Author: scabanovich
Date: 2011-05-18 14:39:29 -0400 (Wed, 18 May 2011)
New Revision: 31358
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDIUtil.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IJavaAnnotation.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/AbstractMemberDefinition.java
Log:
JBIDE-8674
https://issues.jboss.org/browse/JBIDE-8674
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDIUtil.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDIUtil.java 2011-05-18
15:39:00 UTC (rev 31357)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDIUtil.java 2011-05-18
18:39:29 UTC (rev 31358)
@@ -553,10 +553,10 @@
}
if(sourceType.isInterface()) {
IAnnotation annotation =
sourceType.getAnnotation(CDIConstants.LOCAL_ANNOTATION_TYPE_NAME);
- if (annotation == null || !annotation.exists()) {
+ if (!annotation.exists()) {
annotation = sourceType.getAnnotation("Local"); //$NON-NLS-N1
}
- if (annotation != null &&
CDIConstants.LOCAL_ANNOTATION_TYPE_NAME.equals(EclipseJavaUtil.resolveType(sourceType,
"Local"))) { //$NON-NLS-N1
+ if (annotation.exists() &&
CDIConstants.LOCAL_ANNOTATION_TYPE_NAME.equals(EclipseJavaUtil.resolveType(sourceType,
"Local"))) { //$NON-NLS-N1
sourceTypes.add(sourceType);
}
}
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IJavaAnnotation.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IJavaAnnotation.java 2011-05-18
15:39:00 UTC (rev 31357)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IJavaAnnotation.java 2011-05-18
18:39:29 UTC (rev 31358)
@@ -39,9 +39,9 @@
public String getTypeName();
/**
- * Returns annotation type.
+ * Returns annotation type or null if it cannot be resolved.
*
- * @return annotation type
+ * @return annotation type or null if it cannot be resolved
*/
public IType getType();
/**
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/AbstractMemberDefinition.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/AbstractMemberDefinition.java 2011-05-18
15:39:00 UTC (rev 31357)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/AbstractMemberDefinition.java 2011-05-18
18:39:29 UTC (rev 31358)
@@ -80,13 +80,15 @@
}
public PackageDefinition getPackageDefinition() {
+ PackageDefinition result = null;
AbstractTypeDefinition t = getTypeDefinition();
- if(t == null) return null;
- String qn = t.getQualifiedName();
- if(qn == null) return null;
- int d = qn.lastIndexOf('.');
- String packageName = (d < 0) ? "" : qn.substring(0, d);
- return project.getDefinitions().getPackageDefinition(packageName);
+ if(t != null) {
+ String qn = t.getQualifiedName();
+ int d = qn.lastIndexOf('.');
+ String packageName = (d < 0) ? "" : qn.substring(0, d);
+ result = project.getDefinitions().getPackageDefinition(packageName);
+ }
+ return result;
}
protected void init(IType contextType, IRootDefinitionContext context, int flags) throws
CoreException {