Author: akazakov
Date: 2011-09-22 17:50:43 -0400 (Thu, 22 Sep 2011)
New Revision: 34975
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/MarkerResolutionUtils.java
Log:
Fixed Java Model Exception
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/MarkerResolutionUtils.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/MarkerResolutionUtils.java 2011-09-22
21:50:26 UTC (rev 34974)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/MarkerResolutionUtils.java 2011-09-22
21:50:43 UTC (rev 34975)
@@ -325,22 +325,24 @@
IAnnotation annotation = ((IAnnotatable)element).getAnnotation(qualifiedName);
if (!annotation.exists()) {
annotation = ((IAnnotatable)element).getAnnotation(name);
- }else{
+ } else {
return annotation;
}
- IType type=null;
- if(element instanceof IType){
- type = (IType)element;
- }else if(element instanceof IMember){
- type = ((IMember)element).getDeclaringType();
- }else if(element instanceof ITypeParameter){
- type = ((ITypeParameter)element).getDeclaringMember().getDeclaringType();
- }else if(element instanceof ILocalVariable){
- type = ((ILocalVariable)element).getDeclaringMember().getDeclaringType();
+ if(annotation.exists()) {
+ IType type=null;
+ if(element instanceof IType){
+ type = (IType)element;
+ }else if(element instanceof IMember){
+ type = ((IMember)element).getDeclaringType();
+ }else if(element instanceof ITypeParameter){
+ type = ((ITypeParameter)element).getDeclaringMember().getDeclaringType();
+ }else if(element instanceof ILocalVariable){
+ type = ((ILocalVariable)element).getDeclaringMember().getDeclaringType();
+ }
+ if (type != null && annotation != null &&
qualifiedName.equals(EclipseJavaUtil.resolveType(type, name))) {
+ return annotation;
+ }
}
- if (type != null && annotation != null &&
qualifiedName.equals(EclipseJavaUtil.resolveType(type, name))) {
- return annotation;
- }
}
return null;
}
Show replies by date