Author: scabanovich
Date: 2012-05-22 20:25:01 -0400 (Tue, 22 May 2012)
New Revision: 41269
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/AnnotationDeclaration.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/AnnotationDefinition.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/MethodDefinition.java
Log:
JBIDE-11552
https://issues.jboss.org/browse/JBIDE-11552
Nonbinding members are added for annotation types used by CDI extensions.
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/AnnotationDeclaration.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/AnnotationDeclaration.java 2012-05-22
23:16:42 UTC (rev 41268)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/AnnotationDeclaration.java 2012-05-23
00:25:01 UTC (rev 41269)
@@ -11,6 +11,8 @@
package org.jboss.tools.cdi.internal.core.impl;
import org.jboss.tools.cdi.core.CDICoreNature;
+import org.jboss.tools.cdi.internal.core.impl.definition.AnnotationDefinition;
+import org.jboss.tools.common.java.IAnnotationType;
/**
*
@@ -35,4 +37,16 @@
this.project = project;
}
+ public IAnnotationType getAnnotation() {
+ AnnotationDefinition def = project.getDefinitions().getAnnotation(getTypeName());
+ if(def != null && def.getKind() == AnnotationDefinition.EXTENDED) {
+ CDIAnnotationElement result = new CDIAnnotationElement();
+ result.setParent((CDIElement)project.getDelegate());
+ result.setDefinition(def);
+ result.setSourcePath(def.getType().getPath());
+ return result;
+ }
+ return null;
+ }
+
}
\ No newline at end of file
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/AnnotationDefinition.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/AnnotationDefinition.java 2012-05-22
23:16:42 UTC (rev 41268)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/AnnotationDefinition.java 2012-05-23
00:25:01 UTC (rev 41269)
@@ -82,7 +82,7 @@
}
public void revalidateKind(IRootDefinitionContext context) {
- boolean hasMembers = (kind & QUALIFIER) > 0 || (kind & INTERCEPTOR_BINDING)
> 0;
+ boolean hasMembers = (kind & QUALIFIER) > 0 || (kind & INTERCEPTOR_BINDING)
> 0 || kind == EXTENDED;
kind = NON_RELEVANT;
Map<String, AnnotationDeclaration> ds = new HashMap<String,
AnnotationDeclaration>();
@@ -123,7 +123,7 @@
}
}
- boolean newHasMembers = (kind & QUALIFIER) > 0 || (kind &
INTERCEPTOR_BINDING) > 0;
+ boolean newHasMembers = (kind & QUALIFIER) > 0 || (kind &
INTERCEPTOR_BINDING) > 0 || kind == EXTENDED;
if(newHasMembers != hasMembers) {
methods.clear();
try {
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/MethodDefinition.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/MethodDefinition.java 2012-05-22
23:16:42 UTC (rev 41268)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/MethodDefinition.java 2012-05-23
00:25:01 UTC (rev 41269)
@@ -25,6 +25,7 @@
import org.jboss.tools.cdi.core.IInterceptorBindingDeclaration;
import org.jboss.tools.cdi.core.IRootDefinitionContext;
import org.jboss.tools.cdi.core.IStereotypeDeclaration;
+import org.jboss.tools.cdi.core.extension.feature.IProcessAnnotatedMemberFeature;
import org.jboss.tools.cdi.internal.core.impl.AnnotationDeclaration;
import org.jboss.tools.cdi.internal.core.impl.ClassBean;
import org.jboss.tools.common.java.IAnnotationDeclaration;
@@ -76,12 +77,17 @@
if(ps.length == 0) return;
if(contextType == null) return;
+ Set<IProcessAnnotatedMemberFeature> extensions =
context.getProject().getExtensionManager().getProcessAnnotatedMemberFeatures();
+
ParameterDefinition[] ds = new ParameterDefinition[ps.length];
for (int i = 0; i < ps.length; i++) {
ParameterDefinition pd = new ParameterDefinition();
pd.setMethodDefinition(this);
pd.index = i;
pd.setLocalVariable(ps[i], context, flags);
+ for (IProcessAnnotatedMemberFeature e: extensions) {
+ e.processAnnotatedMember(pd, context);
+ }
if(pd.isAnnotationPresent(CDIConstants.OBSERVERS_ANNOTATION_TYPE_NAME)
|| pd.isAnnotationPresent(CDIConstants.DISPOSES_ANNOTATION_TYPE_NAME)) {
parametersAreInjectionPoints = true;