summaryrefslogtreecommitdiffstats
path: root/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-sdk
diff options
context:
space:
mode:
Diffstat (limited to 'openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-sdk')
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-sdk/src/main/java/org/openecomp/sdc/validation/util/ValidationUtil.java18
1 files changed, 8 insertions, 10 deletions
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-sdk/src/main/java/org/openecomp/sdc/validation/util/ValidationUtil.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-sdk/src/main/java/org/openecomp/sdc/validation/util/ValidationUtil.java
index 76b4aff1f5..925949bc69 100644
--- a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-sdk/src/main/java/org/openecomp/sdc/validation/util/ValidationUtil.java
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-sdk/src/main/java/org/openecomp/sdc/validation/util/ValidationUtil.java
@@ -38,7 +38,9 @@ import static java.util.Objects.nonNull;
public class ValidationUtil {
private static MdcDataDebugMessage mdcDataDebugMessage = new MdcDataDebugMessage();
- private final static Logger log = (Logger) LoggerFactory.getLogger(ValidationUtil.class.getName());
+ private static final Logger LOG = LoggerFactory.getLogger(ValidationUtil.class.getName());
+
+ private ValidationUtil(){}
public static void removeExposedResourcesCalledByGetResource(String fileName,
Set<String> actualExposedResources,
@@ -64,10 +66,8 @@ public class ValidationUtil {
Map<String, Resource> resourcesMap) {
for (String referencedResourceName : referencedResources) {
Resource currResource = resourcesMap.get(referencedResourceName);
- if (Objects.nonNull(currResource)) {
- if (isExpectedToBeExposed(currResource.getType())) {
+ if (Objects.nonNull(currResource) && isExpectedToBeExposed(currResource.getType())) {
actualExposedResources.add(referencedResourceName);
- }
}
}
}
@@ -89,7 +89,7 @@ public class ValidationUtil {
public static boolean evalPattern(Object paramVal, String[] regexList) {
String value = "";
if (paramVal instanceof String) {
- value = ((String) paramVal);
+ value = (String) paramVal;
}
if (paramVal instanceof Integer) {
value = paramVal.toString();
@@ -140,7 +140,7 @@ public class ValidationUtil {
throw new Exception("The file '" + envFileName + "' has no content");
}
} catch (Exception exception) {
- log.debug("",exception);
+ LOG.debug("",exception);
mdcDataDebugMessage.debugExitMessage("file", envFileName);
return null;
}
@@ -157,8 +157,7 @@ public class ValidationUtil {
mdcDataDebugMessage.debugEntryMessage("file", fileName);
String propertyValue = getWantedNameFromPropertyValueGetParam(nameValue);
- if (nonNull(propertyValue)) {
- if (!evalPattern(propertyValue, regexList)) {
+ if (nonNull(propertyValue) && !evalPattern(propertyValue, regexList)) {
globalContext.addMessage(
fileName,
ErrorLevel.WARNING,
@@ -171,7 +170,6 @@ public class ValidationUtil {
mdcDataDebugMessage.debugExitMessage("file", fileName);
return true;
}
- }
mdcDataDebugMessage.debugExitMessage("file", fileName);
return false;
@@ -189,7 +187,7 @@ public class ValidationUtil {
try {
manifestContent = JsonUtil.json2Object(manifest.get(), ManifestContent.class);
} catch (Exception exception) {
- log.debug("",exception);
+ LOG.debug("",exception);
MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_API,
LoggerTragetServiceName.VALIDATE_MANIFEST_CONTENT, ErrorLevel.ERROR.name(),
LoggerErrorCode.DATA_ERROR.getErrorCode(), LoggerErrorDescription.INVALID_MANIFEST);