Author: scabanovich
Date: 2011-03-31 16:11:17 -0400 (Thu, 31 Mar 2011)
New Revision: 30194
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/InterceptorDefinitionTest.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/TCKTest.java
Log:
JBIDE-3120
https://issues.jboss.org/browse/JBIDE-3120
Removed org.eclipse.jdt.core.IAnnotation from CDI interfaces.
IAnnotationDeclaration implementation should handle it or work without it when annotation
info is provided by non-java sources.
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/InterceptorDefinitionTest.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/InterceptorDefinitionTest.java 2011-03-31
20:10:12 UTC (rev 30193)
+++
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/InterceptorDefinitionTest.java 2011-03-31
20:11:17 UTC (rev 30194)
@@ -11,12 +11,12 @@
package org.jboss.tools.cdi.core.test.tck;
+
import java.util.HashSet;
import java.util.Set;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jdt.core.IAnnotation;
import org.eclipse.jdt.core.IMemberValuePair;
import org.eclipse.jdt.core.JavaModelException;
import org.jboss.tools.cdi.core.IBean;
@@ -126,8 +126,7 @@
void assertContainsBindingDeclarationWithValue(Set<IInterceptorBindingDeclaration>
bs, String className, String value) throws JavaModelException {
for (IInterceptorBindingDeclaration b: bs) {
if(className.equals(b.getInterceptorBinding().getSourceType().getFullyQualifiedName()))
{
- IAnnotation a = b.getDeclaration();
- IMemberValuePair[] ps = a.getMemberValuePairs();
+ IMemberValuePair[] ps = b.getMemberValuePairs();
for (IMemberValuePair p: ps) {
if(p.getMemberName().equals("value")) {
assertEquals(value, p.getValue());
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/TCKTest.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/TCKTest.java 2011-03-31
20:10:12 UTC (rev 30193)
+++
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/TCKTest.java 2011-03-31
20:11:17 UTC (rev 30194)
@@ -17,6 +17,7 @@
import org.eclipse.core.runtime.Platform;
import org.eclipse.jdt.core.IAnnotation;
import org.eclipse.jdt.core.IMember;
+import org.eclipse.jdt.core.IMemberValuePair;
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.JavaModelException;
import org.jboss.tools.cdi.core.CDICorePlugin;
@@ -159,8 +160,7 @@
Set<IQualifierDeclaration> declarations = bean.getQualifierDeclarations();
IParametedType type = getType(annotationTypeName);
for (IQualifierDeclaration declaration : declarations) {
- IAnnotation annotation = declaration.getDeclaration();
- if(type.getType().getElementName().equals(annotation.getElementName())) {
+ if(declaration.getType() != null &&
type.getType().getElementName().equals(declaration.getType().getElementName())) {
return declaration;
}
}
@@ -200,6 +200,17 @@
public ICDIAnnotation getAnnotation() {
return null;
}
+
+ public IMemberValuePair[] getMemberValuePairs() {
+ if(annotation != null) {
+ try {
+ return annotation.getMemberValuePairs();
+ } catch (JavaModelException e) {
+ CDICorePlugin.getDefault().logError(e);
+ }
+ }
+ return new IMemberValuePair[0];
+ }
};
return annotationDeclaration;
}