This commit is contained in:
J. Duke 2017-07-05 21:11:59 +02:00
commit 80930473c5
427 changed files with 1265 additions and 989 deletions

View File

@ -342,3 +342,4 @@ cf1dc4c035fb84693d4ae5ad818785cb4d1465d1 jdk9-b90
75c3897541ecb52ee16d001ea605b12971df7303 jdk-9+97 75c3897541ecb52ee16d001ea605b12971df7303 jdk-9+97
48987460c7d49a29013963ee44d090194396bb61 jdk-9+98 48987460c7d49a29013963ee44d090194396bb61 jdk-9+98
7c0577bea4c65d69c5bef67023a89d2efa4fb2f7 jdk-9+99 7c0577bea4c65d69c5bef67023a89d2efa4fb2f7 jdk-9+99
c1f30ac14db0eaff398429c04cd9fab92e1b4b2a jdk-9+100

View File

@ -251,6 +251,24 @@ AC_DEFUN([BPERF_SETUP_CCACHE_USAGE],
fi fi
]) ])
################################################################################
#
# Runs icecc-create-env once and prints the error if it fails
#
# $1: arguments to icecc-create-env
# $2: log file
#
AC_DEFUN([BPERF_RUN_ICECC_CREATE_ENV],
[
cd ${CONFIGURESUPPORT_OUTPUTDIR}/icecc \
&& ${ICECC_CREATE_ENV} $1 > $2 2>&1
if test "$?" != "0"; then
AC_MSG_NOTICE([icecc-create-env output:])
cat $2
AC_MSG_ERROR([Failed to create icecc compiler environment])
fi
])
################################################################################ ################################################################################
# #
# Optionally enable distributed compilation of native code using icecc/icecream # Optionally enable distributed compilation of native code using icecc/icecream
@ -271,16 +289,18 @@ AC_DEFUN([BPERF_SETUP_ICECC],
# be sent to the other hosts in the icecream cluster. # be sent to the other hosts in the icecream cluster.
icecc_create_env_log="${CONFIGURESUPPORT_OUTPUTDIR}/icecc/icecc_create_env.log" icecc_create_env_log="${CONFIGURESUPPORT_OUTPUTDIR}/icecc/icecc_create_env.log"
${MKDIR} -p ${CONFIGURESUPPORT_OUTPUTDIR}/icecc ${MKDIR} -p ${CONFIGURESUPPORT_OUTPUTDIR}/icecc
AC_MSG_CHECKING([for icecc build environment for target compiler]) # Older versions of icecc does not have the --gcc parameter
if ${ICECC_CREATE_ENV} | $GREP -q -e --gcc; then
icecc_gcc_arg="--gcc"
fi
if test "x${TOOLCHAIN_TYPE}" = "xgcc"; then if test "x${TOOLCHAIN_TYPE}" = "xgcc"; then
cd ${CONFIGURESUPPORT_OUTPUTDIR}/icecc \ BPERF_RUN_ICECC_CREATE_ENV([${icecc_gcc_arg} ${CC} ${CXX}], \
&& ${ICECC_CREATE_ENV} --gcc ${CC} ${CXX} > ${icecc_create_env_log} ${icecc_create_env_log})
elif test "x$TOOLCHAIN_TYPE" = "xclang"; then elif test "x$TOOLCHAIN_TYPE" = "xclang"; then
# For clang, the icecc compilerwrapper is needed. It usually resides next # For clang, the icecc compilerwrapper is needed. It usually resides next
# to icecc-create-env. # to icecc-create-env.
BASIC_REQUIRE_PROGS(ICECC_WRAPPER, compilerwrapper) BASIC_REQUIRE_PROGS(ICECC_WRAPPER, compilerwrapper)
cd ${CONFIGURESUPPORT_OUTPUTDIR}/icecc \ BPERF_RUN_ICECC_CREATE_ENV([--clang ${CC} ${ICECC_WRAPPER}], ${icecc_create_env_log})
&& ${ICECC_CREATE_ENV} --clang ${CC} ${ICECC_WRAPPER} > ${icecc_create_env_log}
else else
AC_MSG_ERROR([Can only create icecc compiler packages for toolchain types gcc and clang]) AC_MSG_ERROR([Can only create icecc compiler packages for toolchain types gcc and clang])
fi fi
@ -289,24 +309,31 @@ AC_DEFUN([BPERF_SETUP_ICECC],
# to find it. # to find it.
ICECC_ENV_BUNDLE_BASENAME="`${SED} -n '/^creating/s/creating //p' ${icecc_create_env_log}`" ICECC_ENV_BUNDLE_BASENAME="`${SED} -n '/^creating/s/creating //p' ${icecc_create_env_log}`"
ICECC_ENV_BUNDLE="${CONFIGURESUPPORT_OUTPUTDIR}/icecc/${ICECC_ENV_BUNDLE_BASENAME}" ICECC_ENV_BUNDLE="${CONFIGURESUPPORT_OUTPUTDIR}/icecc/${ICECC_ENV_BUNDLE_BASENAME}"
if test ! -f ${ICECC_ENV_BUNDLE}; then
AC_MSG_ERROR([icecc-create-env did not produce an environment ${ICECC_ENV_BUNDLE}])
fi
AC_MSG_CHECKING([for icecc build environment for target compiler])
AC_MSG_RESULT([${ICECC_ENV_BUNDLE}]) AC_MSG_RESULT([${ICECC_ENV_BUNDLE}])
ICECC="ICECC_VERSION=${ICECC_ENV_BUNDLE} ICECC_CC=${CC} ICECC_CXX=${CXX} ${ICECC_CMD}" ICECC="ICECC_VERSION=${ICECC_ENV_BUNDLE} ICECC_CC=${CC} ICECC_CXX=${CXX} ${ICECC_CMD}"
if test "x${COMPILE_TYPE}" = "xcross"; then if test "x${COMPILE_TYPE}" = "xcross"; then
# If cross compiling, create a separate env package for the build compiler # If cross compiling, create a separate env package for the build compiler
AC_MSG_CHECKING([for icecc build environment for build compiler])
# Assume "gcc" or "cc" is gcc and "clang" is clang. Otherwise bail. # Assume "gcc" or "cc" is gcc and "clang" is clang. Otherwise bail.
icecc_create_env_log_build="${CONFIGURESUPPORT_OUTPUTDIR}/icecc/icecc_create_env_build.log"
if test "x${BUILD_CC##*/}" = "xgcc" || test "x${BUILD_CC##*/}" = "xcc"; then if test "x${BUILD_CC##*/}" = "xgcc" || test "x${BUILD_CC##*/}" = "xcc"; then
cd ${CONFIGURESUPPORT_OUTPUTDIR}/icecc \ BPERF_RUN_ICECC_CREATE_ENV([${icecc_gcc_arg} ${BUILD_CC} ${BUILD_CXX}], \
&& ${ICECC_CREATE_ENV} --gcc ${BUILD_CC} ${BUILD_CXX} > ${icecc_create_env_log} ${icecc_create_env_log_build})
elif test "x${BUILD_CC##*/}" = "xclang"; then elif test "x${BUILD_CC##*/}" = "xclang"; then
cd ${CONFIGURESUPPORT_OUTPUTDIR}/icecc \ BPERF_RUN_ICECC_CREATE_ENV([--clang ${BUILD_CC} ${ICECC_WRAPPER}], ${icecc_create_env_log_build})
&& ${ICECC_CREATE_ENV} --clang ${BUILD_CC} ${ICECC_WRAPPER} > ${icecc_create_env_log}
else else
AC_MSG_ERROR([Cannot create icecc compiler package for ${BUILD_CC}]) AC_MSG_ERROR([Cannot create icecc compiler package for ${BUILD_CC}])
fi fi
ICECC_ENV_BUNDLE_BASENAME="`${SED} -n '/^creating/s/creating //p' ${icecc_create_env_log}`" ICECC_ENV_BUNDLE_BASENAME="`${SED} -n '/^creating/s/creating //p' ${icecc_create_env_log_build}`"
ICECC_ENV_BUNDLE="${CONFIGURESUPPORT_OUTPUTDIR}/icecc/${ICECC_ENV_BUNDLE_BASENAME}" ICECC_ENV_BUNDLE="${CONFIGURESUPPORT_OUTPUTDIR}/icecc/${ICECC_ENV_BUNDLE_BASENAME}"
if test ! -f ${ICECC_ENV_BUNDLE}; then
AC_MSG_ERROR([icecc-create-env did not produce an environment ${ICECC_ENV_BUNDLE}])
fi
AC_MSG_CHECKING([for icecc build environment for build compiler])
AC_MSG_RESULT([${ICECC_ENV_BUNDLE}]) AC_MSG_RESULT([${ICECC_ENV_BUNDLE}])
BUILD_ICECC="ICECC_VERSION=${ICECC_ENV_BUNDLE} ICECC_CC=${BUILD_CC} \ BUILD_ICECC="ICECC_VERSION=${ICECC_ENV_BUNDLE} ICECC_CC=${BUILD_CC} \
ICECC_CXX=${BUILD_CXX} ${ICECC_CMD}" ICECC_CXX=${BUILD_CXX} ${ICECC_CMD}"

View File

@ -128,6 +128,26 @@ AC_DEFUN_ONCE([FLAGS_SETUP_INIT_FLAGS],
else else
COMPILER_TARGET_BITS_FLAG="-m" COMPILER_TARGET_BITS_FLAG="-m"
COMPILER_COMMAND_FILE_FLAG="@" COMPILER_COMMAND_FILE_FLAG="@"
# The solstudio linker does not support @-files.
if test "x$TOOLCHAIN_TYPE" = xsolstudio; then
COMPILER_COMMAND_FILE_FLAG=
fi
# Check if @file is supported by gcc
if test "x$TOOLCHAIN_TYPE" = xgcc; then
AC_MSG_CHECKING([if @file is supported by gcc])
# Extra emtpy "" to prevent ECHO from interpreting '--version' as argument
$ECHO "" "--version" > command.file
if $CXX @command.file 2>&AS_MESSAGE_LOG_FD >&AS_MESSAGE_LOG_FD; then
AC_MSG_RESULT(yes)
COMPILER_COMMAND_FILE_FLAG="@"
else
AC_MSG_RESULT(no)
COMPILER_COMMAND_FILE_FLAG=
fi
rm -rf command.file
fi
fi fi
AC_SUBST(COMPILER_TARGET_BITS_FLAG) AC_SUBST(COMPILER_TARGET_BITS_FLAG)
AC_SUBST(COMPILER_COMMAND_FILE_FLAG) AC_SUBST(COMPILER_COMMAND_FILE_FLAG)

View File

@ -3792,6 +3792,15 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
################################################################################
#
# Runs icecc-create-env once and prints the error if it fails
#
# $1: arguments to icecc-create-env
# $2: log file
#
################################################################################ ################################################################################
# #
# Optionally enable distributed compilation of native code using icecc/icecream # Optionally enable distributed compilation of native code using icecc/icecream
@ -4308,7 +4317,7 @@ pkgadd_help() {
# #
# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -4801,7 +4810,7 @@ VS_SDK_PLATFORM_NAME_2013=
#CUSTOM_AUTOCONF_INCLUDE #CUSTOM_AUTOCONF_INCLUDE
# Do not change or remove the following line, it is needed for consistency checks: # Do not change or remove the following line, it is needed for consistency checks:
DATE_WHEN_GENERATED=1450277321 DATE_WHEN_GENERATED=1452261921
############################################################################### ###############################################################################
# #
@ -45930,6 +45939,29 @@ $as_echo "$tool_specified" >&6; }
else else
COMPILER_TARGET_BITS_FLAG="-m" COMPILER_TARGET_BITS_FLAG="-m"
COMPILER_COMMAND_FILE_FLAG="@" COMPILER_COMMAND_FILE_FLAG="@"
# The solstudio linker does not support @-files.
if test "x$TOOLCHAIN_TYPE" = xsolstudio; then
COMPILER_COMMAND_FILE_FLAG=
fi
# Check if @file is supported by gcc
if test "x$TOOLCHAIN_TYPE" = xgcc; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if @file is supported by gcc" >&5
$as_echo_n "checking if @file is supported by gcc... " >&6; }
# Extra emtpy "" to prevent ECHO from interpreting '--version' as argument
$ECHO "" "--version" > command.file
if $CXX @command.file 2>&5 >&5; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
COMPILER_COMMAND_FILE_FLAG="@"
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
COMPILER_COMMAND_FILE_FLAG=
fi
rm -rf command.file
fi
fi fi
@ -51742,12 +51774,28 @@ $as_echo "$as_me: WARNING: cups not used, so --with-cups[-*] is ignored" >&2;}
fi fi
if test "x${with_cups}" != x; then if test "x${with_cups}" != x; then
CUPS_CFLAGS="-I${with_cups}/include" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cups headers" >&5
CUPS_FOUND=yes $as_echo_n "checking for cups headers... " >&6; }
if test -s "${with_cups}/include/cups/cups.h"; then
CUPS_CFLAGS="-I${with_cups}/include"
CUPS_FOUND=yes
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CUPS_FOUND" >&5
$as_echo "$CUPS_FOUND" >&6; }
else
as_fn_error $? "Can't find 'include/cups/cups.h' under ${with_cups} given with the --with-cups option." "$LINENO" 5
fi
fi fi
if test "x${with_cups_include}" != x; then if test "x${with_cups_include}" != x; then
CUPS_CFLAGS="-I${with_cups_include}" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cups headers" >&5
CUPS_FOUND=yes $as_echo_n "checking for cups headers... " >&6; }
if test -s "${with_cups_include}/cups/cups.h"; then
CUPS_CFLAGS="-I${with_cups_include}"
CUPS_FOUND=yes
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CUPS_FOUND" >&5
$as_echo "$CUPS_FOUND" >&6; }
else
as_fn_error $? "Can't find 'cups/cups.h' under ${with_cups_include} given with the --with-cups-include option." "$LINENO" 5
fi
fi fi
if test "x$CUPS_FOUND" = xno; then if test "x$CUPS_FOUND" = xno; then
# Are the cups headers installed in the default /usr/include location? # Are the cups headers installed in the default /usr/include location?
@ -59543,11 +59591,23 @@ $as_echo "$tool_specified" >&6; }
# be sent to the other hosts in the icecream cluster. # be sent to the other hosts in the icecream cluster.
icecc_create_env_log="${CONFIGURESUPPORT_OUTPUTDIR}/icecc/icecc_create_env.log" icecc_create_env_log="${CONFIGURESUPPORT_OUTPUTDIR}/icecc/icecc_create_env.log"
${MKDIR} -p ${CONFIGURESUPPORT_OUTPUTDIR}/icecc ${MKDIR} -p ${CONFIGURESUPPORT_OUTPUTDIR}/icecc
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for icecc build environment for target compiler" >&5 # Older versions of icecc does not have the --gcc parameter
$as_echo_n "checking for icecc build environment for target compiler... " >&6; } if ${ICECC_CREATE_ENV} | $GREP -q -e --gcc; then
icecc_gcc_arg="--gcc"
fi
if test "x${TOOLCHAIN_TYPE}" = "xgcc"; then if test "x${TOOLCHAIN_TYPE}" = "xgcc"; then
cd ${CONFIGURESUPPORT_OUTPUTDIR}/icecc \
&& ${ICECC_CREATE_ENV} --gcc ${CC} ${CXX} > ${icecc_create_env_log} cd ${CONFIGURESUPPORT_OUTPUTDIR}/icecc \
&& ${ICECC_CREATE_ENV} ${icecc_gcc_arg} ${CC} ${CXX} > \
${icecc_create_env_log} 2>&1
if test "$?" != "0"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: icecc-create-env output:" >&5
$as_echo "$as_me: icecc-create-env output:" >&6;}
cat \
${icecc_create_env_log}
as_fn_error $? "Failed to create icecc compiler environment" "$LINENO" 5
fi
elif test "x$TOOLCHAIN_TYPE" = "xclang"; then elif test "x$TOOLCHAIN_TYPE" = "xclang"; then
# For clang, the icecc compilerwrapper is needed. It usually resides next # For clang, the icecc compilerwrapper is needed. It usually resides next
# to icecc-create-env. # to icecc-create-env.
@ -59755,8 +59815,16 @@ $as_echo "$tool_specified" >&6; }
fi fi
cd ${CONFIGURESUPPORT_OUTPUTDIR}/icecc \
&& ${ICECC_CREATE_ENV} --clang ${CC} ${ICECC_WRAPPER} > ${icecc_create_env_log} cd ${CONFIGURESUPPORT_OUTPUTDIR}/icecc \
&& ${ICECC_CREATE_ENV} --clang ${CC} ${ICECC_WRAPPER} > ${icecc_create_env_log} 2>&1
if test "$?" != "0"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: icecc-create-env output:" >&5
$as_echo "$as_me: icecc-create-env output:" >&6;}
cat ${icecc_create_env_log}
as_fn_error $? "Failed to create icecc compiler environment" "$LINENO" 5
fi
else else
as_fn_error $? "Can only create icecc compiler packages for toolchain types gcc and clang" "$LINENO" 5 as_fn_error $? "Can only create icecc compiler packages for toolchain types gcc and clang" "$LINENO" 5
fi fi
@ -59765,26 +59833,53 @@ $as_echo "$tool_specified" >&6; }
# to find it. # to find it.
ICECC_ENV_BUNDLE_BASENAME="`${SED} -n '/^creating/s/creating //p' ${icecc_create_env_log}`" ICECC_ENV_BUNDLE_BASENAME="`${SED} -n '/^creating/s/creating //p' ${icecc_create_env_log}`"
ICECC_ENV_BUNDLE="${CONFIGURESUPPORT_OUTPUTDIR}/icecc/${ICECC_ENV_BUNDLE_BASENAME}" ICECC_ENV_BUNDLE="${CONFIGURESUPPORT_OUTPUTDIR}/icecc/${ICECC_ENV_BUNDLE_BASENAME}"
if test ! -f ${ICECC_ENV_BUNDLE}; then
as_fn_error $? "icecc-create-env did not produce an environment ${ICECC_ENV_BUNDLE}" "$LINENO" 5
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for icecc build environment for target compiler" >&5
$as_echo_n "checking for icecc build environment for target compiler... " >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${ICECC_ENV_BUNDLE}" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${ICECC_ENV_BUNDLE}" >&5
$as_echo "${ICECC_ENV_BUNDLE}" >&6; } $as_echo "${ICECC_ENV_BUNDLE}" >&6; }
ICECC="ICECC_VERSION=${ICECC_ENV_BUNDLE} ICECC_CC=${CC} ICECC_CXX=${CXX} ${ICECC_CMD}" ICECC="ICECC_VERSION=${ICECC_ENV_BUNDLE} ICECC_CC=${CC} ICECC_CXX=${CXX} ${ICECC_CMD}"
if test "x${COMPILE_TYPE}" = "xcross"; then if test "x${COMPILE_TYPE}" = "xcross"; then
# If cross compiling, create a separate env package for the build compiler # If cross compiling, create a separate env package for the build compiler
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for icecc build environment for build compiler" >&5
$as_echo_n "checking for icecc build environment for build compiler... " >&6; }
# Assume "gcc" or "cc" is gcc and "clang" is clang. Otherwise bail. # Assume "gcc" or "cc" is gcc and "clang" is clang. Otherwise bail.
icecc_create_env_log_build="${CONFIGURESUPPORT_OUTPUTDIR}/icecc/icecc_create_env_build.log"
if test "x${BUILD_CC##*/}" = "xgcc" || test "x${BUILD_CC##*/}" = "xcc"; then if test "x${BUILD_CC##*/}" = "xgcc" || test "x${BUILD_CC##*/}" = "xcc"; then
cd ${CONFIGURESUPPORT_OUTPUTDIR}/icecc \
&& ${ICECC_CREATE_ENV} --gcc ${BUILD_CC} ${BUILD_CXX} > ${icecc_create_env_log} cd ${CONFIGURESUPPORT_OUTPUTDIR}/icecc \
&& ${ICECC_CREATE_ENV} ${icecc_gcc_arg} ${BUILD_CC} ${BUILD_CXX} > \
${icecc_create_env_log_build} 2>&1
if test "$?" != "0"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: icecc-create-env output:" >&5
$as_echo "$as_me: icecc-create-env output:" >&6;}
cat \
${icecc_create_env_log_build}
as_fn_error $? "Failed to create icecc compiler environment" "$LINENO" 5
fi
elif test "x${BUILD_CC##*/}" = "xclang"; then elif test "x${BUILD_CC##*/}" = "xclang"; then
cd ${CONFIGURESUPPORT_OUTPUTDIR}/icecc \
&& ${ICECC_CREATE_ENV} --clang ${BUILD_CC} ${ICECC_WRAPPER} > ${icecc_create_env_log} cd ${CONFIGURESUPPORT_OUTPUTDIR}/icecc \
&& ${ICECC_CREATE_ENV} --clang ${BUILD_CC} ${ICECC_WRAPPER} > ${icecc_create_env_log_build} 2>&1
if test "$?" != "0"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: icecc-create-env output:" >&5
$as_echo "$as_me: icecc-create-env output:" >&6;}
cat ${icecc_create_env_log_build}
as_fn_error $? "Failed to create icecc compiler environment" "$LINENO" 5
fi
else else
as_fn_error $? "Cannot create icecc compiler package for ${BUILD_CC}" "$LINENO" 5 as_fn_error $? "Cannot create icecc compiler package for ${BUILD_CC}" "$LINENO" 5
fi fi
ICECC_ENV_BUNDLE_BASENAME="`${SED} -n '/^creating/s/creating //p' ${icecc_create_env_log}`" ICECC_ENV_BUNDLE_BASENAME="`${SED} -n '/^creating/s/creating //p' ${icecc_create_env_log_build}`"
ICECC_ENV_BUNDLE="${CONFIGURESUPPORT_OUTPUTDIR}/icecc/${ICECC_ENV_BUNDLE_BASENAME}" ICECC_ENV_BUNDLE="${CONFIGURESUPPORT_OUTPUTDIR}/icecc/${ICECC_ENV_BUNDLE_BASENAME}"
if test ! -f ${ICECC_ENV_BUNDLE}; then
as_fn_error $? "icecc-create-env did not produce an environment ${ICECC_ENV_BUNDLE}" "$LINENO" 5
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for icecc build environment for build compiler" >&5
$as_echo_n "checking for icecc build environment for build compiler... " >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${ICECC_ENV_BUNDLE}" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${ICECC_ENV_BUNDLE}" >&5
$as_echo "${ICECC_ENV_BUNDLE}" >&6; } $as_echo "${ICECC_ENV_BUNDLE}" >&6; }
BUILD_ICECC="ICECC_VERSION=${ICECC_ENV_BUNDLE} ICECC_CC=${BUILD_CC} \ BUILD_ICECC="ICECC_VERSION=${ICECC_ENV_BUNDLE} ICECC_CC=${BUILD_CC} \

View File

@ -1,5 +1,5 @@
# #
# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -48,12 +48,24 @@ AC_DEFUN_ONCE([LIB_SETUP_CUPS],
fi fi
if test "x${with_cups}" != x; then if test "x${with_cups}" != x; then
CUPS_CFLAGS="-I${with_cups}/include" AC_MSG_CHECKING([for cups headers])
CUPS_FOUND=yes if test -s "${with_cups}/include/cups/cups.h"; then
CUPS_CFLAGS="-I${with_cups}/include"
CUPS_FOUND=yes
AC_MSG_RESULT([$CUPS_FOUND])
else
AC_MSG_ERROR([Can't find 'include/cups/cups.h' under ${with_cups} given with the --with-cups option.])
fi
fi fi
if test "x${with_cups_include}" != x; then if test "x${with_cups_include}" != x; then
CUPS_CFLAGS="-I${with_cups_include}" AC_MSG_CHECKING([for cups headers])
CUPS_FOUND=yes if test -s "${with_cups_include}/cups/cups.h"; then
CUPS_CFLAGS="-I${with_cups_include}"
CUPS_FOUND=yes
AC_MSG_RESULT([$CUPS_FOUND])
else
AC_MSG_ERROR([Can't find 'cups/cups.h' under ${with_cups_include} given with the --with-cups-include option.])
fi
fi fi
if test "x$CUPS_FOUND" = xno; then if test "x$CUPS_FOUND" = xno; then
# Are the cups headers installed in the default /usr/include location? # Are the cups headers installed in the default /usr/include location?

View File

@ -342,3 +342,4 @@ feb1bd85d7990dcf5584ca9e53104269c01db006 jdk-9+96
10a482b863582376d4ca229090334b23b05159fc jdk-9+97 10a482b863582376d4ca229090334b23b05159fc jdk-9+97
ea285530245cf4e0edf0479121a41347d3030eba jdk-9+98 ea285530245cf4e0edf0479121a41347d3030eba jdk-9+98
180212ee1d8710691ba9944593dfc1ff3e4f1532 jdk-9+99 180212ee1d8710691ba9944593dfc1ff3e4f1532 jdk-9+99
791d0d3ac0138faeb6110bd840a4545bc1950df2 jdk-9+100

View File

@ -502,3 +502,4 @@ a94bb7203596dd632486f1e3655fa5f70541dc08 jdk-9+96
de592ea5f7ba0f8a8c5afc03bd169f7690c72b6f jdk-9+97 de592ea5f7ba0f8a8c5afc03bd169f7690c72b6f jdk-9+97
e5b1a23be1e105417ba1c4c576ab373eb3fa2c2b jdk-9+98 e5b1a23be1e105417ba1c4c576ab373eb3fa2c2b jdk-9+98
f008e8cc10d5b3212fb22d58c96fa01d38654f19 jdk-9+99 f008e8cc10d5b3212fb22d58c96fa01d38654f19 jdk-9+99
bdb0acafc63c42e84d9d8195bf2e2b25ee9c3306 jdk-9+100

View File

@ -285,7 +285,7 @@ JVM_LEAF(jlong, JVM_NanoTime(JNIEnv *env, jclass ignored))
return os::javaTimeNanos(); return os::javaTimeNanos();
JVM_END JVM_END
// The function below is actually exposed by sun.misc.VM and not // The function below is actually exposed by jdk.internal.misc.VM and not
// java.lang.System, but we choose to keep it here so that it stays next // java.lang.System, but we choose to keep it here so that it stays next
// to JVM_CurrentTimeMillis and JVM_NanoTime // to JVM_CurrentTimeMillis and JVM_NanoTime

View File

@ -342,3 +342,4 @@ c8d0845877a811ab4350935892f826929359a3ff jdk-9+95
9c107c050335d7ee63b2a8b38ca5d498f19713a2 jdk-9+97 9c107c050335d7ee63b2a8b38ca5d498f19713a2 jdk-9+97
52b01339235f24c93b679bd6b8fb36a1072ad0ac jdk-9+98 52b01339235f24c93b679bd6b8fb36a1072ad0ac jdk-9+98
52774b544850c791f1d1c67db2601b33739b18c9 jdk-9+99 52774b544850c791f1d1c67db2601b33739b18c9 jdk-9+99
d45bcd374f6057851e3c2dcd45607cd362afadfa jdk-9+100

View File

@ -345,3 +345,4 @@ b55cebc47555293cf9c2aefb3bf63c56e847ab19 jdk-9+96
7293db4716ee25b814e14f738b9acfb85700e3fa jdk-9+97 7293db4716ee25b814e14f738b9acfb85700e3fa jdk-9+97
67c84077edc3db6b24998b35970b37c01aae985e jdk-9+98 67c84077edc3db6b24998b35970b37c01aae985e jdk-9+98
97b31ca0dd77483cf20ff99a033a455673639578 jdk-9+99 97b31ca0dd77483cf20ff99a033a455673639578 jdk-9+99
d0a97e57d2336238edf6a4cd60aafe67deb7258d jdk-9+100

View File

@ -342,3 +342,4 @@ c021b855f51e572e63982654b17742cb1f814fb4 jdk-9+96
fdd84b2265ddce7f50e084b7c8635189bba6f012 jdk-9+97 fdd84b2265ddce7f50e084b7c8635189bba6f012 jdk-9+97
f86ee68d1107dad41a27efc34306e0e56244a12e jdk-9+98 f86ee68d1107dad41a27efc34306e0e56244a12e jdk-9+98
e1a789be1535741274c9779f4d4ca3495196b5c3 jdk-9+99 e1a789be1535741274c9779f4d4ca3495196b5c3 jdk-9+99
3d452840f48299a36842760d17c0c8402f0e1266 jdk-9+100

View File

@ -58,7 +58,10 @@ endif
ifeq ($(OPENJDK_TARGET_OS), aix) ifeq ($(OPENJDK_TARGET_OS), aix)
BUILD_LIBNIO_MAPFILE:=$(JDK_TOPDIR)/make/mapfiles/libnio/mapfile-$(OPENJDK_TARGET_OS) BUILD_LIBNIO_MAPFILE:=$(JDK_TOPDIR)/make/mapfiles/libnio/mapfile-$(OPENJDK_TARGET_OS)
BUILD_LIBNIO_EXFILES += \ BUILD_LIBNIO_EXFILES += \
NativeThread.c /NativeThread.c
# Notice: we really need the leading slash here because otherwise every
# FILE_NAME in EXCLUDE_FILES will actually match any file ending in FILE_NAME
# (e.g. 'NativeThread.c' will also exclude 'AixNativeThread.c').
endif endif
$(eval $(call SetupNativeCompilation,BUILD_LIBNIO, \ $(eval $(call SetupNativeCompilation,BUILD_LIBNIO, \

View File

@ -216,6 +216,7 @@ SUNWprivate_1.1 {
Java_java_lang_SecurityManager_getClassContext; Java_java_lang_SecurityManager_getClassContext;
Java_java_lang_Shutdown_halt0; Java_java_lang_Shutdown_halt0;
Java_java_lang_String_intern; Java_java_lang_String_intern;
Java_java_lang_StringCoding_err;
Java_java_lang_StringUTF16_isBigEndian; Java_java_lang_StringUTF16_isBigEndian;
Java_java_lang_System_identityHashCode; Java_java_lang_System_identityHashCode;
Java_java_lang_System_initProperties; Java_java_lang_System_initProperties;
@ -243,8 +244,6 @@ SUNWprivate_1.1 {
Java_java_util_TimeZone_getSystemTimeZoneID; Java_java_util_TimeZone_getSystemTimeZoneID;
Java_java_util_TimeZone_getSystemGMTOffsetID; Java_java_util_TimeZone_getSystemGMTOffsetID;
Java_java_util_concurrent_atomic_AtomicLong_VMSupportsCS8; Java_java_util_concurrent_atomic_AtomicLong_VMSupportsCS8;
Java_sun_misc_MessageUtils_toStderr;
Java_sun_misc_MessageUtils_toStdout;
Java_sun_misc_NativeSignalHandler_handle0; Java_sun_misc_NativeSignalHandler_handle0;
Java_sun_misc_Signal_findSignal; Java_sun_misc_Signal_findSignal;
Java_sun_misc_Signal_handle0; Java_sun_misc_Signal_handle0;
@ -274,12 +273,12 @@ SUNWprivate_1.1 {
Java_sun_reflect_Reflection_getClassAccessFlags; Java_sun_reflect_Reflection_getClassAccessFlags;
Java_sun_misc_Version_getJdkVersionInfo; Java_sun_misc_Version_getJdkVersionInfo;
Java_sun_misc_Version_getJvmVersionInfo; Java_sun_misc_Version_getJvmVersionInfo;
Java_sun_misc_VM_latestUserDefinedLoader; Java_jdk_internal_misc_VM_latestUserDefinedLoader;
Java_sun_misc_VM_getuid; Java_jdk_internal_misc_VM_getuid;
Java_sun_misc_VM_geteuid; Java_jdk_internal_misc_VM_geteuid;
Java_sun_misc_VM_getgid; Java_jdk_internal_misc_VM_getgid;
Java_sun_misc_VM_getegid; Java_jdk_internal_misc_VM_getegid;
Java_sun_misc_VM_initialize; Java_jdk_internal_misc_VM_initialize;
Java_sun_misc_VMSupport_initAgentProperties; Java_sun_misc_VMSupport_initAgentProperties;
Java_sun_misc_VMSupport_getVMTemporaryDirectory; Java_sun_misc_VMSupport_getVMTemporaryDirectory;

View File

@ -35,8 +35,6 @@ import java.util.Hashtable;
import java.util.BitSet; import java.util.BitSet;
import java.text.MessageFormat; import java.text.MessageFormat;
import sun.misc.MessageUtils;
/** /**
* A parser for DTDs. This parser roughly corresponds to the * A parser for DTDs. This parser roughly corresponds to the
* rules specified in "The SGML Handbook" by Charles F. Goldfarb. * rules specified in "The SGML Handbook" by Charles F. Goldfarb.

View File

@ -2135,7 +2135,7 @@ public class ObjectInputStream
* corresponding modifications to the above class. * corresponding modifications to the above class.
*/ */
private static ClassLoader latestUserDefinedLoader() { private static ClassLoader latestUserDefinedLoader() {
return sun.misc.VM.latestUserDefinedLoader(); return jdk.internal.misc.VM.latestUserDefinedLoader();
} }
/** /**

View File

@ -56,6 +56,7 @@ import java.util.HashMap;
import java.util.Objects; import java.util.Objects;
import java.util.StringJoiner; import java.util.StringJoiner;
import jdk.internal.misc.Unsafe; import jdk.internal.misc.Unsafe;
import jdk.internal.misc.VM;
import jdk.internal.HotSpotIntrinsicCandidate; import jdk.internal.HotSpotIntrinsicCandidate;
import sun.reflect.CallerSensitive; import sun.reflect.CallerSensitive;
import sun.reflect.ConstantPool; import sun.reflect.ConstantPool;
@ -360,9 +361,9 @@ public final class Class<T> implements java.io.Serializable,
// Reflective call to get caller class is only needed if a security manager // Reflective call to get caller class is only needed if a security manager
// is present. Avoid the overhead of making this call otherwise. // is present. Avoid the overhead of making this call otherwise.
caller = Reflection.getCallerClass(); caller = Reflection.getCallerClass();
if (sun.misc.VM.isSystemDomainLoader(loader)) { if (VM.isSystemDomainLoader(loader)) {
ClassLoader ccl = ClassLoader.getClassLoader(caller); ClassLoader ccl = ClassLoader.getClassLoader(caller);
if (!sun.misc.VM.isSystemDomainLoader(ccl)) { if (!VM.isSystemDomainLoader(ccl)) {
sm.checkPermission( sm.checkPermission(
SecurityConstants.GET_CLASSLOADER_PERMISSION); SecurityConstants.GET_CLASSLOADER_PERMISSION);
} }

View File

@ -28,6 +28,7 @@ package java.lang;
import java.lang.annotation.Native; import java.lang.annotation.Native;
import java.util.Objects; import java.util.Objects;
import jdk.internal.HotSpotIntrinsicCandidate; import jdk.internal.HotSpotIntrinsicCandidate;
import jdk.internal.misc.VM;
import static java.lang.String.COMPACT_STRINGS; import static java.lang.String.COMPACT_STRINGS;
import static java.lang.String.LATIN1; import static java.lang.String.LATIN1;
@ -1018,7 +1019,7 @@ public final class Integer extends Number implements Comparable<Integer> {
* may be controlled by the {@code -XX:AutoBoxCacheMax=<size>} option. * may be controlled by the {@code -XX:AutoBoxCacheMax=<size>} option.
* During VM initialization, java.lang.Integer.IntegerCache.high property * During VM initialization, java.lang.Integer.IntegerCache.high property
* may be set and saved in the private system properties in the * may be set and saved in the private system properties in the
* sun.misc.VM class. * jdk.internal.misc.VM class.
*/ */
private static class IntegerCache { private static class IntegerCache {
@ -1030,7 +1031,7 @@ public final class Integer extends Number implements Comparable<Integer> {
// high value may be configured by property // high value may be configured by property
int h = 127; int h = 127;
String integerCacheHighPropValue = String integerCacheHighPropValue =
sun.misc.VM.getSavedProperty("java.lang.Integer.IntegerCache.high"); VM.getSavedProperty("java.lang.Integer.IntegerCache.high");
if (integerCacheHighPropValue != null) { if (integerCacheHighPropValue != null) {
try { try {
int i = parseInt(integerCacheHighPropValue); int i = parseInt(integerCacheHighPropValue);

View File

@ -24,7 +24,7 @@
*/ */
package java.lang; package java.lang;
import sun.misc.VM; import jdk.internal.misc.VM;
import java.io.PrintStream; import java.io.PrintStream;
import java.lang.StackWalker.Option; import java.lang.StackWalker.Option;

View File

@ -39,7 +39,6 @@ import java.nio.charset.IllegalCharsetNameException;
import java.nio.charset.UnsupportedCharsetException; import java.nio.charset.UnsupportedCharsetException;
import java.util.Arrays; import java.util.Arrays;
import jdk.internal.HotSpotIntrinsicCandidate; import jdk.internal.HotSpotIntrinsicCandidate;
import sun.misc.MessageUtils;
import sun.nio.cs.HistoricallyNamedCharset; import sun.nio.cs.HistoricallyNamedCharset;
import sun.nio.cs.ArrayDecoder; import sun.nio.cs.ArrayDecoder;
import sun.nio.cs.ArrayEncoder; import sun.nio.cs.ArrayEncoder;
@ -106,11 +105,11 @@ class StringCoding {
private static void warnUnsupportedCharset(String csn) { private static void warnUnsupportedCharset(String csn) {
if (warnUnsupportedCharset) { if (warnUnsupportedCharset) {
// Use sun.misc.MessageUtils rather than the Logging API or // Use err(String) rather than the Logging API or System.err
// System.err since this method may be called during VM // since this method may be called during VM initialization
// initialization before either is available. // before either is available.
MessageUtils.err("WARNING: Default charset " + csn + err("WARNING: Default charset " + csn +
" not supported, using ISO-8859-1 instead"); " not supported, using ISO-8859-1 instead\n");
warnUnsupportedCharset = false; warnUnsupportedCharset = false;
} }
} }
@ -341,10 +340,9 @@ class StringCoding {
try { try {
return decode("ISO-8859-1", ba, off, len); return decode("ISO-8859-1", ba, off, len);
} catch (UnsupportedEncodingException x) { } catch (UnsupportedEncodingException x) {
// If this code is hit during VM initialization, MessageUtils is // If this code is hit during VM initialization, err(String) is
// the only way we will be able to get any kind of error message. // the only way we will be able to get any kind of error message.
MessageUtils.err("ISO-8859-1 charset not available: " err("ISO-8859-1 charset not available: " + x.toString() + "\n");
+ x.toString());
// If we can not find ISO-8859-1 (a required encoding) then things // If we can not find ISO-8859-1 (a required encoding) then things
// are seriously wrong with the installation. // are seriously wrong with the installation.
System.exit(1); System.exit(1);
@ -653,14 +651,20 @@ class StringCoding {
try { try {
return encode("ISO-8859-1", coder, val); return encode("ISO-8859-1", coder, val);
} catch (UnsupportedEncodingException x) { } catch (UnsupportedEncodingException x) {
// If this code is hit during VM initialization, MessageUtils is // If this code is hit during VM initialization, err(String) is
// the only way we will be able to get any kind of error message. // the only way we will be able to get any kind of error message.
MessageUtils.err("ISO-8859-1 charset not available: " err("ISO-8859-1 charset not available: " + x.toString() + "\n");
+ x.toString());
// If we can not find ISO-8859-1 (a required encoding) then things // If we can not find ISO-8859-1 (a required encoding) then things
// are seriously wrong with the installation. // are seriously wrong with the installation.
System.exit(1); System.exit(1);
return null; return null;
} }
} }
/**
* Print a message directly to stderr, bypassing all character conversion
* methods.
* @param msg message to print
*/
private static native void err(String msg);
} }

View File

@ -46,6 +46,7 @@ import sun.reflect.annotation.AnnotationType;
import jdk.internal.HotSpotIntrinsicCandidate; import jdk.internal.HotSpotIntrinsicCandidate;
import jdk.internal.misc.JavaLangAccess;; import jdk.internal.misc.JavaLangAccess;;
import jdk.internal.misc.SharedSecrets;; import jdk.internal.misc.SharedSecrets;;
import jdk.internal.misc.VM;
import jdk.internal.logger.LoggerFinderLoader; import jdk.internal.logger.LoggerFinderLoader;
import jdk.internal.logger.LazyLoggers; import jdk.internal.logger.LazyLoggers;
import jdk.internal.logger.LocalizedLoggerWrapper; import jdk.internal.logger.LocalizedLoggerWrapper;
@ -1817,12 +1818,12 @@ public final class System {
// removed from the system properties. // removed from the system properties.
// //
// See java.lang.Integer.IntegerCache and the // See java.lang.Integer.IntegerCache and the
// sun.misc.VM.saveAndRemoveProperties method for example. // VM.saveAndRemoveProperties method for example.
// //
// Save a private copy of the system properties object that // Save a private copy of the system properties object that
// can only be accessed by the internal implementation. Remove // can only be accessed by the internal implementation. Remove
// certain system properties that are not intended for public access. // certain system properties that are not intended for public access.
sun.misc.VM.saveAndRemoveProperties(props); VM.saveAndRemoveProperties(props);
lineSeparator = props.getProperty("line.separator"); lineSeparator = props.getProperty("line.separator");
@ -1846,7 +1847,7 @@ public final class System {
// set for the class libraries. Currently this is no-op everywhere except // set for the class libraries. Currently this is no-op everywhere except
// for Windows where the process-wide error mode is set before the java.io // for Windows where the process-wide error mode is set before the java.io
// classes are used. // classes are used.
sun.misc.VM.initializeOSEnvironment(); VM.initializeOSEnvironment();
// The main thread is not added to its thread group in the same // The main thread is not added to its thread group in the same
// way as other threads; we must do it ourselves here. // way as other threads; we must do it ourselves here.
@ -1857,10 +1858,10 @@ public final class System {
setJavaLangAccess(); setJavaLangAccess();
// Subsystems that are invoked during initialization can invoke // Subsystems that are invoked during initialization can invoke
// sun.misc.VM.isBooted() in order to avoid doing things that should // VM.isBooted() in order to avoid doing things that should
// wait until the application class loader has been set up. // wait until the application class loader has been set up.
// IMPORTANT: Ensure that this remains the last initialization action! // IMPORTANT: Ensure that this remains the last initialization action!
sun.misc.VM.booted(); VM.booted();
} }
private static void setJavaLangAccess() { private static void setJavaLangAccess() {

View File

@ -1869,7 +1869,7 @@ class Thread implements Runnable {
*/ */
public State getState() { public State getState() {
// get current thread state // get current thread state
return sun.misc.VM.toThreadState(threadStatus); return jdk.internal.misc.VM.toThreadState(threadStatus);
} }
// Added in JSR-166 // Added in JSR-166

View File

@ -27,7 +27,7 @@ package java.lang;
import java.io.PrintStream; import java.io.PrintStream;
import java.util.Arrays; import java.util.Arrays;
import sun.misc.VM; import jdk.internal.misc.VM;
/** /**
* A thread group represents a set of threads. In addition, a thread * A thread group represents a set of threads. In addition, a thread

View File

@ -24,7 +24,7 @@
*/ */
package java.lang; package java.lang;
import sun.misc.VM; import jdk.internal.misc.VM;
import java.io.*; import java.io.*;
import java.util.*; import java.util.*;

View File

@ -1836,7 +1836,7 @@ return mh1;
return false; return false;
} }
ClassLoader loader = defc.getClassLoader(); ClassLoader loader = defc.getClassLoader();
if (!sun.misc.VM.isSystemDomainLoader(loader)) { if (!jdk.internal.misc.VM.isSystemDomainLoader(loader)) {
ClassLoader sysl = ClassLoader.getSystemClassLoader(); ClassLoader sysl = ClassLoader.getSystemClassLoader();
boolean found = false; boolean found = false;
while (sysl != null) { while (sysl != null) {

View File

@ -29,7 +29,7 @@ import java.security.PrivilegedAction;
import java.security.AccessController; import java.security.AccessController;
import jdk.internal.misc.JavaLangAccess; import jdk.internal.misc.JavaLangAccess;
import jdk.internal.misc.SharedSecrets; import jdk.internal.misc.SharedSecrets;
import sun.misc.VM; import jdk.internal.misc.VM;
final class Finalizer extends FinalReference<Object> { /* Package-private; must be in final class Finalizer extends FinalReference<Object> { /* Package-private; must be in
same package as the Reference same package as the Reference

View File

@ -26,6 +26,7 @@
package java.lang.ref; package java.lang.ref;
import java.util.function.Consumer; import java.util.function.Consumer;
import jdk.internal.misc.VM;
/** /**
* Reference queues, to which registered reference objects are appended by the * Reference queues, to which registered reference objects are appended by the
@ -73,7 +74,7 @@ public class ReferenceQueue<T> {
// Volatiles ensure ordering. // Volatiles ensure ordering.
r.queue = ENQUEUED; r.queue = ENQUEUED;
if (r instanceof FinalReference) { if (r instanceof FinalReference) {
sun.misc.VM.addFinalRefCount(1); VM.addFinalRefCount(1);
} }
lock.notifyAll(); lock.notifyAll();
return true; return true;
@ -93,7 +94,7 @@ public class ReferenceQueue<T> {
r.next = r; r.next = r;
queueLength--; queueLength--;
if (r instanceof FinalReference) { if (r instanceof FinalReference) {
sun.misc.VM.addFinalRefCount(-1); VM.addFinalRefCount(-1);
} }
return r; return r;
} }

View File

@ -34,7 +34,7 @@ import java.util.Map;
import java.util.Objects; import java.util.Objects;
import java.util.concurrent.atomic.AtomicLong; import java.util.concurrent.atomic.AtomicLong;
import java.util.function.BiFunction; import java.util.function.BiFunction;
import sun.misc.VM; import jdk.internal.misc.VM;
import sun.reflect.CallerSensitive; import sun.reflect.CallerSensitive;
import sun.reflect.Reflection; import sun.reflect.Reflection;
import sun.reflect.misc.ReflectUtil; import sun.reflect.misc.ReflectUtil;

View File

@ -2059,7 +2059,7 @@ public final class URI
// 5.2 (2): Reference to current document (lone fragment) // 5.2 (2): Reference to current document (lone fragment)
if ((child.scheme == null) && (child.authority == null) if ((child.scheme == null) && (child.authority == null)
&& child.path.equals("") && (child.fragment != null) && child.path.isEmpty() && (child.fragment != null)
&& (child.query == null)) { && (child.query == null)) {
if ((base.fragment != null) if ((base.fragment != null)
&& child.fragment.equals(base.fragment)) { && child.fragment.equals(base.fragment)) {
@ -2647,13 +2647,6 @@ public final class URI
private static final long L_SCHEME = L_ALPHA | L_DIGIT | lowMask("+-."); private static final long L_SCHEME = L_ALPHA | L_DIGIT | lowMask("+-.");
private static final long H_SCHEME = H_ALPHA | H_DIGIT | highMask("+-."); private static final long H_SCHEME = H_ALPHA | H_DIGIT | highMask("+-.");
// uric_no_slash = unreserved | escaped | ";" | "?" | ":" | "@" |
// "&" | "=" | "+" | "$" | ","
private static final long L_URIC_NO_SLASH
= L_UNRESERVED | L_ESCAPED | lowMask(";?:@&=+$,");
private static final long H_URIC_NO_SLASH
= H_UNRESERVED | H_ESCAPED | highMask(";?:@&=+$,");
// scope_id = alpha | digit | "_" | "." // scope_id = alpha | digit | "_" | "."
private static final long L_SCOPE_ID private static final long L_SCOPE_ID
= L_ALPHANUM | lowMask("_."); = L_ALPHANUM | lowMask("_.");
@ -2884,23 +2877,10 @@ public final class URI
// -- Simple access to the input string -- // -- Simple access to the input string --
// Return a substring of the input string
//
private String substring(int start, int end) {
return input.substring(start, end);
}
// Return the char at position p,
// assuming that p < input.length()
//
private char charAt(int p) {
return input.charAt(p);
}
// Tells whether start < end and, if so, whether charAt(start) == c // Tells whether start < end and, if so, whether charAt(start) == c
// //
private boolean at(int start, int end, char c) { private boolean at(int start, int end, char c) {
return (start < end) && (charAt(start) == c); return (start < end) && (input.charAt(start) == c);
} }
// Tells whether start + s.length() < end and, if so, // Tells whether start + s.length() < end and, if so,
@ -2913,7 +2893,7 @@ public final class URI
return false; return false;
int i = 0; int i = 0;
while (i < sn) { while (i < sn) {
if (charAt(p++) != s.charAt(i)) { if (input.charAt(p++) != s.charAt(i)) {
break; break;
} }
i++; i++;
@ -2953,7 +2933,7 @@ public final class URI
// start position. // start position.
// //
private int scan(int start, int end, char c) { private int scan(int start, int end, char c) {
if ((start < end) && (charAt(start) == c)) if ((start < end) && (input.charAt(start) == c))
return start + 1; return start + 1;
return start; return start;
} }
@ -2968,7 +2948,7 @@ public final class URI
private int scan(int start, int end, String err, String stop) { private int scan(int start, int end, String err, String stop) {
int p = start; int p = start;
while (p < end) { while (p < end) {
char c = charAt(p); char c = input.charAt(p);
if (err.indexOf(c) >= 0) if (err.indexOf(c) >= 0)
return -1; return -1;
if (stop.indexOf(c) >= 0) if (stop.indexOf(c) >= 0)
@ -2978,6 +2958,23 @@ public final class URI
return p; return p;
} }
// Scan forward from the given start position. Stop at the first char
// in the stop string (in which case the index of the preceding char is
// returned), or the end of the input string (in which case the length
// of the input string is returned). May return the start position if
// nothing matches.
//
private int scan(int start, int end, String stop) {
int p = start;
while (p < end) {
char c = input.charAt(p);
if (stop.indexOf(c) >= 0)
break;
p++;
}
return p;
}
// Scan a potential escape sequence, starting at the given position, // Scan a potential escape sequence, starting at the given position,
// with the given first char (i.e., charAt(start) == c). // with the given first char (i.e., charAt(start) == c).
// //
@ -2992,8 +2989,8 @@ public final class URI
if (c == '%') { if (c == '%') {
// Process escape pair // Process escape pair
if ((p + 3 <= n) if ((p + 3 <= n)
&& match(charAt(p + 1), L_HEX, H_HEX) && match(input.charAt(p + 1), L_HEX, H_HEX)
&& match(charAt(p + 2), L_HEX, H_HEX)) { && match(input.charAt(p + 2), L_HEX, H_HEX)) {
return p + 3; return p + 3;
} }
fail("Malformed escape pair", p); fail("Malformed escape pair", p);
@ -3013,7 +3010,7 @@ public final class URI
{ {
int p = start; int p = start;
while (p < n) { while (p < n) {
char c = charAt(p); char c = input.charAt(p);
if (match(c, lowMask, highMask)) { if (match(c, lowMask, highMask)) {
p++; p++;
continue; continue;
@ -3067,13 +3064,13 @@ public final class URI
failExpecting("scheme name", 0); failExpecting("scheme name", 0);
checkChar(0, L_ALPHA, H_ALPHA, "scheme name"); checkChar(0, L_ALPHA, H_ALPHA, "scheme name");
checkChars(1, p, L_SCHEME, H_SCHEME, "scheme name"); checkChars(1, p, L_SCHEME, H_SCHEME, "scheme name");
scheme = substring(0, p); scheme = input.substring(0, p);
p++; // Skip ':' p++; // Skip ':'
ssp = p; ssp = p;
if (at(p, n, '/')) { if (at(p, n, '/')) {
p = parseHierarchical(p, n); p = parseHierarchical(p, n);
} else { } else {
int q = scan(p, n, "", "#"); int q = scan(p, n, "#");
if (q <= p) if (q <= p)
failExpecting("scheme-specific part", p); failExpecting("scheme-specific part", p);
checkChars(p, q, L_URIC, H_URIC, "opaque part"); checkChars(p, q, L_URIC, H_URIC, "opaque part");
@ -3083,10 +3080,10 @@ public final class URI
ssp = 0; ssp = 0;
p = parseHierarchical(0, n); p = parseHierarchical(0, n);
} }
schemeSpecificPart = substring(ssp, p); schemeSpecificPart = input.substring(ssp, p);
if (at(p, n, '#')) { if (at(p, n, '#')) {
checkChars(p + 1, n, L_URIC, H_URIC, "fragment"); checkChars(p + 1, n, L_URIC, H_URIC, "fragment");
fragment = substring(p + 1, n); fragment = input.substring(p + 1, n);
p = n; p = n;
} }
if (p < n) if (p < n)
@ -3113,7 +3110,7 @@ public final class URI
int p = start; int p = start;
if (at(p, n, '/') && at(p + 1, n, '/')) { if (at(p, n, '/') && at(p + 1, n, '/')) {
p += 2; p += 2;
int q = scan(p, n, "", "/?#"); int q = scan(p, n, "/?#");
if (q > p) { if (q > p) {
p = parseAuthority(p, q); p = parseAuthority(p, q);
} else if (q < n) { } else if (q < n) {
@ -3122,15 +3119,15 @@ public final class URI
} else } else
failExpecting("authority", p); failExpecting("authority", p);
} }
int q = scan(p, n, "", "?#"); // DEVIATION: May be empty int q = scan(p, n, "?#"); // DEVIATION: May be empty
checkChars(p, q, L_PATH, H_PATH, "path"); checkChars(p, q, L_PATH, H_PATH, "path");
path = substring(p, q); path = input.substring(p, q);
p = q; p = q;
if (at(p, n, '?')) { if (at(p, n, '?')) {
p++; p++;
q = scan(p, n, "", "#"); q = scan(p, n, "#");
checkChars(p, q, L_URIC, H_URIC, "query"); checkChars(p, q, L_URIC, H_URIC, "query");
query = substring(p, q); query = input.substring(p, q);
p = q; p = q;
} }
return p; return p;
@ -3154,7 +3151,7 @@ public final class URI
boolean serverChars; boolean serverChars;
boolean regChars; boolean regChars;
if (scan(p, n, "", "]") > p) { if (scan(p, n, "]") > p) {
// contains a literal IPv6 address, therefore % is allowed // contains a literal IPv6 address, therefore % is allowed
serverChars = (scan(p, n, L_SERVER_PERCENT, H_SERVER_PERCENT) == n); serverChars = (scan(p, n, L_SERVER_PERCENT, H_SERVER_PERCENT) == n);
} else { } else {
@ -3164,7 +3161,7 @@ public final class URI
if (regChars && !serverChars) { if (regChars && !serverChars) {
// Must be a registry-based authority // Must be a registry-based authority
authority = substring(p, n); authority = input.substring(p, n);
return n; return n;
} }
@ -3176,7 +3173,7 @@ public final class URI
q = parseServer(p, n); q = parseServer(p, n);
if (q < n) if (q < n)
failExpecting("end of authority", q); failExpecting("end of authority", q);
authority = substring(p, n); authority = input.substring(p, n);
} catch (URISyntaxException x) { } catch (URISyntaxException x) {
// Undo results of failed parse // Undo results of failed parse
userInfo = null; userInfo = null;
@ -3198,7 +3195,7 @@ public final class URI
if (q < n) { if (q < n) {
if (regChars) { if (regChars) {
// Registry-based authority // Registry-based authority
authority = substring(p, n); authority = input.substring(p, n);
} else if (ex != null) { } else if (ex != null) {
// Re-throw exception; it was probably due to // Re-throw exception; it was probably due to
// a malformed IPv6 address // a malformed IPv6 address
@ -3224,7 +3221,7 @@ public final class URI
q = scan(p, n, "/?#", "@"); q = scan(p, n, "/?#", "@");
if ((q >= p) && at(q, n, '@')) { if ((q >= p) && at(q, n, '@')) {
checkChars(p, q, L_USERINFO, H_USERINFO, "user info"); checkChars(p, q, L_USERINFO, H_USERINFO, "user info");
userInfo = substring(p, q); userInfo = input.substring(p, q);
p = q + 1; // Skip '@' p = q + 1; // Skip '@'
} }
@ -3235,7 +3232,7 @@ public final class URI
q = scan(p, n, "/?#", "]"); q = scan(p, n, "/?#", "]");
if ((q > p) && at(q, n, ']')) { if ((q > p) && at(q, n, ']')) {
// look for a "%" scope id // look for a "%" scope id
int r = scan (p, q, "", "%"); int r = scan (p, q, "%");
if (r > p) { if (r > p) {
parseIPv6Reference(p, r); parseIPv6Reference(p, r);
if (r+1 == q) { if (r+1 == q) {
@ -3246,7 +3243,7 @@ public final class URI
} else { } else {
parseIPv6Reference(p, q); parseIPv6Reference(p, q);
} }
host = substring(p-1, q+1); host = input.substring(p-1, q+1);
p = q + 1; p = q + 1;
} else { } else {
failExpecting("closing bracket for IPv6 address", q); failExpecting("closing bracket for IPv6 address", q);
@ -3261,7 +3258,7 @@ public final class URI
// port // port
if (at(p, n, ':')) { if (at(p, n, ':')) {
p++; p++;
q = scan(p, n, "", "/"); q = scan(p, n, "/");
if (q > p) { if (q > p) {
checkChars(p, q, L_DIGIT, H_DIGIT, "port number"); checkChars(p, q, L_DIGIT, H_DIGIT, "port number");
try { try {
@ -3361,13 +3358,13 @@ public final class URI
// IPv4 address is followed by something - check that // IPv4 address is followed by something - check that
// it's a ":" as this is the only valid character to // it's a ":" as this is the only valid character to
// follow an address. // follow an address.
if (charAt(p) != ':') { if (input.charAt(p) != ':') {
p = -1; p = -1;
} }
} }
if (p > start) if (p > start)
host = substring(start, p); host = input.substring(start, p);
return p; return p;
} }
@ -3393,7 +3390,7 @@ public final class URI
p = q; p = q;
q = scan(p, n, L_ALPHANUM | L_DASH, H_ALPHANUM | H_DASH); q = scan(p, n, L_ALPHANUM | L_DASH, H_ALPHANUM | H_DASH);
if (q > p) { if (q > p) {
if (charAt(q - 1) == '-') if (input.charAt(q - 1) == '-')
fail("Illegal character in hostname", q - 1); fail("Illegal character in hostname", q - 1);
p = q; p = q;
} }
@ -3412,11 +3409,11 @@ public final class URI
// for a fully qualified hostname check that the rightmost // for a fully qualified hostname check that the rightmost
// label starts with an alpha character. // label starts with an alpha character.
if (l > start && !match(charAt(l), L_ALPHA, H_ALPHA)) { if (l > start && !match(input.charAt(l), L_ALPHA, H_ALPHA)) {
fail("Illegal character in hostname", l); fail("Illegal character in hostname", l);
} }
host = substring(start, p); host = input.substring(start, p);
return p; return p;
} }

View File

@ -1242,7 +1242,7 @@ public final class URL implements java.io.Serializable {
private static ThreadLocal<Object> gate = new ThreadLocal<>(); private static ThreadLocal<Object> gate = new ThreadLocal<>();
private static URLStreamHandler lookupViaProviders(final String protocol) { private static URLStreamHandler lookupViaProviders(final String protocol) {
if (!sun.misc.VM.isBooted()) if (!jdk.internal.misc.VM.isBooted())
return null; return null;
if (gate.get() != null) if (gate.get() != null)

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1995, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1995, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -1567,6 +1567,11 @@ public abstract class URLConnection {
} }
} }
if ((c1 == 0x49 && c2 == 0x49 && c3 == 0x2a && c4 == 0x00)
|| (c1 == 0x4d && c2 == 0x4d && c3 == 0x00 && c4 == 0x2a)) {
return "image/tiff";
}
if (c1 == 0xD0 && c2 == 0xCF && c3 == 0x11 && c4 == 0xE0 && if (c1 == 0xD0 && c2 == 0xCF && c3 == 0x11 && c4 == 0xE0 &&
c5 == 0xA1 && c6 == 0xB1 && c7 == 0x1A && c8 == 0xE1) { c5 == 0xA1 && c6 == 0xB1 && c7 == 0x1A && c8 == 0xE1) {

View File

@ -31,7 +31,7 @@ import jdk.internal.misc.JavaNioAccess;
import jdk.internal.misc.JavaLangRefAccess; import jdk.internal.misc.JavaLangRefAccess;
import jdk.internal.misc.SharedSecrets; import jdk.internal.misc.SharedSecrets;
import jdk.internal.misc.Unsafe; import jdk.internal.misc.Unsafe;
import sun.misc.VM; import jdk.internal.misc.VM;
/** /**
* Access to bits, native and otherwise. * Access to bits, native and otherwise.

View File

@ -30,7 +30,7 @@ package java.nio;
import java.io.FileDescriptor; import java.io.FileDescriptor;
import sun.misc.Cleaner; import sun.misc.Cleaner;
import jdk.internal.misc.Unsafe; import jdk.internal.misc.Unsafe;
import sun.misc.VM; import jdk.internal.misc.VM;
import sun.nio.ch.DirectBuffer; import sun.nio.ch.DirectBuffer;

View File

@ -43,6 +43,7 @@ import java.util.ServiceLoader;
import java.util.ServiceConfigurationError; import java.util.ServiceConfigurationError;
import java.util.SortedMap; import java.util.SortedMap;
import java.util.TreeMap; import java.util.TreeMap;
import jdk.internal.misc.VM;
import sun.misc.ASCIICaseInsensitiveComparator; import sun.misc.ASCIICaseInsensitiveComparator;
import sun.nio.cs.StandardCharsets; import sun.nio.cs.StandardCharsets;
import sun.nio.cs.ThreadLocalCoders; import sun.nio.cs.ThreadLocalCoders;
@ -281,7 +282,7 @@ public abstract class Charset
static boolean atBugLevel(String bl) { // package-private static boolean atBugLevel(String bl) { // package-private
String level = bugLevel; String level = bugLevel;
if (level == null) { if (level == null) {
if (!sun.misc.VM.isBooted()) if (!VM.isBooted())
return false; return false;
bugLevel = level = AccessController.doPrivileged( bugLevel = level = AccessController.doPrivileged(
new GetPropertyAction("sun.nio.cs.bugLevel", "")); new GetPropertyAction("sun.nio.cs.bugLevel", ""));
@ -394,7 +395,7 @@ public abstract class Charset
// that loader to be prematurely initialized with incomplete // that loader to be prematurely initialized with incomplete
// information. // information.
// //
if (!sun.misc.VM.isBooted()) if (!VM.isBooted())
return null; return null;
if (gate.get() != null) if (gate.get() != null)
@ -445,7 +446,7 @@ public abstract class Charset
} }
private static Charset lookupExtendedCharset(String charsetName) { private static Charset lookupExtendedCharset(String charsetName) {
if (!sun.misc.VM.isBooted()) // see lookupViaProviders() if (!VM.isBooted()) // see lookupViaProviders()
return null; return null;
CharsetProvider[] ecps = ExtendedProviderHolder.extendedProviders; CharsetProvider[] ecps = ExtendedProviderHolder.extendedProviders;
for (CharsetProvider cp : ecps) { for (CharsetProvider cp : ecps) {

View File

@ -69,7 +69,7 @@ import static java.time.LocalTime.NANOS_PER_MILLI;
import java.io.Serializable; import java.io.Serializable;
import java.util.Objects; import java.util.Objects;
import java.util.TimeZone; import java.util.TimeZone;
import sun.misc.VM; import jdk.internal.misc.VM;
/** /**
* A clock providing access to the current instant, date and time using a time-zone. * A clock providing access to the current instant, date and time using a time-zone.

View File

@ -1194,6 +1194,7 @@ public final class Duration
* This instance is immutable and unaffected by this method call. * This instance is immutable and unaffected by this method call.
* *
* @return the whole seconds part of the length of the duration, positive or negative * @return the whole seconds part of the length of the duration, positive or negative
* @since 9
*/ */
public long toSeconds() { public long toSeconds() {
return seconds; return seconds;
@ -1243,6 +1244,7 @@ public final class Duration
* This instance is immutable and unaffected by this method call. * This instance is immutable and unaffected by this method call.
* *
* @return the number of days in the duration, may be negative * @return the number of days in the duration, may be negative
* @since 9
*/ */
public long toDaysPart(){ public long toDaysPart(){
return seconds / SECONDS_PER_DAY; return seconds / SECONDS_PER_DAY;
@ -1258,6 +1260,7 @@ public final class Duration
* This instance is immutable and unaffected by this method call. * This instance is immutable and unaffected by this method call.
* *
* @return the number of hours part in the duration, may be negative * @return the number of hours part in the duration, may be negative
* @since 9
*/ */
public int toHoursPart(){ public int toHoursPart(){
return (int) (toHours() % 24); return (int) (toHours() % 24);
@ -1273,7 +1276,7 @@ public final class Duration
* This instance is immutable and unaffected by this method call. * This instance is immutable and unaffected by this method call.
* *
* @return the number of minutes parts in the duration, may be negative * @return the number of minutes parts in the duration, may be negative
* may be negative * @since 9
*/ */
public int toMinutesPart(){ public int toMinutesPart(){
return (int) (toMinutes() % MINUTES_PER_HOUR); return (int) (toMinutes() % MINUTES_PER_HOUR);
@ -1289,6 +1292,7 @@ public final class Duration
* This instance is immutable and unaffected by this method call. * This instance is immutable and unaffected by this method call.
* *
* @return the number of seconds parts in the duration, may be negative * @return the number of seconds parts in the duration, may be negative
* @since 9
*/ */
public int toSecondsPart(){ public int toSecondsPart(){
return (int) (seconds % SECONDS_PER_MINUTE); return (int) (seconds % SECONDS_PER_MINUTE);
@ -1306,6 +1310,7 @@ public final class Duration
* This instance is immutable and unaffected by this method call. * This instance is immutable and unaffected by this method call.
* *
* @return the number of milliseconds part of the duration. * @return the number of milliseconds part of the duration.
* @since 9
*/ */
public int toMillisPart(){ public int toMillisPart(){
return nanos / 1000_000; return nanos / 1000_000;
@ -1322,6 +1327,7 @@ public final class Duration
* This instance is immutable and unaffected by this method call. * This instance is immutable and unaffected by this method call.
* *
* @return the nanoseconds within the second part of the length of the duration, from 0 to 999,999,999 * @return the nanoseconds within the second part of the length of the duration, from 0 to 999,999,999
* @since 9
*/ */
public int toNanosPart(){ public int toNanosPart(){
return nanos; return nanos;
@ -1385,7 +1391,7 @@ public final class Duration
* <p> * <p>
* The format of the returned string will be {@code PTnHnMnS}, where n is * The format of the returned string will be {@code PTnHnMnS}, where n is
* the relevant hours, minutes or seconds part of the duration. * the relevant hours, minutes or seconds part of the duration.
* Any fractional seconds are placed after a decimal point i the seconds section. * Any fractional seconds are placed after a decimal point in the seconds section.
* If a section has a zero value, it is omitted. * If a section has a zero value, it is omitted.
* The hours, minutes and seconds will all have the same sign. * The hours, minutes and seconds will all have the same sign.
* <p> * <p>
@ -1406,9 +1412,13 @@ public final class Duration
if (this == ZERO) { if (this == ZERO) {
return "PT0S"; return "PT0S";
} }
long hours = seconds / SECONDS_PER_HOUR; long effectiveTotalSecs = seconds;
int minutes = (int) ((seconds % SECONDS_PER_HOUR) / SECONDS_PER_MINUTE); if (seconds < 0 && nanos > 0) {
int secs = (int) (seconds % SECONDS_PER_MINUTE); effectiveTotalSecs++;
}
long hours = effectiveTotalSecs / SECONDS_PER_HOUR;
int minutes = (int) ((effectiveTotalSecs % SECONDS_PER_HOUR) / SECONDS_PER_MINUTE);
int secs = (int) (effectiveTotalSecs % SECONDS_PER_MINUTE);
StringBuilder buf = new StringBuilder(24); StringBuilder buf = new StringBuilder(24);
buf.append("PT"); buf.append("PT");
if (hours != 0) { if (hours != 0) {
@ -1420,18 +1430,18 @@ public final class Duration
if (secs == 0 && nanos == 0 && buf.length() > 2) { if (secs == 0 && nanos == 0 && buf.length() > 2) {
return buf.toString(); return buf.toString();
} }
if (secs < 0 && nanos > 0) { if (seconds < 0 && nanos > 0) {
if (secs == -1) { if (secs == 0) {
buf.append("-0"); buf.append("-0");
} else { } else {
buf.append(secs + 1); buf.append(secs);
} }
} else { } else {
buf.append(secs); buf.append(secs);
} }
if (nanos > 0) { if (nanos > 0) {
int pos = buf.length(); int pos = buf.length();
if (secs < 0) { if (seconds < 0) {
buf.append(2 * NANOS_PER_SECOND - nanos); buf.append(2 * NANOS_PER_SECOND - nanos);
} else { } else {
buf.append(nanos + NANOS_PER_SECOND); buf.append(nanos + NANOS_PER_SECOND);

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1996, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -2085,8 +2085,10 @@ public abstract class Calendar implements Serializable, Cloneable, Comparable<Ca
String calendarType = getCalendarType(); String calendarType = getCalendarType();
int fieldValue = get(field); int fieldValue = get(field);
// the standalone and narrow styles are supported only through CalendarDataProviders. // the standalone/narrow styles and short era are supported only through
if (isStandaloneStyle(style) || isNarrowFormatStyle(style)) { // CalendarNameProviders.
if (isStandaloneStyle(style) || isNarrowFormatStyle(style) ||
field == ERA && (style & SHORT) == SHORT) {
String val = CalendarDataUtility.retrieveFieldValueName(calendarType, String val = CalendarDataUtility.retrieveFieldValueName(calendarType,
field, fieldValue, field, fieldValue,
style, locale); style, locale);

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -1037,14 +1037,16 @@ class JapaneseImperialCalendar extends Calendar {
} }
if (size < eras.length) { if (size < eras.length) {
int baseStyle = getBaseStyle(style); int baseStyle = getBaseStyle(style);
for (int i = size; i < eras.length; i++) { for (int i = 0; i < eras.length; i++) {
Era era = eras[i]; if (!names.values().contains(i)) {
if (baseStyle == ALL_STYLES || baseStyle == SHORT Era era = eras[i];
|| baseStyle == NARROW_FORMAT) { if (baseStyle == ALL_STYLES || baseStyle == SHORT
names.put(era.getAbbreviation(), i); || baseStyle == NARROW_FORMAT) {
} names.put(era.getAbbreviation(), i);
if (baseStyle == ALL_STYLES || baseStyle == LONG) { }
names.put(era.getName(), i); if (baseStyle == ALL_STYLES || baseStyle == LONG) {
names.put(era.getName(), i);
}
} }
} }
} }

View File

@ -1251,7 +1251,7 @@ class ZipFile implements ZipConstants, Closeable {
idx = getEntryNext(idx); idx = getEntryNext(idx);
} }
/* If not addSlash, or slash is already there, we are done */ /* If not addSlash, or slash is already there, we are done */
if (!addSlash || name[name.length - 1] == '/') { if (!addSlash || name.length == 0 || name[name.length - 1] == '/') {
return -1; return -1;
} }
/* Add slash and try once more */ /* Add slash and try once more */

View File

@ -1,80 +0,0 @@
/*
* Copyright (c) 2013, 2014, 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. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* 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.
*/
package jdk;
import java.lang.annotation.*;
/**
* Indicates whether or not a JDK specific type or package is an
* exported part of the JDK suitable for use outside of the JDK
* implementation itself.
*
* This annotation should only be applied to types and packages
* <em>outside</em> of the Java SE namespaces of {@code java.*} and
* {@code javax.*} packages. For example, certain portions of {@code
* com.sun.*} are official parts of the JDK meant to be generally
* usable while other portions of {@code com.sun.*} are not. This
* annotation type allows those portions to be easily and
* programmatically distinguished.
*
* <p>If in one release a type or package is
* <code>@Exported(true)</code>, in a subsequent major release such a
* type or package can transition to <code>@Exported(false)</code>.
*
* <p>If a type or package is <code>@Exported(false)</code> in a
* release, it may be removed in a subsequent major release.
*
* <p>If a top-level type has an <code>@Exported</code> annotation,
* any nested member types with the top-level type should have an
* <code>@Exported</code> annotation with the same value.
*
* (In exceptional cases, if a nested type is going to be removed
* before its enclosing type, the nested type's could be
* <code>@Exported(false)</code> while its enclosing type was
* <code>@Exported(true)</code>.)
*
* Likewise, if a package has an <code>@Exported</code> annotation,
* top-level types within that package should also have an
* <code>@Exported</code> annotation.
*
* Sometimes a top-level type may have a different
* <code>@Exported</code> value than its package.
*
* @since 1.8
*/
@Documented
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.TYPE, ElementType.PACKAGE})
@Exported
public @interface Exported {
/**
* Whether or not the annotated type or package is an exported
* part of the JDK.
* @return whether or not the annotated type or package is an exported
* part of the JDK
*/
boolean value() default true;
}

View File

@ -48,7 +48,7 @@ import java.util.concurrent.ThreadFactory;
import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import sun.misc.InnocuousThread; import sun.misc.InnocuousThread;
import sun.misc.VM; import jdk.internal.misc.VM;
import sun.util.logging.PlatformLogger; import sun.util.logging.PlatformLogger;
import jdk.internal.logger.LazyLoggers.LazyLoggerAccessor; import jdk.internal.logger.LazyLoggers.LazyLoggerAccessor;

View File

@ -32,7 +32,7 @@ import java.lang.System.LoggerFinder;
import java.lang.System.Logger; import java.lang.System.Logger;
import java.lang.ref.WeakReference; import java.lang.ref.WeakReference;
import java.util.Objects; import java.util.Objects;
import sun.misc.VM; import jdk.internal.misc.VM;
import sun.util.logging.PlatformLogger; import sun.util.logging.PlatformLogger;
/** /**

View File

@ -30,7 +30,7 @@ import java.security.ProtectionDomain;
import sun.reflect.CallerSensitive; import sun.reflect.CallerSensitive;
import sun.reflect.Reflection; import sun.reflect.Reflection;
import sun.misc.VM; import jdk.internal.misc.VM;
import jdk.internal.HotSpotIntrinsicCandidate; import jdk.internal.HotSpotIntrinsicCandidate;

View File

@ -23,7 +23,7 @@
* questions. * questions.
*/ */
package sun.misc; package jdk.internal.misc;
import static java.lang.Thread.State.*; import static java.lang.Thread.State.*;
import java.util.Properties; import java.util.Properties;

View File

@ -23,7 +23,7 @@
* questions. * questions.
*/ */
package sun.misc; package jdk.internal.misc;
/** @deprecated */ /** @deprecated */
@Deprecated @Deprecated

View File

@ -34,7 +34,6 @@ import java.net.SocketOption;
* *
* @since 1.8 * @since 1.8
*/ */
@jdk.Exported
public final class ExtendedSocketOptions { public final class ExtendedSocketOptions {
private static class ExtSocketOption<T> implements SocketOption<T> { private static class ExtSocketOption<T> implements SocketOption<T> {

View File

@ -61,7 +61,6 @@ import java.security.BasicPermission;
* @since 1.8 * @since 1.8
*/ */
@jdk.Exported
public final class NetworkPermission extends BasicPermission { public final class NetworkPermission extends BasicPermission {
private static final long serialVersionUID = -2012939586906722291L; private static final long serialVersionUID = -2012939586906722291L;

View File

@ -45,7 +45,6 @@ import java.lang.annotation.Native;
* *
* @since 1.8 * @since 1.8
*/ */
@jdk.Exported
public class SocketFlow { public class SocketFlow {
private static final int UNSET = -1; private static final int UNSET = -1;
@ -68,7 +67,6 @@ public class SocketFlow {
* *
* @since 1.8 * @since 1.8
*/ */
@jdk.Exported
public enum Status { public enum Status {
/** /**
* Set or get socket option has not been called yet. Status * Set or get socket option has not been called yet. Status

View File

@ -55,7 +55,6 @@ import sun.net.ExtendedOptionsImpl;
* *
* @see java.nio.channels.NetworkChannel * @see java.nio.channels.NetworkChannel
*/ */
@jdk.Exported
public class Sockets { public class Sockets {
private static final HashMap<Class<?>,Set<SocketOption<?>>> private static final HashMap<Class<?>,Set<SocketOption<?>>>

View File

@ -30,5 +30,4 @@
* @since 1.8 * @since 1.8
*/ */
@jdk.Exported
package jdk.net; package jdk.net;

View File

@ -66,6 +66,7 @@ import java.util.TreeSet;
import java.util.jar.Attributes; import java.util.jar.Attributes;
import java.util.jar.JarFile; import java.util.jar.JarFile;
import java.util.jar.Manifest; import java.util.jar.Manifest;
import jdk.internal.misc.VM;
public enum LauncherHelper { public enum LauncherHelper {
INSTANCE; INSTANCE;
@ -86,9 +87,9 @@ public enum LauncherHelper {
private static final String PROP_SETTINGS = "Property settings:"; private static final String PROP_SETTINGS = "Property settings:";
private static final String LOCALE_SETTINGS = "Locale settings:"; private static final String LOCALE_SETTINGS = "Locale settings:";
// sync with java.c and sun.misc.VM // sync with java.c and jdk.internal.misc.VM
private static final String diagprop = "sun.java.launcher.diag"; private static final String diagprop = "sun.java.launcher.diag";
static final boolean trace = sun.misc.VM.getSavedProperty(diagprop) != null; static final boolean trace = VM.getSavedProperty(diagprop) != null;
private static final String defaultBundleName = private static final String defaultBundleName =
"sun.launcher.resources.launcher"; "sun.launcher.resources.launcher";

View File

@ -1,127 +0,0 @@
/*
* Copyright (c) 1995, 2000, 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. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* 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.
*/
package sun.misc;
/**
* MessageUtils: miscellaneous utilities for handling error and status
* properties and messages.
*
* @author Herb Jellinek
*/
public class MessageUtils {
// can instantiate it for to allow less verbose use - via instance
// instead of classname
public MessageUtils() { }
public static String subst(String patt, String arg) {
String args[] = { arg };
return subst(patt, args);
}
public static String subst(String patt, String arg1, String arg2) {
String args[] = { arg1, arg2 };
return subst(patt, args);
}
public static String subst(String patt, String arg1, String arg2,
String arg3) {
String args[] = { arg1, arg2, arg3 };
return subst(patt, args);
}
public static String subst(String patt, String args[]) {
StringBuilder result = new StringBuilder();
int len = patt.length();
for (int i = 0; i >= 0 && i < len; i++) {
char ch = patt.charAt(i);
if (ch == '%') {
if (i != len) {
int index = Character.digit(patt.charAt(i + 1), 10);
if (index == -1) {
result.append(patt.charAt(i + 1));
i++;
} else if (index < args.length) {
result.append(args[index]);
i++;
}
}
} else {
result.append(ch);
}
}
return result.toString();
}
public static String substProp(String propName, String arg) {
return subst(System.getProperty(propName), arg);
}
public static String substProp(String propName, String arg1, String arg2) {
return subst(System.getProperty(propName), arg1, arg2);
}
public static String substProp(String propName, String arg1, String arg2,
String arg3) {
return subst(System.getProperty(propName), arg1, arg2, arg3);
}
/**
* Print a message directly to stderr, bypassing all the
* character conversion methods.
* @param msg message to print
*/
public static native void toStderr(String msg);
/**
* Print a message directly to stdout, bypassing all the
* character conversion methods.
* @param msg message to print
*/
public static native void toStdout(String msg);
// Short forms of the above
public static void err(String s) {
toStderr(s + "\n");
}
public static void out(String s) {
toStdout(s + "\n");
}
// Print a stack trace to stderr
//
public static void where() {
Throwable t = new Throwable();
StackTraceElement[] es = t.getStackTrace();
for (int i = 1; i < es.length; i++)
toStderr("\t" + es[i].toString() + "\n");
}
}

View File

@ -32,6 +32,7 @@ import sun.reflect.CallerSensitive;
import sun.reflect.Reflection; import sun.reflect.Reflection;
import jdk.internal.HotSpotIntrinsicCandidate; import jdk.internal.HotSpotIntrinsicCandidate;
import jdk.internal.misc.VM;
/** /**

View File

@ -389,7 +389,7 @@ public class Util {
static boolean atBugLevel(String bl) { // package-private static boolean atBugLevel(String bl) { // package-private
if (bugLevel == null) { if (bugLevel == null) {
if (!sun.misc.VM.isBooted()) if (!jdk.internal.misc.VM.isBooted())
return false; return false;
String value = AccessController.doPrivileged( String value = AccessController.doPrivileged(
new GetPropertyAction("sun.nio.ch.bugLevel")); new GetPropertyAction("sun.nio.ch.bugLevel"));

View File

@ -156,12 +156,12 @@ public class StandardCharsets extends CharsetProvider {
private boolean initialized = false; private boolean initialized = false;
/* provider the sun.nio.cs.map property fir sjis/ms932 mapping hack /* provider the sun.nio.cs.map property fir sjis/ms932 mapping hack
*/ */
private void init() { private void init() {
if (initialized) if (initialized)
return; return;
if (!sun.misc.VM.isBooted()) if (!jdk.internal.misc.VM.isBooted())
return; return;
initialized = true; initialized = true;

View File

@ -29,6 +29,7 @@ import java.lang.reflect.*;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import jdk.internal.HotSpotIntrinsicCandidate; import jdk.internal.HotSpotIntrinsicCandidate;
import jdk.internal.misc.VM;
/** Common utility routines used by both java.lang and /** Common utility routines used by both java.lang and
java.lang.reflect */ java.lang.reflect */
@ -335,7 +336,7 @@ public class Reflection {
*/ */
public static boolean isCallerSensitive(Method m) { public static boolean isCallerSensitive(Method m) {
final ClassLoader loader = m.getDeclaringClass().getClassLoader(); final ClassLoader loader = m.getDeclaringClass().getClassLoader();
if (sun.misc.VM.isSystemDomainLoader(loader) || isExtClassLoader(loader)) { if (VM.isSystemDomainLoader(loader) || isExtClassLoader(loader)) {
return m.isAnnotationPresent(CallerSensitive.class); return m.isAnnotationPresent(CallerSensitive.class);
} }
return false; return false;

View File

@ -417,14 +417,12 @@ final class SignatureAndHashAlgorithm {
supports(HashAlgorithm.SHA1, SignatureAlgorithm.ECDSA, supports(HashAlgorithm.SHA1, SignatureAlgorithm.ECDSA,
"SHA1withECDSA", --p); "SHA1withECDSA", --p);
if (Security.getProvider("SunMSCAPI") == null) {
supports(HashAlgorithm.SHA224, SignatureAlgorithm.DSA, supports(HashAlgorithm.SHA224, SignatureAlgorithm.DSA,
"SHA224withDSA", --p); "SHA224withDSA", --p);
supports(HashAlgorithm.SHA224, SignatureAlgorithm.RSA, supports(HashAlgorithm.SHA224, SignatureAlgorithm.RSA,
"SHA224withRSA", --p); "SHA224withRSA", --p);
supports(HashAlgorithm.SHA224, SignatureAlgorithm.ECDSA, supports(HashAlgorithm.SHA224, SignatureAlgorithm.ECDSA,
"SHA224withECDSA", --p); "SHA224withECDSA", --p);
}
supports(HashAlgorithm.SHA256, SignatureAlgorithm.DSA, supports(HashAlgorithm.SHA256, SignatureAlgorithm.DSA,
"SHA256withDSA", --p); "SHA256withDSA", --p);

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -103,23 +103,19 @@ Java_java_io_RandomAccessFile_getFilePointer(JNIEnv *env, jobject this) {
JNIEXPORT jlong JNICALL JNIEXPORT jlong JNICALL
Java_java_io_RandomAccessFile_length(JNIEnv *env, jobject this) { Java_java_io_RandomAccessFile_length(JNIEnv *env, jobject this) {
FD fd; FD fd;
jlong cur = jlong_zero; jlong length = jlong_zero;
jlong end = jlong_zero;
fd = GET_FD(this, raf_fd); fd = GET_FD(this, raf_fd);
if (fd == -1) { if (fd == -1) {
JNU_ThrowIOException(env, "Stream Closed"); JNU_ThrowIOException(env, "Stream Closed");
return -1; return -1;
} }
if ((cur = IO_Lseek(fd, 0L, SEEK_CUR)) == -1) { if ((length = IO_GetLength(fd)) == -1) {
JNU_ThrowIOExceptionWithLastError(env, "Seek failed"); JNU_ThrowIOExceptionWithLastError(env, "GetLength failed");
} else if ((end = IO_Lseek(fd, 0L, SEEK_END)) == -1) {
JNU_ThrowIOExceptionWithLastError(env, "Seek failed");
} else if (IO_Lseek(fd, cur, SEEK_SET) == -1) {
JNU_ThrowIOExceptionWithLastError(env, "Seek failed");
} }
return end; return length;
} }
JNIEXPORT void JNICALL JNIEXPORT void JNICALL

View File

@ -26,11 +26,10 @@
#include <stdlib.h> #include <stdlib.h>
#include <jni.h> #include <jni.h>
#include <jni_util.h> #include <jni_util.h>
#include <jlong.h>
#include <stdio.h> #include <stdio.h>
#include <jvm.h> #include <jvm.h>
#include "sun_misc_MessageUtils.h" #include "java_lang_StringCoding.h"
static void static void
printToFile(JNIEnv *env, jstring s, FILE *file) printToFile(JNIEnv *env, jstring s, FILE *file)
@ -41,8 +40,8 @@ printToFile(JNIEnv *env, jstring s, FILE *file)
const jchar *sAsArray; const jchar *sAsArray;
if (s == NULL) { if (s == NULL) {
s = (*env)->NewStringUTF(env, "null"); JNU_ThrowNullPointerException(env, NULL);
if (s == NULL) return; return;
} }
sAsArray = (*env)->GetStringChars(env, s, NULL); sAsArray = (*env)->GetStringChars(env, s, NULL);
@ -70,13 +69,7 @@ printToFile(JNIEnv *env, jstring s, FILE *file)
} }
JNIEXPORT void JNICALL JNIEXPORT void JNICALL
Java_sun_misc_MessageUtils_toStderr(JNIEnv *env, jclass cls, jstring s) Java_java_lang_StringCoding_err(JNIEnv *env, jclass cls, jstring s)
{ {
printToFile(env, s, stderr); printToFile(env, s, stderr);
} }
JNIEXPORT void JNICALL
Java_sun_misc_MessageUtils_toStdout(JNIEnv *env, jclass cls, jstring s)
{
printToFile(env, s, stdout);
}

View File

@ -28,7 +28,7 @@
#include "jvm.h" #include "jvm.h"
#include "jdk_util.h" #include "jdk_util.h"
#include "sun_misc_VM.h" #include "jdk_internal_misc_VM.h"
/* Only register the performance-critical methods */ /* Only register the performance-critical methods */
static JNINativeMethod methods[] = { static JNINativeMethod methods[] = {
@ -36,12 +36,12 @@ static JNINativeMethod methods[] = {
}; };
JNIEXPORT jobject JNICALL JNIEXPORT jobject JNICALL
Java_sun_misc_VM_latestUserDefinedLoader(JNIEnv *env, jclass cls) { Java_jdk_internal_misc_VM_latestUserDefinedLoader(JNIEnv *env, jclass cls) {
return JVM_LatestUserDefinedLoader(env); return JVM_LatestUserDefinedLoader(env);
} }
JNIEXPORT void JNICALL JNIEXPORT void JNICALL
Java_sun_misc_VM_initialize(JNIEnv *env, jclass cls) { Java_jdk_internal_misc_VM_initialize(JNIEnv *env, jclass cls) {
if (!JDK_InitJvmHandle()) { if (!JDK_InitJvmHandle()) {
JNU_ThrowInternalError(env, "Handle for JVM not found for symbol lookup"); JNU_ThrowInternalError(env, "Handle for JVM not found for symbol lookup");
return; return;
@ -50,8 +50,8 @@ Java_sun_misc_VM_initialize(JNIEnv *env, jclass cls) {
// Registers implementations of native methods described in methods[] // Registers implementations of native methods described in methods[]
// above. // above.
// In particular, registers JVM_GetNanoTimeAdjustment as the implementation // In particular, registers JVM_GetNanoTimeAdjustment as the implementation
// of the native sun.misc.VM.getNanoTimeAdjustment - avoiding the cost of // of the native VM.getNanoTimeAdjustment - avoiding the cost of
// introducing a Java_sun_misc_VM_getNanoTimeAdjustment wrapper // introducing a Java_jdk_internal_misc_VM_getNanoTimeAdjustment wrapper
(*env)->RegisterNatives(env, cls, (*env)->RegisterNatives(env, cls,
methods, sizeof(methods)/sizeof(methods[0])); methods, sizeof(methods)/sizeof(methods[0]));
} }

View File

@ -23,12 +23,12 @@
* questions. * questions.
*/ */
package sun.misc; package jdk.internal.misc;
public class OSEnvironment { public class OSEnvironment {
/* /*
* Initialize any miscellenous operating system settings that need to be set * Initialize any miscellaneous operating system settings that need to be set
* for the class libraries. * for the class libraries.
*/ */
public static void initialize() { public static void initialize() {

View File

@ -28,25 +28,25 @@
JNIEXPORT jlong JNICALL JNIEXPORT jlong JNICALL
Java_sun_misc_VM_getuid(JNIEnv *env, jclass thisclass) { Java_jdk_internal_misc_VM_getuid(JNIEnv *env, jclass thisclass) {
return getuid(); return getuid();
} }
JNIEXPORT jlong JNICALL JNIEXPORT jlong JNICALL
Java_sun_misc_VM_geteuid(JNIEnv *env, jclass thisclass) { Java_jdk_internal_misc_VM_geteuid(JNIEnv *env, jclass thisclass) {
return geteuid(); return geteuid();
} }
JNIEXPORT jlong JNICALL JNIEXPORT jlong JNICALL
Java_sun_misc_VM_getgid(JNIEnv *env, jclass thisclass) { Java_jdk_internal_misc_VM_getgid(JNIEnv *env, jclass thisclass) {
return getgid(); return getgid();
} }
JNIEXPORT jlong JNICALL JNIEXPORT jlong JNICALL
Java_sun_misc_VM_getegid(JNIEnv *env, jclass thisclass) { Java_jdk_internal_misc_VM_getegid(JNIEnv *env, jclass thisclass) {
return getegid(); return getegid();
} }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -22,7 +22,6 @@
* or visit www.oracle.com if you need additional information or have any * or visit www.oracle.com if you need additional information or have any
* questions. * questions.
*/ */
#include "jni.h" #include "jni.h"
#include "jni_util.h" #include "jni_util.h"
#include "jvm.h" #include "jvm.h"
@ -219,3 +218,14 @@ handleSetLength(FD fd, jlong length)
RESTARTABLE(ftruncate64(fd, length), result); RESTARTABLE(ftruncate64(fd, length), result);
return result; return result;
} }
jlong
handleGetLength(FD fd)
{
struct stat64 sb;
if (fstat64(fd, &sb) == 0) {
return sb.st_size;
} else {
return -1;
}
}

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -39,7 +39,7 @@ ssize_t handleWrite(FD fd, const void *buf, jint len);
ssize_t handleRead(FD fd, void *buf, jint len); ssize_t handleRead(FD fd, void *buf, jint len);
jint handleAvailable(FD fd, jlong *pbytes); jint handleAvailable(FD fd, jlong *pbytes);
jint handleSetLength(FD fd, jlong length); jint handleSetLength(FD fd, jlong length);
jlong handleGetLength(FD fd);
FD handleOpen(const char *path, int oflag, int mode); FD handleOpen(const char *path, int oflag, int mode);
/* /*
@ -72,6 +72,7 @@ FD handleOpen(const char *path, int oflag, int mode);
#define IO_Append handleWrite #define IO_Append handleWrite
#define IO_Available handleAvailable #define IO_Available handleAvailable
#define IO_SetLength handleSetLength #define IO_SetLength handleSetLength
#define IO_GetLength handleGetLength
#ifdef _ALLBSD_SOURCE #ifdef _ALLBSD_SOURCE
#define open64 open #define open64 open

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2002, 2006, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -93,6 +93,10 @@ Java_sun_nio_ch_NativeThread_signal(JNIEnv *env, jclass cl, jlong thread)
#else #else
ret = pthread_kill((pthread_t)thread, INTERRUPT_SIGNAL); ret = pthread_kill((pthread_t)thread, INTERRUPT_SIGNAL);
#endif #endif
#ifdef MACOSX
if (ret != 0 && ret != ESRCH)
#else
if (ret != 0) if (ret != 0)
#endif
JNU_ThrowIOExceptionWithLastError(env, "Thread signal failed"); JNU_ThrowIOExceptionWithLastError(env, "Thread signal failed");
} }

View File

@ -23,14 +23,14 @@
* questions. * questions.
*/ */
package sun.misc; package jdk.internal.misc;
import sun.io.Win32ErrorMode; import sun.io.Win32ErrorMode;
public class OSEnvironment { public class OSEnvironment {
/* /*
* Initialize any miscellenous operating system settings that need to be set * Initialize any miscellaneous operating system settings that need to be set
* for the class libraries. * for the class libraries.
* <p> * <p>
* At this time only the process-wide error mode needs to be set. * At this time only the process-wide error mode needs to be set.

View File

@ -66,7 +66,7 @@ public class Win32ErrorMode {
* has completed. * has completed.
*/ */
public static void initialize() { public static void initialize() {
if (!sun.misc.VM.isBooted()) { if (!jdk.internal.misc.VM.isBooted()) {
String s = System.getProperty("sun.io.allowCriticalErrorMessageBox"); String s = System.getProperty("sun.io.allowCriticalErrorMessageBox");
if (s == null || s.equals(Boolean.FALSE.toString())) { if (s == null || s.equals(Boolean.FALSE.toString())) {
long mode = setErrorMode(0); long mode = setErrorMode(0);

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -38,8 +38,10 @@ import java.text.spi.NumberFormatProvider;
import java.util.Calendar; import java.util.Calendar;
import java.util.Collections; import java.util.Collections;
import java.util.Currency; import java.util.Currency;
import java.util.HashMap;
import java.util.HashSet; import java.util.HashSet;
import java.util.Locale; import java.util.Locale;
import java.util.Map;
import java.util.ResourceBundle.Control; import java.util.ResourceBundle.Control;
import java.util.Set; import java.util.Set;
import java.util.TimeZone; import java.util.TimeZone;
@ -47,6 +49,7 @@ import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap; import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.atomic.AtomicReferenceArray; import java.util.concurrent.atomic.AtomicReferenceArray;
import java.util.spi.CalendarDataProvider; import java.util.spi.CalendarDataProvider;
import java.util.spi.CalendarNameProvider;
import java.util.spi.CurrencyNameProvider; import java.util.spi.CurrencyNameProvider;
import java.util.spi.LocaleNameProvider; import java.util.spi.LocaleNameProvider;
import sun.util.spi.CalendarProvider; import sun.util.spi.CalendarProvider;
@ -81,6 +84,9 @@ public class HostLocaleProviderAdapterImpl {
private static final int DN_LOCALE_REGION = 4; private static final int DN_LOCALE_REGION = 4;
private static final int DN_LOCALE_VARIANT = 5; private static final int DN_LOCALE_VARIANT = 5;
// Windows Calendar IDs
private static final int CAL_JAPAN = 3;
// Native Calendar ID to LDML calendar type map // Native Calendar ID to LDML calendar type map
private static final String[] calIDToLDML = { private static final String[] calIDToLDML = {
"", "",
@ -95,7 +101,8 @@ public class HostLocaleProviderAdapterImpl {
"gregory_fr", "gregory_fr",
"gregory_ar", "gregory_ar",
"gregory_en", "gregory_en",
"gregory_fr", "gregory_fr", "", "", "", "", "", "", "", "", "", "",
"islamic-umalqura",
}; };
// Caches // Caches
@ -362,6 +369,50 @@ public class HostLocaleProviderAdapterImpl {
}; };
} }
public static CalendarNameProvider getCalendarNameProvider() {
return new CalendarNameProvider() {
@Override
public Locale[] getAvailableLocales() {
return getSupportedCalendarLocales();
}
@Override
public boolean isSupportedLocale(Locale locale) {
return isSupportedCalendarLocale(locale);
}
@Override
public String getDisplayName(String calendarType, int field,
int value, int style, Locale locale) {
String[] names = getCalendarDisplayStrings(removeExtensions(locale).toLanguageTag(),
getCalendarIDFromLDMLType(calendarType), field, style);
if (names != null && value >= 0 && value < names.length) {
return names[value];
} else {
return null;
}
}
@Override
public Map<String, Integer> getDisplayNames(String calendarType,
int field, int style, Locale locale) {
Map<String, Integer> map = null;
String[] names = getCalendarDisplayStrings(removeExtensions(locale).toLanguageTag(),
getCalendarIDFromLDMLType(calendarType), field, style);
if (names != null) {
map = new HashMap<>();
for (int value = 0; value < names.length; value++) {
if (names[value] != null) {
map.put(names[value], value);
}
}
map = map.isEmpty() ? null : map;
}
return map;
}
};
}
public static CalendarProvider getCalendarProvider() { public static CalendarProvider getCalendarProvider() {
return new CalendarProvider() { return new CalendarProvider() {
@Override @Override
@ -496,15 +547,7 @@ public class HostLocaleProviderAdapterImpl {
} }
private static boolean isSupportedCalendarLocale(Locale locale) { private static boolean isSupportedCalendarLocale(Locale locale) {
Locale base = locale; Locale base = stripVariantAndExtensions(locale);
if (base.hasExtensions() || base.getVariant() != "") {
// strip off extensions and variant.
base = new Locale.Builder()
.setLocale(locale)
.clearExtensions()
.build();
}
if (!supportedLocaleSet.contains(base)) { if (!supportedLocaleSet.contains(base)) {
return false; return false;
@ -569,11 +612,23 @@ public class HostLocaleProviderAdapterImpl {
} }
private static boolean isJapaneseCalendar() { private static boolean isJapaneseCalendar() {
return getCalendarID("ja-JP") == 3; // 3: CAL_JAPAN return getCalendarID("ja-JP") == CAL_JAPAN;
}
private static Locale stripVariantAndExtensions(Locale locale) {
if (locale.hasExtensions() || locale.getVariant() != "") {
// strip off extensions and variant.
locale = new Locale.Builder()
.setLocale(locale)
.clearExtensions()
.build();
}
return locale;
} }
private static Locale getCalendarLocale(Locale locale) { private static Locale getCalendarLocale(Locale locale) {
int calid = getCalendarID(locale.toLanguageTag()); int calid = getCalendarID(stripVariantAndExtensions(locale).toLanguageTag());
if (calid > 0 && calid < calIDToLDML.length) { if (calid > 0 && calid < calIDToLDML.length) {
Locale.Builder lb = new Locale.Builder(); Locale.Builder lb = new Locale.Builder();
String[] caltype = calIDToLDML[calid].split("_"); String[] caltype = calIDToLDML[calid].split("_");
@ -589,6 +644,15 @@ public class HostLocaleProviderAdapterImpl {
return locale; return locale;
} }
private static int getCalendarIDFromLDMLType(String ldmlType) {
for (int i = 0; i < calIDToLDML.length; i++) {
if (calIDToLDML[i].startsWith(ldmlType)) {
return i;
}
}
return -1;
}
private static Locale getNumberLocale(Locale src) { private static Locale getNumberLocale(Locale src) {
if (JRELocaleConstants.TH_TH.equals(src)) { if (JRELocaleConstants.TH_TH.equals(src)) {
if (isNativeDigit("th-TH")) { if (isNativeDigit("th-TH")) {
@ -639,6 +703,9 @@ public class HostLocaleProviderAdapterImpl {
// For CalendarDataProvider // For CalendarDataProvider
private static native int getCalendarDataValue(String langTag, int type); private static native int getCalendarDataValue(String langTag, int type);
// For CalendarNameProvider
private static native String[] getCalendarDisplayStrings(String langTag, int calid, int field, int style);
// For Locale/CurrencyNameProvider // For Locale/CurrencyNameProvider
private static native String getDisplayString(String langTag, int key, String value); private static native String getDisplayString(String langTag, int key, String value);
} }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -31,22 +31,33 @@
#define BUFLEN 256 #define BUFLEN 256
// java.util.Calendar constants
#define CALENDAR_FIELD_ERA 0 // Calendar.ERA
#define CALENDAR_FIELD_MONTH 2 // Calendar.MONTH
#define CALENDAR_STYLE_SHORT_MASK 0x00000001 // Calendar.SHORT
#define CALENDAR_STYLE_STANDALONE_MASK 0x00008000 // Calendar.STANDALONE
// global variables // global variables
typedef int (WINAPI *PGLIE)(const jchar *, LCTYPE, LPWSTR, int); typedef int (WINAPI *PGLIE)(const jchar *, LCTYPE, LPWSTR, int);
typedef int (WINAPI *PGCIE)(const jchar *, CALID, LPCWSTR, CALTYPE, LPWSTR, int, LPDWORD); typedef int (WINAPI *PGCIE)(const jchar *, CALID, LPCWSTR, CALTYPE, LPWSTR, int, LPDWORD);
typedef int (WINAPI *PECIEE)(CALINFO_ENUMPROCEXEX, const jchar *, CALID, LPCWSTR, CALTYPE, LPARAM);
PGLIE pGetLocaleInfoEx; PGLIE pGetLocaleInfoEx;
PGCIE pGetCalendarInfoEx; PGCIE pGetCalendarInfoEx;
PECIEE pEnumCalendarInfoExEx;
BOOL initialized = FALSE; BOOL initialized = FALSE;
// prototypes // prototypes
int getLocaleInfoWrapper(const jchar *langtag, LCTYPE type, LPWSTR data, int buflen); int getLocaleInfoWrapper(const jchar *langtag, LCTYPE type, LPWSTR data, int buflen);
int getCalendarInfoWrapper(const jchar *langtag, CALID id, LPCWSTR reserved, CALTYPE type, LPWSTR data, int buflen, LPDWORD val); int getCalendarInfoWrapper(const jchar *langtag, CALID id, LPCWSTR reserved, CALTYPE type, LPWSTR data, int buflen, LPDWORD val);
jint getCalendarID(const jchar *langtag); jint getCalendarID(const jchar *langtag);
void replaceCalendarArrayElems(JNIEnv *env, jstring jlangtag, jobjectArray jarray, void replaceCalendarArrayElems(JNIEnv *env, jstring jlangtag, jint calid, jobjectArray jarray,
CALTYPE* pCalTypes, int offset, int length); CALTYPE* pCalTypes, int offset, int length, int style);
WCHAR * getNumberPattern(const jchar * langtag, const jint numberStyle); WCHAR * getNumberPattern(const jchar * langtag, const jint numberStyle);
void getNumberPart(const jchar * langtag, const jint numberStyle, WCHAR * number); void getNumberPart(const jchar * langtag, const jint numberStyle, WCHAR * number);
void getFixPart(const jchar * langtag, const jint numberStyle, BOOL positive, BOOL prefix, WCHAR * ret); void getFixPart(const jchar * langtag, const jint numberStyle, BOOL positive, BOOL prefix, WCHAR * ret);
int enumCalendarInfoWrapper(const jchar * langtag, CALID calid, CALTYPE type, LPWSTR buf, int buflen);
BOOL CALLBACK EnumCalendarInfoProc(LPWSTR lpCalInfoStr, CALID calid, LPWSTR lpReserved, LPARAM lParam);
jobjectArray getErasImpl(JNIEnv *env, jstring jlangtag, jint calid, jint style, jobjectArray eras);
// from java_props_md.c // from java_props_md.c
extern __declspec(dllexport) const char * getJavaIDFromLangID(LANGID langID); extern __declspec(dllexport) const char * getJavaIDFromLangID(LANGID langID);
@ -83,6 +94,8 @@ CALTYPE sMonthsType[] = {
CAL_SABBREVMONTHNAME13, CAL_SABBREVMONTHNAME13,
}; };
#define MONTHTYPES (sizeof(monthsType) / sizeof(CALTYPE))
CALTYPE wDaysType[] = { CALTYPE wDaysType[] = {
CAL_SDAYNAME7, CAL_SDAYNAME7,
CAL_SDAYNAME1, CAL_SDAYNAME1,
@ -155,6 +168,11 @@ WCHAR * fixes[2][2][3][16] =
} }
}; };
// Localized region name for unknown regions (Windows 10)
#define UNKNOWN_REGION L"Unknown Region ("
#define UNKNOWN_REGION_SIZE wcslen(UNKNOWN_REGION)
/* /*
* Class: sun_util_locale_provider_HostLocaleProviderAdapterImpl * Class: sun_util_locale_provider_HostLocaleProviderAdapterImpl
* Method: initialize * Method: initialize
@ -169,11 +187,15 @@ JNIEXPORT jboolean JNICALL Java_sun_util_locale_provider_HostLocaleProviderAdapt
pGetCalendarInfoEx = (PGCIE)GetProcAddress( pGetCalendarInfoEx = (PGCIE)GetProcAddress(
GetModuleHandle("kernel32.dll"), GetModuleHandle("kernel32.dll"),
"GetCalendarInfoEx"); "GetCalendarInfoEx");
pEnumCalendarInfoExEx = (PECIEE)GetProcAddress(
GetModuleHandle("kernel32.dll"),
"EnumCalendarInfoExEx");
initialized =TRUE; initialized =TRUE;
} }
return pGetLocaleInfoEx != NULL && return pGetLocaleInfoEx != NULL &&
pGetCalendarInfoEx != NULL; pGetCalendarInfoEx != NULL &&
pEnumCalendarInfoExEx != NULL;
} }
/* /*
@ -300,23 +322,7 @@ JNIEXPORT jobjectArray JNICALL Java_sun_util_locale_provider_HostLocaleProviderA
*/ */
JNIEXPORT jobjectArray JNICALL Java_sun_util_locale_provider_HostLocaleProviderAdapterImpl_getEras JNIEXPORT jobjectArray JNICALL Java_sun_util_locale_provider_HostLocaleProviderAdapterImpl_getEras
(JNIEnv *env, jclass cls, jstring jlangtag, jobjectArray eras) { (JNIEnv *env, jclass cls, jstring jlangtag, jobjectArray eras) {
WCHAR ad[BUFLEN]; return getErasImpl(env, jlangtag, -1, 0, eras);
const jchar *langtag = (*env)->GetStringChars(env, jlangtag, JNI_FALSE);
jstring tmp_string;
CHECK_NULL_RETURN(langtag, eras);
getCalendarInfoWrapper(langtag, getCalendarID(langtag), NULL,
CAL_SERASTRING, ad, BUFLEN, NULL);
// Windows does not provide B.C. era.
tmp_string = (*env)->NewString(env, ad, (jsize)wcslen(ad));
if (tmp_string != NULL) {
(*env)->SetObjectArrayElement(env, eras, 1, tmp_string);
}
(*env)->ReleaseStringChars(env, jlangtag, langtag);
return eras;
} }
/* /*
@ -326,8 +332,8 @@ JNIEXPORT jobjectArray JNICALL Java_sun_util_locale_provider_HostLocaleProviderA
*/ */
JNIEXPORT jobjectArray JNICALL Java_sun_util_locale_provider_HostLocaleProviderAdapterImpl_getMonths JNIEXPORT jobjectArray JNICALL Java_sun_util_locale_provider_HostLocaleProviderAdapterImpl_getMonths
(JNIEnv *env, jclass cls, jstring jlangtag, jobjectArray months) { (JNIEnv *env, jclass cls, jstring jlangtag, jobjectArray months) {
replaceCalendarArrayElems(env, jlangtag, months, monthsType, replaceCalendarArrayElems(env, jlangtag, -1, months, monthsType,
0, sizeof(monthsType)/sizeof(CALTYPE)); 0, MONTHTYPES, 0);
return months; return months;
} }
@ -338,8 +344,8 @@ JNIEXPORT jobjectArray JNICALL Java_sun_util_locale_provider_HostLocaleProviderA
*/ */
JNIEXPORT jobjectArray JNICALL Java_sun_util_locale_provider_HostLocaleProviderAdapterImpl_getShortMonths JNIEXPORT jobjectArray JNICALL Java_sun_util_locale_provider_HostLocaleProviderAdapterImpl_getShortMonths
(JNIEnv *env, jclass cls, jstring jlangtag, jobjectArray smonths) { (JNIEnv *env, jclass cls, jstring jlangtag, jobjectArray smonths) {
replaceCalendarArrayElems(env, jlangtag, smonths, sMonthsType, replaceCalendarArrayElems(env, jlangtag, -1, smonths, sMonthsType,
0, sizeof(sMonthsType)/sizeof(CALTYPE)); 0, MONTHTYPES, 0);
return smonths; return smonths;
} }
@ -350,8 +356,8 @@ JNIEXPORT jobjectArray JNICALL Java_sun_util_locale_provider_HostLocaleProviderA
*/ */
JNIEXPORT jobjectArray JNICALL Java_sun_util_locale_provider_HostLocaleProviderAdapterImpl_getWeekdays JNIEXPORT jobjectArray JNICALL Java_sun_util_locale_provider_HostLocaleProviderAdapterImpl_getWeekdays
(JNIEnv *env, jclass cls, jstring jlangtag, jobjectArray wdays) { (JNIEnv *env, jclass cls, jstring jlangtag, jobjectArray wdays) {
replaceCalendarArrayElems(env, jlangtag, wdays, wDaysType, replaceCalendarArrayElems(env, jlangtag, -1, wdays, wDaysType,
1, sizeof(wDaysType)/sizeof(CALTYPE)); 1, sizeof(wDaysType)/sizeof(CALTYPE), 0);
return wdays; return wdays;
} }
@ -362,8 +368,8 @@ JNIEXPORT jobjectArray JNICALL Java_sun_util_locale_provider_HostLocaleProviderA
*/ */
JNIEXPORT jobjectArray JNICALL Java_sun_util_locale_provider_HostLocaleProviderAdapterImpl_getShortWeekdays JNIEXPORT jobjectArray JNICALL Java_sun_util_locale_provider_HostLocaleProviderAdapterImpl_getShortWeekdays
(JNIEnv *env, jclass cls, jstring jlangtag, jobjectArray swdays) { (JNIEnv *env, jclass cls, jstring jlangtag, jobjectArray swdays) {
replaceCalendarArrayElems(env, jlangtag, swdays, sWDaysType, replaceCalendarArrayElems(env, jlangtag, -1, swdays, sWDaysType,
1, sizeof(sWDaysType)/sizeof(CALTYPE)); 1, sizeof(sWDaysType)/sizeof(CALTYPE), 0);
return swdays; return swdays;
} }
@ -674,6 +680,41 @@ JNIEXPORT jint JNICALL Java_sun_util_locale_provider_HostLocaleProviderAdapterIm
} }
} }
/*
* Class: sun_util_locale_provider_HostLocaleProviderAdapterImpl
* Method: getCalendarDisplayStrings
* Signature: (Ljava/lang/String;III)[Ljava/lang/String;
*/
JNIEXPORT jobjectArray JNICALL Java_sun_util_locale_provider_HostLocaleProviderAdapterImpl_getCalendarDisplayStrings
(JNIEnv *env, jclass cls, jstring jlangtag, jint calid, jint field, jint style) {
jobjectArray ret = NULL;
CALTYPE * pCalType = NULL;
switch (field) {
case CALENDAR_FIELD_ERA:
return getErasImpl(env, jlangtag, calid, style, NULL);
case CALENDAR_FIELD_MONTH:
ret = (*env)->NewObjectArray(env, MONTHTYPES,
(*env)->FindClass(env, "java/lang/String"), NULL);
if (ret != NULL) {
if (style & CALENDAR_STYLE_SHORT_MASK) {
pCalType = sMonthsType;
} else {
pCalType = monthsType;
}
replaceCalendarArrayElems(env, jlangtag, calid, ret, pCalType,
0, MONTHTYPES, style);
}
return ret;
default:
// not supported
return NULL;
}
}
/* /*
* Class: sun_util_locale_provider_HostLocaleProviderAdapterImpl * Class: sun_util_locale_provider_HostLocaleProviderAdapterImpl
* Method: getDisplayString * Method: getDisplayString
@ -714,10 +755,15 @@ JNIEXPORT jstring JNICALL Java_sun_util_locale_provider_HostLocaleProviderAdapte
(*env)->ReleaseStringChars(env, jStr, pjChar); (*env)->ReleaseStringChars(env, jStr, pjChar);
if (got) { if (got) {
return (*env)->NewString(env, buf, (jsize)wcslen(buf)); // Hack: Windows 10 returns "Unknown Region (XX)" for localized XX region name.
} else { // Take that as not known.
return NULL; if (type != sun_util_locale_provider_HostLocaleProviderAdapterImpl_DN_LOCALE_REGION ||
wcsncmp(UNKNOWN_REGION, buf, UNKNOWN_REGION_SIZE) != 0) {
return (*env)->NewString(env, buf, (jsize)wcslen(buf));
}
} }
return NULL;
} }
int getLocaleInfoWrapper(const jchar *langtag, LCTYPE type, LPWSTR data, int buflen) { int getLocaleInfoWrapper(const jchar *langtag, LCTYPE type, LPWSTR data, int buflen) {
@ -753,35 +799,62 @@ int getCalendarInfoWrapper(const jchar *langtag, CALID id, LPCWSTR reserved, CAL
} }
jint getCalendarID(const jchar *langtag) { jint getCalendarID(const jchar *langtag) {
DWORD type; DWORD type = -1;
int got = getLocaleInfoWrapper(langtag, int got = getLocaleInfoWrapper(langtag,
LOCALE_ICALENDARTYPE | LOCALE_RETURN_NUMBER, LOCALE_ICALENDARTYPE | LOCALE_RETURN_NUMBER,
(LPWSTR)&type, sizeof(type)); (LPWSTR)&type, sizeof(type));
if (got) { if (got) {
return type; switch (type) {
} else { case CAL_GREGORIAN:
return 0; case CAL_GREGORIAN_US:
case CAL_JAPAN:
case CAL_TAIWAN:
case CAL_HIJRI:
case CAL_THAI:
case CAL_GREGORIAN_ME_FRENCH:
case CAL_GREGORIAN_ARABIC:
case CAL_GREGORIAN_XLIT_ENGLISH:
case CAL_GREGORIAN_XLIT_FRENCH:
case CAL_UMALQURA:
break;
default:
// non-supported calendars return -1
type = -1;
break;
}
} }
return type;
} }
void replaceCalendarArrayElems(JNIEnv *env, jstring jlangtag, jobjectArray jarray, CALTYPE* pCalTypes, int offset, int length) { void replaceCalendarArrayElems(JNIEnv *env, jstring jlangtag, jint calid, jobjectArray jarray, CALTYPE* pCalTypes, int offset, int length, int style) {
WCHAR name[BUFLEN]; WCHAR name[BUFLEN];
const jchar *langtag = (*env)->GetStringChars(env, jlangtag, JNI_FALSE); const jchar *langtag = (*env)->GetStringChars(env, jlangtag, JNI_FALSE);
int calid;
jstring tmp_string; jstring tmp_string;
CALTYPE isGenitive;
CHECK_NULL(langtag); CHECK_NULL(langtag);
calid = getCalendarID(langtag);
if (calid < 0) {
calid = getCalendarID(langtag);
}
if (calid != -1) { if (calid != -1) {
int i; int i;
if (!(style & CALENDAR_STYLE_STANDALONE_MASK)) {
isGenitive = CAL_RETURN_GENITIVE_NAMES;
}
for (i = 0; i < length; i++) { for (i = 0; i < length; i++) {
getCalendarInfoWrapper(langtag, calid, NULL, if (getCalendarInfoWrapper(langtag, calid, NULL,
pCalTypes[i], name, BUFLEN, NULL); pCalTypes[i] | isGenitive, name, BUFLEN, NULL) != 0) {
tmp_string = (*env)->NewString(env, name, (jsize)wcslen(name)); tmp_string = (*env)->NewString(env, name, (jsize)wcslen(name));
if (tmp_string != NULL) { if (tmp_string != NULL) {
(*env)->SetObjectArrayElement(env, jarray, i + offset, tmp_string); (*env)->SetObjectArrayElement(env, jarray, i + offset, tmp_string);
}
} }
} }
} }
@ -924,3 +997,99 @@ void getFixPart(const jchar * langtag, const jint numberStyle, BOOL positive, BO
wcscpy(ret, fixes[!prefix][!positive][style][pattern]); wcscpy(ret, fixes[!prefix][!positive][style][pattern]);
} }
int enumCalendarInfoWrapper(const jchar *langtag, CALID calid, CALTYPE type, LPWSTR buf, int buflen) {
if (pEnumCalendarInfoExEx) {
if (wcscmp(L"und", (LPWSTR)langtag) == 0) {
// defaults to "en"
return pEnumCalendarInfoExEx(&EnumCalendarInfoProc, L"en",
calid, NULL, type, (LPARAM)buf);
} else {
return pEnumCalendarInfoExEx(&EnumCalendarInfoProc, langtag,
calid, NULL, type, (LPARAM)buf);
}
} else {
return 0;
}
}
BOOL CALLBACK EnumCalendarInfoProc(LPWSTR lpCalInfoStr, CALID calid, LPWSTR lpReserved, LPARAM lParam) {
wcscat_s((LPWSTR)lParam, BUFLEN, lpCalInfoStr);
wcscat_s((LPWSTR)lParam, BUFLEN, L",");
return TRUE;
}
jobjectArray getErasImpl(JNIEnv *env, jstring jlangtag, jint calid, jint style, jobjectArray eras) {
const jchar * langtag = (*env)->GetStringChars(env, jlangtag, JNI_FALSE);
WCHAR buf[BUFLEN];
jobjectArray ret = eras;
CALTYPE type;
CHECK_NULL_RETURN(langtag, ret);
buf[0] = '\0';
if (style & CALENDAR_STYLE_SHORT_MASK) {
type = CAL_SABBREVERASTRING;
} else {
type = CAL_SERASTRING;
}
if (calid < 0) {
calid = getCalendarID(langtag);
}
if (calid != -1 && enumCalendarInfoWrapper(langtag, calid, type, buf, BUFLEN)) {
// format in buf: "era0,era1,era2," where era0 is the current one
int eraCount;
LPWSTR current;
jsize array_length;
for(eraCount = 0, current = buf; *current != '\0'; current++) {
if (*current == L',') {
eraCount ++;
}
}
if (eras != NULL) {
array_length = (*env)->GetArrayLength(env, eras);
} else {
// +1 for the "before" era, e.g., BC, which Windows does not return.
array_length = (jsize)eraCount + 1;
ret = (*env)->NewObjectArray(env, array_length,
(*env)->FindClass(env, "java/lang/String"), NULL);
}
if (ret != NULL) {
int eraIndex;
LPWSTR era;
for(eraIndex = 0, era = current = buf; eraIndex < eraCount; era = current, eraIndex++) {
while (*current != L',') {
current++;
}
*current++ = '\0';
if (eraCount - eraIndex < array_length &&
*era != '\0') {
(*env)->SetObjectArrayElement(env, ret,
(jsize)(eraCount - eraIndex),
(*env)->NewString(env, era, (jsize)wcslen(era)));
}
}
// Hack for the Japanese Imperial Calendar to insert Gregorian era for
// "Before Meiji"
if (calid == CAL_JAPAN) {
buf[0] = '\0';
if (enumCalendarInfoWrapper(langtag, CAL_GREGORIAN, type, buf, BUFLEN)) {
jsize len = (jsize)wcslen(buf);
buf[--len] = '\0'; // remove the last ','
(*env)->SetObjectArrayElement(env, ret, 0, (*env)->NewString(env, buf, len));
}
}
}
}
(*env)->ReleaseStringChars(env, jlangtag, langtag);
return ret;
}

View File

@ -27,28 +27,28 @@
JNIEXPORT jlong JNICALL JNIEXPORT jlong JNICALL
Java_sun_misc_VM_getuid(JNIEnv *env, jclass thisclass) { Java_jdk_internal_misc_VM_getuid(JNIEnv *env, jclass thisclass) {
/* -1 means function not available. */ /* -1 means function not available. */
return -1; return -1;
} }
JNIEXPORT jlong JNICALL JNIEXPORT jlong JNICALL
Java_sun_misc_VM_geteuid(JNIEnv *env, jclass thisclass) { Java_jdk_internal_misc_VM_geteuid(JNIEnv *env, jclass thisclass) {
/* -1 means function not available. */ /* -1 means function not available. */
return -1; return -1;
} }
JNIEXPORT jlong JNICALL JNIEXPORT jlong JNICALL
Java_sun_misc_VM_getgid(JNIEnv *env, jclass thisclass) { Java_jdk_internal_misc_VM_getgid(JNIEnv *env, jclass thisclass) {
/* -1 means function not available. */ /* -1 means function not available. */
return -1; return -1;
} }
JNIEXPORT jlong JNICALL JNIEXPORT jlong JNICALL
Java_sun_misc_VM_getegid(JNIEnv *env, jclass thisclass) { Java_jdk_internal_misc_VM_getegid(JNIEnv *env, jclass thisclass) {
/* -1 means function not available. */ /* -1 means function not available. */
return -1; return -1;

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -584,3 +584,14 @@ handleLseek(FD fd, jlong offset, jint whence)
} }
return long_to_jlong(pos.QuadPart); return long_to_jlong(pos.QuadPart);
} }
jlong
handleGetLength(FD fd) {
HANDLE h = (HANDLE) fd;
LARGE_INTEGER length;
if (GetFileSizeEx(h, &length) != 0) {
return long_to_jlong(length.QuadPart);
} else {
return -1;
}
}

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -44,6 +44,7 @@ int currentDirLength(const WCHAR* path, int pathlen);
int handleAvailable(FD fd, jlong *pbytes); int handleAvailable(FD fd, jlong *pbytes);
int handleSync(FD fd); int handleSync(FD fd);
int handleSetLength(FD fd, jlong length); int handleSetLength(FD fd, jlong length);
jlong handleGetLength(FD fd);
JNIEXPORT jint handleRead(FD fd, void *buf, jint len); JNIEXPORT jint handleRead(FD fd, void *buf, jint len);
jint handleWrite(FD fd, const void *buf, jint len); jint handleWrite(FD fd, const void *buf, jint len);
jint handleAppend(FD fd, const void *buf, jint len); jint handleAppend(FD fd, const void *buf, jint len);
@ -84,6 +85,7 @@ FD winFileHandleOpen(JNIEnv *env, jstring path, int flags);
#define IO_Lseek handleLseek #define IO_Lseek handleLseek
#define IO_Available handleAvailable #define IO_Available handleAvailable
#define IO_SetLength handleSetLength #define IO_SetLength handleSetLength
#define IO_GetLength handleGetLength
/* /*
* Setting the handle field in Java_java_io_FileDescriptor_set for * Setting the handle field in Java_java_io_FileDescriptor_set for

View File

@ -35,8 +35,6 @@ import java.util.Vector;
import java.util.Enumeration; import java.util.Enumeration;
import java.net.URL; import java.net.URL;
import sun.misc.MessageUtils;
/** /**
* A simple DTD-driven HTML parser. The parser reads an * A simple DTD-driven HTML parser. The parser reads an
* HTML file from an InputStream and calls various methods * HTML file from an InputStream and calls various methods

View File

@ -44,7 +44,6 @@ import sun.awt.AppContext;
import sun.awt.EmbeddedFrame; import sun.awt.EmbeddedFrame;
import sun.awt.SunToolkit; import sun.awt.SunToolkit;
import sun.misc.ManagedLocalsThread; import sun.misc.ManagedLocalsThread;
import sun.misc.MessageUtils;
import sun.misc.PerformanceLogger; import sun.misc.PerformanceLogger;
import sun.security.util.SecurityConstants; import sun.security.util.SecurityConstants;
@ -118,8 +117,6 @@ abstract class AppletPanel extends Panel implements AppletStub, Runnable {
*/ */
Dimension currentAppletSize = new Dimension(10, 10); Dimension currentAppletSize = new Dimension(10, 10);
MessageUtils mu = new MessageUtils();
/** /**
* The thread to use during applet loading * The thread to use during applet loading
*/ */

View File

@ -639,7 +639,7 @@ public class FileHandler extends StreamHandler {
continue; continue;
} else if (ch2 == 'h') { } else if (ch2 == 'h') {
file = new File(System.getProperty("user.home")); file = new File(System.getProperty("user.home"));
if (sun.misc.VM.isSetUID()) { if (jdk.internal.misc.VM.isSetUID()) {
// Ok, we are in a set UID program. For safety's sake // Ok, we are in a set UID program. For safety's sake
// we disallow attempts to open files relative to %h. // we disallow attempts to open files relative to %h.
throw new IOException("can't use %h in set UID program"); throw new IOException("can't use %h in set UID program");

View File

@ -583,7 +583,7 @@ public class ManagementFactory {
ClassLoader loader = ClassLoader loader =
AccessController.doPrivileged( AccessController.doPrivileged(
(PrivilegedAction<ClassLoader>) () -> cls.getClassLoader()); (PrivilegedAction<ClassLoader>) () -> cls.getClassLoader());
if (!sun.misc.VM.isSystemDomainLoader(loader)) { if (!jdk.internal.misc.VM.isSystemDomainLoader(loader)) {
throw new IllegalArgumentException(mxbeanName + throw new IllegalArgumentException(mxbeanName +
" is not a platform MXBean"); " is not a platform MXBean");
} }

View File

@ -473,7 +473,7 @@ public class ManagementFactoryHelper {
public static Thread.State toThreadState(int state) { public static Thread.State toThreadState(int state) {
// suspended and native bits may be set in state // suspended and native bits may be set in state
int threadStatus = state & ~JMM_THREAD_STATE_FLAG_MASK; int threadStatus = state & ~JMM_THREAD_STATE_FLAG_MASK;
return sun.misc.VM.toThreadState(threadStatus); return jdk.internal.misc.VM.toThreadState(threadStatus);
} }
// These values are defined in jmm.h // These values are defined in jmm.h

View File

@ -59,7 +59,7 @@ class MemoryImpl extends NotificationEmitterSupport
} }
public int getObjectPendingFinalizationCount() { public int getObjectPendingFinalizationCount() {
return sun.misc.VM.getFinalRefCount(); return jdk.internal.misc.VM.getFinalRefCount();
} }
public void gc() { public void gc() {

View File

@ -262,7 +262,7 @@ public class MarshalInputStream extends ObjectInputStream {
* if only code from the null class loader is on the stack. * if only code from the null class loader is on the stack.
*/ */
private static ClassLoader latestUserDefinedLoader() { private static ClassLoader latestUserDefinedLoader() {
return sun.misc.VM.latestUserDefinedLoader(); return jdk.internal.misc.VM.latestUserDefinedLoader();
} }
/** /**

View File

@ -397,7 +397,7 @@ public class FileCredentialsCache extends CredentialsCache
*/ */
if (osname != null && !osname.startsWith("Windows")) { if (osname != null && !osname.startsWith("Windows")) {
long uid = sun.misc.VM.getuid(); long uid = jdk.internal.misc.VM.getuid();
if (uid != -1) { if (uid != -1) {
name = File.separator + "tmp" + name = File.separator + "tmp" +
File.separator + stdCacheNameComponent + "_" + uid; File.separator + stdCacheNameComponent + "_" + uid;

View File

@ -60,7 +60,7 @@ import sun.security.krb5.internal.ReplayCache;
* *
* service_euid * service_euid
* *
* in which euid is available as sun.misc.VM.geteuid(). * in which euid is available as jdk.internal.misc.VM.geteuid().
* *
* The file has a header: * The file has a header:
* *
@ -107,7 +107,7 @@ public class DflCache extends ReplayCache {
private static long uid; private static long uid;
static { static {
// Available on Solaris, Linux and Mac. Otherwise, -1 and no _euid suffix // Available on Solaris, Linux and Mac. Otherwise, -1 and no _euid suffix
uid = sun.misc.VM.geteuid(); uid = jdk.internal.misc.VM.geteuid();
} }
public DflCache (String source) { public DflCache (String source) {

View File

@ -1582,4 +1582,43 @@ public interface Statement extends Wrapper, AutoCloseable {
return len >= 1 && len <= 128 return len >= 1 && len <= 128
&& Pattern.compile("[\\p{Alpha}][\\p{Alnum}_]*").matcher(identifier).matches(); && Pattern.compile("[\\p{Alpha}][\\p{Alnum}_]*").matcher(identifier).matches();
} }
/**
* Returns a {@code String} representing a National Character Set Literal
* enclosed in single quotes and prefixed with a upper case letter N.
* Any occurrence of a single quote within the string will be replaced
* by two single quotes.
*
* <blockquote>
* <table border = 1 cellspacing=0 cellpadding=5 >
* <caption>Examples of the conversion:</caption>
* <tr>
* <th>Value</th>
* <th>Result</th>
* </tr>
* <tr> <td align='center'>Hello</td> <td align='center'>N'Hello'</td> </tr>
* <tr> <td align='center'>G'Day</td> <td align='center'>N'G''Day'</td> </tr>
* <tr> <td align='center'>'G''Day'</td>
* <td align='center'>N'''G''''Day'''</td> </tr>
* <tr> <td align='center'>I'''M</td> <td align='center'>N'I''''''M'</td>
* <tr> <td align='center'>N'Hello'</td> <td align='center'>N'N''Hello'''</td> </tr>
*
* </table>
* </blockquote>
* @implNote
* JDBC driver implementations may need to provide their own implementation
* of this method in order to meet the requirements of the underlying
* datasource. An implementation of enquoteNCharLiteral may accept a different
* set of characters than that accepted by the same drivers implementation of
* enquoteLiteral.
* @param val a character string
* @return the result of replacing every single quote character in the
* argument by two single quote characters where this entire result is
* then prefixed with 'N'.
* @throws NullPointerException if val is {@code null}
* @throws SQLException if a database access error occurs
*/
default String enquoteNCharLiteral(String val) throws SQLException {
return "N'" + val.replace("'", "''") + "'";
}
} }

View File

@ -45,7 +45,6 @@ import sun.awt.AWTPermissions;
* level support for capturing the top-level containers as they are created. * level support for capturing the top-level containers as they are created.
*/ */
@jdk.Exported
public class AWTEventMonitor { public class AWTEventMonitor {
/** /**

View File

@ -43,7 +43,6 @@ import javax.accessibility.*;
* *
*/ */
@jdk.Exported
public class AccessibilityEventMonitor { public class AccessibilityEventMonitor {
// listeners // listeners

View File

@ -37,7 +37,6 @@ import javax.accessibility.*;
* *
*/ */
@jdk.Exported
public class AccessibilityListenerList { public class AccessibilityListenerList {
/* A null array to be shared by all empty listener lists */ /* A null array to be shared by all empty listener lists */
private final static Object[] NULL_ARRAY = new Object[0]; private final static Object[] NULL_ARRAY = new Object[0];

View File

@ -35,7 +35,6 @@ package com.sun.java.accessibility.util;
* @see SwingEventMonitor * @see SwingEventMonitor
* *
*/ */
@jdk.Exported
public class EventID { public class EventID {
/** /**

View File

@ -40,7 +40,6 @@ import java.security.PrivilegedAction;
* @see AWTEventMonitor * @see AWTEventMonitor
* @see SwingEventMonitor * @see SwingEventMonitor
*/ */
@jdk.Exported
public class EventQueueMonitor public class EventQueueMonitor
implements AWTEventListener { implements AWTEventListener {

View File

@ -49,7 +49,6 @@ import javax.accessibility.*;
* @see EventQueueMonitor#removeGUIInitializedListener * @see EventQueueMonitor#removeGUIInitializedListener
* *
*/ */
@jdk.Exported
public interface GUIInitializedListener extends EventListener { public interface GUIInitializedListener extends EventListener {
/** /**

View File

@ -56,7 +56,6 @@ import javax.accessibility.*;
* @see AWTEventMonitor * @see AWTEventMonitor
* *
*/ */
@jdk.Exported
public class SwingEventMonitor extends AWTEventMonitor { public class SwingEventMonitor extends AWTEventMonitor {
/** /**

View File

@ -43,7 +43,6 @@ import javax.accessibility.*;
* @see EventQueueMonitor#removeTopLevelWindowListener * @see EventQueueMonitor#removeTopLevelWindowListener
* *
*/ */
@jdk.Exported
public interface TopLevelWindowListener extends EventListener { public interface TopLevelWindowListener extends EventListener {
/** /**

View File

@ -58,7 +58,6 @@ import javax.accessibility.*;
* to implement accessibility features for a toolkit. Instead of relying upon this * to implement accessibility features for a toolkit. Instead of relying upon this
* code, a toolkit's components should implement interface {@code Accessible} directly. * code, a toolkit's components should implement interface {@code Accessible} directly.
*/ */
@jdk.Exported
public class Translator extends AccessibleContext public class Translator extends AccessibleContext
implements Accessible, AccessibleComponent { implements Accessible, AccessibleComponent {

View File

@ -53,7 +53,6 @@ import java.util.concurrent.CountDownLatch;
* Note: This class has to be public. It's loaded from the VM like this: * Note: This class has to be public. It's loaded from the VM like this:
* Class.forName(atName).newInstance(); * Class.forName(atName).newInstance();
*/ */
@jdk.Exported(false)
final public class AccessBridge { final public class AccessBridge {
private static AccessBridge theAccessBridge; private static AccessBridge theAccessBridge;

View File

@ -40,7 +40,6 @@ package com.sun.tools.attach;
* the error returned by the agent's {@code Agent_OnAttach} function. * the error returned by the agent's {@code Agent_OnAttach} function.
* This error code can be obtained by invoking the {@link #returnValue() returnValue} method. * This error code can be obtained by invoking the {@link #returnValue() returnValue} method.
*/ */
@jdk.Exported
public class AgentInitializationException extends Exception { public class AgentInitializationException extends Exception {
/** use serialVersionUID for interoperability */ /** use serialVersionUID for interoperability */

View File

@ -36,7 +36,6 @@ package com.sun.tools.attach;
* com.sun.tools.attach.VirtualMachine#loadAgentPath loadAgentPath} methods * com.sun.tools.attach.VirtualMachine#loadAgentPath loadAgentPath} methods
* if the agent, or agent library, cannot be loaded. * if the agent, or agent library, cannot be loaded.
*/ */
@jdk.Exported
public class AgentLoadException extends Exception { public class AgentLoadException extends Exception {
/** use serialVersionUID for interoperability */ /** use serialVersionUID for interoperability */

View File

@ -36,7 +36,6 @@ import com.sun.tools.attach.spi.AttachProvider; // for javadoc
* AttachProvider.attachVirtualMachine} if the provider attempts to * AttachProvider.attachVirtualMachine} if the provider attempts to
* attach to a Java virtual machine with which it not comptatible. * attach to a Java virtual machine with which it not comptatible.
*/ */
@jdk.Exported
public class AttachNotSupportedException extends Exception { public class AttachNotSupportedException extends Exception {
/** use serialVersionUID for interoperability */ /** use serialVersionUID for interoperability */

View File

@ -37,7 +37,6 @@ import java.io.IOException;
* *
* @since 1.9 * @since 1.9
*/ */
@jdk.Exported
public class AttachOperationFailedException extends IOException { public class AttachOperationFailedException extends IOException {
private static final long serialVersionUID = 2140308168167478043L; private static final long serialVersionUID = 2140308168167478043L;

View File

@ -79,7 +79,6 @@ package com.sun.tools.attach;
* @see com.sun.tools.attach.spi.AttachProvider * @see com.sun.tools.attach.spi.AttachProvider
*/ */
@jdk.Exported
public final class AttachPermission extends java.security.BasicPermission { public final class AttachPermission extends java.security.BasicPermission {
/** use serialVersionUID for interoperability */ /** use serialVersionUID for interoperability */

View File

@ -96,7 +96,6 @@ import java.io.IOException;
* @since 1.6 * @since 1.6
*/ */
@jdk.Exported
public abstract class VirtualMachine { public abstract class VirtualMachine {
private AttachProvider provider; private AttachProvider provider;
private String id; private String id;

View File

@ -55,7 +55,6 @@ import com.sun.tools.attach.spi.AttachProvider;
* *
* @since 1.6 * @since 1.6
*/ */
@jdk.Exported
public class VirtualMachineDescriptor { public class VirtualMachineDescriptor {
private AttachProvider provider; private AttachProvider provider;

View File

@ -38,5 +38,4 @@
* @since 1.6 * @since 1.6
*/ */
@jdk.Exported
package com.sun.tools.attach; package com.sun.tools.attach;

View File

@ -74,7 +74,6 @@ import java.util.ServiceLoader;
* @since 1.6 * @since 1.6
*/ */
@jdk.Exported
public abstract class AttachProvider { public abstract class AttachProvider {
private static final Object lock = new Object(); private static final Object lock = new Object();

Some files were not shown because too many files have changed in this diff Show More