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 135290

Summary: NullPointerException at org.netbeans.modules.refactoring.javascript.RetoucheUtils.getClasspathInfoFor
Product: javascript Reporter: unr303 <unr303>
Component: EditorAssignee: Torbjorn Norbye <tor>
Status: RESOLVED DUPLICATE    
Severity: blocker CC: deepakjacob
Priority: P3    
Version: 6.x   
Hardware: PC   
OS: Windows XP   
URL: http://statistics.netbeans.org/exceptions/detail.do?id=36233
Issue Type: DEFECT Exception Reporter: 36233
Attachments: ide log
ide log

Description unr303 2008-05-19 07:01:29 UTC
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
Comment 1 unr303 2008-05-19 07:01:53 UTC
Created attachment 61544 [details]
ide log
Comment 2 Torbjorn Norbye 2008-05-19 19:45:19 UTC
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.)
Comment 3 unr303 2008-05-20 06:54:12 UTC
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
Comment 4 unr303 2008-05-20 06:54:39 UTC
Created attachment 61592 [details]
ide log
Comment 5 unr303 2008-05-20 06:56:36 UTC
And as you've said doing ctrl-r for file with content
var c = 1;
var n = c;    
(global vars) generates exception.
Comment 6 Exceptions Reporter 2008-05-30 22:01:36 UTC
This issue has already 10 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=36233
Comment 7 Torbjorn Norbye 2008-06-10 17:39:52 UTC
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 ***
Comment 8 Torbjorn Norbye 2008-06-26 17:11:00 UTC
*** Issue 138314 has been marked as a duplicate of this issue. ***