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 201111060600) VM: Java HotSpot(TM) Client VM, 21.1-b02, Java(TM) SE Runtime Environment, 1.7.0_01-b08 OS: Linux User Comments: aldobrucale: Change Method Parameters -> click on "Default Value" column Stacktrace: java.lang.StringIndexOutOfBoundsException: String index out of range: -20 at java.lang.String.substring(String.java:1958) at java.lang.String.substring(String.java:1925) at org.netbeans.modules.refactoring.java.ui.ChangeParametersPanel$ParamEditor.getCellEditorValue(ChangeParametersPanel.java:1177) at javax.swing.JTable.editingStopped(JTable.java:4725) at javax.swing.AbstractCellEditor.fireEditingStopped(AbstractCellEditor.java:141) at javax.swing.DefaultCellEditor$EditorDelegate.stopCellEditing(DefaultCellEditor.java:368)
Created attachment 112935 [details] stacktrace
Cannot reproduce
The problem is caused by removing characters before the document-view-start-position. Reassigning.
Ralph, can you please explain a bit more why you assigned this to editor? All I see is the code in ChangeParametersPanel.java causing an exception ... startOffset being -20 causing the substring to fail and startOffset being filled from startOffset = ((String)model.getValueAt(row, col - 1)).length() + 1;. I know that I don't know what is inside the model and how it relates to the editor ... please explain.
(In reply to comment #4) > Ralph, can you please explain a bit more why you assigned this to editor? All I > see is the code in ChangeParametersPanel.java causing an exception ... > startOffset being -20 causing the substring to fail and startOffset being > filled from startOffset = ((String)model.getValueAt(row, col - 1)).length() + > 1;. I know that I don't know what is inside the model and how it relates to the > editor ... please explain. David, the startOffset being -20 is caused by the document-view-start-position incorrectly allowing to type before this position. Just checking if startOffset holds a 'valid' value will not work, as the document will remain in illegal state and throw exceptions.
*** Bug 208116 has been marked as a duplicate of this bug. ***
*** Bug 209542 has been marked as a duplicate of this bug. ***
Seems to work fine in current 7.2 builds.
Do you mean WORKSFORME? There is no specific fix changeset listed here.
I have tried > aldobrucale: Change Method Parameters -> click on "Default Value" column and it worked fine in a recent dev build. Ralph could you please check whether this is really working now or not? Thanks.
Mila, steps to reproduce. 1. Invoke change method parameters on a method 2. Add a new parameter 3. Remove all characters in the name column 4. Press backspace to remove a character before the document-view-start-position 5. Change focus out of the field Product Version: NetBeans IDE Dev (Build 20120604-f99607e592c6) Java: 1.6.0_31; Java HotSpot(TM) 64-Bit Server VM 20.6-b01-415 System: Mac OS X version 10.7.4 running on x86_64; MacRoman; en_US (nb)
*** Bug 220843 has been marked as a duplicate of this bug. ***
(In reply to comment #12) > *** Bug 220843 has been marked as a duplicate of this bug. *** The same problem as in cmp. Open Introduce Parameter Refactoring Select All on the parameter name textfield (CTRL+A) Press backspace When using document-view-start-position it should not be possible to change the text outside of the view.
*** Bug 249227 has been marked as a duplicate of this bug. ***
This old bug may not be relevant anymore. If you can still reproduce it in 8.2 development builds please reopen this issue. Thanks for your cooperation, NetBeans IDE 8.2 Release Boss