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

GroovyScripeEngine fails to properly reload when dependent class is updated

Agile BoardAttach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.8.1
    • 2.0.5, 1.8.9
    • GroovyScriptEngine
    • 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. 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

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

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

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment