GMaven (OLD... DO NOT USE)

static member variables not correctly handled by stub generator

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 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;

}

Activity

Hide
Jason Dillon added a comment -

Appears that final is missing as well as static, will have a look.

What version of the plugin are you using?

Show
Jason Dillon added a comment - Appears that final is missing as well as static, will have a look. What version of the plugin are you using?
Hide
Andreas Heydler added a comment -

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

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

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

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

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...

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

Is this in svn?

I
svn up
mvn clean install

but I still get the same result as originally

TIA

Andreas

Show
Andreas Heydler added a comment - Is this in svn? I svn up mvn clean install but I still get the same result as originally TIA Andreas
Hide
Jason Dillon added a comment -

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.

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

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: