8173163: searching for a versioned entry in a multi-release jar in hotspot is inconsistent with java code

Use the highest versioned entry if the specified version is higher than the current jdk version

Reviewed-by: iklam, sspitsyn, jiangli
This commit is contained in:
Calvin Cheung 2017-01-26 10:17:06 -08:00
parent 8c46b8e160
commit 3520dcfe62

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2017, 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
@ -364,7 +364,12 @@ u1* ClassPathZipEntry::open_versioned_entry(const char* name, jint* filesize, TR
if (verstr != NULL) {
version = atoi(verstr);
if (version < base_version || version > cur_ver) {
is_multi_ver = false;
// If the specified version is lower than the base version, the base
// entry will be used; if the version is higher than the current
// jdk version, the highest versioned entry will be used.
if (version < base_version) {
is_multi_ver = false;
}
// print out warning, do not use assertion here since it will continue to look
// for proper version.
warning("JDK%d is not supported in multiple version jars", version);