United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-8004094 Javac compiler error - synthetic method accessor generated with duplicate name
JDK-8004094 : Javac compiler error - synthetic method accessor generated with duplicate name

Details
Type:
Bug
Submit Date:
2012-11-28
Status:
Closed
Updated Date:
2013-06-22
Project Name:
JDK
Resolved Date:
2012-12-10
Component:
tools
OS:
Sub-Component:
javac
CPU:
Priority:
P2
Resolution:
Fixed
Affected Versions:
5.0u39,6u39,7u13,8-pool
Fixed Versions:

Related Reports
Backport:
Backport:
Backport:
Backport:
Duplicate:

Sub Tasks

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:


                                    

Comments
URL:   http://hg.openjdk.java.net/jdk8/tl/langtools/rev/c78acf6c2f3e
User:  mcimadamore
Date:  2012-12-10 12:31:54 +0000

                                     
2012-12-10
URL:   http://hg.openjdk.java.net/jdk8/jdk8/langtools/rev/c78acf6c2f3e
User:  lana
Date:  2012-12-18 21:11:08 +0000

                                     
2012-12-18



Hardware and Software, Engineered to Work Together