[jbosstools-commits] JBoss Tools SVN: r35493 - trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker.
jbosstools-commits at lists.jboss.org
jbosstools-commits at lists.jboss.org
Fri Oct 7 19:14:47 EDT 2011
Author: dazarov
Date: 2011-10-07 19:14:46 -0400 (Fri, 07 Oct 2011)
New Revision: 35493
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/CDIProblemMarkerResolutionGenerator.java
Log:
Quick fixes for problem markers in beans.xml https://issues.jboss.org/browse/JBIDE-9833
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 2011-10-07 22:53:14 UTC (rev 35492)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/CDIProblemMarkerResolutionGenerator.java 2011-10-07 23:14:46 UTC (rev 35493)
@@ -501,13 +501,19 @@
}
if(messageId == CDIValidationErrorManager.UNKNOWN_ALTERNATIVE_BEAN_CLASS_NAME_ID){
- return new IMarkerResolution[] {
- new CreateCDIElementMarkerResolution(file.getProject(), text, CreateCDIElementMarkerResolution.CREATE_BEAN_CLASS)
- };
+ IJavaElement element = findJavaElementByQualifiedName(file.getProject(), text);
+ if(element == null){
+ return new IMarkerResolution[] {
+ new CreateCDIElementMarkerResolution(file.getProject(), text, CreateCDIElementMarkerResolution.CREATE_BEAN_CLASS)
+ };
+ }
}else if(messageId == CDIValidationErrorManager.UNKNOWN_ALTERNATIVE_ANNOTATION_NAME_ID){
- return new IMarkerResolution[] {
- new CreateCDIElementMarkerResolution(file.getProject(), text, CreateCDIElementMarkerResolution.CREATE_STEREOTYPE)
- };
+ IJavaElement element = findJavaElementByQualifiedName(file.getProject(), text);
+ if(element == null){
+ return new IMarkerResolution[] {
+ new CreateCDIElementMarkerResolution(file.getProject(), text, CreateCDIElementMarkerResolution.CREATE_STEREOTYPE)
+ };
+ }
}else if(messageId == CDIValidationErrorManager.ILLEGAL_ALTERNATIVE_BEAN_CLASS_ID){
IJavaElement element = findJavaElementByQualifiedName(file.getProject(), text);
if(element != null){
@@ -523,13 +529,19 @@
};
}
}else if(messageId == CDIValidationErrorManager.UNKNOWN_DECORATOR_BEAN_CLASS_NAME_ID){
- return new IMarkerResolution[] {
- new CreateCDIElementMarkerResolution(file.getProject(), text, CreateCDIElementMarkerResolution.CREATE_DECORATOR)
- };
+ IJavaElement element = findJavaElementByQualifiedName(file.getProject(), text);
+ if(element == null){
+ return new IMarkerResolution[] {
+ new CreateCDIElementMarkerResolution(file.getProject(), text, CreateCDIElementMarkerResolution.CREATE_DECORATOR)
+ };
+ }
}else if(messageId == CDIValidationErrorManager.UNKNOWN_INTERCEPTOR_CLASS_NAME_ID){
- return new IMarkerResolution[] {
- new CreateCDIElementMarkerResolution(file.getProject(), text, CreateCDIElementMarkerResolution.CREATE_INTERCEPTOR)
- };
+ IJavaElement element = findJavaElementByQualifiedName(file.getProject(), text);
+ if(element == null){
+ return new IMarkerResolution[] {
+ new CreateCDIElementMarkerResolution(file.getProject(), text, CreateCDIElementMarkerResolution.CREATE_INTERCEPTOR)
+ };
+ }
}
}
return new IMarkerResolution[] {};
More information about the jbosstools-commits
mailing list