United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-4979053 compiler to generate Getter/Setter methods
JDK-4979053 : compiler to generate Getter/Setter methods

Details
Type:
Enhancement
Submit Date:
2004-01-15
Status:
Closed
Updated Date:
2006-11-17
Project Name:
JDK
Resolved Date:
2006-11-17
Component:
specification
OS:
windows_xp
Sub-Component:
language
CPU:
x86
Priority:
P4
Resolution:
Duplicate
Affected Versions:
1.4.2
Fixed Versions:

Related Reports
Duplicate:

Sub Tasks

Description
Name: jl125535			Date: 01/15/2004


A DESCRIPTION OF THE REQUEST :
A new keyword to the Java language that marks variables to have Getter/Setter to be automatically generated by the compiler.

JUSTIFICATION :
IDEs like eclipse have capability to autmatically generate getters and setters. But they bloat the code and make it harder to read. I wonder why this isn't
something the compiler could do at compile-time. Why not simply invent a
new keyword, e.g. "bean". Every bean is known to the compiler to have a
public Getter/Setter which can be overridden:

public Test
{
  // will generate:
  // String getBlah();
  // void setBlah(String s) { this.blah = s; }
  public bean String blah;

  // and can be overridden:

 public void setBlah(String s)
 {
    whatever();
    super.setBlah(s);
  }
}
(Incident Review ID: 232174) 
======================================================================

                                    

Comments
EVALUATION

This is really a request for properties, and 6347784 expresses it better.
                                     
2006-11-17



Hardware and Software, Engineered to Work Together