Author: dazarov
Date: 2012-01-24 15:19:48 -0500 (Tue, 24 Jan 2012)
New Revision: 38116
Added:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/ObserverInDecorator.qfxresult
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/ObserverInInterceptor.qfxresult
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/SessionBeanAnnotatedDecoratorBroken.qfxresult
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/SessionBeanAnnotatedInterceptorBroken.qfxresult
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestDecorator.qfxresult
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/TestDecorator4.qfxresult
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestDisposerConstructor.qfxresult
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestInterceptor3.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/TestInterceptor6.qfxresult
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestObserverConstructor.qfxresult
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/ObserverInDecorator.qfxresult
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/ObserverInInterceptor.qfxresult
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/SessionBeanAnnotatedDecoratorBroken.qfxresult
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/SessionBeanAnnotatedInterceptorBroken.qfxresult
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestDecorator.qfxresult
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/TestDecorator4.qfxresult
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestDisposerConstructor.qfxresult
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestInterceptor3.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/TestInterceptor6.qfxresult
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestObserverConstructor.qfxresult
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestStereotype6.qfxresult
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/MakeBeanScopedDependentMarkerResolution.java
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/refactoring/MarkerResolutionUtils.java
Log:
Add the code which is supposed to be inserted by the Quick Fix into its description
https://issues.jboss.org/browse/JBIDE-10636
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/MakeBeanScopedDependentMarkerResolution.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/MakeBeanScopedDependentMarkerResolution.java 2012-01-24
20:06:27 UTC (rev 38115)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/MakeBeanScopedDependentMarkerResolution.java 2012-01-24
20:19:48 UTC (rev 38116)
@@ -91,26 +91,10 @@
IBuffer buffer = compilationUnit.getBuffer();
- //buffer.replace(workingCopyAnnotation.getSourceRange().getOffset(),
workingCopyAnnotation.getSourceRange().getLength(),
CDIMarkerResolutionUtils.AT+shortName);
-
- //synchronized(compilationUnit) {
- // compilationUnit.reconcile(ICompilationUnit.NO_AST, true, null, null);
- //}
-
// delete import
String qualifiedName = getFullyQualifiedName();
if(qualifiedName != null){
- IImportDeclaration importDeclaration = compilationUnit.getImport(qualifiedName);
- IImportContainer importContainer = compilationUnit.getImportContainer();
- if(importDeclaration != null && importContainer != null){
- int importSize =
importContainer.getSourceRange().getOffset()+importContainer.getSourceRange().getLength();
- String text = buffer.getText(importSize, buffer.getLength()-importSize);
- if(checkImport(text, originalAnnotation.getElementName())){
- TextEdit de = new DeleteEdit(importDeclaration.getSourceRange().getOffset(),
importDeclaration.getSourceRange().getLength());
- edit.addChild(de);
- //importDeclaration.delete(false, new NullProgressMonitor());
- }
- }
+ CDIMarkerResolutionUtils.deleteImportForAnnotation(qualifiedName,
workingCopyAnnotation, compilationUnit, buffer, edit);
}
}
@@ -125,12 +109,6 @@
}
- private boolean checkImport(String text, String shortName){
- Pattern p =
Pattern.compile(".*\\W"+shortName+"\\W.*",Pattern.DOTALL);
//$NON-NLS-1$ //$NON-NLS-2$
- Matcher m = p.matcher(text);
- return !m.matches();
- }
-
private IAnnotation getWorkingCopyAnnotation(IAnnotation annotation, ICompilationUnit
compilationUnit){
IType type = compilationUnit.getType(bean.getBeanClass().getElementName());
Deleted:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/ObserverInDecorator.qfxresult
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/ObserverInDecorator.qfxresult 2012-01-24
20:06:27 UTC (rev 38115)
+++
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/ObserverInDecorator.qfxresult 2012-01-24
20:19:48 UTC (rev 38116)
@@ -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 ObserverInDecorator {
- @Inject @Delegate @AAnnotation String str;
-
- public void method(Boolean param){
-
- }
-}
Added:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/ObserverInDecorator.qfxresult
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/ObserverInDecorator.qfxresult
(rev 0)
+++
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/ObserverInDecorator.qfxresult 2012-01-24
20:19:48 UTC (rev 38116)
@@ -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 ObserverInDecorator {
+ @Inject @Delegate @AAnnotation String str;
+
+ public void method(Boolean param){
+
+ }
+}
Deleted:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/ObserverInInterceptor.qfxresult
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/ObserverInInterceptor.qfxresult 2012-01-24
20:06:27 UTC (rev 38115)
+++
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/ObserverInInterceptor.qfxresult 2012-01-24
20:19:48 UTC (rev 38116)
@@ -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 ObserverInInterceptor {
-
- public void method(Boolean param){
-
- }
-}
Added:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/ObserverInInterceptor.qfxresult
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/ObserverInInterceptor.qfxresult
(rev 0)
+++
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/ObserverInInterceptor.qfxresult 2012-01-24
20:19:48 UTC (rev 38116)
@@ -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 ObserverInInterceptor {
+
+ public void method(Boolean param){
+
+ }
+}
Deleted:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/SessionBeanAnnotatedDecoratorBroken.qfxresult
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/SessionBeanAnnotatedDecoratorBroken.qfxresult 2012-01-24
20:06:27 UTC (rev 38115)
+++
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/SessionBeanAnnotatedDecoratorBroken.qfxresult 2012-01-24
20:19:48 UTC (rev 38116)
@@ -1,9 +0,0 @@
-package org.jboss.jsr299.tck.tests.jbt.quickfixes;
-
-
-import javax.ejb.Stateless;
-
-@Stateless
-public class SessionBeanAnnotatedDecoratorBroken {
-
-}
\ No newline at end of file
Added:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/SessionBeanAnnotatedDecoratorBroken.qfxresult
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/SessionBeanAnnotatedDecoratorBroken.qfxresult
(rev 0)
+++
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/SessionBeanAnnotatedDecoratorBroken.qfxresult 2012-01-24
20:19:48 UTC (rev 38116)
@@ -0,0 +1,8 @@
+package org.jboss.jsr299.tck.tests.jbt.quickfixes;
+
+import javax.ejb.Stateless;
+
+@Stateless
+public class SessionBeanAnnotatedDecoratorBroken {
+
+}
\ No newline at end of file
Deleted:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/SessionBeanAnnotatedInterceptorBroken.qfxresult
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/SessionBeanAnnotatedInterceptorBroken.qfxresult 2012-01-24
20:06:27 UTC (rev 38115)
+++
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/SessionBeanAnnotatedInterceptorBroken.qfxresult 2012-01-24
20:19:48 UTC (rev 38116)
@@ -1,14 +0,0 @@
-package org.jboss.jsr299.tck.tests.jbt.quickfixes;
-
-import javax.ejb.Singleton;
-import javax.interceptor.AroundInvoke;
-
-import javax.interceptor.InvocationContext;
-
-@Singleton
-public class SessionBeanAnnotatedInterceptorBroken {
- @AroundInvoke
- public Object alwaysReturnThis(InvocationContext ctx) throws Exception {
- return ctx.proceed();
- }
-}
\ No newline at end of file
Added:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/SessionBeanAnnotatedInterceptorBroken.qfxresult
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/SessionBeanAnnotatedInterceptorBroken.qfxresult
(rev 0)
+++
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/SessionBeanAnnotatedInterceptorBroken.qfxresult 2012-01-24
20:19:48 UTC (rev 38116)
@@ -0,0 +1,13 @@
+package org.jboss.jsr299.tck.tests.jbt.quickfixes;
+
+import javax.ejb.Singleton;
+import javax.interceptor.AroundInvoke;
+import javax.interceptor.InvocationContext;
+
+@Singleton
+public class SessionBeanAnnotatedInterceptorBroken {
+ @AroundInvoke
+ public Object alwaysReturnThis(InvocationContext ctx) throws Exception {
+ return ctx.proceed();
+ }
+}
\ No newline at end of file
Deleted:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestDecorator.qfxresult
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestDecorator.qfxresult 2012-01-24
20:06:27 UTC (rev 38115)
+++
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestDecorator.qfxresult 2012-01-24
20:19:48 UTC (rev 38116)
@@ -1,12 +0,0 @@
-package org.jboss.jsr299.tck.tests.jbt.quickfixes;
-
-import javax.decorator.Decorator;
-
-
-@Decorator
-public class TestDecorator {
-
- public void method(String parameter){
-
- }
-}
Added:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestDecorator.qfxresult
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestDecorator.qfxresult
(rev 0)
+++
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestDecorator.qfxresult 2012-01-24
20:19:48 UTC (rev 38116)
@@ -0,0 +1,10 @@
+package org.jboss.jsr299.tck.tests.jbt.quickfixes;
+
+import javax.decorator.Decorator;
+@Decorator
+public class TestDecorator {
+
+ public void method(String parameter){
+
+ }
+}
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 2012-01-24
20:06:27 UTC (rev 38115)
+++
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestDecorator2.qfxresult 2012-01-24
20:19:48 UTC (rev 38116)
@@ -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 2012-01-24
20:19:48 UTC (rev 38116)
@@ -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 2012-01-24
20:06:27 UTC (rev 38115)
+++
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestDecorator3.qfxresult 2012-01-24
20:19:48 UTC (rev 38116)
@@ -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 2012-01-24
20:19:48 UTC (rev 38116)
@@ -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 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/TestDecorator4.qfxresult
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestDecorator4.qfxresult 2012-01-24
20:06:27 UTC (rev 38115)
+++
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestDecorator4.qfxresult 2012-01-24
20:19:48 UTC (rev 38116)
@@ -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 TestDecorator4 extends 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/TestDecorator4.qfxresult
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestDecorator4.qfxresult
(rev 0)
+++
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestDecorator4.qfxresult 2012-01-24
20:19:48 UTC (rev 38116)
@@ -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 TestDecorator4 extends 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/TestDisposerConstructor.qfxresult
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestDisposerConstructor.qfxresult 2012-01-24
20:06:27 UTC (rev 38115)
+++
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestDisposerConstructor.qfxresult 2012-01-24
20:19:48 UTC (rev 38116)
@@ -1,20 +0,0 @@
-package org.jboss.jsr299.tck.tests.jbt.quickfixes;
-
-
-import javax.enterprise.inject.Produces;
-import javax.inject.Inject;
-import javax.inject.Named;
-
-@Named("sss")
-public class TestDisposerConstructor {
- @Produces
- public String produce(){
- return "test";
- }
-
-
- @Inject
- public TestDisposerConstructor(String aaa){
-
- }
-}
Added:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestDisposerConstructor.qfxresult
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestDisposerConstructor.qfxresult
(rev 0)
+++
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestDisposerConstructor.qfxresult 2012-01-24
20:19:48 UTC (rev 38116)
@@ -0,0 +1,19 @@
+package org.jboss.jsr299.tck.tests.jbt.quickfixes;
+
+import javax.enterprise.inject.Produces;
+import javax.inject.Inject;
+import javax.inject.Named;
+
+@Named("sss")
+public class TestDisposerConstructor {
+ @Produces
+ public String produce(){
+ return "test";
+ }
+
+
+ @Inject
+ public TestDisposerConstructor(String aaa){
+
+ }
+}
Deleted:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestInterceptor3.qfxresult
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestInterceptor3.qfxresult 2012-01-24
20:06:27 UTC (rev 38115)
+++
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestInterceptor3.qfxresult 2012-01-24
20:19:48 UTC (rev 38116)
@@ -1,17 +0,0 @@
-package org.jboss.jsr299.tck.tests.jbt.quickfixes;
-
-
-import javax.enterprise.inject.Produces;
-import javax.interceptor.Interceptor;
-
-@Interceptor
-public class TestInterceptor3 {
- @Produces
- public String produce(){
- return "";
- }
-
- public void method(String parameter){
-
- }
-}
Added:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestInterceptor3.qfxresult
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestInterceptor3.qfxresult
(rev 0)
+++
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestInterceptor3.qfxresult 2012-01-24
20:19:48 UTC (rev 38116)
@@ -0,0 +1,16 @@
+package org.jboss.jsr299.tck.tests.jbt.quickfixes;
+
+import javax.enterprise.inject.Produces;
+import javax.interceptor.Interceptor;
+
+@Interceptor
+public class TestInterceptor3 {
+ @Produces
+ public String produce(){
+ return "";
+ }
+
+ public void method(String parameter){
+
+ }
+}
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 2012-01-24
20:06:27 UTC (rev 38115)
+++
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestInterceptor4.qfxresult 2012-01-24
20:19:48 UTC (rev 38116)
@@ -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 2012-01-24
20:19:48 UTC (rev 38116)
@@ -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 2012-01-24
20:06:27 UTC (rev 38115)
+++
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestInterceptor5.qfxresult 2012-01-24
20:19:48 UTC (rev 38116)
@@ -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 2012-01-24
20:19:48 UTC (rev 38116)
@@ -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";
+ }
+}
Deleted:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestInterceptor6.qfxresult
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestInterceptor6.qfxresult 2012-01-24
20:06:27 UTC (rev 38115)
+++
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestInterceptor6.qfxresult 2012-01-24
20:19:48 UTC (rev 38116)
@@ -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 TestInterceptor6 extends TestInterceptor5{
-
-
- public String produce(){
- return "a";
- }
-}
Added:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestInterceptor6.qfxresult
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestInterceptor6.qfxresult
(rev 0)
+++
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestInterceptor6.qfxresult 2012-01-24
20:19:48 UTC (rev 38116)
@@ -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 TestInterceptor6 extends TestInterceptor5{
+
+
+ public String produce(){
+ return "a";
+ }
+}
Deleted:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestObserverConstructor.qfxresult
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestObserverConstructor.qfxresult 2012-01-24
20:06:27 UTC (rev 38115)
+++
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestObserverConstructor.qfxresult 2012-01-24
20:19:48 UTC (rev 38116)
@@ -1,12 +0,0 @@
-package org.jboss.jsr299.tck.tests.jbt.quickfixes;
-
-
-import javax.inject.Inject;
-
-public class TestObserverConstructor {
-
- @Inject
- public TestObserverConstructor(String aaa){
-
- }
-}
Added:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestObserverConstructor.qfxresult
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestObserverConstructor.qfxresult
(rev 0)
+++
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestObserverConstructor.qfxresult 2012-01-24
20:19:48 UTC (rev 38116)
@@ -0,0 +1,11 @@
+package org.jboss.jsr299.tck.tests.jbt.quickfixes;
+
+import javax.inject.Inject;
+
+public class TestObserverConstructor {
+
+ @Inject
+ public TestObserverConstructor(String aaa){
+
+ }
+}
Deleted:
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 2012-01-24
20:06:27 UTC (rev 38115)
+++
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestStereotype6.qfxresult 2012-01-24
20:19:48 UTC (rev 38116)
@@ -1,22 +0,0 @@
-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 {
-
-}
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 2012-01-24
20:19:48 UTC (rev 38116)
@@ -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/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/refactoring/MarkerResolutionUtils.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/refactoring/MarkerResolutionUtils.java 2012-01-24
20:06:27 UTC (rev 38115)
+++
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/refactoring/MarkerResolutionUtils.java 2012-01-24
20:19:48 UTC (rev 38116)
@@ -514,16 +514,7 @@
if(annotation != null){
IBuffer buffer = compilationUnit.getBuffer();
- int position = annotation.getSourceRange().getOffset() +
annotation.getSourceRange().getLength();
- int numberOfSpaces = 0;
- if(position < buffer.getLength()-1){
- char c = buffer.getChar(position);
- while((c == C_SPACE || c == C_TAB || c == C_NEW_LINE || c == C_CARRIAGE_RETURN)
&& position < buffer.getLength()-1){
- numberOfSpaces++;
- position++;
- c = buffer.getChar(position);
- }
- }
+ int numberOfSpaces = getNumberOfSpaces(annotation.getSourceRange().getOffset() +
annotation.getSourceRange().getLength(), buffer);
// delete annotation
if(rootEdit != null){
@@ -534,37 +525,57 @@
}
// check and delete import
- IImportDeclaration importDeclaration = compilationUnit.getImport(qualifiedName);
- IImportContainer importContainer = compilationUnit.getImportContainer();
- if(importDeclaration.exists() && importContainer.exists()){
- int importSize =
importContainer.getSourceRange().getOffset()+importContainer.getSourceRange().getLength();
-
- if(rootEdit != null){
- int annotationStart = annotation.getSourceRange().getOffset();
- int annotationEnd = annotationStart+annotation.getSourceRange().getLength();
- String textBefore = buffer.getText(importSize, annotationStart-importSize);
- String textAfter = buffer.getText(annotationEnd,
buffer.getLength()-annotationEnd);
- if(checkImport(textBefore, qualifiedName) && checkImport(textAfter,
qualifiedName)){
- TextEdit edit = new DeleteEdit(importDeclaration.getSourceRange().getOffset(),
importDeclaration.getSourceRange().getLength());
- rootEdit.addChild(edit);
- }
- }else{
- String text = buffer.getText(importSize, buffer.getLength()-importSize);
- if(checkImport(text, qualifiedName)){
- importDeclaration.delete(false, new NullProgressMonitor());
- }
- }
+ deleteImportForAnnotation(qualifiedName, annotation, compilationUnit, buffer,
rootEdit);
+ }
+ }
+
+ private static int getNumberOfSpaces(int startPosition, IBuffer buffer){
+ int position = startPosition;
+ int numberOfSpaces = 0;
+ if(position < buffer.getLength()-1){
+ char c = buffer.getChar(position);
+ while((c == C_SPACE || c == C_TAB || c == C_NEW_LINE || c == C_CARRIAGE_RETURN)
&& position < buffer.getLength()-1){
+ numberOfSpaces++;
+ position++;
+ c = buffer.getChar(position);
}
+ }
+ return numberOfSpaces;
+ }
+
+ public static void deleteImportForAnnotation(String qualifiedName, IAnnotation
annotation, ICompilationUnit compilationUnit, IBuffer buffer, MultiTextEdit rootEdit)
throws JavaModelException{
+ IImportDeclaration importDeclaration = compilationUnit.getImport(qualifiedName);
+ IImportContainer importContainer = compilationUnit.getImportContainer();
+ if(importDeclaration.exists() && importContainer.exists()){
+ int importSize =
importContainer.getSourceRange().getOffset()+importContainer.getSourceRange().getLength();
- if(rootEdit == null){
- synchronized(compilationUnit) {
- compilationUnit.reconcile(ICompilationUnit.NO_AST, true, null, null);
+ if(rootEdit != null){
+ int annotationStart = annotation.getSourceRange().getOffset();
+ int annotationEnd = annotationStart+annotation.getSourceRange().getLength();
+ String textBefore = buffer.getText(importSize, annotationStart-importSize);
+ String textAfter = buffer.getText(annotationEnd, buffer.getLength()-annotationEnd);
+ if(checkImport(textBefore, qualifiedName) && checkImport(textAfter,
qualifiedName)){
+ int numberOfSpaces =
getNumberOfSpaces(importDeclaration.getSourceRange().getOffset() +
importDeclaration.getSourceRange().getLength(), buffer);
+
+ TextEdit edit = new DeleteEdit(importDeclaration.getSourceRange().getOffset(),
importDeclaration.getSourceRange().getLength()+numberOfSpaces);
+ rootEdit.addChild(edit);
+ }
+ }else{
+ String text = buffer.getText(importSize, buffer.getLength()-importSize);
+ if(checkImport(text, qualifiedName)){
+ importDeclaration.delete(false, new NullProgressMonitor());
+ }
}
+ }
+
+ if(rootEdit == null){
+ synchronized(compilationUnit) {
+ compilationUnit.reconcile(ICompilationUnit.NO_AST, true, null, null);
}
}
}
- private static boolean checkImport(String text, String qualifiedName){
+ public static boolean checkImport(String text, String qualifiedName){
String name = getShortName(qualifiedName);
Pattern p = Pattern.compile(".*\\W"+name+"\\W.*",Pattern.DOTALL);
//$NON-NLS-1$ //$NON-NLS-2$