Author: dazarov
Date: 2011-07-27 13:30:08 -0400 (Wed, 27 Jul 2011)
New Revision: 33262
Added:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestDecorator2.qfxresult
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestDecorator3.qfxresult
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestInterceptor4.qfxresult
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestInterceptor5.qfxresult
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestStereotype6.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestStereotype6.qfxresult
Removed:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestDecorator2.qfxresult
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestDecorator3.qfxresult
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestInterceptor4.qfxresult
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestInterceptor5.qfxresult
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
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/MarkerResolutionUtils.java
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/marker/CDIMarkerResolutionTest.java
Log:
https://issues.jboss.org/browse/JBIDE-7640
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
17:28:53 UTC (rev 33261)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java 2011-07-27
17:30:08 UTC (rev 33262)
@@ -2279,7 +2279,7 @@
IAnnotationDeclaration typedDeclaration =
stereotype.getAnnotationDeclaration(CDIConstants.TYPED_ANNOTATION_TYPE_NAME);
if (typedDeclaration != null) {
ITextSourceReference location = typedDeclaration;
- addError(CDIValidationMessages.STEREOTYPE_IS_ANNOTATED_TYPED,
CDIPreferences.STEREOTYPE_IS_ANNOTATED_TYPED, location, resource);
+ addError(CDIValidationMessages.STEREOTYPE_IS_ANNOTATED_TYPED,
CDIPreferences.STEREOTYPE_IS_ANNOTATED_TYPED, location, resource,
STEREOTYPE_IS_ANNOTATED_TYPED_ID);
}
// 3. Qualifier other than @Named
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
17:28:53 UTC (rev 33261)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDIValidationErrorManager.java 2011-07-27
17:30:08 UTC (rev 33262)
@@ -51,6 +51,7 @@
public static final int STEREOTYPE_DECLARES_NON_EMPTY_NAME_ID = 30;
public static final int INTERCEPTOR_HAS_NAME_ID = 31;
public static final int DECORATOR_HAS_NAME_ID = 32;
+ public static final int STEREOTYPE_IS_ANNOTATED_TYPED_ID = 33;
/*
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
17:28:53 UTC (rev 33261)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/CDIProblemMarkerResolutionGenerator.java 2011-07-27
17:30:08 UTC (rev 33262)
@@ -357,6 +357,13 @@
new DeleteAnnotationMarkerResolution(ta.type,
CDIConstants.NAMED_QUALIFIER_TYPE_NAME)
};
}
+ }else if(messageId == CDIValidationErrorManager.STEREOTYPE_IS_ANNOTATED_TYPED_ID){
+ TypeAndAnnotation ta = findTypeAndAnnotation(file, start,
CDIConstants.TYPED_ANNOTATION_TYPE_NAME);
+ if(ta != null && ta.annotation != null && ta.type != null){
+ return new IMarkerResolution[] {
+ new DeleteAnnotationMarkerResolution(ta.type,
CDIConstants.TYPED_ANNOTATION_TYPE_NAME)
+ };
+ }
}
}
return new IMarkerResolution[] {};
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/MarkerResolutionUtils.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/MarkerResolutionUtils.java 2011-07-27
17:28:53 UTC (rev 33261)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/MarkerResolutionUtils.java 2011-07-27
17:30:08 UTC (rev 33262)
@@ -546,7 +546,7 @@
int numberOfSpaces = 0;
if(position < buffer.getLength()-1){
char c = buffer.getChar(position);
- while(c == ' ' && position < buffer.getLength()-1){
+ while((c == ' ' || c == '\t' || c == '\n' || c ==
'\r') && position < buffer.getLength()-1){
numberOfSpaces++;
position++;
c = buffer.getChar(position);
Deleted:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestDecorator2.qfxresult
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestDecorator2.qfxresult 2011-07-27
17:28:53 UTC (rev 33261)
+++
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestDecorator2.qfxresult 2011-07-27
17:30:08 UTC (rev 33262)
@@ -1,15 +0,0 @@
-package org.jboss.jsr299.tck.tests.jbt.quickfixes;
-
-import javax.decorator.Decorator;
-import javax.decorator.Delegate;
-import javax.inject.Inject;
-
-@Decorator
-public class TestDecorator2 {
- @Inject @Delegate @AAnnotation String str;
-
-
- public String produce(){
- return "a";
- }
-}
Added:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestDecorator2.qfxresult
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestDecorator2.qfxresult
(rev 0)
+++
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestDecorator2.qfxresult 2011-07-27
17:30:08 UTC (rev 33262)
@@ -0,0 +1,14 @@
+package org.jboss.jsr299.tck.tests.jbt.quickfixes;
+
+import javax.decorator.Decorator;
+import javax.decorator.Delegate;
+import javax.inject.Inject;
+
+@Decorator
+public class TestDecorator2 {
+ @Inject @Delegate @AAnnotation String str;
+
+ public String produce(){
+ return "a";
+ }
+}
Deleted:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestDecorator3.qfxresult
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestDecorator3.qfxresult 2011-07-27
17:28:53 UTC (rev 33261)
+++
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestDecorator3.qfxresult 2011-07-27
17:30:08 UTC (rev 33262)
@@ -1,16 +0,0 @@
-package org.jboss.jsr299.tck.tests.jbt.quickfixes;
-
-import javax.decorator.Decorator;
-import javax.decorator.Delegate;
-import javax.inject.Inject;
-
-@Decorator
-
-public class TestDecorator3 {
- @Inject @Delegate @AAnnotation String str;
-
-
- public String produce(){
- return str;
- }
-}
Added:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestDecorator3.qfxresult
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestDecorator3.qfxresult
(rev 0)
+++
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestDecorator3.qfxresult 2011-07-27
17:30:08 UTC (rev 33262)
@@ -0,0 +1,15 @@
+package org.jboss.jsr299.tck.tests.jbt.quickfixes;
+
+import javax.decorator.Decorator;
+import javax.decorator.Delegate;
+import javax.inject.Inject;
+
+@Decorator
+public class TestDecorator3 {
+ @Inject @Delegate @AAnnotation String str;
+
+
+ public String produce(){
+ return str;
+ }
+}
Deleted:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestInterceptor4.qfxresult
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestInterceptor4.qfxresult 2011-07-27
17:28:53 UTC (rev 33261)
+++
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestInterceptor4.qfxresult 2011-07-27
17:30:08 UTC (rev 33262)
@@ -1,15 +0,0 @@
-package org.jboss.jsr299.tck.tests.jbt.quickfixes;
-
-import javax.interceptor.Interceptor;
-
-import org.jboss.jsr299.tck.tests.decorators.interceptor.FooBinding;
-
-@Interceptor
-@FooBinding
-public class TestInterceptor4{
-
-
- public String produce(){
- return "a";
- }
-}
Added:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestInterceptor4.qfxresult
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestInterceptor4.qfxresult
(rev 0)
+++
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestInterceptor4.qfxresult 2011-07-27
17:30:08 UTC (rev 33262)
@@ -0,0 +1,14 @@
+package org.jboss.jsr299.tck.tests.jbt.quickfixes;
+
+import javax.interceptor.Interceptor;
+
+import org.jboss.jsr299.tck.tests.decorators.interceptor.FooBinding;
+
+@Interceptor
+@FooBinding
+public class TestInterceptor4{
+
+ public String produce(){
+ return "a";
+ }
+}
Deleted:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestInterceptor5.qfxresult
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestInterceptor5.qfxresult 2011-07-27
17:28:53 UTC (rev 33261)
+++
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestInterceptor5.qfxresult 2011-07-27
17:30:08 UTC (rev 33262)
@@ -1,16 +0,0 @@
-package org.jboss.jsr299.tck.tests.jbt.quickfixes;
-
-import javax.interceptor.Interceptor;
-
-import org.jboss.jsr299.tck.tests.decorators.interceptor.FooBinding;
-
-@Interceptor
-@FooBinding
-
-public class TestInterceptor5{
-
-
- public String produce(){
- return "a";
- }
-}
Added:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestInterceptor5.qfxresult
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestInterceptor5.qfxresult
(rev 0)
+++
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestInterceptor5.qfxresult 2011-07-27
17:30:08 UTC (rev 33262)
@@ -0,0 +1,15 @@
+package org.jboss.jsr299.tck.tests.jbt.quickfixes;
+
+import javax.interceptor.Interceptor;
+
+import org.jboss.jsr299.tck.tests.decorators.interceptor.FooBinding;
+
+@Interceptor
+@FooBinding
+public class TestInterceptor5{
+
+
+ public String produce(){
+ return "a";
+ }
+}
Added:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestStereotype6.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestStereotype6.java
(rev 0)
+++
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestStereotype6.java 2011-07-27
17:30:08 UTC (rev 33262)
@@ -0,0 +1,23 @@
+package org.jboss.jsr299.tck.tests.jbt.quickfixes;
+
+import java.lang.annotation.Target;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.enterprise.inject.Stereotype;
+import javax.enterprise.inject.Typed;
+import javax.inject.Named;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.FIELD;
+
+@Retention(RUNTIME)
+@Stereotype
+@Target({TYPE, METHOD, FIELD})
+@ApplicationScoped
+@Named
+@Typed
+public @interface TestStereotype6 {
+
+}
Property changes on:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestStereotype6.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestStereotype6.qfxresult
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestStereotype6.qfxresult
(rev 0)
+++
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestStereotype6.qfxresult 2011-07-27
17:30:08 UTC (rev 33262)
@@ -0,0 +1,21 @@
+package org.jboss.jsr299.tck.tests.jbt.quickfixes;
+
+import java.lang.annotation.Target;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.enterprise.inject.Stereotype;
+import javax.inject.Named;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.FIELD;
+
+@Retention(RUNTIME)
+@Stereotype
+@Target({TYPE, METHOD, FIELD})
+@ApplicationScoped
+@Named
+public @interface TestStereotype6 {
+
+}
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/marker/CDIMarkerResolutionTest.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/marker/CDIMarkerResolutionTest.java 2011-07-27
17:28:53 UTC (rev 33261)
+++
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/marker/CDIMarkerResolutionTest.java 2011-07-27
17:30:08 UTC (rev 33262)
@@ -786,4 +786,18 @@
DeleteAnnotationMarkerResolution.class);
}
+ public void testTypedInStereotypeResolution() throws CoreException{
+ checkResolution(tckProject,
+ new String[]{
+ "JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/TestStereotype6.java"
+ },
+ new String[]{
+ "JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/TestStereotype6.qfxresult"
+ },
+ CDICoreValidator.PROBLEM_TYPE,
+ CDIValidationErrorManager.MESSAGE_ID_ATTRIBUTE_NAME,
+ CDIValidationErrorManager.STEREOTYPE_IS_ANNOTATED_TYPED_ID,
+ DeleteAnnotationMarkerResolution.class);
+ }
+
}
\ No newline at end of file