JDK-8004094 : Javac compiler error - synthetic method accessor generated with duplicate name
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 5.0u39,6u39,7u13,8-pool
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2012-11-28
  • Updated: 2013-06-26
  • Resolved: 2012-12-10
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other JDK 6 JDK 7 JDK 8
5.0u55Fixed 6u60Fixed 7u40Fixed 8 b69Fixed
Related Reports
Duplicate :  
Description
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: