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 44718

Summary: Index Out Of Bounds Exception when I Move a Class
Product: editor Reporter: vbrabant <vbrabant>
Component: RefactoringAssignee: issues@java <issues>
Status: CLOSED FIXED    
Severity: blocker    
Priority: P2    
Version: 4.x   
Hardware: PC   
OS: Other   
Issue Type: DEFECT Exception Reporter:
Bug Depends on:    
Bug Blocks: 44713    
Attachments: Exception

Description vbrabant 2004-06-10 21:15:58 UTC
I have a Main Class.
I decided to move the class to the default package:
But I do it by using drag and drop via the mouse.
I am positively surpised that Refactoring dialog
box appeared.
Everythings happened correctly.

I run the project, selected the class Main.
Nb recompiled the source and execute it.

Remark the java source file continue to be marked
as uncompiled. Even after a Build Main Project and
Clean and Build Main Project. Strange behaviour.

Remark: the package tiger continue to be present,
but is now empty.

Now, I decided to do inverse operation, but via
the refactoring menu, and not via drag and drop.
And I received the following message:
java.lang.StringIndexOutOfBoundsException: String
index out of range: -1
	at java.lang.String.substring(String.java:1687)
	at
org.netbeans.modules.refactoring.ui.MoveClassUI.getResPackageName(MoveClassUI.java:102)
	at
org.netbeans.modules.refactoring.ui.MoveClassUI.getPanel(MoveClassUI.java:87)
	at
org.netbeans.modules.refactoring.api.ui.ParametersPanel.<init>(ParametersPanel.java:96)
Comment 1 Marek Grummich 2004-06-11 10:08:55 UTC
I am able to reproduce it too - attached exception
Comment 2 Marek Grummich 2004-06-11 10:09:27 UTC
Created attachment 15650 [details]
Exception
Comment 3 Jan Becicka 2004-06-14 14:42:36 UTC
Fixed.

/cvs/java/javacore/src/org/netbeans/modules/javacore/jmiimpl/javamodel/ResourceImpl.java,v
 <--  ResourceImpl.java
new revision: 1.7; previous revision: 1.6
done
Processing log script arguments...
More commits to come...
Checking in
refactoring/src/org/netbeans/modules/refactoring/ui/MoveClassUI.java;
/cvs/refactoring/src/org/netbeans/modules/refactoring/ui/MoveClassUI.java,v
 <--  MoveClassUI.java
new revision: 1.4; previous revision: 1.3
done
Comment 4 Jiri Prox 2005-07-19 12:10:39 UTC
verified