Author: akazakov
Date: 2010-05-26 16:28:35 -0400 (Wed, 26 May 2010)
New Revision: 22343
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/errorList.txt
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/ValidationTest.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2708
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-05-26
20:21:57 UTC (rev 22342)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java 2010-05-26
20:28:35 UTC (rev 22343)
@@ -866,14 +866,19 @@
}
}
+ IInjectionPointMethod injectionMethod = (IInjectionPointMethod)injection;
+ IAnnotationDeclaration declaration = injection.getInjectAnnotation();
/*
- *
+ * 3.9.1. Declaring an initializer method
+ * - generic method of a bean is annotated @Inject
*/
- IInjectionPointMethod injectionMethod = (IInjectionPointMethod)injection;
- IAnnotationDeclaration declaration = injection.getInjectAnnotation();
if(CDIUtil.isMethodGeneric(injectionMethod)) {
addError(CDIValidationMessages.GENERIC_METHOD_ANNOTATED_INJECT,
CDIPreferences.GENERIC_METHOD_ANNOTATED_INJECT, declaration, injection.getResource());
}
+ /*
+ * 3.9. Initializer methods
+ * - initializer method may not be static
+ */
if(CDIUtil.isMethodStatic(injectionMethod)) {
addError(CDIValidationMessages.STATIC_METHOD_ANNOTATED_INJECT,
CDIPreferences.GENERIC_METHOD_ANNOTATED_INJECT, declaration, injection.getResource());
}
@@ -881,8 +886,7 @@
}
/**
- * Validates class bean which may be both a session and decorator (or
- * interceptor).
+ * Validates class bean which may be both a session and decorator (or interceptor).
*
* @param bean
*/
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/errorList.txt
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/errorList.txt 2010-05-26
20:21:57 UTC (rev 22342)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/errorList.txt 2010-05-26
20:28:35 UTC (rev 22343)
@@ -109,9 +109,6 @@
3.8.1. Declaring an injected field
- injected field is annotated @Produces
-
-
-
3.9.1. Declaring an initializer method
- generic method of a bean is annotated @Inject (initializer method is a non-abstract,
non-static, non-generic method of a bean class)
@@ -120,6 +117,10 @@
- injection point other than injected field declares a @Named annotation that
does not specify the value member
+
+
+
+
4.3.1. Direct and indirect specialization
- X specializes Y but does not have some bean type of Y
- X specializes Y and Y has a name and X declares a name explicitly, using @Named
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/ValidationTest.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/ValidationTest.java 2010-05-26
20:21:57 UTC (rev 22342)
+++
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/ValidationTest.java 2010-05-26
20:28:35 UTC (rev 22343)
@@ -793,6 +793,17 @@
}
/**
+ * 3.9. Initializer methods
+ * - initializer method may not be static
+ *
+ * @throws Exception
+ */
+ public void testStaticInitializerMethod() throws Exception {
+ IFile file =
tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/inject/GenericInitializerMethodBroken.java");
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file,
AbstractResourceMarkerTest.MARKER_TYPE,
CDIValidationMessages.STATIC_METHOD_ANNOTATED_INJECT, 11);
+ }
+
+ /**
* 3.9.1. Declaring an initializer method
* - an initializer method has a parameter annotated @Disposes
*
@@ -805,17 +816,6 @@
}
/**
- * 3.9. Initializer methods
- * - initializer method may not be static
- *
- * @throws Exception
- */
- public void testStaticInitializerMethod() throws Exception {
- IFile file =
tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/inject/GenericInitializerMethodBroken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file,
AbstractResourceMarkerTest.MARKER_TYPE,
CDIValidationMessages.STATIC_METHOD_ANNOTATED_INJECT, 11);
- }
-
- /**
* 3.9.1. Declaring an initializer method
* - generic method of a bean is annotated @Inject
*