Rearranger 4.0.2 exception

I don't know, when exactly this happened, just saw the flashing icon in
the status bar:


adjustSpacing: illegal syntax (mismatched braces); PsiElement for brace
is null
java.lang.RuntimeException: adjustSpacing: illegal syntax (mismatched
braces); PsiElement for brace is null
at com.wrq.rearranger.rearrangement.Spacer.adjustSpacing(Spacer.java:415)
at com.wrq.rearranger.rearrangement.Spacer.adjustSpacing(Spacer.java:358)
at com.wrq.rearranger.rearrangement.Spacer.access$000(Spacer.java:26)
at com.wrq.rearranger.rearrangement.Spacer$1.visitClass(Spacer.java:116)
at
com.intellij.psi.JavaElementVisitor.visitTypeParameter(JavaElementVisitor.java:362)
at
com.intellij.psi.impl.source.tree.java.PsiTypeParameterImpl.accept(PsiTypeParameterImpl.java:9)
at
com.intellij.psi.impl.source.TreeWrapperPsiElement.acceptChildren(TreeWrapperPsiElement.java:64)
at
com.intellij.psi.PsiRecursiveElementVisitor.visitElement(PsiRecursiveElementVisitor.java:21)
at
com.intellij.psi.JavaElementVisitor.visitTypeParameterList(JavaElementVisitor.java:274)
at
com.intellij.psi.impl.source.tree.java.PsiTypeParameterListImpl.accept(PsiTypeParameterListImpl.java:7)
at
com.intellij.psi.impl.source.TreeWrapperPsiElement.acceptChildren(TreeWrapperPsiElement.java:64)
at
com.intellij.psi.PsiRecursiveElementVisitor.visitElement(PsiRecursiveElementVisitor.java:21)
at
com.intellij.psi.JavaElementVisitor.visitClass(JavaElementVisitor.java:54)
at com.wrq.rearranger.rearrangement.Spacer$1.visitClass(Spacer.java:114)
at com.intellij.psi.impl.source.PsiClassImpl.accept(PsiClassImpl.java:78)
at
com.intellij.psi.impl.source.TreeWrapperPsiElement.acceptChildren(TreeWrapperPsiElement.java:64)
at
com.intellij.psi.PsiRecursiveElementVisitor.visitElement(PsiRecursiveElementVisitor.java:21)
at
com.intellij.psi.JavaElementVisitor.visitFile(JavaElementVisitor.java:130)
at com.wrq.rearranger.rearrangement.Spacer$1.visitFile(Spacer.java:83)
at
com.intellij.psi.JavaElementVisitor.visitJavaFile(JavaElementVisitor.java:338)
at
com.intellij.psi.impl.source.PsiJavaFileBaseImpl.accept(PsiJavaFileBaseImpl.java:70)
at com.wrq.rearranger.rearrangement.Spacer.respace(Spacer.java:273)
at
com.wrq.rearranger.RearrangerActionHandler.rearrangeDocument(RearrangerActionHandler.java:194)
at
com.wrq.rearranger.RearrangerActionHandler$rearrangerTask.run(RearrangerActionHandler.java:226)
at
com.intellij.openapi.command.impl.CommandProcessorImpl.executeCommand(CommandProcessorImpl.java:114)
at
com.intellij.openapi.command.impl.CommandProcessorImpl.executeCommand(CommandProcessorImpl.java:89)
at
com.wrq.rearranger.RearrangerActionHandler.runWriteActionRearrangement(RearrangerActionHandler.java:144)
at
com.wrq.rearranger.RearrangerActionHandler$1.run(RearrangerActionHandler.java:104)
at
com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:358)
at
com.wrq.rearranger.RearrangerActionHandler.execute(RearrangerActionHandler.java:97)
at
com.intellij.openapi.editor.actionSystem.EditorAction$1.run(EditorAction.java:40)
at
com.intellij.openapi.command.impl.CommandProcessorImpl.executeCommand(CommandProcessorImpl.java:79)
at
com.intellij.openapi.command.impl.CommandProcessorImpl.executeCommand(CommandProcessorImpl.java:89)
at
com.intellij.openapi.editor.actionSystem.EditorAction.actionPerformed(EditorAction.java:46)
at
com.intellij.openapi.editor.actionSystem.EditorAction.actionPerformed(EditorAction.java:31)
at
com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.a(IdeKeyEventDispatcher.java:182)
at
com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.b(IdeKeyEventDispatcher.java:15)
at
com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.dispatchKeyEvent(IdeKeyEventDispatcher.java:131)
at com.intellij.ide.IdeEventQueue.a(IdeEventQueue.java:170)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:53)
at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)

2 comments
Comment actions Permalink

This can happen when braces (class, method, or code block left or right braces) are missing. I've added code to the next version of Rearranger to display a message dialog indicating the problem.

-Dave

0
Comment actions Permalink

I've added code to the next version of Rearranger to display a message dialog indicating the problem.


Cool, thanks. :)

Tom

0

Please sign in to leave a comment.