diff options
author | Sonsino, Ofir (os0695) <os0695@intl.att.com> | 2018-11-20 16:59:17 +0200 |
---|---|---|
committer | Ofir Sonsino <ofir.sonsino@intl.att.com> | 2018-11-25 10:48:28 +0000 |
commit | d3ee3a2f05f2c5898f92891527c64ce7b055b34e (patch) | |
tree | 5d3c42c31478f1dd36da2d7f38c7392d3b015d53 | |
parent | 7a55ea6955c0e75fe04c0e1d0af8a346310a75f5 (diff) |
Sonar code smells
Change-Id: Ia43e9d0ff3de1b02d259c5bb05678b4cc6eb8b9b
Issue-ID: SDC-1941
Signed-off-by: Sonsino, Ofir (os0695) <os0695@intl.att.com>
6 files changed, 24 insertions, 27 deletions
diff --git a/openecomp-be/backend/openecomp-sdc-action-manager/src/main/java/org/openecomp/sdc/action/ActionManager.java b/openecomp-be/backend/openecomp-sdc-action-manager/src/main/java/org/openecomp/sdc/action/ActionManager.java index a16d8eb4c2..e5a1b6da43 100644 --- a/openecomp-be/backend/openecomp-sdc-action-manager/src/main/java/org/openecomp/sdc/action/ActionManager.java +++ b/openecomp-be/backend/openecomp-sdc-action-manager/src/main/java/org/openecomp/sdc/action/ActionManager.java @@ -21,7 +21,6 @@ package org.openecomp.sdc.action; -import org.openecomp.sdc.action.errors.ActionException; import org.openecomp.sdc.action.types.Action; import org.openecomp.sdc.action.types.ActionArtifact; import org.openecomp.sdc.action.types.OpenEcompComponent; @@ -33,37 +32,34 @@ import java.util.List; */ public interface ActionManager { - public Action createAction(Action action, String user) throws ActionException; + public Action createAction(Action action, String user); - public Action updateAction(Action action, String user) throws ActionException; + public Action updateAction(Action action, String user); - public void deleteAction(String actionInvariantUuId, String user) throws ActionException; + public void deleteAction(String actionInvariantUuId, String user); - public List<Action> getFilteredActions(String filterType, String filterValue) - throws ActionException; + public List<Action> getFilteredActions(String filterType, String filterValue); - public List<OpenEcompComponent> getOpenEcompComponents() throws ActionException; + public List<OpenEcompComponent> getOpenEcompComponents(); - public List<Action> getActionsByActionInvariantUuId(String invariantId) throws ActionException; + public List<Action> getActionsByActionInvariantUuId(String invariantId); - public Action getActionsByActionUuId(String actionUuId) throws ActionException; + public Action getActionsByActionUuId(String actionUuId); - public Action checkout(String invariantUuId, String user) throws ActionException; + public Action checkout(String invariantUuId, String user); - public void undoCheckout(String invariantUuId, String user) throws ActionException; + public void undoCheckout(String invariantUuId, String user); - public Action checkin(String invariantUuId, String user) throws ActionException; + public Action checkin(String invariantUuId, String user); - public Action submit(String invariantUuId, String user) throws ActionException; + public Action submit(String invariantUuId, String user); public ActionArtifact uploadArtifact(ActionArtifact data, String actionInvariantUuId, String user); - public ActionArtifact downloadArtifact(String actionUuId, String artifactUuId) - throws ActionException; + public ActionArtifact downloadArtifact(String actionUuId, String artifactUuId); - public void deleteArtifact(String actionInvariantUuId, String artifactUuId, String user) - throws ActionException; + public void deleteArtifact(String actionInvariantUuId, String artifactUuId, String user); public void updateArtifact(ActionArtifact data, String actionInvariantUuId, String user); } diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/main/java/org/openecomp/core/utilities/deserializers/RequirementDefinitionDeserializer.java b/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/main/java/org/openecomp/core/utilities/deserializers/RequirementDefinitionDeserializer.java index af3ecb4c08..e6863fa2b5 100644 --- a/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/main/java/org/openecomp/core/utilities/deserializers/RequirementDefinitionDeserializer.java +++ b/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/main/java/org/openecomp/core/utilities/deserializers/RequirementDefinitionDeserializer.java @@ -9,7 +9,6 @@ import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.JsonParseException; import com.google.gson.JsonPrimitive; -import org.onap.sdc.tosca.datatypes.model.RequirementDefinition; import java.lang.reflect.Type; import java.util.Objects; @@ -24,8 +23,7 @@ public class RequirementDefinitionDeserializer implements JsonDeserializer<Requi @Override public RequirementDefinition deserialize(JsonElement jsonElement, Type type, - JsonDeserializationContext jsonDeserializationContext) - throws JsonParseException { + JsonDeserializationContext jsonDeserializationContext) { JsonObject jsonObject = jsonElement.getAsJsonObject(); diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/main/java/org/openecomp/core/utilities/json/JsonSchemaDataGenerator.java b/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/main/java/org/openecomp/core/utilities/json/JsonSchemaDataGenerator.java index 84e4f6d7c9..2db691a781 100644 --- a/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/main/java/org/openecomp/core/utilities/json/JsonSchemaDataGenerator.java +++ b/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/main/java/org/openecomp/core/utilities/json/JsonSchemaDataGenerator.java @@ -32,7 +32,7 @@ public class JsonSchemaDataGenerator { private static final String ROOT = "root"; private static final Logger logger = - (Logger) LoggerFactory.getLogger(JsonSchemaDataGenerator.class); + LoggerFactory.getLogger(JsonSchemaDataGenerator.class); boolean includeDefaults = true; private JSONObject root; private Map<String, Object> referencesData; diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-api/src/main/java/org/openecomp/core/validation/ErrorMessageCode.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-api/src/main/java/org/openecomp/core/validation/ErrorMessageCode.java index a958d27740..e3b6f5fe6f 100644 --- a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-api/src/main/java/org/openecomp/core/validation/ErrorMessageCode.java +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-api/src/main/java/org/openecomp/core/validation/ErrorMessageCode.java @@ -21,8 +21,12 @@ public final class ErrorMessageCode { @Override public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } ErrorMessageCode that = (ErrorMessageCode) o; diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-api/src/main/java/org/openecomp/core/validation/errors/ErrorMessagesFormatBuilder.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-api/src/main/java/org/openecomp/core/validation/errors/ErrorMessagesFormatBuilder.java index 0656b02089..bd5a2ccc3c 100644 --- a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-api/src/main/java/org/openecomp/core/validation/errors/ErrorMessagesFormatBuilder.java +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-api/src/main/java/org/openecomp/core/validation/errors/ErrorMessagesFormatBuilder.java @@ -24,7 +24,7 @@ package org.openecomp.core.validation.errors; import org.openecomp.core.validation.ErrorMessageCode; public class ErrorMessagesFormatBuilder { - private static final String messagePattern = "[%s]: %s"; + private static final String MESSAGE_PATTERN = "[%s]: %s"; public static String getErrorWithParameters(String error, String... params) { return String.format(error, params); @@ -42,7 +42,7 @@ public class ErrorMessagesFormatBuilder { String message = getErrorWithParameters(errorMessage, params); return ( null != messageCode && null != messageCode.getMessageCode() ) ? - String.format(messagePattern, messageCode.getMessageCode(), message) : message; + String.format(MESSAGE_PATTERN, messageCode.getMessageCode(), message) : message; } } diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-api/src/main/java/org/openecomp/core/validation/types/FileValidationContext.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-api/src/main/java/org/openecomp/core/validation/types/FileValidationContext.java index 993ea6b4df..3bc760c805 100644 --- a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-api/src/main/java/org/openecomp/core/validation/types/FileValidationContext.java +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-api/src/main/java/org/openecomp/core/validation/types/FileValidationContext.java @@ -41,8 +41,7 @@ public class FileValidationContext { } public InputStream getContent() { - ByteArrayInputStream is = new ByteArrayInputStream(content); - return is; + return new ByteArrayInputStream(content); } public String getFileName() { |