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

GroovyScripeEngine fails to properly reload when dependent class is updated



    • 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


      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.


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



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


              • Created: