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.
new js file containing function b(){ var c = 1; var n = c; } refactor/rename c -> exception Build: NetBeans IDE 6.1 Beta Build 200803050202 VM: Java HotSpot TM Client VM, 10.0-b19 OS: Windows XP, 5.1, x86 User comments: STACKTRACE: first 10 lines java.lang.NullPointerException at org.netbeans.modules.refactoring.javascript.RetoucheUtils.getClasspathInfoFor RetoucheUtils.java:414 at org.netbeans.modules.refactoring.javascript.RetoucheUtils.getClasspathInfoFor RetoucheUtils.java:438 at org.netbeans.modules.refactoring.javascript.ui.ReNAMERefactoringUI. init> ReNAMERefactoringUI.java:91 at org.netbeans.modules.refactoring.javascript.ui.RefactoringActionsProvider$1.createRefactoringUI RefactoringActionsProvider.java:100 at org.netbeans.modules.refactoring.javascript.ui.RefactoringActionsProvider$TextComponentTask.run RefactoringActionsProvider.java:283 at org.netbeans.modules.refactoring.javascript.ui.RefactoringActionsProvider$TextComponentTask.run RefactoringActionsProvider.java:250 at org.netbeans.napi.gsfret.source.Source.runUserActionTask Source.java:467 at org.netbeans.modules.refactoring.javascript.ui.RefactoringActionsProvider$TextComponentTask.run RefactoringActionsProvider.java:289 at org.netbeans.modules.refactoring.javascript.ui.RefactoringActionsProvider.doReNAME RefactoringActionsProvider.java:122 at org.netbeans.modules.refactoring.api.impl.ActionsImplementationFactory.doReNAME ActionsImplementationFactory.java:69
Created attachment 61544 [details] ide log
This is with beta -- 6.1 final is out, can you try that? Your sample refactors correctly for me. (This is in a Rails project type. What kind of project is your JavaScript file in?) By the way, to rename local variables like this, just invoke Ctrl-R -- it will rename the symbol instantly (and if that isn't possible, e.g. because you're trying it on a symbol that is really global, it will open the rename refactoring dialog.)
Latest trunk build new java project new java package new javascript file function b(){ var c = 1; var n = c; } refactor/rename c -> exception ctrl-r works, refactor/rename doesnt
Created attachment 61592 [details] ide log
And as you've said doing ctrl-r for file with content var c = 1; var n = c; (global vars) generates exception.
This issue has already 10 duplicates see http://statistics.netbeans.org/exceptions/detail.do?id=36233
This was just fixed in 6.5; tracked in issue 136936 to hopefully get it backported to 6.1 as well. *** This issue has been marked as a duplicate of 136936 ***
*** Issue 138314 has been marked as a duplicate of this issue. ***