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 136222 - generate Setters/Getters methods does not work and throws NPE
Summary: generate Setters/Getters methods does not work and throws NPE
Status: RESOLVED DUPLICATE of bug 131619
Alias: None
Product: java
Classification: Unclassified
Component: Editor (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Jan Lahoda
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-06-01 00:53 UTC by hdwang
Modified: 2008-06-02 08:43 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
screen snap for refactor npe dialog box (24.92 KB, image/jpeg)
2008-06-01 00:55 UTC, hdwang
Details
the IDE log file (44.60 KB, text/plain)
2008-06-01 00:58 UTC, hdwang
Details
the encapsulate fields dialog box which cause error message (28.27 KB, image/jpeg)
2008-06-01 04:14 UTC, hdwang
Details

Note You need to log in before you can comment on or make changes to this bug.
Description hdwang 2008-06-01 00:53:07 UTC
in NB6.1,create a class file which named "User.java" and enter codes like this:
public class User{
   private String username;
   private String password;

   public String getUsername(){
      return username;
   }
   public void setUsername(String username){
      this.username=username;
   }

}
choose "Refactor->Encapsulate Fields" menu, in the refactor dialog box,
choose all the fields to generate setter/getters.
After do  above operations,IDE sometimes popup a error dialog(please see the attachment),
and  does  not generate the Setter/Getter method for field password.

I test with other class,it is seemed that if your have a  Setter/Getter methods for a field,
the IDE can not generate  Setters/Getters for the remain fields.
Comment 1 hdwang 2008-06-01 00:55:50 UTC
Created attachment 62213 [details]
screen snap for refactor npe dialog box
Comment 2 hdwang 2008-06-01 00:58:02 UTC
Created attachment 62214 [details]
the IDE log file
Comment 3 hdwang 2008-06-01 04:14:06 UTC
Created attachment 62216 [details]
the encapsulate fields dialog box which cause error message
Comment 4 Jiri Prox 2008-06-02 08:43:27 UTC
This issue is already fixed and the fix will be included in patch 2. Thanks for your report anyway.

*** This issue has been marked as a duplicate of 131619 ***