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 254636

Summary: [81cat]javax.swing.text.BadLocationException: Invalid offset=517, docLen=475
Product: editor Reporter: manikantannaren <manikantannaren>
Component: Painting & PrintingAssignee: Miloslav Metelka <mmetelka>
Status: NEW ---    
Severity: normal    
Priority: P3    
Version: 8.1   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter: 219379
Attachments: stacktrace

Description manikantannaren 2015-08-24 07:08:46 UTC
Build: NetBeans IDE Dev (Build 201508230002)
VM: Java HotSpot(TM) 64-Bit Server VM, 25.60-b23, Java(TM) SE Runtime Environment, 1.8.0_60-ea-b25
OS: Mac OS X

User Comments:
manikantannaren: package naming;
public class Naming {

    public static void staticMethod() {
        int x = 4;        

    public static void method() {
        int x = 4;
        int y = x + 1;

In the above class select 4 in staticMethod
RMB|Refacttor|Introduce |Method
Enter getX in dialog
Got this error

javax.swing.text.BadLocationException: Invalid offset=517, docLen=475
   at org.netbeans.modules.editor.lib2.view.EditorView.checkBounds(
   at org.netbeans.modules.editor.lib2.view.EditorView.modelToView(
   at javax.swing.plaf.basic.BasicTextUI$RootView.modelToView(
   at javax.swing.plaf.basic.BasicTextUI.modelToView(
   at javax.swing.plaf.basic.BasicTextUI.modelToView(
   at javax.swing.text.JTextComponent.modelToView(
Comment 1 manikantannaren 2015-08-24 07:08:48 UTC
Created attachment 155565 [details]
Comment 2 manikantannaren 2015-09-18 14:43:59 UTC
Dont see it happening on Build 201509170002. Guess one of situation.

We can close this as WorksForMe I think.