Author: scabanovich
Date: 2011-03-31 16:11:36 -0400 (Thu, 31 Mar 2011)
New Revision: 30195
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.solder.core/src/org/jboss/tools/cdi/solder/core/BeanNameFeature.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/plugins/org.jboss.tools.cdi.solder.core/src/org/jboss/tools/cdi/solder/core/BeanNameFeature.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.solder.core/src/org/jboss/tools/cdi/solder/core/BeanNameFeature.java 2011-03-31
20:11:17 UTC (rev 30194)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.solder.core/src/org/jboss/tools/cdi/solder/core/BeanNameFeature.java 2011-03-31
20:11:36 UTC (rev 30195)
@@ -12,14 +12,11 @@
import java.beans.Introspector;
-import org.eclipse.jdt.core.IAnnotation;
import org.eclipse.jdt.core.IMemberValuePair;
-import org.eclipse.jdt.core.JavaModelException;
import org.jboss.tools.cdi.core.CDIConstants;
import org.jboss.tools.cdi.core.CDIUtil;
import org.jboss.tools.cdi.core.IAnnotationDeclaration;
import org.jboss.tools.cdi.core.IBean;
-import org.jboss.tools.cdi.core.ICDIAnnotation;
import org.jboss.tools.cdi.core.IClassBean;
import org.jboss.tools.cdi.core.IProducerField;
import org.jboss.tools.cdi.core.IProducerMethod;
@@ -77,22 +74,18 @@
return null;
}
- private String getStringValue(IAnnotation a) {
+ private String getStringValue(IAnnotationDeclaration a) {
if(a == null) return null;
- try {
- IMemberValuePair[] ps = a.getMemberValuePairs();
- if(ps != null && ps.length > 0 && ps[0].getValue() != null) {
- return ps[0].getValue().toString();
- }
- } catch (JavaModelException e) {
- CDISolderCorePlugin.getDefault().logError(e);
+ IMemberValuePair[] ps = a.getMemberValuePairs();
+ if(ps != null && ps.length > 0 && ps[0].getValue() != null) {
+ return ps[0].getValue().toString();
}
return null;
}
private String resolvePackageName(AnnotationDeclaration fullyQualified,
AnnotationDeclaration fullyQualifiedOnPackage, AbstractTypeDefinition t, PackageDefinition
p) {
String contextClass = null;
- IAnnotation a = fullyQualified != null ? fullyQualified.getDeclaration() :
fullyQualifiedOnPackage.getDeclaration();
+ AnnotationDeclaration a = fullyQualified != null ? fullyQualified :
fullyQualifiedOnPackage;
contextClass = getStringValue(a);
if(contextClass == null) {
contextClass = t == null ? "" : t.getQualifiedName();
@@ -109,7 +102,7 @@
private String getSimpleBeanName(IBean bean, IAnnotationDeclaration named) {
String simpleName = null;
if(named != null) {
- simpleName = getStringValue(named.getDeclaration());
+ simpleName = getStringValue(named);
}
if(simpleName != null && simpleName.length() > 0) {
//do nothing