Author: scabanovich
Date: 2011-04-08 15:08:29 -0400 (Fri, 08 Apr 2011)
New Revision: 30442
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/PackageDefinition.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/scanner/CDIBuilderDelegate.java
Log:
JBIDE-8199
https://issues.jboss.org/browse/JBIDE-8199
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/PackageDefinition.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/PackageDefinition.java 2011-04-08
19:02:43 UTC (rev 30441)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/PackageDefinition.java 2011-04-08
19:08:29 UTC (rev 30442)
@@ -24,6 +24,7 @@
*
*/
public class PackageDefinition extends AbstractMemberDefinition {
+ IType binaryType = null;
protected String qualifiedName;
public PackageDefinition() {}
@@ -32,6 +33,12 @@
return qualifiedName;
}
+ public void setBinaryType(IType pkg, IRootDefinitionContext context) {
+ binaryType = pkg;
+ setAnnotatable(pkg, pkg, context);
+ qualifiedName = pkg.getPackageFragment().getElementName();
+ }
+
public void setPackage(IPackageDeclaration pkg, IRootDefinitionContext context) {
qualifiedName = pkg.getElementName();
IType contextType = null;
@@ -55,6 +62,9 @@
}
public String resolveType(String typeName) {
+ if(binaryType != null) {
+ return typeName;
+ }
String result = typeName;
IPackageDeclaration pkg = (IPackageDeclaration)member;
IType contextType = null;
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/scanner/CDIBuilderDelegate.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/scanner/CDIBuilderDelegate.java 2011-04-08
19:02:43 UTC (rev 30441)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/scanner/CDIBuilderDelegate.java 2011-04-08
19:08:29 UTC (rev 30442)
@@ -47,7 +47,16 @@
Map<IPath, Set<IType>> is = fileSet.getInterfaces();
for (IPath f: is.keySet()) {
- //TODO
+ Set<IType> ts = is.get(f);
+ for (IType type: ts) {
+ // Jars present package-info as binary interface
+ // whereas sources present it as compilation unit with package declaration.
+ if(type.getElementName().equals("package-info")) {
+ PackageDefinition def = new PackageDefinition();
+ def.setBinaryType(type, context);
+ context.addPackage(f, def.getQualifiedName(), def);
+ }
+ }
}
Map<IPath, Set<IType>> cs = fileSet.getClasses();