Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 2.5.2.Release
-
Fix Version/s: 2.6.1.Release
-
Component/s: Editor, Formatting
-
Labels:
-
Number of attachments :
Description
I use a workspace config that has "Organize imports" set as a save action for Java. This seems to immediately remove any @Grab lines from the begining of the groovy scripts as soon as I save them. If i put the line after my imports, I get an error instead:
!ENTRY org.eclipse.jdt.ui 4 10006 2011-10-13 10:10:34.836
!MESSAGE The save participant 'org.eclipse.jdt.ui.postsavelistener.cleanup' caused an exception: java.lang.NullPointerException
!STACK 0
java.lang.NullPointerException
at org.codehaus.groovy.eclipse.refactoring.actions.GroovyImportsCleanUp.createFix(GroovyImportsCleanUp.java:61)
at org.eclipse.jdt.internal.corext.fix.CleanUpRefactoring.calculateChange(CleanUpRefactoring.java:803)
at org.codehaus.groovy.eclipse.refactoring.actions.CleanUpPostSaveListener.saved(CleanUpPostSaveListener.java:350)
at org.codehaus.groovy.eclipse.refactoring.actions.DelegatingCleanUpPostSaveListener.saved(DelegatingCleanUpPostSaveListener.java:120)
at org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitDocumentProvider$5.run(CompilationUnitDocumentProvider.java:1590)
...
Issue Links
- is related to
-
GRECLIPSE-1390
Organize Imports does not sort by type name ascending
-
Actually, the error might not be so important since I put the annotation in an invalid position. If I put it on a class after my imports everything works properly!
This works:
Whereas this doesn't: