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 238718

Summary: IndexOutOfBoundsException: start=-536870476 < 0
Product: editor Reporter: Jiri Prox <jiriprox>
Component: RefactoringAssignee: Ralph Ruijs <ralphbenjamin>
Status: RESOLVED FIXED    
Severity: normal CC: rodrigorsantos
Priority: P3    
Version: 8.0   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter: 205506
Attachments: stacktrace

Description Jiri Prox 2013-11-22 19:58:15 UTC
Build: NetBeans IDE Dev (Build 20131121-463f9d09987b)
VM: Java HotSpot(TM) 64-Bit Server VM, 25.0-b49, Java(TM) SE Runtime Environment, 1.8.0-ea-b107
OS: Windows 7

User Comments:
jiriprox: IOOBE when performing instant rename 

Steps to reproduce:
1) have a code:
public class ClassARen {
    
    public int getX() {
        return 1;
    }

    public void use() {
        int x = getX();
    }
}

2) press Insert to get to override mode
3) start renaming on the first 'getX'
4) put cursor at the 'e'  inside 'e'
5) type new character
-> exception is thrown




Stacktrace: 
java.lang.IndexOutOfBoundsException: start=-536870476 < 0
   at org.netbeans.lib.editor.util.CharSequenceUtilities.checkIndexesValid(CharSequenceUtilities.java:529)
   at org.netbeans.modules.editor.lib2.document.CharContent.subSequence(CharContent.java:95)
   at org.netbeans.lib.editor.util.swing.DocumentUtilities.getText(DocumentUtilities.java:336)
   at org.netbeans.modules.refactoring.java.ui.SyncDocumentRegion.sync(SyncDocumentRegion.java:181)
   at org.netbeans.modules.refactoring.java.plugins.InstantRefactoringPerformer.insertUpdate(InstantRefactoringPerformer.java:313)
   at org.netbeans.editor.BaseDocument.handleInsertString(BaseDocument.java:850)
Comment 1 Jiri Prox 2013-11-22 19:58:17 UTC
Created attachment 142498 [details]
stacktrace
Comment 2 Milutin Kristofic 2013-11-26 12:05:29 UTC
*** Bug 238766 has been marked as a duplicate of this bug. ***
Comment 3 Milutin Kristofic 2013-11-26 13:08:12 UTC
*** Bug 238768 has been marked as a duplicate of this bug. ***
Comment 4 Ralph Ruijs 2013-11-27 15:01:06 UTC
changeset   : 598d0e431b2c
author      : Ralph Benjamin Ruijs <ralphbenjamin@netbeans.org>
date        : Wed Nov 27 15:53:40 CET 2013
summary     : #238718 - do not remove when in overwrite-mode