Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-8675

GenericsUtils.PARAMETERIZED_TYPE_CACHE is static and private

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 2.5.1, 3.0.0-alpha-4, 2.6.0-alpha-5
    • None
    • None

    Description

      Recently, GROOVY-8604, GROOVY-8630, et al. added PARAMETERIZED_TYPE_CACHE to GenericsUtils. This type cache is static and final with no outside interface for clearing it save the soft references. Long-lived processes (like an IDE) can run into stale class data as the type being compiled are continuously being edited/altered. And different branches may be brought in from source control. I don't think it is good practice for the runtime to cache anything in static data structures.

      It's difficult to judge the usefulness of this cache since the linked JIRA tickets and commits do not mention before and after measurements. But if it is indeed beneficial, could its reference be kept somewhere non-static and passed/accessed by GenericsUtils?

      Attachments

        Issue Links

          Activity

            People

              daniel_sun Daniel Sun
              emilles Eric Milles
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: