Skip to content
Snippets Groups Projects
Commit 665b28a1 authored by Zhibin Mai's avatar Zhibin Mai
Browse files

Use map getOrDefault method to simplify the codes

parent bd5a73db
No related branches found
No related tags found
1 merge request!601Augmenter performance enhancement
Pipeline #207080 failed
...@@ -195,7 +195,7 @@ public class PropertyConfigurationsServiceImpl implements PropertyConfigurations ...@@ -195,7 +195,7 @@ public class PropertyConfigurationsServiceImpl implements PropertyConfigurations
for (String relatedObjectId : relatedObjectIds) { for (String relatedObjectId : relatedObjectIds) {
String id = PropertyUtil.removeIdPostfix(relatedObjectId); String id = PropertyUtil.removeIdPostfix(relatedObjectId);
Map<String, Object> relatedObject = idObjectDataMap.containsKey(id)? idObjectDataMap.get(id) : null; Map<String, Object> relatedObject = idObjectDataMap.getOrDefault(id, new HashMap<>());
Map<String, Object> propertyValues = getExtendedPropertyValues(extendedPropertyName, relatedObject, path.getValueExtraction(), configuration.isExtractFirstMatch()); Map<String, Object> propertyValues = getExtendedPropertyValues(extendedPropertyName, relatedObject, path.getValueExtraction(), configuration.isExtractFirstMatch());
if (allPropertyValues.isEmpty() && configuration.isExtractFirstMatch()) { if (allPropertyValues.isEmpty() && configuration.isExtractFirstMatch()) {
allPropertyValues = propertyValues; allPropertyValues = propertyValues;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment