Fix code smells
1. removed typedefs annotation
2. chnaged final string constant name
Issue-ID: CPS-89
Signed-off-by: Rishi.Chail <rishi.chail@est.tech>
Change-Id: I524aa8c13e8bb4c6a00d810c6e89b30a48f37d10
diff --git a/cps-nf-proxy-rest/src/main/java/org/onap/cps/nfproxy/rest/exceptions/NfProxyRestExceptionHandler.java b/cps-nf-proxy-rest/src/main/java/org/onap/cps/nfproxy/rest/exceptions/NfProxyRestExceptionHandler.java
old mode 100644
new mode 100755
index ebcb013..ac35e9a
--- a/cps-nf-proxy-rest/src/main/java/org/onap/cps/nfproxy/rest/exceptions/NfProxyRestExceptionHandler.java
+++ b/cps-nf-proxy-rest/src/main/java/org/onap/cps/nfproxy/rest/exceptions/NfProxyRestExceptionHandler.java
@@ -38,7 +38,7 @@
@RestControllerAdvice(assignableTypes = {NfProxyController.class})
public class NfProxyRestExceptionHandler {
- private static final String checkLogsForDetails = "Check logs for details.";
+ private static final String CHECK_LOGS_FOR_DETAILS = "Check logs for details.";
/**
* Default exception handler.
@@ -65,7 +65,7 @@
errorMessage.setStatus(status.toString());
errorMessage.setMessage(exception.getMessage());
errorMessage.setDetails(exception instanceof CpsException ? ((CpsException) exception).getDetails() :
- checkLogsForDetails);
+ CHECK_LOGS_FOR_DETAILS);
return new ResponseEntity<>(errorMessage, status);
}
}
diff --git a/cps-rest/src/main/java/org/onap/cps/rest/exceptions/CpsRestExceptionHandler.java b/cps-rest/src/main/java/org/onap/cps/rest/exceptions/CpsRestExceptionHandler.java
old mode 100644
new mode 100755
index 75a4532..7719417
--- a/cps-rest/src/main/java/org/onap/cps/rest/exceptions/CpsRestExceptionHandler.java
+++ b/cps-rest/src/main/java/org/onap/cps/rest/exceptions/CpsRestExceptionHandler.java
@@ -42,7 +42,7 @@
QueryRestController.class})
public class CpsRestExceptionHandler {
- private static final String checkLogsForDetails = "Check logs for details.";
+ private static final String CHECK_LOGS_FOR_DETAILS = "Check logs for details.";
private CpsRestExceptionHandler() {
}
@@ -88,7 +88,7 @@
errorMessage.setStatus(status.toString());
errorMessage.setMessage(exception.getMessage());
errorMessage.setDetails(exception instanceof CpsException ? ((CpsException) exception).getDetails() :
- checkLogsForDetails);
+ CHECK_LOGS_FOR_DETAILS);
return new ResponseEntity<>(errorMessage, status);
}
}
diff --git a/cps-ri/src/main/java/org/onap/cps/spi/entities/FragmentEntity.java b/cps-ri/src/main/java/org/onap/cps/spi/entities/FragmentEntity.java
index 53ceaaa..74f75d1 100755
--- a/cps-ri/src/main/java/org/onap/cps/spi/entities/FragmentEntity.java
+++ b/cps-ri/src/main/java/org/onap/cps/spi/entities/FragmentEntity.java
@@ -45,7 +45,6 @@
import lombok.Setter;
import org.hibernate.annotations.Type;
import org.hibernate.annotations.TypeDef;
-import org.hibernate.annotations.TypeDefs;
/**
* Entity to store a fragment.
@@ -58,7 +57,7 @@
@Builder
@Entity
@Table(name = "fragment")
-@TypeDefs({@TypeDef(name = "jsonb", typeClass = JsonBinaryType.class)})
+@TypeDef(name = "jsonb", typeClass = JsonBinaryType.class)
public class FragmentEntity implements Serializable {
private static final long serialVersionUID = 7737669789097119667L;