Uploaded image for project: 'NetBeans'
  1. NetBeans
  2. NETBEANS-1440

BadLocationException on triple click to select text at EOF

    XMLWordPrintableJSON

Details

    Description

      I got a BadLocationException, when I'm at the end of the file, doing triple click and try to select the text from the bottom:

      javax.swing.text.BadLocationException: Invalid offset=1228 not within <0, 1227>
      	at org.netbeans.modules.editor.lib2.DocUtils.checkOffsetValid(DocUtils.java:214)
      	at org.netbeans.modules.editor.lib2.DocUtils.checkOffsetValid(DocUtils.java:209)
      	at org.netbeans.modules.editor.lib2.DocUtils.getRowStart(DocUtils.java:45)
      [catch] at org.netbeans.modules.editor.lib2.highlighting.CaretBasedBlockHighlighting$CaretRowHighlighting.getCurrentBlockPositions(CaretBasedBlockHighlighting.java:278)
      	at org.netbeans.modules.editor.lib2.highlighting.CaretBasedBlockHighlighting.updateLineInfo(CaretBasedBlockHighlighting.java:191)
      	at org.netbeans.modules.editor.lib2.highlighting.CaretBasedBlockHighlighting.stateChanged(CaretBasedBlockHighlighting.java:179)
      	at org.openide.util.WeakListenerImpl$Change.stateChanged(WeakListenerImpl.java:331)
      	at org.netbeans.api.editor.caret.EditorCaret$6.run(EditorCaret.java:1733)
      	at org.netbeans.modules.editor.lib2.view.ViewUtils.runInEDT(ViewUtils.java:411)
      	at org.netbeans.api.editor.caret.EditorCaret.fireStateChanged(EditorCaret.java:1742)
      	at org.netbeans.api.editor.caret.EditorCaret.runTransaction(EditorCaret.java:1664)
      	at org.netbeans.api.editor.caret.EditorCaret.moveDot(EditorCaret.java:634)
      	at org.netbeans.api.editor.caret.EditorCaret.moveDot(EditorCaret.java:604)
      	at org.netbeans.api.editor.caret.EditorCaret.selectEnsureMinSelection(EditorCaret.java:2458)
      	at org.netbeans.api.editor.caret.EditorCaret.access$4200(EditorCaret.java:143)
      	at org.netbeans.api.editor.caret.EditorCaret$ListenerImpl.mouseDragged(EditorCaret.java:3145)
      	at java.desktop/java.awt.AWTEventMulticaster.mouseDragged(AWTEventMulticaster.java:328)
      	at java.desktop/java.awt.AWTEventMulticaster.mouseDragged(AWTEventMulticaster.java:327)
      	at java.desktop/java.awt.Component.processMouseMotionEvent(Component.java:6637)
      	at java.desktop/javax.swing.JComponent.processMouseMotionEvent(JComponent.java:3360)
      	at java.desktop/java.awt.Component.processEvent(Component.java:6358)
      	at java.desktop/java.awt.Container.processEvent(Container.java:2261)
      	at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:4966)
      	at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2319)
      	at java.desktop/java.awt.Component.dispatchEvent(Component.java:4798)
      	at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4914)
      	at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4560)
      	at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4484)
      	at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2305)
      	at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2772)
      	at java.desktop/java.awt.Component.dispatchEvent(Component.java:4798)
      	at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:772)
      	at java.desktop/java.awt.EventQueue.access$600(EventQueue.java:97)
      	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
      	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715)
      	at java.base/java.security.AccessController.doPrivileged(Native Method)
      	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:87)
      	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:97)
      	at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:745)
      	at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:743)
      	at java.base/java.security.AccessController.doPrivileged(Native Method)
      	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:87)
      	at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:742)
      	at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:136)
      	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)
      

      See my little screen capture too.

      Attachments

        1. badLocationException.gif
          1017 kB
          Christian Lenz

        Issue Links

          Activity

            People

              arunava.sinha ARUNAVA SINHA
              chrizzly Christian Lenz
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 2h 10m
                  2h 10m