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,
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);
- }
}
}
}
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();
throw new Exception("The file '" + envFileName + "' has no content");
}
} catch (Exception exception) {
- log.debug("",exception);
+ LOG.debug("",exception);
mdcDataDebugMessage.debugExitMessage("file", envFileName);
return null;
}
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,
mdcDataDebugMessage.debugExitMessage("file", fileName);
return true;
}
- }
mdcDataDebugMessage.debugExitMessage("file", fileName);
return false;
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);