JDK-8067111 : Exception in compiler: java.lang.AssertionError: isSubClass E
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 8u20
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: windows_7
  • CPU: x86_64
  • Submitted: 2014-09-23
  • Updated: 2015-04-06
  • Resolved: 2014-12-11
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.
JDK 8
8u40 b08Fixed
Related Reports
Duplicate :  
Relates :  
Relates :  
Relates :  
Description
FULL PRODUCT VERSION :
java version "1.8.0_20"
Java(TM) SE Runtime Environment (build 1.8.0_20-b26)
Java HotSpot(TM) 64-Bit Server VM (build 25.20-b23, mixed mode)

AND

java version "1.8.0_40-ea"
Java(TM) SE Runtime Environment (build 1.8.0_40-ea-b06)
Java HotSpot(TM) 64-Bit Server VM (build 25.40-b10, mixed mode)

ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows [Version 6.1.7601]

AND

Linux ***** 2.6.32-431.3.1.el6.x86_64 #1 SMP Fri Dec 13 06:58:20 EST 2013 x86_64 x86_64 x86_64 GNU/Linux


A DESCRIPTION OF THE PROBLEM :
Assertion in javac while compiling classes

REGRESSION.  Last worked in version 7u67

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Run JAVAC to compile the given two classes:

> javac Entity.java MyClass.java

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The files are compiled without errors.
ACTUAL -
A java.lang.AssertionError is thrown in the compiler.

Entity.class is generated, but not MyClass.class

ERROR MESSAGES/STACK TRACES THAT OCCUR :
An exception has occurred in the compiler (1.8.0_40-ea). 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.

java.lang.AssertionError: isSubClass E
        at com.sun.tools.javac.code.Symbol.isSubClass(Symbol.java:447)
        at com.sun.tools.javac.code.Symbol.isMemberOf(Symbol.java:456)
        at com.sun.tools.javac.code.Symbol$MethodSymbol.overrides(Symbol.java:1469)
        at com.sun.tools.javac.code.Types$ImplementationCache.implementationInternal(Types.java:2671)
        at com.sun.tools.javac.code.Types$ImplementationCache.get(Types.java:2653)
        at com.sun.tools.javac.code.Types.implementation(Types.java:2682)
        at com.sun.tools.javac.code.Symbol$MethodSymbol.implementation(Symbol.java:1529)
        at com.sun.tools.javac.code.Symbol$MethodSymbol.implementation(Symbol.java:1518)
        at com.sun.tools.javac.comp.Resolve.notOverriddenIn(Resolve.java:416)
        at com.sun.tools.javac.comp.Resolve.isAccessible(Resolve.java:402)
        at com.sun.tools.javac.comp.Resolve.isAccessible(Resolve.java:362)
        at com.sun.tools.javac.comp.Resolve.selectBest(Resolve.java:1448)
        at com.sun.tools.javac.comp.Resolve.findMethodInScope(Resolve.java:1618)
        at com.sun.tools.javac.comp.Resolve.findMethod(Resolve.java:1689)
        at com.sun.tools.javac.comp.Resolve.findMethod(Resolve.java:1662)
        at com.sun.tools.javac.comp.DeferredAttr$DeferredChecker$2.lookup(DeferredAttr.java:1325)
        at com.sun.tools.javac.comp.Resolve.lookupMethod(Resolve.java:3325)
        at com.sun.tools.javac.comp.Resolve.lookupMethod(Resolve.java:3310)
        at com.sun.tools.javac.comp.DeferredAttr$DeferredChecker.quicklyResolveMethod(DeferredAttr.java:1333)
        at com.sun.tools.javac.comp.DeferredAttr$DeferredChecker.visitApply(DeferredAttr.java:1223)
        at com.sun.tools.javac.tree.JCTree$JCMethodInvocation.accept(JCTree.java:1465)
        at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49)
        at com.sun.tools.javac.comp.DeferredAttr$FilterScanner.scan(DeferredAttr.java:901)
        at com.sun.tools.javac.comp.DeferredAttr$DeferredChecker.visitConditional(DeferredAttr.java:1195)
        at com.sun.tools.javac.tree.JCTree$JCConditional.accept(JCTree.java:1237)
        at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49)
        at com.sun.tools.javac.comp.DeferredAttr$FilterScanner.scan(DeferredAttr.java:901)
        at com.sun.tools.javac.comp.DeferredAttr.isDeferred(DeferredAttr.java:1088)
        at com.sun.tools.javac.comp.Attr.attribArgs(Attr.java:701)
        at com.sun.tools.javac.comp.Attr.visitApply(Attr.java:1834)
        at com.sun.tools.javac.tree.JCTree$JCMethodInvocation.accept(JCTree.java:1465)
        at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:607)
        at com.sun.tools.javac.comp.Attr.visitReturn(Attr.java:1704)
        at com.sun.tools.javac.tree.JCTree$JCReturn.accept(JCTree.java:1384)
        at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:607)
        at com.sun.tools.javac.comp.Attr.attribStat(Attr.java:676)
        at com.sun.tools.javac.comp.Attr.attribStats(Attr.java:692)
        at com.sun.tools.javac.comp.Attr.visitBlock(Attr.java:1142)
        at com.sun.tools.javac.tree.JCTree$JCBlock.accept(JCTree.java:909)
        at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:607)
        at com.sun.tools.javac.comp.Attr.attribStat(Attr.java:676)
        at com.sun.tools.javac.comp.Attr.visitMethodDef(Attr.java:1035)
        at com.sun.tools.javac.tree.JCTree$JCMethodDecl.accept(JCTree.java:778)
        at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:607)
        at com.sun.tools.javac.comp.Attr.attribStat(Attr.java:676)
        at com.sun.tools.javac.comp.Attr.attribClassBody(Attr.java:4342)
        at com.sun.tools.javac.comp.Attr.attribClass(Attr.java:4252)
        at com.sun.tools.javac.comp.Attr.attribClass(Attr.java:4181)
        at com.sun.tools.javac.comp.Attr.attrib(Attr.java:4156)
        at com.sun.tools.javac.main.JavaCompiler.attribute(JavaCompiler.java:1248)
        at com.sun.tools.javac.main.JavaCompiler.compile2(JavaCompiler.java:901)
        at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:860)
        at com.sun.tools.javac.main.Main.compile(Main.java:523)
        at com.sun.tools.javac.main.Main.compile(Main.java:381)
        at com.sun.tools.javac.main.Main.compile(Main.java:370)
        at com.sun.tools.javac.main.Main.compile(Main.java:361)
        at com.sun.tools.javac.Main.compile(Main.java:56)
        at com.sun.tools.javac.Main.main(Main.java:42)

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
Entity.java
========

public abstract class Entity {
	public abstract String getName(String type);

	public final String getName() {
		return getName("DEFAULT");
	}
}

MyClass.java
==========

public class MyClass<E extends Entity> {
	protected boolean test(E value, String name, String type) {
		return name.equals((type != null) ? value.getName(type) : value.getName());
	}
}
---------- END SOURCE ----------

CUSTOMER SUBMITTED WORKAROUND :
Switch 'getName' methods like this:

Entity.java
========

public abstract class Entity {
	public final String getName() {
		return getName("DEFAULT");
	}

	public abstract String getName(String type);
}




Comments
Submitter confirmed back saying: "My issue on Javac assertionError has been fix in the last early access."
11-12-2014

Tested with 8u40 build 8 and confirmed resolved. Sent an email to the submitter to reconfirm at his end.
10-12-2014