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

SC: set groovy property written for variable expression assignment that should be direct setter call

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 4.0.0-alpha-1, 3.0.6, 2.5.15
    • None
    • None

    Description

      Consider the following:

      class A {
        void setX(Date value) {}
        void setX(Long value) {}
      }
      class B extends A {
        void m() {
          x = 42L
          x = new Date()
        }
      }
      

      When compiled with @compileStatic the method "m" contains calls to ScriptBytecodeAdapter.setGroovyObjectProperty for the assignment statements. If "x" is replaced by "this.x" direct setter calls are written instead, as expected.

      Attachments

        Activity

          People

            emilles Eric Milles
            emilles Eric Milles
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 20m
                20m