apache / apache/grails-intellij-plugin

java.lang.IndexOutOfBoundsException: Wrong index: -1

Open
#50 0 comments 0 reactions 0 assignees View on GitHub
bug imported-from-youtrack
Dominant language
Java
Stars
17
Forks
4
Avg merge
5d 15h
Merged PRs (30d)
4

Description

Editing the value for the methodMissing property of a metaclass in the debugger's evaluation dialog
```
java.lang.IndexOutOfBoundsException: Wrong index: -1
at com.intellij.openapi.editor.ex.util.SegmentArrayWithData.getSegmentData(SegmentArrayWithData.java:33)
at com.intellij.openapi.editor.ex.util.LexerEditorHighlighter$HighlighterIteratorImpl.getTokenType(LexerEditorHighlighter.java:10)
at com.intellij.codeInsight.editorActions.TypedHandler.a(TypedHandler.java:339)
at com.intellij.codeInsight.editorActions.TypedHandler.b(TypedHandler.java:378)
at com.intellij.codeInsight.editorActions.TypedHandler.execute(TypedHandler.java:261)
at com.intellij.codeInsight.template.impl.TemplateManagerActions$SpaceHandler.execute(TemplateManagerActions.java:1)
at com.intellij.codeInsight.lookup.impl.TypedHandler.execute(TypedHandler.java:27)
at org.jetbrains.plugins.groovy.lang.editor.actions.GroovyTypedHandler.execute(GroovyTypedHandler.java:116)
at org.jetbrains.plugins.grails.lang.gsp.editor.actions.GspTypedHandler.execute(GspTypedHandler.java:229)
at com.intellij.execution.impl.ConsoleViewImpl$MyTypedHandler.execute(ConsoleViewImpl.java:4)
at com.intellij.openapi.editor.actionSystem.TypedAction$1$1.run(TypedAction.java:108)
at com.intellij.openapi.application.impl.ApplicationImpl$13.compute(ApplicationImpl.java:1)
at com.intellij.psi.impl.source.PostprocessReformattingAspect.postponeFormattingInside(PostprocessReformattingAspect.java:174)
at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:171)
at com.intellij.openapi.editor.actionSystem.TypedAction$1.run(TypedAction.java:103)
at com.intellij.openapi.command.impl.CommandProcessorImpl.executeCommand(CommandProcessorImpl.java:103)
at com.intellij.openapi.command.impl.CommandProcessorImpl.executeCommand(CommandProcessorImpl.java:89)
at com.intellij.openapi.editor.actionSystem.TypedAction.actionPerformed(TypedAction.java:121)
at com.intellij.openapi.editor.impl.EditorImpl.a(EditorImpl.java:1099)
at com.intellij.openapi.editor.impl.EditorImpl.processKeyTyped(EditorImpl.java:789)
at com.intellij.openapi.editor.impl.EditorImpl$7.keyTyped(EditorImpl.java:7)
at java.awt.Component.processKeyEvent(Component.java:5996)
at javax.swing.JComponent.processKeyEvent(JComponent.java:2799)
at java.awt.Component.processEvent(Component.java:5818)
at java.awt.Container.processEvent(Container.java:2058)
at java.awt.Component.dispatchEventImpl(Component.java:4413)
at java.awt.Container.dispatchEventImpl(Container.java:2116)
at java.awt.Component.dispatchEvent(Component.java:4243)
at java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1848)
at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(DefaultKeyboardFocusManager.java:697)
at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(DefaultKeyboardFocusManager.java:962)
at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:834)
at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:661)
at java.awt.Component.dispatchEventImpl(Component.java:4285)
at java.awt.Container.dispatchEventImpl(Container.java:2116)
at java.awt.Window.dispatchEventImpl(Window.java:2440)
at java.awt.Component.dispatchEvent(Component.java:4243)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
at com.intellij.ide.IdeEventQueue.c(IdeEventQueue.java:131)
at com.intellij.ide.IdeEventQueue.b(IdeEventQueue.java:172)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:136)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
```
Environment: Idea build #7757
Revision: 15592
Build: 1.5.15592

---

*Imported from [IDEA-43459](https://youtrack.jetbrains.com/issue/IDEA-43459) · Type: Bug · Votes: 0*
*Comments, attachments, dates and reporter are not part of the export — follow the link above for the full history.*

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the crash by editing the methodMissing property in a metaclass in the debugger evaluation dialog on the stated IDEA build. Start with the editor path in LexerEditorHighlighter.getTokenType and GroovyTypedHandler.execute, then inspect the reported TypedHandler call chain. Done means the same edit no longer raises IndexOutOfBoundsException.

Written by the indexing model from the issue text.

Assessment

Tech stack
groovy, java
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.