Skip to content
Permalink
Browse files

Improved: Rewrite ‘AbstractEngine#getLocation’ (OFBIZ-10809)

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 98336606628afb15aef942c53e199986ea4d75ea
@@ -65,12 +65,15 @@ protected AbstractEngine(ServiceDispatcher dispatcher) {
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

0 comments on commit 9833660

Please sign in to comment.
You can’t perform that action at this time.