click (maybe drag) in gutter gets invalid line

forward progress. I have a basic structure view going for simple programming language. By accident I clicked or dragged the gutter in between the structure view and the source code editor and received an exception in SegmentArray:

  public int getSegmentStart(int index) {
    if (index < 0 || index >= mySegmentCount) {
>>>>>      throw new IndexOutOfBoundsException("Wrong line: " + index + ". Available lines count: " + mySegmentCount);
    }
    return myStarts[index];
  }


index==6 which is the line at which I clicked approximately. I have three lines of input so the exception is correct but I would expect it to simply ignore clicks or drags outside of the valid range. Am I supposed to trap this exception?

here is the exception I see in the console of intellij:

[ 294077]  ERROR - llij.ide.plugins.PluginManager - Wrong line: 6. Available lines count: 3
java.lang.IndexOutOfBoundsException: Wrong line: 6. Available lines count: 3
 at com.intellij.openapi.editor.ex.util.SegmentArray.getSegmentStart(SegmentArray.java:181)
 at com.intellij.openapi.editor.impl.LineSet.getLineStart(LineSet.java:50)
 at com.intellij.openapi.editor.impl.DocumentImpl.getLineStartOffset(DocumentImpl.java:714)
 at com.intellij.openapi.editor.impl.EditorImpl.processMouseDragged(EditorImpl.java:4072)
 at com.intellij.openapi.editor.impl.EditorImpl.access$5600(EditorImpl.java:137)
 at com.intellij.openapi.editor.impl.EditorImpl$22.run(EditorImpl.java:4055)
 at com.intellij.openapi.command.impl.CommandProcessorImpl.executeCommand(CommandProcessorImpl.java:124)
 at com.intellij.openapi.editor.impl.EditorImpl.runMouseDraggedCommand(EditorImpl.java:4052)
 at com.intellij.openapi.editor.impl.EditorImpl.access$10900(EditorImpl.java:137)
 at com.intellij.openapi.editor.impl.EditorImpl$MyMouseMotionListener.mouseDragged(EditorImpl.java:5745)
 at java.awt.AWTEventMulticaster.mouseDragged(AWTEventMulticaster.java:320)
 at java.awt.Component.processMouseMotionEvent(Component.java:6553)
 at javax.swing.JComponent.processMouseMotionEvent(JComponent.java:3339)
 at java.awt.Component.processEvent(Component.java:6274)
 at java.awt.Container.processEvent(Container.java:2229)
 at java.awt.Component.dispatchEventImpl(Component.java:4861)
 at java.awt.Container.dispatchEventImpl(Container.java:2287)
 at java.awt.Component.dispatchEvent(Component.java:4687)
 at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4832)
 at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4509)
 at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4422)
 at java.awt.Container.dispatchEventImpl(Container.java:2273)
 at java.awt.Window.dispatchEventImpl(Window.java:2719)
 at java.awt.Component.dispatchEvent(Component.java:4687)
 at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:729)
 at java.awt.EventQueue.access$200(EventQueue.java:103)
 at java.awt.EventQueue$3.run(EventQueue.java:688)
 at java.awt.EventQueue$3.run(EventQueue.java:686)
 at java.security.AccessController.doPrivileged(Native Method)
 at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
 at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87)
 at java.awt.EventQueue$4.run(EventQueue.java:702)
 at java.awt.EventQueue$4.run(EventQueue.java:700)
 at java.security.AccessController.doPrivileged(Native Method)
 at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
 at java.awt.EventQueue.dispatchEvent(EventQueue.java:699)
 at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:696)
 at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:520)
 at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:335)
 at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
 at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
 at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
 at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
 at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
 at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)


But, in the system console log I see a null pointer exception. I guess it is in their because it's in Apple's code? weird though. perhaps the two errors are related.

9/27/13 12:53:51.488 PM [0x0-0xc95c95].com.jetbrains.intellij: java.lang.NullPointerException
9/27/13 12:53:51.490 PM [0x0-0xc95c95].com.jetbrains.intellij:  at apple.awt.CAccessible.getAccessibleContext(CAccessible.java:74)
9/27/13 12:53:51.490 PM [0x0-0xc95c95].com.jetbrains.intellij:  at apple.awt.CAccessibility$15.call(CAccessibility.java:264)
9/27/13 12:53:51.490 PM [0x0-0xc95c95].com.jetbrains.intellij:  at apple.awt.CAccessibility$15.call(CAccessibility.java:262)
9/27/13 12:53:51.490 PM [0x0-0xc95c95].com.jetbrains.intellij:  at apple.awt.CToolkit$CallableWrapper.run(CToolkit.java:1125)
9/27/13 12:53:51.490 PM [0x0-0xc95c95].com.jetbrains.intellij:  at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:199)
9/27/13 12:53:51.490 PM [0x0-0xc95c95].com.jetbrains.intellij:  at apple.awt.CToolkit$CPeerEvent.dispatch(CToolkit.java:1215)
9/27/13 12:53:51.490 PM [0x0-0xc95c95].com.jetbrains.intellij:  at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:715)
9/27/13 12:53:51.490 PM [0x0-0xc95c95].com.jetbrains.intellij:  at java.awt.EventQueue.access$400(EventQueue.java:82)
9/27/13 12:53:51.490 PM [0x0-0xc95c95].com.jetbrains.intellij:  at java.awt.EventQueue$2.run(EventQueue.java:676)
9/27/13 12:53:51.490 PM [0x0-0xc95c95].com.jetbrains.intellij:  at java.awt.EventQueue$2.run(EventQueue.java:674)
9/27/13 12:53:51.490 PM [0x0-0xc95c95].com.jetbrains.intellij:  at java.security.AccessController.doPrivileged(Native Method)
9/27/13 12:53:51.490 PM [0x0-0xc95c95].com.jetbrains.intellij:  at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:86)
9/27/13 12:53:51.490 PM [0x0-0xc95c95].com.jetbrains.intellij:  at java.awt.EventQueue.dispatchEvent(EventQueue.java:685)
9/27/13 12:53:51.490 PM [0x0-0xc95c95].com.jetbrains.intellij:  at com.intellij.ide.IdeEventQueue.d(IdeEventQueue.java:700)
9/27/13 12:53:51.490 PM [0x0-0xc95c95].com.jetbrains.intellij:  at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:525)
9/27/13 12:53:51.490 PM [0x0-0xc95c95].com.jetbrains.intellij:  at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:348)
9/27/13 12:53:51.490 PM [0x0-0xc95c95].com.jetbrains.intellij:  at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
9/27/13 12:53:51.491 PM [0x0-0xc95c95].com.jetbrains.intellij:  at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
9/27/13 12:53:51.491 PM [0x0-0xc95c95].com.jetbrains.intellij:  at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
9/27/13 12:53:51.491 PM [0x0-0xc95c95].com.jetbrains.intellij:  at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
9/27/13 12:53:51.491 PM [0x0-0xc95c95].com.jetbrains.intellij:  at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
9/27/13 12:53:51.491 PM [0x0-0xc95c95].com.jetbrains.intellij:  at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
9/27/13 12:53:55.733 PM [0x0-0xc95c95].com.jetbrains.intellij: java.lang.NullPointerException
9/27/13 12:53:55.734 PM [0x0-0xc95c95].com.jetbrains.intellij:  at apple.awt.CAccessible.getAccessibleContext(CAccessible.java:74)
9/27/13 12:53:55.734 PM [0x0-0xc95c95].com.jetbrains.intellij:  at apple.awt.CAccessibility$21.call(CAccessibility.java:356)
9/27/13 12:53:55.734 PM [0x0-0xc95c95].com.jetbrains.intellij:  at apple.awt.CAccessibility$21.call(CAccessibility.java:354)
9/27/13 12:53:55.734 PM [0x0-0xc95c95].com.jetbrains.intellij:  at apple.awt.CToolkit$CallableWrapper.run(CToolkit.java:1125)
9/27/13 12:53:55.734 PM [0x0-0xc95c95].com.jetbrains.intellij:  at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:199)
9/27/13 12:53:55.734 PM [0x0-0xc95c95].com.jetbrains.intellij:  at apple.awt.CToolkit$CPeerEvent.dispatch(CToolkit.java:1215)
9/27/13 12:53:55.734 PM [0x0-0xc95c95].com.jetbrains.intellij:  at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:715)
9/27/13 12:53:55.734 PM [0x0-0xc95c95].com.jetbrains.intellij:  at java.awt.EventQueue.access$400(EventQueue.java:82)
9/27/13 12:53:55.734 PM [0x0-0xc95c95].com.jetbrains.intellij:  at java.awt.EventQueue$2.run(EventQueue.java:676)
9/27/13 12:53:55.734 PM [0x0-0xc95c95].com.jetbrains.intellij:  at java.awt.EventQueue$2.run(EventQueue.java:674)
9/27/13 12:53:55.734 PM [0x0-0xc95c95].com.jetbrains.intellij:  at java.security.AccessController.doPrivileged(Native Method)
9/27/13 12:53:55.734 PM [0x0-0xc95c95].com.jetbrains.intellij:  at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:86)
9/27/13 12:53:55.734 PM [0x0-0xc95c95].com.jetbrains.intellij:  at java.awt.EventQueue.dispatchEvent(EventQueue.java:685)
9/27/13 12:53:55.734 PM [0x0-0xc95c95].com.jetbrains.intellij:  at com.intellij.ide.IdeEventQueue.d(IdeEventQueue.java:700)
9/27/13 12:53:55.734 PM [0x0-0xc95c95].com.jetbrains.intellij:  at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:525)
9/27/13 12:53:55.734 PM [0x0-0xc95c95].com.jetbrains.intellij:  at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:348)
9/27/13 12:53:55.734 PM [0x0-0xc95c95].com.jetbrains.intellij:  at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
9/27/13 12:53:55.734 PM [0x0-0xc95c95].com.jetbrains.intellij:  at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
9/27/13 12:53:55.734 PM [0x0-0xc95c95].com.jetbrains.intellij:  at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
9/27/13 12:53:55.734 PM [0x0-0xc95c95].com.jetbrains.intellij:  at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
9/27/13 12:53:55.734 PM [0x0-0xc95c95].com.jetbrains.intellij:  at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
9/27/13 12:53:55.734 PM [0x0-0xc95c95].com.jetbrains.intellij:  at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
9/27/13 12:53:55.736 PM [0x0-0xc95c95].com.jetbrains.intellij: java.lang.NullPointerException
9/27/13 12:53:55.737 PM [0x0-0xc95c95].com.jetbrains.intellij:  at apple.awt.CAccessible.getAccessibleContext(CAccessible.java:74)
9/27/13 12:53:55.737 PM [0x0-0xc95c95].com.jetbrains.intellij:  at apple.awt.CAccessibility$21.call(CAccessibility.java:356)
9/27/13 12:53:55.737 PM [0x0-0xc95c95].com.jetbrains.intellij:  at apple.awt.CAccessibility$21.call(CAccessibility.java:354)
9/27/13 12:53:55.737 PM [0x0-0xc95c95].com.jetbrains.intellij:  at apple.awt.CToolkit$CallableWrapper.run(CToolkit.java:1125)
9/27/13 12:53:55.737 PM [0x0-0xc95c95].com.jetbrains.intellij:  at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:199)
9/27/13 12:53:55.737 PM [0x0-0xc95c95].com.jetbrains.intellij:  at apple.awt.CToolkit$CPeerEvent.dispatch(CToolkit.java:1215)
9/27/13 12:53:55.737 PM [0x0-0xc95c95].com.jetbrains.intellij:  at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:715)
9/27/13 12:53:55.737 PM [0x0-0xc95c95].com.jetbrains.intellij:  at java.awt.EventQueue.access$400(EventQueue.java:82)
9/27/13 12:53:55.737 PM [0x0-0xc95c95].com.jetbrains.intellij:  at java.awt.EventQueue$2.run(EventQueue.java:676)
9/27/13 12:53:55.737 PM [0x0-0xc95c95].com.jetbrains.intellij:  at java.awt.EventQueue$2.run(EventQueue.java:674)
9/27/13 12:53:55.737 PM [0x0-0xc95c95].com.jetbrains.intellij:  at java.security.AccessController.doPrivileged(Native Method)
9/27/13 12:53:55.737 PM [0x0-0xc95c95].com.jetbrains.intellij:  at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:86)
9/27/13 12:53:55.737 PM [0x0-0xc95c95].com.jetbrains.intellij:  at java.awt.EventQueue.dispatchEvent(EventQueue.java:685)
9/27/13 12:53:55.737 PM [0x0-0xc95c95].com.jetbrains.intellij:  at com.intellij.ide.IdeEventQueue.d(IdeEventQueue.java:700)
9/27/13 12:53:55.737 PM [0x0-0xc95c95].com.jetbrains.intellij:  at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:525)
9/27/13 12:53:55.737 PM [0x0-0xc95c95].com.jetbrains.intellij:  at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:348)
9/27/13 12:53:55.737 PM [0x0-0xc95c95].com.jetbrains.intellij:  at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
9/27/13 12:53:55.737 PM [0x0-0xc95c95].com.jetbrains.intellij:  at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
9/27/13 12:53:55.737 PM [0x0-0xc95c95].com.jetbrains.intellij:  at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
9/27/13 12:53:55.737 PM [0x0-0xc95c95].com.jetbrains.intellij:  at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
9/27/13 12:53:55.737 PM [0x0-0xc95c95].com.jetbrains.intellij:  at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
9/27/13 12:53:55.737 PM [0x0-0xc95c95].com.jetbrains.intellij:  at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)


thanks for any insight people might have. It's not a showstopper as I can simply stop clicking in the gutter ;) Attaching the log file.

Ter


Attachment(s):
idea.log.zip

Please sign in to leave a comment.