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 reported manually by panica_11. It already has 2 duplicates Build: NetBeans IDE 8.0.1 (Build 201408251540) VM: Java HotSpot(TM) 64-Bit Server VM, 25.20-b23, Java(TM) SE Runtime Environment, 1.8.0_20-b26 OS: Mac OS X User Comments: panica_11: public class Point { private int x; private int y; } when i try to create methods get and set i got this exception GUEST: ff Stacktrace: java.lang.StringIndexOutOfBoundsException: String index out of range: -1 at java.lang.AbstractStringBuilder.substring(AbstractStringBuilder.java:908) at java.lang.StringBuilder.substring(StringBuilder.java:76) at org.netbeans.api.java.source.CodeStyleUtils.removePrefixSuffix(CodeStyleUtils.java:126) at org.netbeans.api.java.source.CodeStyleUtils.removeFieldPrefixSuffix(CodeStyleUtils.java:222) at org.netbeans.api.java.source.CodeStyleUtils.computeGetterName(CodeStyleUtils.java:200) at org.netbeans.modules.java.editor.codegen.GeneratorUtils.hasGetter(GeneratorUtils.java:294)
Created attachment 150236 [details] stacktrace
I am not sure if I covered your specific situation, since I was not able to reproduce the defect using panica_11's description. I'd need to look at the java formatting settings active at the time of the error. However if BOTH prefix and suffix is defined for a field, and the actual field name matches both in a way that the prefix and suffix in the field's name overlap - the name generation algorithm will throw the exactly same SIOOBE. Corner cases should be handled by jet-main#6803edc38fc2
Integrated into 'main-silver', will be available in build *201509300002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/6803edc38fc2 User: Svata Dedic <sdedic@netbeans.org> Log: #248367: do not strip prefix/suffix if they overlap or the basename is empty