This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
This issue was reported manually by mentlicher. It already has 18 duplicates Build: NetBeans IDE Dev (Build 20130918-f923276dee99) VM: Java HotSpot(TM) 64-Bit Server VM, 23.25-b01, Java(TM) SE Runtime Environment, 1.7.0_25-b15 OS: Linux User Comments: janario: . jenjen: Click File -> Open Why can't a text editor open files? What program manager idiot decided that was not a needed feature? GUEST: debugging maven web project rodrigorsantos: <Please provide a description of the problem or the steps to reproduce> janario: . GUEST: Opening a WebService file rodrigorsantos: <Please provide a description of the problem or the steps to reproduce> GUEST: Opening netbeans after reinstallation to the nightly build 201309050001. Opend file is web.xml (active), persistence.xml, properties-files, pom.xml file and java. multiple maven and an ant project is open. jenjen: sigh GUEST: starting an maven tomcat project in debug mode janario: attaching debug janario: After deploy application rodrigorsantos: <Please provide a description of the problem or the steps to reproduce> rodrigorsantos: <Please provide a description of the problem or the steps to reproduce> jenjen: Trying to open a file janario: . GUEST: Attempting to debug web services client jbsabmello: x Stacktrace: java.lang.IndexOutOfBoundsException: Invalid line index=352 >= lineCount=352 at org.netbeans.modules.editor.lib2.document.LineRootElement.getElement(LineRootElement.java:84) at org.openide.text.NbDocument$DocumentRenderer.run(NbDocument.java:923) at org.netbeans.editor.BaseDocument.render(BaseDocument.java:1391) at org.openide.text.NbDocument$DocumentRenderer.renderToInt(NbDocument.java:898) at org.openide.text.NbDocument.findLineOffset(NbDocument.java:201) at org.openide.text.PositionRef$Manager$DocumentRenderer.run(PositionRef.java:1033)
Created attachment 140252 [details] stacktrace
Created attachment 140554 [details] stacktrace start IDE from IDE
Created attachment 140740 [details] stacktrace debugging
My file had 197 lines (at one point) but netbeans seemed to have it down as 194 lines. It wouldn't open in the IDE. When I manually added more lines to the file the file opened as normal. It might also have to do with adding a breakpoint on a line that no longer exists as I was debugging the bottom of that file.
(In reply to djdevin from comment #4) > My file had 197 lines (at one point) but netbeans seemed to have it down as > 194 lines. It wouldn't open in the IDE. > > When I manually added more lines to the file the file opened as normal. > > It might also have to do with adding a breakpoint on a line that no longer > exists as I was debugging the bottom of that file. Clarification: Netbeans was trying to do something with line 197 On disk, custom.module had 194 lines At some point in the past, it did have 197 lines and there was a debug breakpoint on one of those.
Created attachment 141449 [details] stacktrace starting a debug session..
Created attachment 141470 [details] stacktrace Installed EasyPMD, first time scan
Created attachment 141471 [details] stacktrace Refreshing EasyPMD actions
Created attachment 141472 [details] stacktrace EasyPMD scanning
Created attachment 141754 [details] stacktrace trying to debug file
Created attachment 141768 [details] stacktrace debug main project.
Created attachment 141839 [details] stacktrace Just browsing source code.
I was able to reproduce the problem: 1) Create .java source with a method that contains e.g. 20 empty lines followed by a code on which a breakpoint can be placed e.g. System.err.println(). 2) Put a breakpoint on the code. 3) Open Breakpoints window a notice a line where the breakpoint is placed. 4) Shutdown IDE 5) Open the .java source in external editor and delete the empty lines. 6) Open IDE - the Breakponints window should still show the original line number. 7) Doubleclick the breakpoint and the IOOBE should be thrown. This is an effect of issue 228855. PositionRef.Manager.toMemory() is no longer called upon document opening. It's only called upon CloneableEditor opening which is too late for this specific case. It contains a fallback for the case when the line number is outside of document: case LINE_KIND_TO_MEMORY: { // try to find the right position try { retObject = NbDocument.createPosition( mgr.getDoc(), NbDocument.findLineOffset(mgr.getDoc(), argLine) + argColumn, argInsertAfter ? Position.Bias.Backward : Position.Bias.Forward ); } catch (BadLocationException e) { retObject = mgr.getDoc().getEndPosition(); } catch (IndexOutOfBoundsException e) { retObject = mgr.getDoc().getEndPosition(); } So the solution should probably be to add a similar fallback to PositionRef.getOffset(). http://hg.netbeans.org/jet-main/rev/a2706cef352f
*** Bug 237892 has been marked as a duplicate of this bug. ***
Marking as P1 since one of the dup issue was also P1.
Integrated into 'main-silver', will be available in build *201311140002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/a2706cef352f User: Miloslav Metelka <mmetelka@netbeans.org> Log: #236147 - IndexOutOfBoundsException: Invalid line index=352 >= lineCount=352.
In release74: a2706cef352f transplanted to b15df9ad855c
Is it possible to provide EXCEPTIONS_REPORT 74patch1-fixed as single jar to patch the current installed netbeans?
The IDE will update automatically once the patch will be released.
Integrated into 'releases/release74', will be available in build *201311142201* or newer. Wait for official and publicly available build. Changeset: http://hg.netbeans.org/releases/rev/b15df9ad855c User: Miloslav Metelka <mmetelka@netbeans.org> Log: #236147 - IndexOutOfBoundsException: Invalid line index=352 >= lineCount=352. (transplanted from a2706cef352f3a3cda4d6568545cf93eef21730c)