Author: scabanovich
Date: 2012-03-22 19:14:53 -0400 (Thu, 22 Mar 2012)
New Revision: 39781
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/ConfigDefinitionContext.java
Log:
JBIDE-11386
https://issues.jboss.org/browse/JBIDE-11386
Fixed getting path from annotation declaration object; if annotation type is located in an
external jar then getResource() returns null.
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/ConfigDefinitionContext.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/ConfigDefinitionContext.java 2012-03-22
22:41:41 UTC (rev 39780)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/ConfigDefinitionContext.java 2012-03-22
23:14:53 UTC (rev 39781)
@@ -146,10 +146,14 @@
}
public void addAnnotation(String typeName, AnnotationDefinition def) {
- IPath path = def.getResource().getFullPath();
// root.clean(typeName);
annotations.put(typeName, def);
- ((DefinitionContext)root).addType(path, typeName, def);
+ IPath path = def.getResource() != null ? def.getResource().getFullPath()
+ : def.getType() != null ? def.getType().getPath()
+ : null;
+ if(path != null) {
+ ((DefinitionContext)root).addType(path, typeName, def);
+ }
}
public List<TypeDefinition> getTypeDefinitions() {