Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8004094

Javac compiler error - synthetic method accessor generated with duplicate name

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2 P2
    • 8
    • 5.0u39, 6u39, 7u13, 8-pool
    • tools
    • None
    • b69
    • Verified


        SHORT SUMMARY:
        javac compiler error - synthetic method accessor generated with duplicate
        name

        INDICATORS:
          Problem Statement
          =================
          Customer's code compiles fine inside eclipse but fails when the compile is
          attempted on the command line.

          Issue Clarification
          ===================
          This is a problem where the javac compiler gives an error
          Error is:
          CompileIssue3.java:4: error: types CompileIssue2<Object> and CompileIssue1
          are incompatible; both define access$000(), but with unrelated return types
          public class CompileIssue3 extends CompileIssue2<Object> {

          There are four files in the test case.
          If the four files are compiled together, the failure is seen.
          If the order in which the files are compiled is changed, no failure is
        seen.
          If the files are compiled individually, no failure is seen.

          system configuration
          ====================
          The customer is using eclipse on Windows XP.
          I have reproduced in on Solaris 10 Update 4 x86.

          % cat /etc/release
                                  Solaris 10 8/07 s10x_u4wos_12b X86


          For the customer, with his real code, this fails on java 5.0, 6.0 and 7.0.

          support work
          ============
          The behavior is the same on all the versions that I tested.
          5u19 and 7u07. Then I tested on:

          % javac -version "@javacOpts.txt"
          javac 1.5.0_38
          CompileIssue3.java:4: types CompileIssue2<java.lang.Object> and
          CompileIssue2<java.lang.Object> are incompatible; both define access$000(),
          but with unrelated return types
          public class CompileIssue3 extends CompileIssue2<Object> {
                 ^
          1 error

          = = = = = = =
          
          % javac -version
          javac 1.7.0_12-ea
          % javac "@javacOpts.txt"
          CompileIssue3.java:4: error: types CompileIssue2<Object> and CompileIssue1
          are incompatible; both define access$000(), but with unrelated return types
          public class CompileIssue3 extends CompileIssue2<Object> {
                 ^
          1 error
          %


        COUNTER INDICATORS:
        TRIGGERS:
        KNOWN WORKAROUND:
        PRESENT SINCE:
        HOW TO VERIFY:

        Uploaded Files
        ==============
        CompileIssue.zip containing:

        CompileIssue1.java
        CompileIssue2.java
        CompileIssue3.java
        CompileIssueEnum.java
        javacOpts.txt

        Possible Solutions
        ==================
        Changing the order in which the files are compiled allows the compile to
        work
        % cat javac*
        CompileIssue1.java CompileIssue2.java CompileIssue3.java
        CompileIssueEnum.java
        CompileIssue2.java CompileIssue1.java CompileIssue3.java
        CompileIssueEnum.java
        CompileIssue3.java CompileIssue2.java CompileIssue1.java
        CompileIssueEnum.java
        % javac -version
        javac 1.7.0_12-ea
        % javac "@javacOpts.txt"
        CompileIssue3.java:4: error: types CompileIssue1 and CompileIssue2<Object>
        are incompatible; both define access$000(), but with unrelated return types
        public class CompileIssue3 extends CompileIssue2<Object> {
               ^
        1 error
        % javac "@javacOpts1.txt"
        CompileIssue3.java:4: error: types CompileIssue2<Object> and CompileIssue1
        are incompatible; both define access$000(), but with unrelated return types
        public class CompileIssue3 extends CompileIssue2<Object> {
               ^
        1 error
        % javac "@javacOpts2.txt"
        % [ compile succeeds ]

        NOTES FOR SE:
        REGRESSION:

              mcimadamore Maurizio Cimadamore
              webbuggrp Webbug Group
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: