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

remove timestamp fields for better hotswap

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.7.1
    • 2.4.0-beta-4
    • bytecode
    • None

    Description

      While debugging I try to hot swap a groovy class.
      It always fails with messages "Schema change not implemented. Operation not supported by VM".

      With Java classes there is no such problem - hot swap works as long as I don't add/remove any field or method or change a method signature.

      I had hoped to gradually convert my Java app to groovy, but this made me refrain from using groovy for anything more complex than "java" beans.

      Looking at the bytecode with javap, it is obvious where the problem is:
      There is an artifical field that changes its name on each compilation.
      Initial:
      public static java.lang.Long _timeStamp_239_neverHappen1268432715287;
      After recompilation:
      public static java.lang.Long _timeStamp_239_neverHappen1268433121889;

      What is this field used for? Can't we get rid of it?
      All other fields/methods look the same after recompilation, so I am pretty sure that hot swap will work without this field change.

      Attachments

        1. timestamp.patch
          5 kB
          Jochen Theodorou

        Issue Links

          Activity

            People

              melix Cédric Champeau
              stephen.friedrich Stephen Friedrich
              Votes:
              3 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: