Bug 1015612 - java-1.7.0-openjdk: java.lang.ClassCastException: com.sun.tools.javac.tree.JCTree$JCFieldAccess
Summary: java-1.7.0-openjdk: java.lang.ClassCastException: com.sun.tools.javac.tree.JC...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: java-1.7.0-openjdk
Version: 7.2
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Andrew John Hughes
QA Contact: Lukáš Zachar
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-10-04 15:28 UTC by Stanislav Ochotnicky
Modified: 2016-11-03 22:58 UTC (History)
9 users (show)

Fixed In Version: java-1.7.0-openjdk-1.7.0.101-2.6.6.6.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-11-03 22:58:03 UTC
Target Upstream Version:


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


Links
System ID Private Priority Status Summary Last Updated
Icedtea Bugzilla 3012 0 None None None 2016-06-14 01:45:05 UTC
Red Hat Product Errata RHBA-2016:2140 0 normal SHIPPED_LIVE java-1.7.0-openjdk bug fix and enhancement update 2016-11-03 13:12:14 UTC
openjdk bug system JDK-8069181 0 None None None 2016-06-14 01:44:34 UTC

Description Stanislav Ochotnicky 2013-10-04 15:28:52 UTC
Description of problem:
java-1.7.0-openjdk throws ClassCastException when building apache-commons-el[1]:

Snippet: 
    [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:1.7.0.60-2.4.2.5.fc21  but I can reproduce on F19 with java-1.7.0-openjdk-1.7.0.60-2.4.2.4.fc19.x86_64 as well

Comment 1 Pavel Tisnovsky 2013-10-08 14:26:46 UTC
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

http://hg.openjdk.java.net/jdk7u/jdk7u/langtools/rev/7e2c650b86bc

Is it possible to cooperate on creating a simple reproducer which could be send to upstream?

Comment 2 Mikolaj Izdebski 2013-10-08 14:59:37 UTC
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 15:04:58 UTC
The problem seems to be enum *identifier* (valid in Java 1.4 and older).

Comment 4 Pavel Tisnovsky 2013-10-15 14:38:31 UTC
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 15:07:27 UTC
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:
https://fedoraproject.org/wiki/Fedora_Program_Management/HouseKeeping/Fedora22

Comment 7 Andrew John Hughes 2016-05-04 18:50:09 UTC
This is now fixed in OpenJDK 8 by:

https://bugs.openjdk.java.net/browse/JDK-8069181

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 22:58:03 UTC
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.

https://rhn.redhat.com/errata/RHBA-2016-2140.html


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