Bug 1015612 - java-1.7.0-openjdk: java.lang.ClassCastException: com.sun.tools.javac.tree.JCTree$JCFieldAccess
java-1.7.0-openjdk: java.lang.ClassCastException: com.sun.tools.javac.tree.JC...
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: java-1.7.0-openjdk (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: rc
: ---
Assigned To: Andrew John Hughes
Lukas Zachar
Depends On:
  Show dependency treegraph
Reported: 2013-10-04 11:28 EDT by Stanislav Ochotnicky
Modified: 2016-11-03 18:58 EDT (History)
9 users (show)

See Also:
Fixed In Version: java-1.7.0-openjdk-
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2016-11-03 18:58:03 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Simplified reproducer (53.58 KB, text/x-java)
2013-10-08 10:59 EDT, Mikolaj Izdebski
no flags Details

External Trackers
Tracker ID Priority Status Summary Last Updated
Icedtea Bugzilla 3012 None None None 2016-06-13 21:45 EDT
openjdk bug system JDK-8069181 None None None 2016-06-13 21:44 EDT

  None (edit)
Description Stanislav Ochotnicky 2013-10-04 11:28:52 EDT
Description of problem:
java-1.7.0-openjdk throws ClassCastException when building apache-commons-el[1]:

    [javac] An exception has occurred in the compiler (1.7.0_40). Please file a bug at the Java Developer Connection (http://java.sun.com/webapps/bugreport)  after checking the Bug Parade for duplicates. Include your program and the following diagnostic in your report.  Thank you.
    [javac] java.lang.ClassCastException: com.sun.tools.javac.tree.JCTree$JCFieldAccess cannot be cast to com.sun.tools.javac.tree.JCTree$JCIdent
    [javac] 	at com.sun.tools.javac.comp.MemberEnter.visitVarDef(MemberEnter.java:629)
    [javac] 	at com.sun.tools.javac.tree.JCTree$JCVariableDecl.accept(JCTree.java:725)
    [javac] 	at com.sun.tools.javac.comp.MemberEnter.memberEnter(MemberEnter.java:401)
    [javac] 	at com.sun.tools.javac.comp.Attr.visitVarDef(Attr.java:855)
    [javac] 	at com.sun.tools.javac.tree.JCTree$JCVariableDecl.accept(JCTree.java:725)
    [javac] 	at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:431)
    [javac] 	at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:418)
    [javac] 	at com.sun.tools.javac.comp.Attr.attribStat(Attr.java:480)

[1] http://koji.fedoraproject.org/koji/taskinfo?taskID=6024885

Version-Release number of selected component (if applicable):
1:  but I can reproduce on F19 with java-1.7.0-openjdk- as well
Comment 1 Pavel Tisnovsky 2013-10-08 10:26:46 EDT
This issue seems to be caused by the following change made in OpenJDK7:

changeset:   1483:7e2c650b86bc
user:        mcimadamore
date:        Wed May 29 14:49:14 2013 +0100
summary:     7160084: javac fails to compile an apparently valid class/interface combination


Is it possible to cooperate on creating a simple reproducer which could be send to upstream?
Comment 2 Mikolaj Izdebski 2013-10-08 10:59:37 EDT
Created attachment 809349 [details]
Simplified reproducer

$ wget http://repo1.maven.org/maven2/commons-el/commons-el/1.0/commons-el-1.0.jar

$ javac -source 1.3 ELParser.java -cp commons-el-1.0.jar
Comment 3 Mikolaj Izdebski 2013-10-08 11:04:58 EDT
The problem seems to be enum *identifier* (valid in Java 1.4 and older).
Comment 4 Pavel Tisnovsky 2013-10-15 10:38:31 EDT
Mikolaj, I'm able to reproduce it even on OpenJDK8 and Oracle JDK8, because this change have been backported from 8 as far as I knwo. TY, I'm working on it.
Comment 6 Jaroslav Reznik 2015-03-03 10:07:27 EST
This bug appears to have been reported against 'rawhide' during the Fedora 22 development cycle.
Changing version to '22'.

More information and reason for this action is here:
Comment 7 Andrew John Hughes 2016-05-04 14:50:09 EDT
This is now fixed in OpenJDK 8 by:


but Oracle didn't backport it to 7, so the bug remains there.

As 7 is no longer in Fedora, turning this into a RHEL bug.
Comment 12 errata-xmlrpc 2016-11-03 18:58:03 EDT
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.


Note You need to log in before you can comment on or make changes to this bug.