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.
Build: NetBeans IDE Dev (Build 201109060600) VM: Java HotSpot(TM) Client VM, 20.2-b06, Java(TM) SE Runtime Environment, 1.6.0_27-b07 OS: Linux User Comments: gualtiero65: Hi I was fixing import on a line using the hint. Line was: BufferedReader br = new BufferedReader(new FileReader(strFile)); and package FileReader was marked as to be imported. On the background there was a plugin installation running (I was installing Netbeans API documentation). Stacktrace: java.lang.IndexOutOfBoundsException: Invalid line index=111 >= lineCount=104 at org.netbeans.modules.editor.lib2.document.LineElementRoot.getElement(LineElementRoot.java:66) at org.openide.text.NbDocument$DocumentRenderer.run(NbDocument.java:691) at org.netbeans.editor.BaseDocument.render(BaseDocument.java:1404) at org.openide.text.NbDocument$DocumentRenderer.renderToInt(NbDocument.java:666) at org.openide.text.NbDocument.findLineOffset(NbDocument.java:187) at org.openide.text.DocumentLine$Set.offset(DocumentLine.java:1066)
Created attachment 110543 [details] stacktrace
Created attachment 110687 [details] stacktrace click onto line number to toggle breakpoint
org.netbeans.modules.web.beans.navigation.actions.CdiGlyphAction.performCdiAction(CdiGlyphAction.java:114) should use Document.render(). In case the problem would persist even with read-lock. then the LineSet.getOriginal() algorithm would be wrong.
I just filed a duplicate report but I am not using the Java EE support, so maybe reevaluate the component, or consider filing separate issues for miscategorized dupes.
Created attachment 110925 [details] stacktrace
Created attachment 110928 [details] stacktrace
This bug already has 5 duplicates see http://statistics.netbeans.org/exceptions/detail.do?id=181039
(In reply to comment #3) > org.netbeans.modules.web.beans.navigation.actions.CdiGlyphAction.performCdiAction(CdiGlyphAction.java:114) > > should use Document.render(). In case the problem would persist even with > read-lock. then the LineSet.getOriginal() algorithm would be wrong. It's a shame that NbEditorUtilities.getLine() method doesn't have javadoc with requirement to acquire document lock . The action is performed in the AWT thread so it's unlikely bug in mentioned method. I will correct the method on web.beans module to do it under document lock. But the issue obviously is not in web.beans module. The two stacktraces from Jesse don't contain any mentions of CDI . So the issue is in editor support. I will reassign it after correction on web.beans side.
Created attachment 110938 [details] stacktrace I clicked on the red circular error indicator on the left side of the editor.
correction in the web.beans module: web-main#a3f609274439
Please set appropriate component because I don't know what it is exactly. Thanks.
I noticed that org.netbeans.modules.web.beans.navigation.actions.CdiGlyphAction.performCdiAction(CdiGlyphAction.java:119) uses Line line = NbEditorUtilities.getLine(document, dot, true); so original line is requested for caret's position. This is almost certainly wrong since in case when e.g. several new lines were added to the end of doc and that code would be run the IIOBE exception would be thrown because originally (before the modifications were done in the document) there was no line with such number. 'false' should be passed into getLine() to get current line. Reassigning to web.beans.
Created attachment 111233 [details] stacktrace Click onto line numbers to toggle breakpoint
Created attachment 111236 [details] stacktrace Clicked on line number gutter with expectation of seeing hints and got this error
(In reply to comment #12) > I noticed that > > org.netbeans.modules.web.beans.navigation.actions.CdiGlyphAction.performCdiAction(CdiGlyphAction.java:119) > > uses > > Line line = NbEditorUtilities.getLine(document, dot, true); > > so original line is requested for caret's position. This is almost certainly > wrong since in case when e.g. several new lines were added to the end of doc > and that code would be run the IIOBE exception would be thrown because > originally (before the modifications were done in the document) there was no > line with such number. 'false' should be passed into getLine() to get current > line. Reassigning to web.beans. Could you PLEASE look at other stacktraces ? They don't contain J2EE functionality AT ALL . So either this is a common problem across usages of this code in many places or this is a bug in the Editor. I will change method argument as you suggest and add comment here about my commit. But please evaluate other stacktraces. I will reassign back it.
Created attachment 111269 [details] stacktrace Clicking onto line number to toggle breakpoint
This bug already has 10 duplicates see http://statistics.netbeans.org/exceptions/detail.do?id=181039
Change third argument in getLine() method from "true" to "false". web-main#797d227648e5
I read stack traces and there is also a one stack trace where org.netbeans.modules.web.beans.hints.EditorAnnotationsHelper.addAnnotation(EditorAnnotationsHelper.java:262) use also True - to get Original Line. You could consider to change it. I also separated stacktraces from apisupport.refactoring.
Integrated into 'main-golden' Changeset: http://hg.netbeans.org/main-golden/rev/797d227648e5 User: Denis Anisimov <ads@netbeans.org> Log: Requested correction from BZ#201841 - [71cat] IndexOutOfBoundsException: Invalid line index=111 >= lineCount=104 .
(In reply to comment #19) > I read stack traces and there is also a one stack trace where > org.netbeans.modules.web.beans.hints.EditorAnnotationsHelper.addAnnotation(EditorAnnotationsHelper.java:262) > use also True - to get Original Line. You could consider to change it. > Thank you. web-main#ef1ecaa9202b
Created attachment 111329 [details] stacktrace I was setting a breakpoint in a test .java file.
The problem arised because I was setting a breakpoint in a file that I had just edited (appending lines) and wasn't already saved. The breakpoint was in the new segment of the file. Probably it's just necessary to save the file whenever someone is trying to set a breakpoint. > Created an attachment (id=111329) > stacktrace > I was setting a breakpoint in a test .java file.
Created attachment 111359 [details] stacktrace To reproduce: - create new web project - create new qualifier (File|New|Context and Dependency Injection|Qualifier Type) - create a new class - modify class to contain following and fix imports. Exception is thrown repeatedly whenever you type something in. @Decorator public class NewClass { @Inject @Delegate @NewQualifier private int qualifier1; }
Integrated into 'main-golden' Changeset: http://hg.netbeans.org/main-golden/rev/ef1ecaa9202b User: Denis Anisimov <ads@netbeans.org> Log: Correction related to BZ#201841 - [71cat] IndexOutOfBoundsException: Invalid line index=111 >= lineCount=104
Jirka, IMHO your reported bug is fixed by the Denis' second changeset. New stacktraces are from nb's version before fixes -> I set this to fixed.
Looks like after Denis's change, there are much fewer reports of this, but I still see two reports that came from a build after this change: http://statistics.netbeans.org/exceptions/exception.do?id=534714 http://statistics.netbeans.org/exceptions/exception.do?id=534294 Can these please be evaluated?
(In reply to comment #28) > Looks like after Denis's change, there are much fewer reports of this, but I > still see two reports that came from a build after this change: > http://statistics.netbeans.org/exceptions/exception.do?id=534714 > http://statistics.netbeans.org/exceptions/exception.do?id=534294 > > Can these please be evaluated? By the way they has no relation to web beans area.
(In reply to comment #28) > Looks like after Denis's change, there are much fewer reports of this, but I > still see two reports that came from a build after this change: > http://statistics.netbeans.org/exceptions/exception.do?id=534714 I send as a duplicate to php module https://netbeans.org/bugzilla/show_bug.cgi?id=203427 > http://statistics.netbeans.org/exceptions/exception.do?id=534294 it's user defined parser. at coffeescript.nb.CoffeeScriptParser$ParsingResult.getDiagnostics(CoffeeScriptParser.java:104) > > Can these please be evaluated?