Groovy
  1. Groovy
  2. GROOVY-3318

Javac doesn't see synthetic Groovy methods in Groovy-compiled superclass

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Duplicate
    • Affects Version/s: 1.6-rc-2
    • Fix Version/s: 1.6.6, 1.7-rc-1
    • Component/s: None
    • Labels:
      None

      Description

      Create a Foo.groovy class containing:

      abstract class Foo {}

      and Bar.java with:

      class Bar extends Foo {}.

      After that you compile the first file with groovyc (1.6) and the other one
      with javac (1.5 or 1.6):

      C:\sdks\groovy-1.6-RC-1>set GROOVY_HOME=c:\sdks\groovy-1.6-RC-1\

      C:\sdks\groovy-1.6-RC-1\bin>set path=c:\sdks\groovy-1.6-RC-1\bin\;%path%

      C:\temp>groovyc Foo.groovy

      C:\temp>c:\jdk1.5.0_08\bin\javac.exe -classpath c:\sdks\groovy-1.6-RC-1\embeddable\groovy-all-1.6-RC-1.jar;. Bar.java
      Bar.java:1: Bar is not abstract and does not override abstract method setMetaClass(groovy.lang.MetaClass) in groovy.lang.GroovyObject
      class Bar extends Foo {}
      ^
      1 error

      Foo.jad contains the required setMetaClass method, but it's synthetic. Javac doesn't consider synthetic methods to be the ones already implementing what it wants. The abstractness of Foo is important, otherwise everything works. The same may apply not only to GroovyObject MOP methods, but also to generated property accessors.

        Issue Links

          Activity

          Peter Gromov created issue -
          Hide
          Jochen Theodorou added a comment -

          we have to either remove the synthetic flag from these methods or do that only for abstract classes. I would do the later.

          Show
          Jochen Theodorou added a comment - we have to either remove the synthetic flag from these methods or do that only for abstract classes. I would do the later.
          Guillaume Delcroix made changes -
          Field Original Value New Value
          Fix Version/s 1.6.1 [ 14852 ]
          Fix Version/s 1.6.2 [ 15151 ]
          Guillaume Delcroix made changes -
          Fix Version/s 1.6.2 [ 15151 ]
          Fix Version/s 1.6.3 [ 15251 ]
          Guillaume Delcroix made changes -
          Fix Version/s 1.7-beta-1 [ 14014 ]
          Fix Version/s 1.6.3 [ 15251 ]
          Guillaume Delcroix made changes -
          Fix Version/s 1.7-beta-1 [ 14014 ]
          Fix Version/s 1.7-beta-x [ 15538 ]
          Hide
          Roshan Dawrani added a comment -

          This issue has now been fixed under GROOVY-3877 - so, I guess, this one can be marked duplicate and closed.

          Show
          Roshan Dawrani added a comment - This issue has now been fixed under GROOVY-3877 - so, I guess, this one can be marked duplicate and closed.
          Roshan Dawrani made changes -
          Link This issue duplicates GROOVY-3877 [ GROOVY-3877 ]
          Hide
          Roshan Dawrani added a comment -

          Duplicate - fixed under GROOVY-3877.

          Show
          Roshan Dawrani added a comment - Duplicate - fixed under GROOVY-3877 .
          Roshan Dawrani made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Resolution Duplicate [ 3 ]
          Jochen Theodorou made changes -
          Fix Version/s 1.6.6 [ 15781 ]
          Fix Version/s 1.7.X [ 15538 ]
          Assignee Jochen Theodorou [ blackdrag ]
          Fix Version/s 1.7-rc-1 [ 14666 ]
          Jochen Theodorou made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Mark Thomas made changes -
          Project Import Sun Apr 05 13:32:57 UTC 2015 [ 1428240777691 ]
          Mark Thomas made changes -
          Workflow jira [ 12732314 ] Default workflow, editable Closed status [ 12744118 ]
          Mark Thomas made changes -
          Project Import Mon Apr 06 02:11:23 UTC 2015 [ 1428286283443 ]
          Mark Thomas made changes -
          Workflow jira [ 12970139 ] Default workflow, editable Closed status [ 12977913 ]
          Transition Time In Source Status Execution Times Last Executer Last Execution Date
          Open Open Resolved Resolved
          336d 20h 7m 1 Roshan Dawrani 01/Jan/10 07:16
          Resolved Resolved Closed Closed
          3m 2s 1 Jochen Theodorou 01/Jan/10 07:19

            People

            • Assignee:
              Jochen Theodorou
              Reporter:
              Peter Gromov
            • Votes:
              2 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development