Object (final String name, Namespace uri) { final Map<String, Object> vmap = xvariables.get(uri == null ? "" : uri.getURI()); if (vmap == null) { throw new IllegalArgumentException("Variable with name '" + name + "' in namespace '" + uri.getURI() + "' has not been declared."); } final Object ret = vmap.get(name); if (ret == null) { if (!vmap.containsKey(name)) { throw new IllegalArgumentException("Variable with name '" + name + "' in namespace '" + uri.getURI() + "' has not been declared."); } // leave translating null variable values to the implementation. return null; } return ret; }