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 201201080601) VM: Java HotSpot(TM) 64-Bit Server VM, 22.0-b10, Java(TM) SE Runtime Environment, 1.7.0_02-b13 OS: Linux User Comments: GUEST: I was refactoring(renaming variables) GUEST: refactoring Class Stacktrace: java.lang.IllegalArgumentException: len=-2 < 0 at org.netbeans.editor.BaseDocument.handleRemove(BaseDocument.java:903) at org.netbeans.editor.BaseDocument$FilterBypassImpl.remove(BaseDocument.java:2343) at javax.swing.text.DocumentFilter.remove(DocumentFilter.java:79) at org.openide.text.CloneableEditorSupport$DocFilter.remove(CloneableEditorSupport.java:2995) at org.netbeans.editor.BaseDocument.remove(BaseDocument.java:889) at org.netbeans.modules.spring.beans.completion.SpringXMLConfigCompletionItem$1.run(SpringXMLConfigCompletionItem.java:195)
Created attachment 114864 [details] stacktrace
There are three types of stacktraces, all related to factoring.
Invalid length of document removal.
Spring's case should be fixed by web-main #b0f849f3dd78.
Integrated into 'main-golden', will be available in build *201203240400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/b0f849f3dd78 User: Martin Fousek <marfous@netbeans.org> Log: #207264 - IllegalArgumentException: len=-2 < 0
Integrated into 'main-golden', will be available in build *201203250401* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/b0f849f3dd78 User: Martin Fousek <marfous@netbeans.org> Log: #207264 - IllegalArgumentException: len=-2 < 0
Created attachment 117368 [details] stacktrace Trying to multi-replace a variable name with a new name in a Java class file.
Most reports are java.source related, reassigning further for evaluation of their cases.
Here is how to reproduce it: 1.) Open a Java file in NetBeans. 2.) Put cursor on a variable name. 3.) Press Ctrl+R then Ctrl+F then Ctrl+R again. 4.) Rename dialog appears. 5.) Rename variable and push the Refactor button. This Exception happens.
Created attachment 122480 [details] stacktrace Attempted to refactor a value using CTRL+R to rename it.
Created attachment 122481 [details] stacktrace
Created attachment 122676 [details] stacktrace
This bug already has 50 duplicates see http://statistics.netbeans.org/exceptions/detail.do?id=183623
I was using Refactoring -> Change Method Parameters and changed both arguments order and the name of one of them when the exception was thrown.
Created attachment 122711 [details] stacktrace Failed to refactor the name of a variable. I was attempting to rename a variable using the CTRL + R reafactoring method.
I have separated the change method parameters test case: http://netbeans.org/bugzilla/show_bug.cgi?id=218053 For the (Java) rename refactoring testcase, sorry, but there is not enough information to fix that. I have added some debugging logs: http://hg.netbeans.org/jet-main/rev/e0d8ba9d5add so when we have some messages.log with this data, it might be possible to find out what is wrong. But even better would be precise steps to reproduce. Thanks for your help.
Integrated into 'main-golden', will be available in build *201209110001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/e0d8ba9d5add User: Jan Lahoda <jlahoda@netbeans.org> Log: #207264: adding debugging logs - keep creation stack traces for a few committed ModificationResults, and print them if commit fails.
*** Bug 206280 has been marked as a duplicate of this bug. ***
Created attachment 124231 [details] Project to use for reproduction. Here is how to reproduce it: 1.) Open attached project in NetBeans. 2.) Open up WithInner.java file in newpackage1. 3.) On line 12, put cursor in front of variable name "p". 4.) Press Ctrl+R and inline red editing box surrounds variable name. 5.) Then press Ctrl+F and the Find toolbar appears with "p" in find field. 6.) Then press Ctrl+R again and the Rename Field dialog pops up with "p" in field. 7.) Rename variable to p1 and push the Refactor button.
Created attachment 124232 [details] logfile See attached logfile.
Thanks for the testcase. It is an interaction between instant rename and full refactoring. Fix attempt: http://hg.netbeans.org/jet-main/rev/08550ae09fdc
Integrated into 'main-golden', will be available in build *201209190001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/08550ae09fdc User: Jan Lahoda <jlahoda@netbeans.org> Log: #207264: must cancel instant rename when running full refactoring.