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

Key: MGROOVY-128
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

static member variables not correctly handled by stub generator

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

Time Tracking:
Not Specified


 Description  « Hide
The following groovy
class MainModel extends Model implements ExitListener {

   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'

}

produces this (the static modifier is missing)

/**
 * @source-type GROOVY
 */
public class MainModel extends Model implements ExitListener {

	public String ACTION_PRINT = null;

	public String ACTION_OPEN_PRINT_DIALOG = null;

	public String ACTION_OPEN_PREFERENCES = null;

	public String ACTION_EXIT = null;

	public String ACTION_OPEN_TIP_OF_THE_DAY = null;

	public String ACTION_OPEN_HELP_CONTENTS = null;

	public String ACTION_OPEN_ABOUT_DIALOG = null;

	public String MONTH = null;

	public String OPERATOR = null;

	public String TOTALS = null;

}


 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Jason Dillon - 09/Apr/08 02:02 AM
Appears that final is missing as well as static, will have a look.

What version of the plugin are you using?


Andreas Heydler - 09/Apr/08 02:39 AM
As per comment for other issue, its whatever is available from svn for gmaven.

Will update again after you have had a chance to finish moving everything... I didn't realise this was happening.

As a comment to the above, the final is not so much an issue in this context but the missing static is.

Also, should it be necessary to explicitely mark the fields as public? I am a bit hazy on my groovy but I was under the impression that by default members were public if not qualified in any other way.

Andreas


Jason Dillon - 09/Apr/08 07:47 AM
No you don't need to mark them as public, w/o access modifiers the default is public. Anyways, I'm tracking this down now

Jason Dillon - 09/Apr/08 08:24 AM
Anyways, there are several issues with the stub builder, as well as some maintenance issues keeping the code for 1.0 and 1.5 up to date and conforming to what Groovy actually does, so I'm gonna rewrite this stuff...

Andreas Heydler - 11/Apr/08 04:31 PM
Is this in svn?

I
svn up
mvn clean install

but I still get the same result as originally

TIA

Andreas


Jason Dillon - 18/Apr/08 03:47 AM
The new stub-generator correctly handles static, final and other modifiers (or at least I think it does). But for sure this case is fixed.