Skip to content

Commit

Permalink
WBRI-154
Browse files Browse the repository at this point in the history
git-svn-id: http://anonsvn.jboss.org/repos/weld/ri/trunk@1800 1c488680-804c-0410-94cd-c6b725194a0e
  • Loading branch information
pmuir committed Mar 6, 2009
1 parent 89e2201 commit 2ba430e
Showing 1 changed file with 7 additions and 2 deletions.
Expand Up @@ -9,6 +9,7 @@
import java.util.List;
import java.util.Map;

import javax.inject.DefinitionException;
import javax.inject.DeploymentException;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
Expand Down Expand Up @@ -174,7 +175,7 @@ else if (deployElements.size() == 1)
{
if (child instanceof Element)
{
String className = getAsClassName(child.getNodeName(), deployElement.getNamespaces());
String className = getAsClassName(child.getNodeName(), deployElement.getNamespaces(), deployElement.getFile());
if (className != null)
{
enabledDeploymentTypes.add(resourceLoader.classForName(className).asSubclass(Annotation.class));
Expand All @@ -184,7 +185,7 @@ else if (deployElements.size() == 1)
}
}

private static String getAsClassName(String nodeName, Map<String, String> namespaces)
private static String getAsClassName(String nodeName, Map<String, String> namespaces, URL file)
{
String namespacePrefix;
String simpleClassName;
Expand All @@ -199,6 +200,10 @@ private static String getAsClassName(String nodeName, Map<String, String> namesp
simpleClassName = nodeName;
}
String namespace = namespaces.get(namespacePrefix);
if (namespace == null)
{
throw new DefinitionException("Prefix " + namespacePrefix + " has no namespace mapped in " + file.getPath());
}
String packageName;
if (namespace.startsWith("urn:java:ee"))
{
Expand Down

0 comments on commit 2ba430e

Please sign in to comment.