Author: dazarov
Date: 2010-12-10 06:32:50 -0500 (Fri, 10 Dec 2010)
New Revision: 27348
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/CDIProblemMarkerResolutionGenerator.java
Log:
https://issues.jboss.org/browse/JBIDE-7669
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/CDIProblemMarkerResolutionGenerator.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/CDIProblemMarkerResolutionGenerator.java 2010-12-10
09:14:48 UTC (rev 27347)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/CDIProblemMarkerResolutionGenerator.java 2010-12-10
11:32:50 UTC (rev 27348)
@@ -115,6 +115,10 @@
private List<IType> findLocalAnnotattedInterfaces(IMethod method) throws
JavaModelException{
ArrayList<IType> types = new ArrayList<IType>();
+
+ if(method.getTypeParameters().length > 0)
+ return types;
+
IType type = method.getDeclaringType();
String[] is = type.getSuperInterfaceNames();
for(int i = 0; i < is.length; i++){
@@ -122,13 +126,25 @@
IType t = EclipseResourceUtil.getValidType(type.getJavaProject().getProject(), f);
if(t != null && t.isInterface()){
IAnnotation localAnnotation = EclipseJavaUtil.findAnnotation(t, t,
CDIConstants.LOCAL_ANNOTATION_TYPE_NAME);
- if(localAnnotation != null)
+ if(localAnnotation != null){
+ if(isMethodExists(t, method)){
+ types.clear();
+ return types;
+ }
types.add(t);
+ }
}
}
return types;
}
+ private boolean isMethodExists(IType interfaceType, IMethod method){
+ IMethod existingMethod = interfaceType.getMethod(method.getElementName(),
method.getParameterTypes());
+ if(existingMethod != null && existingMethod.exists())
+ return true;
+ return false;
+ }
+
private IField findNonStaticField(IFile file, int start){
try{
ICompilationUnit original = EclipseUtil.getCompilationUnit(file);