Got unexpected exception during formatting PsiJavaFile:Testklasse.java: java.lang.IndexOutOfBoundsException: Wrong offset: 1655. Should be in range: [0, 1623]
See original GitHub issueGot unexpected exception during formatting PsiJavaFile:Testklasse.java: java.lang.IndexOutOfBoundsException: Wrong offset: 1655. Should be in range: [0, 1623]
java.util.concurrent.ExecutionException: java.lang.IndexOutOfBoundsException: Wrong offset: 1655. Should be in range: [0, 1623]
at java.util.concurrent.FutureTask.report(FutureTask.java:122)
at java.util.concurrent.FutureTask.get(FutureTask.java:192)
at com.intellij.codeInsight.actions.AbstractLayoutCodeProcessor$ReformatFilesTask.a(AbstractLayoutCodeProcessor.java:559)
at com.intellij.codeInsight.actions.AbstractLayoutCodeProcessor$ReformatFilesTask.a(AbstractLayoutCodeProcessor.java:553)
at com.intellij.codeInsight.actions.AbstractLayoutCodeProcessor$ReformatFilesTask.c(AbstractLayoutCodeProcessor.java:524)
at com.intellij.openapi.project.DumbService.withAlternativeResolveEnabled(DumbService.java:278)
at com.intellij.codeInsight.actions.AbstractLayoutCodeProcessor$ReformatFilesTask.iteration(AbstractLayoutCodeProcessor.java:524)
at com.intellij.codeInsight.actions.AbstractLayoutCodeProcessor.b(AbstractLayoutCodeProcessor.java:378)
at com.intellij.openapi.progress.impl.CoreProgressManager$2.run(CoreProgressManager.java:261)
at com.intellij.openapi.progress.impl.CoreProgressManager$TaskRunnable.run(CoreProgressManager.java:718)
at com.intellij.openapi.progress.impl.CoreProgressManager$5.run(CoreProgressManager.java:402)
at com.intellij.openapi.progress.impl.CoreProgressManager.a(CoreProgressManager.java:170)
at com.intellij.openapi.progress.impl.CoreProgressManager.a(CoreProgressManager.java:548)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:493)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:94)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:157)
at com.intellij.openapi.application.impl.ApplicationImpl.runProcessWithProgressSynchronously(ApplicationImpl.java:569)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcessWithProgressSynchronously(CoreProgressManager.java:414)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.runProcessWithProgressSynchronously(ProgressManagerImpl.java:117)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcessWithProgressSynchronously(CoreProgressManager.java:264)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcessWithProgressSynchronously(CoreProgressManager.java:216)
at com.intellij.codeInsight.actions.AbstractLayoutCodeProcessor.a(AbstractLayoutCodeProcessor.java:374)
at com.intellij.codeInsight.actions.AbstractLayoutCodeProcessor.run(AbstractLayoutCodeProcessor.java:264)
at com.dubreuia.processors.RearrangeCodeProcessor.run(RearrangeCodeProcessor.java:84)
at com.dubreuia.core.SaveActionManager.runProcessor(SaveActionManager.java:110)
at com.dubreuia.core.SaveActionManager.processPsiFile(SaveActionManager.java:100)
at com.dubreuia.core.SaveActionManager.beforeDocumentSaving(SaveActionManager.java:48)
at sun.reflect.GeneratedMethodAccessor136.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.intellij.util.messages.impl.MessageBusConnectionImpl.deliverMessage(MessageBusConnectionImpl.java:117)
at com.intellij.util.messages.impl.MessageBusImpl.doPumpMessages(MessageBusImpl.java:443)
at com.intellij.util.messages.impl.MessageBusImpl.pumpWaitingBuses(MessageBusImpl.java:404)
at com.intellij.util.messages.impl.MessageBusImpl.pumpMessages(MessageBusImpl.java:393)
at com.intellij.util.messages.impl.MessageBusImpl.sendMessage(MessageBusImpl.java:374)
at com.intellij.util.messages.impl.MessageBusImpl.access$200(MessageBusImpl.java:45)
at com.intellij.util.messages.impl.MessageBusImpl$2.invoke(MessageBusImpl.java:231)
at com.sun.proxy.$Proxy22.beforeDocumentSaving(Unknown Source)
at sun.reflect.GeneratedMethodAccessor136.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl.a(FileDocumentManagerImpl.java:153)
at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl.a(FileDocumentManagerImpl.java:132)
at com.sun.proxy.$Proxy22.beforeDocumentSaving(Unknown Source)
at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl.e(FileDocumentManagerImpl.java:428)
at com.intellij.pom.core.impl.PomModelImpl.guardPsiModificationsIn(PomModelImpl.java:411)
at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl.b(FileDocumentManagerImpl.java:427)
at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl.a(FileDocumentManagerImpl.java:390)
at com.intellij.openapi.application.WriteAction.run(WriteAction.java:91)
at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl.a(FileDocumentManagerImpl.java:390)
at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl.saveAllDocuments(FileDocumentManagerImpl.java:312)
at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl.saveAllDocuments(FileDocumentManagerImpl.java:290)
at com.intellij.openapi.components.impl.stores.StoreUtil.saveDocumentsAndProjectsAndApp(StoreUtil.java:118)
at com.intellij.openapi.application.impl.ApplicationImpl.saveAll(ApplicationImpl.java:1437)
at com.intellij.ide.actions.SaveAllAction.actionPerformed(SaveAllAction.java:36)
at com.intellij.openapi.actionSystem.ex.ActionUtil$1.run(ActionUtil.java:216)
at com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAware(ActionUtil.java:233)
at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher$1.performAction(IdeKeyEventDispatcher.java:576)
at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.a(IdeKeyEventDispatcher.java:625)
at com.intellij.openapi.application.TransactionGuardImpl.performUserActivity(TransactionGuardImpl.java:193)
at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.processAction(IdeKeyEventDispatcher.java:624)
at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.e(IdeKeyEventDispatcher.java:479)
at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.dispatchKeyEvent(IdeKeyEventDispatcher.java:213)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:621)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:365)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
Caused by: java.lang.IndexOutOfBoundsException: Wrong offset: 1655. Should be in range: [0, 1623]
at com.intellij.openapi.editor.impl.LineSet.findLineIndex(LineSet.java:173)
at com.intellij.openapi.editor.impl.DocumentImpl.getLineNumber(DocumentImpl.java:887)
at com.intellij.psi.codeStyle.arrangement.ArrangementUtil.expandToLineIfPossible(ArrangementUtil.java:159)
at com.intellij.psi.codeStyle.arrangement.JavaArrangementVisitor.a(JavaArrangementVisitor.java:514)
at com.intellij.psi.codeStyle.arrangement.JavaArrangementVisitor.visitMethod(JavaArrangementVisitor.java:390)
at com.intellij.psi.impl.source.PsiMethodImpl.accept(PsiMethodImpl.java:290)
at com.intellij.psi.impl.source.tree.SharedImplUtil.acceptChildren(SharedImplUtil.java:200)
at com.intellij.psi.impl.source.JavaStubPsiElement.acceptChildren(JavaStubPsiElement.java:168)
at com.intellij.psi.codeStyle.arrangement.JavaArrangementVisitor.c(JavaArrangementVisitor.java:477)
at com.intellij.psi.codeStyle.arrangement.JavaArrangementVisitor.a(JavaArrangementVisitor.java:483)
at com.intellij.psi.codeStyle.arrangement.JavaArrangementVisitor.a(JavaArrangementVisitor.java:477)
at com.intellij.psi.codeStyle.arrangement.JavaArrangementVisitor.visitClass(JavaArrangementVisitor.java:150)
at com.intellij.psi.impl.source.PsiClassImpl.accept(PsiClassImpl.java:470)
at com.intellij.psi.impl.source.tree.SharedImplUtil.acceptChildren(SharedImplUtil.java:200)
at com.intellij.psi.impl.source.PsiFileImpl.acceptChildren(PsiFileImpl.java:861)
at com.intellij.psi.JavaRecursiveElementVisitor.visitElement(JavaRecursiveElementVisitor.java:43)
at com.intellij.psi.PsiElementVisitor.visitFile(PsiElementVisitor.java:34)
at com.intellij.psi.JavaElementVisitor.visitJavaFile(JavaElementVisitor.java:335)
at com.intellij.psi.impl.source.PsiJavaFileBaseImpl.accept(PsiJavaFileBaseImpl.java:463)
at com.intellij.psi.codeStyle.arrangement.JavaRearranger.parse(JavaRearranger.java:269)
at com.intellij.psi.codeStyle.arrangement.engine.ArrangementEngine$Context.from(ArrangementEngine.java:551)
at com.intellij.psi.codeStyle.arrangement.engine.ArrangementEngine.arrange(ArrangementEngine.java:134)
at com.intellij.psi.codeStyle.arrangement.engine.ArrangementEngine.arrange(ArrangementEngine.java:91)
at com.dubreuia.processors.RearrangeCodeProcessor$2.run(RearrangeCodeProcessor.java:71)
at com.intellij.openapi.command.impl.CoreCommandProcessor.a(CoreCommandProcessor.java:141)
at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:109)
at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:99)
at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:85)
at com.dubreuia.processors.RearrangeCodeProcessor$1.call(RearrangeCodeProcessor.java:51)
at com.dubreuia.processors.RearrangeCodeProcessor$1.call(RearrangeCodeProcessor.java:41)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at com.intellij.openapi.command.WriteCommandAction$1.run(WriteCommandAction.java:252)
at com.intellij.openapi.command.WriteCommandAction$Simple.run(WriteCommandAction.java:234)
at com.intellij.openapi.application.RunResult.run(RunResult.java:35)
at com.intellij.openapi.command.WriteCommandAction.lambda$null$1(WriteCommandAction.java:171)
at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:1018)
at com.intellij.openapi.command.WriteCommandAction.lambda$performWriteCommandAction$2(WriteCommandAction.java:170)
at com.intellij.openapi.command.WriteCommandAction.lambda$doExecuteCommand$4(WriteCommandAction.java:210)
at com.intellij.openapi.command.impl.CoreCommandProcessor.a(CoreCommandProcessor.java:149)
at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:119)
at com.intellij.openapi.command.WriteCommandAction.doExecuteCommand(WriteCommandAction.java:212)
at com.intellij.openapi.command.WriteCommandAction.performWriteCommandAction(WriteCommandAction.java:168)
at com.intellij.openapi.command.WriteCommandAction.execute(WriteCommandAction.java:151)
at com.intellij.openapi.command.WriteCommandAction.runWriteCommandAction(WriteCommandAction.java:254)
at com.intellij.codeInsight.actions.AbstractLayoutCodeProcessor$ReformatFilesTask.a(AbstractLayoutCodeProcessor.java:551)
at com.intellij.openapi.application.impl.ApplicationImpl.invokeAndWait(ApplicationImpl.java:668)
at com.intellij.openapi.application.impl.ApplicationImpl.invokeAndWait(ApplicationImpl.java:681)
at com.intellij.codeInsight.actions.AbstractLayoutCodeProcessor$ReformatFilesTask.a(AbstractLayoutCodeProcessor.java:551)
... 67 more
Issue Analytics
- State:
- Created 6 years ago
- Comments:11 (5 by maintainers)
Top Results From Across the Web
How to resolve "java.lang.IndexOutOfBoundsException" error?
An IndexOutOfBoundsException occurs when you try to select a value from an array that goes beyond its size. In this example, you're trying ......
Read more >Out of Bounds Exception Error - Alice Community
java.lang.ArrayIndexOutOfBoundsException: Array index out of range: 5 at java.util.Vector.get(Unknown Source) at javax.swing.plaf.basic.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Getting a different error after the latest update (both IDEA, and save actions)
Released in https://github.com/dubreuia/intellij-plugin-save-actions/releases/tag/v1.3.0