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 originally marked as duplicate of issue 164395, that is already resolved. This issue is still valid, so this seems to be another issue, but it might be related. Build: NetBeans IDE 6.7 RC1 (Build 200905312038) VM: Java HotSpot(TM) 64-Bit Server VM, 10.0-b23, Java(TM) SE Runtime Environment, 1.6.0_07-b06 OS: Linux, 2.6.24-21-generic, amd64 User Comments: lisukorin: when I use replace feature (Ctrl+H) and use regular expression eg. from: (\d+) to: @date + $1.minutes Stacktrace: java.lang.IndexOutOfBoundsException: end=5373 > length()=1027 at org.netbeans.lib.editor.util.CharSequenceUtilities.checkIndexesValid(CharSequenceUtilities.java:532) at org.netbeans.lib.editor.util.CharSequenceUtilities.checkIndexesValid(CharSequenceUtilities.java:546) at org.netbeans.lib.editor.util.CharSubSequence.checkIndexesValid(CharSubSequence.java:62) at org.netbeans.lib.editor.util.CharSubSequence.<init>(CharSubSequence.java:84) at org.netbeans.lib.editor.util.AbstractCharSequence.subSequence(AbstractCharSequence.java:95) at org.netbeans.modules.editor.lib2.search.DocumentFinder.findReplaceImpl(DocumentFinder.java:289)
Created attachment 83128 [details] stacktrace
Reproducible in a dev build. It is necessary to perform the replace operation inside a selected text (eg. select several lines and then ctrl+H, use regex, make sure Search Selection is ticked, Replace All will crash with the exception).
This issue was originally marked as duplicate of issue 164395, that is already resolved. This issue is still valid, so this seems to be another issue, but it might be related. Build: NetBeans IDE Dev (Build 200906081401) VM: Java HotSpot(TM) Client VM, 11.3-b02, Java(TM) SE Runtime Environment, 1.6.0_13-b03 OS: Windows XP, 5.1, x86 User Comments: while trying to replace /(.*)/ with /"$1",/ in this selection: file.separator path.separator line.separator java.version Stacktrace: java.lang.IndexOutOfBoundsException: end=453 > length()=57 at org.netbeans.lib.editor.util.CharSequenceUtilities.checkIndexesValid(CharSequenceUtilities.java:532) at org.netbeans.lib.editor.util.CharSequenceUtilities.checkIndexesValid(CharSequenceUtilities.java:546) at org.netbeans.lib.editor.util.CharSubSequence.checkIndexesValid(CharSubSequence.java:62) at org.netbeans.lib.editor.util.CharSubSequence.<init>(CharSubSequence.java:84) at org.netbeans.lib.editor.util.AbstractCharSequence.subSequence(AbstractCharSequence.java:95) at org.netbeans.modules.editor.lib2.search.DocumentFinder.findReplaceImpl(DocumentFinder.java:289)
Created attachment 83600 [details] stacktrace
This issue already has 5 duplicates see http://statistics.netbeans.org/exceptions/detail.do?id=150915
Build: NetBeans IDE 6.7 RC3 (Build 200906142201) VM: Java HotSpot(TM) 64-Bit Server VM, 11.3-b02-83, Java(TM) SE Runtime Environment, 1.6.0_13-b03-211 OS: Mac OS X, 10.5.7, x86_64 User Comments: was attempting to do find/replace inside of a block of selected text using regular expressions. Find worked fine, but when clicking on replace it would generate exception ( was trying to replace with some references to regular expression capture group) Stacktrace: java.lang.IndexOutOfBoundsException: end=14241 > length()=1838 at org.netbeans.lib.editor.util.CharSequenceUtilities.checkIndexesValid(CharSequenceUtilities.java:532) at org.netbeans.lib.editor.util.CharSequenceUtilities.checkIndexesValid(CharSequenceUtilities.java:546) at org.netbeans.lib.editor.util.CharSubSequence.checkIndexesValid(CharSubSequence.java:62) at org.netbeans.lib.editor.util.CharSubSequence.<init>(CharSubSequence.java:84) at org.netbeans.lib.editor.util.AbstractCharSequence.subSequence(AbstractCharSequence.java:95) at org.netbeans.modules.editor.lib2.search.DocumentFinder.findReplaceImpl(DocumentFinder.java:289)
Created attachment 83848 [details] stacktrace
This issue already has 6 duplicates see http://statistics.netbeans.org/exceptions/detail.do?id=150915
Build: NetBeans IDE 6.7 RC3 (Build 200906142201) VM: Java HotSpot(TM) Client VM, 11.0-b15, Java(TM) SE Runtime Environment, 1.6.0_10-rc-b28 OS: Windows XP, 5.1, x86 User Comments: Given this input: 1 - message 1 2 - message 2 3 - message 3 1. Open the replace dialog (Ctrl-H) 2. Check "Regular Expressions", "Wrap Around", and "Highlight Results" 3. For "Find What" enter: ^\s*(\d+) - (.*) 4. For "Replace with" enter: new SomeClass(1<<$1, "$2"), 5. With the moouse, select (highlight) the 3 lines of input indicated above 6. Click replace or replace all This works if you omit step 5. Stacktrace: java.lang.IndexOutOfBoundsException: end=70083 > length()=239 at org.netbeans.lib.editor.util.CharSequenceUtilities.checkIndexesValid(CharSequenceUtilities.java:532) at org.netbeans.lib.editor.util.CharSequenceUtilities.checkIndexesValid(CharSequenceUtilities.java:546) at org.netbeans.lib.editor.util.CharSubSequence.checkIndexesValid(CharSubSequence.java:62) at org.netbeans.lib.editor.util.CharSubSequence.<init>(CharSubSequence.java:84) at org.netbeans.lib.editor.util.AbstractCharSequence.subSequence(AbstractCharSequence.java:95) at org.netbeans.modules.editor.lib2.search.DocumentFinder.findReplaceImpl(DocumentFinder.java:289)
Created attachment 84145 [details] stacktrace
This issue already has 7 duplicates see http://statistics.netbeans.org/exceptions/detail.do?id=150915
This issue already has 8 duplicates see http://statistics.netbeans.org/exceptions/detail.do?id=150915
This issue already has 10 duplicates see http://statistics.netbeans.org/exceptions/detail.do?id=150915
This issue already has 11 duplicates see http://statistics.netbeans.org/exceptions/detail.do?id=150915
This issue already has 24 duplicates see http://statistics.netbeans.org/exceptions/detail.do?id=150915
I'm unable to reproduce the problem with described scenarios in the current dev build. Closing as worksforme - please reopen if the problem persists.
Created attachment 103532 [details] test case See comment by owe on how this test case is to be understood.
Hi, it seems indeed that the problem persists. There is a whole list of reports from 2009-08 and after for version 6.7.1 at http://statistics.netbeans.org/analytics/exception.do?id=446904 To reproduce, operate on a selection and use regular expressions. Regex on the entire file and ordinary replacement on a selection both do work. Example: File: a, b, c, . (See the previously attache file. Note that there is a line above and below the abc content). Find: ([a-z]), Replace: "$1", Result: The result depends on the selection. While the "Find" button seems to work properly under any cicumstances, the "Replace All" button does not. I did not test the "Replace" button systematically, but it did not respond when the "Replace All" button didn't. Selection: All (e.g. ctrl+A or mouse) Result: Works fine Selection: Line 2-4 (only the abc content, not the lines before and after) Result: "$1", "$1", c, . Ah, if this isn't an instructive misbehaviour. Note that line 4 was selected but did not change! Selection: Line 3,4 Result: Nothing happens (I bet this is oure IndexOutOfBoundsException). Have fun! Olivier
I've tested in a yesterday's dev build there is no exception and the replacement works as expected (the 'c' gets replaced with "c" in the described case etc.) so it was likely fixed by some of previous fixes. Please reopen if the problem would reappear.