提交 48dc82d9 编写于 作者: D duke

Merge

......@@ -213,3 +213,4 @@ e1a929afcfc492470d50be0b6b0e8dc77d3760b9 jdk8-b88
892a0196d10c67f3a12f0eefb0bb536e423d8868 jdk8-b89
69b773a221b956a3386933ecdbfeccee0edeac47 jdk8-b90
cb51fb4789ac0b8be4056482077ddfb8f3bd3805 jdk8-b91
3a36c926a7aafa9d4a892a45ef3678e87ad8359b jdk8-b92
......@@ -72,7 +72,7 @@ AC_DEFUN([BASIC_FIXUP_PATH],
AC_MSG_ERROR([The path of $1, which resolves as "$path", is not found.])
fi
$1="`cd "$path"; $THEPWDCMD`"
$1="`cd "$path"; $THEPWDCMD -L`"
fi
])
......@@ -169,10 +169,10 @@ AC_DEFUN([BASIC_REMOVE_SYMBOLIC_LINKS],
COUNTER=0
sym_link_dir=`$DIRNAME [$]$1`
sym_link_file=`$BASENAME [$]$1`
# Use the system pwd and not the shell builtin to resolve directory symlinks
cd $sym_link_dir
cd `$THEPWDCMD`
sym_link_dir=`$THEPWDCMD`
# Use -P flag to resolve symlinks in directories.
cd `$THEPWDCMD -P`
sym_link_dir=`$THEPWDCMD -P`
# Resolve file symlinks
while test $COUNTER -lt 20; do
ISLINK=`$LS -l $sym_link_dir/$sym_link_file | $GREP '\->' | $SED -e 's/.*-> \(.*\)/\1/'`
......@@ -183,7 +183,7 @@ AC_DEFUN([BASIC_REMOVE_SYMBOLIC_LINKS],
# Again resolve directory symlinks since the target of the just found
# link could be in a different directory
cd `$DIRNAME $ISLINK`
sym_link_dir=`$THEPWDCMD`
sym_link_dir=`$THEPWDCMD -P`
sym_link_file=`$BASENAME $ISLINK`
let COUNTER=COUNTER+1
done
......@@ -264,7 +264,6 @@ BASIC_REQUIRE_PROG(MKDIR, mkdir)
BASIC_REQUIRE_PROG(MKTEMP, mktemp)
BASIC_REQUIRE_PROG(MV, mv)
BASIC_REQUIRE_PROG(PRINTF, printf)
BASIC_REQUIRE_PROG(THEPWDCMD, pwd)
BASIC_REQUIRE_PROG(RM, rm)
BASIC_REQUIRE_PROG(SH, sh)
BASIC_REQUIRE_PROG(SORT, sort)
......@@ -297,6 +296,10 @@ BASIC_CHECK_NONEMPTY(NAWK)
# Always force rm.
RM="$RM -f"
# pwd behaves differently on various platforms and some don't support the -L flag.
# Always use the bash builtin pwd to get uniform behavior.
THEPWDCMD=pwd
# These are not required on all platforms
AC_PATH_PROG(CYGPATH, cygpath)
AC_PATH_PROG(READLINK, readlink)
......@@ -309,13 +312,12 @@ AC_DEFUN_ONCE([BASIC_SETUP_PATHS],
[
# Locate the directory of this script.
SCRIPT="[$]0"
BASIC_REMOVE_SYMBOLIC_LINKS(SCRIPT)
AUTOCONF_DIR=`cd \`$DIRNAME $SCRIPT\`; $THEPWDCMD`
AUTOCONF_DIR=`cd \`$DIRNAME $SCRIPT\`; $THEPWDCMD -L`
# Where is the source? It is located two levels above the configure script.
CURDIR="$PWD"
cd "$AUTOCONF_DIR/../.."
SRC_ROOT="`$THEPWDCMD`"
SRC_ROOT="`$THEPWDCMD -L`"
if test "x$OPENJDK_TARGET_OS" = "xwindows"; then
PATH_SEP=";"
......@@ -374,13 +376,9 @@ AC_ARG_WITH(conf-name, [AS_HELP_STRING([--with-conf-name],
[ CONF_NAME=${with_conf_name} ])
# Test from where we are running configure, in or outside of src root.
# To enable comparison of directories, CURDIR needs to be symlink free
# just like SRC_ROOT already is
NOSYM_CURDIR="$CURDIR"
BASIC_REMOVE_SYMBOLIC_LINKS(NOSYM_CURDIR)
if test "x$NOSYM_CURDIR" = "x$SRC_ROOT" || test "x$NOSYM_CURDIR" = "x$SRC_ROOT/common" \
|| test "x$NOSYM_CURDIR" = "x$SRC_ROOT/common/autoconf" \
|| test "x$NOSYM_CURDIR" = "x$SRC_ROOT/common/makefiles" ; then
if test "x$CURDIR" = "x$SRC_ROOT" || test "x$CURDIR" = "x$SRC_ROOT/common" \
|| test "x$CURDIR" = "x$SRC_ROOT/common/autoconf" \
|| test "x$CURDIR" = "x$SRC_ROOT/common/makefiles" ; then
# We are running configure from the src root.
# Create a default ./build/target-variant-debuglevel output root.
if test "x${CONF_NAME}" = x; then
......@@ -617,6 +615,20 @@ fi
if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then
BASIC_REQUIRE_PROG(XATTR, xattr)
AC_PATH_PROG(CODESIGN, codesign)
if test "x$CODESIGN" != "x"; then
# Verify that the openjdk_codesign certificate is present
AC_MSG_CHECKING([if openjdk_codesign certificate is present])
rm -f codesign-testfile
touch codesign-testfile
codesign -s openjdk_codesign codesign-testfile 2>&AS_MESSAGE_LOG_FD >&AS_MESSAGE_LOG_FD || CODESIGN=
rm -f codesign-testfile
if test "x$CODESIGN" = x; then
AC_MSG_RESULT([no])
else
AC_MSG_RESULT([yes])
fi
fi
fi
])
......
......@@ -300,7 +300,7 @@ AC_DEFUN([BASIC_FIXUP_EXECUTABLE_MSYS],
# Setup basic configuration paths, and platform-specific stuff related to PATHs.
AC_DEFUN([BASIC_CHECK_PATHS_WINDOWS],
[
SRC_ROOT_LENGTH=`$THEPWDCMD|$WC -m`
SRC_ROOT_LENGTH=`$THEPWDCMD -L|$WC -m`
if test $SRC_ROOT_LENGTH -gt 100; then
AC_MSG_ERROR([Your base path is too long. It is $SRC_ROOT_LENGTH characters long, but only 100 is supported])
fi
......
......@@ -145,6 +145,9 @@ AC_DEFUN_ONCE([BPERF_SETUP_BUILD_JOBS],
if test "$JOBS" -gt "16"; then
JOBS=16
fi
if test "$JOBS" -eq "0"; then
JOBS=1
fi
AC_MSG_RESULT([$JOBS])
else
JOBS=$with_jobs
......
......@@ -422,6 +422,14 @@ if test "x$MILESTONE" = x; then
MILESTONE=internal
fi
AC_ARG_WITH(update-version, [AS_HELP_STRING([--with-update-version],
[Set update version value for build @<:@b00@:>@])])
if test "x$with_update_version" = xyes; then
AC_MSG_ERROR([Update version must have a value])
elif test "x$with_update_version" != x; then
JDK_UPDATE_VERSION="$with_update_version"
fi
AC_ARG_WITH(build-number, [AS_HELP_STRING([--with-build-number],
[Set build number value for build @<:@b00@:>@])])
if test "x$with_build_number" = xyes; then
......
......@@ -478,6 +478,7 @@ CCACHE:=@CCACHE@
# CD is going away, but remains to cater for legacy makefiles.
CD:=cd
CHMOD:=@CHMOD@
CODESIGN:=@CODESIGN@
COMM:=@COMM@
CP:=@CP@
CPIO:=@CPIO@
......
......@@ -36,7 +36,7 @@ AC_DEFUN([TOOLCHAIN_CHECK_COMPILER_VERSION],
$ECHO $COMPILER_VERSION_TEST | $GREP "^.*: Sun $COMPILER_NAME" > /dev/null
if test $? -ne 0; then
GCC_VERSION_TEST=`$COMPILER --version 2>&1 | $HEAD -n 1`
AC_MSG_NOTICE([The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required Sun Studio compiler.])
AC_MSG_NOTICE([The result from running with -V was: "$COMPILER_VERSION_TEST" and with --version: "$GCC_VERSION_TEST"])
AC_MSG_ERROR([Sun Studio compiler is required. Try setting --with-tools-dir.])
......@@ -69,7 +69,7 @@ AC_DEFUN([TOOLCHAIN_CHECK_COMPILER_VERSION],
AC_MSG_NOTICE([The result from running with --version was: "$COMPILER_VERSION_TEST"])
AC_MSG_ERROR([GCC compiler is required. Try setting --with-tools-dir.])
fi
# First line typically looks something like:
# gcc (Ubuntu/Linaro 4.5.2-8ubuntu4) 4.5.2
COMPILER_VERSION=`$ECHO $COMPILER_VERSION_TEST | $SED -n "s/^.* \(@<:@1-9@:>@@<:@0-9.@:>@*\)/\1/p"`
......@@ -142,7 +142,7 @@ AC_DEFUN([TOOLCHAIN_FIND_COMPILER],
BASIC_REMOVE_SYMBOLIC_LINKS(TEST_COMPILER)
AC_MSG_RESULT([$TEST_COMPILER])
AC_MSG_CHECKING([if $1 is disguised ccache])
COMPILER_BASENAME=`$BASENAME "$TEST_COMPILER"`
if test "x$COMPILER_BASENAME" = "xccache"; then
AC_MSG_RESULT([yes, trying to find proper $COMPILER_NAME compiler])
......@@ -226,11 +226,11 @@ BDEPS_CHECK_MODULE(DEVKIT, devkit, xxx,
],
[])
if test "x$SYS_ROOT" != "x/" ; then
if test "x$SYS_ROOT" != "x/" ; then
CFLAGS="--sysroot=$SYS_ROOT $CFLAGS"
CXXFLAGS="--sysroot=$SYS_ROOT $CXXFLAGS"
OBJCFLAGS="--sysroot=$SYS_ROOT $OBJCFLAGS"
OBJCXXFLAGS="--sysroot=$SYS_ROOT $OBJCFLAGS"
OBJCFLAGS="--sysroot=$SYS_ROOT $OBJCFLAGS"
OBJCXXFLAGS="--sysroot=$SYS_ROOT $OBJCFLAGS"
CPPFLAGS="--sysroot=$SYS_ROOT $CPPFLAGS"
LDFLAGS="--sysroot=$SYS_ROOT $LDFLAGS"
fi
......@@ -330,7 +330,7 @@ AC_SUBST(HOTSPOT_LD)
COMPILER_NAME=gcc
COMPILER_TYPE=CC
AS_IF([test "x$OPENJDK_TARGET_OS" = xwindows], [
# For now, assume that we are always compiling using cl.exe.
# For now, assume that we are always compiling using cl.exe.
CC_OUT_OPTION=-Fo
EXE_OUT_OPTION=-out:
LD_OUT_OPTION=-out:
......@@ -491,7 +491,7 @@ AC_DEFUN_ONCE([TOOLCHAIN_SETUP_COMPILER_FLAGS_FOR_LIBS],
###############################################################################
#
# How to compile shared libraries.
# How to compile shared libraries.
#
if test "x$GCC" = xyes; then
......@@ -525,7 +525,7 @@ if test "x$GCC" = xyes; then
SHARED_LIBRARY_FLAGS="-dynamiclib -compatibility_version 1.0.0 -current_version 1.0.0 $PICFLAG"
SHARED_LIBRARY_SUFFIX='.dylib'
EXE_SUFFIX=''
SET_SHARED_LIBRARY_NAME='-Xlinker -install_name -Xlinker @rpath/[$]1'
SET_SHARED_LIBRARY_NAME='-Xlinker -install_name -Xlinker @rpath/[$]1'
SET_SHARED_LIBRARY_MAPFILE=''
SET_SHARED_LIBRARY_ORIGIN='-Xlinker -rpath -Xlinker @loader_path/.'
SET_EXECUTABLE_ORIGIN="$SET_SHARED_LIBRARY_ORIGIN"
......@@ -676,7 +676,7 @@ case $COMPILER_TYPE in
# Use single precision floating point with 'float'
CC_HIGHEST="$CC_HIGHEST -fsingle"
# Assume memory references via basic pointer types do not alias
# (Source with excessing pointer casting and data access with mixed
# (Source with excessing pointer casting and data access with mixed
# pointer types are not recommended)
CC_HIGHEST="$CC_HIGHEST -xalias_level=basic"
# Use intrinsic or inline versions for math/std functions
......@@ -892,7 +892,7 @@ if test "x$OPENJDK_TARGET_OS" = xsolaris; then
fi
if test "x$OPENJDK_TARGET_OS" = xmacosx; then
CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DMACOSX -D_ALLBSD_SOURCE"
# Setting these parameters makes it an error to link to macosx APIs that are
# Setting these parameters makes it an error to link to macosx APIs that are
# newer than the given OS version and makes the linked binaries compatible even
# if built on a newer version of the OS.
# The expected format is X.Y.Z
......@@ -940,12 +940,12 @@ CXXFLAGS_JDKEXE="$CCXXFLAGS_JDK $CXXFLAGS_JDK"
# Which should we link to? Are we lucky enough that the binary api to the libjvm.so library
# is identical for client and server? Yes. Which is picked at runtime (client or server)?
# Neither, since the chosen libjvm.so has already been loaded by the launcher, all the following
# libraries will link to whatever is in memory. Yuck.
# libraries will link to whatever is in memory. Yuck.
#
# Thus we offer the compiler to find libjvm.so first in server then in client. It works. Ugh.
if test "x$COMPILER_NAME" = xcl; then
LDFLAGS_JDK="$LDFLAGS_JDK -nologo -opt:ref -incremental:no"
if test "x$OPENJDK_TARGET_CPU" = xx86; then
if test "x$OPENJDK_TARGET_CPU" = xx86; then
LDFLAGS_JDK="$LDFLAGS_JDK -safeseh"
fi
# TODO: make -debug optional "--disable-full-debug-symbols"
......@@ -965,7 +965,7 @@ else
if test -n "$HAS_GNU_HASH"; then
LDFLAGS_JDK="${LDFLAGS_JDK} -Xlinker --hash-style=both "
fi
if test "x$OPENJDK_TARGET_OS" = xlinux; then
if test "x$OPENJDK_TARGET_OS" = xlinux; then
# And since we now know that the linker is gnu, then add -z defs, to forbid
# undefined symbols in object files.
LDFLAGS_JDK="${LDFLAGS_JDK} -Xlinker -z -Xlinker defs"
......@@ -1006,7 +1006,7 @@ fi
# Adjust flags according to debug level.
case $DEBUG_LEVEL in
fastdebug )
fastdebug )
CFLAGS="$CFLAGS $D_FLAG"
JAVAC_FLAGS="$JAVAC_FLAGS -g"
;;
......@@ -1018,9 +1018,9 @@ case $DEBUG_LEVEL in
CXX_O_FLAG_NORM="$CXX_O_FLAG_NONE"
JAVAC_FLAGS="$JAVAC_FLAGS -g"
;;
esac
esac
AC_SUBST(CFLAGS_JDKLIB)
AC_SUBST(CFLAGS_JDKEXE)
......@@ -1092,28 +1092,45 @@ AC_DEFUN_ONCE([TOOLCHAIN_SETUP_COMPILER_FLAGS_MISC],
AC_SUBST(COMPILER_SUPPORTS_TARGET_BITS_FLAG)
])
# Setup the JTREG paths
AC_DEFUN_ONCE([TOOLCHAIN_SETUP_JTREG],
[
AC_ARG_WITH(jtreg, [AS_HELP_STRING([--with-jtreg],
[Regression Test Harness @<:@probed@:>@])])
AC_MSG_CHECKING([for JTReg Regression Test Harness])
if test "x$with_jtreg" != x; then
JT_HOME="$with_jtreg"
BASIC_FIXUP_PATH([JT_HOME])
AC_MSG_RESULT($JT_HOME)
# jtreg win32 script works for everybody
JTREGEXE="$JT_HOME/win32/bin/jtreg"
if test ! -f "$JTREGEXE"; then
AC_MSG_ERROR([JTReg executable does not exist: $JTREGEXE])
fi
else
# Setup the JTREG paths
AC_DEFUN_ONCE([TOOLCHAIN_SETUP_JTREG],
[
AC_ARG_WITH(jtreg, [AS_HELP_STRING([--with-jtreg],
[Regression Test Harness @<:@probed@:>@])],
[],
[with_jtreg=no])
if test "x$with_jtreg" = xno; then
# jtreg disabled
AC_MSG_CHECKING([for jtreg])
AC_MSG_RESULT(no)
fi
AC_SUBST(JT_HOME)
AC_SUBST(JTREGEXE)
else
if test "x$with_jtreg" != xyes; then
# with path specified.
JT_HOME="$with_jtreg"
fi
if test "x$JT_HOME" != x; then
AC_MSG_CHECKING([for jtreg])
# use JT_HOME enviroment var.
BASIC_FIXUP_PATH([JT_HOME])
# jtreg win32 script works for everybody
JTREGEXE="$JT_HOME/win32/bin/jtreg"
if test ! -f "$JTREGEXE"; then
AC_MSG_ERROR([JTReg executable does not exist: $JTREGEXE])
fi
AC_MSG_RESULT($JTREGEXE)
else
# try to find jtreg on path
BASIC_REQUIRE_PROG(JTREGEXE, jtreg)
JT_HOME="`$DIRNAME $JTREGEXE`"
fi
fi
AC_SUBST(JT_HOME)
AC_SUBST(JTREGEXE)
])
......@@ -127,9 +127,21 @@ else
ifdef ALT_JAVAFX_ZIP_DIR
@$(ECHO) " --with-javafx-zip-dir=$(call UnixPath,$(ALT_JAVAFX_ZIP_DIR)) " >> $@.tmp
endif
ifdef ALT_JMC_ZIP_DIR
@$(ECHO) " --with-jmc-zip-dir=$(call UnixPath,$(ALT_JMC_ZIP_DIR)) " >> $@.tmp
endif
ifdef ALT_WIXDIR
@$(ECHO) " --with-wix=$(call UnixPath,$(ALT_WIXDIR)) " >> $@.tmp
endif
ifdef ALT_INSTALL_LZMA_PATH
@$(ECHO) " --with-lzma-path=$(call UnixPath,$(ALT_INSTALL_LZMA_PATH)) " >> $@.tmp
endif
ifdef ALT_INSTALL_UPX_PATH
@$(ECHO) " --with-upx-path=$(call UnixPath,$(ALT_INSTALL_UPX_PATH)) " >> $@.tmp
endif
ifdef ALT_INSTALL_UPX_FILENAME
@$(ECHO) " --with-upx-filename=$(call UnixPath,$(ALT_INSTALL_UPX_FILENAME)) " >> $@.tmp
endif
ifdef ALT_CCSS_SIGNING_DIR
@$(ECHO) " --with-ccss-signing=$(call UnixPath,$(ALT_CCSS_SIGNING_DIR)) " >> $@.tmp
endif
......
......@@ -183,7 +183,7 @@ bootcycle-images-only: start-make
test: images test-only
test-only: start-make
@$(call TargetEnter)
@($(CD) $(SRC_ROOT)/test && $(BUILD_LOG_WRAPPER) $(MAKE) -j1 -k MAKEFLAGS= PRODUCT_HOME=$(JDK_IMAGE_DIR) JPRT_JAVA_HOME=$(JDK_IMAGE_DIR) ALT_OUTPUTDIR=$(OUTPUT_ROOT) $(TEST)) || true
@($(CD) $(SRC_ROOT)/test && $(BUILD_LOG_WRAPPER) $(MAKE) -j1 -k JT_HOME=$(JT_HOME) MAKEFLAGS= PRODUCT_HOME=$(JDK_IMAGE_DIR) JPRT_JAVA_HOME=$(JDK_IMAGE_DIR) ALT_OUTPUTDIR=$(OUTPUT_ROOT) $(TEST)) || true
@$(call TargetExit)
# Stores the tips for each repository. This file is be used when constructing the jdk image and can be
......
......@@ -361,8 +361,8 @@ $(eval $(call SetupLogging))
# This is to be called by all SetupFoo macros
define LogSetupMacroEntry
$(if $(26),$(error Internal makefile error: Too many arguments to LogSetupMacroEntry, please update MakeBase.gmk))
$(if $(findstring $(LOG_LEVEL),debug trace), $(info $1 $(foreach i,2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25,$(if $($i),$(NEWLINE) $(strip [$i] $($i))))))
$(if $(27),$(error Internal makefile error: Too many arguments to LogSetupMacroEntry, please update MakeBase.gmk))
$(if $(findstring $(LOG_LEVEL),debug trace), $(info $1 $(foreach i,2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26,$(if $($i),$(NEWLINE) $(strip [$i] $($i))))))
endef
# Make directory without forking mkdir if not needed
......
......@@ -147,9 +147,9 @@ define SetupNativeCompilation
# CC the compiler to use, default is $(CC)
# LDEXE the linker to use for linking executables, default is $(LDEXE)
# OPTIMIZATION sets optimization level to NONE, LOW, HIGH, HIGHEST
$(foreach i,2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25, $(if $($i),$1_$(strip $($i)))$(NEWLINE))
$(call LogSetupMacroEntry,SetupNativeCompilation($1),$2,$3,$4,$5,$6,$7,$8,$9,$(10),$(11),$(12),$(13),$(14),$(15),$(16),$(17),$(18),$(19),$(20),$(21),$(22),$(23),$(24),$(25))
$(if $(26),$(error Internal makefile error: Too many arguments to SetupNativeCompilation, please update NativeCompilation.gmk))
$(foreach i,2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26, $(if $($i),$1_$(strip $($i)))$(NEWLINE))
$(call LogSetupMacroEntry,SetupNativeCompilation($1),$2,$3,$4,$5,$6,$7,$8,$9,$(10),$(11),$(12),$(13),$(14),$(15),$(16),$(17),$(18),$(19),$(20),$(21),$(22),$(23),$(24),$(25),$(26))
$(if $(27),$(error Internal makefile error: Too many arguments to SetupNativeCompilation, please update NativeCompilation.gmk))
ifneq (,$$($1_BIN))
$$(error BIN has been replaced with OBJECT_DIR)
......@@ -567,6 +567,12 @@ define SetupNativeCompilation
ifneq (,$$($1_GEN_MANIFEST))
$(MT) -nologo -manifest $$($1_GEN_MANIFEST) -outputresource:$$@;#1
endif
# This only works if the openjdk_codesign identity is present on the system. Let
# silently fail otherwise.
ifneq (,$(CODESIGN))
ifneq (,$$($1_CODESIGN))
$(CODESIGN) -s openjdk_codesign $$@
endif
endif
endif
endef
......@@ -213,3 +213,4 @@ f1709874d55a06bc3d5dfa02dbcdfbc59f4cba34 jdk8-b87
fe4150590ee597f4e125fea950aa3b352622cc2d jdk8-b89
c8286839d0df04aba819ec4bef12b86babccf30e jdk8-b90
8f7ffb296385f85a4a6d53f9f2d4a7b13a8fa1ff jdk8-b91
717aa26f8e0a1c0e768aebb3a763aca56db0c83e jdk8-b92
......@@ -345,3 +345,4 @@ c4af77d2045476c56fbf3f914b336bb1b7cd18af hs25-b30
b19517cecc2e91636d7c16ba2f35e3d3dc628099 hs25-b33
7cbdf0e3725c0c56a2ff7540fc70b6d4b5890d04 jdk8-b91
38da9f4f67096745f851318d792d6468aa1f6cf8 hs25-b34
092018493d3bbeb1c24278fd8c40ff3d76e1fed7 jdk8-b92
......@@ -213,3 +213,4 @@ eddbc8ad2435a89f64729512337c9f2669e4dd85 jdk8-b87
893d2ba8bbea3a8d090e51d8eaea285b390789ea jdk8-b89
668acc0e1034bc1bec6d02be92e0dd4a63d0667e jdk8-b90
e3065fb07877c7e96e8b93416fe2ab9a4c9eb2a5 jdk8-b91
1ab5d8d6eab81e65c6c3cf21739474cd67a0e7cf jdk8-b92
......@@ -236,10 +236,6 @@ public class DocumentBuilderImpl extends DocumentBuilder
String feature = (String) entry.getKey();
boolean value = ((Boolean) entry.getValue()).booleanValue();
domParser.setFeature(feature, value);
if (feature.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) {
domParser.setProperty(ACCESS_EXTERNAL_DTD, "");
domParser.setProperty(ACCESS_EXTERNAL_SCHEMA, "");
}
}
}
}
......
......@@ -242,10 +242,6 @@ public class SAXParserImpl extends javax.xml.parsers.SAXParser
String feature = (String) entry.getKey();
boolean value = ((Boolean) entry.getValue()).booleanValue();
xmlReader.setFeature0(feature, value);
if (feature.equals(XMLConstants.FEATURE_SECURE_PROCESSING) && value) {
xmlReader.setProperty0(ACCESS_EXTERNAL_DTD, "");
xmlReader.setProperty0(ACCESS_EXTERNAL_SCHEMA, "");
}
}
}
}
......
......@@ -213,3 +213,4 @@ d5228e624826a10ccc5b05f30ad8d839b58fe48d jdk8-b87
845025546e35519fbb8970e79fc2a834063a5e19 jdk8-b89
c63eda8f63008a4398d2c22ac8d72f7fef6f9238 jdk8-b90
169451cf0cc53bde5af24f9820ea3f35ec4b4df4 jdk8-b91
a2a2a91075ad85becbe10a39d7fd04ef9bea8df5 jdk8-b92
#
# Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 1999, 2013, 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
......@@ -432,40 +432,3 @@ RC_FLAGS += -d "JDK_BUILD_ID=$(JDK_RC_BUILD_ID)" \
-d "JDK_COPYRIGHT=$(JDK_RC_COPYRIGHT)" \
-d "JDK_NAME=$(JDK_RC_NAME)" \
-d "JDK_FVER=$(JDK_RC_FVER)"
# Enable 7-Zip LZMA file (de)compression for Java Kernel if it is available
ifeq ($(ARCH_DATA_MODEL), 32)
ifneq ($(KERNEL), off)
# This is a hack to use until 7-Zip (and UPX) bundles can be put
# under /java/devtools.
ifndef DEPLOY_TOPDIR
DEPLOY_TOPDIR=$(JDK_TOPDIR)/../deploy
endif
# Uncomment this block to cause build failure if above assumption false
#DCHK = $(shell if [ ! -d $(DEPLOY_TOPDIR) ] ; then \
# $(ECHO) deploy_not_a_peer_of_j2se ; \
#fi )
#ifeq ($(DCHK), deploy_not_a_peer_of_j2se)
# If a build failure points to control coming here it means
# it means deploy is not in the same directory
# as j2se. Java Kernel can't tolerate that for the time being.
#endif
EC_TMP = $(shell if [ -d $(DEPLOY_TOPDIR)/make/lzma ] ; then \
$(ECHO) true ; \
else \
$(ECHO) false ; \
fi )
ifeq ($(EC_TMP), true)
EXTRA_COMP_INSTALL_PATH = lib\\\\deploy\\\\lzma.dll
# Crazy but true: deploy/make/plugin/jinstall/Makefile.jkernel does
# not include deploy/make/common/Defs-windows.gmk, either directly
# or indirectly. But it does include this file, so redundantly declare
# these variables that are in deploy/make/common/Defs-windows.gmk for
# the sake of the Java Kernel part of the deploy build. Whew!
EXTRA_COMP_LIB_NAME = lzma.dll
EXTRA_COMP_PATH = $(OUTPUTDIR)/tmp/deploy/lzma/win32/obj
EXTRA_COMP_CMD_PATH = $(EXTRA_COMP_PATH)/lzma.exe
EXTRA_COMP_LIB_PATH = $(EXTRA_COMP_PATH)/$(EXTRA_COMP_LIB_NAME)
endif
endif
endif
......@@ -31,6 +31,8 @@ BUILDDIR = ../..
LIBRARY = jdwp
PRODUCT = jpda
LIBRARY_SUPPORTS_FULL_DEBUG_SYMBOLS=1
FILES_m = mapfile-vers
include $(BUILDDIR)/common/Defs.gmk
......
......@@ -171,3 +171,13 @@ FILES_NO_MOTIF_c = \
GLXSurfaceData.c \
AccelGlyphCache.c \
CUPSfuncs.c
ifeq ($(PLATFORM), macosx)
FILES_NO_MOTIF_objc = \
AWTFont.m \
AWTStrike.m \
CCharToGlyphMapper.m \
CGGlyphImages.m \
CGGlyphOutlines.m \
CoreTextSupport.m
endif # PLATFORM
......@@ -187,3 +187,14 @@ FILES_export2 = \
java/awt/dnd/DnDConstants.java \
sun/awt/CausedFocusEvent.java
ifeq ($(PLATFORM), macosx)
ifeq ($(HEADLESS), true)
FILES_export += \
sun/awt/SunHints.java \
sun/font/CCharToGlyphMapper.java \
sun/font/CFont.java \
sun/font/CFontManager.java \
sun/font/CStrike.java \
sun/font/CStrikeDisposer.java
endif # HEADLESS
endif # PLATFORM
......@@ -43,6 +43,10 @@ include $(BUILDDIR)/sun/awt/FILES_export_unix.gmk
# compiled based on the motif version.
FILES_c = $(FILES_NO_MOTIF_c)
ifeq ($(PLATFORM), macosx)
FILES_objc = $(FILES_NO_MOTIF_objc)
endif # PLATFORM
ifeq ($(PLATFORM), solaris)
ifneq ($(ARCH), amd64)
FILES_reorder += reorder-$(ARCH)
......@@ -97,6 +101,10 @@ vpath %.c $(SHARE_SRC)/native/$(PKGDIR)/../java2d/pipe
vpath %.cpp $(SHARE_SRC)/native/$(PKGDIR)/image
vpath %.c $(PLATFORM_SRC)/native/$(PKGDIR)/robot_child
ifeq ($(PLATFORM), macosx)
vpath %.m $(call NativeSrcDirList,,native/sun/font)
endif # PLATFORM
#
# Libraries to link in.
#
......@@ -192,13 +200,21 @@ CPPFLAGS += -I$(SHARE_SRC)/native/$(PKGDIR)/debug \
$(EVENT_MODEL)
ifeq ($(PLATFORM), macosx)
CPPFLAGS += -I$(CUPS_HEADERS_PATH)
CPPFLAGS += -I$(CUPS_HEADERS_PATH) \
$(call NativeSrcDirList,-I,native/sun/awt) \
$(call NativeSrcDirList,-I,native/sun/font)
ifndef HEADLESS
CPPFLAGS += -I$(MOTIF_DIR)/include \
-I$(OPENWIN_HOME)/include
LDFLAGS += -L$(MOTIF_LIB) -L$(OPENWIN_LIB)
else
LDFLAGS += -framework Accelerate \
-framework ApplicationServices \
-framework Cocoa \
-F/System/Library/Frameworks/JavaVM.framework/Frameworks \
-framework JavaNativeFoundation \
-framework JavaRuntimeSupport
endif # !HEADLESS
endif # PLATFORM
......
......@@ -95,6 +95,9 @@ define SetupLauncher
$1_PLIST_FILE:=Info-cmdline.plist
ifneq ($(11),)
$1_PLIST_FILE:=$(11)
ifneq ($$(findstring privileged,$$($1_PLIST_FILE)),)
$1_CODESIGN:=true
endif
endif
$1_LDFLAGS += -Wl,-all_load $(JDK_OUTPUTDIR)/objs/libjli_static.a \
......@@ -174,7 +177,8 @@ define SetupLauncher
-D "JDK_INTERNAL_NAME=$1" \
-D "JDK_FTYPE=0x1L" \
$7,\
MANIFEST:=$(JDK_TOPDIR)/src/windows/resource/java.manifest)
MANIFEST:=$(JDK_TOPDIR)/src/windows/resource/java.manifest,\
CODESIGN:=$$($1_CODESIGN))
BUILD_LAUNCHERS += $$(BUILD_LAUNCHER_$1)
......
......@@ -1143,7 +1143,7 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBJDWP,\
-D "JDK_INTERNAL_NAME=jdwp" \
-D "JDK_FTYPE=0x2L",\
OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libjdwp,\
DEBUG_SYMBOLS:=$(DEBUG_ALL_BINARIES)))
DEBUG_SYMBOLS:=true))
$(BUILD_LIBJDWP) : $(BUILD_LIBJAVA)
......@@ -2314,6 +2314,10 @@ LIBAWT_HEADLESS_DIRS:=$(JDK_TOPDIR)/src/share/native/sun/font \
$(JDK_TOPDIR)/src/solaris/native/sun/java2d/opengl \
$(JDK_TOPDIR)/src/solaris/native/sun/java2d/x11
ifeq ($(OPENJDK_TARGET_OS),macosx)
LIBAWT_HEADLESS_DIRS+=$(JDK_TOPDIR)/src/macosx/native/sun/font
endif
LIBAWT_HEADLESS_CFLAGS:=-DHEADLESS=true \
-DX11_PATH=\"$(X11_PATH)\" -DPACKAGE_PATH=\"$(PACKAGE_PATH)\" \
$(CUPS_CFLAGS) \
......@@ -2328,6 +2332,12 @@ LIBAWT_HEADLESS_CFLAGS:=-DHEADLESS=true \
-I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/jdga \
$(foreach dir,$(LIBAWT_HEADLESS_DIRS),-I$(dir))
ifeq ($(OPENJDK_TARGET_OS),macosx)
LIBAWT_HEADLESS_CFLAGS+=\
-F/System/Library/Frameworks/JavaVM.framework/Frameworks \
-F/System/Library/Frameworks/ApplicationServices.framework/Frameworks
endif
LIBAWT_HEADLESS_FILES:=\
awt_Font.c \
HeadlessToolkit.c \
......@@ -2356,6 +2366,16 @@ LIBAWT_HEADLESS_FILES:=\
AccelGlyphCache.c \
CUPSfuncs.c
ifeq ($(OPENJDK_TARGET_OS),macosx)
LIBAWT_HEADLESS_FILES+=\
AWTFont.m \
AWTStrike.m \
CCharToGlyphMapper.m \
CGGlyphImages.m \
CGGlyphOutlines.m \
CoreTextSupport.m
endif
LIBAWT_HEADLESS_REORDER:=
ifeq ($(OPENJDK_TARGET_OS), solaris)
ifneq ($(OPENJDK_TARGET_CPU), x86_64)
......@@ -2382,7 +2402,13 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBAWT_HEADLESS,\
REORDER:=$(LIBAWT_HEADLESS_REORDER), \
LDFLAGS_SUFFIX_linux:=-ljvm -lawt -lm $(LIBDL) -ljava,\
LDFLAGS_SUFFIX_solaris:=$(LIBDL) -ljvm -lawt -lm -ljava $(LIBCXX) -lc,\
LDFLAGS_SUFFIX_macosx:=-ljvm $(LIBCXX) -lawt $(LIBDL) -ljava,\
LDFLAGS_SUFFIX_macosx:=-ljvm $(LIBCXX) -lawt $(LIBDL) -ljava \
-framework Accelerate \
-framework ApplicationServices \
-framework Cocoa \
-F/System/Library/Frameworks/JavaVM.framework/Frameworks \
-framework JavaNativeFoundation \
-framework JavaRuntimeSupport,\
OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libawt_headless,\
DEBUG_SYMBOLS:=$(DEBUG_ALL_BINARIES)))
......
......@@ -50,8 +50,6 @@ images:: jre-image jdk-image
overlay-images: jre-overlay-image jdk-overlay-image
-include $(CUSTOM_MAKE_DIR)/Images.gmk
# Processing license files from source area to image area
# These will be modified to have the platform specific EOL chars.
......@@ -774,3 +772,5 @@ endif # Profile
################################################################################
.PHONY: default images jre-image jdk-image
-include $(CUSTOM_MAKE_DIR)/Images.gmk
......@@ -44,7 +44,6 @@
#include <Cocoa/Cocoa.h>
#include <objc/objc-runtime.h>
#include <objc/objc-auto.h>
#include <dispatch/dispatch.h>
#include <errno.h>
#include <spawn.h>
......@@ -1001,6 +1000,32 @@ SetXStartOnFirstThreadArg()
setenv(envVar, "1", 1);
}
/* This class is made for performSelectorOnMainThread when java main
* should be launched on main thread.
* We cannot use dispatch_sync here, because it blocks the main dispatch queue
* which is used inside Cocoa
*/
@interface JavaLaunchHelper : NSObject {
int _returnValue;
}
- (void) launchJava:(NSValue*)argsValue;
- (int) getReturnValue;
@end
@implementation JavaLaunchHelper
- (void) launchJava:(NSValue*)argsValue
{
_returnValue = JavaMain([argsValue pointerValue]);
}
- (int) getReturnValue
{
return _returnValue;
}
@end
// MacOSX we may continue in the same thread
int
JVMInit(InvocationFunctions* ifn, jlong threadStackSize,
......@@ -1010,16 +1035,22 @@ JVMInit(InvocationFunctions* ifn, jlong threadStackSize,
JLI_TraceLauncher("In same thread\n");
// need to block this thread against the main thread
// so signals get caught correctly
__block int rslt;
dispatch_sync(dispatch_get_main_queue(), ^(void) {
JavaMainArgs args;
args.argc = argc;
args.argv = argv;
args.mode = mode;
args.what = what;
args.ifn = *ifn;
rslt = JavaMain((void*)&args);
});
JavaMainArgs args;
args.argc = argc;
args.argv = argv;
args.mode = mode;
args.what = what;
args.ifn = *ifn;
int rslt;
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
{
JavaLaunchHelper* launcher = [[[JavaLaunchHelper alloc] init] autorelease];
[launcher performSelectorOnMainThread:@selector(launchJava:)
withObject:[NSValue valueWithPointer:(void*)&args]
waitUntilDone:YES];
rslt = [launcher getReturnValue];
}
[pool drain];
return rslt;
} else {
return ContinueInNewThread(ifn, threadStackSize, argc, argv, mode, what, ret);
......
......@@ -38,7 +38,7 @@ final class CDropTargetContextPeer extends SunDropTargetContextPeer {
private long fNativeDropTransfer = 0;
private long fNativeDataAvailable = 0;
private Object fNativeData = null;
private boolean insideTarget = false;
private boolean insideTarget = true;
Object awtLockAccess = new Object();
......
/*
* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011, 2013, 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
......@@ -115,6 +115,8 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo
static final int RESIZABLE = 1 << 9; // both a style bit and prop bit
static final int NONACTIVATING = 1 << 24;
static final int IS_DIALOG = 1 << 25;
static final int IS_MODAL = 1 << 26;
static final int _STYLE_PROP_BITMASK = DECORATED | TEXTURED | UNIFIED | UTILITY | HUD | SHEET | CLOSEABLE | MINIMIZABLE | RESIZABLE;
......@@ -374,6 +376,13 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo
}
}
if (isDialog) {
styleBits = SET(styleBits, IS_DIALOG, true);
if (((Dialog) target).isModal()) {
styleBits = SET(styleBits, IS_MODAL, true);
}
}
peer.setTextured(IS(TEXTURED, styleBits));
return styleBits;
......
......@@ -36,6 +36,7 @@ import java.security.PrivilegedAction;
import javax.print.*;
import javax.print.attribute.PrintRequestAttributeSet;
import javax.print.attribute.HashPrintRequestAttributeSet;
import javax.print.attribute.standard.PageRanges;
import sun.java2d.*;
import sun.print.*;
......@@ -173,6 +174,19 @@ public class CPrinterJob extends RasterPrinterJob {
if (nsPrintInfo != null) {
fNSPrintInfo = nsPrintInfo.getValue();
}
PageRanges pageRangesAttr = (PageRanges)attributes.get(PageRanges.class);
if (isSupportedValue(pageRangesAttr, attributes)) {
SunPageSelection rangeSelect = (SunPageSelection)attributes.get(SunPageSelection.class);
// If rangeSelect is not null, we are using AWT's print dialog that has
// All, Selection, and Range radio buttons
if (rangeSelect == null || rangeSelect == SunPageSelection.RANGE) {
int[][] range = pageRangesAttr.getMembers();
// setPageRange will set firstPage and lastPage as called in getFirstPage
// and getLastPage
setPageRange(range[0][0] - 1, range[0][1] - 1);
}
}
}
volatile boolean onEventThread;
......@@ -225,7 +239,6 @@ public class CPrinterJob extends RasterPrinterJob {
* the end of the document. Note that firstPage
* and lastPage are 0 based page indices.
*/
int numPages = mDocument.getNumberOfPages();
int firstPage = getFirstPage();
int lastPage = getLastPage();
......@@ -242,42 +255,53 @@ public class CPrinterJob extends RasterPrinterJob {
userCancelled = false;
}
if (EventQueue.isDispatchThread()) {
// This is an AWT EventQueue, and this print rendering loop needs to block it.
//Add support for PageRange
PageRanges pr = (attributes == null) ? null
: (PageRanges)attributes.get(PageRanges.class);
int[][] prMembers = (pr == null) ? new int[0][0] : pr.getMembers();
int loopi = 0;
do {
if (EventQueue.isDispatchThread()) {
// This is an AWT EventQueue, and this print rendering loop needs to block it.
onEventThread = true;
printingLoop = AccessController.doPrivileged(new PrivilegedAction<SecondaryLoop>() {
@Override
public SecondaryLoop run() {
return Toolkit.getDefaultToolkit()
.getSystemEventQueue()
.createSecondaryLoop();
}
});
onEventThread = true;
printingLoop = AccessController.doPrivileged(new PrivilegedAction<SecondaryLoop>() {
@Override
public SecondaryLoop run() {
return Toolkit.getDefaultToolkit()
.getSystemEventQueue()
.createSecondaryLoop();
try {
// Fire off the print rendering loop on the AppKit thread, and don't have
// it wait and block this thread.
if (printLoop(false, firstPage, lastPage)) {
// Start a secondary loop on EDT until printing operation is finished or cancelled
printingLoop.enter();
}
} catch (Exception e) {
e.printStackTrace();
}
});
} else {
// Fire off the print rendering loop on the AppKit, and block this thread
// until it is done.
// But don't actually block... we need to come back here!
onEventThread = false;
try {
// Fire off the print rendering loop on the AppKit thread, and don't have
// it wait and block this thread.
if (printLoop(false, firstPage, lastPage)) {
// Start a secondary loop on EDT until printing operation is finished or cancelled
printingLoop.enter();
try {
printLoop(true, firstPage, lastPage);
} catch (Exception e) {
e.printStackTrace();
}
} catch (Exception e) {
e.printStackTrace();
}
} else {
// Fire off the print rendering loop on the AppKit, and block this thread
// until it is done.
// But don't actually block... we need to come back here!
onEventThread = false;
try {
printLoop(true, firstPage, lastPage);
} catch (Exception e) {
e.printStackTrace();
if (++loopi < prMembers.length) {
firstPage = prMembers[loopi][0]-1;
lastPage = prMembers[loopi][1] -1;
}
}
} while (loopi < prMembers.length);
} finally {
synchronized (this) {
// NOTE: Native code shouldn't allow exceptions out while
......
/*
* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011, 2013, 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
......@@ -536,8 +536,12 @@ AWT_ASSERT_APPKIT_THREAD;
- (void) windowDidBecomeKey: (NSNotification *) notification {
AWT_ASSERT_APPKIT_THREAD;
[AWTToolkit eventCountPlusPlus];
[CMenuBar activate:self.javaMenuBar modallyDisabled:NO];
AWTWindow *opposite = [AWTWindow lastKeyWindow];
if (!IS(self.styleBits, IS_DIALOG)) {
[CMenuBar activate:self.javaMenuBar modallyDisabled:NO];
} else if (IS(self.styleBits, IS_MODAL)) {
[CMenuBar activate:opposite->javaMenuBar modallyDisabled:YES];
}
[AWTWindow setLastKeyWindow:nil];
[self _deliverWindowFocusEvent:YES oppositeWindow: opposite];
......
......@@ -395,6 +395,7 @@ JNF_COCOA_EXIT(env);
#pragma mark --- Miscellaneous JNI ---
#ifndef HEADLESS
/*
* Class: sun_awt_PlatformFont
* Method: initIDs
......@@ -416,3 +417,4 @@ Java_sun_awt_FontDescriptor_initIDs
(JNIEnv *env, jclass cls)
{
}
#endif
/*
* Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2008, 2013, 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
......@@ -24,6 +24,9 @@
*/
package com.sun.beans.finder;
import java.lang.reflect.Executable;
import java.lang.reflect.Modifier;
import java.util.HashMap;
import java.util.Map;
......@@ -37,7 +40,7 @@ import java.util.Map;
*
* @author Sergey A. Malenkov
*/
abstract class AbstractFinder<T> {
abstract class AbstractFinder<T extends Executable> {
private final Class<?>[] args;
/**
......@@ -52,27 +55,6 @@ abstract class AbstractFinder<T> {
this.args = args;
}
/**
* Returns an array of {@code Class} objects
* that represent the formal parameter types of the method.
* Returns an empty array if the method takes no parameters.
*
* @param method the object that represents method
* @return the parameter types of the method
*/
protected abstract Class<?>[] getParameters(T method);
/**
* Returns {@code true} if and only if the method
* was declared to take a variable number of arguments.
*
* @param method the object that represents method
* @return {@code true} if the method was declared
* to take a variable number of arguments;
* {@code false} otherwise
*/
protected abstract boolean isVarArgs(T method);
/**
* Checks validness of the method.
* At least the valid method should be public.
......@@ -81,7 +63,9 @@ abstract class AbstractFinder<T> {
* @return {@code true} if the method is valid,
* {@code false} otherwise
*/
protected abstract boolean isValid(T method);
protected boolean isValid(T method) {
return Modifier.isPublic(method.getModifiers());
}
/**
* Performs a search in the {@code methods} array.
......@@ -109,7 +93,7 @@ abstract class AbstractFinder<T> {
for (T newMethod : methods) {
if (isValid(newMethod)) {
Class<?>[] newParams = getParameters(newMethod);
Class<?>[] newParams = newMethod.getParameterTypes();
if (newParams.length == this.args.length) {
PrimitiveWrapperMap.replacePrimitivesWithWrappers(newParams);
if (isAssignable(newParams, this.args)) {
......@@ -120,6 +104,11 @@ abstract class AbstractFinder<T> {
boolean useNew = isAssignable(oldParams, newParams);
boolean useOld = isAssignable(newParams, oldParams);
if (useOld && useNew) {
// only if parameters are equal
useNew = !newMethod.isSynthetic();
useOld = !oldMethod.isSynthetic();
}
if (useOld == useNew) {
ambiguous = true;
} else if (useNew) {
......@@ -130,7 +119,7 @@ abstract class AbstractFinder<T> {
}
}
}
if (isVarArgs(newMethod)) {
if (newMethod.isVarArgs()) {
int length = newParams.length - 1;
if (length <= this.args.length) {
Class<?>[] array = new Class<?>[this.args.length];
......@@ -160,6 +149,11 @@ abstract class AbstractFinder<T> {
boolean useNew = isAssignable(oldParams, newParams);
boolean useOld = isAssignable(newParams, oldParams);
if (useOld && useNew) {
// only if parameters are equal
useNew = !newMethod.isSynthetic();
useOld = !oldMethod.isSynthetic();
}
if (useOld == useNew) {
if (oldParams == map.get(oldMethod)) {
ambiguous = true;
......
/*
* Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2008, 2013, 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
......@@ -86,44 +86,4 @@ public final class ConstructorFinder extends AbstractFinder<Constructor<?>> {
private ConstructorFinder(Class<?>[] args) {
super(args);
}
/**
* Returns an array of {@code Class} objects
* that represent the formal parameter types of the constructor.
* Returns an empty array if the constructor takes no parameters.
*
* @param constructor the object that represents constructor
* @return the parameter types of the constructor
*/
@Override
protected Class<?>[] getParameters(Constructor<?> constructor) {
return constructor.getParameterTypes();
}
/**
* Returns {@code true} if and only if the constructor
* was declared to take a variable number of arguments.
*
* @param constructor the object that represents constructor
* @return {@code true} if the constructor was declared
* to take a variable number of arguments;
* {@code false} otherwise
*/
@Override
protected boolean isVarArgs(Constructor<?> constructor) {
return constructor.isVarArgs();
}
/**
* Checks validness of the constructor.
* The valid constructor should be public.
*
* @param constructor the object that represents constructor
* @return {@code true} if the constructor is valid,
* {@code false} otherwise
*/
@Override
protected boolean isValid(Constructor<?> constructor) {
return Modifier.isPublic(constructor.getModifiers());
}
}
/*
* Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2008, 2013, 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
......@@ -195,33 +195,6 @@ public final class MethodFinder extends AbstractFinder<Method> {
this.name = name;
}
/**
* Returns an array of {@code Class} objects
* that represent the formal parameter types of the method.
* Returns an empty array if the method takes no parameters.
*
* @param method the object that represents method
* @return the parameter types of the method
*/
@Override
protected Class<?>[] getParameters(Method method) {
return method.getParameterTypes();
}
/**
* Returns {@code true} if and only if the method
* was declared to take a variable number of arguments.
*
* @param method the object that represents method
* @return {@code true} if the method was declared
* to take a variable number of arguments;
* {@code false} otherwise
*/
@Override
protected boolean isVarArgs(Method method) {
return method.isVarArgs();
}
/**
* Checks validness of the method.
* The valid method should be public and
......@@ -233,6 +206,6 @@ public final class MethodFinder extends AbstractFinder<Method> {
*/
@Override
protected boolean isValid(Method method) {
return !method.isBridge() && Modifier.isPublic(method.getModifiers()) && method.getName().equals(this.name);
return super.isValid(method) && method.getName().equals(this.name);
}
}
/*
* Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2013, 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
......@@ -90,14 +90,16 @@ public class Continuation extends ResolveResult {
* Constructs a new instance of Continuation.
* @param top The name of the object that is to be resolved/operated upon.
* This becomes the Continuation's 'starter' and is used to
* calculate the "resolved name" when filling in a NamingException.
* calculate the "resolved name" when filling in a NamingException.
* @param environment The environment used by the caller. It is used
* when setting the "environment" of a CannotProceedException.
* when setting the "environment" of a CannotProceedException.
*/
@SuppressWarnings("unchecked") // For Hashtable clone: environment.clone()
public Continuation(Name top, Hashtable<?,?> environment) {
super();
starter = top;
this.environment = environment;
this.environment = (Hashtable<?,?>)
((environment == null) ? null : environment.clone());
}
/**
......
/*
* Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2013, 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
......@@ -69,6 +69,7 @@ final public class LazySearchEnumerationImpl
}
}
@SuppressWarnings("unchecked") // For Hashtable clone: env.clone()
public LazySearchEnumerationImpl(NamingEnumeration<Binding> candidates,
AttrFilter filter, SearchControls cons,
Context ctx, Hashtable<String, Object> env, boolean useFactory)
......@@ -76,7 +77,8 @@ final public class LazySearchEnumerationImpl
this.candidates = candidates;
this.filter = filter;
this.env = env;
this.env = (Hashtable<String, Object>)
((env == null) ? null : env.clone());
this.context = ctx;
this.useFactory = useFactory;
......
/*
* Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2013, 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
......@@ -53,7 +53,8 @@ abstract public class GenericURLContext implements Context {
@SuppressWarnings("unchecked") // Expect Hashtable<String, Object>
public GenericURLContext(Hashtable<?,?> env) {
// context that is not tied to any specific URL
myEnv = (Hashtable<String, Object>)env; // copied on write
myEnv =
(Hashtable<String, Object>)(env == null ? null : env.clone());
}
public void close() throws NamingException {
......@@ -488,22 +489,19 @@ abstract public class GenericURLContext implements Context {
return result;
}
@SuppressWarnings("unchecked") // clone()
public Object removeFromEnvironment(String propName)
throws NamingException {
if (myEnv == null) {
return null;
}
myEnv = (Hashtable<String, Object>)myEnv.clone();
return myEnv.remove(propName);
}
@SuppressWarnings("unchecked") // clone()
public Object addToEnvironment(String propName, Object propVal)
throws NamingException {
myEnv = (myEnv == null)
? new Hashtable<String, Object>(11, 0.75f)
: (Hashtable<String, Object>)myEnv.clone();
if (myEnv == null) {
myEnv = new Hashtable<String, Object>(11, 0.75f);
}
return myEnv.put(propName, propVal);
}
......
......@@ -240,13 +240,15 @@ class FileInputStream extends InputStream
*
* <p>The <code>skip</code> method may, for a variety of
* reasons, end up skipping over some smaller number of bytes,
* possibly <code>0</code>. If <code>n</code> is negative, an
* <code>IOException</code> is thrown, even though the <code>skip</code>
* method of the {@link InputStream} superclass does nothing in this case.
* The actual number of bytes skipped is returned.
* possibly <code>0</code>. If <code>n</code> is negative, the method
* will try to skip backwards. In case the backing file does not support
* backward skip at its current position, an <code>IOException</code> is
* thrown. The actual number of bytes skipped is returned. If it skips
* forwards, it returns a positive value. If it skips backwards, it
* returns a negative value.
*
* <p>This method may skip more bytes than are remaining in the backing
* file. This produces no exception and the number of bytes skipped
* <p>This method may skip more bytes than what are remaining in the
* backing file. This produces no exception and the number of bytes skipped
* may include some number of bytes that were beyond the EOF of the
* backing file. Attempting to read from the stream after skipping past
* the end will result in -1 indicating the end of the file.
......@@ -261,9 +263,10 @@ class FileInputStream extends InputStream
/**
* Returns an estimate of the number of remaining bytes that can be read (or
* skipped over) from this input stream without blocking by the next
* invocation of a method for this input stream. The next invocation might be
* the same thread or another thread. A single read or skip of this
* many bytes will not block, but may read or skip fewer bytes.
* invocation of a method for this input stream. Returns 0 when the file
* position is beyond EOF. The next invocation might be the same thread
* or another thread. A single read or skip of this many bytes will not
* block, but may read or skip fewer bytes.
*
* <p> In some cases, a non-blocking read (or skip) may appear to be
* blocked when it is merely slow, for example when reading large
......
/*
* Copyright (c) 1994, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1994, 2013, 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
......@@ -193,8 +193,10 @@ public abstract class InputStream implements Closeable {
* up skipping over some smaller number of bytes, possibly <code>0</code>.
* This may result from any of a number of conditions; reaching end of file
* before <code>n</code> bytes have been skipped is only one possibility.
* The actual number of bytes skipped is returned. If <code>n</code> is
* negative, no bytes are skipped.
* The actual number of bytes skipped is returned. If {@code n} is
* negative, the {@code skip} method for class {@code InputStream} always
* returns 0, and no bytes are skipped. Subclasses may handle the negative
* value differently.
*
* <p> The <code>skip</code> method of this class creates a
* byte array and then repeatedly reads into it until <code>n</code> bytes
......
......@@ -28,6 +28,7 @@ package java.lang;
import java.lang.reflect.AnnotatedElement;
import java.lang.reflect.Array;
import java.lang.reflect.GenericArrayType;
import java.lang.reflect.GenericDeclaration;
import java.lang.reflect.Member;
import java.lang.reflect.Field;
import java.lang.reflect.Executable;
......@@ -115,9 +116,9 @@ import sun.reflect.misc.ReflectUtil;
* @since JDK1.0
*/
public final class Class<T> implements java.io.Serializable,
java.lang.reflect.GenericDeclaration,
java.lang.reflect.Type,
java.lang.reflect.AnnotatedElement {
GenericDeclaration,
Type,
AnnotatedElement {
private static final int ANNOTATION= 0x00002000;
private static final int ENUM = 0x00004000;
private static final int SYNTHETIC = 0x00001000;
......@@ -3182,7 +3183,7 @@ public final class Class<T> implements java.io.Serializable,
*/
@Override
public boolean isAnnotationPresent(Class<? extends Annotation> annotationClass) {
return AnnotatedElement.super.isAnnotationPresent(annotationClass);
return GenericDeclaration.super.isAnnotationPresent(annotationClass);
}
/**
......
......@@ -59,7 +59,7 @@ import sun.util.locale.provider.TimeZoneNameUtility;
* <code>DateFormatSymbols</code> is a public class for encapsulating
* localizable date-time formatting data, such as the names of the
* months, the names of the days of the week, and the time zone data.
* <code>DateFormat</code> and <code>SimpleDateFormat</code> both use
* <code>SimpleDateFormat</code> uses
* <code>DateFormatSymbols</code> to encapsulate this information.
*
* <p>
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册