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.

Bug 173755 - StringIndexOutOfBoundsException: String index out of range: -1
Summary: StringIndexOutOfBoundsException: String index out of range: -1
Status: VERIFIED FIXED
Alias: None
Product: javafx
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: J Bachorik
URL: http://statistics.netbeans.org/except...
Keywords:
Depends on:
Blocks: 173077
  Show dependency tree
 
Reported: 2009-10-05 13:44 UTC by Alexandr Scherbatiy
Modified: 2009-10-09 10:55 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter: 159549


Attachments
stacktrace (9.31 KB, text/plain)
2009-10-05 13:44 UTC, Alexandr Scherbatiy
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alexandr Scherbatiy 2009-10-05 13:44:06 UTC
Build: NetBeans IDE Dev (Build 200910030241)
VM: Java HotSpot(TM) Client VM, 14.1-b02, Java(TM) SE Runtime Environment, 1.6.0_15-b03
OS: Windows XP, 5.1, x86

Stacktrace: 
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
        at java.lang.String.substring(String.java:1937)
        at org.netbeans.modules.javafx.refactoring.impl.plugins.RenameRefactoringPlugin.fastCheckParameters(RenameRefactoringPlugin.java:209)
        at org.netbeans.modules.javafx.refactoring.impl.plugins.JavaFXRefactoringPlugin$3.check(JavaFXRefactoringPlugin.java:71)
        at org.netbeans.modules.javafx.refactoring.impl.plugins.JavaFXRefactoringPlugin$4.run(JavaFXRefactoringPlugin.java:108)
        at org.netbeans.modules.javafx.refactoring.impl.plugins.JavaFXRefactoringPlugin$4.run(JavaFXRefactoringPlugin.java:106)
        at org.netbeans.modules.javafx.source.parsing.LegacyUserTask.run(LegacyUserTask.java:68)
Comment 1 Alexandr Scherbatiy 2009-10-05 13:44:10 UTC
Created attachment 88835 [details]
stacktrace
Comment 2 Alexandr Scherbatiy 2009-10-05 13:49:21 UTC
Steps to reproduce:

- Create the 'MyCustomNode' JavaFX class under the 'pack' package:
-------------------------------------------------
import javafx.scene.CustomNode;
import javafx.scene.Group;
import javafx.scene.Node;

public class MyCustomNode extends CustomNode {

	public override function create(): Node {
		return Group {
			content: []
		};
	}
}
-------------------------------------------------

- Create the Main JavaFX file under the 'javafxapplication9' package

-------------------------------------------------
import javafx.stage.Stage;
import javafx.scene.Scene;

import pack.MyCustomNode;

Stage {
    title: "Application title"
    width: 250
    height: 80
    scene: Scene {
        content:  MyCustomNode{}
        
    }
}
-------------------------------------------------


- Right-click the 'MyCustomNode' class name in the 'content:  MyCustomNode{}' line,
  and select Refactor->Rename
- Add '2' after the 'MyCustomNodes' name in the Rename dialog

The exception pops up.
Comment 3 J Bachorik 2009-10-07 12:04:18 UTC
fixed in http://hg.netbeans.org/javafx/rev/837f9fc199dc
Comment 4 Alexandr Scherbatiy 2009-10-09 10:55:09 UTC
verified in netbeans-trunk-nightly-200910080418-javafx-full.zip