Author: dazarov
Date: 2011-07-27 19:34:10 -0400 (Wed, 27 Jul 2011)
New Revision: 33279
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDIValidationErrorManager.java
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/CDIProblemMarkerResolutionGenerator.java
Log:
https://issues.jboss.org/browse/JBIDE-7685
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java 2011-07-27
23:05:30 UTC (rev 33278)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java 2011-07-27
23:34:10 UTC (rev 33279)
@@ -942,11 +942,11 @@
*/
if(bean instanceof IDecorator) {
for (ITextSourceReference declaration : declarations) {
- addError(CDIValidationMessages.OBSERVER_IN_DECORATOR,
CDIPreferences.OBSERVER_IN_INTERCEPTOR_OR_DECORATOR, declaration, bean.getResource());
+ addError(CDIValidationMessages.OBSERVER_IN_DECORATOR,
CDIPreferences.OBSERVER_IN_INTERCEPTOR_OR_DECORATOR, declaration, bean.getResource(),
OBSERVER_IN_DECORATOR_ID);
}
} else if(bean instanceof IInterceptor) {
for (ITextSourceReference declaration : declarations) {
- addError(CDIValidationMessages.OBSERVER_IN_INTERCEPTOR,
CDIPreferences.OBSERVER_IN_INTERCEPTOR_OR_DECORATOR, declaration, bean.getResource());
+ addError(CDIValidationMessages.OBSERVER_IN_INTERCEPTOR,
CDIPreferences.OBSERVER_IN_INTERCEPTOR_OR_DECORATOR, declaration, bean.getResource(),
OBSERVER_IN_INTERCEPTOR_ID);
}
}
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDIValidationErrorManager.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDIValidationErrorManager.java 2011-07-27
23:05:30 UTC (rev 33278)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDIValidationErrorManager.java 2011-07-27
23:34:10 UTC (rev 33279)
@@ -57,6 +57,8 @@
public static final int PRODUCER_PARAMETER_ILLEGALLY_ANNOTATED_DISPOSES_ID = 36;
public static final int PRODUCER_PARAMETER_ILLEGALLY_ANNOTATED_OBSERVES_ID = 37;
public static final int OBSERVER_PARAMETER_ILLEGALLY_ANNOTATED_ID = 38;
+ public static final int OBSERVER_IN_DECORATOR_ID = 39;
+ public static final int OBSERVER_IN_INTERCEPTOR_ID = 40;
/*
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-07-27
23:05:30 UTC (rev 33278)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/CDIProblemMarkerResolutionGenerator.java 2011-07-27
23:34:10 UTC (rev 33279)
@@ -408,6 +408,17 @@
};
}
}
+ }else if(messageId == CDIValidationErrorManager.OBSERVER_IN_DECORATOR_ID ||
+ messageId == CDIValidationErrorManager.OBSERVER_IN_INTERCEPTOR_ID){
+ IJavaElement element = findJavaElement(file, start);
+ if(element != null){
+ IJavaElement observerElement = findJavaElementByAnnotation(element,
CDIConstants.OBSERVERS_ANNOTATION_TYPE_NAME);
+ if(observerElement != null){
+ return new IMarkerResolution[] {
+ new DeleteAnnotationMarkerResolution(observerElement,
CDIConstants.OBSERVERS_ANNOTATION_TYPE_NAME)
+ };
+ }
+ }
}
}
return new IMarkerResolution[] {};