< prev index next >
src/hotspot/share/classfile/verificationType.cpp
Print this page
@@ -1,7 +1,7 @@
/*
- * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
@@ -109,10 +109,13 @@
from_field_is_protected, from.is_array(), from.is_object(), THREAD);
} else if (is_array() && from.is_array()) {
VerificationType comp_this = get_component(context, CHECK_false);
VerificationType comp_from = from.get_component(context, CHECK_false);
+ // This code implements non-covariance between value type arrays and both
+ // arrays of objects and arrays of interface types. If covariance is
+ // supported for value type arrays then this code should be removed.
if (comp_from.is_valuetype() && !comp_this.is_null() && comp_this.is_reference()) {
// An array of value types is not assignable to an array of java.lang.Objects.
if (comp_this.name() == vmSymbols::java_lang_Object()) {
return false;
}
< prev index next >