Fix code smells 64/119364/2
authorRishi.Chail <rishi.chail@est.tech>
Mon, 15 Mar 2021 14:36:23 +0000 (14:36 +0000)
committerToine Siebelink <toine.siebelink@est.tech>
Thu, 18 Mar 2021 08:56:05 +0000 (08:56 +0000)
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

cps-nf-proxy-rest/src/main/java/org/onap/cps/nfproxy/rest/exceptions/NfProxyRestExceptionHandler.java [changed mode: 0644->0755]
cps-rest/src/main/java/org/onap/cps/rest/exceptions/CpsRestExceptionHandler.java [changed mode: 0644->0755]
cps-ri/src/main/java/org/onap/cps/spi/entities/FragmentEntity.java

old mode 100644 (file)
new mode 100755 (executable)
index ebcb013..ac35e9a
@@ -38,7 +38,7 @@ import org.springframework.web.bind.annotation.RestControllerAdvice;
 @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 @@ public class NfProxyRestExceptionHandler {
         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);
     }
 }
old mode 100644 (file)
new mode 100755 (executable)
index 75a4532..7719417
@@ -42,7 +42,7 @@ import org.springframework.web.bind.annotation.RestControllerAdvice;
     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 @@ public class CpsRestExceptionHandler {
         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);
     }
 }
index 53ceaaa..74f75d1 100755 (executable)
@@ -45,7 +45,6 @@ import lombok.NoArgsConstructor;
 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 @@ import org.hibernate.annotations.TypeDefs;
 @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;