Author: dazarov
Date: 2010-12-11 11:05:47 -0500 (Sat, 11 Dec 2010)
New Revision: 27381
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
Log:
https://issues.jboss.org/browse/JBIDE-7672
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 2010-12-11
15:50:28 UTC (rev 27380)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java 2010-12-11
16:05:47 UTC (rev 27381)
@@ -825,7 +825,7 @@
}
}
- validateSessionBeanMethod(bean, observer, declarations,
CDIValidationMessages.ILLEGAL_OBSERVER_IN_SESSION_BEAN, CDIPreferences.ILLEGAL_OBSERVER_IN_SESSION_BEAN);
+ validateSessionBeanMethod(bean, observer, declarations,
CDIValidationMessages.ILLEGAL_OBSERVER_IN_SESSION_BEAN, CDIPreferences.ILLEGAL_OBSERVER_IN_SESSION_BEAN,
ILLEGAL_OBSERVER_IN_SESSION_BEAN_ID);
}
}
@@ -929,7 +929,7 @@
* - a non-static method of a session bean class has a parameter annotated @Disposes,
and the method is not a business method of the session bean
*/
validateSessionBeanMethod(bean, disposer, disposerDeclarations,
CDIValidationMessages.ILLEGAL_DISPOSER_IN_SESSION_BEAN,
- CDIPreferences.ILLEGAL_DISPOSER_IN_SESSION_BEAN);
+ CDIPreferences.ILLEGAL_DISPOSER_IN_SESSION_BEAN,
ILLEGAL_DISPOSER_IN_SESSION_BEAN_ID);
/*
* 3.3.6. Declaring a disposer method
@@ -989,14 +989,14 @@
* @param annotatedParams
* @param errorKey
*/
- private void validateSessionBeanMethod(IClassBean bean, IBeanMethod method,
Set<ITextSourceReference> annotatedParams, String errorMessage, String
preferencesKey) {
+ private void validateSessionBeanMethod(IClassBean bean, IBeanMethod method,
Set<ITextSourceReference> annotatedParams, String errorMessage, String
preferencesKey, int id) {
if (bean instanceof ISessionBean && annotatedParams != null) {
IMethod iMethod = CDIUtil.getBusinessMethodDeclaration((SessionBean)bean, method);
if(iMethod==null) {
saveAllSuperTypesAsLinkedResources(bean);
for (ITextSourceReference declaration : annotatedParams) {
String bindedErrorMessage = NLS.bind(errorMessage, new
String[]{method.getMethod().getElementName(), bean.getBeanClass().getElementName()});
- addError(bindedErrorMessage, preferencesKey, declaration, bean.getResource());
+ addError(bindedErrorMessage, preferencesKey, declaration, bean.getResource(), id);
}
} else if (iMethod != method.getMethod()) {
getValidationContext().addLinkedCoreResource(bean.getSourcePath().toOSString(),
iMethod.getResource().getFullPath(), false);
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 2010-12-11
15:50:28 UTC (rev 27380)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDIValidationErrorManager.java 2010-12-11
16:05:47 UTC (rev 27381)
@@ -20,6 +20,8 @@
public static final int ILLEGAL_PRODUCER_FIELD_IN_SESSION_BEAN_ID = 1;
public static final int ILLEGAL_PRODUCER_METHOD_IN_SESSION_BEAN_ID = 2;
+ public static final int ILLEGAL_DISPOSER_IN_SESSION_BEAN_ID = 3;
+ public static final int ILLEGAL_OBSERVER_IN_SESSION_BEAN_ID = 4;
/*
* (non-Javadoc)