X-Git-Url: http://wamblee.org/gitweb/?a=blobdiff_plain;f=system%2Fgeneral%2Fsrc%2Fmain%2Fjava%2Forg%2Fwamblee%2Fsystem%2Fcore%2FDefaultScope.java;h=7290a790365eda04712f5ffe5ecd74cc692a2fb4;hb=37050003ad805851e591b66cc3d5933332913fd3;hp=18f26cc8d0a1e8ddaa75a3b88affd2c81422bf5b;hpb=9d8bad3454effe781327c7c4d35c2056cb37ffc4;p=utils diff --git a/system/general/src/main/java/org/wamblee/system/core/DefaultScope.java b/system/general/src/main/java/org/wamblee/system/core/DefaultScope.java index 18f26cc8..7290a790 100644 --- a/system/general/src/main/java/org/wamblee/system/core/DefaultScope.java +++ b/system/general/src/main/java/org/wamblee/system/core/DefaultScope.java @@ -28,7 +28,7 @@ public class DefaultScope implements Scope { private List _parents; private Map _properties; private Map _runtimes; - private Map _provided; + private Map _provided; private ProvidedInterface[] _externallyProvided; public DefaultScope(ProvidedInterface[] aExternallyProvided) { @@ -44,7 +44,7 @@ public class DefaultScope implements Scope { _parents = new ArrayList(aParent); _properties = new HashMap(); _runtimes = new HashMap(); - _provided = new HashMap(); + _provided = new HashMap(); _externallyProvided = aExternallyProvided; } @@ -81,7 +81,7 @@ public class DefaultScope implements Scope { @Override synchronized public void publishInterface(ProvidedInterface aInterface, Object aImplementation) { - _provided.put(aInterface.getUniqueId(), new ProvidedInterfaceImplementation(aInterface, + _provided.put(aInterface, new ProvidedInterfaceImplementation(aInterface, aImplementation)); } @@ -90,13 +90,8 @@ public class DefaultScope implements Scope { Class aType) { if ( aInterface == null ) { return null; - } - String id = aInterface.getUniqueId(); - if ( id == null ) { - // optional interface that was not published. - return null; - } - ProvidedInterfaceImplementation provided = _provided.get(id); + } + ProvidedInterfaceImplementation provided = _provided.get(aInterface); if (provided == null) { for (Scope parent : _parents) { T impl = parent.getInterfaceImplementation(aInterface, aType);