--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Types.java Thu Jul 12 12:06:22 2018 -0700
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Types.java Thu Jul 12 14:13:15 2018 -0700
@@ -89,7 +89,6 @@
final Symtab syms;
final JavacMessages messages;
final Names names;
- final boolean allowObjectToPrimitiveCast;
final boolean allowDefaultMethods;
final boolean mapCapturesToBounds;
final Check chk;
@@ -113,7 +112,6 @@
syms = Symtab.instance(context);
names = Names.instance(context);
Source source = Source.instance(context);
- allowObjectToPrimitiveCast = Feature.OBJECT_TO_PRIMITIVE_CAST.allowedInSource(source);
allowDefaultMethods = Feature.DEFAULT_METHODS.allowedInSource(source);
mapCapturesToBounds = Feature.MAP_CAPTURES_TO_BOUNDS.allowedInSource(source);
chk = Check.instance(context);
@@ -1639,8 +1637,7 @@
if (t.isPrimitive() != s.isPrimitive()) {
t = skipTypeVars(t, false);
return (isConvertible(t, s, warn)
- || (allowObjectToPrimitiveCast &&
- s.isPrimitive() &&
+ || (s.isPrimitive() &&
isSubtype(boxedClass(s).type, t)));
}
if (warn != warnStack.head) {