History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: MGROOVY-129
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Jason Dillon
Reporter: Andreas Heydler
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
GMaven

duplicate setter generated in stub

Created: 08/Apr/08 08:05 PM   Updated: 18/Apr/08 03:50 AM
Component/s: stub generation
Affects Version/s: 1.0-rc-1
Fix Version/s: 1.0-rc-1

Time Tracking:
Not Specified

Issue Links:
dependent
 


 Description  « Hide
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."); };

}


 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Andreas Heydler - 08/Apr/08 08:42 PM
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.

Jason Dillon - 09/Apr/08 02:04 AM
Which sources are you looking at? The ones from gmaven or the old ones from mojo/groovy?

Andreas Heydler - 09/Apr/08 02:12 AM
Hi Jason,

I just found the gmaven sources today and checked them out with svn to have a look at.

Andreas


Jason Dillon - 09/Apr/08 02:24 AM
Okay, those are the new ones... I was still in the process of moving. I just nuked the mojo sources with a readme pointing to the new ones. Also setup redirects for the documentation, will push out the changes later. But if you are digging around, look at the gmaven bits.

Jason Dillon - 18/Apr/08 03:50 AM
This is mostly fixed... there are still some cases where duplicates are generated due to the lack of fully-qualified type muck.