groovy

ClassNode:306

Details

  • Type: Sub-task Sub-task
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: 1.7-beta-1
  • Component/s: None
  • Labels:
    None
  • Number of attachments :
    1

Description

ClassNode:306 has

if ((modifiers & ACC_INTERFACE) == 0)
          addField("$ownClass", ACC_STATIC|ACC_PUBLIC|ACC_FINAL, ClassHelper.CLASS_Type, new ClassExpression(this)).setSynthetic(true);

        transformInstances = new EnumMap<CompilePhase, Map<Class <? extends ASTTransformation>, Set<ASTNode>>>(CompilePhase.class);
        for (CompilePhase phase : CompilePhase.values()) {
            transformInstances.put(phase, new HashMap<Class <? extends ASTTransformation>, Set<ASTNode>>());
        }
which should be moved somewhere else. The "$ownclass" probably into verifier and the for transformInstances (moved to GROOVY-3588) we need to find a good place. At last there is no sense in addeding these instances to a ClassNode, that is no primary class node. The code above is for example executed for each class creation in ClassHelper, which looks very surplus

Activity

Hide
René de Bloois added a comment -

Added in rev 10389, I think $ownClass is not really needed.

I attached a patch which removes it.

Show
René de Bloois added a comment - Added in rev 10389, I think $ownClass is not really needed. I attached a patch which removes it.
Hide
Paul King added a comment -

Jochen, any thoughts on this patch?

Show
Paul King added a comment - Jochen, any thoughts on this patch?
Hide
blackdrag blackdrag added a comment -

it is a partial solution, since it does not move out the transform code. maybe we should make two sub tasks, one for the transform code and one for the $ownclass code. Now the patch removes the usage of this field totally. On first glance this seems to be a valid change. So I approve of the patch

Show
blackdrag blackdrag added a comment - it is a partial solution, since it does not move out the transform code. maybe we should make two sub tasks, one for the transform code and one for the $ownclass code. Now the patch removes the usage of this field totally. On first glance this seems to be a valid change. So I approve of the patch
Hide
Paul King added a comment -

Just on trunk right - not 1_6_X.

Show
Paul King added a comment - Just on trunk right - not 1_6_X.
Hide
Paul King added a comment -

Assuming just for trunk. Thanks for the patch René.

Show
Paul King added a comment - Assuming just for trunk. Thanks for the patch René.
Hide
René de Bloois added a comment -

You're welcome.

Show
René de Bloois added a comment - You're welcome.

People

Vote (0)
Watch (2)

Dates

  • Created:
    Updated:
    Resolved: