}
List l = lookup(clazz, resources);
if ( namespace != null ) {
for (Iterator i = l.iterator(); i.hasNext();) {
ResourceInfo resource = (ResourceInfo) i.next();
if (name.equals(resource.getName())) {
NamespaceInfo namespace1 = resource.getNamespace();
if (namespace1 != null && namespace1.equals( namespace )) {
return ModificationProxy.create( (T) resource, clazz );
}
}
}
}
if ( ns == null ) {
// no namespace was specified, so do an exhaustive lookup
List matches = new ArrayList();
for (Iterator i = l.iterator(); i.hasNext();) {
ResourceInfo resource = (ResourceInfo) i.next();
if (name.equals(resource.getName())) {
matches.add( resource );
}
}
if ( matches.size() == 1 ) {