krasa / EclipseCodeFormatter

IntelliJ plugin - use Eclipse's code formatter directly from IntelliJ. https://plugins.jetbrains.com/plugin/6546
Apache License 2.0
487 stars 117 forks source link

java.lang.IllegalArgumentException: Invalid range specified #239

Closed petr-nehez closed 2 years ago

petr-nehez commented 2 years ago

This occurred on the background - I did not invoke ad hoc formatting.

What steps will reproduce the issue?

No idea, just noticied notification.

Paste information about IDE and OS (it can be copied from Help | About dialog).

IntelliJ IDEA 2021.2.3 (Ultimate Edition)
Build #IU-212.5457.46, built on October 12, 2021
Runtime version: 11.0.12+7-b1504.27 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Linux 4.18.0-348.2.1.el8_5.x86_64
GC: G1 Young Generation, G1 Old Generation
Memory: 7500M
Cores: 12
Registry: documentation.show.toolbar=true, ide.balloon.shadow.size=0
Non-Bundled Plugins: ch.raffael.idea.plugins.runpopup (1.3.0), org.dandoh.favacts (0.0.3), Key Promoter X (2021.3), org.toml.lang (0.2.155.4114-212), lermitage.intellij.extra.icons (1.66.0.203), com.github.beansoftapp.visualgc.plugin (2021.3.0), org.intellij.qodana (212.5284.31), com.layoutmanager (1.4.0), lermitage.intellij.iconviewer (1.11.0.193), ski.chrzanow.foldableprojectview (1.1.1), com.jetbrains.CyanTheme (1.2), com.khmelyuk.multirun (1.13), org.turbanov.run.configuration.as.action (1.4.5), com.intellij.nativeDebug (212.5284.19), com.intellij.javafx (1.0.3), com.majera.intellij.codereview.bitbucket (2021.2.14), mobi.hsz.idea.gitignore (4.3.0), com.intellij.ideolog (203.0.27.0), net.seesharpsoft.intellij.plugins.file-preview (1.6.4), zielu.gittoolbox (212.8.1), VisualVMLauncher (1.20.203.4204.0), EclipseCodeFormatter (22.0.203.000.0-Eclipse_2021-09), String Manipulation (8.22.203.000.1), org.sonarlint.idea (6.3.0.39716), CheckStyle-IDEA (5.58.0), com.github.setial (4.0.2), hunspell (212.4746.57), GrepConsole (12.1.211.6086.0), com.intellij.plugins.watcher (212.5080.8), com.wix.sasslint (1.1.2), de.ehmkah.projects.imgdiff (1.11.0), name.kropp.intellij.makefile (212.5457.62), JFormDesigner-Marketplace-Edition (7.0.4), com.jetbrains.ChooseRuntime (1.2), com.tabnine.TabNine (0.5.3), org.rust.lang (0.4.160.4261-212), Batch Scripts Support (1.0.12), net.seesharpsoft.intellij.plugins.csv (2.18.1), com.intellij.plugins.html.instantEditing (212.4746.57), org.jetbrains.kotlin (212-1.6.0-release-799-IJ5457.46), izhangzhihao.rainbow.brackets (6.21), pro.bashsupport (2.0.6.212), com.haulmont.jpab (5.9-212), com.intellij.bigdatatools (212.4037.95), com.github.beansoft.devkit.helper (2.2)
Kotlin: 212-1.6.0-release-799-IJ5457.46
Current Desktop: GNOME
java.lang.IllegalArgumentException: Invalid range specified: (79813, 79781); 
    at com.intellij.openapi.util.TextRange.assertProperRange(TextRange.java:222)
    at com.intellij.openapi.util.TextRange.assertProperRange(TextRange.java:217)
    at com.intellij.openapi.util.TextRange.assertProperRange(TextRange.java:213)
    at com.intellij.openapi.util.TextRange.<init>(TextRange.java:41)
    at com.intellij.openapi.util.TextRange.<init>(TextRange.java:30)
    at com.intellij.openapi.util.TextRange.create(TextRange.java:148)
    at com.intellij.openapi.util.TextRange.from(TextRange.java:143)
    at com.intellij.openapi.util.TextRange.grown(TextRange.java:138)
    at com.intellij.psi.impl.source.codeStyle.CodeFormatterFacade.preprocessEnabledRanges(CodeFormatterFacade.java:346)
    at com.intellij.psi.impl.source.codeStyle.CodeFormatterFacade.preprocess(CodeFormatterFacade.java:327)
    at com.intellij.psi.impl.source.codeStyle.CodeFormatterFacade.processRange(CodeFormatterFacade.java:86)
    at com.intellij.formatting.service.CoreFormattingService.formatElement(CoreFormattingService.java:55)
    at com.intellij.formatting.service.FormattingServiceUtil.formatElement(FormattingServiceUtil.java:74)
    at com.intellij.psi.impl.source.codeStyle.CodeStyleManagerImpl.reformatRangeImpl(CodeStyleManagerImpl.java:209)
    at com.intellij.psi.impl.source.codeStyle.CodeStyleManagerImpl.reformatRange(CodeStyleManagerImpl.java:89)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at krasa.formatter.plugin.ProxyCodeStyleManagerDelegator.PLEASE_REPORT_BUGS_TO_JETBRAINS_IF_IT_FAILS_HERE____ORIGINAL_INTELLIJ_FORMATTER_WAS_USED(ProxyCodeStyleManagerDelegator.java:60)
    at krasa.formatter.plugin.ProxyCodeStyleManagerDelegator.invoke(ProxyCodeStyleManagerDelegator.java:28)
    at net.sf.cglib.empty.Object$$EnhancerByCGLIB$$a6c18dd5.reformatRange(<generated>)
    at com.intellij.codeInsight.editorActions.DefaultTypingActionsExtension.reformatRange(DefaultTypingActionsExtension.java:120)
    at com.intellij.codeInsight.editorActions.DefaultTypingActionsExtension.format(DefaultTypingActionsExtension.java:76)
    at com.intellij.codeInsight.editorActions.TypedHandler.lambda$indentBrace$6(TypedHandler.java:653)
    at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:936)
    at com.intellij.codeInsight.editorActions.TypedHandler.indentBrace(TypedHandler.java:648)
    at com.intellij.codeInsight.editorActions.TypedHandler.indentClosingBrace(TypedHandler.java:596)
    at com.intellij.codeInsight.editorActions.TypedHandler.lambda$doExecute$5(TypedHandler.java:219)
    at com.intellij.openapi.editor.impl.CaretModelImpl.lambda$runForEachCaret$3(CaretModelImpl.java:312)
    at com.intellij.openapi.editor.impl.CaretModelImpl.doWithCaretMerging(CaretModelImpl.java:421)
    at com.intellij.openapi.editor.impl.CaretModelImpl.runForEachCaret(CaretModelImpl.java:321)
    at com.intellij.openapi.editor.impl.CaretModelImpl.runForEachCaret(CaretModelImpl.java:296)
    at com.intellij.codeInsight.editorActions.TypedHandler.doExecute(TypedHandler.java:163)
    at com.intellij.codeInsight.editorActions.TypedHandler.lambda$execute$0(TypedHandler.java:145)
    at com.intellij.util.SlowOperations.allowSlowOperations(SlowOperations.java:152)
    at com.intellij.codeInsight.editorActions.TypedHandler.execute(TypedHandler.java:145)
    at com.intellij.codeInsight.lookup.impl.LookupTypedHandler.execute(LookupTypedHandler.java:73)
    at com.intellij.codeInsight.template.emmet.EmmetPreviewTypedHandler.execute(EmmetPreviewTypedHandler.java:39)
    at com.intellij.execution.impl.ConsoleViewImpl$MyTypedHandler.execute(ConsoleViewImpl.java:1128)
    at com.intellij.openapi.editor.impl.DefaultRawTypedHandler$1.run(DefaultRawTypedHandler.java:55)
    at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:936)
    at com.intellij.openapi.editor.impl.DefaultRawTypedHandler.execute(DefaultRawTypedHandler.java:49)
    at com.intellij.openapi.editor.impl.EditorFactoryImpl$MyRawTypedHandler.execute(EditorFactoryImpl.java:302)
    at com.intellij.openapi.editor.actionSystem.TypedAction.lambda$actionPerformed$2(TypedAction.java:200)
    at com.intellij.reporting.FreezeLoggerImpl.runUnderPerformanceMonitor(FreezeLoggerImpl.java:28)
    at com.intellij.openapi.editor.actionSystem.TypedAction.lambda$actionPerformed$3(TypedAction.java:199)
    at com.intellij.util.SlowOperations.allowSlowOperations(SlowOperations.java:152)
    at com.intellij.openapi.editor.actionSystem.TypedAction.actionPerformed(TypedAction.java:199)
    at com.intellij.openapi.editor.impl.EditorImpl.processKeyTypedNormally(EditorImpl.java:1320)
    at com.intellij.openapi.editor.impl.EditorImpl.processKeyTyped(EditorImpl.java:1302)
    at com.intellij.openapi.editor.impl.EditorImpl.processKeyTyped(EditorImpl.java:3410)
    at com.intellij.openapi.editor.impl.EditorImpl$7.keyTyped(EditorImpl.java:1141)
    at java.desktop/java.awt.AWTEventMulticaster.keyTyped(AWTEventMulticaster.java:247)
    at java.desktop/java.awt.Component.processKeyEvent(Component.java:6607)
    at java.desktop/javax.swing.JComponent.processKeyEvent(JComponent.java:2852)
    at java.desktop/java.awt.Component.processEvent(Component.java:6429)
    at java.desktop/java.awt.Container.processEvent(Container.java:2263)
    at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5027)
    at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2321)
    at java.desktop/java.awt.Component.dispatchEvent(Component.java:4859)
    at java.desktop/java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1962)
    at java.desktop/java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(DefaultKeyboardFocusManager.java:879)
    at java.desktop/java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(DefaultKeyboardFocusManager.java:1158)
    at java.desktop/java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:1018)
    at java.desktop/java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:844)
    at com.intellij.ide.IdeKeyboardFocusManager.dispatchEvent(IdeKeyboardFocusManager.java:42)
    at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:4908)
    at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2321)
    at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2784)
    at java.desktop/java.awt.Component.dispatchEvent(Component.java:4859)
    at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:778)
    at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:727)
    at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:95)
    at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:751)
    at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:749)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
    at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:748)
    at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:885)
    at com.intellij.ide.IdeEventQueue.dispatchKeyEvent(IdeEventQueue.java:801)
    at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:748)
    at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$6(IdeEventQueue.java:441)
    at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:825)
    at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$7(IdeEventQueue.java:440)
    at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:794)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:492)
    at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
krasa commented 2 years ago

Just a small IntelliJ bug, you can report it to https://youtrack.jetbrains.com/issues/IDEA if you want.