Skip to content

Commit

Permalink
Improved: Rewrite ‘AbstractEngine#getLocation’ (OFBIZ-10809)
Browse files Browse the repository at this point in the history
The AbstractEngine#getLocation method is now documented and rewritten
using a single statement.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1854658 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
mthl committed Mar 2, 2019
1 parent f58f069 commit 9833660
Showing 1 changed file with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,15 @@ protected static Map<String, String> createLocationMap() {
return Collections.unmodifiableMap(tmpMap);
}

// uses the lookup map to determine if the location has been aliased by a service-location element in serviceengine.xml
/**
* Looks for location aliases which are set by {@code service-location} elements
* inside the {@code serviceengine.xml} configuration file.
*
* @param model the object representing a service
* @return the actual location where to find the service implementation
*/
protected String getLocation(ModelService model) {
if (locationMap.containsKey(model.location)) {
return locationMap.get(model.location);
}
return model.location;
return locationMap.getOrDefault(model.location, model.location);
}

@Override
Expand Down

0 comments on commit 9833660

Please sign in to comment.