Fix sonar issues

Signed-off-by: SirWayne <dennis.melzer@bosch-si.com>
This commit is contained in:
SirWayne
2016-08-05 08:56:38 +02:00
parent a1e939e233
commit 54ce3ad8e0
68 changed files with 341 additions and 290 deletions

View File

@@ -9,7 +9,7 @@
package org.eclipse.hawkbit.rest.exception;
import org.eclipse.hawkbit.exception.SpServerError;
import org.eclipse.hawkbit.exception.SpServerRtException;
import org.eclipse.hawkbit.exception.AbstractServerRtException;
/**
* Exception which is thrown in case an request body is not well formaned and
@@ -19,7 +19,7 @@ import org.eclipse.hawkbit.exception.SpServerRtException;
*
*
*/
public class MessageNotReadableException extends SpServerRtException {
public class MessageNotReadableException extends AbstractServerRtException {
/**
*

View File

@@ -16,7 +16,7 @@ import javax.servlet.http.HttpServletRequest;
import org.apache.commons.lang3.exception.ExceptionUtils;
import org.eclipse.hawkbit.exception.SpServerError;
import org.eclipse.hawkbit.exception.SpServerRtException;
import org.eclipse.hawkbit.exception.AbstractServerRtException;
import org.eclipse.hawkbit.repository.exception.MultiPartFileUploadException;
import org.eclipse.hawkbit.rest.json.model.ExceptionInfo;
import org.slf4j.Logger;
@@ -75,7 +75,7 @@ public class ResponseExceptionHandler {
}
/**
* method for handling exception of type SpServerRtException. Called by the
* method for handling exception of type AbstractServerRtException. Called by the
* Spring-Framework for exception handling.
*
* @param request
@@ -86,14 +86,14 @@ public class ResponseExceptionHandler {
* @return the entity to be responded containing the exception information
* as entity.
*/
@ExceptionHandler(SpServerRtException.class)
@ExceptionHandler(AbstractServerRtException.class)
public ResponseEntity<ExceptionInfo> handleSpServerRtExceptions(final HttpServletRequest request,
final Exception ex) {
logRequest(request, ex);
final ExceptionInfo response = createExceptionInfo(ex);
final HttpStatus responseStatus;
if (ex instanceof SpServerRtException) {
responseStatus = getStatusOrDefault(((SpServerRtException) ex).getError());
if (ex instanceof AbstractServerRtException) {
responseStatus = getStatusOrDefault(((AbstractServerRtException) ex).getError());
} else {
responseStatus = DEFAULT_RESPONSE_STATUS;
}
@@ -152,8 +152,8 @@ public class ResponseExceptionHandler {
final ExceptionInfo response = new ExceptionInfo();
response.setMessage(ex.getMessage());
response.setExceptionClass(ex.getClass().getName());
if (ex instanceof SpServerRtException) {
response.setErrorCode(((SpServerRtException) ex).getError().getKey());
if (ex instanceof AbstractServerRtException) {
response.setErrorCode(((AbstractServerRtException) ex).getError().getKey());
}
return response;

View File

@@ -9,7 +9,7 @@
package org.eclipse.hawkbit.rest.exception;
import org.eclipse.hawkbit.exception.SpServerError;
import org.eclipse.hawkbit.exception.SpServerRtException;
import org.eclipse.hawkbit.exception.AbstractServerRtException;
/**
* Exception used by the REST API in case of invalid sort parameter syntax.
@@ -18,7 +18,7 @@ import org.eclipse.hawkbit.exception.SpServerRtException;
*
*
*/
public class SortParameterSyntaxErrorException extends SpServerRtException {
public class SortParameterSyntaxErrorException extends AbstractServerRtException {
/**
*

View File

@@ -9,7 +9,7 @@
package org.eclipse.hawkbit.rest.exception;
import org.eclipse.hawkbit.exception.SpServerError;
import org.eclipse.hawkbit.exception.SpServerRtException;
import org.eclipse.hawkbit.exception.AbstractServerRtException;
/**
* Exception used by the REST API in case of invalid sort parameter direction
@@ -19,7 +19,7 @@ import org.eclipse.hawkbit.exception.SpServerRtException;
*
*
*/
public class SortParameterUnsupportedDirectionException extends SpServerRtException {
public class SortParameterUnsupportedDirectionException extends AbstractServerRtException {
/**
*

View File

@@ -9,7 +9,7 @@
package org.eclipse.hawkbit.rest.exception;
import org.eclipse.hawkbit.exception.SpServerError;
import org.eclipse.hawkbit.exception.SpServerRtException;
import org.eclipse.hawkbit.exception.AbstractServerRtException;
/**
* Exception used by the REST API in case of invalid field name in the sort
@@ -19,7 +19,7 @@ import org.eclipse.hawkbit.exception.SpServerRtException;
*
*
*/
public class SortParameterUnsupportedFieldException extends SpServerRtException {
public class SortParameterUnsupportedFieldException extends AbstractServerRtException {
/**
*

View File

@@ -9,12 +9,12 @@
package org.eclipse.hawkbit.rest.util;
import org.eclipse.hawkbit.exception.SpServerError;
import org.eclipse.hawkbit.exception.SpServerRtException;
import org.eclipse.hawkbit.exception.AbstractServerRtException;
/**
* Thrown if artifact content streaming to client failed.
*/
public final class FileSteamingFailedException extends SpServerRtException {
public final class FileSteamingFailedException extends AbstractServerRtException {
private static final long serialVersionUID = 1L;