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.
17 duplicates so far ... Build: NetBeans IDE Dev (Build 080923) VM: Java HotSpot(TM) Client VM, 11.0-b12, Java(TM) SE Runtime Environment, 1.6.0_10-beta-b25 OS: Linux, 2.6.24-19-generic, i386 User comments: STACKTRACE: (first 10 lines) java.lang.StringIndexOutOfBoundsException: String index out of range: 97 at java.lang.String.charAt(String.java:687) at org.netbeans.modules.php.editor.parser.GSFPHPParser.sanitizeSource(GSFPHPParser.java:279) at org.netbeans.modules.php.editor.parser.GSFPHPParser.parseBuffer(GSFPHPParser.java:111) at org.netbeans.modules.php.editor.parser.GSFPHPParser.sanitize(GSFPHPParser.java:414) at org.netbeans.modules.php.editor.parser.GSFPHPParser.parseBuffer(GSFPHPParser.java:182) at org.netbeans.modules.php.editor.parser.GSFPHPParser.sanitize(GSFPHPParser.java:412) at org.netbeans.modules.php.editor.parser.GSFPHPParser.parseBuffer(GSFPHPParser.java:182) at org.netbeans.modules.php.editor.parser.GSFPHPParser.sanitize(GSFPHPParser.java:410) at org.netbeans.modules.php.editor.parser.GSFPHPParser.parseBuffer(GSFPHPParser.java:182) at org.netbeans.modules.php.editor.parser.GSFPHPParser.sanitize(GSFPHPParser.java:407)
*** Issue 154990 has been marked as a duplicate of this issue. ***
The problem can happen when the cursor is on the last line and the code contains an error. fixed in trunk.
Integrated into 'main-golden', will be available in build *200812100201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/2277b67580af User: Petr Pisl <ppisl@netbeans.org> Log: #154893 - StringIndexOutOfBoundsException: String index out of range: 97
The correct fix is -- a/php.editor/src/org/netbeans/modules/php/editor/parser/GSFPHPParser.java +++ b/php.editor/src/org/netbeans/modules/php/editor/parser/GSFPHPParser.java @@ -282,8 +282,9 @@ public class GSFPHPParser implements Par start++; if (end < source.length()) { c = source.charAt(end); while (end < source.length() && c != '\n' && c != '\r' && c != '{' && c != '}') { - c = source.charAt(++end); + c = source.charAt(end++); } } context.sanitizedSource = source.substring(0, start) + Utils.getSpaces(end-start) + source.substring(end); So without end++ before while.
QA, please verify this fix till 14-Jan-2009, so it can be part of NB 6.5 patch 2.
There is new report http://statistics.netbeans.org/analytics/exception.do?id=151030 ... reported after your fix, so not sure it's already fixed.
But the latest report is from an older build (NetBeans 6.5). I fixed this in December. Or I missed something?
Well. If it fixed in trunk (main) it should be verified in trunk (main) and only after that it can be ported into 65_fixes (become part of some patch)
to ppisl: http://statistics.netbeans.org/analytics/exception.do?id=151030 is reported against build 090101...
The issue hasn't passed the nomination process for 65patch2 by cut-off date. It has been moved to 65patch3.
The status whiteboard "65fixes4-candidate" has been removed. At this time our proactive patches for the NetBeans 6.5.x IDE have concluded. If you own a Sun service plan contract for NetBeans, you may wish to contact Sun Service http://www.sun.com/contact/support.jsp to request a fix via the product defect escalation process. For more information on purchasing a Sun service plan contract for NetBeans, refer to the service plan item "Sun Software Service Plans (S3P) for Developers" in the Sun Service table found on our NetBeans Support Resources page http://www.netbeans.org/kb/support.html
v/c