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 27810 - Getter and Setter (code completion) Problems
Summary: Getter and Setter (code completion) Problems
Status: RESOLVED WORKSFORME
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 3.x
Hardware: PC Windows ME/2000
: P3 blocker (vote)
Assignee: issues@java
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-10-04 06:11 UTC by SamKebab
Modified: 2007-09-26 09:14 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description SamKebab 2002-10-04 06:11:15 UTC
1)BUG!!! Get and Set methods code completion don't work 
when the field is not EXPLICITLY initialized.
e.g. private int age;  
     private double weight;
//will not create getAge() or getWeight()
However, when age and weight are EXPLICITLY initialized 
e.g. private int age = 0;
     private double weight = 0;
//getAge() and getWeight() are created

2)Not a Bug but a Request:
  a)the order of get and set on the page: I wish we had 
the option to put all the get together and all the set 
together -- it is easier to read.  
e.g. getAge(){return age;}
     getWeight(){return weight;}
     setAge(int age){this.age = age;}
     setWeight(double weight){ this.weight = weight;}

At the moment we have:
     getAge(){return age;}
     setAge(int age){ this.age = age;}
     getWeight(){return weight;}
     setWeight ...

b) Request get and set action by bulk!  i.e. we can 
highlight all the fields in one go.
At the moment, we have to click the fields one at a time 
and select create Read Write.

Note: just imagine I have 50 fields per class!  And I have 
30 classes.

Gee thanks.
Comment 1 Martin Roskanin 2002-10-07 11:34:26 UTC
I cannot reproduce this bug. Please provide more info, jdk version,
step-by-step reproduction... Anyway, it seems it is not bug in the
editor. Reassigning to java module. Please, feel free to reassign if I
am wrong.
Comment 2 Martin Roskanin 2002-10-10 14:57:37 UTC
SamKebab, for the next time, please don't reply to the issues via
reply from your mail client. Use Issuezilla instead. Thanks.

Message from SamKebab:

Dear Comrades

Thank you for responding.  Regarding your request for
more details:  
1) I am using the latest stable version of NetBeans
i.e. version 3.4.
2) I am using JDK - 1.4.1
3) OS - Windows 2000 professional
4) Sample Code to reproduce the bug:

a) Sample Code 1 : UNABLE to produce get and set

public class Baloney {
    int sss;
    double weight;
    String name;
} 

b) Sample 2 : This one can produce get and set

public class Baloney2{
    int sss = 0;
    double weight = 0.0;
    String name = "";
}

After copying class Baloney and Baloney2, and opening
it in NetBeans, follow these steps:
Step 1: click highlight the identifier e.g. sss
Step 2: right click - to open pop-up options
Step 3: choose the create Read - Write
Note: at this point you will note that the get/set
option is only available for Sample2 and not Sample1 -
which should not be the case.  They should work for
both sample1 and sample2.

I hope the code helps elucidate the first problem.  

In addition, I also have a request.  If NetBeans can
have an option where i can simply highlight all three
fields sss, weight, and name in ONE execution - then
right click and create all the get/set for all three
fields.  Instead of repeating the action for every
field.  As I had earlier mentioned, I have 30 fields
in a class with over 50 classes.

Thanks again.  I love NetBeans.

Comment 3 Jan Becicka 2002-11-15 09:24:43 UTC
Works for me (200211131011, W2k, JDK 1.4.1)