Merge
This commit is contained in:
commit
08af24d8f2
4
.hgtags
4
.hgtags
@ -1,3 +1,5 @@
|
||||
fa3e76b477829afc4476f0b725cfaa440a6fd917 jdk-9+157
|
||||
b5015f742ba648184bb7fc547197bd33ebfde30d jdk-9+158
|
||||
1cc8dd79fd1cd13d36b385196271a29632c67c3b jdk7-b24
|
||||
bf2517e15f0c0f950e5b3143c4ca11e2df73dcc1 jdk7-b25
|
||||
5ae7db536e3fcf6be78e45b240a9058095e0ed38 jdk7-b26
|
||||
@ -399,3 +401,5 @@ d7034ff7f8e257e81c9f95c7785dd4eaaa3c2afc jdk-9+153
|
||||
8c70d170e62c0c58b5bc3ba666bd140399b98c9c jdk-10+0
|
||||
45b751afd11e6c05991cf4913c5a0ac3304fcc4e jdk-9+154
|
||||
f4aff695ffe05cfdb69d8af25a4ddc6a029754ea jdk-9+155
|
||||
06bce0388880b5ff8e040e4a9d72a3ea11dac321 jdk-9+156
|
||||
74116beae88a8f17a80301aa6c83865c82f10ece jdk-10+1
|
||||
|
@ -396,5 +396,9 @@ b119012d1c2ab2570fe8718633840d0c1f1f441d jdk-9+149
|
||||
71a766d4c18041a7f833ee22823125b02e1a7f1e jdk-9+151
|
||||
ef056360ddf3977d7d2ddbeb456a4d612d19ea05 jdk-9+152
|
||||
816a6d03a7c44edfbd8780110529f1bdc3964fb9 jdk-9+153
|
||||
8d22611ffb6540bc1ace64a00c048c8b82d8c69a jdk-10+0
|
||||
8d26916eaa21b689835ffc1c0dbf12470aa9be61 jdk-9+154
|
||||
688a3863c00ebc089ab17ee1fc46272cbbd96815 jdk-9+155
|
||||
783ec7542cf7154e5d2b87f55bb97d28f81e9ada jdk-9+156
|
||||
4eb77fb98952dc477a4229575c81d2263a9ce711 jdk-9+157
|
||||
a4087bc10a88a43ea3ad0919b5b4af1c86977221 jdk-9+158
|
||||
|
@ -1 +1 @@
|
||||
project=jdk9
|
||||
project=jdk10
|
||||
|
@ -1202,6 +1202,18 @@ AC_DEFUN_ONCE([BASIC_TEST_USABILITY_ISSUES],
|
||||
# Check for support for specific options in bash
|
||||
AC_DEFUN_ONCE([BASIC_CHECK_BASH_OPTIONS],
|
||||
[
|
||||
# Check bash version
|
||||
# Extra [ ] to stop m4 mangling
|
||||
[ BASH_VER=`$BASH --version | $SED -n -e 's/^.*bash.*ersion *\([0-9.]*\).*$/\1/ p'` ]
|
||||
AC_MSG_CHECKING([bash version])
|
||||
AC_MSG_RESULT([$BASH_VER])
|
||||
|
||||
BASH_MAJOR=`$ECHO $BASH_VER | $CUT -d . -f 1`
|
||||
BASH_MINOR=`$ECHO $BASH_VER | $CUT -d . -f 2`
|
||||
if test $BASH_MAJOR -lt 3 || (test $BASH_MAJOR -eq 3 && test $BASH_MINOR -lt 2); then
|
||||
AC_MSG_ERROR([bash version 3.2 or better is required])
|
||||
fi
|
||||
|
||||
# Test if bash supports pipefail.
|
||||
AC_MSG_CHECKING([if bash supports pipefail])
|
||||
if ${BASH} -c 'set -o pipefail'; then
|
||||
|
@ -5170,7 +5170,7 @@ VS_SDK_PLATFORM_NAME_2013=
|
||||
#CUSTOM_AUTOCONF_INCLUDE
|
||||
|
||||
# Do not change or remove the following line, it is needed for consistency checks:
|
||||
DATE_WHEN_GENERATED=1486175373
|
||||
DATE_WHEN_GENERATED=1486679715
|
||||
|
||||
###############################################################################
|
||||
#
|
||||
@ -24092,6 +24092,20 @@ $as_echo "$tool_specified" >&6; }
|
||||
fi
|
||||
|
||||
|
||||
# Check bash version
|
||||
# Extra [ ] to stop m4 mangling
|
||||
BASH_VER=`$BASH --version | $SED -n -e 's/^.*bash.*ersion *\([0-9.]*\).*$/\1/ p'`
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking bash version" >&5
|
||||
$as_echo_n "checking bash version... " >&6; }
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $BASH_VER" >&5
|
||||
$as_echo "$BASH_VER" >&6; }
|
||||
|
||||
BASH_MAJOR=`$ECHO $BASH_VER | $CUT -d . -f 1`
|
||||
BASH_MINOR=`$ECHO $BASH_VER | $CUT -d . -f 2`
|
||||
if test $BASH_MAJOR -lt 3 || (test $BASH_MAJOR -eq 3 && test $BASH_MINOR -lt 2); then
|
||||
as_fn_error $? "bash version 3.2 or better is required" "$LINENO" 5
|
||||
fi
|
||||
|
||||
# Test if bash supports pipefail.
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if bash supports pipefail" >&5
|
||||
$as_echo_n "checking if bash supports pipefail... " >&6; }
|
||||
|
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2011, 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
|
||||
@ -25,7 +25,7 @@
|
||||
|
||||
# Default version numbers to use unless overridden by configure
|
||||
|
||||
DEFAULT_VERSION_MAJOR=9
|
||||
DEFAULT_VERSION_MAJOR=10
|
||||
DEFAULT_VERSION_MINOR=0
|
||||
DEFAULT_VERSION_SECURITY=0
|
||||
DEFAULT_VERSION_PATCH=0
|
||||
|
@ -361,8 +361,8 @@ jdk/src/java.base/share/native/libverify/check_code.c : jdk/src/share/native/com
|
||||
jdk/src/java.base/share/native/libverify/check_format.c : jdk/src/share/native/common/check_format.c
|
||||
jdk/src/java.base/share/native/libverify/opcodes.in_out : jdk/src/share/native/common/opcodes.in_out
|
||||
jdk/src/java.base/share/native/libzip : jdk/src/share/native/java/util/zip
|
||||
jdk/src/java.base/share/native/libzip/zlib-1.2.8 : jdk/src/share/native/java/util/zip/zlib-1.2.8
|
||||
jdk/src/java.base/share/native/libzip/zlib-1.2.8/patches/ChangeLog_java : jdk/src/share/native/java/util/zip/zlib-1.2.8/patches/ChangeLog_java
|
||||
jdk/src/java.base/share/native/libzip/zlib : jdk/src/share/native/java/util/zip/zlib
|
||||
jdk/src/java.base/share/native/libzip/zlib/patches/ChangeLog_java : jdk/src/share/native/java/util/zip/zlib/patches/ChangeLog_java
|
||||
jdk/src/java.base/unix/classes/java/io : jdk/src/solaris/classes/java/io
|
||||
jdk/src/java.base/unix/classes/java/lang : jdk/src/solaris/classes/java/lang
|
||||
jdk/src/java.base/unix/classes/java/net : jdk/src/solaris/classes/java/net
|
||||
|
@ -1080,7 +1080,7 @@ var getVersion = function (major, minor, security, patch) {
|
||||
+ "." + (minor != null ? minor : version_numbers.get("DEFAULT_VERSION_MINOR"))
|
||||
+ "." + (security != null ? security : version_numbers.get("DEFAULT_VERSION_SECURITY"))
|
||||
+ "." + (patch != null ? patch : version_numbers.get("DEFAULT_VERSION_PATCH"));
|
||||
while (version.match(".*\.0$")) {
|
||||
while (version.match(".*\\.0$")) {
|
||||
version = version.substring(0, version.length - 2);
|
||||
}
|
||||
return version;
|
||||
|
@ -1223,7 +1223,7 @@
|
||||
<in>check_format.c</in>
|
||||
</df>
|
||||
<df name="libzip">
|
||||
<df name="zlib-1.2.8">
|
||||
<df name="zlib">
|
||||
<in>compress.c</in>
|
||||
<in>deflate.c</in>
|
||||
<in>gzclose.c</in>
|
||||
@ -38283,7 +38283,7 @@
|
||||
<pElem>../../jdk/src/java.base/unix/native/include</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libjava</pElem>
|
||||
<pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem>
|
||||
<pElem>../../build/support/headers/java.base</pElem>
|
||||
<pElem>../../make</pElem>
|
||||
</incDir>
|
||||
@ -38304,7 +38304,7 @@
|
||||
<pElem>../../jdk/src/java.base/unix/native/include</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libjava</pElem>
|
||||
<pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem>
|
||||
<pElem>../../build/support/headers/java.base</pElem>
|
||||
<pElem>../../make</pElem>
|
||||
</incDir>
|
||||
@ -38325,7 +38325,7 @@
|
||||
<pElem>../../jdk/src/java.base/unix/native/include</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libjava</pElem>
|
||||
<pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem>
|
||||
<pElem>../../build/support/headers/java.base</pElem>
|
||||
<pElem>../../make</pElem>
|
||||
</incDir>
|
||||
@ -38346,7 +38346,7 @@
|
||||
<pElem>../../jdk/src/java.base/unix/native/include</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libjava</pElem>
|
||||
<pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem>
|
||||
<pElem>../../build/support/headers/java.base</pElem>
|
||||
<pElem>../../make</pElem>
|
||||
</incDir>
|
||||
@ -38367,7 +38367,7 @@
|
||||
<pElem>../../jdk/src/java.base/unix/native/include</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libjava</pElem>
|
||||
<pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem>
|
||||
<pElem>../../build/support/headers/java.base</pElem>
|
||||
<pElem>../../make</pElem>
|
||||
</incDir>
|
||||
@ -38377,14 +38377,14 @@
|
||||
</preprocessorList>
|
||||
</cTool>
|
||||
</item>
|
||||
<item path="../../jdk/src/java.base/share/native/libzip/zlib-1.2.8/compress.c"
|
||||
<item path="../../jdk/src/java.base/share/native/libzip/zlib/compress.c"
|
||||
ex="false"
|
||||
tool="0"
|
||||
flavor2="0">
|
||||
<cTool flags="4">
|
||||
</cTool>
|
||||
</item>
|
||||
<item path="../../jdk/src/java.base/share/native/libzip/zlib-1.2.8/deflate.c"
|
||||
<item path="../../jdk/src/java.base/share/native/libzip/zlib/deflate.c"
|
||||
ex="false"
|
||||
tool="0"
|
||||
flavor2="0">
|
||||
@ -38394,7 +38394,7 @@
|
||||
</preprocessorList>
|
||||
</cTool>
|
||||
</item>
|
||||
<item path="../../jdk/src/java.base/share/native/libzip/zlib-1.2.8/gzclose.c"
|
||||
<item path="../../jdk/src/java.base/share/native/libzip/zlib/gzclose.c"
|
||||
ex="false"
|
||||
tool="0"
|
||||
flavor2="0">
|
||||
@ -38404,7 +38404,7 @@
|
||||
</preprocessorList>
|
||||
</cTool>
|
||||
</item>
|
||||
<item path="../../jdk/src/java.base/share/native/libzip/zlib-1.2.8/gzlib.c"
|
||||
<item path="../../jdk/src/java.base/share/native/libzip/zlib/gzlib.c"
|
||||
ex="false"
|
||||
tool="0"
|
||||
flavor2="0">
|
||||
@ -38414,7 +38414,7 @@
|
||||
</preprocessorList>
|
||||
</cTool>
|
||||
</item>
|
||||
<item path="../../jdk/src/java.base/share/native/libzip/zlib-1.2.8/gzread.c"
|
||||
<item path="../../jdk/src/java.base/share/native/libzip/zlib/gzread.c"
|
||||
ex="false"
|
||||
tool="0"
|
||||
flavor2="0">
|
||||
@ -38424,7 +38424,7 @@
|
||||
</preprocessorList>
|
||||
</cTool>
|
||||
</item>
|
||||
<item path="../../jdk/src/java.base/share/native/libzip/zlib-1.2.8/gzwrite.c"
|
||||
<item path="../../jdk/src/java.base/share/native/libzip/zlib/gzwrite.c"
|
||||
ex="false"
|
||||
tool="0"
|
||||
flavor2="0">
|
||||
@ -38434,7 +38434,7 @@
|
||||
</preprocessorList>
|
||||
</cTool>
|
||||
</item>
|
||||
<item path="../../jdk/src/java.base/share/native/libzip/zlib-1.2.8/infback.c"
|
||||
<item path="../../jdk/src/java.base/share/native/libzip/zlib/infback.c"
|
||||
ex="false"
|
||||
tool="0"
|
||||
flavor2="0">
|
||||
@ -38444,7 +38444,7 @@
|
||||
</preprocessorList>
|
||||
</cTool>
|
||||
</item>
|
||||
<item path="../../jdk/src/java.base/share/native/libzip/zlib-1.2.8/inffast.c"
|
||||
<item path="../../jdk/src/java.base/share/native/libzip/zlib/inffast.c"
|
||||
ex="false"
|
||||
tool="0"
|
||||
flavor2="0">
|
||||
@ -38454,7 +38454,7 @@
|
||||
</preprocessorList>
|
||||
</cTool>
|
||||
</item>
|
||||
<item path="../../jdk/src/java.base/share/native/libzip/zlib-1.2.8/inflate.c"
|
||||
<item path="../../jdk/src/java.base/share/native/libzip/zlib/inflate.c"
|
||||
ex="false"
|
||||
tool="0"
|
||||
flavor2="0">
|
||||
@ -38464,7 +38464,7 @@
|
||||
</preprocessorList>
|
||||
</cTool>
|
||||
</item>
|
||||
<item path="../../jdk/src/java.base/share/native/libzip/zlib-1.2.8/inftrees.c"
|
||||
<item path="../../jdk/src/java.base/share/native/libzip/zlib/inftrees.c"
|
||||
ex="false"
|
||||
tool="0"
|
||||
flavor2="0">
|
||||
@ -38474,7 +38474,7 @@
|
||||
</preprocessorList>
|
||||
</cTool>
|
||||
</item>
|
||||
<item path="../../jdk/src/java.base/share/native/libzip/zlib-1.2.8/trees.c"
|
||||
<item path="../../jdk/src/java.base/share/native/libzip/zlib/trees.c"
|
||||
ex="false"
|
||||
tool="0"
|
||||
flavor2="0">
|
||||
@ -38484,7 +38484,7 @@
|
||||
</preprocessorList>
|
||||
</cTool>
|
||||
</item>
|
||||
<item path="../../jdk/src/java.base/share/native/libzip/zlib-1.2.8/uncompr.c"
|
||||
<item path="../../jdk/src/java.base/share/native/libzip/zlib/uncompr.c"
|
||||
ex="false"
|
||||
tool="0"
|
||||
flavor2="0">
|
||||
@ -38494,7 +38494,7 @@
|
||||
</preprocessorList>
|
||||
</cTool>
|
||||
</item>
|
||||
<item path="../../jdk/src/java.base/share/native/libzip/zlib-1.2.8/zadler32.c"
|
||||
<item path="../../jdk/src/java.base/share/native/libzip/zlib/zadler32.c"
|
||||
ex="false"
|
||||
tool="0"
|
||||
flavor2="0">
|
||||
@ -38504,7 +38504,7 @@
|
||||
</preprocessorList>
|
||||
</cTool>
|
||||
</item>
|
||||
<item path="../../jdk/src/java.base/share/native/libzip/zlib-1.2.8/zcrc32.c"
|
||||
<item path="../../jdk/src/java.base/share/native/libzip/zlib/zcrc32.c"
|
||||
ex="false"
|
||||
tool="0"
|
||||
flavor2="0">
|
||||
@ -38514,7 +38514,7 @@
|
||||
</preprocessorList>
|
||||
</cTool>
|
||||
</item>
|
||||
<item path="../../jdk/src/java.base/share/native/libzip/zlib-1.2.8/zutil.c"
|
||||
<item path="../../jdk/src/java.base/share/native/libzip/zlib/zutil.c"
|
||||
ex="false"
|
||||
tool="0"
|
||||
flavor2="0">
|
||||
@ -41203,7 +41203,7 @@
|
||||
<pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem>
|
||||
<pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem>
|
||||
<pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem>
|
||||
<pElem>../../jdk/src/java.base/linux/native/libjava</pElem>
|
||||
<pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libjava</pElem>
|
||||
@ -41232,7 +41232,7 @@
|
||||
<pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem>
|
||||
<pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem>
|
||||
<pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem>
|
||||
<pElem>../../jdk/src/java.base/linux/native/libjava</pElem>
|
||||
<pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libjava</pElem>
|
||||
@ -41261,7 +41261,7 @@
|
||||
<pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem>
|
||||
<pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem>
|
||||
<pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem>
|
||||
<pElem>../../jdk/src/java.base/linux/native/libjava</pElem>
|
||||
<pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libjava</pElem>
|
||||
@ -41290,7 +41290,7 @@
|
||||
<pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem>
|
||||
<pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem>
|
||||
<pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem>
|
||||
<pElem>../../jdk/src/java.base/linux/native/libjava</pElem>
|
||||
<pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libjava</pElem>
|
||||
@ -41319,7 +41319,7 @@
|
||||
<pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem>
|
||||
<pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem>
|
||||
<pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem>
|
||||
<pElem>../../jdk/src/java.base/linux/native/libjava</pElem>
|
||||
<pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libjava</pElem>
|
||||
@ -41348,7 +41348,7 @@
|
||||
<pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem>
|
||||
<pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem>
|
||||
<pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem>
|
||||
<pElem>../../jdk/src/java.base/linux/native/libjava</pElem>
|
||||
<pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libjava</pElem>
|
||||
@ -41377,7 +41377,7 @@
|
||||
<pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem>
|
||||
<pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem>
|
||||
<pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem>
|
||||
<pElem>../../jdk/src/java.base/linux/native/libjava</pElem>
|
||||
<pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libjava</pElem>
|
||||
@ -41406,7 +41406,7 @@
|
||||
<pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem>
|
||||
<pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem>
|
||||
<pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem>
|
||||
<pElem>../../jdk/src/java.base/linux/native/libjava</pElem>
|
||||
<pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libjava</pElem>
|
||||
@ -41435,7 +41435,7 @@
|
||||
<pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem>
|
||||
<pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem>
|
||||
<pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem>
|
||||
<pElem>../../jdk/src/java.base/linux/native/libjava</pElem>
|
||||
<pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libjava</pElem>
|
||||
@ -41464,7 +41464,7 @@
|
||||
<pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem>
|
||||
<pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem>
|
||||
<pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem>
|
||||
<pElem>../../jdk/src/java.base/linux/native/libjava</pElem>
|
||||
<pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libjava</pElem>
|
||||
@ -41493,7 +41493,7 @@
|
||||
<pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem>
|
||||
<pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem>
|
||||
<pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem>
|
||||
<pElem>../../jdk/src/java.base/linux/native/libjava</pElem>
|
||||
<pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libjava</pElem>
|
||||
@ -41522,7 +41522,7 @@
|
||||
<pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem>
|
||||
<pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem>
|
||||
<pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem>
|
||||
<pElem>../../jdk/src/java.base/linux/native/libjava</pElem>
|
||||
<pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libjava</pElem>
|
||||
@ -41551,7 +41551,7 @@
|
||||
<pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem>
|
||||
<pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem>
|
||||
<pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem>
|
||||
<pElem>../../jdk/src/java.base/linux/native/libjava</pElem>
|
||||
<pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libjava</pElem>
|
||||
@ -41580,7 +41580,7 @@
|
||||
<pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem>
|
||||
<pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem>
|
||||
<pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem>
|
||||
<pElem>../../jdk/src/java.base/linux/native/libjava</pElem>
|
||||
<pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libjava</pElem>
|
||||
@ -41609,7 +41609,7 @@
|
||||
<pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem>
|
||||
<pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem>
|
||||
<pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem>
|
||||
<pElem>../../jdk/src/java.base/linux/native/libjava</pElem>
|
||||
<pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libjava</pElem>
|
||||
@ -41638,7 +41638,7 @@
|
||||
<pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem>
|
||||
<pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem>
|
||||
<pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem>
|
||||
<pElem>../../jdk/src/java.base/linux/native/libjava</pElem>
|
||||
<pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libjava</pElem>
|
||||
@ -41667,7 +41667,7 @@
|
||||
<pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem>
|
||||
<pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem>
|
||||
<pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem>
|
||||
<pElem>../../jdk/src/java.base/linux/native/libjava</pElem>
|
||||
<pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libjava</pElem>
|
||||
@ -41696,7 +41696,7 @@
|
||||
<pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem>
|
||||
<pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem>
|
||||
<pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem>
|
||||
<pElem>../../jdk/src/java.base/linux/native/libjava</pElem>
|
||||
<pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libjava</pElem>
|
||||
@ -41725,7 +41725,7 @@
|
||||
<pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem>
|
||||
<pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem>
|
||||
<pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem>
|
||||
<pElem>../../jdk/src/java.base/linux/native/libjava</pElem>
|
||||
<pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libjava</pElem>
|
||||
@ -41754,7 +41754,7 @@
|
||||
<pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem>
|
||||
<pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem>
|
||||
<pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem>
|
||||
<pElem>../../jdk/src/java.base/linux/native/libjava</pElem>
|
||||
<pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libjava</pElem>
|
||||
@ -41783,7 +41783,7 @@
|
||||
<pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem>
|
||||
<pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem>
|
||||
<pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem>
|
||||
<pElem>../../jdk/src/java.base/linux/native/libjava</pElem>
|
||||
<pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libjava</pElem>
|
||||
@ -41812,7 +41812,7 @@
|
||||
<pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem>
|
||||
<pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem>
|
||||
<pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem>
|
||||
<pElem>../../jdk/src/java.base/linux/native/libjava</pElem>
|
||||
<pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libjava</pElem>
|
||||
@ -41841,7 +41841,7 @@
|
||||
<pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem>
|
||||
<pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem>
|
||||
<pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem>
|
||||
<pElem>../../jdk/src/java.base/linux/native/libjava</pElem>
|
||||
<pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libjava</pElem>
|
||||
@ -41870,7 +41870,7 @@
|
||||
<pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem>
|
||||
<pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem>
|
||||
<pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem>
|
||||
<pElem>../../jdk/src/java.base/linux/native/libjava</pElem>
|
||||
<pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libjava</pElem>
|
||||
@ -41899,7 +41899,7 @@
|
||||
<pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem>
|
||||
<pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem>
|
||||
<pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem>
|
||||
<pElem>../../jdk/src/java.base/linux/native/libjava</pElem>
|
||||
<pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libjava</pElem>
|
||||
@ -41928,7 +41928,7 @@
|
||||
<pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem>
|
||||
<pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem>
|
||||
<pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem>
|
||||
<pElem>../../jdk/src/java.base/linux/native/libjava</pElem>
|
||||
<pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libjava</pElem>
|
||||
@ -41957,7 +41957,7 @@
|
||||
<pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem>
|
||||
<pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem>
|
||||
<pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem>
|
||||
<pElem>../../jdk/src/java.base/linux/native/libjava</pElem>
|
||||
<pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libjava</pElem>
|
||||
@ -41986,7 +41986,7 @@
|
||||
<pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem>
|
||||
<pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem>
|
||||
<pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem>
|
||||
<pElem>../../jdk/src/java.base/linux/native/libjava</pElem>
|
||||
<pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libjava</pElem>
|
||||
@ -42015,7 +42015,7 @@
|
||||
<pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem>
|
||||
<pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem>
|
||||
<pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem>
|
||||
<pElem>../../jdk/src/java.base/linux/native/libjava</pElem>
|
||||
<pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libjava</pElem>
|
||||
@ -42044,7 +42044,7 @@
|
||||
<pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem>
|
||||
<pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem>
|
||||
<pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem>
|
||||
<pElem>../../jdk/src/java.base/linux/native/libjava</pElem>
|
||||
<pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libjava</pElem>
|
||||
@ -42073,7 +42073,7 @@
|
||||
<pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem>
|
||||
<pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem>
|
||||
<pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem>
|
||||
<pElem>../../jdk/src/java.base/linux/native/libjava</pElem>
|
||||
<pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libjava</pElem>
|
||||
@ -42102,7 +42102,7 @@
|
||||
<pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem>
|
||||
<pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem>
|
||||
<pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem>
|
||||
<pElem>../../jdk/src/java.base/linux/native/libjava</pElem>
|
||||
<pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libjava</pElem>
|
||||
@ -42131,7 +42131,7 @@
|
||||
<pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem>
|
||||
<pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem>
|
||||
<pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem>
|
||||
<pElem>../../jdk/src/java.base/linux/native/libjava</pElem>
|
||||
<pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libjava</pElem>
|
||||
@ -42160,7 +42160,7 @@
|
||||
<pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem>
|
||||
<pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem>
|
||||
<pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem>
|
||||
<pElem>../../jdk/src/java.base/linux/native/libjava</pElem>
|
||||
<pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libjava</pElem>
|
||||
@ -42189,7 +42189,7 @@
|
||||
<pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem>
|
||||
<pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem>
|
||||
<pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem>
|
||||
<pElem>../../jdk/src/java.base/linux/native/libjava</pElem>
|
||||
<pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libjava</pElem>
|
||||
@ -42218,7 +42218,7 @@
|
||||
<pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem>
|
||||
<pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem>
|
||||
<pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem>
|
||||
<pElem>../../jdk/src/java.base/linux/native/libjava</pElem>
|
||||
<pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libjava</pElem>
|
||||
@ -42247,7 +42247,7 @@
|
||||
<pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem>
|
||||
<pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem>
|
||||
<pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem>
|
||||
<pElem>../../jdk/src/java.base/linux/native/libjava</pElem>
|
||||
<pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libjava</pElem>
|
||||
@ -42276,7 +42276,7 @@
|
||||
<pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem>
|
||||
<pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem>
|
||||
<pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem>
|
||||
<pElem>../../jdk/src/java.base/linux/native/libjava</pElem>
|
||||
<pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libjava</pElem>
|
||||
@ -42305,7 +42305,7 @@
|
||||
<pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem>
|
||||
<pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem>
|
||||
<pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem>
|
||||
<pElem>../../jdk/src/java.base/linux/native/libjava</pElem>
|
||||
<pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libjava</pElem>
|
||||
@ -42334,7 +42334,7 @@
|
||||
<pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem>
|
||||
<pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem>
|
||||
<pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem>
|
||||
<pElem>../../jdk/src/java.base/linux/native/libjava</pElem>
|
||||
<pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libjava</pElem>
|
||||
@ -42363,7 +42363,7 @@
|
||||
<pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem>
|
||||
<pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem>
|
||||
<pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem>
|
||||
<pElem>../../jdk/src/java.base/linux/native/libjava</pElem>
|
||||
<pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libjava</pElem>
|
||||
@ -42413,7 +42413,7 @@
|
||||
<pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem>
|
||||
<pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem>
|
||||
<pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem>
|
||||
<pElem>../../jdk/src/java.base/linux/native/libjava</pElem>
|
||||
<pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libjava</pElem>
|
||||
@ -42442,7 +42442,7 @@
|
||||
<pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem>
|
||||
<pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem>
|
||||
<pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem>
|
||||
<pElem>../../jdk/src/java.base/linux/native/libjava</pElem>
|
||||
<pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libjava</pElem>
|
||||
@ -42471,7 +42471,7 @@
|
||||
<pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem>
|
||||
<pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem>
|
||||
<pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem>
|
||||
<pElem>../../jdk/src/java.base/linux/native/libjava</pElem>
|
||||
<pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libjava</pElem>
|
||||
@ -46557,7 +46557,7 @@
|
||||
<pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
|
||||
<pElem>../../jdk/src/java.base/unix/native/libjli</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libjli</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem>
|
||||
<pElem>../../make</pElem>
|
||||
</incDir>
|
||||
<preprocessorList>
|
||||
@ -46639,7 +46639,7 @@
|
||||
</preprocessorList>
|
||||
</cTool>
|
||||
</folder>
|
||||
<folder path="0/jdk/src/java.base/share/native/libzip/zlib-1.2.8">
|
||||
<folder path="0/jdk/src/java.base/share/native/libzip/zlib">
|
||||
<cTool>
|
||||
<incDir>
|
||||
<pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/giflib</pElem>
|
||||
@ -46647,7 +46647,7 @@
|
||||
<pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem>
|
||||
<pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem>
|
||||
<pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem>
|
||||
<pElem>../../jdk/src/java.base/linux/native/libjava</pElem>
|
||||
<pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libjava</pElem>
|
||||
@ -46712,7 +46712,7 @@
|
||||
<incDir>
|
||||
<pElem>../../jdk/src/java.base/unix/native/libjli</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libjli</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem>
|
||||
<pElem>../../make</pElem>
|
||||
</incDir>
|
||||
<preprocessorList>
|
||||
@ -47250,7 +47250,7 @@
|
||||
<pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem>
|
||||
<pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem>
|
||||
<pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem>
|
||||
<pElem>../../jdk/src/java.base/linux/native/libjava</pElem>
|
||||
<pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libjava</pElem>
|
||||
@ -47598,7 +47598,7 @@
|
||||
<pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem>
|
||||
<pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem>
|
||||
<pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem>
|
||||
<pElem>../../jdk/src/java.base/linux/native/libjava</pElem>
|
||||
<pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libjava</pElem>
|
||||
@ -47996,7 +47996,7 @@
|
||||
<pElem>../../jdk/src/jdk.pack/share/native/common-unpack</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libjava</pElem>
|
||||
<pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem>
|
||||
<pElem>../../jdk/src/java.base/share/native/include</pElem>
|
||||
<pElem>../../jdk/src/java.base/linux/native/include</pElem>
|
||||
<pElem>../../jdk/src/java.base/unix/native/include</pElem>
|
||||
|
@ -396,5 +396,9 @@ f95cc86b6ac22ec1ade5d4f825dc7782adeea228 jdk-9+148
|
||||
77f827f5bbad3ef795664bc675f72d98d156b9f8 jdk-9+151
|
||||
ff8cb43c07c069b1debdee44cb88ca22db1ec757 jdk-9+152
|
||||
68a8e8658511093b322a46ed04b2a321e1da2a43 jdk-9+153
|
||||
d66f97a610a6beac987740edc2bf6a70f46ba574 jdk-10+0
|
||||
078ebe23b584466dc8346e620d7821d91751e5a9 jdk-9+154
|
||||
a545f54babfa31aa7eb611f36031609acd617cbc jdk-9+155
|
||||
907c26240cd481579e919bfd23740797ff8ce1c8 jdk-9+156
|
||||
9383da04b385cca46b7ca67f3a39ac1b673e09fe jdk-9+157
|
||||
de6bdf38935fa753183ca288bed5c06a23c0bb12 jdk-9+158
|
||||
|
@ -1 +1 @@
|
||||
project=jdk9
|
||||
project=jdk10
|
||||
|
@ -25,6 +25,8 @@
|
||||
|
||||
/**
|
||||
* Defines the Java binding of the OMG CORBA APIs, and the RMI-IIOP API.
|
||||
*
|
||||
* @since 9
|
||||
*/
|
||||
@Deprecated(since="9", forRemoval=true)
|
||||
module java.corba {
|
||||
|
@ -106,13 +106,13 @@ import java.security.PrivilegedAction;
|
||||
*
|
||||
* <LI>check in properties parameter, if any
|
||||
*
|
||||
* <LI>check in the System properties
|
||||
* <LI>check in the System properties, if any
|
||||
*
|
||||
* <LI>check in the orb.properties file located in the user.home
|
||||
* directory (if any)
|
||||
* directory, if any
|
||||
*
|
||||
* <LI>check in the orb.properties file located in the java.home/lib
|
||||
* directory (if any)
|
||||
* <LI>check in the orb.properties file located in the run-time image,
|
||||
* if any
|
||||
*
|
||||
* <LI>fall back on a hardcoded default behavior (use the Java IDL
|
||||
* implementation)
|
||||
@ -170,9 +170,15 @@ import java.security.PrivilegedAction;
|
||||
* Thus, where appropriate, it is necessary that
|
||||
* the classes for this alternative ORBSingleton are available on the application's class path.
|
||||
* It should be noted that the singleton ORB is system wide.
|
||||
*
|
||||
* <P>
|
||||
* When a per-application ORB is created via the 2-arg init methods,
|
||||
* then it will be located using the thread context class loader.
|
||||
* <P>
|
||||
* The IDL to Java Language OMG specification documents the ${java.home}/lib directory as the location,
|
||||
* in the Java run-time image, to search for orb.properties.
|
||||
* This location is not intended for user editable configuration files.
|
||||
* Therefore, the implementation first checks the ${java.home}/conf directory for orb.properties,
|
||||
* and thereafter the ${java.home}/lib directory.
|
||||
*
|
||||
* @since JDK1.2
|
||||
*/
|
||||
@ -271,14 +277,25 @@ abstract public class ORB {
|
||||
}
|
||||
|
||||
String javaHome = System.getProperty("java.home");
|
||||
fileName = javaHome + File.separator
|
||||
+ "lib" + File.separator + "orb.properties";
|
||||
props = getFileProperties( fileName ) ;
|
||||
|
||||
fileName = javaHome + File.separator + "conf"
|
||||
+ File.separator + "orb.properties";
|
||||
props = getFileProperties(fileName);
|
||||
|
||||
if (props != null) {
|
||||
String value = props.getProperty(name);
|
||||
if (value != null)
|
||||
return value;
|
||||
}
|
||||
|
||||
fileName = javaHome + File.separator + "lib"
|
||||
+ File.separator + "orb.properties";
|
||||
props = getFileProperties(fileName);
|
||||
|
||||
if (props == null)
|
||||
return null ;
|
||||
return null;
|
||||
else
|
||||
return props.getProperty( name ) ;
|
||||
return props.getProperty(name);
|
||||
}
|
||||
}
|
||||
);
|
||||
|
@ -556,5 +556,9 @@ a82cb5350cad96a0b4de496afebe3ded89f27efa jdk-9+146
|
||||
2a2ac7d9f52c8cb2b80077e515b5840b947e640c jdk-9+151
|
||||
31f1d26c60df7b2e516a4f84160d76ba017d4e09 jdk-9+152
|
||||
217ba81b9a4ce8698200370175aa2db86a39f66c jdk-9+153
|
||||
fc7e94cb748507366b839e859f865f724467446a jdk-10+0
|
||||
a9fdfd55835ef9dccb7f317b07249bd66653b874 jdk-9+154
|
||||
f3b3d77a1751897413aae43ac340a130b6fa2ae1 jdk-9+155
|
||||
43139c588ea48b6504e52b6c3dec530b17b1fdb4 jdk-9+156
|
||||
b2d0a906afd73dcf27f572217eb1be0f196ec16c jdk-9+157
|
||||
4e78f30935229f13ce7c43089621cf7169f5abac jdk-9+158
|
||||
|
@ -1 +1 @@
|
||||
project=jdk9
|
||||
project=jdk10
|
||||
|
@ -1922,12 +1922,17 @@ void LIR_Assembler::comp_op(LIR_Condition condition, LIR_Opr opr1, LIR_Opr opr2,
|
||||
}
|
||||
|
||||
if (opr2->is_constant()) {
|
||||
bool is_32bit = false; // width of register operand
|
||||
jlong imm;
|
||||
|
||||
switch(opr2->type()) {
|
||||
case T_INT:
|
||||
imm = opr2->as_constant_ptr()->as_jint();
|
||||
is_32bit = true;
|
||||
break;
|
||||
case T_LONG:
|
||||
imm = opr2->as_constant_ptr()->as_jlong();
|
||||
break;
|
||||
case T_INT:
|
||||
case T_ADDRESS:
|
||||
imm = opr2->as_constant_ptr()->as_jint();
|
||||
break;
|
||||
@ -1942,14 +1947,14 @@ void LIR_Assembler::comp_op(LIR_Condition condition, LIR_Opr opr1, LIR_Opr opr2,
|
||||
}
|
||||
|
||||
if (Assembler::operand_valid_for_add_sub_immediate(imm)) {
|
||||
if (type2aelembytes(opr1->type()) <= 4)
|
||||
if (is_32bit)
|
||||
__ cmpw(reg1, imm);
|
||||
else
|
||||
__ cmp(reg1, imm);
|
||||
return;
|
||||
} else {
|
||||
__ mov(rscratch1, imm);
|
||||
if (type2aelembytes(opr1->type()) <= 4)
|
||||
if (is_32bit)
|
||||
__ cmpw(reg1, rscratch1);
|
||||
else
|
||||
__ cmp(reg1, rscratch1);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014, Red Hat Inc. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
@ -45,10 +45,8 @@ define_pd_global(bool, TieredCompilation, false);
|
||||
// We compile very aggressively with the builtin simulator because
|
||||
// doing so greatly reduces run times and tests more code.
|
||||
define_pd_global(intx, CompileThreshold, 150 );
|
||||
define_pd_global(intx, BackEdgeThreshold, 500);
|
||||
#else
|
||||
define_pd_global(intx, CompileThreshold, 1500 );
|
||||
define_pd_global(intx, BackEdgeThreshold, 100000);
|
||||
#endif
|
||||
|
||||
define_pd_global(intx, OnStackReplacePercentage, 933 );
|
||||
@ -76,6 +74,4 @@ define_pd_global(bool, OptimizeSinglePrecision, true );
|
||||
define_pd_global(bool, CSEArrayLength, false);
|
||||
define_pd_global(bool, TwoOperandLIRForm, false );
|
||||
|
||||
define_pd_global(intx, SafepointPollOffset, 0 );
|
||||
|
||||
#endif // CPU_AARCH64_VM_C1_GLOBALS_AARCH64_HPP
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014, Red Hat Inc. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
@ -43,7 +43,6 @@ define_pd_global(bool, UseOnStackReplacement, true);
|
||||
define_pd_global(bool, ProfileInterpreter, true);
|
||||
define_pd_global(bool, TieredCompilation, trueInTiered);
|
||||
define_pd_global(intx, CompileThreshold, 10000);
|
||||
define_pd_global(intx, BackEdgeThreshold, 100000);
|
||||
|
||||
define_pd_global(intx, OnStackReplacePercentage, 140);
|
||||
define_pd_global(intx, ConditionalMoveLimit, 3);
|
||||
|
@ -25,6 +25,7 @@ package jdk.tools.jaotc;
|
||||
|
||||
import org.graalvm.compiler.code.CompilationResult;
|
||||
import org.graalvm.compiler.core.target.Backend;
|
||||
import org.graalvm.compiler.hotspot.HotSpotCompiledCodeBuilder;
|
||||
import org.graalvm.compiler.hotspot.stubs.Stub;
|
||||
|
||||
import jdk.vm.ci.hotspot.HotSpotCompiledCode;
|
||||
@ -48,7 +49,7 @@ public class AOTStub implements JavaMethodInfo {
|
||||
}
|
||||
|
||||
public HotSpotCompiledCode compiledCode(CompilationResult result) {
|
||||
return stub.getCompiledCode(backend);
|
||||
return HotSpotCompiledCodeBuilder.createCompiledCode(null, null, result);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 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
|
||||
@ -50,7 +50,7 @@ int pathmap_open(const char* name) {
|
||||
}
|
||||
|
||||
|
||||
if (strlen(alt_root) + strlen(name) < PATH_MAX) {
|
||||
if (strlen(alt_root) + strlen(name) > PATH_MAX) {
|
||||
// Buffer too small.
|
||||
return -1;
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 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
|
||||
@ -150,13 +150,7 @@ public class HeapSummary extends Tool {
|
||||
// Helper methods
|
||||
|
||||
private void printGCAlgorithm(Map flagMap) {
|
||||
// print about new generation
|
||||
long l = getFlagValue("UseParNewGC", flagMap);
|
||||
if (l == 1L) {
|
||||
System.out.println("using parallel threads in the new generation.");
|
||||
}
|
||||
|
||||
l = getFlagValue("UseTLAB", flagMap);
|
||||
long l = getFlagValue("UseTLAB", flagMap);
|
||||
if (l == 1L) {
|
||||
System.out.println("using thread-local object allocation.");
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2004, 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
|
||||
@ -114,6 +114,8 @@ public abstract class AbstractHeapGraphWriter implements HeapGraphWriter {
|
||||
}
|
||||
});
|
||||
|
||||
writeHeapRecordPrologue();
|
||||
|
||||
// write JavaThreads
|
||||
writeJavaThreads();
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2004, 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
|
||||
@ -45,8 +45,8 @@ import sun.jvm.hotspot.classfile.*;
|
||||
* WARNING: This format is still under development, and is subject to
|
||||
* change without notice.
|
||||
*
|
||||
* header "JAVA PROFILE 1.0.1" or "JAVA PROFILE 1.0.2" (0-terminated)
|
||||
* u4 size of identifiers. Identifiers are used to represent
|
||||
* header "JAVA PROFILE 1.0.2" (0-terminated)
|
||||
* u4 size of identifiers. Identifiers are used to represent
|
||||
* UTF8 strings, objects, stack traces, etc. They usually
|
||||
* have the same size as host pointers. For example, on
|
||||
* Solaris and Win32, the size is 4.
|
||||
@ -294,10 +294,9 @@ import sun.jvm.hotspot.classfile.*;
|
||||
* u2 stack trace depth
|
||||
*
|
||||
*
|
||||
* When the header is "JAVA PROFILE 1.0.2" a heap dump can optionally
|
||||
* be generated as a sequence of heap dump segments. This sequence is
|
||||
* terminated by an end record. The additional tags allowed by format
|
||||
* "JAVA PROFILE 1.0.2" are:
|
||||
* A heap dump can optionally be generated as a sequence of heap dump
|
||||
* segments. This sequence is terminated by an end record. The additional
|
||||
* tags allowed by format "JAVA PROFILE 1.0.2" are:
|
||||
*
|
||||
* HPROF_HEAP_DUMP_SEGMENT denote a heap dump segment
|
||||
*
|
||||
@ -310,8 +309,6 @@ import sun.jvm.hotspot.classfile.*;
|
||||
|
||||
public class HeapHprofBinWriter extends AbstractHeapGraphWriter {
|
||||
|
||||
// The heap size threshold used to determine if segmented format
|
||||
// ("JAVA PROFILE 1.0.2") should be used.
|
||||
private static final long HPROF_SEGMENTED_HEAP_DUMP_THRESHOLD = 2L * 0x40000000;
|
||||
|
||||
// The approximate size of a heap segment. Used to calculate when to create
|
||||
@ -319,7 +316,6 @@ public class HeapHprofBinWriter extends AbstractHeapGraphWriter {
|
||||
private static final long HPROF_SEGMENTED_HEAP_DUMP_SEGMENT_SIZE = 1L * 0x40000000;
|
||||
|
||||
// hprof binary file header
|
||||
private static final String HPROF_HEADER_1_0_1 = "JAVA PROFILE 1.0.1";
|
||||
private static final String HPROF_HEADER_1_0_2 = "JAVA PROFILE 1.0.2";
|
||||
|
||||
// constants in enum HprofTag
|
||||
@ -380,6 +376,7 @@ public class HeapHprofBinWriter extends AbstractHeapGraphWriter {
|
||||
private static final int JVM_SIGNATURE_ARRAY = '[';
|
||||
private static final int JVM_SIGNATURE_CLASS = 'L';
|
||||
|
||||
private static final long MAX_U4_VALUE = 0xFFFFFFFFL;
|
||||
int serialNum = 1;
|
||||
|
||||
public synchronized void write(String fileName) throws IOException {
|
||||
@ -469,7 +466,6 @@ public class HeapHprofBinWriter extends AbstractHeapGraphWriter {
|
||||
// length later - hprof format requires length.
|
||||
out.flush();
|
||||
currentSegmentStart = fos.getChannel().position();
|
||||
|
||||
// write dummy length of 0 and we'll fix it later.
|
||||
out.writeInt(0);
|
||||
}
|
||||
@ -479,7 +475,7 @@ public class HeapHprofBinWriter extends AbstractHeapGraphWriter {
|
||||
protected void writeHeapRecordEpilogue() throws IOException {
|
||||
if (useSegmentedHeapDump) {
|
||||
out.flush();
|
||||
if ((fos.getChannel().position() - currentSegmentStart - 4) >= HPROF_SEGMENTED_HEAP_DUMP_SEGMENT_SIZE) {
|
||||
if ((fos.getChannel().position() - currentSegmentStart - 4L) >= HPROF_SEGMENTED_HEAP_DUMP_SEGMENT_SIZE) {
|
||||
fillInHeapRecordLength();
|
||||
currentSegmentStart = 0;
|
||||
}
|
||||
@ -488,14 +484,14 @@ public class HeapHprofBinWriter extends AbstractHeapGraphWriter {
|
||||
|
||||
private void fillInHeapRecordLength() throws IOException {
|
||||
|
||||
// now get current position to calculate length
|
||||
// now get the current position to calculate length
|
||||
long dumpEnd = fos.getChannel().position();
|
||||
|
||||
// calculate length of heap data
|
||||
// calculate the length of heap data
|
||||
long dumpLenLong = (dumpEnd - currentSegmentStart - 4L);
|
||||
|
||||
// Check length boundary, overflow could happen but is _very_ unlikely
|
||||
if(dumpLenLong >= (4L * 0x40000000)){
|
||||
if (dumpLenLong >= (4L * 0x40000000)) {
|
||||
throw new RuntimeException("Heap segment size overflow.");
|
||||
}
|
||||
|
||||
@ -517,6 +513,71 @@ public class HeapHprofBinWriter extends AbstractHeapGraphWriter {
|
||||
fos.getChannel().position(currentPosition);
|
||||
}
|
||||
|
||||
// get the size in bytes for the requested type
|
||||
private long getSizeForType(int type) throws IOException {
|
||||
switch (type) {
|
||||
case TypeArrayKlass.T_BOOLEAN:
|
||||
return BOOLEAN_SIZE;
|
||||
case TypeArrayKlass.T_INT:
|
||||
return INT_SIZE;
|
||||
case TypeArrayKlass.T_CHAR:
|
||||
return CHAR_SIZE;
|
||||
case TypeArrayKlass.T_SHORT:
|
||||
return SHORT_SIZE;
|
||||
case TypeArrayKlass.T_BYTE:
|
||||
return BYTE_SIZE;
|
||||
case TypeArrayKlass.T_LONG:
|
||||
return LONG_SIZE;
|
||||
case TypeArrayKlass.T_FLOAT:
|
||||
return FLOAT_SIZE;
|
||||
case TypeArrayKlass.T_DOUBLE:
|
||||
return DOUBLE_SIZE;
|
||||
default:
|
||||
throw new RuntimeException(
|
||||
"Should not reach here: Unknown type: " + type);
|
||||
}
|
||||
}
|
||||
|
||||
private int getArrayHeaderSize(boolean isObjectAarray) {
|
||||
return isObjectAarray?
|
||||
((int) BYTE_SIZE + 2 * (int) INT_SIZE + 2 * (int) OBJ_ID_SIZE):
|
||||
(2 * (int) BYTE_SIZE + 2 * (int) INT_SIZE + (int) OBJ_ID_SIZE);
|
||||
}
|
||||
|
||||
// Check if we need to truncate an array
|
||||
private int calculateArrayMaxLength(long originalArrayLength,
|
||||
int headerSize,
|
||||
long typeSize,
|
||||
String typeName) throws IOException {
|
||||
|
||||
long length = originalArrayLength;
|
||||
|
||||
// now get the current position to calculate length
|
||||
long dumpEnd = fos.getChannel().position();
|
||||
long originalLengthInBytes = originalArrayLength * typeSize;
|
||||
|
||||
// calculate the length of heap data
|
||||
long currentRecordLength = (dumpEnd - currentSegmentStart - 4L);
|
||||
if (currentRecordLength > 0 &&
|
||||
(currentRecordLength + headerSize + originalLengthInBytes) > MAX_U4_VALUE) {
|
||||
fillInHeapRecordLength();
|
||||
currentSegmentStart = 0;
|
||||
writeHeapRecordPrologue();
|
||||
currentRecordLength = 0;
|
||||
}
|
||||
|
||||
// Calculate the max bytes we can use.
|
||||
long maxBytes = (MAX_U4_VALUE - (headerSize + currentRecordLength));
|
||||
|
||||
if (originalLengthInBytes > maxBytes) {
|
||||
length = maxBytes/typeSize;
|
||||
System.err.println("WARNING: Cannot dump array of type " + typeName
|
||||
+ " with length " + originalArrayLength
|
||||
+ "; truncating to length " + length);
|
||||
}
|
||||
return (int) length;
|
||||
}
|
||||
|
||||
private void writeClassDumpRecords() throws IOException {
|
||||
SystemDictionary sysDict = VM.getVM().getSystemDictionary();
|
||||
ClassLoaderDataGraph cldGraph = VM.getVM().getClassLoaderDataGraph();
|
||||
@ -694,12 +755,16 @@ public class HeapHprofBinWriter extends AbstractHeapGraphWriter {
|
||||
}
|
||||
|
||||
protected void writeObjectArray(ObjArray array) throws IOException {
|
||||
int headerSize = getArrayHeaderSize(true);
|
||||
final int length = calculateArrayMaxLength(array.getLength(),
|
||||
headerSize,
|
||||
OBJ_ID_SIZE,
|
||||
"Object");
|
||||
out.writeByte((byte) HPROF_GC_OBJ_ARRAY_DUMP);
|
||||
writeObjectID(array);
|
||||
out.writeInt(DUMMY_STACK_TRACE_ID);
|
||||
out.writeInt((int) array.getLength());
|
||||
out.writeInt(length);
|
||||
writeObjectID(array.getKlass().getJavaMirror());
|
||||
final int length = (int) array.getLength();
|
||||
for (int index = 0; index < length; index++) {
|
||||
OopHandle handle = array.getOopHandleAt(index);
|
||||
writeObjectID(getAddressValue(handle));
|
||||
@ -707,101 +772,101 @@ public class HeapHprofBinWriter extends AbstractHeapGraphWriter {
|
||||
}
|
||||
|
||||
protected void writePrimitiveArray(TypeArray array) throws IOException {
|
||||
int headerSize = getArrayHeaderSize(false);
|
||||
TypeArrayKlass tak = (TypeArrayKlass) array.getKlass();
|
||||
final int type = (int) tak.getElementType();
|
||||
final String typeName = tak.getElementTypeName();
|
||||
final long typeSize = getSizeForType(type);
|
||||
final int length = calculateArrayMaxLength(array.getLength(),
|
||||
headerSize,
|
||||
typeSize,
|
||||
typeName);
|
||||
out.writeByte((byte) HPROF_GC_PRIM_ARRAY_DUMP);
|
||||
writeObjectID(array);
|
||||
out.writeInt(DUMMY_STACK_TRACE_ID);
|
||||
out.writeInt((int) array.getLength());
|
||||
TypeArrayKlass tak = (TypeArrayKlass) array.getKlass();
|
||||
final int type = (int) tak.getElementType();
|
||||
out.writeInt(length);
|
||||
out.writeByte((byte) type);
|
||||
switch (type) {
|
||||
case TypeArrayKlass.T_BOOLEAN:
|
||||
writeBooleanArray(array);
|
||||
writeBooleanArray(array, length);
|
||||
break;
|
||||
case TypeArrayKlass.T_CHAR:
|
||||
writeCharArray(array);
|
||||
writeCharArray(array, length);
|
||||
break;
|
||||
case TypeArrayKlass.T_FLOAT:
|
||||
writeFloatArray(array);
|
||||
writeFloatArray(array, length);
|
||||
break;
|
||||
case TypeArrayKlass.T_DOUBLE:
|
||||
writeDoubleArray(array);
|
||||
writeDoubleArray(array, length);
|
||||
break;
|
||||
case TypeArrayKlass.T_BYTE:
|
||||
writeByteArray(array);
|
||||
writeByteArray(array, length);
|
||||
break;
|
||||
case TypeArrayKlass.T_SHORT:
|
||||
writeShortArray(array);
|
||||
writeShortArray(array, length);
|
||||
break;
|
||||
case TypeArrayKlass.T_INT:
|
||||
writeIntArray(array);
|
||||
writeIntArray(array, length);
|
||||
break;
|
||||
case TypeArrayKlass.T_LONG:
|
||||
writeLongArray(array);
|
||||
writeLongArray(array, length);
|
||||
break;
|
||||
default:
|
||||
throw new RuntimeException("should not reach here");
|
||||
throw new RuntimeException(
|
||||
"Should not reach here: Unknown type: " + type);
|
||||
}
|
||||
}
|
||||
|
||||
private void writeBooleanArray(TypeArray array) throws IOException {
|
||||
final int length = (int) array.getLength();
|
||||
private void writeBooleanArray(TypeArray array, int length) throws IOException {
|
||||
for (int index = 0; index < length; index++) {
|
||||
long offset = BOOLEAN_BASE_OFFSET + index * BOOLEAN_SIZE;
|
||||
out.writeBoolean(array.getHandle().getJBooleanAt(offset));
|
||||
}
|
||||
}
|
||||
|
||||
private void writeByteArray(TypeArray array) throws IOException {
|
||||
final int length = (int) array.getLength();
|
||||
private void writeByteArray(TypeArray array, int length) throws IOException {
|
||||
for (int index = 0; index < length; index++) {
|
||||
long offset = BYTE_BASE_OFFSET + index * BYTE_SIZE;
|
||||
out.writeByte(array.getHandle().getJByteAt(offset));
|
||||
}
|
||||
}
|
||||
|
||||
private void writeShortArray(TypeArray array) throws IOException {
|
||||
final int length = (int) array.getLength();
|
||||
private void writeShortArray(TypeArray array, int length) throws IOException {
|
||||
for (int index = 0; index < length; index++) {
|
||||
long offset = SHORT_BASE_OFFSET + index * SHORT_SIZE;
|
||||
out.writeShort(array.getHandle().getJShortAt(offset));
|
||||
}
|
||||
}
|
||||
|
||||
private void writeIntArray(TypeArray array) throws IOException {
|
||||
final int length = (int) array.getLength();
|
||||
private void writeIntArray(TypeArray array, int length) throws IOException {
|
||||
for (int index = 0; index < length; index++) {
|
||||
long offset = INT_BASE_OFFSET + index * INT_SIZE;
|
||||
out.writeInt(array.getHandle().getJIntAt(offset));
|
||||
}
|
||||
}
|
||||
|
||||
private void writeLongArray(TypeArray array) throws IOException {
|
||||
final int length = (int) array.getLength();
|
||||
private void writeLongArray(TypeArray array, int length) throws IOException {
|
||||
for (int index = 0; index < length; index++) {
|
||||
long offset = LONG_BASE_OFFSET + index * LONG_SIZE;
|
||||
out.writeLong(array.getHandle().getJLongAt(offset));
|
||||
}
|
||||
}
|
||||
|
||||
private void writeCharArray(TypeArray array) throws IOException {
|
||||
final int length = (int) array.getLength();
|
||||
private void writeCharArray(TypeArray array, int length) throws IOException {
|
||||
for (int index = 0; index < length; index++) {
|
||||
long offset = CHAR_BASE_OFFSET + index * CHAR_SIZE;
|
||||
out.writeChar(array.getHandle().getJCharAt(offset));
|
||||
}
|
||||
}
|
||||
|
||||
private void writeFloatArray(TypeArray array) throws IOException {
|
||||
final int length = (int) array.getLength();
|
||||
private void writeFloatArray(TypeArray array, int length) throws IOException {
|
||||
for (int index = 0; index < length; index++) {
|
||||
long offset = FLOAT_BASE_OFFSET + index * FLOAT_SIZE;
|
||||
out.writeFloat(array.getHandle().getJFloatAt(offset));
|
||||
}
|
||||
}
|
||||
|
||||
private void writeDoubleArray(TypeArray array) throws IOException {
|
||||
final int length = (int) array.getLength();
|
||||
private void writeDoubleArray(TypeArray array, int length) throws IOException {
|
||||
for (int index = 0; index < length; index++) {
|
||||
long offset = DOUBLE_BASE_OFFSET + index * DOUBLE_SIZE;
|
||||
out.writeDouble(array.getHandle().getJDoubleAt(offset));
|
||||
@ -996,12 +1061,7 @@ public class HeapHprofBinWriter extends AbstractHeapGraphWriter {
|
||||
// writes hprof binary file header
|
||||
private void writeFileHeader() throws IOException {
|
||||
// version string
|
||||
if(useSegmentedHeapDump) {
|
||||
out.writeBytes(HPROF_HEADER_1_0_2);
|
||||
}
|
||||
else {
|
||||
out.writeBytes(HPROF_HEADER_1_0_1);
|
||||
}
|
||||
out.writeBytes(HPROF_HEADER_1_0_2);
|
||||
out.writeByte((byte)'\0');
|
||||
|
||||
// write identifier size. we use pointers as identifiers.
|
||||
|
@ -27,8 +27,6 @@ import java.lang.ref.ReferenceQueue;
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.util.Arrays;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
import java.util.WeakHashMap;
|
||||
|
||||
import jdk.vm.ci.meta.JavaKind;
|
||||
import jdk.vm.ci.meta.ResolvedJavaType;
|
||||
@ -147,21 +145,34 @@ public class HotSpotJVMCIMetaAccessContext {
|
||||
}
|
||||
}
|
||||
|
||||
private final Map<Class<?>, WeakReference<ResolvedJavaType>> typeMap = new WeakHashMap<>();
|
||||
private final ClassValue<WeakReference<ResolvedJavaType>> resolvedJavaType = new ClassValue<WeakReference<ResolvedJavaType>>() {
|
||||
@Override
|
||||
protected WeakReference<ResolvedJavaType> computeValue(Class<?> type) {
|
||||
return new WeakReference<>(createClass(type));
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Gets the JVMCI mirror for a {@link Class} object.
|
||||
*
|
||||
* @return the {@link ResolvedJavaType} corresponding to {@code javaClass}
|
||||
*/
|
||||
public synchronized ResolvedJavaType fromClass(Class<?> javaClass) {
|
||||
WeakReference<ResolvedJavaType> typeRef = typeMap.get(javaClass);
|
||||
ResolvedJavaType type = typeRef != null ? typeRef.get() : null;
|
||||
if (type == null) {
|
||||
type = createClass(javaClass);
|
||||
typeMap.put(javaClass, new WeakReference<>(type));
|
||||
public ResolvedJavaType fromClass(Class<?> javaClass) {
|
||||
ResolvedJavaType javaType = null;
|
||||
while (javaType == null) {
|
||||
WeakReference<ResolvedJavaType> type = resolvedJavaType.get(javaClass);
|
||||
javaType = type.get();
|
||||
if (javaType == null) {
|
||||
/*
|
||||
* If the referent has become null, clear out the current value
|
||||
* and let computeValue above create a new value. Reload the
|
||||
* value in a loop because in theory the WeakReference referent
|
||||
* can be reclaimed at any point.
|
||||
*/
|
||||
resolvedJavaType.remove(javaClass);
|
||||
}
|
||||
}
|
||||
return type;
|
||||
return javaType;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -89,18 +89,11 @@ public abstract class Stub {
|
||||
*/
|
||||
protected InstalledCode code;
|
||||
|
||||
/**
|
||||
* Compilation result from which {@link #code} was created.
|
||||
*/
|
||||
protected CompilationResult compResult;
|
||||
|
||||
/**
|
||||
* The registers destroyed by this stub (from the caller's perspective).
|
||||
*/
|
||||
private Set<Register> destroyedCallerRegisters;
|
||||
|
||||
private HotSpotCompiledCode compiledCode;
|
||||
|
||||
public void initDestroyedCallerRegisters(Set<Register> registers) {
|
||||
assert registers != null;
|
||||
assert destroyedCallerRegisters == null || registers.equals(destroyedCallerRegisters) : "cannot redefine";
|
||||
@ -184,35 +177,13 @@ public abstract class Stub {
|
||||
public synchronized InstalledCode getCode(final Backend backend) {
|
||||
if (code == null) {
|
||||
try (Scope d = Debug.sandbox("CompilingStub", DebugScope.getConfig(), providers.getCodeCache(), debugScopeContext())) {
|
||||
final StructuredGraph graph = getGraph(getStubCompilationId());
|
||||
|
||||
// Stubs cannot be recompiled so they cannot be compiled with assumptions
|
||||
assert graph.getAssumptions() == null;
|
||||
|
||||
if (!(graph.start() instanceof StubStartNode)) {
|
||||
StubStartNode newStart = graph.add(new StubStartNode(Stub.this));
|
||||
newStart.setStateAfter(graph.start().stateAfter());
|
||||
graph.replaceFixed(graph.start(), newStart);
|
||||
}
|
||||
|
||||
CodeCacheProvider codeCache = providers.getCodeCache();
|
||||
|
||||
compResult = new CompilationResult(toString(), GeneratePIC.getValue());
|
||||
try (Scope s0 = Debug.scope("StubCompilation", graph, providers.getCodeCache())) {
|
||||
Suites suites = createSuites();
|
||||
emitFrontEnd(providers, backend, graph, providers.getSuites().getDefaultGraphBuilderSuite(), OptimisticOptimizations.ALL, DefaultProfilingInfo.get(TriState.UNKNOWN), suites);
|
||||
LIRSuites lirSuites = createLIRSuites();
|
||||
emitBackEnd(graph, Stub.this, getInstalledCodeOwner(), backend, compResult, CompilationResultBuilderFactory.Default, getRegisterConfig(), lirSuites);
|
||||
assert checkStubInvariants();
|
||||
} catch (Throwable e) {
|
||||
throw Debug.handle(e);
|
||||
}
|
||||
|
||||
assert destroyedCallerRegisters != null;
|
||||
CompilationResult compResult = buildCompilationResult(backend);
|
||||
try (Scope s = Debug.scope("CodeInstall", compResult)) {
|
||||
assert destroyedCallerRegisters != null;
|
||||
// Add a GeneratePIC check here later, we don't want to install
|
||||
// code if we don't have a corresponding VM global symbol.
|
||||
compiledCode = HotSpotCompiledCodeBuilder.createCompiledCode(null, null, compResult);
|
||||
HotSpotCompiledCode compiledCode = HotSpotCompiledCodeBuilder.createCompiledCode(null, null, compResult);
|
||||
code = codeCache.installCode(null, compiledCode, null, null, false);
|
||||
} catch (Throwable e) {
|
||||
throw Debug.handle(e);
|
||||
@ -226,6 +197,44 @@ public abstract class Stub {
|
||||
return code;
|
||||
}
|
||||
|
||||
@SuppressWarnings("try")
|
||||
private CompilationResult buildCompilationResult(final Backend backend) {
|
||||
CompilationResult compResult = new CompilationResult(toString(), GeneratePIC.getValue());
|
||||
final StructuredGraph graph = getGraph(getStubCompilationId());
|
||||
|
||||
// Stubs cannot be recompiled so they cannot be compiled with assumptions
|
||||
assert graph.getAssumptions() == null;
|
||||
|
||||
if (!(graph.start() instanceof StubStartNode)) {
|
||||
StubStartNode newStart = graph.add(new StubStartNode(Stub.this));
|
||||
newStart.setStateAfter(graph.start().stateAfter());
|
||||
graph.replaceFixed(graph.start(), newStart);
|
||||
}
|
||||
|
||||
try (Scope s0 = Debug.scope("StubCompilation", graph, providers.getCodeCache())) {
|
||||
Suites suites = createSuites();
|
||||
emitFrontEnd(providers, backend, graph, providers.getSuites().getDefaultGraphBuilderSuite(), OptimisticOptimizations.ALL, DefaultProfilingInfo.get(TriState.UNKNOWN), suites);
|
||||
LIRSuites lirSuites = createLIRSuites();
|
||||
emitBackEnd(graph, Stub.this, getInstalledCodeOwner(), backend, compResult, CompilationResultBuilderFactory.Default, getRegisterConfig(), lirSuites);
|
||||
assert checkStubInvariants(compResult);
|
||||
} catch (Throwable e) {
|
||||
throw Debug.handle(e);
|
||||
}
|
||||
return compResult;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a {@link CompilationResult} that can be used for code generation. Required for AOT.
|
||||
*/
|
||||
@SuppressWarnings("try")
|
||||
public CompilationResult getCompilationResult(final Backend backend) {
|
||||
try (Scope d = Debug.sandbox("CompilingStub", DebugScope.getConfig(), providers.getCodeCache(), debugScopeContext())) {
|
||||
return buildCompilationResult(backend);
|
||||
} catch (Throwable e) {
|
||||
throw Debug.handle(e);
|
||||
}
|
||||
}
|
||||
|
||||
public CompilationIdentifier getStubCompilationId() {
|
||||
return new StubCompilationIdentifier(this);
|
||||
}
|
||||
@ -233,7 +242,7 @@ public abstract class Stub {
|
||||
/**
|
||||
* Checks the conditions a compilation must satisfy to be installed as a RuntimeStub.
|
||||
*/
|
||||
private boolean checkStubInvariants() {
|
||||
private boolean checkStubInvariants(CompilationResult compResult) {
|
||||
assert compResult.getExceptionHandlers().isEmpty() : this;
|
||||
|
||||
// Stubs cannot be recompiled so they cannot be compiled with
|
||||
@ -278,24 +287,4 @@ public abstract class Stub {
|
||||
}
|
||||
return lirSuites;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the HotSpotCompiledCode that was created during installation.
|
||||
*/
|
||||
public synchronized HotSpotCompiledCode getCompiledCode(final Backend backend) {
|
||||
getCompilationResult(backend);
|
||||
assert compiledCode != null;
|
||||
return compiledCode;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the compilation result for this stub, compiling it first if necessary, and installing it
|
||||
* in code.
|
||||
*/
|
||||
public synchronized CompilationResult getCompilationResult(final Backend backend) {
|
||||
if (code == null) {
|
||||
getCode(backend);
|
||||
}
|
||||
return compResult;
|
||||
}
|
||||
}
|
||||
|
@ -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
|
||||
@ -3050,15 +3050,12 @@ void os::naked_yield() {
|
||||
thr_yield();
|
||||
}
|
||||
|
||||
// Interface for setting lwp priorities. If we are using T2 libthread,
|
||||
// which forces the use of BoundThreads or we manually set UseBoundThreads,
|
||||
// all of our threads will be assigned to real lwp's. Using the thr_setprio
|
||||
// function is meaningless in this mode so we must adjust the real lwp's priority
|
||||
// Interface for setting lwp priorities. We are using T2 libthread,
|
||||
// which forces the use of bound threads, so all of our threads will
|
||||
// be assigned to real lwp's. Using the thr_setprio function is
|
||||
// meaningless in this mode so we must adjust the real lwp's priority.
|
||||
// The routines below implement the getting and setting of lwp priorities.
|
||||
//
|
||||
// Note: T2 is now the only supported libthread. UseBoundThreads flag is
|
||||
// being deprecated and all threads are now BoundThreads
|
||||
//
|
||||
// Note: There are three priority scales used on Solaris. Java priotities
|
||||
// which range from 1 to 10, libthread "thr_setprio" scale which range
|
||||
// from 0 to 127, and the current scheduling class of the process we
|
||||
|
@ -248,7 +248,9 @@ void Canonicalizer::do_ArrayLength (ArrayLength* x) {
|
||||
} else if ((lf = x->array()->as_LoadField()) != NULL) {
|
||||
ciField* field = lf->field();
|
||||
if (field->is_static_constant()) {
|
||||
assert(PatchALot || ScavengeRootsInCode < 2, "Constant field loads are folded during parsing");
|
||||
// Constant field loads are usually folded during parsing.
|
||||
// But it doesn't happen with PatchALot, ScavengeRootsInCode < 2, or when
|
||||
// holder class is being initialized during parsing (for static fields).
|
||||
ciObject* c = field->constant_value().as_object();
|
||||
if (!c->is_null_object()) {
|
||||
set_constant(c->as_array()->length());
|
||||
|
@ -1413,6 +1413,17 @@ void LIR_List::store_check(LIR_Opr object, LIR_Opr array, LIR_Opr tmp1, LIR_Opr
|
||||
append(c);
|
||||
}
|
||||
|
||||
void LIR_List::null_check(LIR_Opr opr, CodeEmitInfo* info, bool deoptimize_on_null) {
|
||||
if (deoptimize_on_null) {
|
||||
// Emit an explicit null check and deoptimize if opr is null
|
||||
CodeStub* deopt = new DeoptimizeStub(info, Deoptimization::Reason_null_check, Deoptimization::Action_none);
|
||||
cmp(lir_cond_equal, opr, LIR_OprFact::oopConst(NULL));
|
||||
branch(lir_cond_equal, T_OBJECT, deopt);
|
||||
} else {
|
||||
// Emit an implicit null check
|
||||
append(new LIR_Op1(lir_null_check, opr, info));
|
||||
}
|
||||
}
|
||||
|
||||
void LIR_List::cas_long(LIR_Opr addr, LIR_Opr cmp_value, LIR_Opr new_value,
|
||||
LIR_Opr t1, LIR_Opr t2, LIR_Opr result) {
|
||||
|
@ -2113,7 +2113,7 @@ class LIR_List: public CompilationResourceObj {
|
||||
void pack64(LIR_Opr src, LIR_Opr dst) { append(new LIR_Op1(lir_pack64, src, dst, T_LONG, lir_patch_none, NULL)); }
|
||||
void unpack64(LIR_Opr src, LIR_Opr dst) { append(new LIR_Op1(lir_unpack64, src, dst, T_LONG, lir_patch_none, NULL)); }
|
||||
|
||||
void null_check(LIR_Opr opr, CodeEmitInfo* info) { append(new LIR_Op1(lir_null_check, opr, info)); }
|
||||
void null_check(LIR_Opr opr, CodeEmitInfo* info, bool deoptimize_on_null = false);
|
||||
void throw_exception(LIR_Opr exceptionPC, LIR_Opr exceptionOop, CodeEmitInfo* info) {
|
||||
append(new LIR_Op2(lir_throw, exceptionPC, exceptionOop, LIR_OprFact::illegalOpr, info));
|
||||
}
|
||||
|
@ -1752,8 +1752,10 @@ void LIRGenerator::do_StoreField(StoreField* x) {
|
||||
if (x->needs_null_check() &&
|
||||
(needs_patching ||
|
||||
MacroAssembler::needs_explicit_null_check(x->offset()))) {
|
||||
// emit an explicit null check because the offset is too large
|
||||
__ null_check(object.result(), new CodeEmitInfo(info));
|
||||
// Emit an explicit null check because the offset is too large.
|
||||
// If the class is not loaded and the object is NULL, we need to deoptimize to throw a
|
||||
// NoClassDefFoundError in the interpreter instead of an implicit NPE from compiled code.
|
||||
__ null_check(object.result(), new CodeEmitInfo(info), /* deoptimize */ needs_patching);
|
||||
}
|
||||
|
||||
LIR_Address* address;
|
||||
@ -1838,8 +1840,10 @@ void LIRGenerator::do_LoadField(LoadField* x) {
|
||||
obj = new_register(T_OBJECT);
|
||||
__ move(LIR_OprFact::oopConst(NULL), obj);
|
||||
}
|
||||
// emit an explicit null check because the offset is too large
|
||||
__ null_check(obj, new CodeEmitInfo(info));
|
||||
// Emit an explicit null check because the offset is too large.
|
||||
// If the class is not loaded and the object is NULL, we need to deoptimize to throw a
|
||||
// NoClassDefFoundError in the interpreter instead of an implicit NPE from compiled code.
|
||||
__ null_check(obj, new CodeEmitInfo(info), /* deoptimize */ needs_patching);
|
||||
}
|
||||
|
||||
LIR_Opr reg = rlock_result(x, field_type);
|
||||
|
@ -101,6 +101,7 @@ ciEnv::ciEnv(CompileTask* task, int system_dictionary_modification_counter)
|
||||
_debug_info = NULL;
|
||||
_dependencies = NULL;
|
||||
_failure_reason = NULL;
|
||||
_inc_decompile_count_on_failure = true;
|
||||
_compilable = MethodCompilable;
|
||||
_break_at_compile = false;
|
||||
_compiler_data = NULL;
|
||||
@ -161,6 +162,7 @@ ciEnv::ciEnv(Arena* arena) : _ciEnv_arena(mtCompiler) {
|
||||
_debug_info = NULL;
|
||||
_dependencies = NULL;
|
||||
_failure_reason = NULL;
|
||||
_inc_decompile_count_on_failure = true;
|
||||
_compilable = MethodCompilable_never;
|
||||
_break_at_compile = false;
|
||||
_compiler_data = NULL;
|
||||
@ -902,7 +904,12 @@ void ciEnv::validate_compile_task_dependencies(ciMethod* target) {
|
||||
if (deps.is_klass_type()) continue; // skip klass dependencies
|
||||
Klass* witness = deps.check_dependency();
|
||||
if (witness != NULL) {
|
||||
record_failure("invalid non-klass dependency");
|
||||
if (deps.type() == Dependencies::call_site_target_value) {
|
||||
_inc_decompile_count_on_failure = false;
|
||||
record_failure("call site target change");
|
||||
} else {
|
||||
record_failure("invalid non-klass dependency");
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -1017,7 +1024,7 @@ void ciEnv::register_method(ciMethod* target,
|
||||
if (failing()) {
|
||||
// While not a true deoptimization, it is a preemptive decompile.
|
||||
MethodData* mdo = method()->method_data();
|
||||
if (mdo != NULL) {
|
||||
if (mdo != NULL && _inc_decompile_count_on_failure) {
|
||||
mdo->inc_decompile_count();
|
||||
}
|
||||
|
||||
|
@ -55,6 +55,7 @@ private:
|
||||
DebugInformationRecorder* _debug_info;
|
||||
Dependencies* _dependencies;
|
||||
const char* _failure_reason;
|
||||
bool _inc_decompile_count_on_failure;
|
||||
int _compilable;
|
||||
bool _break_at_compile;
|
||||
int _num_inlined_bytecodes;
|
||||
|
@ -2269,6 +2269,7 @@ void java_lang_LiveStackFrameInfo::compute_offsets() {
|
||||
compute_offset(_monitors_offset, k, vmSymbols::monitors_name(), vmSymbols::object_array_signature());
|
||||
compute_offset(_locals_offset, k, vmSymbols::locals_name(), vmSymbols::object_array_signature());
|
||||
compute_offset(_operands_offset, k, vmSymbols::operands_name(), vmSymbols::object_array_signature());
|
||||
compute_offset(_mode_offset, k, vmSymbols::mode_name(), vmSymbols::int_signature());
|
||||
}
|
||||
|
||||
void java_lang_reflect_AccessibleObject::compute_offsets() {
|
||||
@ -3658,6 +3659,7 @@ int java_lang_StackFrameInfo::_version_offset;
|
||||
int java_lang_LiveStackFrameInfo::_monitors_offset;
|
||||
int java_lang_LiveStackFrameInfo::_locals_offset;
|
||||
int java_lang_LiveStackFrameInfo::_operands_offset;
|
||||
int java_lang_LiveStackFrameInfo::_mode_offset;
|
||||
int java_lang_AssertionStatusDirectives::classes_offset;
|
||||
int java_lang_AssertionStatusDirectives::classEnabled_offset;
|
||||
int java_lang_AssertionStatusDirectives::packages_offset;
|
||||
@ -3728,6 +3730,10 @@ void java_lang_LiveStackFrameInfo::set_operands(oop element, oop value) {
|
||||
element->obj_field_put(_operands_offset, value);
|
||||
}
|
||||
|
||||
void java_lang_LiveStackFrameInfo::set_mode(oop element, int value) {
|
||||
element->int_field_put(_mode_offset, value);
|
||||
}
|
||||
|
||||
// Support for java Assertions - java_lang_AssertionStatusDirectives.
|
||||
|
||||
void java_lang_AssertionStatusDirectives::set_classes(oop o, oop val) {
|
||||
|
@ -1380,11 +1380,13 @@ class java_lang_LiveStackFrameInfo: AllStatic {
|
||||
static int _monitors_offset;
|
||||
static int _locals_offset;
|
||||
static int _operands_offset;
|
||||
static int _mode_offset;
|
||||
|
||||
public:
|
||||
static void set_monitors(oop info, oop value);
|
||||
static void set_locals(oop info, oop value);
|
||||
static void set_operands(oop info, oop value);
|
||||
static void set_mode(oop info, int value);
|
||||
|
||||
static void compute_offsets();
|
||||
|
||||
|
@ -325,14 +325,8 @@
|
||||
template(java_lang_StackStreamFactory_AbstractStackWalker, "java/lang/StackStreamFactory$AbstractStackWalker") \
|
||||
template(doStackWalk_signature, "(JIIII)Ljava/lang/Object;") \
|
||||
template(asPrimitive_name, "asPrimitive") \
|
||||
template(asPrimitive_int_signature, "(I)Ljava/lang/LiveStackFrame$PrimitiveValue;") \
|
||||
template(asPrimitive_long_signature, "(J)Ljava/lang/LiveStackFrame$PrimitiveValue;") \
|
||||
template(asPrimitive_short_signature, "(S)Ljava/lang/LiveStackFrame$PrimitiveValue;") \
|
||||
template(asPrimitive_byte_signature, "(B)Ljava/lang/LiveStackFrame$PrimitiveValue;") \
|
||||
template(asPrimitive_char_signature, "(C)Ljava/lang/LiveStackFrame$PrimitiveValue;") \
|
||||
template(asPrimitive_float_signature, "(F)Ljava/lang/LiveStackFrame$PrimitiveValue;") \
|
||||
template(asPrimitive_double_signature, "(D)Ljava/lang/LiveStackFrame$PrimitiveValue;") \
|
||||
template(asPrimitive_boolean_signature, "(Z)Ljava/lang/LiveStackFrame$PrimitiveValue;") \
|
||||
template(asPrimitive_int_signature, "(I)Ljava/lang/LiveStackFrame$PrimitiveSlot;") \
|
||||
template(asPrimitive_long_signature, "(J)Ljava/lang/LiveStackFrame$PrimitiveSlot;") \
|
||||
\
|
||||
/* common method and field names */ \
|
||||
template(object_initializer_name, "<init>") \
|
||||
@ -444,6 +438,7 @@
|
||||
template(monitors_name, "monitors") \
|
||||
template(locals_name, "locals") \
|
||||
template(operands_name, "operands") \
|
||||
template(mode_name, "mode") \
|
||||
template(oop_size_name, "oop_size") \
|
||||
template(static_oop_field_count_name, "static_oop_field_count") \
|
||||
template(protection_domain_name, "protection_domain") \
|
||||
|
@ -1211,7 +1211,7 @@ void CodeCache::make_marked_nmethods_not_entrant() {
|
||||
CompiledMethodIterator iter;
|
||||
while(iter.next_alive()) {
|
||||
CompiledMethod* nm = iter.method();
|
||||
if (nm->is_marked_for_deoptimization()) {
|
||||
if (nm->is_marked_for_deoptimization() && !nm->is_not_entrant()) {
|
||||
nm->make_not_entrant();
|
||||
}
|
||||
}
|
||||
|
@ -1146,6 +1146,14 @@ bool nmethod::make_not_entrant_or_zombie(unsigned int state) {
|
||||
assert(state == zombie || state == not_entrant, "must be zombie or not_entrant");
|
||||
assert(!is_zombie(), "should not already be a zombie");
|
||||
|
||||
if (_state == state) {
|
||||
// Avoid taking the lock if already in required state.
|
||||
// This is safe from races because the state is an end-state,
|
||||
// which the nmethod cannot back out of once entered.
|
||||
// No need for fencing either.
|
||||
return false;
|
||||
}
|
||||
|
||||
// Make sure neither the nmethod nor the method is flushed in case of a safepoint in code below.
|
||||
nmethodLocker nml(this);
|
||||
methodHandle the_method(method());
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2001, 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
|
||||
@ -488,9 +488,6 @@ CMSCollector::CMSCollector(ConcurrentMarkSweepGeneration* cmsGen,
|
||||
_gc_timer_cm(new (ResourceObj::C_HEAP, mtGC) ConcurrentGCTimer()),
|
||||
_cms_start_registered(false)
|
||||
{
|
||||
if (ExplicitGCInvokesConcurrentAndUnloadsClasses) {
|
||||
ExplicitGCInvokesConcurrent = true;
|
||||
}
|
||||
// Now expand the span and allocate the collection support structures
|
||||
// (MUT, marking bit map etc.) to cover both generations subject to
|
||||
// collection.
|
||||
@ -2559,10 +2556,8 @@ void CMSCollector::verify_overflow_empty() const {
|
||||
// Decide if we want to enable class unloading as part of the
|
||||
// ensuing concurrent GC cycle. We will collect and
|
||||
// unload classes if it's the case that:
|
||||
// (1) an explicit gc request has been made and the flag
|
||||
// ExplicitGCInvokesConcurrentAndUnloadsClasses is set, OR
|
||||
// (2) (a) class unloading is enabled at the command line, and
|
||||
// (b) old gen is getting really full
|
||||
// (a) class unloading is enabled at the command line, and
|
||||
// (b) old gen is getting really full
|
||||
// NOTE: Provided there is no change in the state of the heap between
|
||||
// calls to this method, it should have idempotent results. Moreover,
|
||||
// its results should be monotonically increasing (i.e. going from 0 to 1,
|
||||
@ -2575,11 +2570,7 @@ void CMSCollector::verify_overflow_empty() const {
|
||||
// below.
|
||||
void CMSCollector::update_should_unload_classes() {
|
||||
_should_unload_classes = false;
|
||||
// Condition 1 above
|
||||
if (_full_gc_requested && ExplicitGCInvokesConcurrentAndUnloadsClasses) {
|
||||
_should_unload_classes = true;
|
||||
} else if (CMSClassUnloadingEnabled) { // Condition 2.a above
|
||||
// Disjuncts 2.b.(i,ii,iii) above
|
||||
if (CMSClassUnloadingEnabled) {
|
||||
_should_unload_classes = (concurrent_cycles_since_last_unload() >=
|
||||
CMSClassUnloadingMaxInterval)
|
||||
|| _cmsGen->is_too_full();
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2001, 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
|
||||
@ -711,29 +711,6 @@ void HeapRegionRemSet::setup_remset_size() {
|
||||
guarantee(G1RSetSparseRegionEntries > 0 && G1RSetRegionEntries > 0 , "Sanity");
|
||||
}
|
||||
|
||||
#ifndef PRODUCT
|
||||
void HeapRegionRemSet::print() {
|
||||
HeapRegionRemSetIterator iter(this);
|
||||
size_t card_index;
|
||||
while (iter.has_next(card_index)) {
|
||||
HeapWord* card_start = _bot->address_for_index(card_index);
|
||||
tty->print_cr(" Card " PTR_FORMAT, p2i(card_start));
|
||||
}
|
||||
if (iter.n_yielded() != occupied()) {
|
||||
tty->print_cr("Yielded disagrees with occupied:");
|
||||
tty->print_cr(" " SIZE_FORMAT_W(6) " yielded (" SIZE_FORMAT_W(6)
|
||||
" coarse, " SIZE_FORMAT_W(6) " fine).",
|
||||
iter.n_yielded(),
|
||||
iter.n_yielded_coarse(), iter.n_yielded_fine());
|
||||
tty->print_cr(" " SIZE_FORMAT_W(6) " occ (" SIZE_FORMAT_W(6)
|
||||
" coarse, " SIZE_FORMAT_W(6) " fine).",
|
||||
occupied(), occ_coarse(), occ_fine());
|
||||
}
|
||||
guarantee(iter.n_yielded() == occupied(),
|
||||
"We should have yielded all the represented cards.");
|
||||
}
|
||||
#endif
|
||||
|
||||
void HeapRegionRemSet::cleanup() {
|
||||
SparsePRT::cleanup_all();
|
||||
}
|
||||
@ -917,10 +894,6 @@ bool HeapRegionRemSetIterator::has_next(size_t& card_index) {
|
||||
// Otherwise...
|
||||
break;
|
||||
}
|
||||
assert(ParallelGCThreads > 1 ||
|
||||
n_yielded() == _hrrs->occupied(),
|
||||
"Should have yielded all the cards in the rem set "
|
||||
"(in the non-par case).");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2001, 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
|
||||
@ -290,8 +290,6 @@ public:
|
||||
// consumed by the strong code roots.
|
||||
size_t strong_code_roots_mem_size();
|
||||
|
||||
void print() PRODUCT_RETURN;
|
||||
|
||||
// Called during a stop-world phase to perform any deferred cleanups.
|
||||
static void cleanup();
|
||||
|
||||
|
@ -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
|
||||
@ -2199,7 +2199,6 @@ void Method::print_on(outputStream* st) const {
|
||||
ResourceMark rm;
|
||||
assert(is_method(), "must be method");
|
||||
st->print_cr("%s", internal_name());
|
||||
// get the effect of PrintOopAddress, always, for methods:
|
||||
st->print_cr(" - this oop: " INTPTR_FORMAT, p2i(this));
|
||||
st->print (" - method holder: "); method_holder()->print_value_on(st); st->cr();
|
||||
st->print (" - constants: " INTPTR_FORMAT " ", p2i(constants()));
|
||||
|
@ -373,7 +373,7 @@ const Type* Type::make_constant_from_field(ciField* field, ciInstance* holder,
|
||||
if (con_type != NULL && field->is_call_site_target()) {
|
||||
ciCallSite* call_site = holder->as_call_site();
|
||||
if (!call_site->is_constant_call_site()) {
|
||||
ciMethodHandle* target = call_site->get_target();
|
||||
ciMethodHandle* target = con.as_object()->as_method_handle();
|
||||
Compile::current()->dependencies()->assert_call_site_target_value(call_site, target);
|
||||
}
|
||||
}
|
||||
|
@ -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
|
||||
@ -2967,14 +2967,7 @@ JVM_ENTRY(void, JVM_Yield(JNIEnv *env, jclass threadClass))
|
||||
JVMWrapper("JVM_Yield");
|
||||
if (os::dont_yield()) return;
|
||||
HOTSPOT_THREAD_YIELD();
|
||||
|
||||
// When ConvertYieldToSleep is off (default), this matches the classic VM use of yield.
|
||||
// Critical for similar threading behaviour
|
||||
if (ConvertYieldToSleep) {
|
||||
os::sleep(thread, MinSleepInterval, false);
|
||||
} else {
|
||||
os::naked_yield();
|
||||
}
|
||||
os::naked_yield();
|
||||
JVM_END
|
||||
|
||||
|
||||
@ -2998,18 +2991,7 @@ JVM_ENTRY(void, JVM_Sleep(JNIEnv* env, jclass threadClass, jlong millis))
|
||||
EventThreadSleep event;
|
||||
|
||||
if (millis == 0) {
|
||||
// When ConvertSleepToYield is on, this matches the classic VM implementation of
|
||||
// JVM_Sleep. Critical for similar threading behaviour (Win32)
|
||||
// It appears that in certain GUI contexts, it may be beneficial to do a short sleep
|
||||
// for SOLARIS
|
||||
if (ConvertSleepToYield) {
|
||||
os::naked_yield();
|
||||
} else {
|
||||
ThreadState old_state = thread->osthread()->get_state();
|
||||
thread->osthread()->set_state(SLEEPING);
|
||||
os::sleep(thread, MinSleepInterval, false);
|
||||
thread->osthread()->set_state(old_state);
|
||||
}
|
||||
os::naked_yield();
|
||||
} else {
|
||||
ThreadState old_state = thread->osthread()->get_state();
|
||||
thread->osthread()->set_state(SLEEPING);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 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
|
||||
@ -1230,8 +1230,12 @@ void JvmtiExport::post_class_unload(Klass* klass) {
|
||||
assert(thread->is_VM_thread(), "wrong thread");
|
||||
|
||||
// get JavaThread for whom we are proxy
|
||||
JavaThread *real_thread =
|
||||
(JavaThread *)((VMThread *)thread)->vm_operation()->calling_thread();
|
||||
Thread *calling_thread = ((VMThread *)thread)->vm_operation()->calling_thread();
|
||||
if (!calling_thread->is_Java_thread()) {
|
||||
// cannot post an event to a non-JavaThread
|
||||
return;
|
||||
}
|
||||
JavaThread *real_thread = (JavaThread *)calling_thread;
|
||||
|
||||
JvmtiEnvIterator it;
|
||||
for (JvmtiEnv* env = it.first(); env != NULL; env = it.next(env)) {
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2008, 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
|
||||
@ -1208,9 +1208,10 @@ JVM_ENTRY(jobject, MHN_resolve_Mem(JNIEnv *env, jobject igcls, jobject mname_jh,
|
||||
if (reference_klass != NULL && reference_klass->is_instance_klass()) {
|
||||
// Emulate LinkResolver::check_klass_accessability.
|
||||
Klass* caller = java_lang_Class::as_Klass(JNIHandles::resolve_non_null(caller_jh));
|
||||
if (Reflection::verify_class_access(caller,
|
||||
reference_klass,
|
||||
true) != Reflection::ACCESS_OK) {
|
||||
if (caller != SystemDictionary::Object_klass()
|
||||
&& Reflection::verify_class_access(caller,
|
||||
reference_klass,
|
||||
true) != Reflection::ACCESS_OK) {
|
||||
THROW_MSG_NULL(vmSymbols::java_lang_InternalError(), reference_klass->external_name());
|
||||
}
|
||||
}
|
||||
|
@ -173,7 +173,11 @@ void JavaFrameStream::fill_frame(int index, objArrayHandle frames_array,
|
||||
}
|
||||
}
|
||||
|
||||
oop LiveFrameStream::create_primitive_value_instance(StackValueCollection* values, int i, TRAPS) {
|
||||
// Create and return a LiveStackFrame.PrimitiveSlot (if needed) for the
|
||||
// StackValue at the given index. 'type' is expected to be T_INT, T_LONG,
|
||||
// T_OBJECT, or T_CONFLICT.
|
||||
oop LiveFrameStream::create_primitive_slot_instance(StackValueCollection* values,
|
||||
int i, BasicType type, TRAPS) {
|
||||
Klass* k = SystemDictionary::resolve_or_null(vmSymbols::java_lang_LiveStackFrameInfo(), CHECK_NULL);
|
||||
instanceKlassHandle ik (THREAD, k);
|
||||
|
||||
@ -182,8 +186,8 @@ oop LiveFrameStream::create_primitive_value_instance(StackValueCollection* value
|
||||
Symbol* signature = NULL;
|
||||
|
||||
// ## TODO: type is only available in LocalVariable table, if present.
|
||||
// ## StackValue type is T_INT or T_OBJECT.
|
||||
switch (values->at(i)->type()) {
|
||||
// ## StackValue type is T_INT or T_OBJECT (or converted to T_LONG on 64-bit)
|
||||
switch (type) {
|
||||
case T_INT:
|
||||
args.push_int(values->int_at(i));
|
||||
signature = vmSymbols::asPrimitive_int_signature();
|
||||
@ -195,42 +199,26 @@ oop LiveFrameStream::create_primitive_value_instance(StackValueCollection* value
|
||||
break;
|
||||
|
||||
case T_FLOAT:
|
||||
args.push_float(values->float_at(i));
|
||||
signature = vmSymbols::asPrimitive_float_signature();
|
||||
break;
|
||||
|
||||
case T_DOUBLE:
|
||||
args.push_double(values->double_at(i));
|
||||
signature = vmSymbols::asPrimitive_double_signature();
|
||||
break;
|
||||
|
||||
case T_BYTE:
|
||||
args.push_int(values->int_at(i));
|
||||
signature = vmSymbols::asPrimitive_byte_signature();
|
||||
break;
|
||||
|
||||
case T_SHORT:
|
||||
args.push_int(values->int_at(i));
|
||||
signature = vmSymbols::asPrimitive_short_signature();
|
||||
break;
|
||||
|
||||
case T_CHAR:
|
||||
args.push_int(values->int_at(i));
|
||||
signature = vmSymbols::asPrimitive_char_signature();
|
||||
break;
|
||||
|
||||
case T_BOOLEAN:
|
||||
args.push_int(values->int_at(i));
|
||||
signature = vmSymbols::asPrimitive_boolean_signature();
|
||||
break;
|
||||
THROW_MSG_(vmSymbols::java_lang_InternalError(), "Unexpected StackValue type", NULL);
|
||||
|
||||
case T_OBJECT:
|
||||
return values->obj_at(i)();
|
||||
|
||||
case T_CONFLICT:
|
||||
// put a non-null slot
|
||||
args.push_int(0);
|
||||
signature = vmSymbols::asPrimitive_int_signature();
|
||||
#ifdef _LP64
|
||||
args.push_long(0);
|
||||
signature = vmSymbols::asPrimitive_long_signature();
|
||||
#else
|
||||
args.push_int(0);
|
||||
signature = vmSymbols::asPrimitive_int_signature();
|
||||
#endif
|
||||
|
||||
break;
|
||||
|
||||
default: ShouldNotReachHere();
|
||||
@ -252,9 +240,19 @@ objArrayHandle LiveFrameStream::values_to_object_array(StackValueCollection* val
|
||||
objArrayHandle array_h(THREAD, array_oop);
|
||||
for (int i = 0; i < values->size(); i++) {
|
||||
StackValue* st = values->at(i);
|
||||
oop obj = create_primitive_value_instance(values, i, CHECK_(empty));
|
||||
if (obj != NULL)
|
||||
BasicType type = st->type();
|
||||
int index = i;
|
||||
#ifdef _LP64
|
||||
if (type != T_OBJECT && type != T_CONFLICT) {
|
||||
intptr_t ret = st->get_int(); // read full 64-bit slot
|
||||
type = T_LONG; // treat as long
|
||||
index--; // undo +1 in StackValueCollection::long_at
|
||||
}
|
||||
#endif
|
||||
oop obj = create_primitive_slot_instance(values, index, type, CHECK_(empty));
|
||||
if (obj != NULL) {
|
||||
array_h->obj_at_put(i, obj);
|
||||
}
|
||||
}
|
||||
return array_h;
|
||||
}
|
||||
@ -286,6 +284,13 @@ void LiveFrameStream::fill_live_stackframe(Handle stackFrame,
|
||||
StackValueCollection* expressions = _jvf->expressions();
|
||||
GrowableArray<MonitorInfo*>* monitors = _jvf->monitors();
|
||||
|
||||
int mode = 0;
|
||||
if (_jvf->is_interpreted_frame()) {
|
||||
mode = MODE_INTERPRETED;
|
||||
} else if (_jvf->is_compiled_frame()) {
|
||||
mode = MODE_COMPILED;
|
||||
}
|
||||
|
||||
if (!locals->is_empty()) {
|
||||
objArrayHandle locals_h = values_to_object_array(locals, CHECK);
|
||||
java_lang_LiveStackFrameInfo::set_locals(stackFrame(), locals_h());
|
||||
@ -298,6 +303,7 @@ void LiveFrameStream::fill_live_stackframe(Handle stackFrame,
|
||||
objArrayHandle monitors_h = monitors_to_object_array(monitors, CHECK);
|
||||
java_lang_LiveStackFrameInfo::set_monitors(stackFrame(), monitors_h());
|
||||
}
|
||||
java_lang_LiveStackFrameInfo::set_mode(stackFrame(), mode);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -92,11 +92,16 @@ public:
|
||||
|
||||
class LiveFrameStream : public BaseFrameStream {
|
||||
private:
|
||||
enum {
|
||||
MODE_INTERPRETED = 0x01,
|
||||
MODE_COMPILED = 0x02
|
||||
};
|
||||
|
||||
javaVFrame* _jvf;
|
||||
|
||||
void fill_live_stackframe(Handle stackFrame, const methodHandle& method, TRAPS);
|
||||
static oop create_primitive_value_instance(StackValueCollection* values,
|
||||
int i, TRAPS);
|
||||
static oop create_primitive_slot_instance(StackValueCollection* values,
|
||||
int i, BasicType type, TRAPS);
|
||||
static objArrayHandle monitors_to_object_array(GrowableArray<MonitorInfo*>* monitors,
|
||||
TRAPS);
|
||||
static objArrayHandle values_to_object_array(StackValueCollection* values, TRAPS);
|
||||
|
@ -375,53 +375,17 @@ static SpecialFlag const special_jvm_flags[] = {
|
||||
// -------------- Deprecated Flags --------------
|
||||
// --- Non-alias flags - sorted by obsolete_in then expired_in:
|
||||
{ "MaxGCMinorPauseMillis", JDK_Version::jdk(8), JDK_Version::undefined(), JDK_Version::undefined() },
|
||||
{ "AutoGCSelectPauseMillis", JDK_Version::jdk(9), JDK_Version::undefined(), JDK_Version::jdk(10) },
|
||||
{ "UseAutoGCSelectPolicy", JDK_Version::jdk(9), JDK_Version::undefined(), JDK_Version::jdk(10) },
|
||||
{ "UseParNewGC", JDK_Version::jdk(9), JDK_Version::undefined(), JDK_Version::jdk(10) },
|
||||
{ "ExplicitGCInvokesConcurrentAndUnloadsClasses", JDK_Version::jdk(9), JDK_Version::undefined(), JDK_Version::jdk(10) },
|
||||
{ "ConvertSleepToYield", JDK_Version::jdk(9), JDK_Version::jdk(10), JDK_Version::jdk(11) },
|
||||
{ "ConvertYieldToSleep", JDK_Version::jdk(9), JDK_Version::jdk(10), JDK_Version::jdk(11) },
|
||||
|
||||
// --- Deprecated alias flags (see also aliased_jvm_flags) - sorted by obsolete_in then expired_in:
|
||||
{ "DefaultMaxRAMFraction", JDK_Version::jdk(8), JDK_Version::undefined(), JDK_Version::undefined() },
|
||||
{ "CreateMinidumpOnCrash", JDK_Version::jdk(9), JDK_Version::undefined(), JDK_Version::undefined() },
|
||||
{ "CMSMarkStackSizeMax", JDK_Version::jdk(9), JDK_Version::undefined(), JDK_Version::jdk(10) },
|
||||
{ "CMSMarkStackSize", JDK_Version::jdk(9), JDK_Version::undefined(), JDK_Version::jdk(10) },
|
||||
{ "G1MarkStackSize", JDK_Version::jdk(9), JDK_Version::undefined(), JDK_Version::jdk(10) },
|
||||
{ "ParallelMarkingThreads", JDK_Version::jdk(9), JDK_Version::undefined(), JDK_Version::jdk(10) },
|
||||
{ "ParallelCMSThreads", JDK_Version::jdk(9), JDK_Version::undefined(), JDK_Version::jdk(10) },
|
||||
|
||||
// -------------- Obsolete Flags - sorted by expired_in --------------
|
||||
{ "UseOldInlining", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) },
|
||||
{ "SafepointPollOffset", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) },
|
||||
{ "UseBoundThreads", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) },
|
||||
{ "DefaultThreadPriority", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) },
|
||||
{ "NoYieldsInMicrolock", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) },
|
||||
{ "BackEdgeThreshold", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) },
|
||||
{ "UseNewReflection", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) },
|
||||
{ "ReflectionWrapResolutionErrors",JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) },
|
||||
{ "VerifyReflectionBytecodes", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) },
|
||||
{ "AutoShutdownNMT", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) },
|
||||
{ "NmethodSweepFraction", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) },
|
||||
{ "NmethodSweepCheckInterval", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) },
|
||||
{ "CodeCacheMinimumFreeSpace", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) },
|
||||
#ifndef ZERO
|
||||
{ "UseFastAccessorMethods", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) },
|
||||
{ "UseFastEmptyMethods", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) },
|
||||
#endif // ZERO
|
||||
{ "UseCompilerSafepoints", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) },
|
||||
{ "AdaptiveSizePausePolicy", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) },
|
||||
{ "ParallelGCRetainPLAB", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) },
|
||||
{ "ThreadSafetyMargin", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) },
|
||||
{ "LazyBootClassLoader", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) },
|
||||
{ "StarvationMonitorInterval", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) },
|
||||
{ "PreInflateSpin", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) },
|
||||
{ "JNIDetachReleasesMonitors", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) },
|
||||
{ "UseAltSigs", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) },
|
||||
{ "SegmentedHeapDumpThreshold", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) },
|
||||
{ "PrintOopAddress", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) },
|
||||
{ "PermSize", JDK_Version::undefined(), JDK_Version::jdk(8), JDK_Version::jdk(10) },
|
||||
{ "MaxPermSize", JDK_Version::undefined(), JDK_Version::jdk(8), JDK_Version::jdk(10) },
|
||||
{ "ConvertSleepToYield", JDK_Version::jdk(9), JDK_Version::jdk(10), JDK_Version::jdk(11) },
|
||||
{ "ConvertYieldToSleep", JDK_Version::jdk(9), JDK_Version::jdk(10), JDK_Version::jdk(11) },
|
||||
{ "MinSleepInterval", JDK_Version::jdk(9), JDK_Version::jdk(10), JDK_Version::jdk(11) },
|
||||
{ "PermSize", JDK_Version::undefined(), JDK_Version::jdk(8), JDK_Version::undefined() },
|
||||
{ "MaxPermSize", JDK_Version::undefined(), JDK_Version::jdk(8), JDK_Version::undefined() },
|
||||
|
||||
#ifdef TEST_VERIFY_SPECIAL_JVM_FLAGS
|
||||
{ "dep > obs", JDK_Version::jdk(9), JDK_Version::jdk(8), JDK_Version::undefined() },
|
||||
@ -444,11 +408,6 @@ typedef struct {
|
||||
|
||||
static AliasedFlag const aliased_jvm_flags[] = {
|
||||
{ "DefaultMaxRAMFraction", "MaxRAMFraction" },
|
||||
{ "CMSMarkStackSizeMax", "MarkStackSizeMax" },
|
||||
{ "CMSMarkStackSize", "MarkStackSize" },
|
||||
{ "G1MarkStackSize", "MarkStackSize" },
|
||||
{ "ParallelMarkingThreads", "ConcGCThreads" },
|
||||
{ "ParallelCMSThreads", "ConcGCThreads" },
|
||||
{ "CreateMinidumpOnCrash", "CreateCoredumpOnCrash" },
|
||||
{ NULL, NULL}
|
||||
};
|
||||
@ -1547,7 +1506,6 @@ void Arguments::set_parnew_gc_flags() {
|
||||
assert(!UseSerialGC && !UseParallelOldGC && !UseParallelGC && !UseG1GC,
|
||||
"control point invariant");
|
||||
assert(UseConcMarkSweepGC, "CMS is expected to be on here");
|
||||
assert(UseParNewGC, "ParNew should always be used with CMS");
|
||||
|
||||
if (FLAG_IS_DEFAULT(ParallelGCThreads)) {
|
||||
FLAG_SET_DEFAULT(ParallelGCThreads, Abstract_VM_Version::parallel_worker_threads());
|
||||
@ -1588,7 +1546,6 @@ void Arguments::set_parnew_gc_flags() {
|
||||
void Arguments::set_cms_and_parnew_gc_flags() {
|
||||
assert(!UseSerialGC && !UseParallelOldGC && !UseParallelGC, "Error");
|
||||
assert(UseConcMarkSweepGC, "CMS is expected to be on here");
|
||||
assert(UseParNewGC, "ParNew should always be used with CMS");
|
||||
|
||||
// Turn off AdaptiveSizePolicy by default for cms until it is complete.
|
||||
disable_adaptive_size_policy("UseConcMarkSweepGC");
|
||||
@ -1728,16 +1685,6 @@ size_t Arguments::max_heap_for_compressed_oops() {
|
||||
NOT_LP64(ShouldNotReachHere(); return 0);
|
||||
}
|
||||
|
||||
bool Arguments::should_auto_select_low_pause_collector() {
|
||||
if (UseAutoGCSelectPolicy &&
|
||||
!FLAG_IS_DEFAULT(MaxGCPauseMillis) &&
|
||||
(MaxGCPauseMillis <= AutoGCSelectPauseMillis)) {
|
||||
log_trace(gc)("Automatic selection of the low pause collector based on pause goal of %d (ms)", (int) MaxGCPauseMillis);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void Arguments::set_use_compressed_oops() {
|
||||
#ifndef ZERO
|
||||
#ifdef _LP64
|
||||
@ -1841,16 +1788,7 @@ void Arguments::select_compilation_mode_ergonomically() {
|
||||
void Arguments::select_gc_ergonomically() {
|
||||
#if INCLUDE_ALL_GCS
|
||||
if (os::is_server_class_machine()) {
|
||||
if (!UseAutoGCSelectPolicy) {
|
||||
FLAG_SET_ERGO_IF_DEFAULT(bool, UseG1GC, true);
|
||||
} else {
|
||||
if (should_auto_select_low_pause_collector()) {
|
||||
FLAG_SET_ERGO_IF_DEFAULT(bool, UseConcMarkSweepGC, true);
|
||||
FLAG_SET_ERGO_IF_DEFAULT(bool, UseParNewGC, true);
|
||||
} else {
|
||||
FLAG_SET_ERGO_IF_DEFAULT(bool, UseParallelGC, true);
|
||||
}
|
||||
}
|
||||
FLAG_SET_ERGO_IF_DEFAULT(bool, UseG1GC, true);
|
||||
} else {
|
||||
FLAG_SET_ERGO_IF_DEFAULT(bool, UseSerialGC, true);
|
||||
}
|
||||
@ -1859,7 +1797,6 @@ void Arguments::select_gc_ergonomically() {
|
||||
UNSUPPORTED_OPTION(UseParallelGC);
|
||||
UNSUPPORTED_OPTION(UseParallelOldGC);
|
||||
UNSUPPORTED_OPTION(UseConcMarkSweepGC);
|
||||
UNSUPPORTED_OPTION(UseParNewGC);
|
||||
FLAG_SET_ERGO_IF_DEFAULT(bool, UseSerialGC, true);
|
||||
#endif // INCLUDE_ALL_GCS
|
||||
}
|
||||
@ -2073,7 +2010,6 @@ void Arguments::set_gc_specific_flags() {
|
||||
if (!ClassUnloading) {
|
||||
FLAG_SET_CMDLINE(bool, CMSClassUnloadingEnabled, false);
|
||||
FLAG_SET_CMDLINE(bool, ClassUnloadingWithConcurrentMark, false);
|
||||
FLAG_SET_CMDLINE(bool, ExplicitGCInvokesConcurrentAndUnloadsClasses, false);
|
||||
}
|
||||
#endif // INCLUDE_ALL_GCS
|
||||
}
|
||||
@ -2428,18 +2364,6 @@ bool Arguments::check_gc_consistency() {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (UseConcMarkSweepGC && !UseParNewGC) {
|
||||
jio_fprintf(defaultStream::error_stream(),
|
||||
"It is not possible to combine the DefNew young collector with the CMS collector.\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (UseParNewGC && !UseConcMarkSweepGC) {
|
||||
jio_fprintf(defaultStream::error_stream(),
|
||||
"It is not possible to combine the ParNew young collector with any collector other than CMS.\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -3726,11 +3650,6 @@ jint Arguments::finalize_vm_init_args() {
|
||||
}
|
||||
}
|
||||
|
||||
if (UseConcMarkSweepGC && FLAG_IS_DEFAULT(UseParNewGC) && !UseParNewGC) {
|
||||
// CMS can only be used with ParNew
|
||||
FLAG_SET_ERGO(bool, UseParNewGC, true);
|
||||
}
|
||||
|
||||
if (!check_vm_args_consistency()) {
|
||||
return JNI_ERR;
|
||||
}
|
||||
|
@ -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
|
||||
@ -480,9 +480,6 @@ class Arguments : AllStatic {
|
||||
static julong limit_by_allocatable_memory(julong size);
|
||||
// Setup heap size
|
||||
static void set_heap_size();
|
||||
// Based on automatic selection criteria, should the
|
||||
// low pause collector be used.
|
||||
static bool should_auto_select_low_pause_collector();
|
||||
|
||||
// Bytecode rewriting
|
||||
static void set_bytecode_flags();
|
||||
|
@ -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
|
||||
@ -1159,13 +1159,6 @@ public:
|
||||
product_pd(bool, DontYieldALot, \
|
||||
"Throw away obvious excess yield calls") \
|
||||
\
|
||||
product(bool, ConvertSleepToYield, true, \
|
||||
"Convert sleep(0) to thread yield ") \
|
||||
\
|
||||
product(bool, ConvertYieldToSleep, false, \
|
||||
"Convert yield to a sleep of MinSleepInterval to simulate Win32 " \
|
||||
"behavior") \
|
||||
\
|
||||
develop(bool, UseDetachedThreads, true, \
|
||||
"Use detached threads that are recycled upon termination " \
|
||||
"(for Solaris only)") \
|
||||
@ -1479,11 +1472,6 @@ public:
|
||||
"A System.gc() request invokes a concurrent collection; " \
|
||||
"(effective only when using concurrent collectors)") \
|
||||
\
|
||||
product(bool, ExplicitGCInvokesConcurrentAndUnloadsClasses, false, \
|
||||
"A System.gc() request invokes a concurrent collection and " \
|
||||
"also unloads classes during such a concurrent gc cycle " \
|
||||
"(effective only when UseConcMarkSweepGC)") \
|
||||
\
|
||||
product(bool, GCLockerInvokesConcurrent, false, \
|
||||
"The exit of a JNI critical section necessitating a scavenge, " \
|
||||
"also kicks off a background concurrent collection") \
|
||||
@ -1501,9 +1489,6 @@ public:
|
||||
product(bool, UseCMSBestFit, true, \
|
||||
"Use CMS best fit allocation strategy") \
|
||||
\
|
||||
product(bool, UseParNewGC, false, \
|
||||
"Use parallel threads in the new generation") \
|
||||
\
|
||||
product(uintx, ParallelGCBufferWastePct, 10, \
|
||||
"Wasted fraction of parallel allocation buffer") \
|
||||
range(0, 100) \
|
||||
@ -2059,13 +2044,6 @@ public:
|
||||
"Maximum fraction (1/n) of virtual memory used for ergonomically "\
|
||||
"determining maximum heap size") \
|
||||
\
|
||||
product(bool, UseAutoGCSelectPolicy, false, \
|
||||
"Use automatic collection selection policy") \
|
||||
\
|
||||
product(uintx, AutoGCSelectPauseMillis, 5000, \
|
||||
"Automatic GC selection pause threshold in milliseconds") \
|
||||
range(0, max_uintx) \
|
||||
\
|
||||
product(bool, UseAdaptiveSizePolicy, true, \
|
||||
"Use adaptive generation sizing policies") \
|
||||
\
|
||||
@ -3003,10 +2981,6 @@ public:
|
||||
develop(intx, DontYieldALotInterval, 10, \
|
||||
"Interval between which yields will be dropped (milliseconds)") \
|
||||
\
|
||||
develop(intx, MinSleepInterval, 1, \
|
||||
"Minimum sleep() interval (milliseconds) when " \
|
||||
"ConvertSleepToYield is off (used for Solaris)") \
|
||||
\
|
||||
develop(intx, ProfilerPCTickThreshold, 15, \
|
||||
"Number of ticks in a PC buckets to be a hotspot") \
|
||||
\
|
||||
|
@ -73,6 +73,7 @@ runtime/SharedArchiveFile/DefaultUseWithClient.java 8154204 generic-all
|
||||
|
||||
serviceability/jdwp/AllModulesCommandTest.java 8168478 generic-all
|
||||
serviceability/sa/sadebugd/SADebugDTest.java 8163805 generic-all
|
||||
serviceability/jvmti/ModuleAwareAgents/ClassFileLoadHook/MAAClassFileLoadHook.java 8173936 generic-all
|
||||
|
||||
#############################################################################
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2013, 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
|
||||
@ -209,11 +209,8 @@ needs_full_vm_compact1 = \
|
||||
gc/g1/TestShrinkToOneRegion.java \
|
||||
gc/metaspace/G1AddMetaspaceDependency.java \
|
||||
gc/startup_warnings/TestCMS.java \
|
||||
gc/startup_warnings/TestDefNewCMS.java \
|
||||
gc/startup_warnings/TestParallelGC.java \
|
||||
gc/startup_warnings/TestParallelScavengeSerialOld.java \
|
||||
gc/startup_warnings/TestParNewCMS.java \
|
||||
gc/startup_warnings/TestParNewSerialOld.java \
|
||||
runtime/SharedArchiveFile/SharedArchiveFile.java
|
||||
|
||||
# Minimal VM on Compact 2 adds in some compact2 tests
|
||||
|
38
hotspot/test/compiler/c1/TestUnresolvedField.jasm
Normal file
38
hotspot/test/compiler/c1/TestUnresolvedField.jasm
Normal file
@ -0,0 +1,38 @@
|
||||
/*
|
||||
* Copyright (c) 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
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*
|
||||
*/
|
||||
|
||||
public class compiler/c1/TestUnresolvedField version 52:0 {
|
||||
public static Method testGetField:"()V" stack 1 locals 1 {
|
||||
aconst_null;
|
||||
getfield Field T.f:I; // T does not exist
|
||||
return;
|
||||
}
|
||||
|
||||
public static Method testPutField:"()V" stack 2 locals 1 {
|
||||
aconst_null;
|
||||
iconst_0;
|
||||
putfield Field T.f:I; // T does not exist
|
||||
return;
|
||||
}
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 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
|
||||
@ -23,28 +23,26 @@
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @bug 6843127
|
||||
* @run main/othervm/timeout=300 BadKdc4
|
||||
* @summary krb5 should not try to access unavailable kdc too often
|
||||
* @bug 8173373
|
||||
* @compile TestUnresolvedField.jasm
|
||||
* @run main/othervm -XX:TieredStopAtLevel=1 -Xcomp
|
||||
* -XX:CompileCommand=compileonly,compiler.c1.TestUnresolvedField::test*
|
||||
* compiler.c1.TestUnresolvedFieldMain
|
||||
*/
|
||||
|
||||
import java.io.*;
|
||||
import java.security.Security;
|
||||
package compiler.c1;
|
||||
|
||||
public class BadKdc4 {
|
||||
|
||||
public static void main(String[] args)
|
||||
throws Exception {
|
||||
Security.setProperty("krb5.kdc.bad.policy", "");
|
||||
BadKdc.go(
|
||||
"121212222222(32){1,3}121212222222(32){1,3}",
|
||||
"121212222222(32){1,3}121212222222(32){1,3}",
|
||||
// refresh
|
||||
"121212222222(32){1,3}121212222222(32){1,3}",
|
||||
// k3 off k2 on
|
||||
"121212(22){1,3}121212(22){1,3}",
|
||||
// k1 on
|
||||
"(12){2,4}"
|
||||
);
|
||||
public class TestUnresolvedFieldMain {
|
||||
public static void main(String[] args) {
|
||||
try {
|
||||
TestUnresolvedField.testGetField();
|
||||
} catch (java.lang.NoClassDefFoundError error) {
|
||||
// Expected
|
||||
}
|
||||
try {
|
||||
TestUnresolvedField.testPutField();
|
||||
} catch (java.lang.NoClassDefFoundError error) {
|
||||
// Expected
|
||||
}
|
||||
}
|
||||
}
|
@ -23,7 +23,6 @@
|
||||
|
||||
/**
|
||||
* @test
|
||||
* @modules java.base/jdk.internal.misc
|
||||
* @library /test/lib /
|
||||
*
|
||||
* @run driver compiler.jsr292.ContinuousCallSiteTargetChange
|
||||
@ -31,6 +30,7 @@
|
||||
|
||||
package compiler.jsr292;
|
||||
|
||||
import jdk.test.lib.Asserts;
|
||||
import jdk.test.lib.process.OutputAnalyzer;
|
||||
import jdk.test.lib.process.ProcessTools;
|
||||
|
||||
@ -39,15 +39,26 @@ import java.lang.invoke.MethodHandle;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.MethodType;
|
||||
import java.lang.invoke.MutableCallSite;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
public class ContinuousCallSiteTargetChange {
|
||||
static void testServer() throws Exception {
|
||||
static final int ITERATIONS = Integer.parseInt(System.getProperty("iterations", "50"));
|
||||
|
||||
static void runTest(Class<?> test, String... extraArgs) throws Exception {
|
||||
List<String> argsList = new ArrayList<>(
|
||||
List.of("-XX:+IgnoreUnrecognizedVMOptions",
|
||||
"-XX:PerBytecodeRecompilationCutoff=10", "-XX:PerMethodRecompilationCutoff=10",
|
||||
"-XX:+PrintCompilation", "-XX:+UnlockDiagnosticVMOptions", "-XX:+PrintInlining"));
|
||||
|
||||
argsList.addAll(Arrays.asList(extraArgs));
|
||||
|
||||
argsList.add(test.getName());
|
||||
argsList.add(Integer.toString(ITERATIONS));
|
||||
|
||||
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
|
||||
"-XX:+IgnoreUnrecognizedVMOptions",
|
||||
"-server", "-XX:-TieredCompilation", "-Xbatch",
|
||||
"-XX:PerBytecodeRecompilationCutoff=10", "-XX:PerMethodRecompilationCutoff=10",
|
||||
"-XX:+PrintCompilation", "-XX:+UnlockDiagnosticVMOptions", "-XX:+PrintInlining",
|
||||
Test.class.getName(), "100");
|
||||
argsList.toArray(new String[argsList.size()]));
|
||||
|
||||
OutputAnalyzer analyzer = new OutputAnalyzer(pb.start());
|
||||
|
||||
@ -55,30 +66,42 @@ public class ContinuousCallSiteTargetChange {
|
||||
|
||||
analyzer.shouldNotContain("made not compilable");
|
||||
analyzer.shouldNotContain("decompile_count > PerMethodRecompilationCutoff");
|
||||
|
||||
}
|
||||
|
||||
static void testClient() throws Exception {
|
||||
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
|
||||
"-XX:+IgnoreUnrecognizedVMOptions",
|
||||
"-client", "-XX:+TieredCompilation", "-XX:TieredStopAtLevel=1", "-Xbatch",
|
||||
"-XX:PerBytecodeRecompilationCutoff=10", "-XX:PerMethodRecompilationCutoff=10",
|
||||
"-XX:+PrintCompilation", "-XX:+UnlockDiagnosticVMOptions", "-XX:+PrintInlining",
|
||||
Test.class.getName(), "100");
|
||||
static void testServer(Class<?> test, String... args) throws Exception {
|
||||
List<String> extraArgsList = new ArrayList<>(
|
||||
List.of("-server", "-XX:-TieredCompilation"));
|
||||
extraArgsList.addAll(Arrays.asList(args));
|
||||
|
||||
OutputAnalyzer analyzer = new OutputAnalyzer(pb.start());
|
||||
runTest(test, extraArgsList.toArray(new String[extraArgsList.size()]));
|
||||
}
|
||||
|
||||
analyzer.shouldHaveExitValue(0);
|
||||
static void testClient(Class<?> test, String... args) throws Exception {
|
||||
List<String> extraArgsList = new ArrayList<>(
|
||||
List.of("-client", "-XX:+TieredCompilation", "-XX:TieredStopAtLevel=1"));
|
||||
extraArgsList.addAll(Arrays.asList(args));
|
||||
|
||||
analyzer.shouldNotContain("made not compilable");
|
||||
analyzer.shouldNotContain("decompile_count > PerMethodRecompilationCutoff");
|
||||
runTest(test, extraArgsList.toArray(new String[extraArgsList.size()]));
|
||||
}
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
testServer();
|
||||
testClient();
|
||||
testServer(RecompilationTest.class, "-Xbatch");
|
||||
testClient(RecompilationTest.class, "-Xbatch");
|
||||
|
||||
testServer(PingPongTest.class);
|
||||
testClient(PingPongTest.class);
|
||||
}
|
||||
|
||||
static class Test {
|
||||
static MethodHandle findStatic(Class<?> cls, String name, MethodType mt) {
|
||||
try {
|
||||
return MethodHandles.lookup().findStatic(cls, name, mt);
|
||||
} catch (Exception e) {
|
||||
throw new Error(e);
|
||||
}
|
||||
}
|
||||
|
||||
static class RecompilationTest {
|
||||
static final MethodType mt = MethodType.methodType(void.class);
|
||||
static final CallSite cs = new MutableCallSite(mt);
|
||||
|
||||
@ -96,7 +119,7 @@ public class ContinuousCallSiteTargetChange {
|
||||
}
|
||||
|
||||
static void iteration() throws Throwable {
|
||||
MethodHandle mh1 = MethodHandles.lookup().findStatic(ContinuousCallSiteTargetChange.Test.class, "f", mt);
|
||||
MethodHandle mh1 = findStatic(RecompilationTest.class, "f", mt);
|
||||
cs.setTarget(mh1);
|
||||
for (int i = 0; i < 20_000; i++) {
|
||||
test1();
|
||||
@ -111,4 +134,38 @@ public class ContinuousCallSiteTargetChange {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static class PingPongTest {
|
||||
static final MethodType mt = MethodType.methodType(void.class);
|
||||
static final CallSite cs = new MutableCallSite(mt);
|
||||
|
||||
static final MethodHandle mh = cs.dynamicInvoker();
|
||||
|
||||
static final MethodHandle ping = findStatic(PingPongTest.class, "ping", mt);
|
||||
static final MethodHandle pong = findStatic(PingPongTest.class, "pong", mt);
|
||||
|
||||
static void ping() {
|
||||
Asserts.assertEQ(cs.getTarget(), ping, "wrong call site target");
|
||||
cs.setTarget(pong);
|
||||
}
|
||||
|
||||
static void pong() {
|
||||
Asserts.assertEQ(cs.getTarget(), pong, "wrong call site target");
|
||||
cs.setTarget(ping);
|
||||
}
|
||||
|
||||
static void iteration() throws Throwable {
|
||||
cs.setTarget(ping);
|
||||
for (int i = 0; i < 20_000; i++) {
|
||||
mh.invokeExact();
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args) throws Throwable {
|
||||
int iterations = Integer.parseInt(args[0]);
|
||||
for (int i = 0; i < iterations; i++) {
|
||||
iteration();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -84,7 +84,7 @@ public class MethodHandleHelper {
|
||||
|
||||
public static MethodHandle make(MethodHandle target) {
|
||||
LambdaForm lform = DelegatingMethodHandle.makeReinvokerForm(
|
||||
target, -1, DelegatingMethodHandle.class, "reinvoker.dontInline",
|
||||
target, -1, DelegatingMethodHandle.class,
|
||||
/*forceInline=*/false, DelegatingMethodHandle.NF_getTarget, null);
|
||||
return new NonInlinedReinvoker(target, lform);
|
||||
}
|
||||
|
@ -44,6 +44,8 @@
|
||||
* -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
|
||||
* -XX:CompileCommand=exclude,*::check
|
||||
* -XX:+DoEscapeAnalysis -XX:-UseCounterDecay
|
||||
* -XX:CompileCommand=dontinline,compiler/jvmci/compilerToVM/MaterializeVirtualObjectTest,testFrame
|
||||
* -XX:CompileCommand=inline,compiler/jvmci/compilerToVM/MaterializeVirtualObjectTest,recurse
|
||||
* -Xbatch
|
||||
* -Dcompiler.jvmci.compilerToVM.MaterializeVirtualObjectTest.invalidate=false
|
||||
* compiler.jvmci.compilerToVM.MaterializeVirtualObjectTest
|
||||
@ -119,14 +121,25 @@ public class MaterializeVirtualObjectTest {
|
||||
}
|
||||
Asserts.assertTrue(WB.isMethodCompiled(METHOD), getName()
|
||||
+ "Method unexpectedly not compiled");
|
||||
Asserts.assertTrue(WB.getMethodCompilationLevel(METHOD) == 4, getName()
|
||||
+ "Method not compiled at level 4");
|
||||
testFrame("someString", COMPILE_THRESHOLD);
|
||||
}
|
||||
|
||||
private void testFrame(String str, int iteration) {
|
||||
Helper helper = new Helper(str);
|
||||
check(iteration);
|
||||
recurse(2, iteration);
|
||||
Asserts.assertTrue((helper.string != null) && (this != null)
|
||||
&& (helper != null), getName() + " : some locals are null");
|
||||
&& (helper != null), String.format("%s : some locals are null", getName()));
|
||||
}
|
||||
private void recurse(int depth, int iteration) {
|
||||
if (depth == 0) {
|
||||
check(iteration);
|
||||
} else {
|
||||
Integer s = new Integer(depth);
|
||||
recurse(depth - 1, iteration);
|
||||
Asserts.assertEQ(s.intValue(), depth, String.format("different values: %s != %s", s.intValue(), depth));
|
||||
}
|
||||
}
|
||||
|
||||
private void check(int iteration) {
|
||||
|
@ -1,48 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2016, 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.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/*
|
||||
* @test TestExplicitGCInvokesConcurrentAndUnloadsClasses
|
||||
* @summary Test that the flag ExplicitGCInvokesConcurrentAndUnloadsClasses is deprecated
|
||||
* @bug 8170388
|
||||
* @key gc
|
||||
* @library /test/lib
|
||||
* @modules java.base/jdk.internal.misc
|
||||
* java.management
|
||||
* @run driver TestExplicitGCInvokesConcurrentAndUnloadsClasses
|
||||
*/
|
||||
|
||||
import jdk.test.lib.process.OutputAnalyzer;
|
||||
import jdk.test.lib.process.ProcessTools;
|
||||
|
||||
public class TestExplicitGCInvokesConcurrentAndUnloadsClasses {
|
||||
public static void main(String[] args) throws Exception {
|
||||
ProcessBuilder pb =
|
||||
ProcessTools.createJavaProcessBuilder("-XX:+ExplicitGCInvokesConcurrentAndUnloadsClasses",
|
||||
"-Xlog:gc",
|
||||
"-version");
|
||||
OutputAnalyzer output = new OutputAnalyzer(pb.start());
|
||||
output.shouldContain("ExplicitGCInvokesConcurrentAndUnloadsClasses was deprecated");
|
||||
output.shouldHaveExitValue(0);
|
||||
}
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2015, 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
|
||||
@ -66,7 +66,6 @@ public class TestSelectDefaultGC {
|
||||
assertVMOption(output, "UseSerialGC", !isServer);
|
||||
// CMS is never default
|
||||
assertVMOption(output, "UseConcMarkSweepGC", false);
|
||||
assertVMOption(output, "UseParNewGC", false);
|
||||
}
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
|
@ -1,47 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2013, 2016, 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.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/*
|
||||
* @test TestDefNewCMS
|
||||
* @key gc
|
||||
* @bug 8065972
|
||||
* @summary Test that the unsupported DefNew+CMS combination does not start
|
||||
* @library /test/lib
|
||||
* @modules java.base/jdk.internal.misc
|
||||
* java.management
|
||||
*/
|
||||
|
||||
import jdk.test.lib.process.ProcessTools;
|
||||
import jdk.test.lib.process.OutputAnalyzer;
|
||||
|
||||
public class TestDefNewCMS {
|
||||
|
||||
public static void main(String args[]) throws Exception {
|
||||
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:-UseParNewGC", "-XX:+UseConcMarkSweepGC", "-version");
|
||||
OutputAnalyzer output = new OutputAnalyzer(pb.start());
|
||||
output.shouldContain("It is not possible to combine the DefNew young collector with the CMS collector.");
|
||||
output.shouldContain("Error");
|
||||
output.shouldHaveExitValue(1);
|
||||
}
|
||||
|
||||
}
|
@ -1,48 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2013, 2016, 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.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/*
|
||||
* @test TestParNewCMS
|
||||
* @key gc
|
||||
* @bug 8065972
|
||||
* @summary Test that specifying -XX:+UseParNewGC on the command line logs a warning message
|
||||
* @library /test/lib
|
||||
* @modules java.base/jdk.internal.misc
|
||||
* java.management
|
||||
*/
|
||||
|
||||
import jdk.test.lib.process.ProcessTools;
|
||||
import jdk.test.lib.process.OutputAnalyzer;
|
||||
|
||||
|
||||
public class TestParNewCMS {
|
||||
|
||||
public static void main(String args[]) throws Exception {
|
||||
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UseParNewGC", "-XX:+UseConcMarkSweepGC", "-version");
|
||||
OutputAnalyzer output = new OutputAnalyzer(pb.start());
|
||||
output.shouldContain("warning: Option UseParNewGC was deprecated in version");
|
||||
output.shouldNotContain("error");
|
||||
output.shouldHaveExitValue(0);
|
||||
}
|
||||
|
||||
}
|
@ -1,48 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2013, 2016, 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.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/*
|
||||
* @test TestParNewSerialOld
|
||||
* @key gc
|
||||
* @bug 8065972
|
||||
* @summary Test that the unsupported ParNew+SerialOld combination does not start
|
||||
* @library /test/lib
|
||||
* @modules java.base/jdk.internal.misc
|
||||
* java.management
|
||||
*/
|
||||
|
||||
import jdk.test.lib.process.ProcessTools;
|
||||
import jdk.test.lib.process.OutputAnalyzer;
|
||||
|
||||
|
||||
public class TestParNewSerialOld {
|
||||
|
||||
public static void main(String args[]) throws Exception {
|
||||
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UseParNewGC", "-version");
|
||||
OutputAnalyzer output = new OutputAnalyzer(pb.start());
|
||||
output.shouldContain("It is not possible to combine the ParNew young collector with any collector other than CMS.");
|
||||
output.shouldContain("Error");
|
||||
output.shouldHaveExitValue(1);
|
||||
}
|
||||
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014, 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
|
||||
@ -37,18 +37,18 @@ public class ObsoleteFlagErrorMessage {
|
||||
|
||||
// Case 1: Newly obsolete flags with extra junk appended should not be treated as newly obsolete (8060449)
|
||||
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
|
||||
"-XX:UseOldInliningPlusJunk", "-version");
|
||||
"-XX:ConvertSleepToYieldPlusJunk", "-version");
|
||||
|
||||
OutputAnalyzer output = new OutputAnalyzer(pb.start());
|
||||
output.shouldContain("Unrecognized VM option 'UseOldInliningPlusJunk'"); // Must identify bad option.
|
||||
output.shouldContain("Unrecognized VM option 'ConvertSleepToYieldPlusJunk'"); // Must identify bad option.
|
||||
output.shouldHaveExitValue(1);
|
||||
|
||||
// Case 2: Newly obsolete integer-valued flags should be recognized as newly obsolete (8073989)
|
||||
// Case 2: Newly obsolete flags should be recognized as newly obsolete (8073989)
|
||||
ProcessBuilder pb2 = ProcessTools.createJavaProcessBuilder(
|
||||
"-XX:NmethodSweepFraction=10", "-version");
|
||||
"-XX:+ConvertSleepToYield", "-version");
|
||||
|
||||
OutputAnalyzer output2 = new OutputAnalyzer(pb2.start());
|
||||
output2.shouldContain("Ignoring option").shouldContain("support was removed");
|
||||
output2.shouldContain("NmethodSweepFraction");
|
||||
output2.shouldContain("ConvertSleepToYield");
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2015, 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
|
||||
@ -40,11 +40,6 @@ public class VMAliasOptions {
|
||||
*/
|
||||
public static final String[][] ALIAS_OPTIONS = {
|
||||
{"DefaultMaxRAMFraction", "MaxRAMFraction", "1032"},
|
||||
{"CMSMarkStackSizeMax", "MarkStackSizeMax", "1032"},
|
||||
{"CMSMarkStackSize", "MarkStackSize", "1032"},
|
||||
{"G1MarkStackSize", "MarkStackSize", "1032"},
|
||||
{"ParallelMarkingThreads", "ConcGCThreads", "2"},
|
||||
{"ParallelCMSThreads", "ConcGCThreads", "2"},
|
||||
{"CreateMinidumpOnCrash", "CreateCoredumpOnCrash", "false" },
|
||||
};
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2015, 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
|
||||
@ -41,17 +41,9 @@ public class VMDeprecatedOptions {
|
||||
public static final String[][] DEPRECATED_OPTIONS = {
|
||||
// deprecated non-alias flags:
|
||||
{"MaxGCMinorPauseMillis", "1032"},
|
||||
{"UseParNewGC", "false"},
|
||||
{"ConvertSleepToYield", "false" },
|
||||
{"ConvertYieldToSleep", "false" },
|
||||
|
||||
// deprecated alias flags (see also aliased_jvm_flags):
|
||||
{"DefaultMaxRAMFraction", "4"},
|
||||
{"CMSMarkStackSizeMax", "1032"},
|
||||
{"CMSMarkStackSize", "1032"},
|
||||
{"G1MarkStackSize", "1032"},
|
||||
{"ParallelMarkingThreads", "2"},
|
||||
{"ParallelCMSThreads", "2"},
|
||||
{"CreateMinidumpOnCrash", "false"}
|
||||
};
|
||||
|
||||
|
@ -30,10 +30,10 @@ import java.lang.StackWalker.StackFrame;
|
||||
|
||||
public class LocalLongHelper {
|
||||
static StackWalker sw;
|
||||
static Method intValue;
|
||||
static Method longValue;
|
||||
static Method getLocals;
|
||||
static Class<?> primitiveValueClass;
|
||||
static Method primitiveType;
|
||||
static Method primitiveSize;
|
||||
static Method getMethodType;
|
||||
static Field memberName;
|
||||
static Field offset;
|
||||
@ -43,27 +43,29 @@ public class LocalLongHelper {
|
||||
new LocalLongHelper().longArg(0xC0FFEE, 0x1234567890ABCDEFL);
|
||||
}
|
||||
|
||||
// locals[2] contains the high byte of the long argument.
|
||||
// locals[2] contains the unused slot of the long argument.
|
||||
public long longArg(int i, long l) throws Throwable {
|
||||
List<StackFrame> frames = sw.walk(s -> s.collect(Collectors.toList()));
|
||||
Object[] locals = (Object[]) getLocals.invoke(frames.get(0));
|
||||
|
||||
int locals_2 = (int) intValue.invoke(locals[2]);
|
||||
if (locals_2 != 0){
|
||||
throw new RuntimeException("Expected locals_2 == 0");
|
||||
if (8 == (int) primitiveSize.invoke(locals[2])) { // Only test 64-bit
|
||||
long locals_2 = (long) longValue.invoke(locals[2]);
|
||||
if (locals_2 != 0){
|
||||
throw new RuntimeException("Expected locals_2 == 0");
|
||||
}
|
||||
}
|
||||
return l; // Don't want l to become a dead var
|
||||
}
|
||||
|
||||
private static void setupReflectionStatics() throws Throwable {
|
||||
Class<?> liveStackFrameClass = Class.forName("java.lang.LiveStackFrame");
|
||||
primitiveValueClass = Class.forName("java.lang.LiveStackFrame$PrimitiveValue");
|
||||
primitiveValueClass = Class.forName("java.lang.LiveStackFrame$PrimitiveSlot");
|
||||
|
||||
getLocals = liveStackFrameClass.getDeclaredMethod("getLocals");
|
||||
getLocals.setAccessible(true);
|
||||
|
||||
intValue = primitiveValueClass.getDeclaredMethod("intValue");
|
||||
intValue.setAccessible(true);
|
||||
longValue = primitiveValueClass.getDeclaredMethod("longValue");
|
||||
longValue.setAccessible(true);
|
||||
|
||||
Class<?> stackFrameInfoClass = Class.forName("java.lang.StackFrameInfo");
|
||||
memberName = stackFrameInfoClass.getDeclaredField("memberName");
|
||||
@ -80,20 +82,8 @@ public class LocalLongHelper {
|
||||
f.setAccessible(true);
|
||||
Object localsAndOperandsOption = f.get(null);
|
||||
|
||||
primitiveType = primitiveValueClass.getDeclaredMethod("type");
|
||||
primitiveType.setAccessible(true);
|
||||
|
||||
primitiveSize = primitiveValueClass.getDeclaredMethod("size");
|
||||
primitiveSize.setAccessible(true);
|
||||
sw = (StackWalker) ewsNI.invoke(null, java.util.Collections.emptySet(), localsAndOperandsOption);
|
||||
}
|
||||
|
||||
private static String type(Object o) throws Throwable {
|
||||
if (primitiveValueClass.isInstance(o)) {
|
||||
final char c = (char) primitiveType.invoke(o);
|
||||
return String.valueOf(c);
|
||||
} else if (o != null) {
|
||||
return o.getClass().getName();
|
||||
} else {
|
||||
return "null";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,47 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2014, 2016, 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.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @key nmt
|
||||
* @summary Test for deprecated message if -XX:-AutoShutdownNMT is specified
|
||||
* @library /test/lib
|
||||
* @modules java.base/jdk.internal.misc
|
||||
* java.management
|
||||
*/
|
||||
|
||||
import jdk.test.lib.process.ProcessTools;
|
||||
import jdk.test.lib.process.OutputAnalyzer;
|
||||
|
||||
public class AutoshutdownNMT {
|
||||
|
||||
public static void main(String args[]) throws Exception {
|
||||
|
||||
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
|
||||
"-XX:NativeMemoryTracking=detail",
|
||||
"-XX:-AutoShutdownNMT",
|
||||
"-version");
|
||||
OutputAnalyzer output = new OutputAnalyzer(pb.start());
|
||||
output.shouldContain("Ignoring option AutoShutdownNMT");
|
||||
}
|
||||
}
|
@ -68,7 +68,7 @@ public class AccessExportTwice {
|
||||
// Packages: none
|
||||
// Packages exported: none
|
||||
ModuleDescriptor descriptor_first_mod =
|
||||
ModuleDescriptor.module("first_mod")
|
||||
ModuleDescriptor.newModule("first_mod")
|
||||
.requires("java.base")
|
||||
.requires("second_mod")
|
||||
.build();
|
||||
@ -78,7 +78,7 @@ public class AccessExportTwice {
|
||||
// Packages: p2
|
||||
// Packages exported: p2 is exported to first_mod
|
||||
ModuleDescriptor descriptor_second_mod =
|
||||
ModuleDescriptor.module("second_mod")
|
||||
ModuleDescriptor.newModule("second_mod")
|
||||
.requires("java.base")
|
||||
.exports("p2", Set.of("first_mod"))
|
||||
.build();
|
||||
@ -89,7 +89,7 @@ public class AccessExportTwice {
|
||||
// Resolves "first_mod"
|
||||
Configuration cf = Layer.boot()
|
||||
.configuration()
|
||||
.resolveRequires(finder, ModuleFinder.of(), Set.of("first_mod"));
|
||||
.resolve(finder, ModuleFinder.of(), Set.of("first_mod"));
|
||||
|
||||
// Map each module to the same class loader
|
||||
Map<String, ClassLoader> map = new HashMap<>();
|
||||
|
@ -66,9 +66,9 @@ public class AccessReadTwice {
|
||||
// Packages: p1, p4
|
||||
// Packages exported: none
|
||||
ModuleDescriptor descriptor_first_mod =
|
||||
ModuleDescriptor.module("first_mod")
|
||||
ModuleDescriptor.newModule("first_mod")
|
||||
.requires("java.base")
|
||||
.contains(Set.of("p1", "p4"))
|
||||
.packages(Set.of("p1", "p4"))
|
||||
.build();
|
||||
|
||||
// Define module: second_mod
|
||||
@ -76,7 +76,7 @@ public class AccessReadTwice {
|
||||
// Packages: p2
|
||||
// Packages exported: p2 is exported to first_mod
|
||||
ModuleDescriptor descriptor_second_mod =
|
||||
ModuleDescriptor.module("second_mod")
|
||||
ModuleDescriptor.newModule("second_mod")
|
||||
.requires("java.base")
|
||||
.exports("p2", Set.of("first_mod"))
|
||||
.build();
|
||||
@ -87,7 +87,7 @@ public class AccessReadTwice {
|
||||
// Resolves "first_mod" and "second_mod"
|
||||
Configuration cf = Layer.boot()
|
||||
.configuration()
|
||||
.resolveRequires(finder, ModuleFinder.of(), Set.of("first_mod", "second_mod"));
|
||||
.resolve(finder, ModuleFinder.of(), Set.of("first_mod", "second_mod"));
|
||||
|
||||
// Map each module to this class loader
|
||||
Map<String, ClassLoader> map = new HashMap<>();
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2016, 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
|
||||
@ -25,8 +25,8 @@
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @summary Test that if module m1 can not read module m2, then class p1.c1
|
||||
* in module m1 can not access p2.c2 in module m2.
|
||||
* @summary Test that if module m1x can not read module m2x, then class p1.c1
|
||||
* in module m1x can not access p2.c2 in module m2x.
|
||||
* @modules java.base/jdk.internal.misc
|
||||
* @library /test/lib
|
||||
* @compile myloaders/MySameClassLoader.java
|
||||
@ -47,15 +47,15 @@ import java.util.Set;
|
||||
import myloaders.MySameClassLoader;
|
||||
|
||||
//
|
||||
// ClassLoader1 --> defines m1 --> packages p1
|
||||
// defines m2 --> packages p2
|
||||
// defines m3 --> packages p3
|
||||
// ClassLoader1 --> defines m1x --> packages p1
|
||||
// defines m2x --> packages p2
|
||||
// defines m3x --> packages p3
|
||||
//
|
||||
// m1 can not read m2
|
||||
// package p2 in m2 is exported to m1
|
||||
// m1x can not read m2x
|
||||
// package p2 in m2x is exported to m1x
|
||||
//
|
||||
// class p1.c1 defined in m1 tries to access p2.c2 defined in m2.
|
||||
// Access denied since m1 can not read m2.
|
||||
// class p1.c1 defined in m1x tries to access p2.c2 defined in m2x.
|
||||
// Access denied since m1x can not read m2x.
|
||||
//
|
||||
public class CheckRead {
|
||||
|
||||
@ -64,65 +64,65 @@ public class CheckRead {
|
||||
// publicly defined classes within packages of those modules.
|
||||
public void createLayerOnBoot() throws Throwable {
|
||||
|
||||
// Define module: m1
|
||||
// Can read: java.base, m3
|
||||
// Define module: m1x
|
||||
// Can read: java.base, m3x
|
||||
// Packages: p1
|
||||
// Packages exported: p1 is exported unqualifiedly
|
||||
ModuleDescriptor descriptor_m1 =
|
||||
ModuleDescriptor.module("m1")
|
||||
ModuleDescriptor descriptor_m1x =
|
||||
ModuleDescriptor.newModule("m1x")
|
||||
.requires("java.base")
|
||||
.requires("m3")
|
||||
.requires("m3x")
|
||||
.exports("p1")
|
||||
.build();
|
||||
|
||||
// Define module: m2
|
||||
// Define module: m2x
|
||||
// Can read: java.base
|
||||
// Packages: p2
|
||||
// Packages exported: p2 is exported to m1
|
||||
ModuleDescriptor descriptor_m2 =
|
||||
ModuleDescriptor.module("m2")
|
||||
// Packages exported: p2 is exported to m1x
|
||||
ModuleDescriptor descriptor_m2x =
|
||||
ModuleDescriptor.newModule("m2x")
|
||||
.requires("java.base")
|
||||
.exports("p2", Set.of("m1"))
|
||||
.exports("p2", Set.of("m1x"))
|
||||
.build();
|
||||
|
||||
// Define module: m3
|
||||
// Can read: java.base, m2
|
||||
// Define module: m3x
|
||||
// Can read: java.base, m2x
|
||||
// Packages: p3
|
||||
// Packages exported: none
|
||||
ModuleDescriptor descriptor_m3 =
|
||||
ModuleDescriptor.module("m3")
|
||||
ModuleDescriptor descriptor_m3x =
|
||||
ModuleDescriptor.newModule("m3x")
|
||||
.requires("java.base")
|
||||
.requires("m2")
|
||||
.contains("p3")
|
||||
.requires("m2x")
|
||||
.packages(Set.of("p3"))
|
||||
.build();
|
||||
|
||||
// Set up a ModuleFinder containing all modules for this layer.
|
||||
ModuleFinder finder = ModuleLibrary.of(descriptor_m1, descriptor_m2, descriptor_m3);
|
||||
ModuleFinder finder = ModuleLibrary.of(descriptor_m1x, descriptor_m2x, descriptor_m3x);
|
||||
|
||||
// Resolves "m1"
|
||||
// Resolves "m1x"
|
||||
Configuration cf = Layer.boot()
|
||||
.configuration()
|
||||
.resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
|
||||
.resolve(finder, ModuleFinder.of(), Set.of("m1x"));
|
||||
|
||||
// map each module to differing class loaders for this test
|
||||
Map<String, ClassLoader> map = new HashMap<>();
|
||||
map.put("m1", MySameClassLoader.loader1);
|
||||
map.put("m2", MySameClassLoader.loader1);
|
||||
map.put("m3", MySameClassLoader.loader1);
|
||||
map.put("m1x", MySameClassLoader.loader1);
|
||||
map.put("m2x", MySameClassLoader.loader1);
|
||||
map.put("m3x", MySameClassLoader.loader1);
|
||||
|
||||
// Create Layer that contains m1, m2 and m3
|
||||
// Create Layer that contains m1x, m2x and m3x
|
||||
Layer layer = Layer.boot().defineModules(cf, map::get);
|
||||
|
||||
assertTrue(layer.findLoader("m1") == MySameClassLoader.loader1);
|
||||
assertTrue(layer.findLoader("m2") == MySameClassLoader.loader1);
|
||||
assertTrue(layer.findLoader("m3") == MySameClassLoader.loader1);
|
||||
assertTrue(layer.findLoader("m1x") == MySameClassLoader.loader1);
|
||||
assertTrue(layer.findLoader("m2x") == MySameClassLoader.loader1);
|
||||
assertTrue(layer.findLoader("m3x") == MySameClassLoader.loader1);
|
||||
assertTrue(layer.findLoader("java.base") == null);
|
||||
|
||||
// now use the same loader to load class p1.c1
|
||||
Class p1_c1_class = MySameClassLoader.loader1.loadClass("p1.c1");
|
||||
try {
|
||||
p1_c1_class.newInstance();
|
||||
throw new RuntimeException("Failed to get IAE (p2 in m2 is exported to m1 but m2 is not readable from m1)");
|
||||
throw new RuntimeException("Failed to get IAE (p2 in m2x is exported to m1x but m2x is not readable from m1x)");
|
||||
} catch (IllegalAccessError e) {
|
||||
System.out.println(e.getMessage());
|
||||
if (!e.getMessage().contains("cannot access")) {
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2016, 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
|
||||
@ -25,8 +25,8 @@
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @summary Test that if module m1 can not read module m2, then class p1.c1
|
||||
* in module m1 can not access p2.c2 in module m2.
|
||||
* @summary Test that if module m1x can not read module m2x, then class p1.c1
|
||||
* in module m1x can not access p2.c2 in module m2x.
|
||||
* @modules java.base/jdk.internal.misc
|
||||
* @library /test/lib
|
||||
* @compile myloaders/MyDiffClassLoader.java
|
||||
@ -47,15 +47,15 @@ import java.util.Set;
|
||||
import myloaders.MyDiffClassLoader;
|
||||
|
||||
//
|
||||
// ClassLoader1 --> defines m1 --> packages p1
|
||||
// ClassLoader2 --> defines m2 --> packages p2
|
||||
// defines m3 --> packages p3
|
||||
// ClassLoader1 --> defines m1x --> packages p1
|
||||
// ClassLoader2 --> defines m2x --> packages p2
|
||||
// defines m3x --> packages p3
|
||||
//
|
||||
// m1 can not read m2
|
||||
// package p2 in m2 is exported to m1
|
||||
// m1x can not read m2x
|
||||
// package p2 in m2x is exported to m1x
|
||||
//
|
||||
// class p1.c1 defined in m1 tries to access p2.c2 defined in m2.
|
||||
// Access denied since m1 can not read m2.
|
||||
// class p1.c1 defined in m1x tries to access p2.c2 defined in m2x.
|
||||
// Access denied since m1x can not read m2x.
|
||||
//
|
||||
public class DiffCL_CheckRead {
|
||||
|
||||
@ -64,65 +64,65 @@ public class DiffCL_CheckRead {
|
||||
// publicly defined classes within packages of those modules.
|
||||
public void createLayerOnBoot() throws Throwable {
|
||||
|
||||
// Define module: m1
|
||||
// Can read: java.base, m3
|
||||
// Define module: m1x
|
||||
// Can read: java.base, m3x
|
||||
// Packages: p1
|
||||
// Packages exported: p1 is exported unqualifiedly
|
||||
ModuleDescriptor descriptor_m1 =
|
||||
ModuleDescriptor.module("m1")
|
||||
ModuleDescriptor descriptor_m1x =
|
||||
ModuleDescriptor.newModule("m1x")
|
||||
.requires("java.base")
|
||||
.requires("m3")
|
||||
.requires("m3x")
|
||||
.exports("p1")
|
||||
.build();
|
||||
|
||||
// Define module: m2
|
||||
// Define module: m2x
|
||||
// Can read: java.base
|
||||
// Packages: p2
|
||||
// Packages exported: p2 is exported to m1
|
||||
ModuleDescriptor descriptor_m2 =
|
||||
ModuleDescriptor.module("m2")
|
||||
// Packages exported: p2 is exported to m1x
|
||||
ModuleDescriptor descriptor_m2x =
|
||||
ModuleDescriptor.newModule("m2x")
|
||||
.requires("java.base")
|
||||
.exports("p2", Set.of("m1"))
|
||||
.exports("p2", Set.of("m1x"))
|
||||
.build();
|
||||
|
||||
// Define module: m3
|
||||
// Can read: java.base, m2
|
||||
// Define module: m3x
|
||||
// Can read: java.base, m2x
|
||||
// Packages: p3
|
||||
// Packages exported: none
|
||||
ModuleDescriptor descriptor_m3 =
|
||||
ModuleDescriptor.module("m3")
|
||||
ModuleDescriptor descriptor_m3x =
|
||||
ModuleDescriptor.newModule("m3x")
|
||||
.requires("java.base")
|
||||
.requires("m2")
|
||||
.contains("p3")
|
||||
.requires("m2x")
|
||||
.packages(Set.of("p3"))
|
||||
.build();
|
||||
|
||||
// Set up a ModuleFinder containing all modules for this layer.
|
||||
ModuleFinder finder = ModuleLibrary.of(descriptor_m1, descriptor_m2, descriptor_m3);
|
||||
ModuleFinder finder = ModuleLibrary.of(descriptor_m1x, descriptor_m2x, descriptor_m3x);
|
||||
|
||||
// Resolves "m1"
|
||||
// Resolves "m1x"
|
||||
Configuration cf = Layer.boot()
|
||||
.configuration()
|
||||
.resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
|
||||
.resolve(finder, ModuleFinder.of(), Set.of("m1x"));
|
||||
|
||||
// map each module to differing class loaders for this test
|
||||
Map<String, ClassLoader> map = new HashMap<>();
|
||||
map.put("m1", MyDiffClassLoader.loader1);
|
||||
map.put("m2", MyDiffClassLoader.loader2);
|
||||
map.put("m3", MyDiffClassLoader.loader2);
|
||||
map.put("m1x", MyDiffClassLoader.loader1);
|
||||
map.put("m2x", MyDiffClassLoader.loader2);
|
||||
map.put("m3x", MyDiffClassLoader.loader2);
|
||||
|
||||
// Create Layer that contains m1, m2 and m3
|
||||
// Create Layer that contains m1x, m2x and m3x
|
||||
Layer layer = Layer.boot().defineModules(cf, map::get);
|
||||
|
||||
assertTrue(layer.findLoader("m1") == MyDiffClassLoader.loader1);
|
||||
assertTrue(layer.findLoader("m2") == MyDiffClassLoader.loader2);
|
||||
assertTrue(layer.findLoader("m3") == MyDiffClassLoader.loader2);
|
||||
assertTrue(layer.findLoader("m1x") == MyDiffClassLoader.loader1);
|
||||
assertTrue(layer.findLoader("m2x") == MyDiffClassLoader.loader2);
|
||||
assertTrue(layer.findLoader("m3x") == MyDiffClassLoader.loader2);
|
||||
assertTrue(layer.findLoader("java.base") == null);
|
||||
|
||||
// now use the same loader to load class p1.c1
|
||||
Class p1_c1_class = MyDiffClassLoader.loader1.loadClass("p1.c1");
|
||||
try {
|
||||
p1_c1_class.newInstance();
|
||||
throw new RuntimeException("Failed to get IAE (p2 in m2 is exported to m1 but m2 is not readable from m1)");
|
||||
throw new RuntimeException("Failed to get IAE (p2 in m2x is exported to m1x but m2x is not readable from m1x)");
|
||||
} catch (IllegalAccessError e) {
|
||||
System.out.println(e.getMessage());
|
||||
if (!e.getMessage().contains("cannot access")) {
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2016, 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
|
||||
@ -25,9 +25,9 @@
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @summary Test that if module m1 can read module m2, but package p2 in m2
|
||||
* is exported specifically to module m3, then class p1.c1 in m1 can not
|
||||
* access p2.c2 in m2.
|
||||
* @summary Test that if module m1x can read module m2x, but package p2 in m2x
|
||||
* is exported specifically to module m3x, then class p1.c1 in m1x can not
|
||||
* access p2.c2 in m2x.
|
||||
* @modules java.base/jdk.internal.misc
|
||||
* @library /test/lib
|
||||
* @compile myloaders/MyDiffClassLoader.java
|
||||
@ -48,15 +48,15 @@ import java.util.Set;
|
||||
import myloaders.MyDiffClassLoader;
|
||||
|
||||
//
|
||||
// ClassLoader1 --> defines m1 --> packages p1
|
||||
// ClassLoader2 --> defines m2 --> packages p2
|
||||
// defines m3 --> packages p3
|
||||
// ClassLoader1 --> defines m1x --> packages p1
|
||||
// ClassLoader2 --> defines m2x --> packages p2
|
||||
// defines m3x --> packages p3
|
||||
//
|
||||
// m1 can read m2
|
||||
// package p2 in m2 is exported to m3
|
||||
// m1x can read m2x
|
||||
// package p2 in m2x is exported to m3x
|
||||
//
|
||||
// class p1.c1 defined in m1 tries to access p2.c2 defined in m2
|
||||
// Access denied since although m1 can read m2, p2 is exported only to m3.
|
||||
// class p1.c1 defined in m1x tries to access p2.c2 defined in m2x
|
||||
// Access denied since although m1x can read m2x, p2 is exported only to m3x.
|
||||
//
|
||||
public class DiffCL_ExpQualOther {
|
||||
|
||||
@ -65,66 +65,66 @@ public class DiffCL_ExpQualOther {
|
||||
// publically defined classes within packages of those modules.
|
||||
public void createLayerOnBoot() throws Throwable {
|
||||
|
||||
// Define module: m1
|
||||
// Can read: java.base, m2, m3
|
||||
// Define module: m1x
|
||||
// Can read: java.base, m2x, m3x
|
||||
// Packages: p1
|
||||
// Packages exported: p1 is exported unqualifiedly
|
||||
ModuleDescriptor descriptor_m1 =
|
||||
ModuleDescriptor.module("m1")
|
||||
ModuleDescriptor descriptor_m1x =
|
||||
ModuleDescriptor.newModule("m1x")
|
||||
.requires("java.base")
|
||||
.requires("m2")
|
||||
.requires("m3")
|
||||
.requires("m2x")
|
||||
.requires("m3x")
|
||||
.exports("p1")
|
||||
.build();
|
||||
|
||||
// Define module: m2
|
||||
// Can read: java.base, m3
|
||||
// Define module: m2x
|
||||
// Can read: java.base, m3x
|
||||
// Packages: p2
|
||||
// Packages exported: p2 is exported to m3
|
||||
ModuleDescriptor descriptor_m2 =
|
||||
ModuleDescriptor.module("m2")
|
||||
// Packages exported: p2 is exported to m3x
|
||||
ModuleDescriptor descriptor_m2x =
|
||||
ModuleDescriptor.newModule("m2x")
|
||||
.requires("java.base")
|
||||
.exports("p2", Set.of("m3"))
|
||||
.exports("p2", Set.of("m3x"))
|
||||
.build();
|
||||
|
||||
// Define module: m3
|
||||
// Can read: java.base, m2
|
||||
// Define module: m3x
|
||||
// Can read: java.base, m2x
|
||||
// Packages: p3
|
||||
// Packages exported: none
|
||||
ModuleDescriptor descriptor_m3 =
|
||||
ModuleDescriptor.module("m3")
|
||||
ModuleDescriptor descriptor_m3x =
|
||||
ModuleDescriptor.newModule("m3x")
|
||||
.requires("java.base")
|
||||
.requires("m2")
|
||||
.contains("p3")
|
||||
.requires("m2x")
|
||||
.packages(Set.of("p3"))
|
||||
.build();
|
||||
|
||||
// Set up a ModuleFinder containing all modules for this layer.
|
||||
ModuleFinder finder = ModuleLibrary.of(descriptor_m1, descriptor_m2, descriptor_m3);
|
||||
ModuleFinder finder = ModuleLibrary.of(descriptor_m1x, descriptor_m2x, descriptor_m3x);
|
||||
|
||||
// Resolves "m1"
|
||||
// Resolves "m1x"
|
||||
Configuration cf = Layer.boot()
|
||||
.configuration()
|
||||
.resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
|
||||
.resolve(finder, ModuleFinder.of(), Set.of("m1x"));
|
||||
|
||||
// map each module to differing class loaders for this test
|
||||
Map<String, ClassLoader> map = new HashMap<>();
|
||||
map.put("m1", MyDiffClassLoader.loader1);
|
||||
map.put("m2", MyDiffClassLoader.loader2);
|
||||
map.put("m3", MyDiffClassLoader.loader2);
|
||||
map.put("m1x", MyDiffClassLoader.loader1);
|
||||
map.put("m2x", MyDiffClassLoader.loader2);
|
||||
map.put("m3x", MyDiffClassLoader.loader2);
|
||||
|
||||
// Create Layer that contains m1 & m2
|
||||
// Create Layer that contains m1x & m2x
|
||||
Layer layer = Layer.boot().defineModules(cf, map::get);
|
||||
|
||||
assertTrue(layer.findLoader("m1") == MyDiffClassLoader.loader1);
|
||||
assertTrue(layer.findLoader("m2") == MyDiffClassLoader.loader2);
|
||||
assertTrue(layer.findLoader("m3") == MyDiffClassLoader.loader2);
|
||||
assertTrue(layer.findLoader("m1x") == MyDiffClassLoader.loader1);
|
||||
assertTrue(layer.findLoader("m2x") == MyDiffClassLoader.loader2);
|
||||
assertTrue(layer.findLoader("m3x") == MyDiffClassLoader.loader2);
|
||||
assertTrue(layer.findLoader("java.base") == null);
|
||||
|
||||
// now use the same loader to load class p1.c1
|
||||
Class p1_c1_class = MyDiffClassLoader.loader1.loadClass("p1.c1");
|
||||
try {
|
||||
p1_c1_class.newInstance();
|
||||
throw new RuntimeException("Failed to get IAE (p2 in m2 is exported to m3 not to m1)");
|
||||
throw new RuntimeException("Failed to get IAE (p2 in m2x is exported to m3x not to m1x)");
|
||||
} catch (IllegalAccessError e) {
|
||||
System.out.println(e.getMessage());
|
||||
if (!e.getMessage().contains("does not export")) {
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2016, 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
|
||||
@ -25,8 +25,8 @@
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @summary class p1.c1 defined in m1 tries to access p2.c2 defined in m2.
|
||||
* Access allowed since m1 can read m2 and package p2 is exported to m1.
|
||||
* @summary class p1.c1 defined in m1x tries to access p2.c2 defined in m2x.
|
||||
* Access allowed since m1x can read m2x and package p2 is exported to m1x.
|
||||
* @modules java.base/jdk.internal.misc
|
||||
* @library /test/lib
|
||||
* @compile myloaders/MyDiffClassLoader.java
|
||||
@ -47,14 +47,14 @@ import java.util.Set;
|
||||
import myloaders.MyDiffClassLoader;
|
||||
|
||||
//
|
||||
// ClassLoader1 --> defines m1 --> packages p1
|
||||
// ClassLoader2 --> defines m2 --> packages p2
|
||||
// ClassLoader1 --> defines m1x --> packages p1
|
||||
// ClassLoader2 --> defines m2x --> packages p2
|
||||
//
|
||||
// m1 can read m2
|
||||
// package p2 in m2 is exported to m1
|
||||
// m1x can read m2x
|
||||
// package p2 in m2x is exported to m1x
|
||||
//
|
||||
// class p1.c1 defined in m1 tries to access p2.c2 defined in m2
|
||||
// Access allowed since m1 can read m2 and package p2 is exported to m1.
|
||||
// class p1.c1 defined in m1x tries to access p2.c2 defined in m2x
|
||||
// Access allowed since m1x can read m2x and package p2 is exported to m1x.
|
||||
//
|
||||
public class DiffCL_ExpQualToM1 {
|
||||
|
||||
@ -63,45 +63,45 @@ public class DiffCL_ExpQualToM1 {
|
||||
// publically defined classes within packages of those modules.
|
||||
public void createLayerOnBoot() throws Throwable {
|
||||
|
||||
// Define module: m1
|
||||
// Can read: java.base, m2
|
||||
// Define module: m1x
|
||||
// Can read: java.base, m2x
|
||||
// Packages: p1
|
||||
// Packages exported: p1 is exported to unqualifiedly
|
||||
ModuleDescriptor descriptor_m1 =
|
||||
ModuleDescriptor.module("m1")
|
||||
ModuleDescriptor descriptor_m1x =
|
||||
ModuleDescriptor.newModule("m1x")
|
||||
.requires("java.base")
|
||||
.requires("m2")
|
||||
.requires("m2x")
|
||||
.exports("p1")
|
||||
.build();
|
||||
|
||||
// Define module: m2
|
||||
// Define module: m2x
|
||||
// Can read: java.base
|
||||
// Packages: p2
|
||||
// Packages exported: package p2 is exported to m1
|
||||
ModuleDescriptor descriptor_m2 =
|
||||
ModuleDescriptor.module("m2")
|
||||
// Packages exported: package p2 is exported to m1x
|
||||
ModuleDescriptor descriptor_m2x =
|
||||
ModuleDescriptor.newModule("m2x")
|
||||
.requires("java.base")
|
||||
.exports("p2", Set.of("m1"))
|
||||
.exports("p2", Set.of("m1x"))
|
||||
.build();
|
||||
|
||||
// Set up a ModuleFinder containing all modules for this layer.
|
||||
ModuleFinder finder = ModuleLibrary.of(descriptor_m1, descriptor_m2);
|
||||
ModuleFinder finder = ModuleLibrary.of(descriptor_m1x, descriptor_m2x);
|
||||
|
||||
// Resolves "m1"
|
||||
// Resolves "m1x"
|
||||
Configuration cf = Layer.boot()
|
||||
.configuration()
|
||||
.resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
|
||||
.resolve(finder, ModuleFinder.of(), Set.of("m1x"));
|
||||
|
||||
// map each module to differing class loaders for this test
|
||||
Map<String, ClassLoader> map = new HashMap<>();
|
||||
map.put("m1", MyDiffClassLoader.loader1);
|
||||
map.put("m2", MyDiffClassLoader.loader2);
|
||||
map.put("m1x", MyDiffClassLoader.loader1);
|
||||
map.put("m2x", MyDiffClassLoader.loader2);
|
||||
|
||||
// Create Layer that contains m1 & m2
|
||||
// Create Layer that contains m1x & m2x
|
||||
Layer layer = Layer.boot().defineModules(cf, map::get);
|
||||
|
||||
assertTrue(layer.findLoader("m1") == MyDiffClassLoader.loader1);
|
||||
assertTrue(layer.findLoader("m2") == MyDiffClassLoader.loader2);
|
||||
assertTrue(layer.findLoader("m1x") == MyDiffClassLoader.loader1);
|
||||
assertTrue(layer.findLoader("m2x") == MyDiffClassLoader.loader2);
|
||||
assertTrue(layer.findLoader("java.base") == null);
|
||||
|
||||
// now use the same loader to load class p1.c1
|
||||
@ -109,7 +109,7 @@ public class DiffCL_ExpQualToM1 {
|
||||
try {
|
||||
p1_c1_class.newInstance();
|
||||
} catch (IllegalAccessError e) {
|
||||
throw new RuntimeException("Test Failed, an IAE should not be thrown since p2 is exported qualifiedly to m1");
|
||||
throw new RuntimeException("Test Failed, an IAE should not be thrown since p2 is exported qualifiedly to m1x");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2016, 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
|
||||
@ -25,8 +25,8 @@
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @summary Test that if module m1 can read module m2, and package p2 in m2 is
|
||||
* exported unqualifiedly, then class p1.c1 in m1 can read p2.c2 in m2.
|
||||
* @summary Test that if module m1x can read module m2x, and package p2 in m2x is
|
||||
* exported unqualifiedly, then class p1.c1 in m1x can read p2.c2 in m2x.
|
||||
* @modules java.base/jdk.internal.misc
|
||||
* @library /test/lib
|
||||
* @compile myloaders/MyDiffClassLoader.java
|
||||
@ -47,14 +47,14 @@ import java.util.Set;
|
||||
import myloaders.MyDiffClassLoader;
|
||||
|
||||
//
|
||||
// ClassLoader1 --> defines m1 --> packages p1
|
||||
// ClassLoader2 --> defines m2 --> packages p2
|
||||
// ClassLoader1 --> defines m1x --> packages p1
|
||||
// ClassLoader2 --> defines m2x --> packages p2
|
||||
//
|
||||
// m1 can read m2
|
||||
// package p2 in m2 is exported to m1
|
||||
// m1x can read m2x
|
||||
// package p2 in m2x is exported to m1x
|
||||
//
|
||||
// class p1.c1 defined in m1 tries to access p2.c2 defined in m2
|
||||
// Access allowed since m1 can read m2 and package p2 is exported
|
||||
// class p1.c1 defined in m1x tries to access p2.c2 defined in m2x
|
||||
// Access allowed since m1x can read m2x and package p2 is exported
|
||||
// unqualifiedly.
|
||||
//
|
||||
public class DiffCL_ExpUnqual {
|
||||
@ -64,45 +64,45 @@ public class DiffCL_ExpUnqual {
|
||||
// publically defined classes within packages of those modules.
|
||||
public void createLayerOnBoot() throws Throwable {
|
||||
|
||||
// Define module: m1
|
||||
// Can read: java.base, m2
|
||||
// Define module: m1x
|
||||
// Can read: java.base, m2x
|
||||
// Packages: p1
|
||||
// Packages exported: p1 is exported unqualifiedly
|
||||
ModuleDescriptor descriptor_m1 =
|
||||
ModuleDescriptor.module("m1")
|
||||
ModuleDescriptor descriptor_m1x =
|
||||
ModuleDescriptor.newModule("m1x")
|
||||
.requires("java.base")
|
||||
.requires("m2")
|
||||
.requires("m2x")
|
||||
.exports("p1")
|
||||
.build();
|
||||
|
||||
// Define module: m2
|
||||
// Define module: m2x
|
||||
// Can read: java.base
|
||||
// Packages: p2
|
||||
// Packages exported: package p2 is exported to m1
|
||||
ModuleDescriptor descriptor_m2 =
|
||||
ModuleDescriptor.module("m2")
|
||||
// Packages exported: package p2 is exported to m1x
|
||||
ModuleDescriptor descriptor_m2x =
|
||||
ModuleDescriptor.newModule("m2x")
|
||||
.requires("java.base")
|
||||
.exports("p2")
|
||||
.build();
|
||||
|
||||
// Set up a ModuleFinder containing all modules for this layer.
|
||||
ModuleFinder finder = ModuleLibrary.of(descriptor_m1, descriptor_m2);
|
||||
ModuleFinder finder = ModuleLibrary.of(descriptor_m1x, descriptor_m2x);
|
||||
|
||||
// Resolves "m1"
|
||||
// Resolves "m1x"
|
||||
Configuration cf = Layer.boot()
|
||||
.configuration()
|
||||
.resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
|
||||
.resolve(finder, ModuleFinder.of(), Set.of("m1x"));
|
||||
|
||||
// map each module to differing class loaders for this test
|
||||
Map<String, ClassLoader> map = new HashMap<>();
|
||||
map.put("m1", MyDiffClassLoader.loader1);
|
||||
map.put("m2", MyDiffClassLoader.loader2);
|
||||
map.put("m1x", MyDiffClassLoader.loader1);
|
||||
map.put("m2x", MyDiffClassLoader.loader2);
|
||||
|
||||
// Create Layer that contains m1 & m2
|
||||
// Create Layer that contains m1x & m2x
|
||||
Layer layer = Layer.boot().defineModules(cf, map::get);
|
||||
|
||||
assertTrue(layer.findLoader("m1") == MyDiffClassLoader.loader1);
|
||||
assertTrue(layer.findLoader("m2") == MyDiffClassLoader.loader2);
|
||||
assertTrue(layer.findLoader("m1x") == MyDiffClassLoader.loader1);
|
||||
assertTrue(layer.findLoader("m2x") == MyDiffClassLoader.loader2);
|
||||
assertTrue(layer.findLoader("java.base") == null);
|
||||
|
||||
// now use the same loader to load class p1.c1
|
||||
@ -110,7 +110,7 @@ public class DiffCL_ExpUnqual {
|
||||
try {
|
||||
p1_c1_class.newInstance();
|
||||
} catch (IllegalAccessError e) {
|
||||
throw new RuntimeException("Test Failed, an IAE should not be thrown since p2 is exported qualifiedly to m1");
|
||||
throw new RuntimeException("Test Failed, an IAE should not be thrown since p2 is exported qualifiedly to m1x");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2016, 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
|
||||
@ -25,8 +25,8 @@
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @summary Test that if module m1 can read module m2, but package p2 in m2 is not
|
||||
* exported, then class p1.c1 in m1 can not read p2.c2 in m2.
|
||||
* @summary Test that if module m1x can read module m2x, but package p2 in m2x is not
|
||||
* exported, then class p1.c1 in m1x can not read p2.c2 in m2x.
|
||||
* @modules java.base/jdk.internal.misc
|
||||
* @library /test/lib
|
||||
* @compile myloaders/MyDiffClassLoader.java
|
||||
@ -47,13 +47,13 @@ import java.util.Set;
|
||||
import myloaders.MyDiffClassLoader;
|
||||
|
||||
//
|
||||
// ClassLoader1 --> defines m1 --> packages p1
|
||||
// ClassLoader2 --> defines m2 --> packages p2
|
||||
// ClassLoader1 --> defines m1x --> packages p1
|
||||
// ClassLoader2 --> defines m2x --> packages p2
|
||||
//
|
||||
// m1 can read m2
|
||||
// package p2 in m2 is not exported
|
||||
// m1x can read m2x
|
||||
// package p2 in m2x is not exported
|
||||
//
|
||||
// class p1.c1 defined in m1 tries to access p2.c2 defined in m2
|
||||
// class p1.c1 defined in m1x tries to access p2.c2 defined in m2x
|
||||
// Access denied since p2 is not exported.
|
||||
//
|
||||
public class DiffCL_PkgNotExp {
|
||||
@ -63,52 +63,52 @@ public class DiffCL_PkgNotExp {
|
||||
// publically defined classes within packages of those modules.
|
||||
public void createLayerOnBoot() throws Throwable {
|
||||
|
||||
// Define module: m1
|
||||
// Can read: java.base, m2
|
||||
// Define module: m1x
|
||||
// Can read: java.base, m2x
|
||||
// Packages: p1
|
||||
// Packages exported: p1 is exported unqualifiedly
|
||||
ModuleDescriptor descriptor_m1 =
|
||||
ModuleDescriptor.module("m1")
|
||||
ModuleDescriptor descriptor_m1x =
|
||||
ModuleDescriptor.newModule("m1x")
|
||||
.requires("java.base")
|
||||
.requires("m2")
|
||||
.requires("m2x")
|
||||
.exports("p1")
|
||||
.build();
|
||||
|
||||
// Define module: m2
|
||||
// Define module: m2x
|
||||
// Can read: java.base
|
||||
// Packages: p2
|
||||
// Packages exported: none
|
||||
ModuleDescriptor descriptor_m2 =
|
||||
ModuleDescriptor.module("m2")
|
||||
ModuleDescriptor descriptor_m2x =
|
||||
ModuleDescriptor.newModule("m2x")
|
||||
.requires("java.base")
|
||||
.contains("p2")
|
||||
.packages(Set.of("p2"))
|
||||
.build();
|
||||
|
||||
// Set up a ModuleFinder containing all modules for this layer.
|
||||
ModuleFinder finder = ModuleLibrary.of(descriptor_m1, descriptor_m2);
|
||||
ModuleFinder finder = ModuleLibrary.of(descriptor_m1x, descriptor_m2x);
|
||||
|
||||
// Resolves "m1"
|
||||
// Resolves "m1x"
|
||||
Configuration cf = Layer.boot()
|
||||
.configuration()
|
||||
.resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
|
||||
.resolve(finder, ModuleFinder.of(), Set.of("m1x"));
|
||||
|
||||
// map each module to differing class loaders for this test
|
||||
Map<String, ClassLoader> map = new HashMap<>();
|
||||
map.put("m1", MyDiffClassLoader.loader1);
|
||||
map.put("m2", MyDiffClassLoader.loader2);
|
||||
map.put("m1x", MyDiffClassLoader.loader1);
|
||||
map.put("m2x", MyDiffClassLoader.loader2);
|
||||
|
||||
// Create Layer that contains m1 & m2
|
||||
// Create Layer that contains m1x & m2x
|
||||
Layer layer = Layer.boot().defineModules(cf, map::get);
|
||||
|
||||
assertTrue(layer.findLoader("m1") == MyDiffClassLoader.loader1);
|
||||
assertTrue(layer.findLoader("m2") == MyDiffClassLoader.loader2);
|
||||
assertTrue(layer.findLoader("m1x") == MyDiffClassLoader.loader1);
|
||||
assertTrue(layer.findLoader("m2x") == MyDiffClassLoader.loader2);
|
||||
assertTrue(layer.findLoader("java.base") == null);
|
||||
|
||||
// now use the same loader to load class p1.c1
|
||||
Class p1_c1_class = MyDiffClassLoader.loader1.loadClass("p1.c1");
|
||||
try {
|
||||
p1_c1_class.newInstance();
|
||||
throw new RuntimeException("Failed to get IAE (p2 in m2 is not exported)");
|
||||
throw new RuntimeException("Failed to get IAE (p2 in m2x is not exported)");
|
||||
} catch (IllegalAccessError e) {
|
||||
System.out.println(e.getMessage());
|
||||
if (!e.getMessage().contains("does not export")) {
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2016, 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
|
||||
@ -25,7 +25,7 @@
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @summary class p1.c1 defined in m1 tries to access p2.c2 defined in unnamed module.
|
||||
* @summary class p1.c1 defined in m1x tries to access p2.c2 defined in unnamed module.
|
||||
* @library /test/lib
|
||||
* @modules java.base/jdk.internal.misc
|
||||
* @modules java.base/jdk.internal.module
|
||||
@ -50,10 +50,10 @@ import java.util.Set;
|
||||
import myloaders.MyDiffClassLoader;
|
||||
|
||||
//
|
||||
// ClassLoader1 --> defines m1 --> packages p1
|
||||
// package p1 in m1 is exported unqualifiedly
|
||||
// ClassLoader1 --> defines m1x --> packages p1
|
||||
// package p1 in m1x is exported unqualifiedly
|
||||
//
|
||||
// class p1.c1 defined in m1 tries to access p2.c2 defined in
|
||||
// class p1.c1 defined in m1x tries to access p2.c2 defined in
|
||||
// in unnamed module.
|
||||
//
|
||||
// Three access attempts occur in this test:
|
||||
@ -62,7 +62,7 @@ import myloaders.MyDiffClassLoader;
|
||||
// 2. In this scenario a strict module establishes readability
|
||||
// to the particular unnamed module it is trying to access.
|
||||
// Access is allowed.
|
||||
// 3. Module m1 in the test_looseModuleLayer() method
|
||||
// 3. Module m1x in the test_looseModuleLayer() method
|
||||
// is transitioned to a loose module, access
|
||||
// to all unnamed modules is allowed.
|
||||
//
|
||||
@ -71,41 +71,41 @@ public class DiffCL_Umod {
|
||||
// Create Layers over the boot layer to test different
|
||||
// accessing scenarios of a named module to an unnamed module.
|
||||
|
||||
// Module m1 is a strict module and has not established
|
||||
// Module m1x is a strict module and has not established
|
||||
// readability to an unnamed module that p2.c2 is defined in.
|
||||
public void test_strictModuleLayer() throws Throwable {
|
||||
|
||||
// Define module: m1
|
||||
// Define module: m1x
|
||||
// Can read: java.base
|
||||
// Packages: p1
|
||||
// Packages exported: p1 is exported unqualifiedly
|
||||
ModuleDescriptor descriptor_m1 =
|
||||
ModuleDescriptor.module("m1")
|
||||
ModuleDescriptor descriptor_m1x =
|
||||
ModuleDescriptor.newModule("m1x")
|
||||
.requires("java.base")
|
||||
.exports("p1")
|
||||
.build();
|
||||
|
||||
// Set up a ModuleFinder containing all modules for this layer.
|
||||
ModuleFinder finder = ModuleLibrary.of(descriptor_m1);
|
||||
ModuleFinder finder = ModuleLibrary.of(descriptor_m1x);
|
||||
|
||||
// Resolves "m1"
|
||||
// Resolves "m1x"
|
||||
Configuration cf = Layer.boot()
|
||||
.configuration()
|
||||
.resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
|
||||
.resolve(finder, ModuleFinder.of(), Set.of("m1x"));
|
||||
|
||||
MyDiffClassLoader.loader1 = new MyDiffClassLoader();
|
||||
MyDiffClassLoader.loader2 = new MyDiffClassLoader();
|
||||
|
||||
// map module m1 to class loader.
|
||||
// map module m1x to class loader.
|
||||
// class c2 will be loaded in an unnamed module/loader2
|
||||
// to achieve differing class loaders.
|
||||
Map<String, ClassLoader> map = new HashMap<>();
|
||||
map.put("m1", MyDiffClassLoader.loader1);
|
||||
map.put("m1x", MyDiffClassLoader.loader1);
|
||||
|
||||
// Create Layer that contains m1
|
||||
// Create Layer that contains m1x
|
||||
Layer layer = Layer.boot().defineModules(cf, map::get);
|
||||
|
||||
assertTrue(layer.findLoader("m1") == MyDiffClassLoader.loader1);
|
||||
assertTrue(layer.findLoader("m1x") == MyDiffClassLoader.loader1);
|
||||
assertTrue(layer.findLoader("java.base") == null);
|
||||
|
||||
// now use the same loader to load class p1.c1
|
||||
@ -114,109 +114,109 @@ public class DiffCL_Umod {
|
||||
// Attempt access
|
||||
try {
|
||||
p1_c1_class.newInstance();
|
||||
throw new RuntimeException("Test Failed, strict module m1 should not be able " +
|
||||
throw new RuntimeException("Test Failed, strict module m1x should not be able " +
|
||||
"to access public type p2.c2 defined in unnamed module");
|
||||
} catch (IllegalAccessError e) {
|
||||
}
|
||||
}
|
||||
|
||||
// Module m1 is a strict module and has established
|
||||
// Module m1x is a strict module and has established
|
||||
// readability to an unnamed module that p2.c2 is defined in.
|
||||
public void test_strictModuleUnnamedReadableLayer() throws Throwable {
|
||||
|
||||
// Define module: m1
|
||||
// Define module: m1x
|
||||
// Can read: java.base
|
||||
// Packages: p1
|
||||
// Packages exported: p1 is exported unqualifiedly
|
||||
ModuleDescriptor descriptor_m1 =
|
||||
ModuleDescriptor.module("m1")
|
||||
ModuleDescriptor descriptor_m1x =
|
||||
ModuleDescriptor.newModule("m1x")
|
||||
.requires("java.base")
|
||||
.exports("p1")
|
||||
.build();
|
||||
|
||||
// Set up a ModuleFinder containing all modules for this layer.
|
||||
ModuleFinder finder = ModuleLibrary.of(descriptor_m1);
|
||||
ModuleFinder finder = ModuleLibrary.of(descriptor_m1x);
|
||||
|
||||
// Resolves "m1"
|
||||
// Resolves "m1x"
|
||||
Configuration cf = Layer.boot()
|
||||
.configuration()
|
||||
.resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
|
||||
.resolve(finder, ModuleFinder.of(), Set.of("m1x"));
|
||||
|
||||
MyDiffClassLoader.loader1 = new MyDiffClassLoader();
|
||||
MyDiffClassLoader.loader2 = new MyDiffClassLoader();
|
||||
|
||||
// map module m1 to class loader.
|
||||
// map module m1x to class loader.
|
||||
// class c2 will be loaded in an unnamed module/loader2
|
||||
// to achieve differing class loaders.
|
||||
Map<String, ClassLoader> map = new HashMap<>();
|
||||
map.put("m1", MyDiffClassLoader.loader1);
|
||||
map.put("m1x", MyDiffClassLoader.loader1);
|
||||
|
||||
// Create Layer that contains m1
|
||||
// Create Layer that contains m1x
|
||||
Layer layer = Layer.boot().defineModules(cf, map::get);
|
||||
|
||||
assertTrue(layer.findLoader("m1") == MyDiffClassLoader.loader1);
|
||||
assertTrue(layer.findLoader("m1x") == MyDiffClassLoader.loader1);
|
||||
assertTrue(layer.findLoader("java.base") == null);
|
||||
|
||||
// now use the same loader to load class p1.c1ReadEdgeDiffLoader
|
||||
Class p1_c1_class = MyDiffClassLoader.loader1.loadClass("p1.c1ReadEdgeDiffLoader");
|
||||
|
||||
try {
|
||||
// Read edge between m1 and the unnamed module that loads p2.c2 is established in
|
||||
// Read edge between m1x and the unnamed module that loads p2.c2 is established in
|
||||
// c1ReadEdgeDiffLoader's ctor before attempting access.
|
||||
p1_c1_class.newInstance();
|
||||
} catch (IllegalAccessError e) {
|
||||
throw new RuntimeException("Test Failed, module m1 has established readability to p2/c2 loader's " +
|
||||
throw new RuntimeException("Test Failed, module m1x has established readability to p2/c2 loader's " +
|
||||
"unnamed module, access should be allowed: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
// Module m1 is a loose module and thus can read all unnamed modules.
|
||||
// Module m1x is a loose module and thus can read all unnamed modules.
|
||||
public void test_looseModuleLayer() throws Throwable {
|
||||
|
||||
// Define module: m1
|
||||
// Define module: m1x
|
||||
// Can read: java.base
|
||||
// Packages: p1
|
||||
// Packages exported: p1 is exported unqualifiedly
|
||||
ModuleDescriptor descriptor_m1 =
|
||||
ModuleDescriptor.module("m1")
|
||||
ModuleDescriptor descriptor_m1x =
|
||||
ModuleDescriptor.newModule("m1x")
|
||||
.requires("java.base")
|
||||
.exports("p1")
|
||||
.build();
|
||||
|
||||
// Set up a ModuleFinder containing all modules for this layer.
|
||||
ModuleFinder finder = ModuleLibrary.of(descriptor_m1);
|
||||
ModuleFinder finder = ModuleLibrary.of(descriptor_m1x);
|
||||
|
||||
// Resolves "m1"
|
||||
// Resolves "m1x"
|
||||
Configuration cf = Layer.boot()
|
||||
.configuration()
|
||||
.resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
|
||||
.resolve(finder, ModuleFinder.of(), Set.of("m1x"));
|
||||
|
||||
MyDiffClassLoader.loader1 = new MyDiffClassLoader();
|
||||
MyDiffClassLoader.loader2 = new MyDiffClassLoader();
|
||||
|
||||
// map module m1 to class loader.
|
||||
// map module m1x to class loader.
|
||||
// class c2 will be loaded in an unnamed module/loader2
|
||||
// to achieve differing class loaders.
|
||||
Map<String, ClassLoader> map = new HashMap<>();
|
||||
map.put("m1", MyDiffClassLoader.loader1);
|
||||
map.put("m1x", MyDiffClassLoader.loader1);
|
||||
|
||||
// Create Layer that contains m1
|
||||
// Create Layer that contains m1x
|
||||
Layer layer = Layer.boot().defineModules(cf, map::get);
|
||||
|
||||
assertTrue(layer.findLoader("m1") == MyDiffClassLoader.loader1);
|
||||
assertTrue(layer.findLoader("m1x") == MyDiffClassLoader.loader1);
|
||||
assertTrue(layer.findLoader("java.base") == null);
|
||||
|
||||
// now use the same loader to load class p1.c1Loose
|
||||
Class p1_c1_class = MyDiffClassLoader.loader1.loadClass("p1.c1Loose");
|
||||
|
||||
// change m1 to read all unnamed modules
|
||||
Module m1 = layer.findModule("m1").get();
|
||||
jdk.internal.module.Modules.addReadsAllUnnamed(m1);
|
||||
// change m1x to read all unnamed modules
|
||||
Module m1x = layer.findModule("m1x").get();
|
||||
jdk.internal.module.Modules.addReadsAllUnnamed(m1x);
|
||||
|
||||
try {
|
||||
p1_c1_class.newInstance();
|
||||
} catch (IllegalAccessError e) {
|
||||
throw new RuntimeException("Test Failed, loose module m1 should be able to access " +
|
||||
throw new RuntimeException("Test Failed, loose module m1x should be able to access " +
|
||||
"public type p2.c2 defined in unnamed module: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2016, 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
|
||||
@ -25,7 +25,7 @@
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @summary class p3.c3 defined in module m1 tries to access c4 defined in an unnamed package
|
||||
* @summary class p3.c3 defined in module m1x tries to access c4 defined in an unnamed package
|
||||
* and an unnamed module.
|
||||
* @modules java.base/jdk.internal.misc
|
||||
* @library /test/lib
|
||||
@ -48,10 +48,10 @@ import java.util.Set;
|
||||
import myloaders.MyDiffClassLoader;
|
||||
|
||||
//
|
||||
// ClassLoader1 --> defines m1 --> packages p3
|
||||
// package p3 in m1 is exported unqualifiedly
|
||||
// ClassLoader1 --> defines m1x --> packages p3
|
||||
// package p3 in m1x is exported unqualifiedly
|
||||
//
|
||||
// class p3.c3 defined in m1 tries to access c4 defined in
|
||||
// class p3.c3 defined in m1x tries to access c4 defined in
|
||||
// in unnamed module.
|
||||
//
|
||||
// Two access attempts occur in this test:
|
||||
@ -66,41 +66,41 @@ public class DiffCL_UmodUpkg {
|
||||
// Create Layers over the boot layer to test different
|
||||
// accessing scenarios of a named module to an unnamed module.
|
||||
|
||||
// Module m1 is a strict module and has not established
|
||||
// Module m1x is a strict module and has not established
|
||||
// readability to an unnamed module that c4 is defined in.
|
||||
public void test_strictModuleLayer() throws Throwable {
|
||||
|
||||
// Define module: m1
|
||||
// Define module: m1x
|
||||
// Can read: java.base
|
||||
// Packages: p3
|
||||
// Packages exported: p3 is exported unqualifiedly
|
||||
ModuleDescriptor descriptor_m1 =
|
||||
ModuleDescriptor.module("m1")
|
||||
ModuleDescriptor descriptor_m1x =
|
||||
ModuleDescriptor.newModule("m1x")
|
||||
.requires("java.base")
|
||||
.exports("p3")
|
||||
.build();
|
||||
|
||||
// Set up a ModuleFinder containing all modules for this layer.
|
||||
ModuleFinder finder = ModuleLibrary.of(descriptor_m1);
|
||||
ModuleFinder finder = ModuleLibrary.of(descriptor_m1x);
|
||||
|
||||
// Resolves "m1"
|
||||
// Resolves "m1x"
|
||||
Configuration cf = Layer.boot()
|
||||
.configuration()
|
||||
.resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
|
||||
.resolve(finder, ModuleFinder.of(), Set.of("m1x"));
|
||||
|
||||
MyDiffClassLoader.loader1 = new MyDiffClassLoader();
|
||||
MyDiffClassLoader.loader2 = new MyDiffClassLoader();
|
||||
|
||||
// map module m1 to class loader.
|
||||
// map module m1x to class loader.
|
||||
// class c2 will be loaded in an unnamed module/loader2
|
||||
// to achieve differing class loaders.
|
||||
Map<String, ClassLoader> map = new HashMap<>();
|
||||
map.put("m1", MyDiffClassLoader.loader1);
|
||||
map.put("m1x", MyDiffClassLoader.loader1);
|
||||
|
||||
// Create Layer that contains m1
|
||||
// Create Layer that contains m1x
|
||||
Layer layer = Layer.boot().defineModules(cf, map::get);
|
||||
|
||||
assertTrue(layer.findLoader("m1") == MyDiffClassLoader.loader1);
|
||||
assertTrue(layer.findLoader("m1x") == MyDiffClassLoader.loader1);
|
||||
assertTrue(layer.findLoader("java.base") == null);
|
||||
|
||||
// now use the same loader to load class p3.c3
|
||||
@ -109,58 +109,58 @@ public class DiffCL_UmodUpkg {
|
||||
// Attempt access
|
||||
try {
|
||||
p3_c3_class.newInstance();
|
||||
throw new RuntimeException("Test Failed, strict module m1 should not be able to access " +
|
||||
throw new RuntimeException("Test Failed, strict module m1x should not be able to access " +
|
||||
"public type c4 defined in unnamed module");
|
||||
} catch (IllegalAccessError e) {
|
||||
}
|
||||
}
|
||||
|
||||
// Module m1 is a strict module and has established
|
||||
// Module m1x is a strict module and has established
|
||||
// readability to an unnamed module that c4 is defined in.
|
||||
public void test_strictModuleUnnamedReadableLayer() throws Throwable {
|
||||
|
||||
// Define module: m1
|
||||
// Define module: m1x
|
||||
// Can read: java.base
|
||||
// Packages: p3
|
||||
// Packages exported: p3 is exported unqualifiedly
|
||||
ModuleDescriptor descriptor_m1 =
|
||||
ModuleDescriptor.module("m1")
|
||||
ModuleDescriptor descriptor_m1x =
|
||||
ModuleDescriptor.newModule("m1x")
|
||||
.requires("java.base")
|
||||
.exports("p3")
|
||||
.build();
|
||||
|
||||
// Set up a ModuleFinder containing all modules for this layer.
|
||||
ModuleFinder finder = ModuleLibrary.of(descriptor_m1);
|
||||
ModuleFinder finder = ModuleLibrary.of(descriptor_m1x);
|
||||
|
||||
// Resolves "m1"
|
||||
// Resolves "m1x"
|
||||
Configuration cf = Layer.boot()
|
||||
.configuration()
|
||||
.resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
|
||||
.resolve(finder, ModuleFinder.of(), Set.of("m1x"));
|
||||
|
||||
MyDiffClassLoader.loader1 = new MyDiffClassLoader();
|
||||
MyDiffClassLoader.loader2 = new MyDiffClassLoader();
|
||||
|
||||
// map module m1 to class loader.
|
||||
// map module m1x to class loader.
|
||||
// class c2 will be loaded in an unnamed module/loader2
|
||||
// to achieve differing class loaders.
|
||||
Map<String, ClassLoader> map = new HashMap<>();
|
||||
map.put("m1", MyDiffClassLoader.loader1);
|
||||
map.put("m1x", MyDiffClassLoader.loader1);
|
||||
|
||||
// Create Layer that contains m1
|
||||
// Create Layer that contains m1x
|
||||
Layer layer = Layer.boot().defineModules(cf, map::get);
|
||||
|
||||
assertTrue(layer.findLoader("m1") == MyDiffClassLoader.loader1);
|
||||
assertTrue(layer.findLoader("m1x") == MyDiffClassLoader.loader1);
|
||||
assertTrue(layer.findLoader("java.base") == null);
|
||||
|
||||
// now use the same loader to load class p3.c3ReadEdgeDiffLoader
|
||||
Class p3_c3_class = MyDiffClassLoader.loader1.loadClass("p3.c3ReadEdgeDiffLoader");
|
||||
|
||||
try {
|
||||
// Read edge between m1 and the unnamed module that loads c4 is established in
|
||||
// Read edge between m1x and the unnamed module that loads c4 is established in
|
||||
// C3ReadEdgeDiffLoader's ctor before attempting access.
|
||||
p3_c3_class.newInstance();
|
||||
} catch (IllegalAccessError e) {
|
||||
throw new RuntimeException("Test Failed, module m1 has established readability to " +
|
||||
throw new RuntimeException("Test Failed, module m1x has established readability to " +
|
||||
"c4 loader's unnamed module, access should be allowed: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2016, 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
|
||||
@ -25,9 +25,9 @@
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @summary Test that if module m1 can read module m2, but package p2 in m2
|
||||
* is exported specifically to module m3, then class p1.c1 in m1 can not
|
||||
* access p2.c2 in m2.
|
||||
* @summary Test that if module m1x can read module m2x, but package p2 in m2x
|
||||
* is exported specifically to module m3x, then class p1.c1 in m1x can not
|
||||
* access p2.c2 in m2x.
|
||||
* @modules java.base/jdk.internal.misc
|
||||
* @library /test/lib
|
||||
* @compile myloaders/MySameClassLoader.java
|
||||
@ -48,15 +48,15 @@ import java.util.Set;
|
||||
import myloaders.MySameClassLoader;
|
||||
|
||||
//
|
||||
// ClassLoader1 --> defines m1 --> packages p1
|
||||
// defines m2 --> packages p2
|
||||
// defines m3 --> packages p3
|
||||
// ClassLoader1 --> defines m1x --> packages p1
|
||||
// defines m2x --> packages p2
|
||||
// defines m3x --> packages p3
|
||||
//
|
||||
// m1 can read m2
|
||||
// package p2 in m2 is exported to m3
|
||||
// m1x can read m2x
|
||||
// package p2 in m2x is exported to m3x
|
||||
//
|
||||
// class p1.c1 defined in m1 tries to access p2.c2 defined in m2
|
||||
// Access denied since although m1 can read m2, p2 is exported only to m3.
|
||||
// class p1.c1 defined in m1x tries to access p2.c2 defined in m2x
|
||||
// Access denied since although m1x can read m2x, p2 is exported only to m3x.
|
||||
//
|
||||
public class ExpQualOther {
|
||||
|
||||
@ -65,66 +65,66 @@ public class ExpQualOther {
|
||||
// publically defined classes within packages of those modules.
|
||||
public void createLayerOnBoot() throws Throwable {
|
||||
|
||||
// Define module: m1
|
||||
// Can read: java.base, m2, m3
|
||||
// Define module: m1x
|
||||
// Can read: java.base, m2x, m3x
|
||||
// Packages: p1
|
||||
// Packages exported: p1 is exported unqualifiedly
|
||||
ModuleDescriptor descriptor_m1 =
|
||||
ModuleDescriptor.module("m1")
|
||||
ModuleDescriptor descriptor_m1x =
|
||||
ModuleDescriptor.newModule("m1x")
|
||||
.requires("java.base")
|
||||
.requires("m2")
|
||||
.requires("m3")
|
||||
.requires("m2x")
|
||||
.requires("m3x")
|
||||
.exports("p1")
|
||||
.build();
|
||||
|
||||
// Define module: m2
|
||||
// Define module: m2x
|
||||
// Can read: java.base
|
||||
// Packages: p2
|
||||
// Packages exported: p2 is exported to m3
|
||||
ModuleDescriptor descriptor_m2 =
|
||||
ModuleDescriptor.module("m2")
|
||||
// Packages exported: p2 is exported to m3x
|
||||
ModuleDescriptor descriptor_m2x =
|
||||
ModuleDescriptor.newModule("m2x")
|
||||
.requires("java.base")
|
||||
.exports("p2", Set.of("m3"))
|
||||
.exports("p2", Set.of("m3x"))
|
||||
.build();
|
||||
|
||||
// Define module: m3
|
||||
// Can read: java.base, m2
|
||||
// Define module: m3x
|
||||
// Can read: java.base, m2x
|
||||
// Packages: p3
|
||||
// Packages exported: none
|
||||
ModuleDescriptor descriptor_m3 =
|
||||
ModuleDescriptor.module("m3")
|
||||
ModuleDescriptor descriptor_m3x =
|
||||
ModuleDescriptor.newModule("m3x")
|
||||
.requires("java.base")
|
||||
.requires("m2")
|
||||
.contains("p3")
|
||||
.requires("m2x")
|
||||
.packages(Set.of("p3"))
|
||||
.build();
|
||||
|
||||
// Set up a ModuleFinder containing all modules for this layer.
|
||||
ModuleFinder finder = ModuleLibrary.of(descriptor_m1, descriptor_m2, descriptor_m3);
|
||||
ModuleFinder finder = ModuleLibrary.of(descriptor_m1x, descriptor_m2x, descriptor_m3x);
|
||||
|
||||
// Resolves "m1"
|
||||
// Resolves "m1x"
|
||||
Configuration cf = Layer.boot()
|
||||
.configuration()
|
||||
.resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
|
||||
.resolve(finder, ModuleFinder.of(), Set.of("m1x"));
|
||||
|
||||
// map each module to differing class loaders for this test
|
||||
Map<String, ClassLoader> map = new HashMap<>();
|
||||
map.put("m1", MySameClassLoader.loader1);
|
||||
map.put("m2", MySameClassLoader.loader1);
|
||||
map.put("m3", MySameClassLoader.loader1);
|
||||
map.put("m1x", MySameClassLoader.loader1);
|
||||
map.put("m2x", MySameClassLoader.loader1);
|
||||
map.put("m3x", MySameClassLoader.loader1);
|
||||
|
||||
// Create Layer that contains m1 & m2
|
||||
// Create Layer that contains m1x & m2x
|
||||
Layer layer = Layer.boot().defineModules(cf, map::get);
|
||||
|
||||
assertTrue(layer.findLoader("m1") == MySameClassLoader.loader1);
|
||||
assertTrue(layer.findLoader("m2") == MySameClassLoader.loader1);
|
||||
assertTrue(layer.findLoader("m3") == MySameClassLoader.loader1);
|
||||
assertTrue(layer.findLoader("m1x") == MySameClassLoader.loader1);
|
||||
assertTrue(layer.findLoader("m2x") == MySameClassLoader.loader1);
|
||||
assertTrue(layer.findLoader("m3x") == MySameClassLoader.loader1);
|
||||
assertTrue(layer.findLoader("java.base") == null);
|
||||
|
||||
// now use the same loader to load class p1.c1
|
||||
Class p1_c1_class = MySameClassLoader.loader1.loadClass("p1.c1");
|
||||
try {
|
||||
p1_c1_class.newInstance();
|
||||
throw new RuntimeException("Failed to get IAE (p2 in m2 is exported to m3 not to m1)");
|
||||
throw new RuntimeException("Failed to get IAE (p2 in m2x is exported to m3x not to m1x)");
|
||||
} catch (IllegalAccessError e) {
|
||||
System.out.println(e.getMessage());
|
||||
if (!e.getMessage().contains("does not export")) {
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2016, 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
|
||||
@ -25,8 +25,8 @@
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @summary Test that if module m1 can read module m2, AND package p2 in m2 is
|
||||
* exported qualifiedly to m1, then class p1.c1 in m1 can read p2.c2 in m2.
|
||||
* @summary Test that if module m1x can read module m2x, AND package p2 in m2x is
|
||||
* exported qualifiedly to m1x, then class p1.c1 in m1x can read p2.c2 in m2x.
|
||||
* @modules java.base/jdk.internal.misc
|
||||
* @library /test/lib
|
||||
* @compile myloaders/MySameClassLoader.java
|
||||
@ -53,52 +53,52 @@ public class ExpQualToM1 {
|
||||
// publically defined classes within packages of those modules.
|
||||
public void createLayerOnBoot() throws Throwable {
|
||||
|
||||
// Define module: m1
|
||||
// Can read: java.base, m2
|
||||
// Define module: m1x
|
||||
// Can read: java.base, m2x
|
||||
// Packages: p1
|
||||
// Packages exported: p1 is exported unqualifiedly
|
||||
ModuleDescriptor descriptor_m1 =
|
||||
ModuleDescriptor.module("m1")
|
||||
ModuleDescriptor descriptor_m1x =
|
||||
ModuleDescriptor.newModule("m1x")
|
||||
.requires("java.base")
|
||||
.requires("m2")
|
||||
.requires("m2x")
|
||||
.exports("p1")
|
||||
.build();
|
||||
|
||||
// Define module: m2
|
||||
// Define module: m2x
|
||||
// Can read: java.base
|
||||
// Packages: p2
|
||||
// Packages exported: p2 is exported qualifiedly to m1
|
||||
ModuleDescriptor descriptor_m2 =
|
||||
ModuleDescriptor.module("m2")
|
||||
// Packages exported: p2 is exported qualifiedly to m1x
|
||||
ModuleDescriptor descriptor_m2x =
|
||||
ModuleDescriptor.newModule("m2x")
|
||||
.requires("java.base")
|
||||
.exports("p2", Set.of("m1"))
|
||||
.exports("p2", Set.of("m1x"))
|
||||
.build();
|
||||
|
||||
// Set up a ModuleFinder containing all modules for this layer.
|
||||
ModuleFinder finder = ModuleLibrary.of(descriptor_m1, descriptor_m2);
|
||||
ModuleFinder finder = ModuleLibrary.of(descriptor_m1x, descriptor_m2x);
|
||||
|
||||
// Resolves "m1"
|
||||
// Resolves "m1x"
|
||||
Configuration cf = Layer.boot()
|
||||
.configuration()
|
||||
.resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
|
||||
.resolve(finder, ModuleFinder.of(), Set.of("m1x"));
|
||||
|
||||
// map each module to the same class loader for this test
|
||||
Map<String, ClassLoader> map = new HashMap<>();
|
||||
map.put("m1", MySameClassLoader.loader1);
|
||||
map.put("m2", MySameClassLoader.loader1);
|
||||
map.put("m1x", MySameClassLoader.loader1);
|
||||
map.put("m2x", MySameClassLoader.loader1);
|
||||
|
||||
// Create Layer that contains m1 & m2
|
||||
// Create Layer that contains m1x & m2x
|
||||
Layer layer = Layer.boot().defineModules(cf, map::get);
|
||||
|
||||
assertTrue(layer.findLoader("m1") == MySameClassLoader.loader1);
|
||||
assertTrue(layer.findLoader("m2") == MySameClassLoader.loader1);
|
||||
assertTrue(layer.findLoader("m1x") == MySameClassLoader.loader1);
|
||||
assertTrue(layer.findLoader("m2x") == MySameClassLoader.loader1);
|
||||
|
||||
// now use the same loader to load class p1.c1
|
||||
Class p1_c1_class = MySameClassLoader.loader1.loadClass("p1.c1");
|
||||
try {
|
||||
p1_c1_class.newInstance();
|
||||
} catch (IllegalAccessError e) {
|
||||
throw new RuntimeException("Test Failed, an IAE should not be thrown since p2 is exported qualifiedly to m1");
|
||||
throw new RuntimeException("Test Failed, an IAE should not be thrown since p2 is exported qualifiedly to m1x");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2016, 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
|
||||
@ -25,8 +25,8 @@
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @summary Test that if module m1 can read module m2, AND package p2 in module2 is
|
||||
* exported unqualifiedly, then class p1.c1 in m1 can read p2.c2 in m2.
|
||||
* @summary Test that if module m1x can read module m2x, AND package p2 in module_two is
|
||||
* exported unqualifiedly, then class p1.c1 in m1x can read p2.c2 in m2x.
|
||||
* @modules java.base/jdk.internal.misc
|
||||
* @library /test/lib
|
||||
* @compile myloaders/MySameClassLoader.java
|
||||
@ -53,45 +53,45 @@ public class ExpUnqual {
|
||||
// publically defined classes within packages of those modules.
|
||||
public void createLayerOnBoot() throws Throwable {
|
||||
|
||||
// Define module: m1
|
||||
// Can read: java.base, m2
|
||||
// Define module: m1x
|
||||
// Can read: java.base, m2x
|
||||
// Packages: p1
|
||||
// Packages exported: p1 is exported unqualifiedly
|
||||
ModuleDescriptor descriptor_m1 =
|
||||
ModuleDescriptor.module("m1")
|
||||
ModuleDescriptor descriptor_m1x =
|
||||
ModuleDescriptor.newModule("m1x")
|
||||
.requires("java.base")
|
||||
.requires("m2")
|
||||
.requires("m2x")
|
||||
.exports("p1")
|
||||
.build();
|
||||
|
||||
// Define module: m2
|
||||
// Define module: m2x
|
||||
// Can read: java.base
|
||||
// Packages: p2
|
||||
// Packages exported: p2 is exported unqualifiedly
|
||||
ModuleDescriptor descriptor_m2 =
|
||||
ModuleDescriptor.module("m2")
|
||||
ModuleDescriptor descriptor_m2x =
|
||||
ModuleDescriptor.newModule("m2x")
|
||||
.requires("java.base")
|
||||
.exports("p2")
|
||||
.build();
|
||||
|
||||
// Set up a ModuleFinder containing all modules for this layer.
|
||||
ModuleFinder finder = ModuleLibrary.of(descriptor_m1, descriptor_m2);
|
||||
ModuleFinder finder = ModuleLibrary.of(descriptor_m1x, descriptor_m2x);
|
||||
|
||||
// Resolves "m1"
|
||||
// Resolves "m1x"
|
||||
Configuration cf = Layer.boot()
|
||||
.configuration()
|
||||
.resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
|
||||
.resolve(finder, ModuleFinder.of(), Set.of("m1x"));
|
||||
|
||||
// map each module to the same class loader for this test
|
||||
Map<String, ClassLoader> map = new HashMap<>();
|
||||
map.put("m1", MySameClassLoader.loader1);
|
||||
map.put("m2", MySameClassLoader.loader1);
|
||||
map.put("m1x", MySameClassLoader.loader1);
|
||||
map.put("m2x", MySameClassLoader.loader1);
|
||||
|
||||
// Create Layer that contains m1 & m2
|
||||
// Create Layer that contains m1x & m2x
|
||||
Layer layer = Layer.boot().defineModules(cf, map::get);
|
||||
|
||||
assertTrue(layer.findLoader("m1") == MySameClassLoader.loader1);
|
||||
assertTrue(layer.findLoader("m2") == MySameClassLoader.loader1);
|
||||
assertTrue(layer.findLoader("m1x") == MySameClassLoader.loader1);
|
||||
assertTrue(layer.findLoader("m2x") == MySameClassLoader.loader1);
|
||||
|
||||
// now use the same loader to load class p1.c1
|
||||
Class p1_c1_class = MySameClassLoader.loader1.loadClass("p1.c1");
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2016, 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
|
||||
@ -25,8 +25,8 @@
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @summary Test if package p2 in module m2 is exported to all unnamed,
|
||||
* then class p1.c1 in an unnamed module can read p2.c2 in module m2.
|
||||
* @summary Test if package p2 in module m2x is exported to all unnamed,
|
||||
* then class p1.c1 in an unnamed module can read p2.c2 in module m2x.
|
||||
* @library /test/lib
|
||||
* @modules java.base/jdk.internal.misc
|
||||
* @modules java.base/jdk.internal.module
|
||||
@ -49,15 +49,15 @@ import java.util.Set;
|
||||
import myloaders.MySameClassLoader;
|
||||
|
||||
//
|
||||
// ClassLoader1 --> defines m1 --> no packages
|
||||
// defines m2 --> packages p2
|
||||
// ClassLoader1 --> defines m1x --> no packages
|
||||
// defines m2x --> packages p2
|
||||
//
|
||||
// m1 can read m2
|
||||
// package p2 in m2 is exported unqualifiedly
|
||||
// m1x can read m2x
|
||||
// package p2 in m2x is exported unqualifiedly
|
||||
//
|
||||
// class p1.c1 defined in an unnamed module tries to access p2.c2 defined in m2
|
||||
// class p1.c1 defined in an unnamed module tries to access p2.c2 defined in m2x
|
||||
// Access allowed, an unnamed module can read all modules and p2 in module
|
||||
// m2 is exported to all unnamed modules.
|
||||
// m2x is exported to all unnamed modules.
|
||||
|
||||
public class ExportAllUnnamed {
|
||||
|
||||
@ -66,51 +66,51 @@ public class ExportAllUnnamed {
|
||||
// publically defined classes within packages of those modules.
|
||||
public void createLayerOnBoot() throws Throwable {
|
||||
|
||||
// Define module: m1
|
||||
// Can read: java.base, m2
|
||||
// Define module: m1x
|
||||
// Can read: java.base, m2x
|
||||
// Packages: none
|
||||
// Packages exported: none
|
||||
ModuleDescriptor descriptor_m1 =
|
||||
ModuleDescriptor.module("m1")
|
||||
ModuleDescriptor descriptor_m1x =
|
||||
ModuleDescriptor.newModule("m1x")
|
||||
.requires("java.base")
|
||||
.requires("m2")
|
||||
.requires("m2x")
|
||||
.build();
|
||||
|
||||
// Define module: m2
|
||||
// Define module: m2x
|
||||
// Can read: java.base
|
||||
// Packages: p2
|
||||
// Packages exported: p2 is exported unqualifiedly
|
||||
ModuleDescriptor descriptor_m2 =
|
||||
ModuleDescriptor.module("m2")
|
||||
ModuleDescriptor descriptor_m2x =
|
||||
ModuleDescriptor.newModule("m2x")
|
||||
.requires("java.base")
|
||||
.exports("p2", Set.of("m1"))
|
||||
.exports("p2", Set.of("m1x"))
|
||||
.build();
|
||||
|
||||
// Set up a ModuleFinder containing all modules for this layer.
|
||||
ModuleFinder finder = ModuleLibrary.of(descriptor_m1, descriptor_m2);
|
||||
ModuleFinder finder = ModuleLibrary.of(descriptor_m1x, descriptor_m2x);
|
||||
|
||||
// Resolves "m1"
|
||||
// Resolves "m1x"
|
||||
Configuration cf = Layer.boot()
|
||||
.configuration()
|
||||
.resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
|
||||
.resolve(finder, ModuleFinder.of(), Set.of("m1x"));
|
||||
|
||||
// map each module to differing class loaders for this test
|
||||
Map<String, ClassLoader> map = new HashMap<>();
|
||||
map.put("m1", MySameClassLoader.loader1);
|
||||
map.put("m2", MySameClassLoader.loader1);
|
||||
map.put("m1x", MySameClassLoader.loader1);
|
||||
map.put("m2x", MySameClassLoader.loader1);
|
||||
|
||||
// Create Layer that contains m1 & m2
|
||||
// Create Layer that contains m1x & m2x
|
||||
Layer layer = Layer.boot().defineModules(cf, map::get);
|
||||
|
||||
assertTrue(layer.findLoader("m1") == MySameClassLoader.loader1);
|
||||
assertTrue(layer.findLoader("m2") == MySameClassLoader.loader1);
|
||||
assertTrue(layer.findLoader("m1x") == MySameClassLoader.loader1);
|
||||
assertTrue(layer.findLoader("m2x") == MySameClassLoader.loader1);
|
||||
assertTrue(layer.findLoader("java.base") == null);
|
||||
|
||||
Class p2_c2_class = MySameClassLoader.loader1.loadClass("p2.c2");
|
||||
Module m2 = p2_c2_class.getModule();
|
||||
Module m2x = p2_c2_class.getModule();
|
||||
|
||||
// Export m2/p2 to all unnamed modules.
|
||||
jdk.internal.module.Modules.addExportsToAllUnnamed(m2, "p2");
|
||||
// Export m2x/p2 to all unnamed modules.
|
||||
jdk.internal.module.Modules.addExportsToAllUnnamed(m2x, "p2");
|
||||
|
||||
// now use the same loader to load class p1.c1
|
||||
Class p1_c1_class = MySameClassLoader.loader1.loadClass("p1.c1");
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2016, 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
|
||||
@ -25,8 +25,8 @@
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @summary Test that if module m1 can read module m2, but package p2 in m2 is not
|
||||
* exported, then class p1.c1 in m1 can not read p2.c2 in m2.
|
||||
* @summary Test that if module m1x can read module m2x, but package p2 in m2x is not
|
||||
* exported, then class p1.c1 in m1x can not read p2.c2 in m2x.
|
||||
* @modules java.base/jdk.internal.misc
|
||||
* @library /test/lib
|
||||
* @compile myloaders/MySameClassLoader.java
|
||||
@ -47,13 +47,13 @@ import java.util.Set;
|
||||
import myloaders.MySameClassLoader;
|
||||
|
||||
//
|
||||
// ClassLoader1 --> defines m1 --> packages p1
|
||||
// defines m2 --> packages p2
|
||||
// ClassLoader1 --> defines m1x --> packages p1
|
||||
// defines m2x --> packages p2
|
||||
//
|
||||
// m1 can read m2
|
||||
// package p2 in m2 is not exported
|
||||
// m1x can read m2x
|
||||
// package p2 in m2x is not exported
|
||||
//
|
||||
// class p1.c1 defined in m1 tries to access p2.c2 defined in m2
|
||||
// class p1.c1 defined in m1x tries to access p2.c2 defined in m2x
|
||||
// Access denied since p2 is not exported.
|
||||
//
|
||||
public class PkgNotExp {
|
||||
@ -63,51 +63,51 @@ public class PkgNotExp {
|
||||
// publically defined classes within packages of those modules.
|
||||
public void createLayerOnBoot() throws Throwable {
|
||||
|
||||
// Define module: m1
|
||||
// Can read: java.base, m2
|
||||
// Define module: m1x
|
||||
// Can read: java.base, m2x
|
||||
// Packages: p1
|
||||
// Packages exported: p1 is exported unqualifiedly
|
||||
ModuleDescriptor descriptor_m1 =
|
||||
ModuleDescriptor.module("m1")
|
||||
ModuleDescriptor descriptor_m1x =
|
||||
ModuleDescriptor.newModule("m1x")
|
||||
.requires("java.base")
|
||||
.requires("m2")
|
||||
.requires("m2x")
|
||||
.exports("p1")
|
||||
.build();
|
||||
|
||||
// Define module: m2
|
||||
// Define module: m2x
|
||||
// Can read: java.base
|
||||
// Packages: p2
|
||||
// Packages exported: none
|
||||
ModuleDescriptor descriptor_m2 =
|
||||
ModuleDescriptor.module("m2")
|
||||
ModuleDescriptor descriptor_m2x =
|
||||
ModuleDescriptor.newModule("m2x")
|
||||
.requires("java.base")
|
||||
.contains("p2")
|
||||
.packages(Set.of("p2"))
|
||||
.build();
|
||||
|
||||
// Set up a ModuleFinder containing all modules for this layer.
|
||||
ModuleFinder finder = ModuleLibrary.of(descriptor_m1, descriptor_m2);
|
||||
ModuleFinder finder = ModuleLibrary.of(descriptor_m1x, descriptor_m2x);
|
||||
|
||||
// Resolves "m1"
|
||||
// Resolves "m1x"
|
||||
Configuration cf = Layer.boot()
|
||||
.configuration()
|
||||
.resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
|
||||
.resolve(finder, ModuleFinder.of(), Set.of("m1x"));
|
||||
|
||||
// map each module to the same class loader for this test
|
||||
Map<String, ClassLoader> map = new HashMap<>();
|
||||
map.put("m1", MySameClassLoader.loader1);
|
||||
map.put("m2", MySameClassLoader.loader1);
|
||||
map.put("m1x", MySameClassLoader.loader1);
|
||||
map.put("m2x", MySameClassLoader.loader1);
|
||||
|
||||
// Create Layer that contains m1 and m2
|
||||
// Create Layer that contains m1x and m2x
|
||||
Layer layer = Layer.boot().defineModules(cf, map::get);
|
||||
|
||||
assertTrue(layer.findLoader("m1") == MySameClassLoader.loader1);
|
||||
assertTrue(layer.findLoader("m2") == MySameClassLoader.loader1);
|
||||
assertTrue(layer.findLoader("m1x") == MySameClassLoader.loader1);
|
||||
assertTrue(layer.findLoader("m2x") == MySameClassLoader.loader1);
|
||||
|
||||
// now use the same loader to load class p1.c1
|
||||
Class p1_c1_class = MySameClassLoader.loader1.loadClass("p1.c1");
|
||||
try {
|
||||
p1_c1_class.newInstance();
|
||||
throw new RuntimeException("Failed to get IAE (p2 in m2 is not exported)");
|
||||
throw new RuntimeException("Failed to get IAE (p2 in m2x is not exported)");
|
||||
} catch (IllegalAccessError e) {
|
||||
System.out.println(e.getMessage());
|
||||
if (!e.getMessage().contains("does not export")) {
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2016, 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
|
||||
@ -25,7 +25,7 @@
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @summary class p1.c1 defined in m1 tries to access p2.c2 defined in unnamed module.
|
||||
* @summary class p1.c1 defined in m1x tries to access p2.c2 defined in unnamed module.
|
||||
* @library /test/lib
|
||||
* @modules java.base/jdk.internal.misc
|
||||
* @modules java.base/jdk.internal.module
|
||||
@ -50,10 +50,10 @@ import java.util.Set;
|
||||
import myloaders.MySameClassLoader;
|
||||
|
||||
//
|
||||
// ClassLoader1 --> defines m1 --> packages p1
|
||||
// package p1 in m1 is exported unqualifiedly
|
||||
// ClassLoader1 --> defines m1x --> packages p1
|
||||
// package p1 in m1x is exported unqualifiedly
|
||||
//
|
||||
// class p1.c1 defined in m1 tries to access p2.c2 defined in
|
||||
// class p1.c1 defined in m1x tries to access p2.c2 defined in
|
||||
// in unnamed module.
|
||||
//
|
||||
// Three access attempts occur in this test:
|
||||
@ -62,7 +62,7 @@ import myloaders.MySameClassLoader;
|
||||
// 2. In this scenario a strict module establishes readability
|
||||
// to the particular unnamed module it is trying to access.
|
||||
// Access is allowed.
|
||||
// 3. Module m1 in the test_looseModuleLayer() method
|
||||
// 3. Module m1x in the test_looseModuleLayer() method
|
||||
// is transitioned to a loose module, access
|
||||
// to all unnamed modules is allowed.
|
||||
//
|
||||
@ -71,38 +71,38 @@ public class Umod {
|
||||
// Create Layers over the boot layer to test different
|
||||
// accessing scenarios of a named module to an unnamed module.
|
||||
|
||||
// Module m1 is a strict module and has not established
|
||||
// Module m1x is a strict module and has not established
|
||||
// readability to an unnamed module that p2.c2 is defined in.
|
||||
public void test_strictModuleLayer() throws Throwable {
|
||||
|
||||
// Define module: m1
|
||||
// Define module: m1x
|
||||
// Can read: java.base
|
||||
// Packages: p1
|
||||
// Packages exported: p1 is exported unqualifiedly
|
||||
ModuleDescriptor descriptor_m1 =
|
||||
ModuleDescriptor.module("m1")
|
||||
ModuleDescriptor descriptor_m1x =
|
||||
ModuleDescriptor.newModule("m1x")
|
||||
.requires("java.base")
|
||||
.exports("p1")
|
||||
.build();
|
||||
|
||||
// Set up a ModuleFinder containing all modules for this layer.
|
||||
ModuleFinder finder = ModuleLibrary.of(descriptor_m1);
|
||||
ModuleFinder finder = ModuleLibrary.of(descriptor_m1x);
|
||||
|
||||
// Resolves "m1"
|
||||
// Resolves "m1x"
|
||||
Configuration cf = Layer.boot()
|
||||
.configuration()
|
||||
.resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
|
||||
.resolve(finder, ModuleFinder.of(), Set.of("m1x"));
|
||||
|
||||
// map module m1 to class loader.
|
||||
// map module m1x to class loader.
|
||||
// class c2 will be loaded in an unnamed module/loader.
|
||||
MySameClassLoader loader = new MySameClassLoader();
|
||||
Map<String, ClassLoader> map = new HashMap<>();
|
||||
map.put("m1", loader);
|
||||
map.put("m1x", loader);
|
||||
|
||||
// Create Layer that contains m1
|
||||
// Create Layer that contains m1x
|
||||
Layer layer = Layer.boot().defineModules(cf, map::get);
|
||||
|
||||
assertTrue(layer.findLoader("m1") == loader);
|
||||
assertTrue(layer.findLoader("m1x") == loader);
|
||||
assertTrue(layer.findLoader("java.base") == null);
|
||||
|
||||
// now use the same loader to load class p1.c1
|
||||
@ -111,103 +111,103 @@ public class Umod {
|
||||
// Attempt access
|
||||
try {
|
||||
p1_c1_class.newInstance();
|
||||
throw new RuntimeException("Test Failed, strict module m1, type p1.c1, should not be able " +
|
||||
throw new RuntimeException("Test Failed, strict module m1x, type p1.c1, should not be able " +
|
||||
"to access public type p2.c2 defined in unnamed module");
|
||||
} catch (IllegalAccessError e) {
|
||||
}
|
||||
}
|
||||
|
||||
// Module m1 is a strict module and has established
|
||||
// Module m1x is a strict module and has established
|
||||
// readability to an unnamed module that p2.c2 is defined in.
|
||||
public void test_strictModuleUnnamedReadableLayer() throws Throwable {
|
||||
|
||||
// Define module: m1
|
||||
// Define module: m1x
|
||||
// Can read: java.base
|
||||
// Packages: p1
|
||||
// Packages exported: p1 is exported unqualifiedly
|
||||
ModuleDescriptor descriptor_m1 =
|
||||
ModuleDescriptor.module("m1")
|
||||
ModuleDescriptor descriptor_m1x =
|
||||
ModuleDescriptor.newModule("m1x")
|
||||
.requires("java.base")
|
||||
.exports("p1")
|
||||
.build();
|
||||
|
||||
// Set up a ModuleFinder containing all modules for this layer.
|
||||
ModuleFinder finder = ModuleLibrary.of(descriptor_m1);
|
||||
ModuleFinder finder = ModuleLibrary.of(descriptor_m1x);
|
||||
|
||||
// Resolves "m1"
|
||||
// Resolves "m1x"
|
||||
Configuration cf = Layer.boot()
|
||||
.configuration()
|
||||
.resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
|
||||
.resolve(finder, ModuleFinder.of(), Set.of("m1x"));
|
||||
|
||||
MySameClassLoader loader = new MySameClassLoader();
|
||||
// map module m1 to class loader.
|
||||
// map module m1x to class loader.
|
||||
// class c2 will be loaded in an unnamed module/loader.
|
||||
Map<String, ClassLoader> map = new HashMap<>();
|
||||
map.put("m1", loader);
|
||||
map.put("m1x", loader);
|
||||
|
||||
// Create Layer that contains m1
|
||||
// Create Layer that contains m1x
|
||||
Layer layer = Layer.boot().defineModules(cf, map::get);
|
||||
|
||||
assertTrue(layer.findLoader("m1") == loader);
|
||||
assertTrue(layer.findLoader("m1x") == loader);
|
||||
assertTrue(layer.findLoader("java.base") == null);
|
||||
|
||||
// now use the same loader to load class p1.c1ReadEdge
|
||||
Class p1_c1_class = loader.loadClass("p1.c1ReadEdge");
|
||||
|
||||
try {
|
||||
// Read edge between m1 and the unnamed module that loads p2.c2 is established in
|
||||
// Read edge between m1x and the unnamed module that loads p2.c2 is established in
|
||||
// c1ReadEdge's ctor before attempting access.
|
||||
p1_c1_class.newInstance();
|
||||
} catch (IllegalAccessError e) {
|
||||
throw new RuntimeException("Test Failed, strict module m1, type p1.c1ReadEdge, should be able to acccess public type " +
|
||||
throw new RuntimeException("Test Failed, strict module m1x, type p1.c1ReadEdge, should be able to acccess public type " +
|
||||
"p2.c2 defined in unnamed module: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
// Module m1 is a loose module and thus can read all unnamed modules.
|
||||
// Module m1x is a loose module and thus can read all unnamed modules.
|
||||
public void test_looseModuleLayer() throws Throwable {
|
||||
|
||||
// Define module: m1
|
||||
// Define module: m1x
|
||||
// Can read: java.base
|
||||
// Packages: p1
|
||||
// Packages exported: p1 is exported unqualifiedly
|
||||
ModuleDescriptor descriptor_m1 =
|
||||
ModuleDescriptor.module("m1")
|
||||
ModuleDescriptor descriptor_m1x =
|
||||
ModuleDescriptor.newModule("m1x")
|
||||
.requires("java.base")
|
||||
.exports("p1")
|
||||
.build();
|
||||
|
||||
// Set up a ModuleFinder containing all modules for this layer.
|
||||
ModuleFinder finder = ModuleLibrary.of(descriptor_m1);
|
||||
ModuleFinder finder = ModuleLibrary.of(descriptor_m1x);
|
||||
|
||||
// Resolves "m1"
|
||||
// Resolves "m1x"
|
||||
Configuration cf = Layer.boot()
|
||||
.configuration()
|
||||
.resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
|
||||
.resolve(finder, ModuleFinder.of(), Set.of("m1x"));
|
||||
|
||||
MySameClassLoader loader = new MySameClassLoader();
|
||||
// map module m1 to class loader.
|
||||
// map module m1x to class loader.
|
||||
// class c2 will be loaded in an unnamed module/loader.
|
||||
Map<String, ClassLoader> map = new HashMap<>();
|
||||
map.put("m1", loader);
|
||||
map.put("m1x", loader);
|
||||
|
||||
// Create Layer that contains m1
|
||||
// Create Layer that contains m1x
|
||||
Layer layer = Layer.boot().defineModules(cf, map::get);
|
||||
|
||||
assertTrue(layer.findLoader("m1") == loader);
|
||||
assertTrue(layer.findLoader("m1x") == loader);
|
||||
assertTrue(layer.findLoader("java.base") == null);
|
||||
|
||||
// now use the same loader to load class p1.c1Loose
|
||||
Class p1_c1_class = loader.loadClass("p1.c1Loose");
|
||||
|
||||
// change m1 to read all unnamed modules
|
||||
Module m1 = layer.findModule("m1").get();
|
||||
jdk.internal.module.Modules.addReadsAllUnnamed(m1);
|
||||
// change m1x to read all unnamed modules
|
||||
Module m1x = layer.findModule("m1x").get();
|
||||
jdk.internal.module.Modules.addReadsAllUnnamed(m1x);
|
||||
|
||||
try {
|
||||
p1_c1_class.newInstance();
|
||||
} catch (IllegalAccessError e) {
|
||||
throw new RuntimeException("Test Failed, strict module m1, type p1.c1Loose, should be able to acccess public type " +
|
||||
throw new RuntimeException("Test Failed, strict module m1x, type p1.c1Loose, should be able to acccess public type " +
|
||||
"p2.c2 defined in unnamed module: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2016, 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
|
||||
@ -25,9 +25,9 @@
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @summary class p1.c1 defined in an unnamed module tries to access p2.c2 defined in m2.
|
||||
* @summary class p1.c1 defined in an unnamed module tries to access p2.c2 defined in m2x.
|
||||
* Access is denied, since an unnamed module can read all modules but p2 in module
|
||||
* m2 is exported specifically to module m1, not to all modules.
|
||||
* m2x is exported specifically to module m1x, not to all modules.
|
||||
* @modules java.base/jdk.internal.misc
|
||||
* @library /test/lib
|
||||
* @compile myloaders/MyDiffClassLoader.java
|
||||
@ -48,15 +48,15 @@ import java.util.Set;
|
||||
import myloaders.MyDiffClassLoader;
|
||||
|
||||
//
|
||||
// ClassLoader1 --> defines m1 --> no packages
|
||||
// ClassLoader2 --> defines m2 --> packages p2
|
||||
// ClassLoader1 --> defines m1x --> no packages
|
||||
// ClassLoader2 --> defines m2x --> packages p2
|
||||
//
|
||||
// m1 can read m2
|
||||
// package p2 in m2 is not exported
|
||||
// m1x can read m2x
|
||||
// package p2 in m2x is not exported
|
||||
//
|
||||
// class p1.c1 defined in an unnamed module tries to access p2.c2 defined in m2
|
||||
// class p1.c1 defined in an unnamed module tries to access p2.c2 defined in m2x
|
||||
// Access denied, an unnamed module can read all modules but p2 in module
|
||||
// m2 is exported specifically to module m1 not to all modules.
|
||||
// m2x is exported specifically to module m1x not to all modules.
|
||||
//
|
||||
public class UmodDiffCL_ExpQualOther {
|
||||
|
||||
@ -65,53 +65,53 @@ public class UmodDiffCL_ExpQualOther {
|
||||
// publically defined classes within packages of those modules.
|
||||
public void createLayerOnBoot() throws Throwable {
|
||||
|
||||
// Define module: m1
|
||||
// Define module: m1x
|
||||
// Can read: java.base
|
||||
// Packages: none
|
||||
// Packages exported: none
|
||||
ModuleDescriptor descriptor_m1 =
|
||||
ModuleDescriptor.module("m1")
|
||||
ModuleDescriptor descriptor_m1x =
|
||||
ModuleDescriptor.newModule("m1x")
|
||||
.requires("java.base")
|
||||
.requires("m2")
|
||||
.requires("m2x")
|
||||
.build();
|
||||
|
||||
// Define module: m2
|
||||
// Define module: m2x
|
||||
// Can read: java.base
|
||||
// Packages: p2
|
||||
// Packages exported: none
|
||||
ModuleDescriptor descriptor_m2 =
|
||||
ModuleDescriptor.module("m2")
|
||||
ModuleDescriptor descriptor_m2x =
|
||||
ModuleDescriptor.newModule("m2x")
|
||||
.requires("java.base")
|
||||
.exports("p2", Set.of("m1"))
|
||||
.exports("p2", Set.of("m1x"))
|
||||
.build();
|
||||
|
||||
// Set up a ModuleFinder containing all modules for this layer.
|
||||
ModuleFinder finder = ModuleLibrary.of(descriptor_m1, descriptor_m2);
|
||||
ModuleFinder finder = ModuleLibrary.of(descriptor_m1x, descriptor_m2x);
|
||||
|
||||
// Resolves "m1"
|
||||
// Resolves "m1x"
|
||||
Configuration cf = Layer.boot()
|
||||
.configuration()
|
||||
.resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
|
||||
.resolve(finder, ModuleFinder.of(), Set.of("m1x"));
|
||||
|
||||
// map each module to differing class loaders for this test
|
||||
Map<String, ClassLoader> map = new HashMap<>();
|
||||
map.put("m1", MyDiffClassLoader.loader1);
|
||||
map.put("m2", MyDiffClassLoader.loader2);
|
||||
map.put("m1x", MyDiffClassLoader.loader1);
|
||||
map.put("m2x", MyDiffClassLoader.loader2);
|
||||
|
||||
// Create Layer that contains m1 & m2
|
||||
// Create Layer that contains m1x & m2x
|
||||
Layer layer = Layer.boot().defineModules(cf, map::get);
|
||||
|
||||
assertTrue(layer.findLoader("m1") == MyDiffClassLoader.loader1);
|
||||
assertTrue(layer.findLoader("m2") == MyDiffClassLoader.loader2);
|
||||
assertTrue(layer.findLoader("m1x") == MyDiffClassLoader.loader1);
|
||||
assertTrue(layer.findLoader("m2x") == MyDiffClassLoader.loader2);
|
||||
assertTrue(layer.findLoader("java.base") == null);
|
||||
|
||||
// now use the same loader to load class p1.c1
|
||||
// NOTE: module m1 does not define a package named p1.
|
||||
// NOTE: module m1x does not define a package named p1.
|
||||
// p1 will be loaded in an unnamed module.
|
||||
Class p1_c1_class = MyDiffClassLoader.loader1.loadClass("p1.c1");
|
||||
try {
|
||||
p1_c1_class.newInstance();
|
||||
throw new RuntimeException("Failed to get IAE (p2 in m2 is exported to m1, not unqualifiedly");
|
||||
throw new RuntimeException("Failed to get IAE (p2 in m2x is exported to m1x, not unqualifiedly");
|
||||
} catch (IllegalAccessError e) {
|
||||
System.out.println(e.getMessage());
|
||||
if (!e.getMessage().contains("does not export")) {
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2016, 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
|
||||
@ -25,8 +25,8 @@
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @summary class p1.c1 defined in an unnamed module tries to access p2.c2 defined in m2.
|
||||
* Access allowed, an unnamed module can read all modules and p2 in module m2
|
||||
* @summary class p1.c1 defined in an unnamed module tries to access p2.c2 defined in m2x.
|
||||
* Access allowed, an unnamed module can read all modules and p2 in module m2x
|
||||
* which is exported unqualifiedly.
|
||||
* @modules java.base/jdk.internal.misc
|
||||
* @library /test/lib
|
||||
@ -48,15 +48,15 @@ import java.util.Set;
|
||||
import myloaders.MyDiffClassLoader;
|
||||
|
||||
//
|
||||
// ClassLoader1 --> defines m1 --> no packages
|
||||
// ClassLoader2 --> defines m2 --> packages p2
|
||||
// ClassLoader1 --> defines m1x --> no packages
|
||||
// ClassLoader2 --> defines m2x --> packages p2
|
||||
//
|
||||
// m1 can read m2
|
||||
// package p2 in m2 is exported unqualifiedly.
|
||||
// m1x can read m2x
|
||||
// package p2 in m2x is exported unqualifiedly.
|
||||
//
|
||||
// class p1.c1 defined in an unnamed module tries to access p2.c2 defined in m2
|
||||
// class p1.c1 defined in an unnamed module tries to access p2.c2 defined in m2x
|
||||
// Access allowed, an unnamed module can read all modules and p2 in module
|
||||
// m2 which is exported unqualifiedly.
|
||||
// m2x which is exported unqualifiedly.
|
||||
//
|
||||
public class UmodDiffCL_ExpUnqual {
|
||||
|
||||
@ -65,53 +65,53 @@ public class UmodDiffCL_ExpUnqual {
|
||||
// publically defined classes within packages of those modules.
|
||||
public void createLayerOnBoot() throws Throwable {
|
||||
|
||||
// Define module: m1
|
||||
// Can read: java.base, m2
|
||||
// Define module: m1x
|
||||
// Can read: java.base, m2x
|
||||
// Packages: none
|
||||
// Packages exported: none
|
||||
ModuleDescriptor descriptor_m1 =
|
||||
ModuleDescriptor.module("m1")
|
||||
ModuleDescriptor descriptor_m1x =
|
||||
ModuleDescriptor.newModule("m1x")
|
||||
.requires("java.base")
|
||||
.requires("m2")
|
||||
.requires("m2x")
|
||||
.build();
|
||||
|
||||
// Define module: m2
|
||||
// Define module: m2x
|
||||
// Can read: java.base
|
||||
// Packages: p2
|
||||
// Packages exported: none
|
||||
ModuleDescriptor descriptor_m2 =
|
||||
ModuleDescriptor.module("m2")
|
||||
ModuleDescriptor descriptor_m2x =
|
||||
ModuleDescriptor.newModule("m2x")
|
||||
.requires("java.base")
|
||||
.exports("p2")
|
||||
.build();
|
||||
|
||||
// Set up a ModuleFinder containing all modules for this layer.
|
||||
ModuleFinder finder = ModuleLibrary.of(descriptor_m1, descriptor_m2);
|
||||
ModuleFinder finder = ModuleLibrary.of(descriptor_m1x, descriptor_m2x);
|
||||
|
||||
// Resolves "m1"
|
||||
// Resolves "m1x"
|
||||
Configuration cf = Layer.boot()
|
||||
.configuration()
|
||||
.resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
|
||||
.resolve(finder, ModuleFinder.of(), Set.of("m1x"));
|
||||
|
||||
// map each module to differing class loaders for this test
|
||||
Map<String, ClassLoader> map = new HashMap<>();
|
||||
map.put("m1", MyDiffClassLoader.loader1);
|
||||
map.put("m2", MyDiffClassLoader.loader2);
|
||||
map.put("m1x", MyDiffClassLoader.loader1);
|
||||
map.put("m2x", MyDiffClassLoader.loader2);
|
||||
|
||||
// Create Layer that contains m1 & m2
|
||||
// Create Layer that contains m1x & m2x
|
||||
Layer layer = Layer.boot().defineModules(cf, map::get);
|
||||
|
||||
assertTrue(layer.findLoader("m1") == MyDiffClassLoader.loader1);
|
||||
assertTrue(layer.findLoader("m2") == MyDiffClassLoader.loader2);
|
||||
assertTrue(layer.findLoader("m1x") == MyDiffClassLoader.loader1);
|
||||
assertTrue(layer.findLoader("m2x") == MyDiffClassLoader.loader2);
|
||||
assertTrue(layer.findLoader("java.base") == null);
|
||||
|
||||
// NOTE: module m1 does not define a package named p1.
|
||||
// NOTE: module m1x does not define a package named p1.
|
||||
// p1 will be loaded in an unnamed module.
|
||||
Class p1_c1_class = MyDiffClassLoader.loader1.loadClass("p1.c1");
|
||||
try {
|
||||
p1_c1_class.newInstance();
|
||||
} catch (IllegalAccessError e) {
|
||||
throw new RuntimeException("Test Failed, p1.c1 defined in unnamed module can access p2.c2 in module m2");
|
||||
throw new RuntimeException("Test Failed, p1.c1 defined in unnamed module can access p2.c2 in module m2x");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2016, 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
|
||||
@ -25,9 +25,9 @@
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @summary class p1.c1 defined in unnamed module tries to access p2.c2 defined in m2.
|
||||
* @summary class p1.c1 defined in unnamed module tries to access p2.c2 defined in m2x.
|
||||
* Access is denied since even though unnamed module can read all modules, p2
|
||||
* in module m2 is not exported at all.
|
||||
* in module m2x is not exported at all.
|
||||
* @modules java.base/jdk.internal.misc
|
||||
* @library /test/lib
|
||||
* @compile myloaders/MyDiffClassLoader.java
|
||||
@ -47,15 +47,15 @@ import java.util.Set;
|
||||
import myloaders.MyDiffClassLoader;
|
||||
|
||||
//
|
||||
// ClassLoader1 --> defines m1 --> no packages
|
||||
// ClassLoader2 --> defines m2 --> packages p2
|
||||
// ClassLoader1 --> defines m1x --> no packages
|
||||
// ClassLoader2 --> defines m2x --> packages p2
|
||||
//
|
||||
// m1 can read m2
|
||||
// package p2 in m2 is not exported
|
||||
// m1x can read m2x
|
||||
// package p2 in m2x is not exported
|
||||
//
|
||||
// class p1.c1 defined in unnamed module tries to access p2.c2 defined in m2
|
||||
// class p1.c1 defined in unnamed module tries to access p2.c2 defined in m2x
|
||||
// Access denied since even though unnamed module can read all modules, p2
|
||||
// in module m2 is not exported at all.
|
||||
// in module m2x is not exported at all.
|
||||
//
|
||||
public class UmodDiffCL_PkgNotExp {
|
||||
|
||||
@ -64,53 +64,53 @@ public class UmodDiffCL_PkgNotExp {
|
||||
// publically defined classes within packages of those modules.
|
||||
public void createLayerOnBoot() throws Throwable {
|
||||
|
||||
// Define module: m1
|
||||
// Can read: java.base, m2
|
||||
// Define module: m1x
|
||||
// Can read: java.base, m2x
|
||||
// Packages: none
|
||||
// Packages exported: none
|
||||
ModuleDescriptor descriptor_m1 =
|
||||
ModuleDescriptor.module("m1")
|
||||
ModuleDescriptor descriptor_m1x =
|
||||
ModuleDescriptor.newModule("m1x")
|
||||
.requires("java.base")
|
||||
.requires("m2")
|
||||
.requires("m2x")
|
||||
.build();
|
||||
|
||||
// Define module: m2
|
||||
// Define module: m2x
|
||||
// Can read: java.base
|
||||
// Packages: p2
|
||||
// Packages exported: none
|
||||
ModuleDescriptor descriptor_m2 =
|
||||
ModuleDescriptor.module("m2")
|
||||
ModuleDescriptor descriptor_m2x =
|
||||
ModuleDescriptor.newModule("m2x")
|
||||
.requires("java.base")
|
||||
.contains("p2")
|
||||
.packages(Set.of("p2"))
|
||||
.build();
|
||||
|
||||
// Set up a ModuleFinder containing all modules for this layer.
|
||||
ModuleFinder finder = ModuleLibrary.of(descriptor_m1, descriptor_m2);
|
||||
ModuleFinder finder = ModuleLibrary.of(descriptor_m1x, descriptor_m2x);
|
||||
|
||||
// Resolves "m1"
|
||||
// Resolves "m1x"
|
||||
Configuration cf = Layer.boot()
|
||||
.configuration()
|
||||
.resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
|
||||
.resolve(finder, ModuleFinder.of(), Set.of("m1x"));
|
||||
|
||||
// map each module to differing class loaders for this test
|
||||
Map<String, ClassLoader> map = new HashMap<>();
|
||||
map.put("m1", MyDiffClassLoader.loader1);
|
||||
map.put("m2", MyDiffClassLoader.loader2);
|
||||
map.put("m1x", MyDiffClassLoader.loader1);
|
||||
map.put("m2x", MyDiffClassLoader.loader2);
|
||||
|
||||
// Create Layer that contains m1 & m2
|
||||
// Create Layer that contains m1x & m2x
|
||||
Layer layer = Layer.boot().defineModules(cf, map::get);
|
||||
|
||||
assertTrue(layer.findLoader("m1") == MyDiffClassLoader.loader1);
|
||||
assertTrue(layer.findLoader("m2") == MyDiffClassLoader.loader2);
|
||||
assertTrue(layer.findLoader("m1x") == MyDiffClassLoader.loader1);
|
||||
assertTrue(layer.findLoader("m2x") == MyDiffClassLoader.loader2);
|
||||
assertTrue(layer.findLoader("java.base") == null);
|
||||
|
||||
// now use the same loader to load class p1.c1
|
||||
// NOTE: module m1 does not define a package named p1.
|
||||
// NOTE: module m1x does not define a package named p1.
|
||||
// p1 will be loaded in an unnamed module.
|
||||
Class p1_c1_class = MyDiffClassLoader.loader1.loadClass("p1.c1");
|
||||
try {
|
||||
p1_c1_class.newInstance();
|
||||
throw new RuntimeException("Failed to get IAE (p2 in m2 is not exported to an unnamed module)");
|
||||
throw new RuntimeException("Failed to get IAE (p2 in m2x is not exported to an unnamed module)");
|
||||
} catch (IllegalAccessError e) {
|
||||
System.out.println(e.getMessage());
|
||||
if (!e.getMessage().contains("does not export")) {
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2016, 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
|
||||
@ -25,7 +25,7 @@
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @summary class p3.c3 defined in module m1 tries to access c4 defined in unnamed module.
|
||||
* @summary class p3.c3 defined in module m1x tries to access c4 defined in unnamed module.
|
||||
* @modules java.base/jdk.internal.misc
|
||||
* @library /test/lib
|
||||
* @compile myloaders/MySameClassLoader.java
|
||||
@ -48,10 +48,10 @@ import java.util.Set;
|
||||
import myloaders.MySameClassLoader;
|
||||
|
||||
//
|
||||
// ClassLoader1 --> defines m1 --> packages p3
|
||||
// package p3 in m1 is exported unqualifiedly
|
||||
// ClassLoader1 --> defines m1x --> packages p3
|
||||
// package p3 in m1x is exported unqualifiedly
|
||||
//
|
||||
// class p3.c3 defined in m1 tries to access c4 defined in
|
||||
// class p3.c3 defined in m1x tries to access c4 defined in
|
||||
// in unnamed module.
|
||||
//
|
||||
// Two access attempts occur in this test:
|
||||
@ -66,38 +66,38 @@ public class UmodUPkg {
|
||||
// Create Layers over the boot layer to test different
|
||||
// accessing scenarios of a named module to an unnamed module.
|
||||
|
||||
// Module m1 is a strict module and has not established
|
||||
// Module m1x is a strict module and has not established
|
||||
// readability to an unnamed module that c4 is defined in.
|
||||
public void test_strictModuleLayer() throws Throwable {
|
||||
|
||||
// Define module: m1
|
||||
// Define module: m1x
|
||||
// Can read: java.base
|
||||
// Packages: p3
|
||||
// Packages exported: p3 is exported unqualifiedly
|
||||
ModuleDescriptor descriptor_m1 =
|
||||
ModuleDescriptor.module("m1")
|
||||
ModuleDescriptor descriptor_m1x =
|
||||
ModuleDescriptor.newModule("m1x")
|
||||
.requires("java.base")
|
||||
.exports("p3")
|
||||
.build();
|
||||
|
||||
// Set up a ModuleFinder containing all modules for this layer.
|
||||
ModuleFinder finder = ModuleLibrary.of(descriptor_m1);
|
||||
ModuleFinder finder = ModuleLibrary.of(descriptor_m1x);
|
||||
|
||||
// Resolves "m1"
|
||||
// Resolves "m1x"
|
||||
Configuration cf = Layer.boot()
|
||||
.configuration()
|
||||
.resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
|
||||
.resolve(finder, ModuleFinder.of(), Set.of("m1x"));
|
||||
|
||||
// map module m1 to class loader.
|
||||
// map module m1x to class loader.
|
||||
// class c4 will be loaded in an unnamed module/loader.
|
||||
MySameClassLoader loader = new MySameClassLoader();
|
||||
Map<String, ClassLoader> map = new HashMap<>();
|
||||
map.put("m1", loader);
|
||||
map.put("m1x", loader);
|
||||
|
||||
// Create Layer that contains m1
|
||||
// Create Layer that contains m1x
|
||||
Layer layer = Layer.boot().defineModules(cf, map::get);
|
||||
|
||||
assertTrue(layer.findLoader("m1") == loader);
|
||||
assertTrue(layer.findLoader("m1x") == loader);
|
||||
assertTrue(layer.findLoader("java.base") == null);
|
||||
|
||||
// now use the same loader to load class p3.c3
|
||||
@ -106,55 +106,55 @@ public class UmodUPkg {
|
||||
// Attempt access
|
||||
try {
|
||||
p3_c3_class.newInstance();
|
||||
throw new RuntimeException("Test Failed, strict module m1, type p3.c3, should not be able to access " +
|
||||
throw new RuntimeException("Test Failed, strict module m1x, type p3.c3, should not be able to access " +
|
||||
"public type c4 defined in unnamed module");
|
||||
} catch (IllegalAccessError e) {
|
||||
}
|
||||
}
|
||||
|
||||
// Module m1 is a strict module and has established
|
||||
// Module m1x is a strict module and has established
|
||||
// readability to an unnamed module that c4 is defined in.
|
||||
public void test_strictModuleUnnamedReadableLayer() throws Throwable {
|
||||
|
||||
// Define module: m1
|
||||
// Define module: m1x
|
||||
// Can read: java.base
|
||||
// Packages: p3
|
||||
// Packages exported: p3 is exported unqualifiedly
|
||||
ModuleDescriptor descriptor_m1 =
|
||||
ModuleDescriptor.module("m1")
|
||||
ModuleDescriptor descriptor_m1x =
|
||||
ModuleDescriptor.newModule("m1x")
|
||||
.requires("java.base")
|
||||
.exports("p3")
|
||||
.build();
|
||||
|
||||
// Set up a ModuleFinder containing all modules for this layer.
|
||||
ModuleFinder finder = ModuleLibrary.of(descriptor_m1);
|
||||
ModuleFinder finder = ModuleLibrary.of(descriptor_m1x);
|
||||
|
||||
// Resolves "m1"
|
||||
// Resolves "m1x"
|
||||
Configuration cf = Layer.boot()
|
||||
.configuration()
|
||||
.resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
|
||||
.resolve(finder, ModuleFinder.of(), Set.of("m1x"));
|
||||
|
||||
MySameClassLoader loader = new MySameClassLoader();
|
||||
// map module m1 to class loader.
|
||||
// map module m1x to class loader.
|
||||
// class c4 will be loaded in an unnamed module/loader.
|
||||
Map<String, ClassLoader> map = new HashMap<>();
|
||||
map.put("m1", loader);
|
||||
map.put("m1x", loader);
|
||||
|
||||
// Create Layer that contains m1
|
||||
// Create Layer that contains m1x
|
||||
Layer layer = Layer.boot().defineModules(cf, map::get);
|
||||
|
||||
assertTrue(layer.findLoader("m1") == loader);
|
||||
assertTrue(layer.findLoader("m1x") == loader);
|
||||
assertTrue(layer.findLoader("java.base") == null);
|
||||
|
||||
// now use the same loader to load class p3.c3ReadEdge
|
||||
Class p3_c3_class = loader.loadClass("p3.c3ReadEdge");
|
||||
|
||||
try {
|
||||
// Read edge between m1 and the unnamed module that loads c4 is established in
|
||||
// Read edge between m1x and the unnamed module that loads c4 is established in
|
||||
// c3ReadEdge's ctor before attempting access.
|
||||
p3_c3_class.newInstance();
|
||||
} catch (IllegalAccessError e) {
|
||||
throw new RuntimeException("Test Failed, module m1, type p3.c3ReadEdge, has established readability to " +
|
||||
throw new RuntimeException("Test Failed, module m1x, type p3.c3ReadEdge, has established readability to " +
|
||||
"c4 loader's unnamed module, access should be allowed: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2016, 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
|
||||
@ -25,9 +25,9 @@
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @summary class c5 defined in an unnamed module tries to access p6.c6 defined in m2.
|
||||
* @summary class c5 defined in an unnamed module tries to access p6.c6 defined in m2x.
|
||||
* Access is denied, since an unnamed module can read all modules but p6 in module
|
||||
* m2 is exported specifically to module m1, not to all modules.
|
||||
* m2x is exported specifically to module m1x, not to all modules.
|
||||
* @modules java.base/jdk.internal.misc
|
||||
* @library /test/lib
|
||||
* @compile myloaders/MyDiffClassLoader.java
|
||||
@ -48,15 +48,15 @@ import java.util.Set;
|
||||
import myloaders.MyDiffClassLoader;
|
||||
|
||||
//
|
||||
// ClassLoader1 --> defines m1 --> no packages
|
||||
// ClassLoader2 --> defines m2 --> packages p6
|
||||
// ClassLoader1 --> defines m1x --> no packages
|
||||
// ClassLoader2 --> defines m2x --> packages p6
|
||||
//
|
||||
// m1 can read m2
|
||||
// package p6 in m2 is not exported
|
||||
// m1x can read m2x
|
||||
// package p6 in m2x is not exported
|
||||
//
|
||||
// class c5 defined in an unnamed module tries to access p6.c6 defined in m2
|
||||
// class c5 defined in an unnamed module tries to access p6.c6 defined in m2x
|
||||
// Access denied, an unnamed module can read all modules but p6 in module
|
||||
// m2 is exported specifically to module m1 not to all modules.
|
||||
// m2x is exported specifically to module m1x not to all modules.
|
||||
//
|
||||
public class UmodUpkgDiffCL_ExpQualOther {
|
||||
|
||||
@ -65,51 +65,51 @@ public class UmodUpkgDiffCL_ExpQualOther {
|
||||
// publically defined classes within packages of those modules.
|
||||
public void createLayerOnBoot() throws Throwable {
|
||||
|
||||
// Define module: m1
|
||||
// Can read: java.base, m2
|
||||
// Define module: m1x
|
||||
// Can read: java.base, m2x
|
||||
// Packages: none
|
||||
// Packages exported: none
|
||||
ModuleDescriptor descriptor_m1 =
|
||||
ModuleDescriptor.module("m1")
|
||||
ModuleDescriptor descriptor_m1x =
|
||||
ModuleDescriptor.newModule("m1x")
|
||||
.requires("java.base")
|
||||
.requires("m2")
|
||||
.requires("m2x")
|
||||
.build();
|
||||
|
||||
// Define module: m2
|
||||
// Define module: m2x
|
||||
// Can read: java.base
|
||||
// Packages: p6
|
||||
// Packages exported: p6 exported to m1
|
||||
ModuleDescriptor descriptor_m2 =
|
||||
ModuleDescriptor.module("m2")
|
||||
// Packages exported: p6 exported to m1x
|
||||
ModuleDescriptor descriptor_m2x =
|
||||
ModuleDescriptor.newModule("m2x")
|
||||
.requires("java.base")
|
||||
.exports("p6", Set.of("m1"))
|
||||
.exports("p6", Set.of("m1x"))
|
||||
.build();
|
||||
|
||||
// Set up a ModuleFinder containing all modules for this layer.
|
||||
ModuleFinder finder = ModuleLibrary.of(descriptor_m1, descriptor_m2);
|
||||
ModuleFinder finder = ModuleLibrary.of(descriptor_m1x, descriptor_m2x);
|
||||
|
||||
// Resolves "m1"
|
||||
// Resolves "m1x"
|
||||
Configuration cf = Layer.boot()
|
||||
.configuration()
|
||||
.resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
|
||||
.resolve(finder, ModuleFinder.of(), Set.of("m1x"));
|
||||
|
||||
// map each module to differing class loaders for this test
|
||||
Map<String, ClassLoader> map = new HashMap<>();
|
||||
map.put("m1", MyDiffClassLoader.loader1);
|
||||
map.put("m2", MyDiffClassLoader.loader2);
|
||||
map.put("m1x", MyDiffClassLoader.loader1);
|
||||
map.put("m2x", MyDiffClassLoader.loader2);
|
||||
|
||||
// Create Layer that contains m1 & m2
|
||||
// Create Layer that contains m1x & m2x
|
||||
Layer layer = Layer.boot().defineModules(cf, map::get);
|
||||
|
||||
assertTrue(layer.findLoader("m1") == MyDiffClassLoader.loader1);
|
||||
assertTrue(layer.findLoader("m2") == MyDiffClassLoader.loader2);
|
||||
assertTrue(layer.findLoader("m1x") == MyDiffClassLoader.loader1);
|
||||
assertTrue(layer.findLoader("m2x") == MyDiffClassLoader.loader2);
|
||||
assertTrue(layer.findLoader("java.base") == null);
|
||||
|
||||
// now use the same loader to load class c5
|
||||
Class c5_class = MyDiffClassLoader.loader1.loadClass("c5");
|
||||
try {
|
||||
c5_class.newInstance();
|
||||
throw new RuntimeException("Failed to get IAE (p6 in m2 is exported to m1, not unqualifiedly");
|
||||
throw new RuntimeException("Failed to get IAE (p6 in m2x is exported to m1x, not unqualifiedly");
|
||||
} catch (IllegalAccessError e) {
|
||||
System.out.println(e.getMessage());
|
||||
if (!e.getMessage().contains("does not export")) {
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2016, 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
|
||||
@ -25,8 +25,8 @@
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @summary class c5 in an unnamed module can read module m2, but package p6 in module m2 is not exported.
|
||||
* Access denied since even though unnamed module can read all modules, p6 in module m2 is not exported at all.
|
||||
* @summary class c5 in an unnamed module can read module m2x, but package p6 in module m2x is not exported.
|
||||
* Access denied since even though unnamed module can read all modules, p6 in module m2x is not exported at all.
|
||||
* @modules java.base/jdk.internal.misc
|
||||
* @library /test/lib
|
||||
* @compile myloaders/MyDiffClassLoader.java
|
||||
@ -47,15 +47,15 @@ import java.util.Set;
|
||||
import myloaders.MyDiffClassLoader;
|
||||
|
||||
//
|
||||
// ClassLoader1 --> defines m1 --> no packages
|
||||
// ClassLoader2 --> defines m2 --> packages p6
|
||||
// ClassLoader1 --> defines m1x --> no packages
|
||||
// ClassLoader2 --> defines m2x --> packages p6
|
||||
//
|
||||
// m1 can read m2
|
||||
// package p6 in m2 is not exported
|
||||
// m1x can read m2x
|
||||
// package p6 in m2x is not exported
|
||||
//
|
||||
// class c5 defined in unnamed module tries to access p6.c6 defined in m2
|
||||
// class c5 defined in unnamed module tries to access p6.c6 defined in m2x
|
||||
// Access denied since even though unnamed module can read all modules, p6
|
||||
// in module m2 is not exported at all.
|
||||
// in module m2x is not exported at all.
|
||||
//
|
||||
public class UmodUpkgDiffCL_NotExp {
|
||||
|
||||
@ -64,53 +64,53 @@ public class UmodUpkgDiffCL_NotExp {
|
||||
// publically defined classes within packages of those modules.
|
||||
public void createLayerOnBoot() throws Throwable {
|
||||
|
||||
// Define module: m1
|
||||
// Can read: java.base, m2
|
||||
// Define module: m1x
|
||||
// Can read: java.base, m2x
|
||||
// Packages: none
|
||||
// Packages exported: none
|
||||
ModuleDescriptor descriptor_m1 =
|
||||
ModuleDescriptor.module("m1")
|
||||
ModuleDescriptor descriptor_m1x =
|
||||
ModuleDescriptor.newModule("m1x")
|
||||
.requires("java.base")
|
||||
.requires("m2")
|
||||
.requires("m2x")
|
||||
.build();
|
||||
|
||||
// Define module: m2
|
||||
// Define module: m2x
|
||||
// Can read: java.base
|
||||
// Packages: p6
|
||||
// Packages exported: none
|
||||
ModuleDescriptor descriptor_m2 =
|
||||
ModuleDescriptor.module("m2")
|
||||
ModuleDescriptor descriptor_m2x =
|
||||
ModuleDescriptor.newModule("m2x")
|
||||
.requires("java.base")
|
||||
.contains("p6")
|
||||
.packages(Set.of("p6"))
|
||||
.build();
|
||||
|
||||
// Set up a ModuleFinder containing all modules for this layer.
|
||||
ModuleFinder finder = ModuleLibrary.of(descriptor_m1, descriptor_m2);
|
||||
ModuleFinder finder = ModuleLibrary.of(descriptor_m1x, descriptor_m2x);
|
||||
|
||||
// Resolves "m1"
|
||||
// Resolves "m1x"
|
||||
Configuration cf = Layer.boot()
|
||||
.configuration()
|
||||
.resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
|
||||
.resolve(finder, ModuleFinder.of(), Set.of("m1x"));
|
||||
|
||||
// map each module to differing class loaders for this test
|
||||
Map<String, ClassLoader> map = new HashMap<>();
|
||||
map.put("m1", MyDiffClassLoader.loader1);
|
||||
map.put("m2", MyDiffClassLoader.loader2);
|
||||
map.put("m1x", MyDiffClassLoader.loader1);
|
||||
map.put("m2x", MyDiffClassLoader.loader2);
|
||||
|
||||
// Create Layer that contains m1 & m2
|
||||
// Create Layer that contains m1x & m2x
|
||||
Layer layer = Layer.boot().defineModules(cf, map::get);
|
||||
|
||||
assertTrue(layer.findLoader("m1") == MyDiffClassLoader.loader1);
|
||||
assertTrue(layer.findLoader("m2") == MyDiffClassLoader.loader2);
|
||||
assertTrue(layer.findLoader("m1x") == MyDiffClassLoader.loader1);
|
||||
assertTrue(layer.findLoader("m2x") == MyDiffClassLoader.loader2);
|
||||
assertTrue(layer.findLoader("java.base") == null);
|
||||
|
||||
// now use the same loader to load class c5
|
||||
// NOTE: module m1 does not define any packages.
|
||||
// NOTE: module m1x does not define any packages.
|
||||
// c5 will be loaded in an unnamed module.
|
||||
Class c5_class = MyDiffClassLoader.loader1.loadClass("c5");
|
||||
try {
|
||||
c5_class.newInstance();
|
||||
throw new RuntimeException("Failed to get IAE (p6 in m2 is not exported to " +
|
||||
throw new RuntimeException("Failed to get IAE (p6 in m2x is not exported to " +
|
||||
"an unnamed module that c5 is defined within)");
|
||||
} catch (IllegalAccessError e) {
|
||||
System.out.println(e.getMessage());
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2016, 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
|
||||
@ -25,8 +25,8 @@
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @summary Test that if class c5 in an unnamed module can read package p6 in module m2, but package p6 in module m2 is
|
||||
* exported qualifiedly to module m3, then class c5 in an unnamed module can not read p6.c6 in module m2.
|
||||
* @summary Test that if class c5 in an unnamed module can read package p6 in module m2x, but package p6 in module m2x is
|
||||
* exported qualifiedly to module m3x, then class c5 in an unnamed module can not read p6.c6 in module m2x.
|
||||
* @modules java.base/jdk.internal.misc
|
||||
* @library /test/lib
|
||||
* @compile myloaders/MySameClassLoader.java
|
||||
@ -47,15 +47,15 @@ import java.util.Set;
|
||||
import myloaders.MySameClassLoader;
|
||||
|
||||
//
|
||||
// ClassLoader1 --> defines m1 --> no packages
|
||||
// defines m2 --> packages p6
|
||||
// defines m3 --> packages p3
|
||||
// ClassLoader1 --> defines m1x --> no packages
|
||||
// defines m2x --> packages p6
|
||||
// defines m3x --> packages p3
|
||||
//
|
||||
// m1 can read m2
|
||||
// package p6 in m2 is exported to m3
|
||||
// m1x can read m2x
|
||||
// package p6 in m2x is exported to m3x
|
||||
//
|
||||
// class c5 defined in m1 tries to access p6.c6 defined in m2
|
||||
// Access denied since although m1 can read m2, p6 is exported only to m3.
|
||||
// class c5 defined in m1x tries to access p6.c6 defined in m2x
|
||||
// Access denied since although m1x can read m2x, p6 is exported only to m3x.
|
||||
//
|
||||
public class UmodUpkg_ExpQualOther {
|
||||
|
||||
@ -64,63 +64,63 @@ public class UmodUpkg_ExpQualOther {
|
||||
// publically defined classes within packages of those modules.
|
||||
public void createLayerOnBoot() throws Throwable {
|
||||
|
||||
// Define module: m1 (need to define m1 to establish the Layer successfully)
|
||||
// Can read: java.base, m2, m3
|
||||
// Define module: m1x (need to define m1x to establish the Layer successfully)
|
||||
// Can read: java.base, m2x, m3x
|
||||
// Packages: none
|
||||
// Packages exported: none
|
||||
ModuleDescriptor descriptor_m1 =
|
||||
ModuleDescriptor.module("m1")
|
||||
ModuleDescriptor descriptor_m1x =
|
||||
ModuleDescriptor.newModule("m1x")
|
||||
.requires("java.base")
|
||||
.requires("m2")
|
||||
.requires("m3")
|
||||
.requires("m2x")
|
||||
.requires("m3x")
|
||||
.build();
|
||||
|
||||
// Define module: m2
|
||||
// Define module: m2x
|
||||
// Can read: java.base
|
||||
// Packages: p6
|
||||
// Packages exported: p6 is exported to m3
|
||||
ModuleDescriptor descriptor_m2 =
|
||||
ModuleDescriptor.module("m2")
|
||||
// Packages exported: p6 is exported to m3x
|
||||
ModuleDescriptor descriptor_m2x =
|
||||
ModuleDescriptor.newModule("m2x")
|
||||
.requires("java.base")
|
||||
.exports("p6", Set.of("m3"))
|
||||
.exports("p6", Set.of("m3x"))
|
||||
.build();
|
||||
|
||||
// Define module: m3
|
||||
// Define module: m3x
|
||||
// Can read: java.base
|
||||
// Packages: p3
|
||||
// Packages exported: none
|
||||
ModuleDescriptor descriptor_m3 =
|
||||
ModuleDescriptor.module("m3")
|
||||
ModuleDescriptor descriptor_m3x =
|
||||
ModuleDescriptor.newModule("m3x")
|
||||
.requires("java.base")
|
||||
.build();
|
||||
|
||||
// Set up a ModuleFinder containing all modules for this layer.
|
||||
ModuleFinder finder = ModuleLibrary.of(descriptor_m1, descriptor_m2, descriptor_m3);
|
||||
ModuleFinder finder = ModuleLibrary.of(descriptor_m1x, descriptor_m2x, descriptor_m3x);
|
||||
|
||||
// Resolves "m1"
|
||||
// Resolves "m1x"
|
||||
Configuration cf = Layer.boot()
|
||||
.configuration()
|
||||
.resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
|
||||
.resolve(finder, ModuleFinder.of(), Set.of("m1x"));
|
||||
|
||||
// map each module to differing class loaders for this test
|
||||
Map<String, ClassLoader> map = new HashMap<>();
|
||||
map.put("m1", MySameClassLoader.loader1);
|
||||
map.put("m2", MySameClassLoader.loader1);
|
||||
map.put("m3", MySameClassLoader.loader1);
|
||||
map.put("m1x", MySameClassLoader.loader1);
|
||||
map.put("m2x", MySameClassLoader.loader1);
|
||||
map.put("m3x", MySameClassLoader.loader1);
|
||||
|
||||
// Create Layer that contains m1, m2 and m3
|
||||
// Create Layer that contains m1x, m2x and m3x
|
||||
Layer layer = Layer.boot().defineModules(cf, map::get);
|
||||
|
||||
assertTrue(layer.findLoader("m1") == MySameClassLoader.loader1);
|
||||
assertTrue(layer.findLoader("m2") == MySameClassLoader.loader1);
|
||||
assertTrue(layer.findLoader("m3") == MySameClassLoader.loader1);
|
||||
assertTrue(layer.findLoader("m1x") == MySameClassLoader.loader1);
|
||||
assertTrue(layer.findLoader("m2x") == MySameClassLoader.loader1);
|
||||
assertTrue(layer.findLoader("m3x") == MySameClassLoader.loader1);
|
||||
assertTrue(layer.findLoader("java.base") == null);
|
||||
|
||||
// now use the same loader to load class c5
|
||||
Class c5_class = MySameClassLoader.loader1.loadClass("c5");
|
||||
try {
|
||||
c5_class.newInstance();
|
||||
throw new RuntimeException("Failed to get IAE (p6 in m2 is exported to m3, not unqualifiedly to everyone)");
|
||||
throw new RuntimeException("Failed to get IAE (p6 in m2x is exported to m3x, not unqualifiedly to everyone)");
|
||||
} catch (IllegalAccessError e) {
|
||||
System.out.println(e.getMessage());
|
||||
if (!e.getMessage().contains("does not export")) {
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2016, 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
|
||||
@ -25,8 +25,8 @@
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @summary Test if package p6 in module m2 is not exported, then class c5
|
||||
* in an unnamed module can not access p6.c2 in module m2.
|
||||
* @summary Test if package p6 in module m2x is not exported, then class c5
|
||||
* in an unnamed module can not access p6.c2 in module m2x.
|
||||
* @modules java.base/jdk.internal.misc
|
||||
* @library /test/lib
|
||||
* @compile myloaders/MySameClassLoader.java
|
||||
@ -46,13 +46,13 @@ import java.util.Map;
|
||||
import java.util.Set;
|
||||
import myloaders.MySameClassLoader;
|
||||
|
||||
// ClassLoader1 --> defines m1 --> no packages
|
||||
// defines m2 --> packages p6
|
||||
// ClassLoader1 --> defines m1x --> no packages
|
||||
// defines m2x --> packages p6
|
||||
//
|
||||
// m1 can read m2
|
||||
// package p6 in m2 is not exported
|
||||
// m1x can read m2x
|
||||
// package p6 in m2x is not exported
|
||||
//
|
||||
// class c5 defined in an unnamed module tries to access p6.c2 defined in m2
|
||||
// class c5 defined in an unnamed module tries to access p6.c2 defined in m2x
|
||||
// Access denied since p6 is not exported.
|
||||
//
|
||||
public class UmodUpkg_NotExp {
|
||||
@ -62,51 +62,51 @@ public class UmodUpkg_NotExp {
|
||||
// publically defined classes within packages of those modules.
|
||||
public void createLayerOnBoot() throws Throwable {
|
||||
|
||||
// Define module: m1
|
||||
// Can read: java.base, m2
|
||||
// Define module: m1x
|
||||
// Can read: java.base, m2x
|
||||
// Packages: none
|
||||
// Packages exported: none
|
||||
ModuleDescriptor descriptor_m1 =
|
||||
ModuleDescriptor.module("m1")
|
||||
ModuleDescriptor descriptor_m1x =
|
||||
ModuleDescriptor.newModule("m1x")
|
||||
.requires("java.base")
|
||||
.requires("m2")
|
||||
.requires("m2x")
|
||||
.build();
|
||||
|
||||
// Define module: m2
|
||||
// Define module: m2x
|
||||
// Can read: java.base
|
||||
// Packages: p6
|
||||
// Packages exported: none
|
||||
ModuleDescriptor descriptor_m2 =
|
||||
ModuleDescriptor.module("m2")
|
||||
ModuleDescriptor descriptor_m2x =
|
||||
ModuleDescriptor.newModule("m2x")
|
||||
.requires("java.base")
|
||||
.contains("p6")
|
||||
.packages(Set.of("p6"))
|
||||
.build();
|
||||
|
||||
// Set up a ModuleFinder containing all modules for this layer.
|
||||
ModuleFinder finder = ModuleLibrary.of(descriptor_m1, descriptor_m2);
|
||||
ModuleFinder finder = ModuleLibrary.of(descriptor_m1x, descriptor_m2x);
|
||||
|
||||
// Resolves "m1"
|
||||
// Resolves "m1x"
|
||||
Configuration cf = Layer.boot()
|
||||
.configuration()
|
||||
.resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
|
||||
.resolve(finder, ModuleFinder.of(), Set.of("m1x"));
|
||||
|
||||
// map each module to the same class loader for this test
|
||||
Map<String, ClassLoader> map = new HashMap<>();
|
||||
map.put("m1", MySameClassLoader.loader1);
|
||||
map.put("m2", MySameClassLoader.loader1);
|
||||
map.put("m1x", MySameClassLoader.loader1);
|
||||
map.put("m2x", MySameClassLoader.loader1);
|
||||
|
||||
// Create Layer that contains m1 and m2
|
||||
// Create Layer that contains m1x and m2x
|
||||
Layer layer = Layer.boot().defineModules(cf, map::get);
|
||||
|
||||
assertTrue(layer.findLoader("m1") == MySameClassLoader.loader1);
|
||||
assertTrue(layer.findLoader("m2") == MySameClassLoader.loader1);
|
||||
assertTrue(layer.findLoader("m1x") == MySameClassLoader.loader1);
|
||||
assertTrue(layer.findLoader("m2x") == MySameClassLoader.loader1);
|
||||
assertTrue(layer.findLoader("java.base") == null);
|
||||
|
||||
// now use the same loader to load class c5
|
||||
Class c5_class = MySameClassLoader.loader1.loadClass("c5");
|
||||
try {
|
||||
c5_class.newInstance();
|
||||
throw new RuntimeException("Failed to get IAE (p6 in m2 is not exported)");
|
||||
throw new RuntimeException("Failed to get IAE (p6 in m2x is not exported)");
|
||||
} catch (IllegalAccessError e) {
|
||||
System.out.println(e.getMessage());
|
||||
if (!e.getMessage().contains("does not export")) {
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2016, 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
|
||||
@ -25,8 +25,8 @@
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @summary Test that if package p2 in module m2 is exported to module m3,
|
||||
* then class p1.c1 in an unnamed module can not read p2.c2 in module m2.
|
||||
* @summary Test that if package p2 in module m2x is exported to module m3x,
|
||||
* then class p1.c1 in an unnamed module can not read p2.c2 in module m2x.
|
||||
* @modules java.base/jdk.internal.misc
|
||||
* @library /test/lib
|
||||
* @compile myloaders/MySameClassLoader.java
|
||||
@ -47,15 +47,15 @@ import java.util.Set;
|
||||
import myloaders.MySameClassLoader;
|
||||
|
||||
//
|
||||
// ClassLoader1 --> defines m1 --> no packages
|
||||
// defines m2 --> packages p2
|
||||
// defines m3 --> packages p3
|
||||
// ClassLoader1 --> defines m1x --> no packages
|
||||
// defines m2x --> packages p2
|
||||
// defines m3x --> packages p3
|
||||
//
|
||||
// m1 can read m2
|
||||
// package p2 in m2 is exported to m3
|
||||
// m1x can read m2x
|
||||
// package p2 in m2x is exported to m3x
|
||||
//
|
||||
// class p1.c1 defined in m1 tries to access p2.c2 defined in m2
|
||||
// Access denied since although m1 can read m2, p2 is exported only to m3.
|
||||
// class p1.c1 defined in m1x tries to access p2.c2 defined in m2x
|
||||
// Access denied since although m1x can read m2x, p2 is exported only to m3x.
|
||||
//
|
||||
public class Umod_ExpQualOther {
|
||||
|
||||
@ -64,63 +64,63 @@ public class Umod_ExpQualOther {
|
||||
// publically defined classes within packages of those modules.
|
||||
public void createLayerOnBoot() throws Throwable {
|
||||
|
||||
// Define module: m1 (need to define m1 to establish the Layer successfully)
|
||||
// Can read: java.base, m2, m3
|
||||
// Define module: m1x (need to define m1x to establish the Layer successfully)
|
||||
// Can read: java.base, m2x, m3x
|
||||
// Packages: none
|
||||
// Packages exported: none
|
||||
ModuleDescriptor descriptor_m1 =
|
||||
ModuleDescriptor.module("m1")
|
||||
ModuleDescriptor descriptor_m1x =
|
||||
ModuleDescriptor.newModule("m1x")
|
||||
.requires("java.base")
|
||||
.requires("m2")
|
||||
.requires("m3")
|
||||
.requires("m2x")
|
||||
.requires("m3x")
|
||||
.build();
|
||||
|
||||
// Define module: m2
|
||||
// Define module: m2x
|
||||
// Can read: java.base
|
||||
// Packages: p2
|
||||
// Packages exported: p2 is exported to m3
|
||||
ModuleDescriptor descriptor_m2 =
|
||||
ModuleDescriptor.module("m2")
|
||||
// Packages exported: p2 is exported to m3x
|
||||
ModuleDescriptor descriptor_m2x =
|
||||
ModuleDescriptor.newModule("m2x")
|
||||
.requires("java.base")
|
||||
.exports("p2", Set.of("m3"))
|
||||
.exports("p2", Set.of("m3x"))
|
||||
.build();
|
||||
|
||||
// Define module: m3
|
||||
// Define module: m3x
|
||||
// Can read: java.base
|
||||
// Packages: p3
|
||||
// Packages exported: none
|
||||
ModuleDescriptor descriptor_m3 =
|
||||
ModuleDescriptor.module("m3")
|
||||
ModuleDescriptor descriptor_m3x =
|
||||
ModuleDescriptor.newModule("m3x")
|
||||
.requires("java.base")
|
||||
.build();
|
||||
|
||||
// Set up a ModuleFinder containing all modules for this layer.
|
||||
ModuleFinder finder = ModuleLibrary.of(descriptor_m1, descriptor_m2, descriptor_m3);
|
||||
ModuleFinder finder = ModuleLibrary.of(descriptor_m1x, descriptor_m2x, descriptor_m3x);
|
||||
|
||||
// Resolves "m1"
|
||||
// Resolves "m1x"
|
||||
Configuration cf = Layer.boot()
|
||||
.configuration()
|
||||
.resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
|
||||
.resolve(finder, ModuleFinder.of(), Set.of("m1x"));
|
||||
|
||||
// map each module to differing class loaders for this test
|
||||
Map<String, ClassLoader> map = new HashMap<>();
|
||||
map.put("m1", MySameClassLoader.loader1);
|
||||
map.put("m2", MySameClassLoader.loader1);
|
||||
map.put("m3", MySameClassLoader.loader1);
|
||||
map.put("m1x", MySameClassLoader.loader1);
|
||||
map.put("m2x", MySameClassLoader.loader1);
|
||||
map.put("m3x", MySameClassLoader.loader1);
|
||||
|
||||
// Create Layer that contains m1, m2 and m3
|
||||
// Create Layer that contains m1x, m2x and m3x
|
||||
Layer layer = Layer.boot().defineModules(cf, map::get);
|
||||
|
||||
assertTrue(layer.findLoader("m1") == MySameClassLoader.loader1);
|
||||
assertTrue(layer.findLoader("m2") == MySameClassLoader.loader1);
|
||||
assertTrue(layer.findLoader("m3") == MySameClassLoader.loader1);
|
||||
assertTrue(layer.findLoader("m1x") == MySameClassLoader.loader1);
|
||||
assertTrue(layer.findLoader("m2x") == MySameClassLoader.loader1);
|
||||
assertTrue(layer.findLoader("m3x") == MySameClassLoader.loader1);
|
||||
assertTrue(layer.findLoader("java.base") == null);
|
||||
|
||||
// now use the same loader to load class p1.c1
|
||||
Class p1_c1_class = MySameClassLoader.loader1.loadClass("p1.c1");
|
||||
try {
|
||||
p1_c1_class.newInstance();
|
||||
throw new RuntimeException("Failed to get IAE (p2 in m2 is exported to m3, not unqualifiedly to everyone)");
|
||||
throw new RuntimeException("Failed to get IAE (p2 in m2x is exported to m3x, not unqualifiedly to everyone)");
|
||||
} catch (IllegalAccessError e) {
|
||||
System.out.println(e.getMessage());
|
||||
if (!e.getMessage().contains("does not export")) {
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2016, 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
|
||||
@ -25,8 +25,8 @@
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @summary Test if package p2 in module m2 is exported unqualifiedly,
|
||||
* then class p1.c1 in an unnamed module can read p2.c2 in module m2.
|
||||
* @summary Test if package p2 in module m2x is exported unqualifiedly,
|
||||
* then class p1.c1 in an unnamed module can read p2.c2 in module m2x.
|
||||
* @modules java.base/jdk.internal.misc
|
||||
* @library /test/lib
|
||||
* @compile myloaders/MySameClassLoader.java
|
||||
@ -47,15 +47,15 @@ import java.util.Set;
|
||||
import myloaders.MySameClassLoader;
|
||||
|
||||
//
|
||||
// ClassLoader1 --> defines m1 --> no packages
|
||||
// defines m2 --> packages p2
|
||||
// ClassLoader1 --> defines m1x --> no packages
|
||||
// defines m2x --> packages p2
|
||||
//
|
||||
// m1 can read m2
|
||||
// package p2 in m2 is exported unqualifiedly
|
||||
// m1x can read m2x
|
||||
// package p2 in m2x is exported unqualifiedly
|
||||
//
|
||||
// class p1.c1 defined in an unnamed module tries to access p2.c2 defined in m2
|
||||
// class p1.c1 defined in an unnamed module tries to access p2.c2 defined in m2x
|
||||
// Access allowed, an unnamed module can read all modules and p2 in module
|
||||
// m2 which is exported unqualifiedly.
|
||||
// m2x which is exported unqualifiedly.
|
||||
|
||||
public class Umod_ExpUnqual {
|
||||
|
||||
@ -64,44 +64,44 @@ public class Umod_ExpUnqual {
|
||||
// publically defined classes within packages of those modules.
|
||||
public void createLayerOnBoot() throws Throwable {
|
||||
|
||||
// Define module: m1
|
||||
// Can read: java.base, m2
|
||||
// Define module: m1x
|
||||
// Can read: java.base, m2x
|
||||
// Packages: none
|
||||
// Packages exported: none
|
||||
ModuleDescriptor descriptor_m1 =
|
||||
ModuleDescriptor.module("m1")
|
||||
ModuleDescriptor descriptor_m1x =
|
||||
ModuleDescriptor.newModule("m1x")
|
||||
.requires("java.base")
|
||||
.requires("m2")
|
||||
.requires("m2x")
|
||||
.build();
|
||||
|
||||
// Define module: m2
|
||||
// Define module: m2x
|
||||
// Can read: java.base
|
||||
// Packages: p2
|
||||
// Packages exported: p2 is exported unqualifiedly
|
||||
ModuleDescriptor descriptor_m2 =
|
||||
ModuleDescriptor.module("m2")
|
||||
ModuleDescriptor descriptor_m2x =
|
||||
ModuleDescriptor.newModule("m2x")
|
||||
.requires("java.base")
|
||||
.exports("p2")
|
||||
.build();
|
||||
|
||||
// Set up a ModuleFinder containing all modules for this layer.
|
||||
ModuleFinder finder = ModuleLibrary.of(descriptor_m1, descriptor_m2);
|
||||
ModuleFinder finder = ModuleLibrary.of(descriptor_m1x, descriptor_m2x);
|
||||
|
||||
// Resolves "m1"
|
||||
// Resolves "m1x"
|
||||
Configuration cf = Layer.boot()
|
||||
.configuration()
|
||||
.resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
|
||||
.resolve(finder, ModuleFinder.of(), Set.of("m1x"));
|
||||
|
||||
// map each module to differing class loaders for this test
|
||||
Map<String, ClassLoader> map = new HashMap<>();
|
||||
map.put("m1", MySameClassLoader.loader1);
|
||||
map.put("m2", MySameClassLoader.loader1);
|
||||
map.put("m1x", MySameClassLoader.loader1);
|
||||
map.put("m2x", MySameClassLoader.loader1);
|
||||
|
||||
// Create Layer that contains m1 & m2
|
||||
// Create Layer that contains m1x & m2x
|
||||
Layer layer = Layer.boot().defineModules(cf, map::get);
|
||||
|
||||
assertTrue(layer.findLoader("m1") == MySameClassLoader.loader1);
|
||||
assertTrue(layer.findLoader("m2") == MySameClassLoader.loader1);
|
||||
assertTrue(layer.findLoader("m1x") == MySameClassLoader.loader1);
|
||||
assertTrue(layer.findLoader("m2x") == MySameClassLoader.loader1);
|
||||
assertTrue(layer.findLoader("java.base") == null);
|
||||
|
||||
// now use the same loader to load class p1.c1
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2016, 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
|
||||
@ -25,8 +25,8 @@
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @summary Test if package p2 in module m2 is not exported, then class p1.c1
|
||||
* in an unnamed module can not access p2.c2 in module m2.
|
||||
* @summary Test if package p2 in module m2x is not exported, then class p1.c1
|
||||
* in an unnamed module can not access p2.c2 in module m2x.
|
||||
* @modules java.base/jdk.internal.misc
|
||||
* @library /test/lib
|
||||
* @compile myloaders/MySameClassLoader.java
|
||||
@ -46,13 +46,13 @@ import java.util.Map;
|
||||
import java.util.Set;
|
||||
import myloaders.MySameClassLoader;
|
||||
|
||||
// ClassLoader1 --> defines m1 --> no packages
|
||||
// defines m2 --> packages p2
|
||||
// ClassLoader1 --> defines m1x --> no packages
|
||||
// defines m2x --> packages p2
|
||||
//
|
||||
// m1 can read m2
|
||||
// package p2 in m2 is not exported
|
||||
// m1x can read m2x
|
||||
// package p2 in m2x is not exported
|
||||
//
|
||||
// class p1.c1 defined in an unnamed module tries to access p2.c2 defined in m2
|
||||
// class p1.c1 defined in an unnamed module tries to access p2.c2 defined in m2x
|
||||
// Access denied since p2 is not exported.
|
||||
//
|
||||
public class Umod_PkgNotExp {
|
||||
@ -62,51 +62,51 @@ public class Umod_PkgNotExp {
|
||||
// publically defined classes within packages of those modules.
|
||||
public void createLayerOnBoot() throws Throwable {
|
||||
|
||||
// Define module: m1
|
||||
// Can read: java.base, m2
|
||||
// Define module: m1x
|
||||
// Can read: java.base, m2x
|
||||
// Packages: none
|
||||
// Packages exported: none
|
||||
ModuleDescriptor descriptor_m1 =
|
||||
ModuleDescriptor.module("m1")
|
||||
ModuleDescriptor descriptor_m1x =
|
||||
ModuleDescriptor.newModule("m1x")
|
||||
.requires("java.base")
|
||||
.requires("m2")
|
||||
.requires("m2x")
|
||||
.build();
|
||||
|
||||
// Define module: m2
|
||||
// Define module: m2x
|
||||
// Can read: java.base
|
||||
// Packages: p2
|
||||
// Packages exported: none
|
||||
ModuleDescriptor descriptor_m2 =
|
||||
ModuleDescriptor.module("m2")
|
||||
ModuleDescriptor descriptor_m2x =
|
||||
ModuleDescriptor.newModule("m2x")
|
||||
.requires("java.base")
|
||||
.contains("p2")
|
||||
.packages(Set.of("p2"))
|
||||
.build();
|
||||
|
||||
// Set up a ModuleFinder containing all modules for this layer.
|
||||
ModuleFinder finder = ModuleLibrary.of(descriptor_m1, descriptor_m2);
|
||||
ModuleFinder finder = ModuleLibrary.of(descriptor_m1x, descriptor_m2x);
|
||||
|
||||
// Resolves "m1"
|
||||
// Resolves "m1x"
|
||||
Configuration cf = Layer.boot()
|
||||
.configuration()
|
||||
.resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
|
||||
.resolve(finder, ModuleFinder.of(), Set.of("m1x"));
|
||||
|
||||
// map each module to the same class loader for this test
|
||||
Map<String, ClassLoader> map = new HashMap<>();
|
||||
map.put("m1", MySameClassLoader.loader1);
|
||||
map.put("m2", MySameClassLoader.loader1);
|
||||
map.put("m1x", MySameClassLoader.loader1);
|
||||
map.put("m2x", MySameClassLoader.loader1);
|
||||
|
||||
// Create Layer that contains m1 and m2
|
||||
// Create Layer that contains m1x and m2x
|
||||
Layer layer = Layer.boot().defineModules(cf, map::get);
|
||||
|
||||
assertTrue(layer.findLoader("m1") == MySameClassLoader.loader1);
|
||||
assertTrue(layer.findLoader("m2") == MySameClassLoader.loader1);
|
||||
assertTrue(layer.findLoader("m1x") == MySameClassLoader.loader1);
|
||||
assertTrue(layer.findLoader("m2x") == MySameClassLoader.loader1);
|
||||
assertTrue(layer.findLoader("java.base") == null);
|
||||
|
||||
// now use the same loader to load class p1.c1
|
||||
Class p1_c1_class = MySameClassLoader.loader1.loadClass("p1.c1");
|
||||
try {
|
||||
p1_c1_class.newInstance();
|
||||
throw new RuntimeException("Failed to get IAE (p2 in m2 is not exported)");
|
||||
throw new RuntimeException("Failed to get IAE (p2 in m2x is not exported)");
|
||||
} catch (IllegalAccessError e) {
|
||||
System.out.println(e.getMessage());
|
||||
if (!e.getMessage().contains("does not export")) {
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2015, 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
|
||||
@ -26,7 +26,7 @@ import p2.c2;
|
||||
|
||||
public class c1Loose {
|
||||
public c1Loose() {
|
||||
// Attempt access - access should succeed since m1 is a loose module
|
||||
// Attempt access - access should succeed since m1x is a loose module
|
||||
p2.c2 c2_obj = new p2.c2();
|
||||
c2_obj.method2();
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2015, 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
|
||||
@ -27,12 +27,12 @@ import p2.c2;
|
||||
|
||||
public class c1ReadEdge {
|
||||
public c1ReadEdge() {
|
||||
// Establish read edge from module m1, where c1ReadEdge is defined,
|
||||
// Establish read edge from module m1x, where c1ReadEdge is defined,
|
||||
// to the unnamed module, where p2.c2 will be defined.
|
||||
Module m1 = c1ReadEdge.class.getModule();
|
||||
Module m1x = c1ReadEdge.class.getModule();
|
||||
ClassLoader loader = c1ReadEdge.class.getClassLoader();
|
||||
Module unnamed_module = loader.getUnnamedModule();
|
||||
m1.addReads(unnamed_module);
|
||||
m1x.addReads(unnamed_module);
|
||||
|
||||
// Attempt access - access should succeed
|
||||
p2.c2 c2_obj = new p2.c2();
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2015, 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
|
||||
@ -28,32 +28,32 @@ import p2.c2;
|
||||
|
||||
public class c1ReadEdgeDiffLoader {
|
||||
public c1ReadEdgeDiffLoader() {
|
||||
// The goal is to establish a read edge between module m1
|
||||
// The goal is to establish a read edge between module m1x
|
||||
// which is the module where p1.c1ReadEdgeDiffLoader is defined,
|
||||
// and the unnamed module that defines p2.c2. This must be
|
||||
// done in 2 steps:
|
||||
//
|
||||
// Step #1: Establish a read edge between m1, where c1ReadEdgeDiffLoader
|
||||
// Step #1: Establish a read edge between m1x, where c1ReadEdgeDiffLoader
|
||||
// is defined, and the System ClassLoader's unnamed module,
|
||||
// where MyDiffClassLoader is defined. This read edge
|
||||
// is needed before we can obtain MyDiffClassLoader.loader2's unnamed module.
|
||||
//
|
||||
// Step #2: Establish a read edge between m1, where c1ReadEdgeDiffLoader
|
||||
// Step #2: Establish a read edge between m1x, where c1ReadEdgeDiffLoader
|
||||
// is defined, and the MyDiffClassLoader.loader2's unnamed module,
|
||||
// where p2.c2 will be defined.
|
||||
|
||||
// Step #1: read edge m1 -> System ClassLoader's unnamed module
|
||||
Module m1 = c1ReadEdgeDiffLoader.class.getModule();
|
||||
// Step #1: read edge m1x -> System ClassLoader's unnamed module
|
||||
Module m1x = c1ReadEdgeDiffLoader.class.getModule();
|
||||
ClassLoader system_loader = ClassLoader.getSystemClassLoader();
|
||||
Module unnamed_module1 = system_loader.getUnnamedModule();
|
||||
m1.addReads(unnamed_module1);
|
||||
Module unnamed_module_one = system_loader.getUnnamedModule();
|
||||
m1x.addReads(unnamed_module_one);
|
||||
|
||||
// Step #2: read edge m1 -> MyDiffClassLoader.loader2's unnamed module
|
||||
// Step #2: read edge m1x -> MyDiffClassLoader.loader2's unnamed module
|
||||
ClassLoader loader2 = MyDiffClassLoader.loader2;
|
||||
Module unnamed_module2 = loader2.getUnnamedModule();
|
||||
m1.addReads(unnamed_module2);
|
||||
Module unnamed_module_two = loader2.getUnnamedModule();
|
||||
m1x.addReads(unnamed_module_two);
|
||||
|
||||
// Attempt access - access should succeed since m1 can read
|
||||
// Attempt access - access should succeed since m1x can read
|
||||
// MyDiffClassLoader.loader2's unnamed module
|
||||
p2.c2 c2_obj = new p2.c2();
|
||||
c2_obj.method2();
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2015, 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
|
||||
@ -26,12 +26,12 @@
|
||||
* import java.lang.reflect.*;
|
||||
* public class c3ReadEdge {
|
||||
* public c3ReadEdge() {
|
||||
* // Establish read edge from module m1, where c3ReadEdge is defined,
|
||||
* // Establish read edge from module m1x, where c3ReadEdge is defined,
|
||||
* // to the unnamed module, where c4 will be defined.
|
||||
* Module m1 = c3ReadEdge.class.getModule();
|
||||
* Module m1x = c3ReadEdge.class.getModule();
|
||||
* ClassLoader loader = c3ReadEdge.class.getClassLoader();
|
||||
* Module unnamed_module = loader.getUnnamedModule();
|
||||
* m1.addReads(unnamed_module);
|
||||
* m1x.addReads(unnamed_module);
|
||||
* // Attempt access - access should succeed
|
||||
* c4 c4_obj = new c4();
|
||||
* c4_obj.method4();
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2015, 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
|
||||
@ -28,32 +28,32 @@
|
||||
*
|
||||
* public class c3ReadEdgeDiffLoader {
|
||||
* public c3ReadEdgeDiffLoader() {
|
||||
* // The goal is to establish a read edge between module m1
|
||||
* // The goal is to establish a read edge between module m1x
|
||||
* // which is the module where p3.c3ReadEdgeDiffLoader is defined,
|
||||
* // and the unnamed module that defines c4. This must be
|
||||
* // done in 2 steps:
|
||||
* //
|
||||
* // Step #1: Establish a read edge between m1, where c3ReadEdgeDiffLoader
|
||||
* // Step #1: Establish a read edge between m1x, where c3ReadEdgeDiffLoader
|
||||
* // is defined, and the System ClassLoader's unnamed module,
|
||||
* // where MyDiffClassLoader is defined. This read edge
|
||||
* // is needed before we can obtain MyDiffClassLoader.loader2's unnamed module.
|
||||
* //
|
||||
* // Step #2: Establish a read edge between m1, where c3ReadEdgeDiffLoader
|
||||
* // Step #2: Establish a read edge between m1x, where c3ReadEdgeDiffLoader
|
||||
* // is defined, and the MyDiffClassLoader.loader2's unnamed module,
|
||||
* // where c4 will be defined.
|
||||
*
|
||||
* // Step #1: read edge m1 -> System ClassLoader's unnamed module
|
||||
* Module m1 = c3ReadEdgeDiffLoader.class.getModule();
|
||||
* // Step #1: read edge m1x -> System ClassLoader's unnamed module
|
||||
* Module m1x = c3ReadEdgeDiffLoader.class.getModule();
|
||||
* ClassLoader system_loader = ClassLoader.getSystemClassLoader();
|
||||
* Module unnamed_module1 = system_loader.getUnnamedModule();
|
||||
* m1.addReads(unnamed_module1);
|
||||
* Module unnamed_module_one = system_loader.getUnnamedModule();
|
||||
* m1x.addReads(unnamed_module_one);
|
||||
*
|
||||
* // Step #2: read edge m1 -> MyDiffClassLoader.loader2's unnamed module
|
||||
* // Step #2: read edge m1x -> MyDiffClassLoader.loader2's unnamed module
|
||||
* ClassLoader loader2 = MyDiffClassLoader.loader2;
|
||||
* Module unnamed_module2 = loader2.getUnnamedModule();
|
||||
* m1.addReads(unnamed_module2);
|
||||
* Module unnamed_module_two = loader2.getUnnamedModule();
|
||||
* m1x.addReads(unnamed_module_two);
|
||||
*
|
||||
* // Attempt access - should succeed since m1 can read
|
||||
* // Attempt access - should succeed since m1x can read
|
||||
* // MyDiffClassLoader.loader2's unnamed module
|
||||
* c4 c4_obj = new c4();
|
||||
* c4_obj.method4();
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2016, 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
|
||||
@ -43,7 +43,7 @@ public class AccessCheckAllUnnamed {
|
||||
// and then test that a class in the unnamed module can access a package in a
|
||||
// named module that has been exported to all unnamed modules.
|
||||
public static void main(String args[]) throws Throwable {
|
||||
Object m1, m2;
|
||||
Object m1x, m2x;
|
||||
|
||||
// Get the java.lang.reflect.Module object for module java.base.
|
||||
Class jlObject = Class.forName("java.lang.Object");
|
||||
@ -55,16 +55,16 @@ public class AccessCheckAllUnnamed {
|
||||
ClassLoader this_cldr = AccessCheckAllUnnamed.class.getClassLoader();
|
||||
|
||||
// Define a module for p3.
|
||||
m1 = ModuleHelper.ModuleObject("module1", this_cldr, new String[] { "p3" });
|
||||
assertNotNull(m1, "Module should not be null");
|
||||
ModuleHelper.DefineModule(m1, "9.0", "m1/there", new String[] { "p3" });
|
||||
ModuleHelper.AddReadsModule(m1, jlObject_jlrM);
|
||||
m1x = ModuleHelper.ModuleObject("module_one", this_cldr, new String[] { "p3" });
|
||||
assertNotNull(m1x, "Module should not be null");
|
||||
ModuleHelper.DefineModule(m1x, "9.0", "m1x/there", new String[] { "p3" });
|
||||
ModuleHelper.AddReadsModule(m1x, jlObject_jlrM);
|
||||
|
||||
// Define a module for p2.
|
||||
m2 = ModuleHelper.ModuleObject("module2", this_cldr, new String[] { "p2" });
|
||||
assertNotNull(m2, "Module should not be null");
|
||||
ModuleHelper.DefineModule(m2, "9.0", "m2/there", new String[] { "p2" });
|
||||
ModuleHelper.AddReadsModule(m2, jlObject_jlrM);
|
||||
m2x = ModuleHelper.ModuleObject("module_two", this_cldr, new String[] { "p2" });
|
||||
assertNotNull(m2x, "Module should not be null");
|
||||
ModuleHelper.DefineModule(m2x, "9.0", "m2x/there", new String[] { "p2" });
|
||||
ModuleHelper.AddReadsModule(m2x, jlObject_jlrM);
|
||||
|
||||
try {
|
||||
ModuleHelper.AddModuleExportsToAllUnnamed((Module)null, "p2");
|
||||
@ -74,7 +74,7 @@ public class AccessCheckAllUnnamed {
|
||||
}
|
||||
|
||||
try {
|
||||
ModuleHelper.AddModuleExportsToAllUnnamed(m2, null);
|
||||
ModuleHelper.AddModuleExportsToAllUnnamed(m2x, null);
|
||||
throw new RuntimeException("Failed to get the expected NPE for null package");
|
||||
} catch(NullPointerException e) {
|
||||
// Expected
|
||||
@ -88,21 +88,21 @@ public class AccessCheckAllUnnamed {
|
||||
}
|
||||
|
||||
try {
|
||||
ModuleHelper.AddModuleExportsToAllUnnamed(m2, "p3");
|
||||
ModuleHelper.AddModuleExportsToAllUnnamed(m2x, "p3");
|
||||
throw new RuntimeException("Failed to get the expected IAE for package in other module");
|
||||
} catch(IllegalArgumentException e) {
|
||||
// Expected
|
||||
}
|
||||
|
||||
try {
|
||||
ModuleHelper.AddModuleExportsToAllUnnamed(m2, "p4");
|
||||
ModuleHelper.AddModuleExportsToAllUnnamed(m2x, "p4");
|
||||
throw new RuntimeException("Failed to get the expected IAE for package not in module");
|
||||
} catch(IllegalArgumentException e) {
|
||||
// Expected
|
||||
}
|
||||
|
||||
// Export package p2 in m2 to allUnnamed.
|
||||
ModuleHelper.AddModuleExportsToAllUnnamed(m2, "p2");
|
||||
// Export package p2 in m2x to allUnnamed.
|
||||
ModuleHelper.AddModuleExportsToAllUnnamed(m2x, "p2");
|
||||
|
||||
// p1.c1's ctor tries to call a method in p2.c2. This should succeed because
|
||||
// p1 is in an unnamed module and p2.c2 is exported to all unnamed modules.
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user