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 121235

Summary: NPE from refactoring change parameters
Product: java Reporter: err <err>
Component: RefactoringAssignee: issues@java <issues>
Status: VERIFIED FIXED    
Severity: blocker CC: jiriprox, jpokorsky, mmirilovic
Priority: P1    
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:
Attachments: messages log with exception

Description err 2007-11-05 23:42:35 UTC
Build 200711050000

Adding (appending) an integer parameter to a method in an interface, the method originally had 3 parameters.
((ViFactory::  public ViOutputStream createOutputStream(ViTextView tv, Object type, Object info);))

Hit Preview button. Got to around 20%, then NPE and dialog asking for a bug report with messages.log
Comment 1 err 2007-11-05 23:48:28 UTC
Created attachment 52561 [details]
messages log with exception
Comment 2 Jiri Prox 2007-11-06 08:34:09 UTC
This is common usecase, it should be fixed in 6.0 -> increasing priority
Comment 3 Jan Becicka 2007-11-06 08:39:17 UTC
Checking in ChangeParamsTransformer.java;
/cvs/refactoring/java/src/org/netbeans/modules/refactoring/java/plugins/ChangeParamsTransformer.java,v  <-- 
ChangeParamsTransformer.java
new revision: 1.10; previous revision: 1.9
done
Comment 4 err 2007-11-06 18:01:44 UTC
 Keywords|      |60_HR_FIX

So I'm guessing things are at the stage where only "approved" changes can go in. And this keyword flags the change as a
candidate for 6.0.
Comment 5 Jan Becicka 2007-11-07 06:34:43 UTC
http://refactoring.netbeans.org/source/browse/refactoring/java/src/org/netbeans/modules/refactoring/java/plugins/ChangeParamsTransformer.java?r1=1.9&r2=1.10

I'd like to ask for review. Fix is similar to issue 119269.
Problem is in method isMethodMatch, which throws NPE if it cannot resolve some element. But it should simply return
false, because element can be unknown in context of current file.
Comment 6 Jan Pokorsky 2007-11-07 09:58:11 UTC
Reviewed, the fix should work.
Comment 7 Jiri Prox 2007-11-07 10:33:47 UTC
verified in trunk, the fix can go to 6.0
Comment 8 Jan Becicka 2007-11-07 14:08:55 UTC
Fixed in 6.0
Checking in ChangeParamsTransformer.java;
/cvs/refactoring/java/src/org/netbeans/modules/refactoring/java/plugins/ChangeParamsTransformer.java,v  <-- 
ChangeParamsTransformer.java
new revision: 1.9.4.1; previous revision: 1.9
done
Comment 9 Jiri Prox 2007-11-12 14:53:03 UTC
verified in RC1