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

GroovyScripeEngine fails to properly reload when dependent class is updated

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.8.1
    • Fix Version/s: 2.0.5, 1.8.9
    • Component/s: GroovyScriptEngine
    • Labels:
    • Environment:
      Win 7 64bit, OSX Lion

      Description

      Let's say you have 2 scripts : script1 and script2 and they both use class BeanX and they are all loaded via the same GroovyScriptEngine instance. If I modify BeanX, the script that is the first to get loaded and references BeanX will reflect changes made to BeanX, while the other or second script to reference BeanX will fail to reflect changes made to BeanX.

      I'm assuming this is not the proper behavior, although I don't see any test to test for this scenario. If one is using groovy via Groovlets or something like Gaelyk where the assumption is that I can write
      scripts and hot have to constantly restart to have my changes reflected then I would assume the GSE should reload classes and dependent classes regardless of the order in which they are referenced.

      Test attached.

        Attachments

        1. GroovyScriptEngineReloadingSlowTest.groovy
          1 kB
          Frans van Buul
        2. patch4975_main.txt
          0.8 kB
          Frans van Buul
        3. patch4975_test.txt
          5 kB
          Frans van Buul
        4. patch4975_v2.txt
          13 kB
          Frans van Buul
        5. ReloadTest.groovy
          4 kB
          Derek Smith
        6. ReloadTestJava.java
          6 kB
          Derek Smith

          Activity

            People

            • Assignee:
              blackdrag Jochen Theodorou
              Reporter:
              dsmith Derek Smith
            • Votes:
              4 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: