Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.0-rc-1
-
Fix Version/s: 1.0-rc-1
-
Component/s: stub generation
-
Labels:None
-
Number of attachments :
Description
The following groovy
class MainModel extends Model implements MainModelProperties { // public static final String ACTION_PRINT = 'print', // ACTION_OPEN_PRINT_DIALOG = 'openPrintDialog', // ACTION_OPEN_PREFERENCES = 'openPreferences', // ACTION_EXIT = 'exit', // ACTION_OPEN_TIP_OF_THE_DAY = 'openTipOfTheDay', // ACTION_OPEN_HELP_CONTENTS = 'openHelpContents', // ACTION_OPEN_ABOUT_DIALOG = 'openAboutDialog' // // public static final String MONTH = 'month', // OPERATOR = 'operator', // TOTALS = 'totals' Date month String operator List<Tally> totals MainModel () { month = new Date (); totals = [] } void setMonth (Date v) { def ov = month firePropertyChange MONTH, ov, month = v setTotals [] } void setOperator (String v) { def ov = operator firePropertyChange OPERATOR, ov, operator = v } void setTotals (List<Tally> v) { def ov = totals firePropertyChange TOTALS, ov, totals = v } }
generates this, ie implied getters & setters generated along with custom setter
/** * @source-type GROOVY */ public class MainModel extends Model implements MainModelProperties { public Date month; public String operator; public List totals; public MainModel(){ throw new Error("Constructor body omitted in Java stub."); }; /** * Setter for 'Month' property. */ public void setMonth(Date value){ throw new Error("Setter body omitted in Java stub."); }; /** * Getter for 'Month' property. */ public Date getMonth(){ throw new Error("Getter body omitted in Java stub."); }; /** * Setter for 'Operator' property. */ public void setOperator(String value){ throw new Error("Setter body omitted in Java stub."); }; /** * Getter for 'Operator' property. */ public String getOperator(){ throw new Error("Getter body omitted in Java stub."); }; /** * Setter for 'Totals' property. */ public void setTotals(List value){ throw new Error("Setter body omitted in Java stub."); }; /** * Getter for 'Totals' property. */ public List getTotals(){ throw new Error("Getter body omitted in Java stub."); }; public void setMonth(Date v){ throw new Error("Method body omitted in Java stub."); }; public void setOperator(String v){ throw new Error("Method body omitted in Java stub."); }; public void setTotals(List v){ throw new Error("Method body omitted in Java stub."); }; }
Issue Links
| This issue depends upon: | ||||
| MGROOVY-130 | Re-implement stub-generation bits to allow more code to be shared between runtime versions |
|
|
|
In poking around in the generator source I have found that the parameter to a custom setter needs to be called 'value' for it to replace the setter that is automatically generated for a property.