groovy
  1. groovy
  2. GROOVY-5123

avoid getTypeClass() use in DelegateASTTransformation

    Details

    • Type: Wish Wish
    • Status: Closed Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.8.4
    • Fix Version/s: 1.8.5, 2.0-beta-2
    • Component/s: None
    • Labels:
      None
    • Number of attachments :
      0

      Description

      Recent changes in DelegateASTTransformation have introduced a dependence on ClassNode.getTypeClass(). As mentioned in other Jiras, the tools don't work well when getTypeClass() is used as we treat ClassNode as a proper type abstraction, we don't always have a real class file behind it (so getTypeClass() will usually return null).

      At line 220, instead of:
      return ClassHelper.makeWithoutCaching(type.getTypeClass(), false);
      can we do something like:
      return type.getComponentType().getPlainNodeReference().makeArray();

        Activity

        Hide
        CÚdric Champeau added a comment -

        Fixed. I also added a javadoc for getTypeClass() for developers to be aware that using this method is unsafe.

        Show
        CÚdric Champeau added a comment - Fixed. I also added a javadoc for getTypeClass() for developers to be aware that using this method is unsafe.
        Hide
        Andrew Eisenberg added a comment -

        Thanks. This will be helpful for us in the future.

        Show
        Andrew Eisenberg added a comment - Thanks. This will be helpful for us in the future.

          People

          • Assignee:
            CÚdric Champeau
            Reporter:
            Andy Clement
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: