Add contains check before proceeding to check for envs
@@ -878,12 +878,12 @@ public class DefinitionParserHelper {
}
private static Annotation updateAnnotationEnvs(Annotation annotation) {
+ if (annotation.toString().contains("$")) {
String envPattern = "\\$\\{(\\w+)\\}";
Pattern expr = Pattern.compile(envPattern);
Map<String, String> collection = annotation.getElements().stream()
.collect(Collectors.toMap(Element::getKey, Element::getValue));
- HashMap<String, String> newAnnotationElements = new HashMap<>();
- newAnnotationElements.putAll(collection);
+ HashMap<String, String> newAnnotationElements = new HashMap<>(collection);
Iterator<Map.Entry<String, String>> itr = newAnnotationElements.entrySet().iterator();
while (itr.hasNext()) {
Map.Entry<String, String> entry = itr.next();
@@ -904,6 +904,7 @@ public class DefinitionParserHelper {
property.getValue()))
.collect(Collectors.toList());
annotation.setElements(annotationElements);
+ }
return annotation;
}
