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.

Bug 245595

Summary: IndexOutOfBoundsException: Invalid line index=82 >= lineCount=69
Product: third-party Reporter: Exceptions Reporter <exceptions_reporter>
Component: -- Other --Assignee: issues@third-party <issues>
Status: REOPENED ---    
Severity: normal CC: abalint21, alied, cezariusz, ggghhhjjj, jglick, jockel, KhArtNJava, luis.boch, mig_soft, misterm, mkhramov, RampantBadger, sdedic, terje7601
Priority: P3    
Version: 8.1   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter: 210659
Attachments: stacktrace
stacktrace
stacktrace
stacktrace
stacktrace
stacktrace
stacktrace
stacktrace

Description Exceptions Reporter 2014-07-11 15:34:34 UTC
This issue was reported manually by sdedic.
It already has 1 duplicates 


Build: NetBeans IDE 7.3 (Build 201306052037)
VM: Java HotSpot(TM) 64-Bit Server VM, 20.65-b04-462, Java(TM) SE Runtime Environment, 1.6.0_65-b14-462-10M4609
OS: Mac OS X

User Comments:
GUEST: Running PMD plugin via Tools -> Run PMD




Stacktrace: 
java.lang.IndexOutOfBoundsException: Invalid line index=82 >= lineCount=69
   at org.netbeans.modules.editor.lib2.document.LineRootElement.getElement(LineRootElement.java:84)
   at org.openide.text.NbDocument$DocumentRenderer.run(NbDocument.java:922)
   at org.netbeans.editor.BaseDocument.render(BaseDocument.java:1383)
   at org.openide.text.NbDocument$DocumentRenderer.renderToInt(NbDocument.java:897)
   at org.openide.text.NbDocument.findLineOffset(NbDocument.java:201)
   at org.openide.text.DocumentLine$Set.offset(DocumentLine.java:1090)
Comment 1 Exceptions Reporter 2014-07-11 15:34:36 UTC
Created attachment 148001 [details]
stacktrace
Comment 2 Svata Dedic 2014-07-11 15:43:00 UTC
Please handle gracefully the IOOBE, or check that line number < # of lines in the document.
Comment 3 ent38 2015-01-01 00:34:13 UTC
Hi,
the "PMD" plugin is no longer maintained.
Please consider using the "EasyPMD" plugin instead.
Thx.
Comment 4 terje7601 2015-02-20 08:19:05 UTC
This issue should be reinvestigated, as it has nothing to do with PMD (in my case I was editing a pom.xml file) & already has 19 duplicates.

Product Version: NetBeans IDE Dev (Build 201502120001)
Updates: Updates available
Java: 1.8.0_31; Java HotSpot(TM) 64-Bit Server VM 25.31-b07
Runtime: Java(TM) SE Runtime Environment 1.8.0_31-b13
System: Windows 7 version 6.1 running on amd64; Cp1252; en_US (nb)
Comment 5 Svata Dedic 2015-02-20 09:28:04 UTC
(In reply to terje7601 from comment #4)
> This issue should be reinvestigated, as it has nothing to do with PMD (in my
> case I was editing a pom.xml file) & already has 19 duplicates.
> 

The cause is as said earlier in the defect. Text API caller has to either ensure the line number is valid (i.e. read-lock the document, check the # of lines, perform operation) or face IOOBE and handle it.

Exception reporter sometimes misreports related exceptions, although the stacktrace is different - attaches to a wrong group of reports. Your issue (report #766366) should be created for maven support (see your own stacktrace).

Please do not change components unless you investigate the reported issue in detail.
Comment 6 terje7601 2015-02-20 12:46:38 UTC
(In reply to Svata Dedic from comment #5)
> The cause is as said earlier in the defect. Text API caller has to either
> ensure the line number is valid (i.e. read-lock the document, check the # of
> lines, perform operation) or face IOOBE and handle it.
> 
> Exception reporter sometimes misreports related exceptions, although the
> stacktrace is different - attaches to a wrong group of reports. Your issue
> (report #766366) should be created for maven support (see your own
> stacktrace).
> 
> Please do not change components unless you investigate the reported issue in
> detail.

Sorry for having changed this issue, but I did read through the comments. And since the stack trace in the description matched mine exactly, I thought this was the appropriate issue to report my problem. All the more since there were already 19 duplicates.
As a mere user, I'm unaware that NetBeans has a Text API which is called by all the other components. And that those components have to call the Text API in a correct way to avoid IOOBEs like this. Also, if NetBeans gives me an error in the Text API, I don't see how I'd be able to know whether it's an error in the Text API itself or in the component that uses it. Anyway, thanks for clarifying, I'll remember this for the future :) And thanks for creating the new issue.
Comment 7 misterm 2015-09-21 19:39:04 UTC
Created attachment 156334 [details]
stacktrace

Typing
Comment 8 misterm 2015-09-21 19:42:03 UTC
Created attachment 156335 [details]
stacktrace

Typing
Comment 9 alied 2016-02-18 20:55:50 UTC
Created attachment 158562 [details]
stacktrace

editing a project's POM. Moving dependencies to parent's dependency management
Comment 10 Jesse Glick 2016-02-22 22:44:20 UTC
Created attachment 158604 [details]
stacktrace

Not sure.
Comment 11 alied 2016-09-20 20:09:55 UTC
Created attachment 162140 [details]
stacktrace

Editing a project POM
Comment 12 alied 2016-10-04 18:31:14 UTC
Created attachment 162334 [details]
stacktrace

edited a project's POM and saved.
Comment 13 alied 2017-09-14 21:54:43 UTC
one more thing: I don't have installed PMD.
Comment 14 Maksim Khramov 2018-03-07 07:38:29 UTC
Created attachment 165664 [details]
stacktrace

Invoke resolve conflicts command on changed file