Default method returns true for a while, and then returns false? (Possible JVM bug)

This is a known bug in Java8.

See this Jira: CHA ignores default methods during analysis leading to incorrect code generation

This blog entry is enlightening....

Update / Summary:

  • issue identified before b127, and fixed in b127 ( JDK-8031695 )
  • issue reappeared (or a similar issue appeared) in b129 ( JDK-8036100 )
  • issue has been 'worked around' (disable the optimization that was failing) in b132 ( available here )
  • issue also logged for a 'proper' fix for later ( JDK-8036153 )

Previous Notes

I have reproduced this issue with:

Claims that this issue is resolved in b127 are confusing since I see it clearly in b129 (unless I am confused about the JVM version conventions...)

C:\Java8\jdk-1.8.0_01\bin>java -version
java version "1.8.0"
Java(TM) SE Runtime Environment (build 1.8.0-b129)
Java HotSpot(TM) 64-Bit Server VM (build 25.0-b69, mixed mode)

C:\Java8\jdk-1.8.0_01\bin>

Adding System.out.println(System.getProperties());

{
java.runtime.name=Java(TM) SE Runtime Environment, 
java.runtime.version=1.8.0-b129, 
java.vm.specification.name=Java Virtual Machine Specification, 
java.vm.name=Java HotSpot(TM) 64-Bit Server VM, 
java.vm.version=25.0-b69, 
java.vm.vendor=Oracle Corporation, 
java.vendor.url=http://java.oracle.com/, 
java.vm.specification.version=1.8, 
java.specification.name=Java Platform API Specification, 
java.specification.version=1.8, 
java.specification.vendor=Oracle Corporation, 
java.class.version=52.0, 
sun.boot.library.path=C:\Java8\jdk-1.8.0_01\jre\bin, 
sun.java.launcher=SUN_STANDARD, 
sun.os.patch.level=Service Pack 1, 
java.endorsed.dirs=C:\Java8\jdk-1.8.0_01\jre\lib\endorsed, 
os.arch=amd64, 
java.vm.specification.vendor=Oracle Corporation, 
os.name=Windows 7, 
sun.jnu.encoding=Cp1252, 
java.library.path=C:\Java8\jdk-1.8.0_01\bin;......, 
sun.management.compiler=HotSpot 64-Bit Tiered Compilers, 
os.version=6.1, 
file.encoding=UTF-8, 
sun.java.command=fromso.IsolatedBug, 
java.home=C:\Java8\jdk-1.8.0_01\jre, 
sun.arch.data.model=64, 
user.language=en, 
java.ext.dirs=C:\Java8\jdk-1.8.0_01\jre\lib\ext;C:\windows\Sun\Java\lib\ext,

sun.boot.class.path=C:\Java8\jdk-1.8.0_01\jre\lib\resources.jar;......,
java.vendor=Oracle Corporation, 
file.separator=\, 
java.vendor.url.bug=http://bugreport.sun.com/bugreport/, 
sun.io.unicode.encoding=UnicodeLittle, 
sun.cpu.endian=little, 
sun.desktop=windows, 
sun.cpu.isalist=amd64
}