GMaven (OLD... DO NOT USE)

duplicate setter generated in stub

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major 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 :
    0

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

Activity

Hide
Andreas Heydler added a comment -

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.

Show
Andreas Heydler added a comment - 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.
Hide
Jason Dillon added a comment -

Which sources are you looking at? The ones from gmaven or the old ones from mojo/groovy?

Show
Jason Dillon added a comment - Which sources are you looking at? The ones from gmaven or the old ones from mojo/groovy?
Hide
Andreas Heydler added a comment -

Hi Jason,

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

Andreas

Show
Andreas Heydler added a comment - Hi Jason, I just found the gmaven sources today and checked them out with svn to have a look at. Andreas
Hide
Jason Dillon added a comment -

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.

Show
Jason Dillon added a comment - 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.
Hide
Jason Dillon added a comment -

This is mostly fixed... there are still some cases where duplicates are generated due to the lack of fully-qualified type muck.

Show
Jason Dillon added a comment - This is mostly fixed... there are still some cases where duplicates are generated due to the lack of fully-qualified type muck.

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: