diff --git a/.hgtags b/.hgtags
index 6c271f6efae8321a613b9cee5bf9e2298fe5aa7b..d83c29f1bedc2f0df4258045dcb42ec6f09f0e2b 100644
--- a/.hgtags
+++ b/.hgtags
@@ -111,3 +111,5 @@ bdc069d3f9101f89ec3f81c2950ee2d68fa846d3 jdk7-b130
554adcfb615e63e62af530b1c10fcf7813a75b26 jdk7-b134
d8ced728159fbb2caa8b6adb477fd8efdbbdf179 jdk7-b135
aa13e7702cd9d8aca9aa38f1227f966990866944 jdk7-b136
+29296ea6529a418037ccce95903249665ef31c11 jdk7-b137
+60d3d55dcc9c31a30ced9caa6ef5c0dcd7db031d jdk7-b138
diff --git a/make/Makefile b/make/Makefile
index afcdda1ee29ea337f85a67f84de94655ba8d208e..d6a1d319a6aa52ea4ae8fc563871526c7a913996 100644
--- a/make/Makefile
+++ b/make/Makefile
@@ -1,5 +1,5 @@
#
-# Copyright (c) 1995, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1995, 2011, 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
diff --git a/make/com/sun/crypto/provider/Makefile b/make/com/sun/crypto/provider/Makefile
index f52fb576fc6a892331c57ae01cf1dc1ef4a60e19..281b02eb3d2c0464d2f0611caa7066197a135157 100644
--- a/make/com/sun/crypto/provider/Makefile
+++ b/make/com/sun/crypto/provider/Makefile
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2007, 2011, 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
diff --git a/make/com/sun/java/pack/Makefile b/make/com/sun/java/pack/Makefile
index 0e73e0556214158ee0ebf9c6a587165a817d2e01..b9b79648bb3e043ea35a55de44b9eae083da2f26 100644
--- a/make/com/sun/java/pack/Makefile
+++ b/make/com/sun/java/pack/Makefile
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2003, 2011, 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
diff --git a/make/com/sun/java/pack/prop/Makefile b/make/com/sun/java/pack/prop/Makefile
index b023d0505fd4071e4e488151d57d6eb5dcad83fb..0cb898d39136d9951dec88701b2513ec5a89ffb2 100644
--- a/make/com/sun/java/pack/prop/Makefile
+++ b/make/com/sun/java/pack/prop/Makefile
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2003, 2011, 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
diff --git a/make/com/sun/jndi/cosnaming/Makefile b/make/com/sun/jndi/cosnaming/Makefile
index 17425dba5f7d7e294005c61c118ef86110f7a4fa..f8e9bf831c5491efc59f74078f1390560914633b 100644
--- a/make/com/sun/jndi/cosnaming/Makefile
+++ b/make/com/sun/jndi/cosnaming/Makefile
@@ -1,5 +1,5 @@
#
-# Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1999, 2011, 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
diff --git a/make/com/sun/jndi/dns/Makefile b/make/com/sun/jndi/dns/Makefile
index 4b34bdafaa9169c710e278ff246b856618d16655..bc412183ed9a5c6893e7c69e1af8b4d5c93fdc24 100644
--- a/make/com/sun/jndi/dns/Makefile
+++ b/make/com/sun/jndi/dns/Makefile
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2000, 2011, 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
diff --git a/make/com/sun/jndi/ldap/Makefile b/make/com/sun/jndi/ldap/Makefile
index 5b74b9101672dd5106c38aa655a34410a9d06f1d..798ac6c58a765d793010b2ae017b8e37b961a7d4 100644
--- a/make/com/sun/jndi/ldap/Makefile
+++ b/make/com/sun/jndi/ldap/Makefile
@@ -1,5 +1,5 @@
#
-# Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1999, 2011, 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
diff --git a/make/com/sun/jndi/rmi/registry/Makefile b/make/com/sun/jndi/rmi/registry/Makefile
index d8b3e6b512cdad23153a229a524acfd769ae8703..03dc25a21d37e47bda74577d614e577257f23424 100644
--- a/make/com/sun/jndi/rmi/registry/Makefile
+++ b/make/com/sun/jndi/rmi/registry/Makefile
@@ -1,5 +1,5 @@
#
-# Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1999, 2011, 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
diff --git a/make/com/sun/nio/sctp/Makefile b/make/com/sun/nio/sctp/Makefile
index 975776889e8e7f3abad1bc9038037102af058baa..e71a92bc6ad7c9d1b022b233ac62790730b6726d 100644
--- a/make/com/sun/nio/sctp/Makefile
+++ b/make/com/sun/nio/sctp/Makefile
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2009, 2011, 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
diff --git a/make/com/sun/org/apache/xml/Makefile b/make/com/sun/org/apache/xml/Makefile
index dc0f48317228d11ed7ed3cb17287875425ca0940..e0c25e9d2733a3878d40194a5fea129787646fa8 100644
--- a/make/com/sun/org/apache/xml/Makefile
+++ b/make/com/sun/org/apache/xml/Makefile
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2003, 2011, 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
diff --git a/make/com/sun/rowset/Makefile b/make/com/sun/rowset/Makefile
index 672aecef30d45f0af59f98166b1dea48d2f18f67..53bbf0f9ab2ec56c8fd83a41d2548a14abe9bda1 100644
--- a/make/com/sun/rowset/Makefile
+++ b/make/com/sun/rowset/Makefile
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2003, 2011, 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
diff --git a/make/com/sun/script/Makefile b/make/com/sun/script/Makefile
index 1554d1f593670207562cd198fafda3d08fc6a2d3..58e134fad53f3d4122f50800cd62114e1dde00ed 100644
--- a/make/com/sun/script/Makefile
+++ b/make/com/sun/script/Makefile
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2005, 2011, 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
diff --git a/make/com/sun/security/auth/module/Makefile b/make/com/sun/security/auth/module/Makefile
index b53e1b307f3c6e91c7263b67faf242cb1b358005..c274fac637a48832690b8554e233e3f149420e62 100644
--- a/make/com/sun/security/auth/module/Makefile
+++ b/make/com/sun/security/auth/module/Makefile
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2000, 2011, 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
diff --git a/make/com/sun/servicetag/Makefile b/make/com/sun/servicetag/Makefile
index d647fc8df90422c113bc5383909217db4e55ca71..6a8bf6da52cc58f8f2ab5ed4135d683efce5dcca 100644
--- a/make/com/sun/servicetag/Makefile
+++ b/make/com/sun/servicetag/Makefile
@@ -1,4 +1,4 @@
-# Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2008, 2011, 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
diff --git a/make/com/sun/tools/attach/Makefile b/make/com/sun/tools/attach/Makefile
index 0fa41d9d9ca26d87ba1242ef9c85220b6781fe44..ac5994d89bec21ecb8ac51df0b850b4504eefaaa 100644
--- a/make/com/sun/tools/attach/Makefile
+++ b/make/com/sun/tools/attach/Makefile
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2005, 2011, 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
diff --git a/make/common/Defs-embedded.gmk b/make/common/Defs-embedded.gmk
new file mode 100644
index 0000000000000000000000000000000000000000..f196e2f4fedffe2284d729818fbd11df441da13e
--- /dev/null
+++ b/make/common/Defs-embedded.gmk
@@ -0,0 +1,53 @@
+#
+# Copyright (c) 2011, 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.
+#
+
+#
+# Variable definitions for SE Embedded builds. This file should
+# not contain rules.
+#
+ifdef JAVASE_EMBEDDED
+
+# Compress jar files
+COMPRESS_JARS = true
+
+# Don't mmap zip files
+LIBZIP_CAN_USE_MMAP = false
+
+# Disable ALSA version check
+REQUIRED_ALSA_VERSION =
+
+# Compilation settings
+OTHER_CPPFLAGS += -DJAVASE_EMBEDDED
+
+# Product naming
+PRODUCT_SUFFIX = SE Runtime Environment for Embedded
+RUNTIME_NAME = $(PRODUCT_NAME) $(PRODUCT_SUFFIX)
+
+# Reduced JRE locations
+JRE_REDUCED_HEADLESS_IMAGE_DIR = $(ABS_OUTPUTDIR)/j2re-reduced-headless-image
+JRE_REDUCED_IMAGE_DIR = $(ABS_OUTPUTDIR)/j2re-reduced-image
+
+endif # JAVASE_EMBEDDED
+
diff --git a/make/common/Defs-solaris.gmk b/make/common/Defs-solaris.gmk
index 50e5c4bb1def89de168d8261abb4255a29eed2e6..1442959756ffbe8958118db551d5f3455604ed01 100644
--- a/make/common/Defs-solaris.gmk
+++ b/make/common/Defs-solaris.gmk
@@ -1,5 +1,5 @@
#
-# Copyright (c) 1995, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1995, 2011, 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
diff --git a/make/common/Defs-windows.gmk b/make/common/Defs-windows.gmk
index f5000e4465ff74f0402d77d8fedbec391ca008bf..d04d60a7924dc40c7b48f752a1518ba53e0d0f31 100644
--- a/make/common/Defs-windows.gmk
+++ b/make/common/Defs-windows.gmk
@@ -1,5 +1,5 @@
#
-# Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1999, 2011, 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
diff --git a/make/common/Defs.gmk b/make/common/Defs.gmk
index a290efa652c504ca28fa0d4b06b9f61eedf81fd8..1e12d4119427be5928109efb269add282f2fe233 100644
--- a/make/common/Defs.gmk
+++ b/make/common/Defs.gmk
@@ -115,6 +115,12 @@ endif
include $(JDK_TOPDIR)/make/common/Defs-$(PLATFORM).gmk
+#
+# SE-Embedded support, if enabled
+#
+
+include $(JDK_TOPDIR)/make/common/Defs-embedded.gmk
+
#
# Cross-compilation Settings
#
@@ -144,7 +150,6 @@ ifdef BUILD_CLIENT_ONLY
VM_NAME = client
endif
-
#
# Freetype logic is applicable to OpenJDK only
#
diff --git a/make/common/Demo.gmk b/make/common/Demo.gmk
index 31c032497872b386fea5d3eabbd5e835e07f819f..c804e94d180ec3d8e1ce424f984b3cadba58de14 100644
--- a/make/common/Demo.gmk
+++ b/make/common/Demo.gmk
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2004, 2011, 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
diff --git a/make/common/Library.gmk b/make/common/Library.gmk
index e7a24d477ff43a76e6752896c11afd3b1d378f67..9999406b71864ae12b613fef698248a1aec0f068 100644
--- a/make/common/Library.gmk
+++ b/make/common/Library.gmk
@@ -1,5 +1,5 @@
#
-# Copyright (c) 1995, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1995, 2011, 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
@@ -78,7 +78,7 @@ LINKER=$(LINK.c)
endif
$(ACTUAL_LIBRARY):: $(INIT) $(TEMPDIR) $(LIBDIR) $(BINDIR) $(EXTDIR) classheaders
-
+ @$(ECHO) Building lib:$(ACTUAL_LIBRARY)
#
# COMPILE_APPROACH: Different approaches to compile up the native object
# files as quickly as possible.
diff --git a/make/common/Program.gmk b/make/common/Program.gmk
index dc0baec883659f2d3ecca5ebe30a05410f5fd68b..23f704e46a732e2ae0bfb04c1fbbc03cb138346e 100644
--- a/make/common/Program.gmk
+++ b/make/common/Program.gmk
@@ -1,5 +1,5 @@
#
-# Copyright (c) 1995, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1995, 2011, 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
diff --git a/make/common/Release-embedded.gmk b/make/common/Release-embedded.gmk
new file mode 100644
index 0000000000000000000000000000000000000000..f7a87f28421a6867ba6c8a625cbe13cadaa47358
--- /dev/null
+++ b/make/common/Release-embedded.gmk
@@ -0,0 +1,232 @@
+#
+# Copyright (c) 2011, 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.
+#
+
+#
+# SE-Embedded Reduced JRE targets
+#
+ifdef JAVASE_EMBEDDED
+
+reduced-image-jre reduced-headless-image-jre ::
+ @$(ECHO) ">>>Making "$@" @ `$(DATE)` ..."
+
+# Add the reduced-jre images as pre-reqs. These will be processed last
+images:: reduced-image-jre reduced-headless-image-jre
+
+
+######################################################
+# Create the headless rt.jar
+######################################################
+
+NOT_HEADLESS_RT_JAR_LIST = $(ABS_TEMPDIR)/not_hl_rt_jar.list
+HEADLESS_RT_JAR_FILELIST=$(JARFILELISTS_TEMPDIR)/hl_rt_jar_list
+TOTAL_HEADLESS_JAR_FILELIST=$(REORDER_TEMPDIR)/hl_file_list
+HEADLESS_CLASSLIST=$(ABS_TEMPDIR)/headless_classlist
+
+# Add the jar file directories that we don't want in the
+# headless JRE. If you want to remove most classes in a
+# directory, put the directory in the NOT_HEADLESS_RT_JAR_LIST
+# and put the individual classes you want to keep in the
+# HEADLESS_CLASSLIST file.
+$(NOT_HEADLESS_RT_JAR_LIST): $(NOT_RT_JAR_LIST)
+ $(RM) $(HEADLESS_CLASSLIST)
+ $(RM) $(NOT_HEADLESS_RT_JAR_LIST)
+ $(CP) $(NOT_RT_JAR_LIST) $(NOT_HEADLESS_RT_JAR_LIST)
+ $(ECHO) "sun/awt/motif/" >> $@
+ $(ECHO) "sun/awt/X11/" >> $@
+ $(ECHO) "sun/applet/" >> $@
+ $(ECHO) "sun/java2d/opengl/" >> $@
+ $(ECHO) "com/sun/java/swing/plaf/" >> $@
+ $(ECHO) "sun/awt/motif/MFontConfiguration" >$(HEADLESS_CLASSLIST)
+ $(ECHO) "sun/applet/AppContextCreator" >>$(HEADLESS_CLASSLIST)
+ $(ECHO) "sun/applet/AppletAudioClip" >>$(HEADLESS_CLASSLIST)
+ $(ECHO) "sun/java2d/opengl/GLXSurfaceData" >>$(HEADLESS_CLASSLIST)
+ $(ECHO) "sun/java2d/opengl/GLXSurfaceData"\$$"GLXOffScreenSurfaceData" >>$(HEADLESS_CLASSLIST)
+ $(ECHO) "sun/java2d/opengl/GLXVolatileSurfaceManager" >>$(HEADLESS_CLASSLIST)
+ $(ECHO) "sun/java2d/opengl/OGLSurfaceData" >>$(HEADLESS_CLASSLIST)
+
+$(TOTAL_HEADLESS_JAR_FILELIST): $(JARREORDER_JARFILE) $(NOT_HEADLESS_RT_JAR_LIST)
+ $(prep-target)
+ $(RM) $@.temp
+ $(CD) $(CLASSBINDIR) ; \
+ $(BOOT_JAVA_CMD) -jar $(JARREORDER_JARFILE) \
+ -o $@.temp $(HEADLESS_CLASSLIST) $(NOT_HEADLESS_RT_JAR_LIST) .
+ $(MV) $@.temp $@
+ @$(CD) $(CLASSBINDIR); $(java-vm-cleanup)
+
+# Create the headless rt.jar file list & non-class files list
+MakeHeadlessJarFileList: $(TOTAL_HEADLESS_JAR_FILELIST) $(JARSPLIT_JARFILE)
+ @$(RM) $(HEADLESS_RT_JAR_FILELIST) $(RES_JAR_FILELIST)
+ $(BOOT_JAVA_CMD) -jar $(JARSPLIT_JARFILE) $(TOTAL_HEADLESS_JAR_FILELIST) \
+ -o $(HEADLESS_RT_JAR_FILELIST) $(RES_JAR_FILELIST)
+ @$(java-vm-cleanup)
+
+# Create headless rt.jar
+HL_RT_JAR=$(ABS_TEMPDIR)/rt-hl-orig.jar
+$(HL_RT_JAR): MakeHeadlessJarFileList $(JAR_MANIFEST_FILE)
+ $(prep-target)
+ $(CD) $(CLASSBINDIR) ; \
+ $(BOOT_JAR_CMD) $(CREATE_JAR_OPTS) $(JAR_MANIFEST_FILE) $@ @$(HEADLESS_RT_JAR_FILELIST) \
+ $(JAR_JFLAGS)
+ @$(CD) $(CLASSBINDIR); $(java-vm-cleanup)
+
+
+#
+# Produce a reduced Headful JRE for Embedded Devices
+#
+# The deployment binaries are added during the deployment build process
+#
+
+# Binaries that don't get included in reduced jre image bin directory
+NOT_REDUCEDJRE_BIN = \
+ java_vm \
+ kinit \
+ klist \
+ ktab \
+ orbd \
+ policytool \
+ rmid \
+ rmiregistry \
+ servertool \
+ tnameserv \
+ pack200 \
+ unpack200
+
+# jars/resources/libs that don't get included in reduced jre image lib directory
+NOT_REDUCEDJRE_LIB = \
+ charsets.jar \
+ ext/dnsns.jar \
+ ext/localedata.jar \
+ $(LIBARCH)/client/classes.jsa \
+ $(LIBARCH)/libjavaplugin_jni.so \
+ $(LIBARCH)/libjavaplugin_nscp_gcc29.so \
+ $(LIBARCH)/libjavaplugin_nscp.so \
+ $(LIBARCH)/libjavaplugin_oji.so
+
+
+ifeq ($(PLATFORM), linux)
+ STRIP_OPTS = --strip-unneeded
+else
+ STRIP_OPTS = -x
+endif
+
+
+reduced-image-jre::
+ @$(ECHO) Starting to Produce Reduced JRE
+ @#
+ @# First make a copy of the full JRE
+ @#
+ $(RM) -r $(JRE_REDUCED_IMAGE_DIR)
+ $(MKDIR) -p $(JRE_REDUCED_IMAGE_DIR)
+ $(CD) $(JRE_IMAGE_DIR); \
+ $(TAR) cf - . | ($(CD) $(JRE_REDUCED_IMAGE_DIR); $(TAR) xf - );
+
+ @# strip the main .so files
+ $(STRIP) $(STRIP_OPTS) $(JRE_REDUCED_IMAGE_DIR)/lib/$(LIBARCH)/client/libjvm.so
+ifndef BUILD_CLIENT_ONLY
+ $(STRIP) $(STRIP_OPTS) $(JRE_REDUCED_IMAGE_DIR)/lib/$(LIBARCH)/server/libjvm.so
+endif
+
+ @#
+ @# Remove all of the files that are not needed for the
+ @# reduced JRE
+ @#
+ for l in $(NOT_REDUCEDJRE_BIN) ; do \
+ $(RM) $(JRE_REDUCED_IMAGE_DIR)/bin/$$l ; \
+ done
+ for l in $(NOT_REDUCEDJRE_LIB) ; do \
+ $(RM) $(JRE_REDUCED_IMAGE_DIR)/lib/$$l ; \
+ done
+
+ @# Remove misc. other files
+ $(RM) -r $(JRE_REDUCED_IMAGE_DIR)/man
+ $(RM) -f $(JRE_REDUCED_IMAGE_DIR)/CHANGES
+
+ @$(ECHO) Done Creating Reduced JRE
+
+#
+# Produce a reduced Headless JRE
+#
+reduced-headless-image-jre:: $(RT_JAR) $(RESOURCES_JAR) $(BUILD_META_INDEX) $(HL_RT_JAR)
+ @$(ECHO) Starting to Produce Reduced Headless JRE
+ @#
+ @# First make a copy of the reduced JRE we just built
+ @#
+ $(RM) -r $(JRE_REDUCED_HEADLESS_IMAGE_DIR)
+ $(MKDIR) -p $(JRE_REDUCED_HEADLESS_IMAGE_DIR)
+ $(CD) $(JRE_REDUCED_IMAGE_DIR); \
+ $(TAR) cf - . | ($(CD) $(JRE_REDUCED_HEADLESS_IMAGE_DIR); $(TAR) xf - );
+
+ @# Replace the full rt.jar with the headless rt.jar
+ $(RM) -f $(JRE_REDUCED_HEADLESS_IMAGE_DIR)/lib/rt.jar
+ $(CP) $(HL_RT_JAR) $(JRE_REDUCED_HEADLESS_IMAGE_DIR)/lib/rt.jar
+
+ @#
+ @# Remove all of the files that are not needed for the
+ @# reduced Headless JRE
+ @#
+ $(RM) -f $(JRE_REDUCED_HEADLESS_IMAGE_DIR)/lib/$(LIBARCH)/gtkhelper
+ $(RM) $(JRE_REDUCED_HEADLESS_IMAGE_DIR)/lib/$(LIBARCH)/libjsoundalsa.so
+ $(RM) -r $(JRE_REDUCED_HEADLESS_IMAGE_DIR)/lib/audio
+ $(RM) -fr $(JRE_REDUCED_HEADLESS_IMAGE_DIR)/lib/applet
+ $(RM) $(JRE_REDUCED_HEADLESS_IMAGE_DIR)/lib/$(LIBARCH)/awt_robot
+ $(RM) -r $(JRE_REDUCED_HEADLESS_IMAGE_DIR)/lib/$(LIBARCH)/xawt
+ $(RM) -r $(JRE_REDUCED_HEADLESS_IMAGE_DIR)/lib/$(LIBARCH)/libsplashscreen.so
+ @# Remove oblique fonts and reduce font support to LucidaSansRegular only
+ $(RM) -fr $(JRE_REDUCED_HEADLESS_IMAGE_DIR)/lib/oblique-fonts
+ $(RM) -f $(JRE_REDUCED_HEADLESS_IMAGE_DIR)/lib/fonts/LucidaBrightDemiBold.ttf
+ $(RM) -f $(JRE_REDUCED_HEADLESS_IMAGE_DIR)/lib/fonts/LucidaBrightDemiItalic.ttf
+ $(RM) -f $(JRE_REDUCED_HEADLESS_IMAGE_DIR)/lib/fonts/LucidaBrightItalic.ttf
+ $(RM) -f $(JRE_REDUCED_HEADLESS_IMAGE_DIR)/lib/fonts/LucidaBrightRegular.ttf
+ $(RM) -f $(JRE_REDUCED_HEADLESS_IMAGE_DIR)/lib/fonts/LucidaSansDemiBold.ttf
+ $(RM) -f $(JRE_REDUCED_HEADLESS_IMAGE_DIR)/lib/fonts/LucidaTypewriterBold.ttf
+ $(RM) -f $(JRE_REDUCED_HEADLESS_IMAGE_DIR)/lib/fonts/LucidaTypewriterRegular.ttf
+
+ifeq ($(PLATFORM), linux)
+# put out minimal fonts.dir file for the remaining font
+ $(RM) -f $(JRE_REDUCED_HEADLESS_IMAGE_DIR)/lib/fonts/fonts.dir
+ $(ECHO) 6>$(JRE_REDUCED_HEADLESS_IMAGE_DIR)/lib/fonts/fonts.dir
+ $(ECHO) "LucidaSansRegular.ttf -b&h-lucidasans-medium-r-normal-sans-0-0-0-0-p-0-iso8859-1">>$(JRE_REDUCED_HEADLESS_IMAGE_DIR)/lib/fonts/fonts.dir
+ $(ECHO) "LucidaSansRegular.ttf -b&h-lucidasans-medium-r-normal-sans-0-0-0-0-p-0-iso8859-2">>$(JRE_REDUCED_HEADLESS_IMAGE_DIR)/lib/fonts/fonts.dir
+ $(ECHO) "LucidaSansRegular.ttf -b&h-lucidasans-medium-r-normal-sans-0-0-0-0-p-0-iso8859-4">>$(JRE_REDUCED_HEADLESS_IMAGE_DIR)/lib/fonts/fonts.dir
+ $(ECHO) "LucidaSansRegular.ttf -b&h-lucidasans-medium-r-normal-sans-0-0-0-0-p-0-iso8859-5">>$(JRE_REDUCED_HEADLESS_IMAGE_DIR)/lib/fonts/fonts.dir
+ $(ECHO) "LucidaSansRegular.ttf -b&h-lucidasans-medium-r-normal-sans-0-0-0-0-p-0-iso8859-7">>$(JRE_REDUCED_HEADLESS_IMAGE_DIR)/lib/fonts/fonts.dir
+ $(ECHO) "LucidaSansRegular.ttf -b&h-lucidasans-medium-r-normal-sans-0-0-0-0-p-0-iso8859-9">>$(JRE_REDUCED_HEADLESS_IMAGE_DIR)/lib/fonts/fonts.dir
+
+endif # Linux
+
+ @#
+ @# all done with JRE reduced headless image
+ @#
+
+ @$(ECHO) Done Creating Reduced Headless JRE
+
+images-clobber::
+ $(RM) -r $(JRE_REDUCED_IMAGE_DIR)
+ $(RM) -r $(JRE_REDUCED_HEADLESS_IMAGE_DIR)
+
+.PHONY: reduced-image-jre reduced-headless-image-jre
+
+endif # JAVASE_EMBEDDED
+
diff --git a/make/common/Release.gmk b/make/common/Release.gmk
index 63e03c44edceb197092389a0422bd4dde70eaf62..17297d573b04613a6f6c585864f7d8a00f50e952 100644
--- a/make/common/Release.gmk
+++ b/make/common/Release.gmk
@@ -38,7 +38,7 @@ THIS_JDK_VERSION := $(JDK_MAJOR_VERSION).$(JDK_MINOR_VERSION).$(JDK_MICRO_VERSIO
IMAGE_BINDIR = bin
-# The compiler should not issue a "Sun Propietary" warning when compiling
+# The compiler should not issue a "Proprietary" warning when compiling
# classes in the com.sun.java.swing.plaf packages, since we've always
# allowed, and even advocated, extending them (see bug 6476749).
#
@@ -195,6 +195,16 @@ if [ "$(JA_DIRNAME)" != "" ] ; then \
fi
endef
+
+# no compression unless requested
+ifndef COMPRESS_JARS
+ CREATE_JAR_OPTS = c0mf
+ CREATE_JAR_OPTS_NOMANIFEST = c0f
+else
+ CREATE_JAR_OPTS = cmf
+ CREATE_JAR_OPTS_NOMANIFEST = cf
+endif
+
#
# Targets.
#
@@ -222,7 +232,7 @@ images:: sanity-images post-sanity-images \
$(INITIAL_IMAGE_JRE) $(INITIAL_IMAGE_JDK) \
trim-image-jre trim-image-jdk \
identify-image-jre identify-image-jdk \
- process-image-jre process-image-jdk sec-files sec-files-win jgss-files
+ process-image-jre process-image-jdk sec-files sec-files-win jgss-files
# Don't use these
image-jre:: initial-image-jre trim-image-jre identify-image-jre process-image-jre
@@ -613,7 +623,7 @@ RESOURCES_JAR=$(ABS_TEMPDIR)/resources-orig.jar
$(RESOURCES_JAR): $(RES_JAR_FILELIST) $(JAR_MANIFEST_FILE)
$(prep-target)
$(CD) $(CLASSBINDIR) && \
- $(BOOT_JAR_CMD) c0mf $(JAR_MANIFEST_FILE) $@ \
+ $(BOOT_JAR_CMD) $(CREATE_JAR_OPTS) $(JAR_MANIFEST_FILE) $@ \
@$(RES_JAR_FILELIST) $(BOOT_JAR_JFLAGS)
@$(CD) $(CLASSBINDIR) && $(java-vm-cleanup)
@@ -622,7 +632,7 @@ JSSE_JAR=$(ABS_TEMPDIR)/jsse-orig.jar
$(JSSE_JAR): $(JAR_MANIFEST_FILE)
$(prep-target)
$(CD) $(CLASSBINDIR) && \
- $(BOOT_JAR_CMD) c0mf $(JAR_MANIFEST_FILE) $@ \
+ $(BOOT_JAR_CMD) $(CREATE_JAR_OPTS) $(JAR_MANIFEST_FILE) $@ \
$(JSSE_CLASSES_DIRS) $(BOOT_JAR_JFLAGS)
@$(CD) $(CLASSBINDIR) && $(java-vm-cleanup)
@@ -669,7 +679,7 @@ RT_JAR=$(ABS_TEMPDIR)/rt-orig.jar
$(RT_JAR): $(RT_JAR_FILELIST) $(JAR_MANIFEST_FILE)
$(prep-target)
$(CD) $(CLASSBINDIR) && \
- $(BOOT_JAR_CMD) c0mf $(JAR_MANIFEST_FILE) $@ \
+ $(BOOT_JAR_CMD) $(CREATE_JAR_OPTS) $(JAR_MANIFEST_FILE) $@ \
@$(RT_JAR_FILELIST) $(BOOT_JAR_JFLAGS)
@$(CD) $(CLASSBINDIR) && $(java-vm-cleanup)
@@ -677,6 +687,10 @@ $(RT_JAR): $(RT_JAR_FILELIST) $(JAR_MANIFEST_FILE)
BUILDMETAINDEX_JARFILE = $(ABS_BUILDTOOLJARDIR)/buildmetaindex.jar
+# SE-Embedded targets if enabled
+include $(JDK_TOPDIR)/make/common/Release-embedded.gmk
+
+
######################################################
# JRE Image
######################################################
@@ -924,7 +938,7 @@ initial-image-jdk:: initial-image-jdk-setup \
@# lib/tools.jar
@#
$(CD) $(CLASSBINDIR) && \
- $(BOOT_JAR_CMD) c0f $(ABS_LIBDIR)/tools.jar \
+ $(BOOT_JAR_CMD) $(CREATE_JAR_OPTS_NOMANIFEST) $(ABS_LIBDIR)/tools.jar \
$(TOOLS) $(BOOT_JAR_JFLAGS)
@$(CD) $(CLASSBINDIR) && $(java-vm-cleanup)
$(CP) $(LIBDIR)/tools.jar $(JDK_IMAGE_DIR)/lib/tools.jar
@@ -937,7 +951,7 @@ initial-image-jdk:: initial-image-jdk-setup \
-Acom.sun.tools.javac.sym.Jar=$(RT_JAR) \
-Acom.sun.tools.javac.sym.Dest=$(OUTPUTDIR)/symbols/META-INF/sym/rt.jar \
$(CORE_PKGS) $(NON_CORE_PKGS) $(EXCLUDE_PROPWARN_PKGS) $(EXPORTED_PRIVATE_PKGS)
- $(BOOT_JAR_CMD) c0f $(LIBDIR)/ct.sym \
+ $(BOOT_JAR_CMD) $(CREATE_JAR_OPTS_NOMANIFEST) $(LIBDIR)/ct.sym \
-C $(OUTPUTDIR)/symbols META-INF $(BOOT_JAR_JFLAGS)
@$(java-vm-cleanup)
$(CP) $(LIBDIR)/ct.sym $(JDK_IMAGE_DIR)/lib/ct.sym
diff --git a/make/common/Sanity.gmk b/make/common/Sanity.gmk
index 5060b8c12b4d3849e8ca19231373d217a55fe2fa..27fe5bdfa16928cfcc982b57d03ae50aa9026211 100644
--- a/make/common/Sanity.gmk
+++ b/make/common/Sanity.gmk
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2001, 2011, 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
diff --git a/make/common/Subdirs.gmk b/make/common/Subdirs.gmk
index 4da8acfca4e576fb09994ec0f406067e330747ae..f212d50c1626b4dc4331e7993b10335b547f9adc 100644
--- a/make/common/Subdirs.gmk
+++ b/make/common/Subdirs.gmk
@@ -1,4 +1,4 @@
-# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2010, 2011, 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
diff --git a/make/common/shared/Compiler-msvc.gmk b/make/common/shared/Compiler-msvc.gmk
index ff00095c565f8bd9d25511d12c3909f450630ba7..c50706c5fbd6c86b59a968bcadc37530d08121f1 100644
--- a/make/common/shared/Compiler-msvc.gmk
+++ b/make/common/shared/Compiler-msvc.gmk
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2005, 2011, 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
diff --git a/make/common/shared/Defs-control.gmk b/make/common/shared/Defs-control.gmk
index 288eb83e01c4e84fa91ea6999c1757b0f3338030..4a67131a23570e46a6b40260d731a55fb1e56853 100644
--- a/make/common/shared/Defs-control.gmk
+++ b/make/common/shared/Defs-control.gmk
@@ -1,5 +1,5 @@
#
-# Copyright (c) 1995, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1995, 2011, 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
diff --git a/make/common/shared/Defs-javadoc.gmk b/make/common/shared/Defs-javadoc.gmk
index f63ec22f5013e42e92217e5cbd2a3a4cfecebe70..c222ad10fa47e84df11bf0efaaf0f9c84042e9d9 100644
--- a/make/common/shared/Defs-javadoc.gmk
+++ b/make/common/shared/Defs-javadoc.gmk
@@ -1,5 +1,5 @@
#
-# Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1997, 2011, 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
diff --git a/make/common/shared/Defs-linux.gmk b/make/common/shared/Defs-linux.gmk
index 4960ecd4de9d577ac602b380608436e6b6018263..ecdf5d77ee4d57b05fd831dabf26a9879d54e94c 100644
--- a/make/common/shared/Defs-linux.gmk
+++ b/make/common/shared/Defs-linux.gmk
@@ -187,6 +187,12 @@ HOTSPOT_SERVER_PATH:=$(call AltCheckValue,HOTSPOT_SERVER_PATH)
# Special define for checking the binaries
+# Debug builds should downgrade warnings to just info
+MAPFILE_WARNING-DBG=INFO
+MAPFILE_WARNING-OPT=WARNING
+MAPFILE_WARNING-=WARNING
+MAPFILE_WARNING=$(MAPFILE_WARNING-$(VARIANT))
+
# Macro to check it's input file for banned dependencies and verify the
# binary built properly. Relies on process exit code.
ifndef CROSS_COMPILE_ARCH
@@ -194,7 +200,7 @@ define binary_file_verification # binary_file
( \
$(ECHO) "Checking for mapfile use in: $1" && \
if [ "`$(NM) -D -g --defined-only $1 | $(EGREP) 'SUNWprivate'`" = "" ] ; then \
- $(ECHO) "WARNING: File was not built with a mapfile: $1"; \
+ $(ECHO) "$(MAPFILE_WARNING): File was not built with a mapfile: $1"; \
fi && \
$(ECHO) "Library loads for: $1" && \
$(LDD) $1 && \
@@ -208,4 +214,5 @@ define binary_file_verification
$(ECHO) "Skipping binary file verification for cross-compile build" \
)
endef
-endif
\ No newline at end of file
+endif
+
diff --git a/make/common/shared/Defs-solaris.gmk b/make/common/shared/Defs-solaris.gmk
index 7e5c90a20ba62641442cbc79d39aefa06b683337..261583d9af97413db8823c9935d7d27622c94366 100644
--- a/make/common/shared/Defs-solaris.gmk
+++ b/make/common/shared/Defs-solaris.gmk
@@ -188,14 +188,37 @@ HOTSPOT_SERVER_PATH:=$(call AltCheckValue,HOTSPOT_SERVER_PATH)
# Special define for checking the binaries
+# Debug builds should downgrade warnings to just info
+MAPFILE_WARNING-DBG=INFO
+MAPFILE_WARNING-OPT=WARNING
+MAPFILE_WARNING-=WARNING
+MAPFILE_WARNING=$(MAPFILE_WARNING-$(VARIANT))
+
+# Some libraries do not have mapfiles for multiple reasons.
+# These libraries for sparc and sparcv9 are exceptions to the mapfile rule:
+# libjdgaSUNWafb.so
+# libjdgaSUNWcg6.so
+# libjdgaSUNWffb.so
+# libjdgaSUNWm64.so
+# libxinerama.so
+# The library libJdbcOdbc.so has also been given an exception.
+# The JNI/JVMTI demo libraries are also missing mapfiles, no exceptions yet.
+ifeq ($(ARCH_FAMILY),sparc)
+ MAPFILE_EXCEPTIONS = \
+ (libJdbcOdbc|libjdgaSUNWafb|libjdgaSUNWcg6|libjdgaSUNWffb|libjdgaSUNWm64|libxinerama)
+else
+ MAPFILE_EXCEPTIONS = (libJdbcOdbc)
+endif
+
# Macro to check it's input file for banned dependencies and verify the
# binary built properly. Relies on process exit code.
ifndef CROSS_COMPILE_ARCH
define binary_file_verification # binary_file
( \
$(ECHO) "Checking for mapfile use in: $1" && \
- if [ "`$(NM) -g -D $1 | $(EGREP) -v 'UNDEF' | $(EGREP) 'SUNWprivate'`" = "" ] ; then \
- $(ECHO) "WARNING: File was not built with a mapfile: $1"; \
+ if [ "`$(ECHO) $(basename $(notdir $1)) | $(EGREP) '$(MAPFILE_EXCEPTIONS)'`" = "" \
+ -a "`$(NM) -g -D $1 | $(EGREP) -v 'UNDEF' | $(EGREP) 'SUNWprivate'`" = "" ] ; then \
+ $(ECHO) "$(MAPFILE_WARNING): File was not built with a mapfile: $1"; \
fi && \
$(ECHO) "Library loads for: $1" && \
$(LDD) $1 && \
@@ -209,4 +232,5 @@ define binary_file_verification
$(ECHO) "Skipping binary file verification for cross-compile build" \
)
endef
-endif
\ No newline at end of file
+endif
+
diff --git a/make/common/shared/Defs-windows.gmk b/make/common/shared/Defs-windows.gmk
index 44df76cb3c2846bd2a8a2f27fa07435a11058faa..af611f3aab2a183d203054ad35e58e88a43b4ebf 100644
--- a/make/common/shared/Defs-windows.gmk
+++ b/make/common/shared/Defs-windows.gmk
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2005, 2011, 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
diff --git a/make/common/shared/Defs.gmk b/make/common/shared/Defs.gmk
index cfc889a01484b12c9e7f75cce4ec06499601ff11..cc7236582039e00095cf3aa187f9d9b2e76a52c3 100644
--- a/make/common/shared/Defs.gmk
+++ b/make/common/shared/Defs.gmk
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2005, 2011, 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
diff --git a/make/common/shared/Sanity-Settings.gmk b/make/common/shared/Sanity-Settings.gmk
index 0184a74792d712692b43fbf3075405695486fa26..36179fed5fdeb4b9533a27aaaec7da5091a605d5 100644
--- a/make/common/shared/Sanity-Settings.gmk
+++ b/make/common/shared/Sanity-Settings.gmk
@@ -185,7 +185,9 @@ ifeq ($(PLATFORM),windows)
endif
endif
ifeq ($(PLATFORM),linux)
- ALL_SETTINGS+=$(call addRequiredSetting,ALSA_VERSION)
+ ifdef REQUIRED_ALSA_VERSION
+ ALL_SETTINGS+=$(call addRequiredSetting,ALSA_VERSION)
+ endif
endif
ALL_SETTINGS+=$(call addRequiredVersionSetting,OS_VERSION)
ALL_SETTINGS+=$(call addOptionalSetting,OS_VARIANT_NAME)
diff --git a/make/docs/Makefile b/make/docs/Makefile
index 520272b5f5a5a3a0c2d777a5a681bb561471bcc0..ee8eb03b7a9ee02b27d8350ca3ac2d653f651f6a 100644
--- a/make/docs/Makefile
+++ b/make/docs/Makefile
@@ -1,4 +1,4 @@
-# Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@@ -40,7 +40,7 @@ COPYRIGHT_URL-7 = $(DOCSDIR_URL)/legal/cpyr.html
COPYRIGHT_URL = $(COPYRIGHT_URL-$(JDK_MINOR_VERSION))
# Url to bug filing site
-BUG_SUBMIT_URL = http://bugs.sun.com/services/bugreport/index.jsp
+BUG_SUBMIT_URL = http://bugreport.sun.com/bugreport/
# Common line for how to submit a bug or rfe
BUG_SUBMIT_LINE = Submit a bug or feature
diff --git a/make/docs/NON_CORE_PKGS.gmk b/make/docs/NON_CORE_PKGS.gmk
index a7f4aaf1dd232f15dcdff09b8c1758c099f706e4..25c79408bdb9a6c1893c0138eebf6f5d8df9ac3b 100644
--- a/make/docs/NON_CORE_PKGS.gmk
+++ b/make/docs/NON_CORE_PKGS.gmk
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2002, 2011, 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
diff --git a/make/java/awt/Makefile b/make/java/awt/Makefile
index 1da8f498cfc3d97b597705302ae1acf1dc8fded6..6cabc50f19a144644e53c7f29ad52486b7be5ffb 100644
--- a/make/java/awt/Makefile
+++ b/make/java/awt/Makefile
@@ -1,5 +1,5 @@
#
-# Copyright (c) 1995, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1995, 2011, 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
diff --git a/make/java/fdlibm/Makefile b/make/java/fdlibm/Makefile
index 38e4bfd9f55aeda48364faf464ac91e9e8676e02..39346de1fdb99b02b75e607e07c928bbd8d05dd4 100644
--- a/make/java/fdlibm/Makefile
+++ b/make/java/fdlibm/Makefile
@@ -1,5 +1,5 @@
#
-# Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1998, 2011, 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
diff --git a/make/java/java/FILES_java.gmk b/make/java/java/FILES_java.gmk
index 06c93db4e5d40b316172505f55346c9e623765a8..d07efda0aa1c246e0ed65cdd7536548beb19bac2 100644
--- a/make/java/java/FILES_java.gmk
+++ b/make/java/java/FILES_java.gmk
@@ -1,5 +1,5 @@
#
-# Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1996, 2011, 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
diff --git a/make/java/java/Makefile b/make/java/java/Makefile
index 9a2627096f0690b82946c21943cd4fc5197bb89a..a51082614d309561949abd04b35f01860f2fe9c5 100644
--- a/make/java/java/Makefile
+++ b/make/java/java/Makefile
@@ -1,5 +1,5 @@
#
-# Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1997, 2011, 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
@@ -198,10 +198,12 @@ INSTALL_DOT_LIB = true
#
# What to link?
+# On Windows, shell32 is not normally required and so it is delay loaded.
#
ifeq ($(PLATFORM),windows)
OTHER_LDLIBS += $(JVMLIB) -libpath:$(OBJDIR)/../../../fdlibm/$(OBJDIRNAME) fdlibm.lib \
- -libpath:$(OBJDIR)/../../../verify/$(OBJDIRNAME) verify.lib
+ -libpath:$(OBJDIR)/../../../verify/$(OBJDIRNAME) verify.lib \
+ shell32.lib delayimp.lib /DELAYLOAD:shell32.dll
else
OTHER_LDLIBS += $(JVMLIB) -lverify $(LIBSOCKET) $(LIBNSL) -ldl \
-L$(OBJDIR)/../../../fdlibm/$(OBJDIRNAME) -lfdlibm.$(ARCH)
diff --git a/make/java/java_crw_demo/Makefile b/make/java/java_crw_demo/Makefile
index 6b3732079aa019b37e3868dacb4c55185d5cb654..ebcadd746568e92e0c36d2ebcc3eb2016f62162e 100644
--- a/make/java/java_crw_demo/Makefile
+++ b/make/java/java_crw_demo/Makefile
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2004, 2011, 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
diff --git a/make/java/java_hprof_demo/Makefile b/make/java/java_hprof_demo/Makefile
index 8ad85dc0c5b3e97109109e842ad4a16cbc563506..9449d2d706285f1e4742c235e6b9999183f08fdd 100644
--- a/make/java/java_hprof_demo/Makefile
+++ b/make/java/java_hprof_demo/Makefile
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2003, 2011, 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
diff --git a/make/java/jli/Makefile b/make/java/jli/Makefile
index 7ecee49fb2f169b615a346e0d68c8d3e48e51f99..f342f62b239d509dcbacb3f6a0b2bf604c89333a 100644
--- a/make/java/jli/Makefile
+++ b/make/java/jli/Makefile
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2005, 2011, 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
diff --git a/make/java/logging/Makefile b/make/java/logging/Makefile
index 5f9153fb7b1275ff2ea1229a934edd0dc58fbf6d..11ce8df2bf008ff9603a7d4b0d77e1da7bed2883 100644
--- a/make/java/logging/Makefile
+++ b/make/java/logging/Makefile
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2000, 2011, 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
diff --git a/make/java/main/java/Makefile b/make/java/main/java/Makefile
index 452099f7a916a6a12d5bbb50de5f6257f7fec1da..2a40bdf9fdd371fe9ff59243d7e0c548da91f940 100644
--- a/make/java/main/java/Makefile
+++ b/make/java/main/java/Makefile
@@ -1,5 +1,5 @@
#
-# Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1996, 2011, 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
diff --git a/make/java/main/javaw/Makefile b/make/java/main/javaw/Makefile
index e2fc6161aa7304cf958aa3e0f7e75bc0103dd889..93a536e9edd60d3167ec3b222083ee5ef159ce62 100644
--- a/make/java/main/javaw/Makefile
+++ b/make/java/main/javaw/Makefile
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2000, 2011, 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
diff --git a/make/java/management/Makefile b/make/java/management/Makefile
index ebf3640b812d0bc02b3722fab7bf0ee748e857f4..aa9b889546dfba4dfd6b5a841a42adba0fd2d512 100644
--- a/make/java/management/Makefile
+++ b/make/java/management/Makefile
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2003, 2011, 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,7 +86,8 @@ OTHER_INCLUDES += \
-I$(SHARE_SRC)/native/sun/management
ifeq ($(PLATFORM),windows)
- OTHER_LDLIBS += $(JVMLIB)
+ # Need process status helper API (psapi) on Windows
+ OTHER_LDLIBS += $(JVMLIB) psapi.lib
endif
#
diff --git a/make/java/net/Makefile b/make/java/net/Makefile
index 6e865fa24ec0b36513e6c6a0eddda36f9562261a..e6429c6c20957f06b1924578eae5be8e796ec492 100644
--- a/make/java/net/Makefile
+++ b/make/java/net/Makefile
@@ -1,5 +1,5 @@
#
-# Copyright (c) 1995, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1995, 2011, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@@ -37,10 +37,6 @@ include FILES_c.gmk
AUTO_FILES_JAVA_DIRS = java/net
ifeq ($(PLATFORM), windows)
- # Windows 9x module only needed on 32-bit build
- ifeq ($(ARCH_DATA_MODEL), 32)
- FILES_c += NetworkInterface_win9x.c
- endif
FILES_c += NTLMAuthSequence.c
FILES_c += NetworkInterface_winXP.c
else
@@ -96,7 +92,9 @@ include $(BUILDDIR)/common/Mapfile-vers.gmk
include $(BUILDDIR)/common/Library.gmk
ifeq ($(PLATFORM), windows)
- OTHER_LDLIBS = ws2_32.lib $(JVMLIB)
+ OTHER_LDLIBS = ws2_32.lib $(JVMLIB) \
+ secur32.lib iphlpapi.lib delayimp.lib \
+ /DELAYLOAD:secur32.dll /DELAYLOAD:iphlpapi.dll
else
OTHER_LDLIBS = $(LIBSOCKET) $(LIBNSL) -ldl $(JVMLIB)
endif
diff --git a/make/java/nio/FILES_java.gmk b/make/java/nio/FILES_java.gmk
index 9fbeafb48a3a4a2de217195b48b712ea1c07c298..34b41d5db380dfab39236afc2c7da79d72ae4e89 100644
--- a/make/java/nio/FILES_java.gmk
+++ b/make/java/nio/FILES_java.gmk
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2000, 2011, 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
diff --git a/make/java/nio/mapfile-linux b/make/java/nio/mapfile-linux
index 7738adb1a73bbe0c595c01ad91316d5fc2768af2..7af5388de961e9ec8e2c668fb272581300ed050c 100644
--- a/make/java/nio/mapfile-linux
+++ b/make/java/nio/mapfile-linux
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2001, 2011, 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
diff --git a/make/java/nio/mapfile-solaris b/make/java/nio/mapfile-solaris
index c295f8771ad84372c287f452d03496e9b305079f..4d86f28a56609f4bafb5c5eaf6144c093873c544 100644
--- a/make/java/nio/mapfile-solaris
+++ b/make/java/nio/mapfile-solaris
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2001, 2011, 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
diff --git a/make/java/npt/Makefile b/make/java/npt/Makefile
index 53f14aa5148ad8eb209e4d2de17b7ebd984ba2a5..587f299ea447623dd48b5041993294bc4532ebe3 100644
--- a/make/java/npt/Makefile
+++ b/make/java/npt/Makefile
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2004, 2011, 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
diff --git a/make/java/redist/Makefile b/make/java/redist/Makefile
index 186296a5e34acfdc6e3b89b20109f3ea6c0430f5..392cd2c16243fbf964c05e640f7ffcddeeeb7e60 100644
--- a/make/java/redist/Makefile
+++ b/make/java/redist/Makefile
@@ -1,5 +1,5 @@
#
-# Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1997, 2011, 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
diff --git a/make/java/redist/fonts/Makefile b/make/java/redist/fonts/Makefile
index 6c4c2f987dfb11909fcd3a5c4c318c9455a4d7e6..d98fb8fb13b970962b173396f1d1c37ed61fb324 100644
--- a/make/java/redist/fonts/Makefile
+++ b/make/java/redist/fonts/Makefile
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2009, 2011, 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
diff --git a/make/java/redist/sajdi/Makefile b/make/java/redist/sajdi/Makefile
index 177c757cd059705f397413d61a80c957aea37405..b624b81ccc9e42ca36a14f453e9024215f3b3f5d 100644
--- a/make/java/redist/sajdi/Makefile
+++ b/make/java/redist/sajdi/Makefile
@@ -1,5 +1,5 @@
#
-# Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1997, 2011, 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
diff --git a/make/java/sql/Makefile b/make/java/sql/Makefile
index 6b71ac1644b2b579bb164bcc78c22783b6e38ae3..e3155b7713e35d9e4135baf89f1b2670aaa18c81 100644
--- a/make/java/sql/Makefile
+++ b/make/java/sql/Makefile
@@ -1,5 +1,5 @@
#
-# Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1996, 2011, 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
diff --git a/make/java/text/base/FILES_java.gmk b/make/java/text/base/FILES_java.gmk
index 34c3491d209c80086182bbd5f894003c3c337a71..9d2667364d3dd879f4926a824ce678f46fbd7e80 100644
--- a/make/java/text/base/FILES_java.gmk
+++ b/make/java/text/base/FILES_java.gmk
@@ -1,5 +1,5 @@
#
-# Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1996, 2011, 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
diff --git a/make/java/text/base/Makefile b/make/java/text/base/Makefile
index d53d21b822c06b0dda7a2b22046d847e881c63a2..8320363dc79a3887ad7baa654ecaa9bc74cf414d 100644
--- a/make/java/text/base/Makefile
+++ b/make/java/text/base/Makefile
@@ -1,5 +1,5 @@
#
-# Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1996, 2011, 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
diff --git a/make/java/util/FILES_properties.gmk b/make/java/util/FILES_properties.gmk
index 5f3bec5e516f1aeaa36a83cda721264514ba6299..4f9f7cd9148e195af12d5a8e62897b7f4c679fc9 100644
--- a/make/java/util/FILES_properties.gmk
+++ b/make/java/util/FILES_properties.gmk
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2005, 2007, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2005, 2011, 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
@@ -55,6 +55,7 @@ FILES_compiled_properties = \
sun/util/resources/LocaleNames_mt.properties \
sun/util/resources/LocaleNames_nl.properties \
sun/util/resources/LocaleNames_no.properties \
+ sun/util/resources/LocaleNames_no_NO_NY.properties \
sun/util/resources/LocaleNames_pl.properties \
sun/util/resources/LocaleNames_pt.properties \
sun/util/resources/LocaleNames_pt_BR.properties \
diff --git a/make/java/verify/Makefile b/make/java/verify/Makefile
index d0399120d81e9f419a59bfb4c90689b44754125d..4343e4aa0dc16cf686b69fe1fcf17a2f45be7f70 100644
--- a/make/java/verify/Makefile
+++ b/make/java/verify/Makefile
@@ -1,5 +1,5 @@
#
-# Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1999, 2011, 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
diff --git a/make/java/zip/Makefile b/make/java/zip/Makefile
index fd83ea3f28292b90397faaf5547f2f2b4a5c58d2..906e7e8509677f2b062b2a5c557488a909d4a0d3 100644
--- a/make/java/zip/Makefile
+++ b/make/java/zip/Makefile
@@ -1,5 +1,5 @@
#
-# Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@@ -50,7 +50,10 @@ FILES_export = \
java/util/jar/JarFile.java
ifneq ($(PLATFORM), windows)
-OTHER_CFLAGS += -DUSE_MMAP
+ # Use mmap unless explicitly disallowed
+ ifneq ($(LIBZIP_CAN_USE_MMAP),false)
+ OTHER_CFLAGS += -DUSE_MMAP
+ endif
endif
#
diff --git a/make/javax/crypto/Defs-jce.gmk b/make/javax/crypto/Defs-jce.gmk
index cfb70b45c489d5ed824b8344cc6d842014ff52c1..bd5cec9d4eb4d46f458a057f45dcf98e275ec97f 100644
--- a/make/javax/crypto/Defs-jce.gmk
+++ b/make/javax/crypto/Defs-jce.gmk
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2007, 2009, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2007, 2011, 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
diff --git a/make/javax/crypto/Makefile b/make/javax/crypto/Makefile
index f2f8baed5541e26e17acaf7da57cf555b8f94bc6..f8b55a411a37a44d04d64b4235d401fad9e10df6 100644
--- a/make/javax/crypto/Makefile
+++ b/make/javax/crypto/Makefile
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2007, 2011, 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
diff --git a/make/javax/imageio/Makefile b/make/javax/imageio/Makefile
index 1a64c1038ba16025bdeb8dcea02773dc36d26817..c73f6f549f06b16163fb589e14264d3b10a3d8d8 100644
--- a/make/javax/imageio/Makefile
+++ b/make/javax/imageio/Makefile
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2000, 2011, 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
diff --git a/make/javax/print/Makefile b/make/javax/print/Makefile
index 290de0f412630bbcde065bfa42debc62a58c3c6e..6e1c5c9e5d09b961071ea7d3ab5f6b26888130eb 100644
--- a/make/javax/print/Makefile
+++ b/make/javax/print/Makefile
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2000, 2011, 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
diff --git a/make/javax/sound/Makefile b/make/javax/sound/Makefile
index 9a6659c41b2474d4305bb9494654b1af84720b8e..a048f23dd3ff37a80e989d52b4086f73d523f69d 100644
--- a/make/javax/sound/Makefile
+++ b/make/javax/sound/Makefile
@@ -1,5 +1,5 @@
#
-# Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1999, 2011, 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
diff --git a/make/javax/sound/jsoundalsa/Makefile b/make/javax/sound/jsoundalsa/Makefile
index 95161cd6b8786f7dba080449d76f962dcb0c9dde..11b4987dc88fc52b373cc8b4a1d9f5874ab3098c 100644
--- a/make/javax/sound/jsoundalsa/Makefile
+++ b/make/javax/sound/jsoundalsa/Makefile
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2002, 2011, 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
diff --git a/make/javax/sound/jsoundds/Makefile b/make/javax/sound/jsoundds/Makefile
index 26c59f1ab4bcff3f3478e179649f337c36d93fd7..f476b39811acdf69c33ba6babd6192956501eeb8 100644
--- a/make/javax/sound/jsoundds/Makefile
+++ b/make/javax/sound/jsoundds/Makefile
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2003, 2011, 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
diff --git a/make/javax/sql/Makefile b/make/javax/sql/Makefile
index 91a8db6cabcff7a0c0dcc16534b9a7733d45597c..cd138cb30f274f5b88680da46e1d03fddb761641 100644
--- a/make/javax/sql/Makefile
+++ b/make/javax/sql/Makefile
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2000, 2011, 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
diff --git a/make/javax/swing/Makefile b/make/javax/swing/Makefile
index 97c5060f7a20c3c291896427cc7a40337ced01a2..4c67858b8850500b4676d308b2e52349ba52d8e2 100644
--- a/make/javax/swing/Makefile
+++ b/make/javax/swing/Makefile
@@ -1,5 +1,5 @@
#
-# Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1998, 2011, 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
diff --git a/make/javax/swing/plaf/Makefile b/make/javax/swing/plaf/Makefile
index ceb5304a8fa39cb40d2ccb9c45f128bf012405eb..394657f1e3e6baf607516f17ed7c527f3ea1128a 100644
--- a/make/javax/swing/plaf/Makefile
+++ b/make/javax/swing/plaf/Makefile
@@ -1,5 +1,5 @@
#
-# Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1998, 2011, 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
diff --git a/make/jdk_generic_profile.sh b/make/jdk_generic_profile.sh
index 9d7ead8b8656e665cda339fbb16cc27dbee74a78..0190fc6bc2476ca4cb5e05c6d18c159c222f0de1 100644
--- a/make/jdk_generic_profile.sh
+++ b/make/jdk_generic_profile.sh
@@ -1,7 +1,7 @@
#!/bin/sh
#
-# Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2007, 2011, 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
diff --git a/make/jpda/back/Makefile b/make/jpda/back/Makefile
index 65d47e922c45252419578bf1b9eb8a661ece74d3..a0d9721b15de3cba5e3161c4827a141806ead703 100644
--- a/make/jpda/back/Makefile
+++ b/make/jpda/back/Makefile
@@ -1,5 +1,5 @@
#
-# Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1998, 2011, 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
diff --git a/make/jpda/transport/Makefile b/make/jpda/transport/Makefile
index a6f18ec29addfccfb11377e318b353d1eebdb4a2..6d8311bd90eab6bcc28bf1eebeb39c059dd12670 100644
--- a/make/jpda/transport/Makefile
+++ b/make/jpda/transport/Makefile
@@ -1,5 +1,5 @@
#
-# Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1998, 2011, 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
diff --git a/make/jpda/transport/shmem/Makefile b/make/jpda/transport/shmem/Makefile
index 60e0276a4299723b73b8e0108dfdac2ec8a89ae9..58987c8cca89250cdc02183d77e514104077ad71 100644
--- a/make/jpda/transport/shmem/Makefile
+++ b/make/jpda/transport/shmem/Makefile
@@ -1,5 +1,5 @@
#
-# Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1999, 2011, 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
diff --git a/make/jpda/transport/socket/Makefile b/make/jpda/transport/socket/Makefile
index 3a742d337b2d1006e2c1e98164f6e6db97bbd445..ac1299d8e7eb6b476f64e722e23d8f97a67fa3d1 100644
--- a/make/jpda/transport/socket/Makefile
+++ b/make/jpda/transport/socket/Makefile
@@ -1,5 +1,5 @@
#
-# Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1998, 2011, 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
diff --git a/make/jpda/tty/Makefile b/make/jpda/tty/Makefile
index 07a63fe8731c0ff215621691cc1cee64e0c52527..20ebd06acbecade7fa0f4d62f4fb960733b753ac 100644
--- a/make/jpda/tty/Makefile
+++ b/make/jpda/tty/Makefile
@@ -1,5 +1,5 @@
#
-# Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1998, 2011, 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
diff --git a/make/jprt.properties b/make/jprt.properties
index 7cb87c1e3a3fb500cf2e935786cbecd8d37374c6..b479e22f06a6678c0667145369cf5a8a2ff3c605 100644
--- a/make/jprt.properties
+++ b/make/jprt.properties
@@ -52,8 +52,11 @@ jprt.build.targets= \
${jprt.my.windows.i586}-{product|fastdebug}, \
windows_x64_5.2-{product|fastdebug}
+# User can select the test set with jprt submit "-testset name" option
+jprt.my.test.set=${jprt.test.set}
+
# Standard vm test target
-jprt.test.targets= \
+jprt.vm.default.test.targets= \
solaris_sparc_5.10-product-c1-jvm98, \
solaris_sparcv9_5.10-product-c2-jvm98, \
solaris_i586_5.10-product-c1-jvm98, \
@@ -63,8 +66,10 @@ jprt.test.targets= \
${jprt.my.windows.i586}-product-c1-jvm98, \
windows_x64_5.2-product-c2-jvm98
-# User can select the test set with jprt submit "-testset name" option
-jprt.my.test.set=${jprt.test.set}
+# Select vm testlist to use (allow for testset to be empty too)
+jprt.vm.all.test.targets=${jprt.vm.default.test.targets}
+jprt.vm..test.targets=${jprt.vm.default.test.targets}
+jprt.test.targets=${jprt.vm.${jprt.my.test.set}.test.targets}
# Default jdk test targets in test/Makefile (no fastdebug & limited c2)
jprt.make.rule.default.test.targets= \
@@ -281,6 +286,21 @@ jprt.make.rule.all.test.targets= \
${jprt.my.windows.i586}-product-c1-jdk_tools2, \
windows_x64_5.2-product-c2-jdk_tools2
+# JCK test targets in test/Makefile (no fastdebug & limited c2, windows broken)
+jprt.my.jck.test.target.set= \
+ solaris_sparc_5.10-product-c1-JCK7TESTRULE, \
+ solaris_sparcv9_5.10-product-c2-JCK7TESTRULE, \
+ solaris_i586_5.10-product-c1-JCK7TESTRULE, \
+ solaris_x64_5.10-product-c2-JCK7TESTRULE, \
+ linux_i586_2.6-product-c1-JCK7TESTRULE, \
+ linux_x64_2.6-product-c2-JCK7TESTRULE
+
+# JCK testset targets (e.g. jprt submit -testset jck ... )
+jprt.make.rule.jck.test.targets= \
+ ${jprt.my.jck.test.target.set:JCK7TESTRULE=jck7devtools}, \
+ ${jprt.my.jck.test.target.set:JCK7TESTRULE=jck7runtime}, \
+ ${jprt.my.jck.test.target.set:JCK7TESTRULE=jck7compiler}
+
# Select list to use (allow for testset to be empty too)
jprt.make.rule..test.targets=${jprt.make.rule.default.test.targets}
jprt.make.rule.test.targets=${jprt.make.rule.${jprt.my.test.set}.test.targets}
diff --git a/make/launchers/Makefile b/make/launchers/Makefile
index 8d7036be179ea239311b90e0e40d0192659a8976..cc07bbe9cb06f012bc967e0ed3347dcbebbcd635 100644
--- a/make/launchers/Makefile
+++ b/make/launchers/Makefile
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2004, 2011, 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
@@ -44,8 +44,17 @@ $(MAKE) -f Makefile.launcher \
endef
# Run MAKE $@ for all generic launchers
-define make-all-launchers
+ifndef BUILD_HEADLESS_ONLY
+define make-appletviewer
$(call make-launcher, appletviewer, sun.applet.Main, , )
+endef
+else
+define make-appletviewer
+endef
+endif
+
+define make-all-launchers
+$(make-appletviewer)
$(call make-launcher, apt, com.sun.tools.apt.Main, , )
$(call make-launcher, extcheck, com.sun.tools.extcheck.Main, , )
$(call make-launcher, idlj, com.sun.tools.corba.se.idl.toJavaPortable.Compile, , )
diff --git a/make/mkdemo/Makefile b/make/mkdemo/Makefile
index 1e1739467cc8e0f383fcee487c72e35770a6df0a..c134316218eb3bfc73e4a91993d56317ee4b27e5 100644
--- a/make/mkdemo/Makefile
+++ b/make/mkdemo/Makefile
@@ -1,5 +1,5 @@
#
-# Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1997, 2011, 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
diff --git a/make/mkdemo/jfc/Font2DTest/Makefile b/make/mkdemo/jfc/Font2DTest/Makefile
index eab16a56b8cd75618fe2d1c10af2426a4b2ee262..4eee7bde2278a516aad636ca7411da618776a096 100644
--- a/make/mkdemo/jfc/Font2DTest/Makefile
+++ b/make/mkdemo/jfc/Font2DTest/Makefile
@@ -1,5 +1,5 @@
#
-# Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1999, 2011, 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
@@ -33,7 +33,7 @@ DEMONAME = Font2DTest
include $(BUILDDIR)/common/Defs.gmk
DEMO_ROOT = $(SHARE_SRC)/demo/jfc/$(DEMONAME)
-DEMO_TOPFILES = ./README.txt
+DEMO_TOPFILES = ./README.txt ./$(DEMONAME).html
DEMO_MAINCLASS = $(DEMONAME)
DEMO_DESTDIR = $(DEMODIR)/jfc/$(DEMONAME)
diff --git a/make/mkdemo/jfc/Java2D/Makefile b/make/mkdemo/jfc/Java2D/Makefile
index beea7c8b47ce9c1d3b98dd613f15e6148cc69a3f..2833fc4c97a1642478b90acd3d6eb4a8f86ae205 100644
--- a/make/mkdemo/jfc/Java2D/Makefile
+++ b/make/mkdemo/jfc/Java2D/Makefile
@@ -1,5 +1,5 @@
#
-# Copyright (c) 1998, 2007, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1998, 2011, 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
@@ -33,7 +33,7 @@ DEMONAME = Java2Demo
include $(BUILDDIR)/common/Defs.gmk
DEMO_ROOT = $(CLOSED_SRC)/share/demo/jfc/Java2D
-DEMO_TOPFILES = ./Java2Demo.html ./README.txt
+DEMO_TOPFILES = ./README.txt ./$(DEMONAME).html
DEMO_MAINCLASS = java2d.Java2Demo
DEMO_DESTDIR = $(DEMODIR)/jfc/Java2D
diff --git a/make/mkdemo/jfc/Makefile b/make/mkdemo/jfc/Makefile
index 768e5b8f4a81defb9a74b4d51b32dd70b6c15bc8..c1063774f642abf359662f2c6b711034a5c28aec 100644
--- a/make/mkdemo/jfc/Makefile
+++ b/make/mkdemo/jfc/Makefile
@@ -1,5 +1,5 @@
#
-# Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1997, 2011, 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
@@ -39,7 +39,8 @@ SUBDIRS = \
Notepad \
SampleTree \
SwingApplet \
- TableExample
+ TableExample \
+ TransparentRuler
# Some demos aren't currently included in OpenJDK
ifndef OPENJDK
diff --git a/make/mkdemo/jfc/SwingApplet/Makefile b/make/mkdemo/jfc/SwingApplet/Makefile
index 3f8ca5d5bed0d6139a41d8ec08d0ea4d8674cc75..e739c67dcfbabbdcab4880ee74c8b6788a0e7565 100644
--- a/make/mkdemo/jfc/SwingApplet/Makefile
+++ b/make/mkdemo/jfc/SwingApplet/Makefile
@@ -1,5 +1,5 @@
#
-# Copyright (c) 1997, 2002, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1997, 2011, 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
@@ -33,7 +33,7 @@ DEMONAME = SwingApplet
include $(BUILDDIR)/common/Defs.gmk
DEMO_ROOT = $(SHARE_SRC)/demo/jfc/$(DEMONAME)
-DEMO_TOPFILES = ./README.txt
+DEMO_TOPFILES = ./README.txt ./$(DEMONAME).html
DEMO_MAINCLASS = $(DEMONAME)
DEMO_DESTDIR = $(DEMODIR)/jfc/$(DEMONAME)
diff --git a/make/mkdemo/jfc/SwingSet2/Makefile b/make/mkdemo/jfc/SwingSet2/Makefile
index 2a4881c8937c8a9cb3b67894f02262a1102231de..8cfef8ba75fefc02e69894d706dc8a97e5a0f21b 100644
--- a/make/mkdemo/jfc/SwingSet2/Makefile
+++ b/make/mkdemo/jfc/SwingSet2/Makefile
@@ -1,5 +1,5 @@
#
-# Copyright (c) 1999, 2006, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1999, 2011, 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
@@ -33,7 +33,7 @@ DEMONAME = SwingSet2
include $(BUILDDIR)/common/Defs.gmk
DEMO_ROOT = $(CLOSED_SRC)/share/demo/jfc/$(DEMONAME)
-DEMO_TOPFILES = ./README.txt
+DEMO_TOPFILES = ./README.txt ./$(DEMONAME).html
DEMO_MAINCLASS = $(DEMONAME)
DEMO_MANIFEST_ATTR = SplashScreen-Image: resources/images/splash.png
DEMO_DESTDIR = $(DEMODIR)/jfc/$(DEMONAME)
diff --git a/make/mkdemo/jfc/SwingSet3/Makefile b/make/mkdemo/jfc/SwingSet3/Makefile
index 9b9fddacaf58f932fb986a0e55c3150b31ad7647..5ba7886a452924dbace191c9442cdf8c32dcdb16 100644
--- a/make/mkdemo/jfc/SwingSet3/Makefile
+++ b/make/mkdemo/jfc/SwingSet3/Makefile
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2010, 2011, 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
diff --git a/make/mkdemo/jfc/TransparentRuler/Makefile b/make/mkdemo/jfc/TransparentRuler/Makefile
new file mode 100644
index 0000000000000000000000000000000000000000..7092b875048962f0e7fb2b861a0ef674b9376f41
--- /dev/null
+++ b/make/mkdemo/jfc/TransparentRuler/Makefile
@@ -0,0 +1,44 @@
+#
+# Copyright (c) 2011, 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.
+#
+
+#
+# Makefile to build the TransparentRuler demo.
+#
+
+BUILDDIR = ../../..
+PRODUCT = demo/jfc
+DEMONAME = TransparentRuler
+include $(BUILDDIR)/common/Defs.gmk
+
+DEMO_ROOT = $(SHARE_SRC)/demo/jfc/$(DEMONAME)
+DEMO_TOPFILES = ./README.txt
+DEMO_MAINCLASS = transparentruler.Ruler
+DEMO_DESTDIR = $(DEMODIR)/jfc/$(DEMONAME)
+
+
+#
+# Demo jar building rules.
+#
+include $(BUILDDIR)/common/Demo.gmk
diff --git a/make/mkdemo/jpda/Makefile b/make/mkdemo/jpda/Makefile
index 9844a739258d1297772477a53589ade2cf2d53f9..443deb5a21271898c18e858c687679890b4636a9 100644
--- a/make/mkdemo/jpda/Makefile
+++ b/make/mkdemo/jpda/Makefile
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2004, 2011, 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
diff --git a/make/mkdemo/jvmti/Makefile b/make/mkdemo/jvmti/Makefile
index 33bdf6fa106c1718cf6feb22377bd50813aa4b2c..630c65b24102191cdb44b784e3abf2c63c918312 100644
--- a/make/mkdemo/jvmti/Makefile
+++ b/make/mkdemo/jvmti/Makefile
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2004, 2011, 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
diff --git a/make/mkdemo/management/Makefile b/make/mkdemo/management/Makefile
index 4ddccb7ec9f7e9b4e61ab8a468f8372caa1a8a9d..40ec42c5237e1305d6ef66d52484778f96c0dfab 100644
--- a/make/mkdemo/management/Makefile
+++ b/make/mkdemo/management/Makefile
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2004, 2011, 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
diff --git a/make/mksample/dtrace/Makefile b/make/mksample/dtrace/Makefile
index 033d4d3ba4c6807933cf2fa85b570f8b1fac8d67..040be7bd37ad52e976e7ad631b148f07a629907d 100644
--- a/make/mksample/dtrace/Makefile
+++ b/make/mksample/dtrace/Makefile
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2006, 2011, 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
diff --git a/make/mksample/jmx/jmx-scandir/Makefile b/make/mksample/jmx/jmx-scandir/Makefile
index 3ee0e99ac6bde31a5a0a9a0e32fa43163eaa58bd..cb23dc6d288d53ddda5f57ad013b1f8ade62362d 100644
--- a/make/mksample/jmx/jmx-scandir/Makefile
+++ b/make/mksample/jmx/jmx-scandir/Makefile
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2006, 2011, 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
diff --git a/make/mksample/nbproject/Makefile b/make/mksample/nbproject/Makefile
index 92ef671474693feb8704deec366d8f37d751f49b..d280b5d01a7a7e48455d9583a324b7b748b492df 100644
--- a/make/mksample/nbproject/Makefile
+++ b/make/mksample/nbproject/Makefile
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2006, 2011, 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
diff --git a/make/mksample/nio/file/Makefile b/make/mksample/nio/file/Makefile
index 9462d5063f1209aed6c2f95f62fad2e8addb2078..62fcfc2bdbcd386a2dab16d11c6b12f50d798b2c 100644
--- a/make/mksample/nio/file/Makefile
+++ b/make/mksample/nio/file/Makefile
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2008, 2011, 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
diff --git a/make/mksample/nio/multicast/Makefile b/make/mksample/nio/multicast/Makefile
index ae3b4e1d816e799cb1d8961dc6af68417d61a8b9..57c9e30ae3d40a3634854694be0d0575101678ff 100644
--- a/make/mksample/nio/multicast/Makefile
+++ b/make/mksample/nio/multicast/Makefile
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2007, 2011, 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
diff --git a/make/mksample/nio/server/Makefile b/make/mksample/nio/server/Makefile
index bf97c7270656c00f9a8ecad69e82870d5af5a217..14b7f5b399bb754e029c460422377ad217bd9c74 100644
--- a/make/mksample/nio/server/Makefile
+++ b/make/mksample/nio/server/Makefile
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2004, 2011, 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
diff --git a/make/mksample/scripting/scriptpad/Makefile b/make/mksample/scripting/scriptpad/Makefile
index b60b01deb2290ffe9ae2402f3e3af85a4601162a..bc641c06db8652e60c006b29d7446bd070f2a8a5 100644
--- a/make/mksample/scripting/scriptpad/Makefile
+++ b/make/mksample/scripting/scriptpad/Makefile
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2006, 2011, 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
diff --git a/make/mksample/webservices/EbayClient/Makefile b/make/mksample/webservices/EbayClient/Makefile
index d007ff36639c87ffebed20715d80c2f319825aab..ac3d9318849263607298d3eb01007d4325708816 100644
--- a/make/mksample/webservices/EbayClient/Makefile
+++ b/make/mksample/webservices/EbayClient/Makefile
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2006, 2011, 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
diff --git a/make/mksample/webservices/EbayServer/Makefile b/make/mksample/webservices/EbayServer/Makefile
index e51d34622cac667f7b55157b6a4793b5c1c84c71..a3ece43d6883c49525c85271816427de24649d22 100644
--- a/make/mksample/webservices/EbayServer/Makefile
+++ b/make/mksample/webservices/EbayServer/Makefile
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2006, 2011, 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
diff --git a/make/netbeans/common/java-data-native.ent b/make/netbeans/common/java-data-native.ent
index 831bf25524509099abc6eb3d4938f40b5a99ff15..fb531ed8921e1aa6a5cab07178b58be1975e387f 100644
--- a/make/netbeans/common/java-data-native.ent
+++ b/make/netbeans/common/java-data-native.ent
@@ -1,7 +1,7 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Must set property 'main.class' (e.g. in build.properties)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/share/demo/nbproject/jfc/TransparentRuler/nbproject/file-targets.xml b/src/share/demo/nbproject/jfc/TransparentRuler/nbproject/file-targets.xml
new file mode 100644
index 0000000000000000000000000000000000000000..9d750841e3b5fdc3b80755263baa4f1a67ce4160
--- /dev/null
+++ b/src/share/demo/nbproject/jfc/TransparentRuler/nbproject/file-targets.xml
@@ -0,0 +1,46 @@
+
+
+
+
+
+
+
+
+
+ Must set property 'includes'
+
+
+
+
+
+
+
diff --git a/src/share/demo/nbproject/jfc/TransparentRuler/nbproject/jdk.xml b/src/share/demo/nbproject/jfc/TransparentRuler/nbproject/jdk.xml
new file mode 100644
index 0000000000000000000000000000000000000000..3690ef0e8f8674020f02765a6c1c1797dd0a76c1
--- /dev/null
+++ b/src/share/demo/nbproject/jfc/TransparentRuler/nbproject/jdk.xml
@@ -0,0 +1,98 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/share/demo/nbproject/jfc/TransparentRuler/nbproject/netbeans-targets.xml b/src/share/demo/nbproject/jfc/TransparentRuler/nbproject/netbeans-targets.xml
new file mode 100644
index 0000000000000000000000000000000000000000..84a0e9b3c5e0fc7ded178a17f5da786399bc5e4c
--- /dev/null
+++ b/src/share/demo/nbproject/jfc/TransparentRuler/nbproject/netbeans-targets.xml
@@ -0,0 +1,81 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/share/demo/nbproject/jfc/TransparentRuler/nbproject/project.xml b/src/share/demo/nbproject/jfc/TransparentRuler/nbproject/project.xml
new file mode 100644
index 0000000000000000000000000000000000000000..ecc07bc52b91d2c540438192922f72ab751466f8
--- /dev/null
+++ b/src/share/demo/nbproject/jfc/TransparentRuler/nbproject/project.xml
@@ -0,0 +1,173 @@
+
+
+
+
+
+ org.netbeans.modules.ant.freeform
+
+
+ TransparentRuler
+
+ user.build.properties
+ build.properties
+ ${nbjdk.home}/jre/lib/rt.jar
+
+
+
+
+ ${main.dir}
+
+
+
+ java
+ ${src.dir}
+
+
+ ${build.dir}
+
+
+
+
+ jar
+
+
+ clean
+
+
+ clean
+ jar
+
+
+ run
+
+
+
+ show-javadoc
+
+
+
+ debug
+
+
+
+ compile-selected
+
+ includes
+ ${src.dir}
+ \.java$
+ relative-path
+
+ ,
+
+
+
+
+ run
+
+ main.class
+ ${src.dir}
+ \.java$
+ java-name
+
+
+
+
+
+
+
+ debug
+
+ main.class
+ ${src.dir}
+ \.java$
+ java-name
+
+
+
+
+
+
+
+ debug-fix
+
+ class
+ ${src.dir}
+ \.java$
+ relative-path-noext
+
+
+
+
+
+
+
+ jar
+ ${jar}
+ jar
+ clean
+
+
+
+
+
+ ${src.dir}
+
+
+ ${main.dir}/README.txt
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ${src.dir}
+ ${cp}
+ ${run.cp}
+ ${nbjdk.bootclasspath}
+ ${classes.dir}
+ ${jar}
+ ${javadoc.dir}
+ 1.5
+
+
+
+
diff --git a/src/share/demo/nbproject/project.xml b/src/share/demo/nbproject/project.xml
index 585faf33b000bf3e5eb2b19e039c67f1ccbab32d..43667547ddf2d2ccf8307ce6b0d6e6ddb38c878d 100644
--- a/src/share/demo/nbproject/project.xml
+++ b/src/share/demo/nbproject/project.xml
@@ -50,6 +50,7 @@
nbproject/jfc/Stylepadnbproject/jfc/SwingAppletnbproject/jfc/TableExample
+ nbproject/jfc/TransparentRulernbproject/scripting/jconsole-pluginnbproject/management/FullThreadDumpnbproject/management/JTop
diff --git a/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/JarFileSystemProvider.java b/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/JarFileSystemProvider.java
index dddf69e4deefd7b6edcc934fc484dbe12e44379c..b9ea826ab11e4f63692093a6075d4d64aaf53b86 100644
--- a/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/JarFileSystemProvider.java
+++ b/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/JarFileSystemProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2007-2008 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright (c) 2007, 2008, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -12,7 +12,7 @@
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
- * - Neither the name of Sun Microsystems nor the names of its
+ * - Neither the name of Oracle nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
diff --git a/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileAttributeView.java b/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileAttributeView.java
index 22b183d97a7a217b9521dba97af8d830acdb4cf0..c646a09e5e36eafb4256313f83499c6817a26113 100644
--- a/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileAttributeView.java
+++ b/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileAttributeView.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
diff --git a/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileStore.java b/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileStore.java
index 05719072de355f6cce2adf99cc3fc53210cdd9b4..94ec0307dd9bd6dbe0b58f16ab18f38d6ebd7598 100644
--- a/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileStore.java
+++ b/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileStore.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
diff --git a/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileSystem.java b/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileSystem.java
index fc43fd87ccf8b030b64045d96e23418eedc0c10a..39945358fc6f8bc98b5686a7a52cd07ce912c4f2 100644
--- a/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileSystem.java
+++ b/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileSystem.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
diff --git a/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileSystemProvider.java b/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileSystemProvider.java
index d8aa305d29b1ab1be0913966f75656406d3a6a54..c6dd243815e08ffb02499ad43ccb397f1d090fdf 100644
--- a/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileSystemProvider.java
+++ b/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileSystemProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -99,7 +99,7 @@ public class ZipFileSystemProvider extends FileSystemProvider {
synchronized(filesystems) {
Path realPath = null;
if (ensureFile(path)) {
- realPath = path.toRealPath(true);
+ realPath = path.toRealPath();
if (filesystems.containsKey(realPath))
throw new FileSystemAlreadyExistsException();
}
@@ -154,7 +154,7 @@ public class ZipFileSystemProvider extends FileSystemProvider {
synchronized (filesystems) {
ZipFileSystem zipfs = null;
try {
- zipfs = filesystems.get(uriToPath(uri).toRealPath(true));
+ zipfs = filesystems.get(uriToPath(uri).toRealPath());
} catch (IOException x) {
// ignore the ioe from toRealPath(), return FSNFE
}
@@ -310,7 +310,7 @@ public class ZipFileSystemProvider extends FileSystemProvider {
//////////////////////////////////////////////////////////////
void removeFileSystem(Path zfpath, ZipFileSystem zfs) throws IOException {
synchronized (filesystems) {
- zfpath = zfpath.toRealPath(true);
+ zfpath = zfpath.toRealPath();
if (filesystems.get(zfpath) == zfs)
filesystems.remove(zfpath);
}
diff --git a/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipPath.java b/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipPath.java
index 1232a27ff1f0b2c1f0d1cb9d6307854a5e22e630..8c97818b24482f3fde4f129a7f46185054d041e7 100644
--- a/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipPath.java
+++ b/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipPath.java
@@ -150,7 +150,7 @@ public class ZipPath implements Path {
}
@Override
- public ZipPath toRealPath(boolean resolveLinks) throws IOException {
+ public ZipPath toRealPath(LinkOption... options) throws IOException {
ZipPath realPath = new ZipPath(zfs, getResolvedPath()).toAbsolutePath();
realPath.checkAccess();
return realPath;
diff --git a/src/share/instrument/JPLISAgent.c b/src/share/instrument/JPLISAgent.c
index 7f6b2a0b67c970f506ad9a527e38f321be17cb27..7494c814189160576f7bb8ad7ec5f7f9843d2905 100644
--- a/src/share/instrument/JPLISAgent.c
+++ b/src/share/instrument/JPLISAgent.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2011, 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
diff --git a/src/share/javavm/export/jvmti.h b/src/share/javavm/export/jvmti.h
index 7e9f2216b55055ef8eb8a803474b8a561347fe16..ee708cb193ba135a28adc3a1048ffe1e3544b5e1 100644
--- a/src/share/javavm/export/jvmti.h
+++ b/src/share/javavm/export/jvmti.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2011, 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
diff --git a/src/share/lib/logging.properties b/src/share/lib/logging.properties
index 4f7f6dcfd416d3e0b6b1c45ab8cd985ed3e6ea49..65cf1b1b7dc9700ada1f3412ca2605ac7bb6b226 100644
--- a/src/share/lib/logging.properties
+++ b/src/share/lib/logging.properties
@@ -43,6 +43,11 @@ java.util.logging.FileHandler.formatter = java.util.logging.XMLFormatter
java.util.logging.ConsoleHandler.level = INFO
java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter
+# Example to customize the SimpleFormatter output format
+# to print one-line log message like this:
+# : []
+#
+# java.util.logging.SimpleFormatter.format=%4$s: %5$s [%1$tc]%n
############################################################
# Facility specific properties.
diff --git a/src/share/native/com/sun/java/util/jar/pack/unpack.cpp b/src/share/native/com/sun/java/util/jar/pack/unpack.cpp
index 40067b1df0f46499ffe9eeb347981dfaffd7f240..17c48a4ceac3c66a6314274080095167b46676b2 100644
--- a/src/share/native/com/sun/java/util/jar/pack/unpack.cpp
+++ b/src/share/native/com/sun/java/util/jar/pack/unpack.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2011, 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
diff --git a/src/share/native/common/check_code.c b/src/share/native/common/check_code.c
index dcdaeda58bfebe31c2a530161d3e5305bc487275..c8787b3612bec648db022a3b73b45127df5d7833 100644
--- a/src/share/native/common/check_code.c
+++ b/src/share/native/common/check_code.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1994, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1994, 2011, 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
diff --git a/src/share/native/java/io/io_util.c b/src/share/native/java/io/io_util.c
index 68a24bbab53d315cc74dc7c152e951967f86d3a0..e17652a69b5d3ea6f42581307e377cfe23b30f99 100644
--- a/src/share/native/java/io/io_util.c
+++ b/src/share/native/java/io/io_util.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1994, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1994, 2011, 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
diff --git a/src/share/native/java/lang/System.c b/src/share/native/java/lang/System.c
index f2b81a069b5f7aa8baf760156b060e6373839cc8..86ad8f6ce2f8a672569b3cb5abc58902613e2738 100644
--- a/src/share/native/java/lang/System.c
+++ b/src/share/native/java/lang/System.c
@@ -99,7 +99,7 @@ Java_java_lang_System_identityHashCode(JNIEnv *env, jobject this, jobject x)
#ifndef VENDOR /* Third party may overwrite this. */
#define VENDOR "Oracle Corporation"
#define VENDOR_URL "http://java.oracle.com/"
-#define VENDOR_URL_BUG "http://java.sun.com/cgi-bin/bugreport.cgi"
+#define VENDOR_URL_BUG "http://bugreport.sun.com/bugreport/"
#endif
#define JAVA_MAX_SUPPORTED_VERSION 51
diff --git a/src/share/native/java/util/zip/Deflater.c b/src/share/native/java/util/zip/Deflater.c
index 3b32750a2985fd42ee8f01464de3a90616841ae7..6cad24e480a82b99573841a00f787603433950fb 100644
--- a/src/share/native/java/util/zip/Deflater.c
+++ b/src/share/native/java/util/zip/Deflater.c
@@ -129,34 +129,28 @@ Java_java_util_zip_Deflater_deflateBytes(JNIEnv *env, jobject this, jlong addr,
if ((*env)->GetBooleanField(env, this, setParamsID)) {
int level = (*env)->GetIntField(env, this, levelID);
int strategy = (*env)->GetIntField(env, this, strategyID);
-
- in_buf = (jbyte *) malloc(this_len);
- if (in_buf == 0) {
+ in_buf = (*env)->GetPrimitiveArrayCritical(env, this_buf, 0);
+ if (in_buf == NULL) {
// Throw OOME only when length is not zero
if (this_len != 0)
JNU_ThrowOutOfMemoryError(env, 0);
return 0;
}
- (*env)->GetByteArrayRegion(env, this_buf, this_off, this_len, in_buf);
- out_buf = (jbyte *) malloc(len);
- if (out_buf == 0) {
- free(in_buf);
+ out_buf = (*env)->GetPrimitiveArrayCritical(env, b, 0);
+ if (out_buf == NULL) {
+ (*env)->ReleasePrimitiveArrayCritical(env, this_buf, in_buf, 0);
if (len != 0)
JNU_ThrowOutOfMemoryError(env, 0);
return 0;
}
- strm->next_in = (Bytef *) in_buf;
- strm->next_out = (Bytef *) out_buf;
+ strm->next_in = (Bytef *) (in_buf + this_off);
+ strm->next_out = (Bytef *) (out_buf + off);
strm->avail_in = this_len;
strm->avail_out = len;
res = deflateParams(strm, level, strategy);
-
- if (res == Z_OK) {
- (*env)->SetByteArrayRegion(env, b, off, len - strm->avail_out, out_buf);
- }
- free(out_buf);
- free(in_buf);
+ (*env)->ReleasePrimitiveArrayCritical(env, b, out_buf, 0);
+ (*env)->ReleasePrimitiveArrayCritical(env, this_buf, in_buf, 0);
switch (res) {
case Z_OK:
@@ -174,33 +168,28 @@ Java_java_util_zip_Deflater_deflateBytes(JNIEnv *env, jobject this, jlong addr,
}
} else {
jboolean finish = (*env)->GetBooleanField(env, this, finishID);
- in_buf = (jbyte *) malloc(this_len);
- if (in_buf == 0) {
+ in_buf = (*env)->GetPrimitiveArrayCritical(env, this_buf, 0);
+ if (in_buf == NULL) {
if (this_len != 0)
JNU_ThrowOutOfMemoryError(env, 0);
return 0;
}
- (*env)->GetByteArrayRegion(env, this_buf, this_off, this_len, in_buf);
-
- out_buf = (jbyte *) malloc(len);
- if (out_buf == 0) {
- free(in_buf);
+ out_buf = (*env)->GetPrimitiveArrayCritical(env, b, 0);
+ if (out_buf == NULL) {
+ (*env)->ReleasePrimitiveArrayCritical(env, this_buf, in_buf, 0);
if (len != 0)
JNU_ThrowOutOfMemoryError(env, 0);
+
return 0;
}
- strm->next_in = (Bytef *) in_buf;
- strm->next_out = (Bytef *) out_buf;
+ strm->next_in = (Bytef *) (in_buf + this_off);
+ strm->next_out = (Bytef *) (out_buf + off);
strm->avail_in = this_len;
strm->avail_out = len;
res = deflate(strm, finish ? Z_FINISH : flush);
-
- if (res == Z_STREAM_END || res == Z_OK) {
- (*env)->SetByteArrayRegion(env, b, off, len - strm->avail_out, out_buf);
- }
- free(out_buf);
- free(in_buf);
+ (*env)->ReleasePrimitiveArrayCritical(env, b, out_buf, 0);
+ (*env)->ReleasePrimitiveArrayCritical(env, this_buf, in_buf, 0);
switch (res) {
case Z_STREAM_END:
diff --git a/src/share/native/java/util/zip/Inflater.c b/src/share/native/java/util/zip/Inflater.c
index dbf9a1357aecad5388a29ed598c4714023b8113b..e5296fcf4c6db6c126bea37849e1f2582517de40 100644
--- a/src/share/native/java/util/zip/Inflater.c
+++ b/src/share/native/java/util/zip/Inflater.c
@@ -38,8 +38,6 @@
#include "zlib.h"
#include "java_util_zip_Inflater.h"
-#define MIN2(x, y) ((x) < (y) ? (x) : (y))
-
#define ThrowDataFormatException(env, msg) \
JNU_ThrowByName(env, "java/util/zip/DataFormatException", msg)
@@ -111,71 +109,50 @@ Java_java_util_zip_Inflater_inflateBytes(JNIEnv *env, jobject this, jlong addr,
jarray b, jint off, jint len)
{
z_stream *strm = jlong_to_ptr(addr);
-
jarray this_buf = (jarray)(*env)->GetObjectField(env, this, bufID);
jint this_off = (*env)->GetIntField(env, this, offID);
jint this_len = (*env)->GetIntField(env, this, lenID);
+
jbyte *in_buf;
jbyte *out_buf;
int ret;
- /*
- * Avoid excess copying.
- * zlib stream usually has a few bytes of overhead for header info
- * (depends on the underlying data)
- *
- * (a) 5 bytes per 16KB
- * (b) 6 bytes for entire stream
- * (c) 4 bytes for gzip header
- * (d) 2 bytes for crc
- *
- * Use 20 bytes as the "safe cutoff" number.
- */
- jint in_len = MIN2(this_len, len + 20);
- jint consumed;
-
- in_buf = (jbyte *) malloc(in_len);
- if (in_buf == 0) {
- if (in_len != 0)
+
+ in_buf = (*env)->GetPrimitiveArrayCritical(env, this_buf, 0);
+ if (in_buf == NULL) {
+ if (this_len != 0)
JNU_ThrowOutOfMemoryError(env, 0);
return 0;
}
- (*env)->GetByteArrayRegion(env, this_buf, this_off, in_len, in_buf);
-
- out_buf = (jbyte *) malloc(len);
- if (out_buf == 0) {
- free(in_buf);
+ out_buf = (*env)->GetPrimitiveArrayCritical(env, b, 0);
+ if (out_buf == NULL) {
+ (*env)->ReleasePrimitiveArrayCritical(env, this_buf, in_buf, 0);
if (len != 0)
JNU_ThrowOutOfMemoryError(env, 0);
return 0;
}
-
- strm->next_in = (Bytef *) in_buf;
- strm->next_out = (Bytef *) out_buf;
- strm->avail_in = in_len;
+ strm->next_in = (Bytef *) (in_buf + this_off);
+ strm->next_out = (Bytef *) (out_buf + off);
+ strm->avail_in = this_len;
strm->avail_out = len;
ret = inflate(strm, Z_PARTIAL_FLUSH);
-
- if (ret == Z_STREAM_END || ret == Z_OK) {
- (*env)->SetByteArrayRegion(env, b, off, len - strm->avail_out, out_buf);
- }
- free(out_buf);
- free(in_buf);
+ (*env)->ReleasePrimitiveArrayCritical(env, b, out_buf, 0);
+ (*env)->ReleasePrimitiveArrayCritical(env, this_buf, in_buf, 0);
switch (ret) {
case Z_STREAM_END:
(*env)->SetBooleanField(env, this, finishedID, JNI_TRUE);
/* fall through */
case Z_OK:
- consumed = in_len - strm->avail_in;
- (*env)->SetIntField(env, this, offID, this_off + consumed);
- (*env)->SetIntField(env, this, lenID, this_len - consumed);
+ this_off += this_len - strm->avail_in;
+ (*env)->SetIntField(env, this, offID, this_off);
+ (*env)->SetIntField(env, this, lenID, strm->avail_in);
return len - strm->avail_out;
case Z_NEED_DICT:
(*env)->SetBooleanField(env, this, needDictID, JNI_TRUE);
/* Might have consumed some input here! */
- consumed = in_len - strm->avail_in;
- (*env)->SetIntField(env, this, offID, this_off + consumed);
- (*env)->SetIntField(env, this, lenID, this_len - consumed);
+ this_off += this_len - strm->avail_in;
+ (*env)->SetIntField(env, this, offID, this_off);
+ (*env)->SetIntField(env, this, lenID, strm->avail_in);
return 0;
case Z_BUF_ERROR:
return 0;
diff --git a/src/share/native/sun/awt/image/awt_parseImage.c b/src/share/native/sun/awt/image/awt_parseImage.c
index b569828f5f664a7bb3be603ed072b3b2555d3b8b..264a02f16429aec5b5d70d0f0e977f2b2f5ddc3d 100644
--- a/src/share/native/sun/awt/image/awt_parseImage.c
+++ b/src/share/native/sun/awt/image/awt_parseImage.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, 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
diff --git a/src/share/native/sun/awt/image/jpeg/imageioJPEG.c b/src/share/native/sun/awt/image/jpeg/imageioJPEG.c
index 84b91889725b401c40f113075977ed5baba448b2..28af8316204a4b67cfbf42ba503f56220710bc43 100644
--- a/src/share/native/sun/awt/image/jpeg/imageioJPEG.c
+++ b/src/share/native/sun/awt/image/jpeg/imageioJPEG.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2011, 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
diff --git a/src/share/native/sun/awt/image/jpeg/jpegdecoder.c b/src/share/native/sun/awt/image/jpeg/jpegdecoder.c
index 2b0992b5151fd6b6c8e29d33bd490497382daf9a..1879c35ced36f2d070c7cce49b18872bf4523955 100644
--- a/src/share/native/sun/awt/image/jpeg/jpegdecoder.c
+++ b/src/share/native/sun/awt/image/jpeg/jpegdecoder.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1995, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2011, 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
diff --git a/src/share/native/sun/awt/splashscreen/splashscreen_gfx_impl.h b/src/share/native/sun/awt/splashscreen/splashscreen_gfx_impl.h
index a0fd446e94a26a8aa186cb16199c3e0a088daa95..10574adba215a8740e3d746b8bb02a186588bebf 100644
--- a/src/share/native/sun/awt/splashscreen/splashscreen_gfx_impl.h
+++ b/src/share/native/sun/awt/splashscreen/splashscreen_gfx_impl.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2010, 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
diff --git a/src/share/native/sun/font/FontInstanceAdapter.cpp b/src/share/native/sun/font/FontInstanceAdapter.cpp
index 952523105c1a5ec241c44fdbe942ff22bd007bcf..824f296cc5c3d1bdd76a89431962cf6b6ff83d05 100644
--- a/src/share/native/sun/font/FontInstanceAdapter.cpp
+++ b/src/share/native/sun/font/FontInstanceAdapter.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2011, 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
diff --git a/src/share/native/sun/java2d/cmm/lcms/LCMS.c b/src/share/native/sun/java2d/cmm/lcms/LCMS.c
index bd2c03c1ac6993ce49ed854203fb7469784e5f7e..8ac40e4b1d17486836172dc2400f6772cbfe78ee 100644
--- a/src/share/native/sun/java2d/cmm/lcms/LCMS.c
+++ b/src/share/native/sun/java2d/cmm/lcms/LCMS.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2011, 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
diff --git a/src/share/native/sun/java2d/loops/MaskFill.c b/src/share/native/sun/java2d/loops/MaskFill.c
index 6691ede7a3581787b59751ba7f6b67faf624ad28..0003675d43cad2143a688dd013be063ac88f5558 100644
--- a/src/share/native/sun/java2d/loops/MaskFill.c
+++ b/src/share/native/sun/java2d/loops/MaskFill.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2010, 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
diff --git a/src/share/native/sun/java2d/loops/ParallelogramUtils.h b/src/share/native/sun/java2d/loops/ParallelogramUtils.h
index 3691abad25c49ec8e9dd62f57e97bfc4de39e7db..117d32e2daa95cf8e0e67d9178ca2586afc53235 100644
--- a/src/share/native/sun/java2d/loops/ParallelogramUtils.h
+++ b/src/share/native/sun/java2d/loops/ParallelogramUtils.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2010, 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
diff --git a/src/share/native/sun/java2d/loops/ProcessPath.c b/src/share/native/sun/java2d/loops/ProcessPath.c
index 5131a3e22c768b73793288d2e66f6e5095bfe564..c6c643219a4ae5507710c4e3b13d6174f34c148c 100644
--- a/src/share/native/sun/java2d/loops/ProcessPath.c
+++ b/src/share/native/sun/java2d/loops/ProcessPath.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2011, 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
diff --git a/src/share/native/sun/java2d/pipe/BufferedMaskBlit.c b/src/share/native/sun/java2d/pipe/BufferedMaskBlit.c
index ccfeab5cafdb38e17dc675f27e4ce99e27ef009a..b5ba039a2379d43811744e2a52ac54f13cf73c38 100644
--- a/src/share/native/sun/java2d/pipe/BufferedMaskBlit.c
+++ b/src/share/native/sun/java2d/pipe/BufferedMaskBlit.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2007, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2010, 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
diff --git a/src/share/native/sun/security/ec/ECC_JNI.cpp b/src/share/native/sun/security/ec/ECC_JNI.cpp
index 249d2e74ed18f5aaa3da2270007ffb7f59d38ae5..dff675f9500f19d790ce39f82bc13a0232287726 100644
--- a/src/share/native/sun/security/ec/ECC_JNI.cpp
+++ b/src/share/native/sun/security/ec/ECC_JNI.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2011, 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
diff --git a/src/share/native/sun/security/ec/impl/ec.c b/src/share/native/sun/security/ec/impl/ec.c
index 11777de8746fcf0267b3e8fa59a698f9a546e06c..de35722904660b4d10caa5de84213c673ded54fa 100644
--- a/src/share/native/sun/security/ec/impl/ec.c
+++ b/src/share/native/sun/security/ec/impl/ec.c
@@ -51,7 +51,7 @@
*
*********************************************************************** */
/*
- * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*/
diff --git a/src/share/native/sun/security/ec/impl/ec.h b/src/share/native/sun/security/ec/impl/ec.h
index f5f3d356e26ddd393aef4ca9dfa218278bd4f29f..96d25f2a47a997394e3db658944b4c3735a9803d 100644
--- a/src/share/native/sun/security/ec/impl/ec.h
+++ b/src/share/native/sun/security/ec/impl/ec.h
@@ -50,7 +50,7 @@
*
*********************************************************************** */
/*
- * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*/
diff --git a/src/share/native/sun/security/ec/impl/ec2.h b/src/share/native/sun/security/ec/impl/ec2.h
index e297a309218de2df3808d071c2062b367cc6798d..b0ad53e9ee11eca509b1ef8da76a7fe3bf3d090d 100644
--- a/src/share/native/sun/security/ec/impl/ec2.h
+++ b/src/share/native/sun/security/ec/impl/ec2.h
@@ -50,7 +50,7 @@
*
*********************************************************************** */
/*
- * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*/
diff --git a/src/share/native/sun/security/ec/impl/ec2_163.c b/src/share/native/sun/security/ec/impl/ec2_163.c
index c1dc55dea35d6fb8981b39986b12ead2eddbb4aa..45023bfb92b81026ba5f2f0e6b1dc93fbadccf9d 100644
--- a/src/share/native/sun/security/ec/impl/ec2_163.c
+++ b/src/share/native/sun/security/ec/impl/ec2_163.c
@@ -52,7 +52,7 @@
*
*********************************************************************** */
/*
- * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*/
diff --git a/src/share/native/sun/security/ec/impl/ec2_193.c b/src/share/native/sun/security/ec/impl/ec2_193.c
index aa7f29f0823ac50315c02f0ad30748fc574b2fab..7bb7a947ac977436fedf81b3e49e67c33155bce5 100644
--- a/src/share/native/sun/security/ec/impl/ec2_193.c
+++ b/src/share/native/sun/security/ec/impl/ec2_193.c
@@ -52,7 +52,7 @@
*
*********************************************************************** */
/*
- * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*/
diff --git a/src/share/native/sun/security/ec/impl/ec2_233.c b/src/share/native/sun/security/ec/impl/ec2_233.c
index 485b104ce2a94cfcfa1f9d634d9d04ad47b9937f..d8fa9b36ed89388cf349c23ee0adfa65384e23ab 100644
--- a/src/share/native/sun/security/ec/impl/ec2_233.c
+++ b/src/share/native/sun/security/ec/impl/ec2_233.c
@@ -52,7 +52,7 @@
*
*********************************************************************** */
/*
- * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*/
diff --git a/src/share/native/sun/security/ec/impl/ec2_aff.c b/src/share/native/sun/security/ec/impl/ec2_aff.c
index f77eba3f4992c310cb60a1df6976ce3451987975..aff4da37d63551ed7af9b6851cd0801878f50568 100644
--- a/src/share/native/sun/security/ec/impl/ec2_aff.c
+++ b/src/share/native/sun/security/ec/impl/ec2_aff.c
@@ -50,7 +50,7 @@
*
*********************************************************************** */
/*
- * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*/
diff --git a/src/share/native/sun/security/ec/impl/ec2_mont.c b/src/share/native/sun/security/ec/impl/ec2_mont.c
index eda921f3ff6e0cd41202cdd3a89e5d879875b1b6..d000a1ab6dfff3d09cfb013f38d0352ad27f5e40 100644
--- a/src/share/native/sun/security/ec/impl/ec2_mont.c
+++ b/src/share/native/sun/security/ec/impl/ec2_mont.c
@@ -52,7 +52,7 @@
*
*********************************************************************** */
/*
- * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*/
diff --git a/src/share/native/sun/security/ec/impl/ec_naf.c b/src/share/native/sun/security/ec/impl/ec_naf.c
index e6307f0d1089d344f3a0835946c53eef1eefd887..c9e4aa4abb957da5e70231b480aecfcd1a08802f 100644
--- a/src/share/native/sun/security/ec/impl/ec_naf.c
+++ b/src/share/native/sun/security/ec/impl/ec_naf.c
@@ -50,7 +50,7 @@
*
*********************************************************************** */
/*
- * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*/
diff --git a/src/share/native/sun/security/ec/impl/ecc_impl.h b/src/share/native/sun/security/ec/impl/ecc_impl.h
index 23357ae8c42cace2726f77c046564bb5d0d8986f..9e5b0f951c9f9e78f1844abaef0f8d356b38bac9 100644
--- a/src/share/native/sun/security/ec/impl/ecc_impl.h
+++ b/src/share/native/sun/security/ec/impl/ecc_impl.h
@@ -51,7 +51,7 @@
*
*********************************************************************** */
/*
- * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*/
diff --git a/src/share/native/sun/security/ec/impl/ecdecode.c b/src/share/native/sun/security/ec/impl/ecdecode.c
index 826192161ee1dc3caa030b021c7208d40dc01139..639035c46526154f7c2167295e393f2f08132ad7 100644
--- a/src/share/native/sun/security/ec/impl/ecdecode.c
+++ b/src/share/native/sun/security/ec/impl/ecdecode.c
@@ -51,7 +51,7 @@
*
*********************************************************************** */
/*
- * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*/
diff --git a/src/share/native/sun/security/ec/impl/ecl-curve.h b/src/share/native/sun/security/ec/impl/ecl-curve.h
index 865c3d49feb4d84b5c67dc54db4b6dae776e3046..7f8ad1a7f9bf8b8b6bbb648d1c3d2e0f5b6f3519 100644
--- a/src/share/native/sun/security/ec/impl/ecl-curve.h
+++ b/src/share/native/sun/security/ec/impl/ecl-curve.h
@@ -50,7 +50,7 @@
*
*********************************************************************** */
/*
- * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*/
diff --git a/src/share/native/sun/security/ec/impl/ecl-exp.h b/src/share/native/sun/security/ec/impl/ecl-exp.h
index 51ed43fdbc24e019de757a8fcb4a98e581093fd7..434df45af67599dbdea0aefd0d32fc97520be4ec 100644
--- a/src/share/native/sun/security/ec/impl/ecl-exp.h
+++ b/src/share/native/sun/security/ec/impl/ecl-exp.h
@@ -50,7 +50,7 @@
*
*********************************************************************** */
/*
- * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*/
diff --git a/src/share/native/sun/security/ec/impl/ecl-priv.h b/src/share/native/sun/security/ec/impl/ecl-priv.h
index 6b032eabecca42f3d2a81182069f3411be510ee6..c99b3e21bb7829b01cb884d996d4a1d0c694b32b 100644
--- a/src/share/native/sun/security/ec/impl/ecl-priv.h
+++ b/src/share/native/sun/security/ec/impl/ecl-priv.h
@@ -51,7 +51,7 @@
*
*********************************************************************** */
/*
- * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*/
diff --git a/src/share/native/sun/security/ec/impl/ecl.c b/src/share/native/sun/security/ec/impl/ecl.c
index 79c5467cf079469056a57c7011d5e9c5de36030c..a379d28e0d918bf1e3d43b0f7b1419a5172f3a33 100644
--- a/src/share/native/sun/security/ec/impl/ecl.c
+++ b/src/share/native/sun/security/ec/impl/ecl.c
@@ -50,7 +50,7 @@
*
*********************************************************************** */
/*
- * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*/
diff --git a/src/share/native/sun/security/ec/impl/ecl.h b/src/share/native/sun/security/ec/impl/ecl.h
index ab956d89fbc721a286aafe80ba84a3ed8b05e1f1..80c3265985808abf8d0766a34c06f231b64c50d0 100644
--- a/src/share/native/sun/security/ec/impl/ecl.h
+++ b/src/share/native/sun/security/ec/impl/ecl.h
@@ -50,7 +50,7 @@
*
*********************************************************************** */
/*
- * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*/
diff --git a/src/share/native/sun/security/ec/impl/ecl_curve.c b/src/share/native/sun/security/ec/impl/ecl_curve.c
index a253a363f6a74334cbf372b566b13a94db63cc04..c315625f771f4897ec3b4cb3f13cda4f2c7bfbd8 100644
--- a/src/share/native/sun/security/ec/impl/ecl_curve.c
+++ b/src/share/native/sun/security/ec/impl/ecl_curve.c
@@ -50,7 +50,7 @@
*
*********************************************************************** */
/*
- * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*/
diff --git a/src/share/native/sun/security/ec/impl/ecl_gf.c b/src/share/native/sun/security/ec/impl/ecl_gf.c
index 46b8dff029581a384fdbf9f8a2971e761c1ced8c..bd4c10c7218b342d40750a75e54397542bbbe91c 100644
--- a/src/share/native/sun/security/ec/impl/ecl_gf.c
+++ b/src/share/native/sun/security/ec/impl/ecl_gf.c
@@ -51,7 +51,7 @@
*
*********************************************************************** */
/*
- * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*/
diff --git a/src/share/native/sun/security/ec/impl/ecl_mult.c b/src/share/native/sun/security/ec/impl/ecl_mult.c
index 5c43ae8cf0e868a80bed8d46ccf0a83e0e8302e3..55ad75f293beba9e8f42786113e902f6524b80ad 100644
--- a/src/share/native/sun/security/ec/impl/ecl_mult.c
+++ b/src/share/native/sun/security/ec/impl/ecl_mult.c
@@ -50,7 +50,7 @@
*
*********************************************************************** */
/*
- * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*/
diff --git a/src/share/native/sun/security/ec/impl/ecp.h b/src/share/native/sun/security/ec/impl/ecp.h
index 97220f3d39f8c5b35c3f5e6f99c65229dfe11469..989c4359b2c3699cf34bbe927a315c67f166ffe3 100644
--- a/src/share/native/sun/security/ec/impl/ecp.h
+++ b/src/share/native/sun/security/ec/impl/ecp.h
@@ -50,7 +50,7 @@
*
*********************************************************************** */
/*
- * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*/
diff --git a/src/share/native/sun/security/ec/impl/ecp_192.c b/src/share/native/sun/security/ec/impl/ecp_192.c
index dcdd9dbe618b3d9ee8fb494baf4d4f1adb3a7b28..c58474dd60b1002c03cafaa84f8a06d2018b68e4 100644
--- a/src/share/native/sun/security/ec/impl/ecp_192.c
+++ b/src/share/native/sun/security/ec/impl/ecp_192.c
@@ -50,7 +50,7 @@
*
*********************************************************************** */
/*
- * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*/
diff --git a/src/share/native/sun/security/ec/impl/ecp_224.c b/src/share/native/sun/security/ec/impl/ecp_224.c
index 96d775f9e870a1905dd835ce035cd494758075a2..573a9f43b593157d315a139b4278b384b3950058 100644
--- a/src/share/native/sun/security/ec/impl/ecp_224.c
+++ b/src/share/native/sun/security/ec/impl/ecp_224.c
@@ -50,7 +50,7 @@
*
*********************************************************************** */
/*
- * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*/
diff --git a/src/share/native/sun/security/ec/impl/ecp_256.c b/src/share/native/sun/security/ec/impl/ecp_256.c
index ef8290856632f533f8911726ae18bfa1202377b6..2ce46e5b93516e2dc3bc811909437258221aa72b 100644
--- a/src/share/native/sun/security/ec/impl/ecp_256.c
+++ b/src/share/native/sun/security/ec/impl/ecp_256.c
@@ -50,7 +50,7 @@
*
*********************************************************************** */
/*
- * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*/
diff --git a/src/share/native/sun/security/ec/impl/ecp_384.c b/src/share/native/sun/security/ec/impl/ecp_384.c
index 263fecb888f2535856e85b71389ced209b388faa..74f8e342c00be9870d5d770b117341d15c1b53ad 100644
--- a/src/share/native/sun/security/ec/impl/ecp_384.c
+++ b/src/share/native/sun/security/ec/impl/ecp_384.c
@@ -50,7 +50,7 @@
*
*********************************************************************** */
/*
- * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*/
diff --git a/src/share/native/sun/security/ec/impl/ecp_521.c b/src/share/native/sun/security/ec/impl/ecp_521.c
index 239b1289372bbcc4a0787288adaf3a79eabeddf4..62c0bc41d58a64bb0b83c7c408251cc65dde08bd 100644
--- a/src/share/native/sun/security/ec/impl/ecp_521.c
+++ b/src/share/native/sun/security/ec/impl/ecp_521.c
@@ -50,7 +50,7 @@
*
*********************************************************************** */
/*
- * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*/
diff --git a/src/share/native/sun/security/ec/impl/ecp_aff.c b/src/share/native/sun/security/ec/impl/ecp_aff.c
index a3a97f62570417341999abf1be047b882059cf15..4f9b0d1daeb9fe95b8285c957495f0a01f20264a 100644
--- a/src/share/native/sun/security/ec/impl/ecp_aff.c
+++ b/src/share/native/sun/security/ec/impl/ecp_aff.c
@@ -55,7 +55,7 @@
*
*********************************************************************** */
/*
- * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*/
diff --git a/src/share/native/sun/security/ec/impl/ecp_jac.c b/src/share/native/sun/security/ec/impl/ecp_jac.c
index 8b35dae8e995ca6118065ea25990e511ee3695bb..779b82f75cbeb4a90aa2d9be3b4f37602ec1de8b 100644
--- a/src/share/native/sun/security/ec/impl/ecp_jac.c
+++ b/src/share/native/sun/security/ec/impl/ecp_jac.c
@@ -55,7 +55,7 @@
*
*********************************************************************** */
/*
- * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*/
diff --git a/src/share/native/sun/security/ec/impl/ecp_jm.c b/src/share/native/sun/security/ec/impl/ecp_jm.c
index b85615be7add52c1b2aa65a32f2eb7ce435420a2..2f1c42aa001b1fd81ba7ba26827a21caee23b299 100644
--- a/src/share/native/sun/security/ec/impl/ecp_jm.c
+++ b/src/share/native/sun/security/ec/impl/ecp_jm.c
@@ -50,7 +50,7 @@
*
*********************************************************************** */
/*
- * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*/
diff --git a/src/share/native/sun/security/ec/impl/ecp_mont.c b/src/share/native/sun/security/ec/impl/ecp_mont.c
index 6519eda7bc08c359455e2bad6e70f849a872d70e..9a9ce1e4cb23c662d3a24ae862009195695513fe 100644
--- a/src/share/native/sun/security/ec/impl/ecp_mont.c
+++ b/src/share/native/sun/security/ec/impl/ecp_mont.c
@@ -50,7 +50,7 @@
*
*********************************************************************** */
/*
- * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*/
diff --git a/src/share/native/sun/security/ec/impl/logtab.h b/src/share/native/sun/security/ec/impl/logtab.h
index f4b40008b4a56090d704e7d4621f0bc4d425e3e5..a6314ff76e12ee183e0d22e8dfb179283cae12c3 100644
--- a/src/share/native/sun/security/ec/impl/logtab.h
+++ b/src/share/native/sun/security/ec/impl/logtab.h
@@ -50,7 +50,7 @@
*
*********************************************************************** */
/*
- * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*/
diff --git a/src/share/native/sun/security/ec/impl/mp_gf2m-priv.h b/src/share/native/sun/security/ec/impl/mp_gf2m-priv.h
index 889bfd1bed0b4e45f877207f51cb6ec6b72428a0..d4f81cee0458195dd3044e315f40053f6facf9cf 100644
--- a/src/share/native/sun/security/ec/impl/mp_gf2m-priv.h
+++ b/src/share/native/sun/security/ec/impl/mp_gf2m-priv.h
@@ -51,7 +51,7 @@
*
*********************************************************************** */
/*
- * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*/
diff --git a/src/share/native/sun/security/ec/impl/mp_gf2m.c b/src/share/native/sun/security/ec/impl/mp_gf2m.c
index 2c021c88a24b616b2704888b4fd27074c37d7517..06e557af12721980244892d2b48fc22f861ef1e9 100644
--- a/src/share/native/sun/security/ec/impl/mp_gf2m.c
+++ b/src/share/native/sun/security/ec/impl/mp_gf2m.c
@@ -51,7 +51,7 @@
*
*********************************************************************** */
/*
- * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*/
diff --git a/src/share/native/sun/security/ec/impl/mp_gf2m.h b/src/share/native/sun/security/ec/impl/mp_gf2m.h
index f689ba35358cdbc1d71d7967d5d775b242ab17cf..90c3bffdf0bddfde5769d831d463302e68b782d2 100644
--- a/src/share/native/sun/security/ec/impl/mp_gf2m.h
+++ b/src/share/native/sun/security/ec/impl/mp_gf2m.h
@@ -51,7 +51,7 @@
*
*********************************************************************** */
/*
- * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*/
diff --git a/src/share/native/sun/security/ec/impl/mpi-config.h b/src/share/native/sun/security/ec/impl/mpi-config.h
index 4c2b22b9f12065ffe074b0a87c2bf965135f7272..1e4216c3baa1e805302130edc07e8226cc893179 100644
--- a/src/share/native/sun/security/ec/impl/mpi-config.h
+++ b/src/share/native/sun/security/ec/impl/mpi-config.h
@@ -50,7 +50,7 @@
*
*********************************************************************** */
/*
- * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*/
diff --git a/src/share/native/sun/security/ec/impl/mpi-priv.h b/src/share/native/sun/security/ec/impl/mpi-priv.h
index 9a80f23d02f975b9eeec51ea01efce4ce166d45b..2cec62c254a4c3bba5257803cc05c698c4bc40c5 100644
--- a/src/share/native/sun/security/ec/impl/mpi-priv.h
+++ b/src/share/native/sun/security/ec/impl/mpi-priv.h
@@ -56,7 +56,7 @@
*
*********************************************************************** */
/*
- * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*/
diff --git a/src/share/native/sun/security/ec/impl/mpi.c b/src/share/native/sun/security/ec/impl/mpi.c
index a495b998598f43651487d9cc494923a3eb73fdc0..c33bc19160ae91733ebd65390da95eefccd08581 100644
--- a/src/share/native/sun/security/ec/impl/mpi.c
+++ b/src/share/native/sun/security/ec/impl/mpi.c
@@ -54,7 +54,7 @@
*
*********************************************************************** */
/*
- * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*/
diff --git a/src/share/native/sun/security/ec/impl/mpi.h b/src/share/native/sun/security/ec/impl/mpi.h
index d80657e5657cde7738d7210f61fa1e2a8ce4d1dd..87ba085619228b50c8b5be06209c0ab3a8c202fb 100644
--- a/src/share/native/sun/security/ec/impl/mpi.h
+++ b/src/share/native/sun/security/ec/impl/mpi.h
@@ -53,7 +53,7 @@
*
*********************************************************************** */
/*
- * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*/
diff --git a/src/share/native/sun/security/ec/impl/mplogic.c b/src/share/native/sun/security/ec/impl/mplogic.c
index 8de8306ea9e6ee1342515bd9f568d63d1140e665..30b5b42c27de9f40ca028ab698f3d948660f9de3 100644
--- a/src/share/native/sun/security/ec/impl/mplogic.c
+++ b/src/share/native/sun/security/ec/impl/mplogic.c
@@ -52,7 +52,7 @@
*
*********************************************************************** */
/*
- * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*/
diff --git a/src/share/native/sun/security/ec/impl/mplogic.h b/src/share/native/sun/security/ec/impl/mplogic.h
index a2f7714bffbe66813b745066272d007531665b41..abc94c0c1a9d7bc0a4c1943c9897125e6e1249b2 100644
--- a/src/share/native/sun/security/ec/impl/mplogic.h
+++ b/src/share/native/sun/security/ec/impl/mplogic.h
@@ -52,7 +52,7 @@
*
*********************************************************************** */
/*
- * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*/
diff --git a/src/share/native/sun/security/ec/impl/mpmontg.c b/src/share/native/sun/security/ec/impl/mpmontg.c
index c1762847a5eb2fb65cc4de4f13ee719c3cca41ce..04dfe9b62d7e5edbfbe8f1ffbfc165c633487e64 100644
--- a/src/share/native/sun/security/ec/impl/mpmontg.c
+++ b/src/share/native/sun/security/ec/impl/mpmontg.c
@@ -52,7 +52,7 @@
*
*********************************************************************** */
/*
- * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*/
diff --git a/src/share/native/sun/security/ec/impl/mpprime.h b/src/share/native/sun/security/ec/impl/mpprime.h
index b9012af4b316c08172a89aff80c126c3cb553fb9..a741d418d63b50e7e0400946f1ad2739b980cd79 100644
--- a/src/share/native/sun/security/ec/impl/mpprime.h
+++ b/src/share/native/sun/security/ec/impl/mpprime.h
@@ -53,7 +53,7 @@
*
*********************************************************************** */
/*
- * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*/
diff --git a/src/share/native/sun/security/ec/impl/oid.c b/src/share/native/sun/security/ec/impl/oid.c
index e5a76992bf987e636ce3bf8d8b21684d77b19c05..252491b33313026b9538b5637f0940e238e5a7a7 100644
--- a/src/share/native/sun/security/ec/impl/oid.c
+++ b/src/share/native/sun/security/ec/impl/oid.c
@@ -50,7 +50,7 @@
*
*********************************************************************** */
/*
- * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*/
diff --git a/src/share/native/sun/security/ec/impl/secitem.c b/src/share/native/sun/security/ec/impl/secitem.c
index 6cfa5dea4b2019d96b94ea222ed262586446d8ea..3db3027afa28c1905edba2b48dbe9094cea69798 100644
--- a/src/share/native/sun/security/ec/impl/secitem.c
+++ b/src/share/native/sun/security/ec/impl/secitem.c
@@ -49,7 +49,7 @@
*
*********************************************************************** */
/*
- * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*/
diff --git a/src/share/native/sun/security/ec/impl/secoidt.h b/src/share/native/sun/security/ec/impl/secoidt.h
index ea5da257ad78a45dd2c4e7c50cd76854c441beca..5ad9a67415afebef805a7b3e8c7b6d21f7caeacf 100644
--- a/src/share/native/sun/security/ec/impl/secoidt.h
+++ b/src/share/native/sun/security/ec/impl/secoidt.h
@@ -50,7 +50,7 @@
*
*********************************************************************** */
/*
- * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*/
diff --git a/src/share/sample/nio/file/AclEdit.java b/src/share/sample/nio/file/AclEdit.java
index 0910e888a70f3a59905c06f213cefb1f118fa843..02b6ae78aa3340cece625ee3bc150edee5d3b591 100644
--- a/src/share/sample/nio/file/AclEdit.java
+++ b/src/share/sample/nio/file/AclEdit.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
diff --git a/src/share/sample/nio/file/Chmod.java b/src/share/sample/nio/file/Chmod.java
index 7c4d50e93efa0665ba3dae21868b7873b78308a6..321f4552551fbc84dd30f18a13b0fda11d7f1bbe 100644
--- a/src/share/sample/nio/file/Chmod.java
+++ b/src/share/sample/nio/file/Chmod.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
diff --git a/src/share/sample/nio/file/Copy.java b/src/share/sample/nio/file/Copy.java
index 38062c4b87530bda7e1d6e66b0c05108967da019..7cb684183aa492706f9f08608cc6f94549ffc8d5 100644
--- a/src/share/sample/nio/file/Copy.java
+++ b/src/share/sample/nio/file/Copy.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
diff --git a/src/share/sample/nio/file/DiskUsage.java b/src/share/sample/nio/file/DiskUsage.java
index fb2a164bf328688d79010022e7afdd75090c7adb..8d6bbb674d1512032cfe9da01c616899cc2e72b6 100644
--- a/src/share/sample/nio/file/DiskUsage.java
+++ b/src/share/sample/nio/file/DiskUsage.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
diff --git a/src/share/sample/nio/file/FileType.java b/src/share/sample/nio/file/FileType.java
index 71451614b07a762edef4e75e1ae51ba41bee55d0..dc754b5f8955053bd1d162971da85eadb7e78af4 100644
--- a/src/share/sample/nio/file/FileType.java
+++ b/src/share/sample/nio/file/FileType.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
diff --git a/src/share/sample/nio/file/WatchDir.java b/src/share/sample/nio/file/WatchDir.java
index 796b728206bcdb22b4bfe4fe62a67a6e8911b412..9b9d2ece052b5793c0dfa11205bc740e937cf6a0 100644
--- a/src/share/sample/nio/file/WatchDir.java
+++ b/src/share/sample/nio/file/WatchDir.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
diff --git a/src/share/sample/nio/file/Xdd.java b/src/share/sample/nio/file/Xdd.java
index 7551121a924a5b308c0b9a319b8040bd386f0eda..f07802f264ac473b18091525775891eb1b749449 100644
--- a/src/share/sample/nio/file/Xdd.java
+++ b/src/share/sample/nio/file/Xdd.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
diff --git a/src/solaris/bin/arm/jvm.cfg b/src/solaris/bin/arm/jvm.cfg
new file mode 100644
index 0000000000000000000000000000000000000000..0262ebda2e37fad7d9f0cce3711f8ada20e15176
--- /dev/null
+++ b/src/solaris/bin/arm/jvm.cfg
@@ -0,0 +1,38 @@
+# Copyright (c) 2011, 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.
+#
+# List of JVMs that can be used as an option to java, javac, etc.
+# Order is important -- first in this list is the default JVM.
+# NOTE that this both this file and its format are UNSUPPORTED and
+# WILL GO AWAY in a future release.
+#
+# You may also select a JVM in an arbitrary location with the
+# "-XXaltjvm=" option, but that too is unsupported
+# and may not be available in a future release.
+#
+-client KNOWN
+-server KNOWN
+-hotspot ERROR
+-classic WARN
+-native ERROR
+-green ERROR
diff --git a/src/solaris/bin/ppc/jvm.cfg b/src/solaris/bin/ppc/jvm.cfg
new file mode 100644
index 0000000000000000000000000000000000000000..0262ebda2e37fad7d9f0cce3711f8ada20e15176
--- /dev/null
+++ b/src/solaris/bin/ppc/jvm.cfg
@@ -0,0 +1,38 @@
+# Copyright (c) 2011, 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.
+#
+# List of JVMs that can be used as an option to java, javac, etc.
+# Order is important -- first in this list is the default JVM.
+# NOTE that this both this file and its format are UNSUPPORTED and
+# WILL GO AWAY in a future release.
+#
+# You may also select a JVM in an arbitrary location with the
+# "-XXaltjvm=" option, but that too is unsupported
+# and may not be available in a future release.
+#
+-client KNOWN
+-server KNOWN
+-hotspot ERROR
+-classic WARN
+-native ERROR
+-green ERROR
diff --git a/src/solaris/classes/java/lang/ProcessEnvironment.java b/src/solaris/classes/java/lang/ProcessEnvironment.java
index a08a291c937f5388cb74fa8843181557eea2d2b3..bb60c71b604b16dc9b527ccdc03fe45966449b5a 100644
--- a/src/solaris/classes/java/lang/ProcessEnvironment.java
+++ b/src/solaris/classes/java/lang/ProcessEnvironment.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, 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
diff --git a/src/solaris/classes/java/util/prefs/FileSystemPreferences.java b/src/solaris/classes/java/util/prefs/FileSystemPreferences.java
index 53a19b5f5bd28bd681f16d78b61753f0bbb5cbd6..166fcd97d69ffa00758de507b9415ae5570c6837 100644
--- a/src/solaris/classes/java/util/prefs/FileSystemPreferences.java
+++ b/src/solaris/classes/java/util/prefs/FileSystemPreferences.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2011, 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
diff --git a/src/solaris/classes/sun/awt/X11/GtkFileDialogPeer.java b/src/solaris/classes/sun/awt/X11/GtkFileDialogPeer.java
index e41bbb65dfb955e86e24ad7fa30ced61613d32d2..02be75b6ca5627b2952efe417e7e6ede6de6f651 100644
--- a/src/solaris/classes/sun/awt/X11/GtkFileDialogPeer.java
+++ b/src/solaris/classes/sun/awt/X11/GtkFileDialogPeer.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2011, 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
diff --git a/src/solaris/classes/sun/awt/X11/XComponentPeer.java b/src/solaris/classes/sun/awt/X11/XComponentPeer.java
index 6e425513c1c40a13fec3d9ebe2b07582fa095830..37126c7165494b20c15dfb29d4c318d69aa67ddd 100644
--- a/src/solaris/classes/sun/awt/X11/XComponentPeer.java
+++ b/src/solaris/classes/sun/awt/X11/XComponentPeer.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2011, 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
diff --git a/src/solaris/classes/sun/awt/X11/XDesktopPeer.java b/src/solaris/classes/sun/awt/X11/XDesktopPeer.java
index 740eabac485bd8d6986c8a0499cc297159e311f4..94ba7529a5444bfb05d25698e17dc2ef80a891c2 100644
--- a/src/solaris/classes/sun/awt/X11/XDesktopPeer.java
+++ b/src/solaris/classes/sun/awt/X11/XDesktopPeer.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2011, 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
diff --git a/src/solaris/classes/sun/awt/X11/XGlobalCursorManager.java b/src/solaris/classes/sun/awt/X11/XGlobalCursorManager.java
index c28d9d03e1174226be08fcb6b4c36b0a51a0a567..a8703cb7877291d986d9f47c9675b6e6d5171784 100644
--- a/src/solaris/classes/sun/awt/X11/XGlobalCursorManager.java
+++ b/src/solaris/classes/sun/awt/X11/XGlobalCursorManager.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2011, 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
diff --git a/src/solaris/classes/sun/awt/X11/XRobotPeer.java b/src/solaris/classes/sun/awt/X11/XRobotPeer.java
index a6acd8eb5f58241958e601b14a5fd3710838b222..1463f283f0bd33b06551bf3d0ae687bd51a96803 100644
--- a/src/solaris/classes/sun/awt/X11/XRobotPeer.java
+++ b/src/solaris/classes/sun/awt/X11/XRobotPeer.java
@@ -48,7 +48,7 @@ class XRobotPeer implements RobotPeer {
}
public void dispose() {
- // does nothing
+ _dispose();
}
public void mouseMove(int x, int y) {
@@ -88,6 +88,7 @@ class XRobotPeer implements RobotPeer {
}
private static native synchronized void setup(int numberOfButtons, int[] buttonDownMasks);
+ private static native synchronized void _dispose();
private static native synchronized void mouseMoveImpl(X11GraphicsConfig xgc, int x, int y);
private static native synchronized void mousePressImpl(int buttons);
diff --git a/src/solaris/classes/sun/awt/X11/XSelection.java b/src/solaris/classes/sun/awt/X11/XSelection.java
index 1ffd1346361e188681ad60a8ebd35c725a107658..f19ad2ffb67cb54b3e4bc8e9e155315eca2e8e89 100644
--- a/src/solaris/classes/sun/awt/X11/XSelection.java
+++ b/src/solaris/classes/sun/awt/X11/XSelection.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2011, 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
diff --git a/src/solaris/classes/sun/awt/X11/XTextAreaPeer.java b/src/solaris/classes/sun/awt/X11/XTextAreaPeer.java
index d9cc3033a3b9cc636584e9a3c198bf9603af48d2..3f63391473da1729a3764d1250f2abc972ecc5ea 100644
--- a/src/solaris/classes/sun/awt/X11/XTextAreaPeer.java
+++ b/src/solaris/classes/sun/awt/X11/XTextAreaPeer.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2011, 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
diff --git a/src/solaris/classes/sun/awt/X11/XToolkit.java b/src/solaris/classes/sun/awt/X11/XToolkit.java
index ad92d2e9c0016df894965d0f72b2c7a2907a3b61..641d82180a905406e592d86de0a4dead4ebf9943 100644
--- a/src/solaris/classes/sun/awt/X11/XToolkit.java
+++ b/src/solaris/classes/sun/awt/X11/XToolkit.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2011, 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
@@ -135,6 +135,12 @@ public final class XToolkit extends UNIXToolkit implements Runnable {
noisyAwtHandler = AccessController.doPrivileged(new GetBooleanAction("sun.awt.noisyerrorhandler"));
}
+ /*
+ * Return (potentially) platform specific display timeout for the
+ * tray icon
+ */
+ static native long getTrayIconDisplayTimeout();
+
//---- ERROR HANDLER CODE ----//
/*
@@ -1222,8 +1228,8 @@ public final class XToolkit extends UNIXToolkit implements Runnable {
public PrintJob getPrintJob(final Frame frame, final String doctitle,
final Properties props) {
- if (GraphicsEnvironment.isHeadless()) {
- throw new IllegalArgumentException();
+ if (frame == null) {
+ throw new NullPointerException("frame must not be null");
}
PrintJob2D printJob = new PrintJob2D(frame, doctitle, props);
@@ -1236,11 +1242,10 @@ public final class XToolkit extends UNIXToolkit implements Runnable {
public PrintJob getPrintJob(final Frame frame, final String doctitle,
final JobAttributes jobAttributes,
- final PageAttributes pageAttributes) {
-
-
- if (GraphicsEnvironment.isHeadless()) {
- throw new IllegalArgumentException();
+ final PageAttributes pageAttributes)
+ {
+ if (frame == null) {
+ throw new NullPointerException("frame must not be null");
}
PrintJob2D printJob = new PrintJob2D(frame, doctitle,
diff --git a/src/solaris/classes/sun/awt/X11/XTrayIconPeer.java b/src/solaris/classes/sun/awt/X11/XTrayIconPeer.java
index ff7b78e2c1396886b79c68e247345594ee08d0de..7bc452c968eb8203bd1c2fd362f32fbfc811b74c 100644
--- a/src/solaris/classes/sun/awt/X11/XTrayIconPeer.java
+++ b/src/solaris/classes/sun/awt/X11/XTrayIconPeer.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2011, 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
@@ -230,7 +230,7 @@ public class XTrayIconPeer implements TrayIconPeer,
// Wait till the EmbeddedFrame is reparented
long start = System.currentTimeMillis();
- final long PERIOD = 2000L;
+ final long PERIOD = XToolkit.getTrayIconDisplayTimeout();
XToolkit.awtLock();
try {
while (!isTrayIconDisplayed) {
diff --git a/src/solaris/classes/sun/awt/motif/MFontConfiguration.java b/src/solaris/classes/sun/awt/motif/MFontConfiguration.java
index 4e42db8d557c92b9de7c25e30f22eb0a6ea5fbbb..25e676eda53e83385f67ee915b228d0c6169e026 100644
--- a/src/solaris/classes/sun/awt/motif/MFontConfiguration.java
+++ b/src/solaris/classes/sun/awt/motif/MFontConfiguration.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2011, 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
diff --git a/src/solaris/classes/sun/awt/motif/MToolkit.java b/src/solaris/classes/sun/awt/motif/MToolkit.java
index a4148a7b047431db26384f9497852fcbec21fa76..44108be3cf18696bd507f031000466291b3e300e 100644
--- a/src/solaris/classes/sun/awt/motif/MToolkit.java
+++ b/src/solaris/classes/sun/awt/motif/MToolkit.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1995, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2011, 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
diff --git a/src/solaris/classes/sun/font/FcFontConfiguration.java b/src/solaris/classes/sun/font/FcFontConfiguration.java
index 3ce3ce9e264d0c7a701fa56a5c86f112a6765227..ce2c935ba71b27f2d45ba63a59a84489d28e256f 100644
--- a/src/solaris/classes/sun/font/FcFontConfiguration.java
+++ b/src/solaris/classes/sun/font/FcFontConfiguration.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2011, 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
diff --git a/src/solaris/classes/sun/font/FontConfigManager.java b/src/solaris/classes/sun/font/FontConfigManager.java
index 5832683c04e6bf7f69ce9252c7c906b69cd0952e..41c1a5d8cbb72a0f40b70a438fd534327e9857c7 100644
--- a/src/solaris/classes/sun/font/FontConfigManager.java
+++ b/src/solaris/classes/sun/font/FontConfigManager.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2011, 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
diff --git a/src/solaris/classes/sun/font/XRGlyphCache.java b/src/solaris/classes/sun/font/XRGlyphCache.java
index 7dbb23a774f89add0b2c681e7251ad04efa7e6b0..74ac140a7876489b27119e65576035543379efe5 100644
--- a/src/solaris/classes/sun/font/XRGlyphCache.java
+++ b/src/solaris/classes/sun/font/XRGlyphCache.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2011, 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
diff --git a/src/solaris/classes/sun/java2d/xr/XRSurfaceData.java b/src/solaris/classes/sun/java2d/xr/XRSurfaceData.java
index d8790b2cb5999e6aceda912a8b377e31f0926df1..fa0598774dfb740181f5fef1f825071995ff8207 100644
--- a/src/solaris/classes/sun/java2d/xr/XRSurfaceData.java
+++ b/src/solaris/classes/sun/java2d/xr/XRSurfaceData.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2011, 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
diff --git a/src/solaris/classes/sun/net/www/protocol/http/ntlm/NTLMAuthentication.java b/src/solaris/classes/sun/net/www/protocol/http/ntlm/NTLMAuthentication.java
index be2426d7f722cb9bb3ca60e47d2cd0a12fa9fcbe..0d898336e242ec42452f19083e388f4ca72d998b 100644
--- a/src/solaris/classes/sun/net/www/protocol/http/ntlm/NTLMAuthentication.java
+++ b/src/solaris/classes/sun/net/www/protocol/http/ntlm/NTLMAuthentication.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2011, 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
diff --git a/src/solaris/classes/sun/nio/ch/UnixAsynchronousServerSocketChannelImpl.java b/src/solaris/classes/sun/nio/ch/UnixAsynchronousServerSocketChannelImpl.java
index ee3731a0c2e29a022b1ae108bea6d990915ff2ea..3b431e77b01dfb18d53765dcb2cebe8cba1a49da 100644
--- a/src/solaris/classes/sun/nio/ch/UnixAsynchronousServerSocketChannelImpl.java
+++ b/src/solaris/classes/sun/nio/ch/UnixAsynchronousServerSocketChannelImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2011, 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
diff --git a/src/solaris/classes/sun/nio/ch/UnixAsynchronousSocketChannelImpl.java b/src/solaris/classes/sun/nio/ch/UnixAsynchronousSocketChannelImpl.java
index 37caeeb9bcebed4bc199e28d0350a5621a68befe..d7fccc9d558b39c21f578ddcbdaf6060e1682c99 100644
--- a/src/solaris/classes/sun/nio/ch/UnixAsynchronousSocketChannelImpl.java
+++ b/src/solaris/classes/sun/nio/ch/UnixAsynchronousSocketChannelImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2011, 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
diff --git a/src/solaris/classes/sun/nio/fs/GnomeFileTypeDetector.java b/src/solaris/classes/sun/nio/fs/GnomeFileTypeDetector.java
index 8e06835570f8720a83800df12b3d48540b136743..f92a31488f8df7857d6765085205454677d7915a 100644
--- a/src/solaris/classes/sun/nio/fs/GnomeFileTypeDetector.java
+++ b/src/solaris/classes/sun/nio/fs/GnomeFileTypeDetector.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2011, 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
diff --git a/src/solaris/classes/sun/nio/fs/LinuxDosFileAttributeView.java b/src/solaris/classes/sun/nio/fs/LinuxDosFileAttributeView.java
index af0dc1036bdb5818222ffe9397701d6253aa03e4..4a97e094243ab60fe7260996ff38f19e5924af44 100644
--- a/src/solaris/classes/sun/nio/fs/LinuxDosFileAttributeView.java
+++ b/src/solaris/classes/sun/nio/fs/LinuxDosFileAttributeView.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2011, 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
diff --git a/src/solaris/classes/sun/nio/fs/LinuxFileSystem.java b/src/solaris/classes/sun/nio/fs/LinuxFileSystem.java
index 18309cb445079109ca1521c867f4ec30dc1b6f1a..89be8614a2595095967e60377cb2c1c1c3abdd65 100644
--- a/src/solaris/classes/sun/nio/fs/LinuxFileSystem.java
+++ b/src/solaris/classes/sun/nio/fs/LinuxFileSystem.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2011, 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
diff --git a/src/solaris/classes/sun/nio/fs/LinuxFileSystemProvider.java b/src/solaris/classes/sun/nio/fs/LinuxFileSystemProvider.java
index 6659ff5ede48f5871524e7697db056d53b87df54..1045a7e00c62c7137083c11dd96b930f000fcb37 100644
--- a/src/solaris/classes/sun/nio/fs/LinuxFileSystemProvider.java
+++ b/src/solaris/classes/sun/nio/fs/LinuxFileSystemProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2011, 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
@@ -56,11 +56,11 @@ public class LinuxFileSystemProvider extends UnixFileSystemProvider {
{
if (type == DosFileAttributeView.class) {
return (V) new LinuxDosFileAttributeView(UnixPath.toUnixPath(obj),
- followLinks(options));
+ Util.followLinks(options));
}
if (type == UserDefinedFileAttributeView.class) {
return (V) new LinuxUserDefinedFileAttributeView(UnixPath.toUnixPath(obj),
- followLinks(options));
+ Util.followLinks(options));
}
return super.getFileAttributeView(obj, type, options);
}
@@ -72,11 +72,11 @@ public class LinuxFileSystemProvider extends UnixFileSystemProvider {
{
if (name.equals("dos")) {
return new LinuxDosFileAttributeView(UnixPath.toUnixPath(obj),
- followLinks(options));
+ Util.followLinks(options));
}
if (name.equals("user")) {
return new LinuxUserDefinedFileAttributeView(UnixPath.toUnixPath(obj),
- followLinks(options));
+ Util.followLinks(options));
}
return super.getFileAttributeView(obj, name, options);
}
diff --git a/src/solaris/classes/sun/nio/fs/LinuxUserDefinedFileAttributeView.java b/src/solaris/classes/sun/nio/fs/LinuxUserDefinedFileAttributeView.java
index 14bfbcc2e1e02ddb0daccbee6ff177ba4a252d06..586e4b3fad158219ebd7621a2856c5b9cf1e35f4 100644
--- a/src/solaris/classes/sun/nio/fs/LinuxUserDefinedFileAttributeView.java
+++ b/src/solaris/classes/sun/nio/fs/LinuxUserDefinedFileAttributeView.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2011, 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
diff --git a/src/solaris/classes/sun/nio/fs/LinuxWatchService.java b/src/solaris/classes/sun/nio/fs/LinuxWatchService.java
index bca96756325908a7c41fd095215cd88d1cd166d2..31d3bf0770fa4965ffabb09a874958adca6b06c1 100644
--- a/src/solaris/classes/sun/nio/fs/LinuxWatchService.java
+++ b/src/solaris/classes/sun/nio/fs/LinuxWatchService.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2011, 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
diff --git a/src/solaris/classes/sun/nio/fs/SolarisAclFileAttributeView.java b/src/solaris/classes/sun/nio/fs/SolarisAclFileAttributeView.java
index 5fa71242b81d9fb5525e8f0649e90eef917b6d72..b27f937b8d7374c35dd2d7ca7642abf3a10be957 100644
--- a/src/solaris/classes/sun/nio/fs/SolarisAclFileAttributeView.java
+++ b/src/solaris/classes/sun/nio/fs/SolarisAclFileAttributeView.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2011, 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
diff --git a/src/solaris/classes/sun/nio/fs/SolarisFileSystem.java b/src/solaris/classes/sun/nio/fs/SolarisFileSystem.java
index 516d983c259840da108f6175e03afc93d4d50adc..9aa9e533b8abcf0a73258846ed404b8c83f52ea5 100644
--- a/src/solaris/classes/sun/nio/fs/SolarisFileSystem.java
+++ b/src/solaris/classes/sun/nio/fs/SolarisFileSystem.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2011, 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
diff --git a/src/solaris/classes/sun/nio/fs/SolarisFileSystemProvider.java b/src/solaris/classes/sun/nio/fs/SolarisFileSystemProvider.java
index 98c3ae8699ca580bf37a26b26a7e763f649be1e9..5564a26235c71005a6038d815260bcd66282c975 100644
--- a/src/solaris/classes/sun/nio/fs/SolarisFileSystemProvider.java
+++ b/src/solaris/classes/sun/nio/fs/SolarisFileSystemProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2011, 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
@@ -57,11 +57,11 @@ public class SolarisFileSystemProvider extends UnixFileSystemProvider {
{
if (type == AclFileAttributeView.class) {
return (V) new SolarisAclFileAttributeView(UnixPath.toUnixPath(obj),
- followLinks(options));
+ Util.followLinks(options));
}
if (type == UserDefinedFileAttributeView.class) {
return(V) new SolarisUserDefinedFileAttributeView(UnixPath.toUnixPath(obj),
- followLinks(options));
+ Util.followLinks(options));
}
return super.getFileAttributeView(obj, type, options);
}
@@ -73,10 +73,10 @@ public class SolarisFileSystemProvider extends UnixFileSystemProvider {
{
if (name.equals("acl"))
return new SolarisAclFileAttributeView(UnixPath.toUnixPath(obj),
- followLinks(options));
+ Util.followLinks(options));
if (name.equals("user"))
return new SolarisUserDefinedFileAttributeView(UnixPath.toUnixPath(obj),
- followLinks(options));
+ Util.followLinks(options));
return super.getFileAttributeView(obj, name, options);
}
}
diff --git a/src/solaris/classes/sun/nio/fs/SolarisUserDefinedFileAttributeView.java b/src/solaris/classes/sun/nio/fs/SolarisUserDefinedFileAttributeView.java
index 6148f4109f2a0144d865c6b420132254a354ad08..c48ecef63b01ece436523b38b18b495a3f8eb834 100644
--- a/src/solaris/classes/sun/nio/fs/SolarisUserDefinedFileAttributeView.java
+++ b/src/solaris/classes/sun/nio/fs/SolarisUserDefinedFileAttributeView.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2011, 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
diff --git a/src/solaris/classes/sun/nio/fs/SolarisWatchService.java b/src/solaris/classes/sun/nio/fs/SolarisWatchService.java
index 68296bc34e506f53ad76f6be3b665a999cac8e3a..fcf36316b19b201f4e2047b64f4807db2ddfd424 100644
--- a/src/solaris/classes/sun/nio/fs/SolarisWatchService.java
+++ b/src/solaris/classes/sun/nio/fs/SolarisWatchService.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2011, 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
diff --git a/src/solaris/classes/sun/nio/fs/UnixChannelFactory.java b/src/solaris/classes/sun/nio/fs/UnixChannelFactory.java
index 21c69ae4f4c16130c5ff20308d2cac96158dd122..963e3777bdfc4228f932c0b04b825949344c0840 100644
--- a/src/solaris/classes/sun/nio/fs/UnixChannelFactory.java
+++ b/src/solaris/classes/sun/nio/fs/UnixChannelFactory.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2011, 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
diff --git a/src/solaris/classes/sun/nio/fs/UnixCopyFile.java b/src/solaris/classes/sun/nio/fs/UnixCopyFile.java
index 9a666c167eeb6b777f0786e5d50f381c8b2287b9..08aa82211dd9c26d9cc7607123527592de4d4cac 100644
--- a/src/solaris/classes/sun/nio/fs/UnixCopyFile.java
+++ b/src/solaris/classes/sun/nio/fs/UnixCopyFile.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2011, 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
diff --git a/src/solaris/classes/sun/nio/fs/UnixFileAttributeViews.java b/src/solaris/classes/sun/nio/fs/UnixFileAttributeViews.java
index ad0a2a00d12597e6fc9466b9c5eaccb13b08d3dd..3716e3fdef793f40b2a3034e21bb570e0e9b371c 100644
--- a/src/solaris/classes/sun/nio/fs/UnixFileAttributeViews.java
+++ b/src/solaris/classes/sun/nio/fs/UnixFileAttributeViews.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2011, 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
diff --git a/src/solaris/classes/sun/nio/fs/UnixFileAttributes.java b/src/solaris/classes/sun/nio/fs/UnixFileAttributes.java
index 966712e0cf16a2233a4790d78decde9c44b4fe2b..a6b79953add8a6ecb0434738ae3140d8506b3e58 100644
--- a/src/solaris/classes/sun/nio/fs/UnixFileAttributes.java
+++ b/src/solaris/classes/sun/nio/fs/UnixFileAttributes.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2011, 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
diff --git a/src/solaris/classes/sun/nio/fs/UnixFileStore.java b/src/solaris/classes/sun/nio/fs/UnixFileStore.java
index 080c2c0c2fd62915e9ae5e71d4a82d5bf63bb72d..4299b2668d0be5bfbd9fb3d701a4fe146f545677 100644
--- a/src/solaris/classes/sun/nio/fs/UnixFileStore.java
+++ b/src/solaris/classes/sun/nio/fs/UnixFileStore.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2011, 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
diff --git a/src/solaris/classes/sun/nio/fs/UnixFileSystem.java b/src/solaris/classes/sun/nio/fs/UnixFileSystem.java
index 96c6e4a4cce9ff9994819e9995db88d76d64dbbb..28276e134ad125241a8e339832edf69cb969d2e6 100644
--- a/src/solaris/classes/sun/nio/fs/UnixFileSystem.java
+++ b/src/solaris/classes/sun/nio/fs/UnixFileSystem.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2011, 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
diff --git a/src/solaris/classes/sun/nio/fs/UnixFileSystemProvider.java b/src/solaris/classes/sun/nio/fs/UnixFileSystemProvider.java
index 8ec672a306bbca65911ae715730de5aa6effeff5..0c14ef02e7e439dbbd144e2261911dd6ae0ba3b1 100644
--- a/src/solaris/classes/sun/nio/fs/UnixFileSystemProvider.java
+++ b/src/solaris/classes/sun/nio/fs/UnixFileSystemProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2011, 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
@@ -105,20 +105,6 @@ public abstract class UnixFileSystemProvider
return (UnixPath)obj;
}
- boolean followLinks(LinkOption... options) {
- boolean followLinks = true;
- for (LinkOption option: options) {
- if (option == LinkOption.NOFOLLOW_LINKS) {
- followLinks = false;
- continue;
- }
- if (option == null)
- throw new NullPointerException();
- throw new AssertionError("Should not get here");
- }
- return followLinks;
- }
-
@Override
@SuppressWarnings("unchecked")
public V getFileAttributeView(Path obj,
@@ -126,7 +112,7 @@ public abstract class UnixFileSystemProvider
LinkOption... options)
{
UnixPath file = UnixPath.toUnixPath(obj);
- boolean followLinks = followLinks(options);
+ boolean followLinks = Util.followLinks(options);
if (type == BasicFileAttributeView.class)
return (V) UnixFileAttributeViews.createBasicView(file, followLinks);
if (type == PosixFileAttributeView.class)
@@ -163,7 +149,7 @@ public abstract class UnixFileSystemProvider
LinkOption... options)
{
UnixPath file = UnixPath.toUnixPath(obj);
- boolean followLinks = followLinks(options);
+ boolean followLinks = Util.followLinks(options);
if (name.equals("basic"))
return UnixFileAttributeViews.createBasicView(file, followLinks);
if (name.equals("posix"))
diff --git a/src/solaris/classes/sun/nio/fs/UnixPath.java b/src/solaris/classes/sun/nio/fs/UnixPath.java
index b392b56b7e92c2c3839baec5c7184548ab4e5255..30c4dfe6501f7064cb1b8f49f7fed0ee7f91f585 100644
--- a/src/solaris/classes/sun/nio/fs/UnixPath.java
+++ b/src/solaris/classes/sun/nio/fs/UnixPath.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2011, 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
@@ -819,13 +819,13 @@ class UnixPath
}
@Override
- public Path toRealPath(boolean resolveLinks) throws IOException {
+ public Path toRealPath(LinkOption... options) throws IOException {
checkRead();
UnixPath absolute = toAbsolutePath();
- // if resolveLinks is true then use realpath
- if (resolveLinks) {
+ // if resolving links then use realpath
+ if (Util.followLinks(options)) {
try {
byte[] rp = realpath(absolute);
return new UnixPath(getFileSystem(), rp);
@@ -834,7 +834,7 @@ class UnixPath
}
}
- // if resolveLinks is false then eliminate "." and also ".."
+ // if not resolving links then eliminate "." and also ".."
// where the previous element is not a link.
UnixPath result = fs.rootDirectory();
for (int i=0; i
+#include
+#endif
+
/* Take an array of string pairs (map of key->value) and a string (key).
* Examine each pair in the map to see if the first string (key) matches the
* string. If so, store the second string of the pair (value) in the value and
@@ -304,6 +309,36 @@ static int ParseLocale(int cat, char ** std_language, char ** std_script,
return 1;
}
+#ifdef JAVASE_EMBEDDED
+/* Determine the default embedded toolkit based on whether lib/xawt/
+ * exists in the JRE. This can still be overridden by -Dawt.toolkit=XXX
+ */
+static char* getEmbeddedToolkit() {
+ Dl_info dlinfo;
+ char buf[MAXPATHLEN];
+ int32_t len;
+ char *p;
+ struct stat statbuf;
+
+ /* Get address of this library and the directory containing it. */
+ dladdr((void *)getEmbeddedToolkit, &dlinfo);
+ realpath((char *)dlinfo.dli_fname, buf);
+ len = strlen(buf);
+ p = strrchr(buf, '/');
+ /* Default AWT Toolkit on Linux and Solaris is XAWT. */
+ strncpy(p, "/xawt/", MAXPATHLEN-len-1);
+ /* Check if it exists */
+ if (stat(buf, &statbuf) == -1 && errno == ENOENT) {
+ /* No - this is a reduced-headless-jre so use special HToolkit */
+ return "sun.awt.HToolkit";
+ }
+ else {
+ /* Yes - this is a headful JRE so fallback to SE defaults */
+ return NULL;
+ }
+}
+#endif
+
/* This function gets called very early, before VM_CALLS are setup.
* Do not use any of the VM_CALLS entries!!!
*/
@@ -328,7 +363,12 @@ GetJavaProperties(JNIEnv *env)
/* Java 2D properties */
sprops.graphics_env = "sun.awt.X11GraphicsEnvironment";
- sprops.awt_toolkit = NULL;
+
+#ifdef JAVASE_EMBEDDED
+ sprops.awt_toolkit = getEmbeddedToolkit();
+ if (sprops.awt_toolkit == NULL) // default as below
+#endif
+ sprops.awt_toolkit = "sun.awt.X11.XToolkit";
/* This is used only for debugging of font problems. */
v = getenv("JAVA2D_FONTPATH");
diff --git a/src/solaris/native/java/net/Inet6AddressImpl.c b/src/solaris/native/java/net/Inet6AddressImpl.c
index 835969d7761bf6c08209cbc82f4e16f4e44914c4..bb5bae7810459252e58d5c9b5a49758d5709e92b 100644
--- a/src/solaris/native/java/net/Inet6AddressImpl.c
+++ b/src/solaris/native/java/net/Inet6AddressImpl.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2011, 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
diff --git a/src/solaris/native/java/net/NetworkInterface.c b/src/solaris/native/java/net/NetworkInterface.c
index ba1c3c7aa8e81ec4a93d887c4312d486df693175..0f987ff676433e8733374ee0c5dab059ab219779 100644
--- a/src/solaris/native/java/net/NetworkInterface.c
+++ b/src/solaris/native/java/net/NetworkInterface.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2011, 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
diff --git a/src/solaris/native/java/net/PlainDatagramSocketImpl.c b/src/solaris/native/java/net/PlainDatagramSocketImpl.c
index 0eb2a9be890f44c4a0d0702e78db94602394100e..7a1edc3a99a75cfc30dbe72b7e7bcdc76774de37 100644
--- a/src/solaris/native/java/net/PlainDatagramSocketImpl.c
+++ b/src/solaris/native/java/net/PlainDatagramSocketImpl.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2011, 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
diff --git a/src/solaris/native/java/net/PlainSocketImpl.c b/src/solaris/native/java/net/PlainSocketImpl.c
index 9aca806096228c368e20077bf4e5201b59cb5051..64b6e3c07fd6cad6b78898cc80781c724f0a56d8 100644
--- a/src/solaris/native/java/net/PlainSocketImpl.c
+++ b/src/solaris/native/java/net/PlainSocketImpl.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2011, 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
diff --git a/src/solaris/native/java/net/linux_close.c b/src/solaris/native/java/net/linux_close.c
index 1385519ef6065cd2b8c29c895805f88694cc2739..5665e85e09c45f8e52b49c32a4f5d34a82463239 100644
--- a/src/solaris/native/java/net/linux_close.c
+++ b/src/solaris/native/java/net/linux_close.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2011, 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
diff --git a/src/solaris/native/java/net/net_util_md.c b/src/solaris/native/java/net/net_util_md.c
index 8e035b368f145eae891f13bd4eaa63c0623acd2e..25b58f67c2a4d80f288b7470feeba56f9bb4d8a2 100644
--- a/src/solaris/native/java/net/net_util_md.c
+++ b/src/solaris/native/java/net/net_util_md.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2011, 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
diff --git a/src/solaris/native/sun/awt/awt_DrawingSurface.c b/src/solaris/native/sun/awt/awt_DrawingSurface.c
index f84c08edf66c393eba1a00b05bedf571725d10af..21cc862dcae616e4b2ecaf0f830736a82c861803 100644
--- a/src/solaris/native/sun/awt/awt_DrawingSurface.c
+++ b/src/solaris/native/sun/awt/awt_DrawingSurface.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2011, 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
diff --git a/src/solaris/native/sun/awt/awt_GraphicsEnv.c b/src/solaris/native/sun/awt/awt_GraphicsEnv.c
index b548df4bf5d577399adbb1dfdb66c06d09e1118f..301df87f8c901c52e820ddf8c5e3f4e14a88e2c3 100644
--- a/src/solaris/native/sun/awt/awt_GraphicsEnv.c
+++ b/src/solaris/native/sun/awt/awt_GraphicsEnv.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2011, 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
diff --git a/src/solaris/native/sun/awt/awt_Robot.c b/src/solaris/native/sun/awt/awt_Robot.c
index c3384b2eb1a3a5461bac73c2cebd1f84c3105e39..38ad27863667f4e7fe49f8f702470dc36500f4ff 100644
--- a/src/solaris/native/sun/awt/awt_Robot.c
+++ b/src/solaris/native/sun/awt/awt_Robot.c
@@ -48,12 +48,28 @@
#ifdef __linux__
#include
#endif
+#include
extern struct X11GraphicsConfigIDs x11GraphicsConfigIDs;
static jint * masks;
static jint num_buttons;
+static unsigned int s_robotInstanceCounter = 0;
+
+static void* xcompositeLibHandle = NULL;
+static Bool xcompositeExtAvailable = False;
+static Bool xcompositeExtTested = False;
+
+typedef Status (*T_XCompositeQueryVersion)(Display *dpy, int *major_versionp, int *minor_versionp);
+typedef Window (*T_XCompositeGetOverlayWindow)(Display *dpy, Window window);
+typedef void (*T_XCompositeReleaseOverlayWindow)(Display *dpy, Window window);
+
+static T_XCompositeQueryVersion XCompositeQueryVersion = NULL;
+static T_XCompositeGetOverlayWindow XCompositeGetOverlayWindow = NULL;
+static T_XCompositeReleaseOverlayWindow XCompositeReleaseOverlayWindow = NULL;
+
+
static int32_t isXTestAvailable() {
int32_t major_opcode, first_event, first_error;
int32_t event_basep, error_basep, majorp, minorp;
@@ -194,8 +210,80 @@ Java_sun_awt_X11_XRobotPeer_setup (JNIEnv * env, jclass cls, jint numberOfButton
}
AWT_UNLOCK();
+
+ s_robotInstanceCounter++;
}
+JNIEXPORT void JNICALL
+Java_sun_awt_X11_XRobotPeer__1dispose (JNIEnv * env, jclass cls)
+{
+ if (--s_robotInstanceCounter) {
+ return;
+ }
+
+ // This is the last instance of the XRobotPeer being released
+
+ if (xcompositeExtTested && xcompositeExtAvailable && xcompositeLibHandle) {
+ // The lib is loaded in IsXCompositeAvailable(). Unload under AWT_LOCK
+ // so that the shutdown function of the lib behaves correctly.
+ AWT_LOCK();
+ dlclose(xcompositeLibHandle);
+ AWT_UNLOCK();
+ }
+
+ xcompositeExtTested = False;
+ xcompositeExtAvailable = False;
+ xcompositeLibHandle = NULL;
+}
+
+/*
+ * Returns True only if XCOMPOSITE is of version 0.3 or higher.
+ * The functions that we need are available since that version.
+ *
+ * Must be invoked under AWT_LOCK.
+ *
+ * Leaves the library loaded if the version is correct.
+ */
+static Bool IsXCompositeAvailable()
+{
+ if (!xcompositeExtTested) {
+ int opcode, eventb, errorb;
+
+ if (XQueryExtension(awt_display, "Composite", &opcode, &eventb, &errorb)) {
+ xcompositeLibHandle = dlopen("libXcomposite.so.1", RTLD_LAZY | RTLD_GLOBAL);
+#ifndef __linux__ /* SOLARIS */
+ if (xcompositeLibHandle == NULL) {
+ xcompositeLibHandle = dlopen("/usr/sfw/lib/libXcomposite.so.1",
+ RTLD_LAZY | RTLD_GLOBAL);
+ }
+#endif
+
+ if (xcompositeLibHandle) {
+ int major, minor;
+ XCompositeQueryVersion = (T_XCompositeQueryVersion)dlsym(xcompositeLibHandle, "XCompositeQueryVersion");
+
+ if (XCompositeQueryVersion && XCompositeQueryVersion(awt_display, &major, &minor)) {
+ if (major >= 0 && minor >= 3) {
+ XCompositeGetOverlayWindow = (T_XCompositeGetOverlayWindow)dlsym(xcompositeLibHandle, "XCompositeGetOverlayWindow");
+ XCompositeReleaseOverlayWindow = (T_XCompositeReleaseOverlayWindow)dlsym(xcompositeLibHandle, "XCompositeReleaseOverlayWindow");
+
+ if (XCompositeGetOverlayWindow && XCompositeReleaseOverlayWindow) {
+ xcompositeExtAvailable = True;
+ }
+ }
+ }
+
+ if (!xcompositeExtAvailable) {
+ dlclose(xcompositeLibHandle);
+ } /* else the lib is unloaded in _dispose() */
+ }
+ }
+
+ xcompositeExtTested = True;
+ }
+
+ return xcompositeExtAvailable;
+}
JNIEXPORT void JNICALL
Java_sun_awt_X11_XRobotPeer_getRGBPixelsImpl( JNIEnv *env,
@@ -211,7 +299,7 @@ Java_sun_awt_X11_XRobotPeer_getRGBPixelsImpl( JNIEnv *env,
jint *ary; /* Array of jints for sending pixel values back
* to parent process.
*/
- Window rootWindow;
+ Window window;
AwtGraphicsConfigDataPtr adata;
DTRACE_PRINTLN6("RobotPeer: getRGBPixelsImpl(%lx, %d, %d, %d, %d, %x)", xgc, x, y, width, height, pixelArray);
@@ -228,14 +316,24 @@ Java_sun_awt_X11_XRobotPeer_getRGBPixelsImpl( JNIEnv *env,
adata = (AwtGraphicsConfigDataPtr) JNU_GetLongFieldAsPtr(env, xgc, x11GraphicsConfigIDs.aData);
DASSERT(adata != NULL);
- rootWindow = XRootWindow(awt_display, adata->awt_visInfo.screen);
- image = getWindowImage(awt_display, rootWindow, x, y, width, height);
+ window = XRootWindow(awt_display, adata->awt_visInfo.screen);
+
+ if (IsXCompositeAvailable()) {
+ // Use 'composite overlay window' instead of the root window.
+ // See 6903034 for details.
+ window = XCompositeGetOverlayWindow(awt_display, window);
+ }
+
+ image = getWindowImage(awt_display, window, x, y, width, height);
/* Array to use to crunch around the pixel values */
ary = (jint *) malloc(width * height * sizeof (jint));
if (ary == NULL) {
JNU_ThrowOutOfMemoryError(env, "OutOfMemoryError");
XDestroyImage(image);
+ if (IsXCompositeAvailable()) {
+ XCompositeReleaseOverlayWindow(awt_display, window);
+ }
AWT_UNLOCK();
return;
}
@@ -256,6 +354,9 @@ Java_sun_awt_X11_XRobotPeer_getRGBPixelsImpl( JNIEnv *env,
free(ary);
XDestroyImage(image);
+ if (IsXCompositeAvailable()) {
+ XCompositeReleaseOverlayWindow(awt_display, window);
+ }
AWT_UNLOCK();
}
diff --git a/src/solaris/native/sun/awt/fontpath.c b/src/solaris/native/sun/awt/fontpath.c
index c868f3cc0ea7007b686a0ebc7d581456cac25fca..68c352db16c61672b96aa45545b796865bc6f930 100644
--- a/src/solaris/native/sun/awt/fontpath.c
+++ b/src/solaris/native/sun/awt/fontpath.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2011, 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
diff --git a/src/solaris/native/sun/awt/gtk2_interface.c b/src/solaris/native/sun/awt/gtk2_interface.c
index 291edc3fb7e56446f6c2e7ec1b7a18ec4c8f2c48..3378dd00c2ded633cac72f74020a6f15b1bff72b 100644
--- a/src/solaris/native/sun/awt/gtk2_interface.c
+++ b/src/solaris/native/sun/awt/gtk2_interface.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2011, 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
diff --git a/src/solaris/native/sun/awt/gtk2_interface.h b/src/solaris/native/sun/awt/gtk2_interface.h
index addbc99d61cd187c19afcaf2e731a3d0e9349dbe..9a6e2ca0f8fb3ea90bcde8bd8501879de92e8a8d 100644
--- a/src/solaris/native/sun/awt/gtk2_interface.h
+++ b/src/solaris/native/sun/awt/gtk2_interface.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2011, 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
diff --git a/src/solaris/native/sun/awt/jawt.c b/src/solaris/native/sun/awt/jawt.c
index b682edaf45d7a8b5464f3a32b7f3024a00ad8d37..f6f8530cb9ac6f13bae0971bcace233d90ea3f6c 100644
--- a/src/solaris/native/sun/awt/jawt.c
+++ b/src/solaris/native/sun/awt/jawt.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2011, 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
@@ -33,6 +33,10 @@
*/
JNIEXPORT jboolean JNICALL JAWT_GetAWT(JNIEnv* env, JAWT* awt)
{
+#if defined(JAVASE_EMBEDDED) && defined(HEADLESS)
+ /* there are no AWT libs available at all */
+ return JNI_FALSE;
+#else
if (awt == NULL) {
return JNI_FALSE;
}
@@ -51,4 +55,5 @@ JNIEXPORT jboolean JNICALL JAWT_GetAWT(JNIEnv* env, JAWT* awt)
}
return JNI_TRUE;
+#endif
}
diff --git a/src/solaris/native/sun/java2d/loops/vis_IntArgbPre_Mask.c b/src/solaris/native/sun/java2d/loops/vis_IntArgbPre_Mask.c
index 2b142c46c4836f97b3f9d42a3dada57383c12d7b..3e9d09747e1cfbcb10c824131cb8da9e537a8750 100644
--- a/src/solaris/native/sun/java2d/loops/vis_IntArgbPre_Mask.c
+++ b/src/solaris/native/sun/java2d/loops/vis_IntArgbPre_Mask.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, 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
diff --git a/src/solaris/native/sun/java2d/loops/vis_SrcMaskFill.c b/src/solaris/native/sun/java2d/loops/vis_SrcMaskFill.c
index 170ab458d807abd716c24e7d05726aa92f5a974a..5d1710ce551627e1226be42476dc744805d28145 100644
--- a/src/solaris/native/sun/java2d/loops/vis_SrcMaskFill.c
+++ b/src/solaris/native/sun/java2d/loops/vis_SrcMaskFill.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, 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
diff --git a/src/solaris/native/sun/java2d/x11/X11SurfaceData.c b/src/solaris/native/sun/java2d/x11/X11SurfaceData.c
index db16fdc524abed1158bd23108c0d389feec19ae1..9b3e706143659ae046a2dee26bd9a0843bc5445a 100644
--- a/src/solaris/native/sun/java2d/x11/X11SurfaceData.c
+++ b/src/solaris/native/sun/java2d/x11/X11SurfaceData.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2011, 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
diff --git a/src/solaris/native/sun/java2d/x11/X11SurfaceData.h b/src/solaris/native/sun/java2d/x11/X11SurfaceData.h
index 104d7b1021adb8a1239ff784d6ed87ccf883a430..a082df9f518062978e26a3f7afbed65d5bcb7dc4 100644
--- a/src/solaris/native/sun/java2d/x11/X11SurfaceData.h
+++ b/src/solaris/native/sun/java2d/x11/X11SurfaceData.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2011, 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
diff --git a/src/solaris/native/sun/java2d/x11/XRBackendNative.c b/src/solaris/native/sun/java2d/x11/XRBackendNative.c
index eb1ee48ecef59c0d5e9f71d7bbe80202b1686b1a..969f5f589fef283c7825f85f336cfc20993fe9f2 100644
--- a/src/solaris/native/sun/java2d/x11/XRBackendNative.c
+++ b/src/solaris/native/sun/java2d/x11/XRBackendNative.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2011, 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
diff --git a/src/solaris/native/sun/java2d/x11/XRSurfaceData.c b/src/solaris/native/sun/java2d/x11/XRSurfaceData.c
index 620f90f7618c93ad105c2561912c264050a04a44..5de53ca7a04e4bfe05c26b4d382639aee37ef512 100644
--- a/src/solaris/native/sun/java2d/x11/XRSurfaceData.c
+++ b/src/solaris/native/sun/java2d/x11/XRSurfaceData.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2011, 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
diff --git a/src/solaris/native/sun/nio/ch/FileChannelImpl.c b/src/solaris/native/sun/nio/ch/FileChannelImpl.c
index 539013f0bd73986a6dcca5183f581a6aa941a5c8..808391433f6d1cec69b6f9b0ed952103764a8e4d 100644
--- a/src/solaris/native/sun/nio/ch/FileChannelImpl.c
+++ b/src/solaris/native/sun/nio/ch/FileChannelImpl.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2011, 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
diff --git a/src/solaris/native/sun/nio/ch/Net.c b/src/solaris/native/sun/nio/ch/Net.c
index 9f9b4669a8eb82611e9adce4ad4e42ddec030e76..def98591f8a86b98263f60748ee7ba31bfb61cc1 100644
--- a/src/solaris/native/sun/nio/ch/Net.c
+++ b/src/solaris/native/sun/nio/ch/Net.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2011, 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
diff --git a/src/solaris/native/sun/nio/fs/UnixNativeDispatcher.c b/src/solaris/native/sun/nio/fs/UnixNativeDispatcher.c
index d01f09e3c647117595017ce52541e9c1b18610c2..ba22f4175569634911c9fb5406df1ced342c426a 100644
--- a/src/solaris/native/sun/nio/fs/UnixNativeDispatcher.c
+++ b/src/solaris/native/sun/nio/fs/UnixNativeDispatcher.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2011, 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
diff --git a/src/solaris/native/sun/xawt/XToolkit.c b/src/solaris/native/sun/xawt/XToolkit.c
index 4ea63143c701d91f1b8952f062e0d0e9a18de687..69620ffc1e641c1245ca2ea8cb9a846cd9ffcbc3 100644
--- a/src/solaris/native/sun/xawt/XToolkit.c
+++ b/src/solaris/native/sun/xawt/XToolkit.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2011, 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
@@ -110,6 +110,21 @@ Java_sun_awt_X11_XToolkit_initIDs
awt_ModLockIsShiftLock = (*env)->GetStaticIntField(env, clazz, fid) != 0 ? True : False;
}
+/*
+ * Class: sun_awt_X11_XToolkit
+ * Method: getTrayIconDisplayTimeout
+ * Signature: ()J
+ */
+JNIEXPORT jlong JNICALL Java_sun_awt_X11_XToolkit_getTrayIconDisplayTimeout
+ (JNIEnv *env, jclass clazz)
+{
+#ifndef JAVASE_EMBEDDED
+ return (jlong) 2000;
+#else
+ return (jlong) 10000;
+#endif
+}
+
/*
* Class: sun_awt_X11_XToolkit
* Method: getDefaultXColormap
@@ -340,15 +355,34 @@ static uint32_t get_poll_timeout(jlong nextTaskTime);
#define AWT_READPIPE (awt_pipe_fds[0])
#define AWT_WRITEPIPE (awt_pipe_fds[1])
-#define DEF_AWT_MAX_POLL_TIMEOUT ((uint32_t)500) /* milliseconds */
+#ifdef JAVASE_EMBEDDED
+ #define DEF_AWT_MAX_POLL_TIMEOUT ((uint32_t)4000000000) /* milliseconds */
+#else
+ #define DEF_AWT_MAX_POLL_TIMEOUT ((uint32_t)500) /* milliseconds */
+#endif
+
#define DEF_AWT_FLUSH_TIMEOUT ((uint32_t)100) /* milliseconds */
#define AWT_MIN_POLL_TIMEOUT ((uint32_t)0) /* milliseconds */
#define TIMEOUT_TIMEDOUT 0
#define TIMEOUT_EVENTS 1
+/* awt_poll_alg - AWT Poll Events Aging Algorithms */
+#define AWT_POLL_FALSE 1
+#define AWT_POLL_AGING_SLOW 2
+#define AWT_POLL_AGING_FAST 3
+
+#define AWT_POLL_THRESHOLD 1000 // msec, Block if delay is larger
+#define AWT_POLL_BLOCK -1 // cause poll() block
+
// Static fields
+#ifdef JAVASE_EMBEDDED
+ static int awt_poll_alg = AWT_POLL_AGING_FAST;
+#else
+ static int awt_poll_alg = AWT_POLL_AGING_SLOW;
+#endif
+
static uint32_t AWT_FLUSH_TIMEOUT = DEF_AWT_FLUSH_TIMEOUT; /* milliseconds */
static uint32_t AWT_MAX_POLL_TIMEOUT = DEF_AWT_MAX_POLL_TIMEOUT; /* milliseconds */
static pthread_t awt_MainThread = 0;
@@ -417,6 +451,7 @@ awt_pipe_init() {
*/
static void readEnv() {
char * value;
+ int tmp_poll_alg;
static Boolean env_read = False;
if (env_read) return;
@@ -451,6 +486,23 @@ static void readEnv() {
if (static_poll_timeout != 0) {
curPollTimeout = static_poll_timeout;
}
+
+ // non-blocking poll()
+ value = getenv("_AWT_POLL_ALG");
+ if (value != NULL) {
+ tmp_poll_alg = atoi(value);
+ switch(tmp_poll_alg) {
+ case AWT_POLL_FALSE:
+ case AWT_POLL_AGING_SLOW:
+ case AWT_POLL_AGING_FAST:
+ awt_poll_alg = tmp_poll_alg;
+ break;
+ default:
+ PRINT("Unknown value of _AWT_POLL_ALG, assuming Slow Aging Algorithm by default");
+ awt_poll_alg = AWT_POLL_AGING_SLOW;
+ break;
+ }
+ }
}
/**
@@ -478,14 +530,29 @@ static void update_poll_timeout(int timeout_control) {
if (static_poll_timeout != 0) return;
// Update it otherwise
- if (timeout_control == TIMEOUT_TIMEDOUT) {
- /* add 1/4 (plus 1, in case the division truncates to 0) */
- curPollTimeout += ((curPollTimeout>>2) + 1);
- curPollTimeout = min(AWT_MAX_POLL_TIMEOUT, curPollTimeout);
- } else if (timeout_control == TIMEOUT_EVENTS) {
- /* subtract 1/4 (plus 1, in case the division truncates to 0) */
- curPollTimeout -= ((curPollTimeout>>2) + 1);
- curPollTimeout = max(AWT_MIN_POLL_TIMEOUT, curPollTimeout);
+
+ switch(awt_poll_alg) {
+ case AWT_POLL_AGING_SLOW:
+ if (timeout_control == TIMEOUT_TIMEDOUT) {
+ /* add 1/4 (plus 1, in case the division truncates to 0) */
+ curPollTimeout += ((curPollTimeout>>2) + 1);
+ curPollTimeout = min(AWT_MAX_POLL_TIMEOUT, curPollTimeout);
+ } else if (timeout_control == TIMEOUT_EVENTS) {
+ /* subtract 1/4 (plus 1, in case the division truncates to 0) */
+ curPollTimeout -= ((curPollTimeout>>2) + 1);
+ curPollTimeout = max(AWT_MIN_POLL_TIMEOUT, curPollTimeout);
+ }
+ break;
+ case AWT_POLL_AGING_FAST:
+ if (timeout_control == TIMEOUT_TIMEDOUT) {
+ curPollTimeout += ((curPollTimeout>>2) + 1);
+ curPollTimeout = min(AWT_MAX_POLL_TIMEOUT, curPollTimeout);
+ if((int)curPollTimeout > AWT_POLL_THRESHOLD || (int)curPollTimeout == AWT_POLL_BLOCK)
+ curPollTimeout = AWT_POLL_BLOCK;
+ } else if (timeout_control == TIMEOUT_EVENTS) {
+ curPollTimeout = max(AWT_MIN_POLL_TIMEOUT, 1);
+ }
+ break;
}
}
@@ -497,16 +564,37 @@ static void update_poll_timeout(int timeout_control) {
*/
static uint32_t get_poll_timeout(jlong nextTaskTime)
{
+ uint32_t ret_timeout;
+ uint32_t timeout;
+ uint32_t taskTimeout;
+ uint32_t flushTimeout;
+
jlong curTime = awtJNI_TimeMillis();
- uint32_t timeout = curPollTimeout;
- uint32_t taskTimeout = (nextTaskTime == -1) ? AWT_MAX_POLL_TIMEOUT : (uint32_t)max(0, (int32_t)(nextTaskTime - curTime));
- uint32_t flushTimeout = (awt_next_flush_time > 0) ? (uint32_t)max(0, (int32_t)(awt_next_flush_time - curTime)) : AWT_MAX_POLL_TIMEOUT;
+ timeout = curPollTimeout;
+ switch(awt_poll_alg) {
+ case AWT_POLL_AGING_SLOW:
+ case AWT_POLL_AGING_FAST:
+ taskTimeout = (nextTaskTime == -1) ? AWT_MAX_POLL_TIMEOUT : (uint32_t)max(0, (int32_t)(nextTaskTime - curTime));
+ flushTimeout = (awt_next_flush_time > 0) ? (uint32_t)max(0, (int32_t)(awt_next_flush_time - curTime)) : AWT_MAX_POLL_TIMEOUT;
+
+ PRINT2("to: %d, ft: %d, to: %d, tt: %d, mil: %d\n", taskTimeout, flushTimeout, timeout, (int)nextTaskTime, (int)curTime);
+
+ // Adjust timeout to flush_time and task_time
+ ret_timeout = min(flushTimeout, min(taskTimeout, timeout));
+ if((int)curPollTimeout == AWT_POLL_BLOCK)
+ ret_timeout = AWT_POLL_BLOCK;
+ break;
+
+ case AWT_POLL_FALSE:
+ ret_timeout = (nextTaskTime > curTime) ?
+ (nextTaskTime - curTime) :
+ ((nextTaskTime == -1) ? -1 : 0);
+ break;
+ }
- PRINT2("to: %d, ft: %d, to: %d, tt: %d, mil: %d\n", taskTimeout, flushTimeout, timeout, (int)nextTaskTime, (int)curTime);
+ return ret_timeout;
- // Adjust timeout to flush_time and task_time
- return min(flushTimeout, min(taskTimeout, timeout));
-} /* awt_get_poll_timeout() */
+} /* get_poll_timeout() */
/*
* Waits for X/Xt events to appear on the pipe. Returns only when
@@ -598,6 +686,8 @@ performPoll(JNIEnv *env, jlong nextTaskTime) {
if (result == 0) {
/* poll() timed out -- update timeout value */
update_poll_timeout(TIMEOUT_TIMEDOUT);
+ PRINT2("%s(): TIMEOUT_TIMEDOUT curPollTimeout = %d \n",
+ performPoll, curPollTimeout);
}
if (pollFds[1].revents) {
int count;
@@ -606,10 +696,14 @@ performPoll(JNIEnv *env, jlong nextTaskTime) {
do {
count = read(AWT_READPIPE, read_buf, AWT_POLL_BUFSIZE );
} while (count == AWT_POLL_BUFSIZE );
+ PRINT2("%s(): data on the AWT pipe: curPollTimeout = %d \n",
+ performPoll, curPollTimeout);
}
if (pollFds[0].revents) {
// Events in X pipe
update_poll_timeout(TIMEOUT_EVENTS);
+ PRINT2("%s(): TIMEOUT_EVENTS curPollTimeout = %ld \n",
+ performPoll, curPollTimeout);
}
return;
diff --git a/src/solaris/native/sun/xawt/awt_Desktop.c b/src/solaris/native/sun/xawt/awt_Desktop.c
index 69b9207bc99092cd49a372d4144ffc31e94ebb45..77f38f88e07ab5710eb19465c05e9965474a83fc 100644
--- a/src/solaris/native/sun/xawt/awt_Desktop.c
+++ b/src/solaris/native/sun/xawt/awt_Desktop.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2011, 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
diff --git a/src/windows/bin/java_md.c b/src/windows/bin/java_md.c
index dfa50ac8af8d63a84e418df0ee7b610bb95cbf5d..b8665f3fefbfbe0aaa2ba1073ca82713de59d4ea 100644
--- a/src/windows/bin/java_md.c
+++ b/src/windows/bin/java_md.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2011, 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
diff --git a/src/windows/classes/java/lang/ProcessEnvironment.java b/src/windows/classes/java/lang/ProcessEnvironment.java
index c5e4c130f26a56c989c8472c6865a2cd41d3f5e2..b5a4383019e185a81c478614beede6ea62e00089 100644
--- a/src/windows/classes/java/lang/ProcessEnvironment.java
+++ b/src/windows/classes/java/lang/ProcessEnvironment.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, 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
diff --git a/src/windows/classes/java/net/PlainSocketImpl.java b/src/windows/classes/java/net/PlainSocketImpl.java
index cc25c39dc7291a76e0e750a0cc3e13077d27c2af..ea11fa609d8e4a19992c8e3f5372c6c15713cbcd 100644
--- a/src/windows/classes/java/net/PlainSocketImpl.java
+++ b/src/windows/classes/java/net/PlainSocketImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2007, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2011, 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
diff --git a/src/windows/classes/java/net/TwoStacksPlainDatagramSocketImpl.java b/src/windows/classes/java/net/TwoStacksPlainDatagramSocketImpl.java
index 5590523b6aeda1573fc3583b7a22537a90bb4f6a..d8e4ec54c20f9f93d8aa224853045aca2c9bc6f1 100644
--- a/src/windows/classes/java/net/TwoStacksPlainDatagramSocketImpl.java
+++ b/src/windows/classes/java/net/TwoStacksPlainDatagramSocketImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2011, 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
diff --git a/src/windows/classes/sun/awt/Win32FontManager.java b/src/windows/classes/sun/awt/Win32FontManager.java
index 40ed72afbcb25c6a478abf9f79387b91fc6af66d..c7315c21eb686371b8a84b889fe4713384ef81a8 100644
--- a/src/windows/classes/sun/awt/Win32FontManager.java
+++ b/src/windows/classes/sun/awt/Win32FontManager.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2011, 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
diff --git a/src/windows/classes/sun/awt/windows/WPathGraphics.java b/src/windows/classes/sun/awt/windows/WPathGraphics.java
index 180341f20f3db616bcaba3633af4644eb6c79769..fff1765c4649eab005e2970ded85703995f22d68 100644
--- a/src/windows/classes/sun/awt/windows/WPathGraphics.java
+++ b/src/windows/classes/sun/awt/windows/WPathGraphics.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2011, 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
diff --git a/src/windows/classes/sun/awt/windows/WPrinterJob.java b/src/windows/classes/sun/awt/windows/WPrinterJob.java
index cf629bb0ae80c4b2be9323ea0fb5b4f0d57078c8..250d8c722034ec872a36ce61d5a6a290497aedcd 100644
--- a/src/windows/classes/sun/awt/windows/WPrinterJob.java
+++ b/src/windows/classes/sun/awt/windows/WPrinterJob.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2011, 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
diff --git a/src/windows/classes/sun/awt/windows/WToolkit.java b/src/windows/classes/sun/awt/windows/WToolkit.java
index b994c23a1e5a93b45411a0e34055025ff0be10f1..f87f5859bf720a7cefe2a19f5337f862e42ee6d8 100644
--- a/src/windows/classes/sun/awt/windows/WToolkit.java
+++ b/src/windows/classes/sun/awt/windows/WToolkit.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2011, 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
@@ -630,10 +630,10 @@ public class WToolkit extends SunToolkit implements Runnable {
public PrintJob getPrintJob(Frame frame, String doctitle,
JobAttributes jobAttributes,
- PageAttributes pageAttributes) {
-
- if (GraphicsEnvironment.isHeadless()) {
- throw new IllegalArgumentException();
+ PageAttributes pageAttributes)
+ {
+ if (frame == null) {
+ throw new NullPointerException("frame must not be null");
}
PrintJob2D printJob = new PrintJob2D(frame, doctitle,
diff --git a/src/windows/classes/sun/awt/windows/fontconfig.properties b/src/windows/classes/sun/awt/windows/fontconfig.properties
index a7f59e52b8d43b8e068aaf7458bbd852c1225231..2a43e6e90d0e388cd4967abd5194aa250792cf15 100644
--- a/src/windows/classes/sun/awt/windows/fontconfig.properties
+++ b/src/windows/classes/sun/awt/windows/fontconfig.properties
@@ -102,28 +102,28 @@ sansserif.bolditalic.korean=Gulim
monospaced.plain.alphabetic=Courier New
monospaced.plain.chinese-ms950=MingLiU
monospaced.plain.chinese-ms950-extb=MingLiU-ExtB
-monospaced.plain.hebrew=David
+monospaced.plain.hebrew=Courier New
monospaced.plain.japanese=MS Gothic
monospaced.plain.korean=GulimChe
monospaced.bold.alphabetic=Courier New Bold
monospaced.bold.chinese-ms950=PMingLiU
monospaced.bold.chinese-ms950-extb=PMingLiU-ExtB
-monospaced.bold.hebrew=David Bold
+monospaced.bold.hebrew=Courier New Bold
monospaced.bold.japanese=MS Gothic
monospaced.bold.korean=GulimChe
monospaced.italic.alphabetic=Courier New Italic
monospaced.italic.chinese-ms950=PMingLiU
monospaced.italic.chinese-ms950-extb=PMingLiU-ExtB
-monospaced.italic.hebrew=David
+monospaced.italic.hebrew=Courier New
monospaced.italic.japanese=MS Gothic
monospaced.italic.korean=GulimChe
monospaced.bolditalic.alphabetic=Courier New Bold Italic
monospaced.bolditalic.chinese-ms950=PMingLiU
monospaced.bolditalic.chinese-ms950-extb=PMingLiU-ExtB
-monospaced.bolditalic.hebrew=David Bold
+monospaced.bolditalic.hebrew=Courier New Bold
monospaced.bolditalic.japanese=MS Gothic
monospaced.bolditalic.korean=GulimChe
diff --git a/src/windows/classes/sun/java2d/d3d/D3DSurfaceData.java b/src/windows/classes/sun/java2d/d3d/D3DSurfaceData.java
index bc7dfd8631a4bd9e94a36f6dfe166ea4f797d408..50a51a6f94b2d600a7f54b5520e02e0e66226b0e 100644
--- a/src/windows/classes/sun/java2d/d3d/D3DSurfaceData.java
+++ b/src/windows/classes/sun/java2d/d3d/D3DSurfaceData.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2007, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2010, 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
diff --git a/src/windows/classes/sun/java2d/opengl/WGLVolatileSurfaceManager.java b/src/windows/classes/sun/java2d/opengl/WGLVolatileSurfaceManager.java
index 7c4fde1b640f1545d9b18674d9ecba45dd308a29..0c3009c44db70f320f92358c6d533d640536a86d 100644
--- a/src/windows/classes/sun/java2d/opengl/WGLVolatileSurfaceManager.java
+++ b/src/windows/classes/sun/java2d/opengl/WGLVolatileSurfaceManager.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2004, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2010, 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
diff --git a/src/windows/classes/sun/net/www/protocol/http/ntlm/NTLMAuthentication.java b/src/windows/classes/sun/net/www/protocol/http/ntlm/NTLMAuthentication.java
index c4b20db6495695d830e040395db5671291e07016..8ca04d7fef7d83f9c77b01cdd5791fa8ce5496bf 100644
--- a/src/windows/classes/sun/net/www/protocol/http/ntlm/NTLMAuthentication.java
+++ b/src/windows/classes/sun/net/www/protocol/http/ntlm/NTLMAuthentication.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2011, 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
diff --git a/src/windows/classes/sun/nio/ch/PendingIoCache.java b/src/windows/classes/sun/nio/ch/PendingIoCache.java
index 7a4b1e3e31944f260af92b8c53a5076f645b2f74..a660ff097e34d020eec50c220be079f98a3b9a86 100644
--- a/src/windows/classes/sun/nio/ch/PendingIoCache.java
+++ b/src/windows/classes/sun/nio/ch/PendingIoCache.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2011, 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
diff --git a/src/windows/classes/sun/nio/ch/WindowsAsynchronousFileChannelImpl.java b/src/windows/classes/sun/nio/ch/WindowsAsynchronousFileChannelImpl.java
index 8240587592807a42f7920e3918610619c3a7b717..b144c96f81b5ed8b019f5d169eb3be9b20113c4c 100644
--- a/src/windows/classes/sun/nio/ch/WindowsAsynchronousFileChannelImpl.java
+++ b/src/windows/classes/sun/nio/ch/WindowsAsynchronousFileChannelImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2011, 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
diff --git a/src/windows/classes/sun/nio/ch/WindowsAsynchronousSocketChannelImpl.java b/src/windows/classes/sun/nio/ch/WindowsAsynchronousSocketChannelImpl.java
index 2cc9cf026af0c4c216e8fe46250d509004e1c59d..a55e7a01a9d5a80f27402010004b570dd898a5eb 100644
--- a/src/windows/classes/sun/nio/ch/WindowsAsynchronousSocketChannelImpl.java
+++ b/src/windows/classes/sun/nio/ch/WindowsAsynchronousSocketChannelImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2011, 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
diff --git a/src/windows/classes/sun/nio/fs/RegistryFileTypeDetector.java b/src/windows/classes/sun/nio/fs/RegistryFileTypeDetector.java
index 8c846c1c219580fd92767af983da0d31294e8290..e04cd7460391b677d38c35b68c286acca7220399 100644
--- a/src/windows/classes/sun/nio/fs/RegistryFileTypeDetector.java
+++ b/src/windows/classes/sun/nio/fs/RegistryFileTypeDetector.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2011, 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
diff --git a/src/windows/classes/sun/nio/fs/WindowsFileAttributeViews.java b/src/windows/classes/sun/nio/fs/WindowsFileAttributeViews.java
index 67e5be670e09049b9b4caf2527423195b75eba66..737bbd73e9844a04dc438ba57893f21b4ae6b308 100644
--- a/src/windows/classes/sun/nio/fs/WindowsFileAttributeViews.java
+++ b/src/windows/classes/sun/nio/fs/WindowsFileAttributeViews.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2011, 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
diff --git a/src/windows/classes/sun/nio/fs/WindowsFileCopy.java b/src/windows/classes/sun/nio/fs/WindowsFileCopy.java
index ed3421fb90e524e381684bd855fd9a0a270c5e04..a8ffba1c933070f9e4e15d7adc6e21420a3135b7 100644
--- a/src/windows/classes/sun/nio/fs/WindowsFileCopy.java
+++ b/src/windows/classes/sun/nio/fs/WindowsFileCopy.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2011, 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
diff --git a/src/windows/classes/sun/nio/fs/WindowsFileStore.java b/src/windows/classes/sun/nio/fs/WindowsFileStore.java
index 07eb73231ce13d86a0099268112b53ddf362a2d4..a18af6d10111de7572ceb901c28eab3cef2715dc 100644
--- a/src/windows/classes/sun/nio/fs/WindowsFileStore.java
+++ b/src/windows/classes/sun/nio/fs/WindowsFileStore.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2011, 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
diff --git a/src/windows/classes/sun/nio/fs/WindowsFileSystem.java b/src/windows/classes/sun/nio/fs/WindowsFileSystem.java
index 59891ec51d5bdf3ee2d202c66625046ee6f03db0..6dba2bc9394db6acb52a8195b391aeee73765a27 100644
--- a/src/windows/classes/sun/nio/fs/WindowsFileSystem.java
+++ b/src/windows/classes/sun/nio/fs/WindowsFileSystem.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2011, 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
diff --git a/src/windows/classes/sun/nio/fs/WindowsFileSystemProvider.java b/src/windows/classes/sun/nio/fs/WindowsFileSystemProvider.java
index 6d6a4db89b2286c38b0db6df09d1db8811b2c007..bff9e0a60dc0fc7874f43b36e38717ba48f7b8e2 100644
--- a/src/windows/classes/sun/nio/fs/WindowsFileSystemProvider.java
+++ b/src/windows/classes/sun/nio/fs/WindowsFileSystemProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -150,20 +150,6 @@ public class WindowsFileSystemProvider
}
}
- private boolean followLinks(LinkOption... options) {
- boolean followLinks = true;
- for (LinkOption option: options) {
- if (option == LinkOption.NOFOLLOW_LINKS) {
- followLinks = false;
- continue;
- }
- if (option == null)
- throw new NullPointerException();
- throw new AssertionError("Should not get here");
- }
- return followLinks;
- }
-
@Override
@SuppressWarnings("unchecked")
public V
@@ -172,7 +158,7 @@ public class WindowsFileSystemProvider
WindowsPath file = WindowsPath.toWindowsPath(obj);
if (view == null)
throw new NullPointerException();
- boolean followLinks = followLinks(options);
+ boolean followLinks = Util.followLinks(options);
if (view == BasicFileAttributeView.class)
return (V) WindowsFileAttributeViews.createBasicView(file, followLinks);
if (view == DosFileAttributeView.class)
@@ -209,7 +195,7 @@ public class WindowsFileSystemProvider
@Override
public DynamicFileAttributeView getFileAttributeView(Path obj, String name, LinkOption... options) {
WindowsPath file = WindowsPath.toWindowsPath(obj);
- boolean followLinks = followLinks(options);
+ boolean followLinks = Util.followLinks(options);
if (name.equals("basic"))
return WindowsFileAttributeViews.createBasicView(file, followLinks);
if (name.equals("dos"))
diff --git a/src/windows/classes/sun/nio/fs/WindowsPath.java b/src/windows/classes/sun/nio/fs/WindowsPath.java
index eb35de8167e554d3dbc649bf1c84395fd2497ff3..e84db2af23156104aeb1b710577dbdd47c4214ee 100644
--- a/src/windows/classes/sun/nio/fs/WindowsPath.java
+++ b/src/windows/classes/sun/nio/fs/WindowsPath.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2011, 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
@@ -831,9 +831,9 @@ class WindowsPath extends AbstractPath {
}
@Override
- public WindowsPath toRealPath(boolean resolveLinks) throws IOException {
+ public WindowsPath toRealPath(LinkOption... options) throws IOException {
checkRead();
- String rp = WindowsLinkSupport.getRealPath(this, resolveLinks);
+ String rp = WindowsLinkSupport.getRealPath(this, Util.followLinks(options));
return createFromNormalizedPath(getFileSystem(), rp);
}
diff --git a/src/windows/classes/sun/nio/fs/WindowsPathParser.java b/src/windows/classes/sun/nio/fs/WindowsPathParser.java
index e898fd55fd27bbe8d65baf5faf2f0e95ba4eccbe..f1158e5f7de714f941f81d49b660b05741f656bc 100644
--- a/src/windows/classes/sun/nio/fs/WindowsPathParser.java
+++ b/src/windows/classes/sun/nio/fs/WindowsPathParser.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2011, 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
diff --git a/src/windows/classes/sun/nio/fs/WindowsSecurityDescriptor.java b/src/windows/classes/sun/nio/fs/WindowsSecurityDescriptor.java
index 7d9464e0ce46bc27e56ef3ef4da62d071c90efec..fb432271cc68b0be6bcfc32a3209a999c90dec85 100644
--- a/src/windows/classes/sun/nio/fs/WindowsSecurityDescriptor.java
+++ b/src/windows/classes/sun/nio/fs/WindowsSecurityDescriptor.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2011, 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
diff --git a/src/windows/classes/sun/nio/fs/WindowsUserDefinedFileAttributeView.java b/src/windows/classes/sun/nio/fs/WindowsUserDefinedFileAttributeView.java
index 5ae901fe8cd8d44162dd71b92196f140f3f8d890..45f5d0644591a1e070f4e9973ad1523bc8c04904 100644
--- a/src/windows/classes/sun/nio/fs/WindowsUserDefinedFileAttributeView.java
+++ b/src/windows/classes/sun/nio/fs/WindowsUserDefinedFileAttributeView.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2011, 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
diff --git a/src/windows/classes/sun/nio/fs/WindowsWatchService.java b/src/windows/classes/sun/nio/fs/WindowsWatchService.java
index 53f2fa2af56bb49a83b599d63a77f50f70fd2304..d5ad78fee9b08000eb8e343e2423b1729e32fa01 100644
--- a/src/windows/classes/sun/nio/fs/WindowsWatchService.java
+++ b/src/windows/classes/sun/nio/fs/WindowsWatchService.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2011, 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
diff --git a/src/windows/classes/sun/print/Win32PrintService.java b/src/windows/classes/sun/print/Win32PrintService.java
index e9f1eb7df82bba6c9676f6f6527bd4a3bfa62851..bef2213e66492870ee6991e0d483679fbb0a4e60 100644
--- a/src/windows/classes/sun/print/Win32PrintService.java
+++ b/src/windows/classes/sun/print/Win32PrintService.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2011, 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
diff --git a/src/windows/demo/jvmti/hprof/hprof_md.c b/src/windows/demo/jvmti/hprof/hprof_md.c
index 03e77f635d5338ffbefd48e4ce3e8dee1957d540..073a946d2e46571d1711126879b39a248755a995 100644
--- a/src/windows/demo/jvmti/hprof/hprof_md.c
+++ b/src/windows/demo/jvmti/hprof/hprof_md.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
diff --git a/src/windows/native/com/sun/management/OperatingSystem_md.c b/src/windows/native/com/sun/management/OperatingSystem_md.c
index c8e72bf73a71fe07e1bb3943d389a93262765058..9422ee2dc86708d0755648246ff7b304ce39603d 100644
--- a/src/windows/native/com/sun/management/OperatingSystem_md.c
+++ b/src/windows/native/com/sun/management/OperatingSystem_md.c
@@ -30,6 +30,7 @@
#include "management.h"
#include "com_sun_management_OperatingSystem.h"
+#include
#include
#include
@@ -53,41 +54,12 @@ static jlong jlong_from(jint h, jint l) {
return result;
}
-// From psapi.h
-typedef struct _PROCESS_MEMORY_COUNTERS {
- DWORD cb;
- DWORD PageFaultCount;
- SIZE_T PeakWorkingSetSize;
- SIZE_T WorkingSetSize;
- SIZE_T QuotaPeakPagedPoolUsage;
- SIZE_T QuotaPagedPoolUsage;
- SIZE_T QuotaPeakNonPagedPoolUsage;
- SIZE_T QuotaNonPagedPoolUsage;
- SIZE_T PagefileUsage;
- SIZE_T PeakPagefileUsage;
-} PROCESS_MEMORY_COUNTERS;
-
-static HINSTANCE hInstPsapi = NULL;
-typedef BOOL (WINAPI *LPFNGETPROCESSMEMORYINFO)(HANDLE, PROCESS_MEMORY_COUNTERS*, DWORD);
-
-static jboolean is_nt = JNI_FALSE;
static HANDLE main_process;
JNIEXPORT void JNICALL
Java_com_sun_management_OperatingSystem_initialize
(JNIEnv *env, jclass cls)
{
- OSVERSIONINFO oi;
- oi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
- GetVersionEx(&oi);
- switch(oi.dwPlatformId) {
- case VER_PLATFORM_WIN32_WINDOWS: is_nt = JNI_FALSE; break;
- case VER_PLATFORM_WIN32_NT: is_nt = JNI_TRUE; break;
- default:
- throw_internal_error(env, "Unsupported Platform");
- return;
- }
-
main_process = GetCurrentProcess();
}
@@ -95,31 +67,12 @@ JNIEXPORT jlong JNICALL
Java_com_sun_management_OperatingSystem_getCommittedVirtualMemorySize0
(JNIEnv *env, jobject mbean)
{
-
- /*
- * In bytes. NT/2000/XP only - using GetProcessMemoryInfo from psapi.dll
- */
- static LPFNGETPROCESSMEMORYINFO lpfnGetProcessMemoryInfo = NULL;
- static volatile jboolean psapi_inited = JNI_FALSE;
PROCESS_MEMORY_COUNTERS pmc;
-
- if (!is_nt) return -1;
-
- if (!psapi_inited) {
- psapi_inited = JNI_TRUE;
- if ((hInstPsapi = LoadLibrary("PSAPI.DLL")) == NULL) return -1;
- if ((lpfnGetProcessMemoryInfo = (LPFNGETPROCESSMEMORYINFO)
- GetProcAddress( hInstPsapi, "GetProcessMemoryInfo")) == NULL) {
- FreeLibrary(hInstPsapi);
- return -1;
- }
+ if (GetProcessMemoryInfo(main_process, &pmc, sizeof(PROCESS_MEMORY_COUNTERS)) == 0) {
+ return (jlong)-1L;
+ } else {
+ return (jlong) pmc.PagefileUsage;
}
-
- if (lpfnGetProcessMemoryInfo == NULL) return -1;
-
- lpfnGetProcessMemoryInfo(main_process, &pmc,
- sizeof(PROCESS_MEMORY_COUNTERS));
- return (jlong) pmc.PagefileUsage;
}
JNIEXPORT jlong JNICALL
@@ -148,20 +101,15 @@ Java_com_sun_management_OperatingSystem_getProcessCpuTime
FILETIME process_creation_time, process_exit_time,
process_user_time, process_kernel_time;
- // Windows NT only
- if (is_nt) {
- // Using static variables declared above
- // Units are 100-ns intervals. Convert to ns.
- GetProcessTimes(main_process, &process_creation_time,
- &process_exit_time,
- &process_kernel_time, &process_user_time);
- return (jlong_from(process_user_time.dwHighDateTime,
- process_user_time.dwLowDateTime) +
- jlong_from(process_kernel_time.dwHighDateTime,
- process_kernel_time.dwLowDateTime)) * 100;
- } else {
- return -1;
- }
+ // Using static variables declared above
+ // Units are 100-ns intervals. Convert to ns.
+ GetProcessTimes(main_process, &process_creation_time,
+ &process_exit_time,
+ &process_kernel_time, &process_user_time);
+ return (jlong_from(process_user_time.dwHighDateTime,
+ process_user_time.dwLowDateTime) +
+ jlong_from(process_kernel_time.dwHighDateTime,
+ process_kernel_time.dwLowDateTime)) * 100;
}
JNIEXPORT jlong JNICALL
diff --git a/src/windows/native/java/io/WinNTFileSystem_md.c b/src/windows/native/java/io/WinNTFileSystem_md.c
index 566b697eb8f7065bbbf2da33ff6f39a055e201ab..7d978294367356ebf320e6463714438eb1adc2ee 100644
--- a/src/windows/native/java/io/WinNTFileSystem_md.c
+++ b/src/windows/native/java/io/WinNTFileSystem_md.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -23,9 +23,9 @@
* questions.
*/
-/* Access APIs for Win2K and above */
+/* Access APIs for WinXP and above */
#ifndef _WIN32_WINNT
-#define _WIN32_WINNT 0x0500
+#define _WIN32_WINNT 0x0501
#endif
#include
@@ -60,13 +60,17 @@ static GetFinalPathNameByHandleProc GetFinalPathNameByHandle_func;
JNIEXPORT void JNICALL
Java_java_io_WinNTFileSystem_initIDs(JNIEnv *env, jclass cls)
{
- HANDLE handle;
+ HMODULE handle;
jclass fileClass = (*env)->FindClass(env, "java/io/File");
if (!fileClass) return;
ids.path =
(*env)->GetFieldID(env, fileClass, "path", "Ljava/lang/String;");
- handle = LoadLibrary("kernel32");
- if (handle != NULL) {
+
+ // GetFinalPathNameByHandle requires Windows Vista or newer
+ if (GetModuleHandleExW((GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS |
+ GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT),
+ (LPCWSTR)&CreateFileW, &handle) != 0)
+ {
GetFinalPathNameByHandle_func = (GetFinalPathNameByHandleProc)
GetProcAddress(handle, "GetFinalPathNameByHandleW");
}
@@ -824,8 +828,6 @@ Java_java_io_WinNTFileSystem_getDriveDirectory(JNIEnv *env, jobject this,
return ret;
}
-typedef BOOL (WINAPI* GetVolumePathNameProc) (LPCWSTR, LPWSTR, DWORD);
-
JNIEXPORT jlong JNICALL
Java_java_io_WinNTFileSystem_getSpace0(JNIEnv *env, jobject this,
jobject file, jint t)
@@ -834,14 +836,7 @@ Java_java_io_WinNTFileSystem_getSpace0(JNIEnv *env, jobject this,
jlong rv = 0L;
WCHAR *pathbuf = fileToNTPath(env, file, ids.path);
- HMODULE h = LoadLibrary("kernel32");
- GetVolumePathNameProc getVolumePathNameW = NULL;
- if (h) {
- getVolumePathNameW
- = (GetVolumePathNameProc)GetProcAddress(h, "GetVolumePathNameW");
- }
-
- if (getVolumePathNameW(pathbuf, volname, MAX_PATH_LENGTH)) {
+ if (GetVolumePathNameW(pathbuf, volname, MAX_PATH_LENGTH)) {
ULARGE_INTEGER totalSpace, freeSpace, usableSpace;
if (GetDiskFreeSpaceExW(volname, &usableSpace, &totalSpace, &freeSpace)) {
switch(t) {
@@ -860,9 +855,6 @@ Java_java_io_WinNTFileSystem_getSpace0(JNIEnv *env, jobject this,
}
}
- if (h) {
- FreeLibrary(h);
- }
free(pathbuf);
return rv;
}
diff --git a/src/windows/native/java/io/canonicalize_md.c b/src/windows/native/java/io/canonicalize_md.c
index e0eadb6b82f008b6e14782ae2d09cf38d0da3526..a7e3ccac41708bcfc95440e960ca5bd231192299 100644
--- a/src/windows/native/java/io/canonicalize_md.c
+++ b/src/windows/native/java/io/canonicalize_md.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2011, 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
diff --git a/src/windows/native/java/io/io_util_md.c b/src/windows/native/java/io/io_util_md.c
index 81a69392096f0f4a2cd843efddf3a289ef90eec4..345f95588b9681cab2573d87d3854dae7e24ce3d 100644
--- a/src/windows/native/java/io/io_util_md.c
+++ b/src/windows/native/java/io/io_util_md.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2011, 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
diff --git a/src/windows/native/java/lang/java_props_md.c b/src/windows/native/java/lang/java_props_md.c
index 5b9332fb11181797211eacce65ea690fb5c29bd6..c66efbaf2fbdddce73b40b429be26d561add9f3a 100644
--- a/src/windows/native/java/lang/java_props_md.c
+++ b/src/windows/native/java/lang/java_props_md.c
@@ -196,42 +196,23 @@ getHomeFromRegistry()
/*
* Code to figure out the user's home directory using shell32.dll
*/
-typedef HRESULT (WINAPI *GetSpecialFolderType)(HWND, int, LPITEMIDLIST *);
-typedef BOOL (WINAPI *GetPathFromIDListType)(LPCITEMIDLIST, LPSTR);
-
WCHAR*
getHomeFromShell32()
{
- HMODULE lib = LoadLibraryW(L"SHELL32.DLL");
- GetSpecialFolderType do_get_folder;
- GetPathFromIDListType do_get_path;
HRESULT rc;
LPITEMIDLIST item_list = 0;
WCHAR *p;
WCHAR path[MAX_PATH+1];
int size = MAX_PATH+1;
- if (lib == 0) {
- // We can't load the library !!??
- return NULL;
- }
-
- do_get_folder = (GetSpecialFolderType)GetProcAddress(lib, "SHGetSpecialFolderLocation");
- do_get_path = (GetPathFromIDListType)GetProcAddress(lib, "SHGetPathFromIDListW");
-
- if (do_get_folder == 0 || do_get_path == 0) {
- // the library doesn't hold the right functions !!??
- return NULL;
- }
-
- rc = (*do_get_folder)(NULL, CSIDL_DESKTOPDIRECTORY, &item_list);
+ rc = SHGetSpecialFolderLocation(NULL, CSIDL_DESKTOPDIRECTORY, &item_list);
if (!SUCCEEDED(rc)) {
// we can't find the shell folder.
return NULL;
}
path[0] = 0;
- (*do_get_path)(item_list, (LPSTR)path);
+ SHGetPathFromIDListW(item_list, (LPWSTR)path);
/* Get the parent of Desktop directory */
p = wcsrchr(path, L'\\');
@@ -253,17 +234,7 @@ getHomeFromShell32()
static boolean
haveMMX(void)
{
- boolean mmx = 0;
- HMODULE lib = LoadLibrary("KERNEL32");
- if (lib != NULL) {
- BOOL (WINAPI *isProcessorFeaturePresent)(DWORD) =
- (BOOL (WINAPI *)(DWORD))
- GetProcAddress(lib, "IsProcessorFeaturePresent");
- if (isProcessorFeaturePresent != NULL)
- mmx = isProcessorFeaturePresent(PF_MMX_INSTRUCTIONS_AVAILABLE);
- FreeLibrary(lib);
- }
- return mmx;
+ return IsProcessorFeaturePresent(PF_MMX_INSTRUCTIONS_AVAILABLE);
}
static const char *
@@ -532,10 +503,19 @@ GetJavaProperties(JNIEnv* env)
if (uname != NULL && wcslen(uname) > 0) {
sprops.user_name = _wcsdup(uname);
} else {
- WCHAR buf[100];
- int buflen = sizeof(buf);
- sprops.user_name =
- GetUserNameW(buf, &buflen) ? _wcsdup(buf) : L"unknown";
+ DWORD buflen = 0;
+ if (GetUserNameW(NULL, &buflen) == 0 &&
+ GetLastError() == ERROR_INSUFFICIENT_BUFFER)
+ {
+ uname = (WCHAR*)malloc(buflen * sizeof(WCHAR));
+ if (uname != NULL && GetUserNameW(uname, &buflen) == 0) {
+ free(uname);
+ uname = NULL;
+ }
+ } else {
+ uname = NULL;
+ }
+ sprops.user_name = (uname != NULL) ? uname : L"unknown";
}
}
@@ -633,8 +613,8 @@ GetJavaProperties(JNIEnv* env)
/* Current directory */
{
WCHAR buf[MAX_PATH];
- GetCurrentDirectoryW(sizeof(buf), buf);
- sprops.user_dir = _wcsdup(buf);
+ if (GetCurrentDirectoryW(sizeof(buf)/sizeof(WCHAR), buf) != 0)
+ sprops.user_dir = _wcsdup(buf);
}
sprops.file_separator = "\\";
diff --git a/src/windows/native/java/net/Inet4AddressImpl.c b/src/windows/native/java/net/Inet4AddressImpl.c
index 197800dc59b515284ddf2df836926c6bf04da043..4bbcfc782b3d5dcfa985354446e0845a1725d9f9 100644
--- a/src/windows/native/java/net/Inet4AddressImpl.c
+++ b/src/windows/native/java/net/Inet4AddressImpl.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2011, 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
diff --git a/src/windows/native/java/net/Inet6AddressImpl.c b/src/windows/native/java/net/Inet6AddressImpl.c
index 1f9a6779e6ebfc98e36eaddf4371b2117a5d9110..efdcd54662be64de5cf750f3e94fb0dd2e4675d0 100644
--- a/src/windows/native/java/net/Inet6AddressImpl.c
+++ b/src/windows/native/java/net/Inet6AddressImpl.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2011, 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,6 +90,7 @@ Java_java_net_Inet6AddressImpl_lookupAllHostAddr(JNIEnv *env, jobject this,
jobjectArray ret = 0;
int retLen = 0;
jboolean preferIPv6Address;
+ static jfieldID ia_preferIPv6AddressID;
int error=0;
struct addrinfo hints, *res, *resNew = NULL;
@@ -116,166 +117,163 @@ Java_java_net_Inet6AddressImpl_lookupAllHostAddr(JNIEnv *env, jobject this,
hostname = JNU_GetStringPlatformChars(env, host, JNI_FALSE);
CHECK_NULL_RETURN(hostname, NULL);
- if (NET_addrtransAvailable()) {
- static jfieldID ia_preferIPv6AddressID;
+ if (ia_preferIPv6AddressID == NULL) {
+ jclass c = (*env)->FindClass(env,"java/net/InetAddress");
+ if (c) {
+ ia_preferIPv6AddressID =
+ (*env)->GetStaticFieldID(env, c, "preferIPv6Address", "Z");
+ }
if (ia_preferIPv6AddressID == NULL) {
- jclass c = (*env)->FindClass(env,"java/net/InetAddress");
- if (c) {
- ia_preferIPv6AddressID =
- (*env)->GetStaticFieldID(env, c, "preferIPv6Address", "Z");
- }
- if (ia_preferIPv6AddressID == NULL) {
- JNU_ReleaseStringPlatformChars(env, host, hostname);
- return NULL;
- }
+ JNU_ReleaseStringPlatformChars(env, host, hostname);
+ return NULL;
}
- /* get the address preference */
- preferIPv6Address
- = (*env)->GetStaticBooleanField(env, ia_class, ia_preferIPv6AddressID);
+ }
+ /* get the address preference */
+ preferIPv6Address
+ = (*env)->GetStaticBooleanField(env, ia_class, ia_preferIPv6AddressID);
- /* Try once, with our static buffer. */
- memset(&hints, 0, sizeof(hints));
- hints.ai_flags = AI_CANONNAME;
- hints.ai_family = AF_UNSPEC;
+ /* Try once, with our static buffer. */
+ memset(&hints, 0, sizeof(hints));
+ hints.ai_flags = AI_CANONNAME;
+ hints.ai_family = AF_UNSPEC;
- error = (*getaddrinfo_ptr)(hostname, NULL, &hints, &res);
+ error = getaddrinfo(hostname, NULL, &hints, &res);
- if (error) {
- /* report error */
- JNU_ThrowByName(env, JNU_JAVANETPKG "UnknownHostException",
- (char *)hostname);
- JNU_ReleaseStringPlatformChars(env, host, hostname);
- return NULL;
- } else {
- int i = 0;
- int inetCount = 0, inet6Count = 0, inetIndex, inet6Index;
- struct addrinfo *itr, *last, *iterator = res;
- while (iterator != NULL) {
- int skip = 0;
- itr = resNew;
- while (itr != NULL) {
- if (iterator->ai_family == itr->ai_family &&
- iterator->ai_addrlen == itr->ai_addrlen) {
- if (itr->ai_family == AF_INET) { /* AF_INET */
- struct sockaddr_in *addr1, *addr2;
- addr1 = (struct sockaddr_in *)iterator->ai_addr;
- addr2 = (struct sockaddr_in *)itr->ai_addr;
- if (addr1->sin_addr.s_addr ==
- addr2->sin_addr.s_addr) {
- skip = 1;
+ if (error) {
+ /* report error */
+ JNU_ThrowByName(env, JNU_JAVANETPKG "UnknownHostException",
+ (char *)hostname);
+ JNU_ReleaseStringPlatformChars(env, host, hostname);
+ return NULL;
+ } else {
+ int i = 0;
+ int inetCount = 0, inet6Count = 0, inetIndex, inet6Index;
+ struct addrinfo *itr, *last, *iterator = res;
+ while (iterator != NULL) {
+ int skip = 0;
+ itr = resNew;
+ while (itr != NULL) {
+ if (iterator->ai_family == itr->ai_family &&
+ iterator->ai_addrlen == itr->ai_addrlen) {
+ if (itr->ai_family == AF_INET) { /* AF_INET */
+ struct sockaddr_in *addr1, *addr2;
+ addr1 = (struct sockaddr_in *)iterator->ai_addr;
+ addr2 = (struct sockaddr_in *)itr->ai_addr;
+ if (addr1->sin_addr.s_addr ==
+ addr2->sin_addr.s_addr) {
+ skip = 1;
+ break;
+ }
+ } else {
+ int t;
+ struct sockaddr_in6 *addr1, *addr2;
+ addr1 = (struct sockaddr_in6 *)iterator->ai_addr;
+ addr2 = (struct sockaddr_in6 *)itr->ai_addr;
+
+ for (t = 0; t < 16; t++) {
+ if (addr1->sin6_addr.s6_addr[t] !=
+ addr2->sin6_addr.s6_addr[t]) {
break;
}
+ }
+ if (t < 16) {
+ itr = itr->ai_next;
+ continue;
} else {
- int t;
- struct sockaddr_in6 *addr1, *addr2;
- addr1 = (struct sockaddr_in6 *)iterator->ai_addr;
- addr2 = (struct sockaddr_in6 *)itr->ai_addr;
-
- for (t = 0; t < 16; t++) {
- if (addr1->sin6_addr.s6_addr[t] !=
- addr2->sin6_addr.s6_addr[t]) {
- break;
- }
- }
- if (t < 16) {
- itr = itr->ai_next;
- continue;
- } else {
- skip = 1;
- break;
- }
+ skip = 1;
+ break;
}
- } else if (iterator->ai_family != AF_INET &&
- iterator->ai_family != AF_INET6) {
- /* we can't handle other family types */
- skip = 1;
- break;
}
- itr = itr->ai_next;
+ } else if (iterator->ai_family != AF_INET &&
+ iterator->ai_family != AF_INET6) {
+ /* we can't handle other family types */
+ skip = 1;
+ break;
}
-
- if (!skip) {
- struct addrinfo *next
- = (struct addrinfo*) malloc(sizeof(struct addrinfo));
- if (!next) {
- JNU_ThrowOutOfMemoryError(env, "heap allocation failed");
- ret = NULL;
- goto cleanupAndReturn;
- }
- memcpy(next, iterator, sizeof(struct addrinfo));
- next->ai_next = NULL;
- if (resNew == NULL) {
- resNew = next;
- } else {
- last->ai_next = next;
- }
- last = next;
- i++;
- if (iterator->ai_family == AF_INET) {
- inetCount ++;
- } else if (iterator->ai_family == AF_INET6) {
- inet6Count ++;
- }
- }
- iterator = iterator->ai_next;
- }
- retLen = i;
- iterator = resNew;
- i = 0;
- ret = (*env)->NewObjectArray(env, retLen, ni_iacls, NULL);
-
- if (IS_NULL(ret)) {
- /* we may have memory to free at the end of this */
- goto cleanupAndReturn;
+ itr = itr->ai_next;
}
- if (preferIPv6Address) {
- inetIndex = inet6Count;
- inet6Index = 0;
- } else {
- inetIndex = 0;
- inet6Index = inetCount;
- }
-
- while (iterator != NULL) {
- if (iterator->ai_family == AF_INET) {
- jobject iaObj = (*env)->NewObject(env, ni_ia4cls, ni_ia4ctrID);
- if (IS_NULL(iaObj)) {
+ if (!skip) {
+ struct addrinfo *next
+ = (struct addrinfo*) malloc(sizeof(struct addrinfo));
+ if (!next) {
+ JNU_ThrowOutOfMemoryError(env, "heap allocation failed");
ret = NULL;
goto cleanupAndReturn;
- }
- (*env)->SetIntField(env, iaObj, ni_iaaddressID,
- ntohl(((struct sockaddr_in*)iterator->ai_addr)->sin_addr.s_addr));
- (*env)->SetObjectField(env, iaObj, ni_iahostID, host);
- (*env)->SetObjectArrayElement(env, ret, inetIndex, iaObj);
- inetIndex ++;
+ }
+ memcpy(next, iterator, sizeof(struct addrinfo));
+ next->ai_next = NULL;
+ if (resNew == NULL) {
+ resNew = next;
+ } else {
+ last->ai_next = next;
+ }
+ last = next;
+ i++;
+ if (iterator->ai_family == AF_INET) {
+ inetCount ++;
} else if (iterator->ai_family == AF_INET6) {
- jint scope = 0;
- jbyteArray ipaddress;
- jobject iaObj = (*env)->NewObject(env, ni_ia6cls, ni_ia6ctrID);
- if (IS_NULL(iaObj)) {
- ret = NULL;
- goto cleanupAndReturn;
- }
- ipaddress = (*env)->NewByteArray(env, 16);
- if (IS_NULL(ipaddress)) {
- ret = NULL;
- goto cleanupAndReturn;
- }
- (*env)->SetByteArrayRegion(env, ipaddress, 0, 16,
- (jbyte *)&(((struct sockaddr_in6*)iterator->ai_addr)->sin6_addr));
- scope = ((struct sockaddr_in6*)iterator->ai_addr)->sin6_scope_id;
- if (scope != 0) { /* zero is default value, no need to set */
- (*env)->SetIntField(env, iaObj, ia6_scopeidID, scope);
- (*env)->SetBooleanField(env, iaObj, ia6_scopeidsetID, JNI_TRUE);
- }
- (*env)->SetObjectField(env, iaObj, ni_ia6ipaddressID, ipaddress);
- (*env)->SetObjectField(env, iaObj, ni_iahostID, host);
- (*env)->SetObjectArrayElement(env, ret, inet6Index, iaObj);
- inet6Index ++;
+ inet6Count ++;
}
- iterator = iterator->ai_next;
}
+ iterator = iterator->ai_next;
+ }
+ retLen = i;
+ iterator = resNew;
+ i = 0;
+ ret = (*env)->NewObjectArray(env, retLen, ni_iacls, NULL);
+
+ if (IS_NULL(ret)) {
+ /* we may have memory to free at the end of this */
+ goto cleanupAndReturn;
+ }
+
+ if (preferIPv6Address) {
+ inetIndex = inet6Count;
+ inet6Index = 0;
+ } else {
+ inetIndex = 0;
+ inet6Index = inetCount;
+ }
+
+ while (iterator != NULL) {
+ if (iterator->ai_family == AF_INET) {
+ jobject iaObj = (*env)->NewObject(env, ni_ia4cls, ni_ia4ctrID);
+ if (IS_NULL(iaObj)) {
+ ret = NULL;
+ goto cleanupAndReturn;
+ }
+ (*env)->SetIntField(env, iaObj, ni_iaaddressID,
+ ntohl(((struct sockaddr_in*)iterator->ai_addr)->sin_addr.s_addr));
+ (*env)->SetObjectField(env, iaObj, ni_iahostID, host);
+ (*env)->SetObjectArrayElement(env, ret, inetIndex, iaObj);
+ inetIndex ++;
+ } else if (iterator->ai_family == AF_INET6) {
+ jint scope = 0;
+ jbyteArray ipaddress;
+ jobject iaObj = (*env)->NewObject(env, ni_ia6cls, ni_ia6ctrID);
+ if (IS_NULL(iaObj)) {
+ ret = NULL;
+ goto cleanupAndReturn;
+ }
+ ipaddress = (*env)->NewByteArray(env, 16);
+ if (IS_NULL(ipaddress)) {
+ ret = NULL;
+ goto cleanupAndReturn;
+ }
+ (*env)->SetByteArrayRegion(env, ipaddress, 0, 16,
+ (jbyte *)&(((struct sockaddr_in6*)iterator->ai_addr)->sin6_addr));
+ scope = ((struct sockaddr_in6*)iterator->ai_addr)->sin6_scope_id;
+ if (scope != 0) { /* zero is default value, no need to set */
+ (*env)->SetIntField(env, iaObj, ia6_scopeidID, scope);
+ (*env)->SetBooleanField(env, iaObj, ia6_scopeidsetID, JNI_TRUE);
+ }
+ (*env)->SetObjectField(env, iaObj, ni_ia6ipaddressID, ipaddress);
+ (*env)->SetObjectField(env, iaObj, ni_iahostID, host);
+ (*env)->SetObjectArrayElement(env, ret, inet6Index, iaObj);
+ inet6Index ++;
+ }
+ iterator = iterator->ai_next;
}
}
@@ -291,8 +289,7 @@ cleanupAndReturn:
JNU_ReleaseStringPlatformChars(env, host, hostname);
}
- if (NET_addrtransAvailable())
- (*freeaddrinfo_ptr)(res);
+ freeaddrinfo(res);
return ret;
}
@@ -312,44 +309,41 @@ Java_java_net_Inet6AddressImpl_getHostByAddr(JNIEnv *env, jobject this,
int len = 0;
jbyte caddr[16];
- if (NET_addrtransAvailable()) {
- struct sockaddr_in him4;
- struct sockaddr_in6 him6;
- struct sockaddr *sa;
+ struct sockaddr_in him4;
+ struct sockaddr_in6 him6;
+ struct sockaddr *sa;
+ /*
+ * For IPv4 addresses construct a sockaddr_in structure.
+ */
+ if ((*env)->GetArrayLength(env, addrArray) == 4) {
+ jint addr;
+ (*env)->GetByteArrayRegion(env, addrArray, 0, 4, caddr);
+ addr = ((caddr[0]<<24) & 0xff000000);
+ addr |= ((caddr[1] <<16) & 0xff0000);
+ addr |= ((caddr[2] <<8) & 0xff00);
+ addr |= (caddr[3] & 0xff);
+ memset((char *) &him4, 0, sizeof(him4));
+ him4.sin_addr.s_addr = (uint32_t) htonl(addr);
+ him4.sin_family = AF_INET;
+ sa = (struct sockaddr *) &him4;
+ len = sizeof(him4);
+ } else {
/*
- * For IPv4 addresses construct a sockaddr_in structure.
+ * For IPv6 address construct a sockaddr_in6 structure.
*/
- if ((*env)->GetArrayLength(env, addrArray) == 4) {
- jint addr;
- (*env)->GetByteArrayRegion(env, addrArray, 0, 4, caddr);
- addr = ((caddr[0]<<24) & 0xff000000);
- addr |= ((caddr[1] <<16) & 0xff0000);
- addr |= ((caddr[2] <<8) & 0xff00);
- addr |= (caddr[3] & 0xff);
- memset((char *) &him4, 0, sizeof(him4));
- him4.sin_addr.s_addr = (uint32_t) htonl(addr);
- him4.sin_family = AF_INET;
- sa = (struct sockaddr *) &him4;
- len = sizeof(him4);
- } else {
- /*
- * For IPv6 address construct a sockaddr_in6 structure.
- */
- (*env)->GetByteArrayRegion(env, addrArray, 0, 16, caddr);
- memset((char *) &him6, 0, sizeof(him6));
- memcpy((void *)&(him6.sin6_addr), caddr, sizeof(struct in6_addr) );
- him6.sin6_family = AF_INET6;
- sa = (struct sockaddr *) &him6 ;
- len = sizeof(him6) ;
- }
+ (*env)->GetByteArrayRegion(env, addrArray, 0, 16, caddr);
+ memset((char *) &him6, 0, sizeof(him6));
+ memcpy((void *)&(him6.sin6_addr), caddr, sizeof(struct in6_addr) );
+ him6.sin6_family = AF_INET6;
+ sa = (struct sockaddr *) &him6 ;
+ len = sizeof(him6) ;
+ }
- error = (*getnameinfo_ptr)(sa, len, host, NI_MAXHOST, NULL, 0,
- NI_NAMEREQD);
+ error = getnameinfo(sa, len, host, NI_MAXHOST, NULL, 0, NI_NAMEREQD);
- if (!error) {
- ret = (*env)->NewStringUTF(env, host);
- }
+ if (!error) {
+ ret = (*env)->NewStringUTF(env, host);
}
if (ret == NULL) {
diff --git a/src/windows/native/java/net/NetworkInterface.c b/src/windows/native/java/net/NetworkInterface.c
index 6a318722414a0fb8dbbfedd4d7ba4016de6069f6..fa5dfc13f611178b4ee6a1c4b51aef3839275186 100644
--- a/src/windows/native/java/net/NetworkInterface.c
+++ b/src/windows/native/java/net/NetworkInterface.c
@@ -53,36 +53,6 @@
* order and this ensures consistent device number across invocations.
*/
-
-/* IP helper library routines */
-int (PASCAL FAR *GetIpAddrTable_fn)();
-int (PASCAL FAR *GetIfTable_fn)();
-int (PASCAL FAR *GetFriendlyIfIndex_fn)();
-int (PASCAL FAR *GetAdaptersAddresses_fn)();
-int (PASCAL FAR *GetAdaptersInfo_fn)();
-int (PASCAL FAR *GetNumberOfInterfaces_fn)();
-
-/* Enumeration routines */
-typedef int (*EnumerateNetInterfaces)(JNIEnv *, netif **);
-typedef int(*EnumerateNetAddresses)(JNIEnv *, netif *, netaddr **);
-
-static EnumerateNetInterfaces enumInterfaces_fn;
-static EnumerateNetAddresses enumAddresses_fn;
-
-/* Windows 9x routines are external (not needed on 64-bit) */
-#ifndef _WIN64
-extern int enumInterfaces_win9x(JNIEnv *, netif **);
-extern int enumAddresses_win9x(JNIEnv *, netif *, netaddr **);
-extern int init_win9x(void);
-#endif
-
-
-/* Windows 95/98/ME running */
-static jboolean isW9x;
-
-/* Windows version supports */
-static jboolean os_supports_ipv6;
-
/* various JNI ids */
jclass ni_class; /* NetworkInterface */
@@ -154,10 +124,10 @@ MIB_IFROW *getIF(jint index) {
*/
size = sizeof(MIB_IFTABLE);
tableP = (MIB_IFTABLE *)malloc(size);
- count = (*GetIfTable_fn)(tableP, &size, TRUE);
+ count = GetIfTable(tableP, &size, TRUE);
if (count == ERROR_INSUFFICIENT_BUFFER || count == ERROR_BUFFER_OVERFLOW) {
tableP = (MIB_IFTABLE *)realloc(tableP, size);
- count = (*GetIfTable_fn)(tableP, &size, TRUE);
+ count = GetIfTable(tableP, &size, TRUE);
}
if (count != NO_ERROR) {
@@ -172,7 +142,7 @@ MIB_IFROW *getIF(jint index) {
/*
* Warning the real index is obtained by GetFriendlyIfIndex()
*/
- ifindex = (*GetFriendlyIfIndex_fn)(ifrowP->dwIndex);
+ ifindex = GetFriendlyIfIndex(ifrowP->dwIndex);
if (ifindex == index) {
/*
* Create a copy of the entry so that we can free the table.
@@ -199,7 +169,7 @@ MIB_IFROW *getIF(jint index) {
* occurs then netifPP be returned as list of netif structures or NULL
* if no interfaces are found.
*/
-int enumInterfaces_win(JNIEnv *env, netif **netifPP)
+int enumInterfaces(JNIEnv *env, netif **netifPP)
{
MIB_IFTABLE *tableP;
MIB_IFROW *ifrowP;
@@ -215,32 +185,16 @@ int enumInterfaces_win(JNIEnv *env, netif **netifPP)
*/
size = sizeof(MIB_IFTABLE);
tableP = (MIB_IFTABLE *)malloc(size);
- ret = (*GetIfTable_fn)(tableP, &size, TRUE);
+ ret = GetIfTable(tableP, &size, TRUE);
if (ret == ERROR_INSUFFICIENT_BUFFER || ret == ERROR_BUFFER_OVERFLOW) {
tableP = (MIB_IFTABLE *)realloc(tableP, size);
- ret = (*GetIfTable_fn)(tableP, &size, TRUE);
+ ret = GetIfTable(tableP, &size, TRUE);
}
if (ret != NO_ERROR) {
if (tableP != NULL)
free(tableP);
-#ifndef _WIN64
- if (isW9x && ret == ERROR_NOT_SUPPORTED) {
- /*
- * If ERROR_NOT_SUPPORTED is returned on Windows 98 it means that
- * IE5.0 has been installed. In this case we revert to the Windows 95
- * approach and avoid using the IP Helper Library.
- * See: http://support.microsoft.com/support/kb/articles/q234/5/73.asp
- */
- enumInterfaces_fn = enumInterfaces_win9x;
- enumAddresses_fn = enumAddresses_win9x;
- init_win9x();
-
- return (*enumInterfaces_fn)(env, netifPP);
- }
-#endif
-
JNU_ThrowByName(env, "java/lang/Error",
"IP Helper Library GetIfTable function failed");
@@ -328,7 +282,7 @@ int enumInterfaces_win(JNIEnv *env, netif **netifPP)
curr->displayName[ifrowP->dwDescrLen] = '\0';
curr->dwIndex = ifrowP->dwIndex;
curr->ifType = ifrowP->dwType;
- curr->index = (*GetFriendlyIfIndex_fn)(ifrowP->dwIndex);
+ curr->index = GetFriendlyIfIndex(ifrowP->dwIndex);
/*
* Put the interface at tail of list as GetIfTable(,,TRUE) is
@@ -384,10 +338,10 @@ int enumAddresses_win(JNIEnv *env, netif *netifP, netaddr **netaddrPP)
size = sizeof(MIB_IPADDRTABLE);
tableP = (MIB_IPADDRTABLE *)malloc(size);
- ret = (*GetIpAddrTable_fn)(&tableP, &size, FALSE);
+ ret = GetIpAddrTable(tableP, &size, FALSE);
if (ret == ERROR_INSUFFICIENT_BUFFER || ret == ERROR_BUFFER_OVERFLOW) {
tableP = (MIB_IPADDRTABLE *)realloc(tableP, size);
- ret = (*GetIpAddrTable_fn)(tableP, &size, FALSE);
+ ret = GetIpAddrTable(tableP, &size, FALSE);
}
if (ret != NO_ERROR) {
if (tableP) {
@@ -477,71 +431,6 @@ int enumAddresses_win(JNIEnv *env, netif *netifP, netaddr **netaddrPP)
JNIEXPORT void JNICALL
Java_java_net_NetworkInterface_init(JNIEnv *env, jclass cls)
{
- OSVERSIONINFO ver;
- HANDLE h;
-
- /*
- * First check if this is a Windows 9x machine.
- */
- ver.dwOSVersionInfoSize = sizeof(ver);
- GetVersionEx(&ver);
- if (ver.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS && ver.dwMajorVersion == 4) {
- isW9x = JNI_TRUE;
- }
-
- /*
- * Try to load the IP Helper Library and obtain the entry points we
- * require. This will succeed on 98, NT SP4+, 2000 & XP. It will
- * fail on Windows 95 (if IE hasn't been updated) and old versions
- * of NT (IP helper library only appeared at SP4). If it fails on
- * Windows 9x we will use the registry approach, otherwise if it
- * fails we throw an Error indicating that we have an incompatible
- * IP helper library.
- */
- h = LoadLibrary("iphlpapi.dll");
- if (h != NULL) {
- GetIpAddrTable_fn =
- (int (PASCAL FAR *)())GetProcAddress(h, "GetIpAddrTable");
- GetIfTable_fn =
- (int (PASCAL FAR *)())GetProcAddress(h, "GetIfTable");
- GetFriendlyIfIndex_fn =
- (int (PASCAL FAR *)())GetProcAddress(h, "GetFriendlyIfIndex");
- GetNumberOfInterfaces_fn =
- (int (PASCAL FAR *)())GetProcAddress(h, "GetNumberOfInterfaces");
- GetAdaptersAddresses_fn =
- (int (PASCAL FAR *)())GetProcAddress(h, "GetAdaptersAddresses");
- GetAdaptersInfo_fn =
- (int (PASCAL FAR *)())GetProcAddress(h, "GetAdaptersInfo");
- }
-
- /* IPv6 is supported on Windows versions if the following APIs avail */
-
- os_supports_ipv6 = (GetAdaptersAddresses_fn != NULL) &&
- (GetNumberOfInterfaces_fn != NULL) &&
- (GetAdaptersInfo_fn != NULL);
-
- if (GetIpAddrTable_fn == NULL ||
- GetIfTable_fn == NULL ||
- GetFriendlyIfIndex_fn == NULL) {
-
-#ifndef _WIN64
- if (isW9x) {
- /* Use Windows 9x registry approach which requires initialization */
- enumInterfaces_fn = enumInterfaces_win9x;
- enumAddresses_fn = enumAddresses_win9x;
- init_win9x();
- } else
-#endif
- {
- JNU_ThrowByName(env, "java/lang/Error",
- "Incompatible IP helper library (iphlpapi.dll)");
- return;
- }
- } else {
- enumInterfaces_fn = enumInterfaces_win;
- enumAddresses_fn = enumAddresses_win;
- }
-
/*
* Get the various JNI ids that we require
*/
@@ -581,7 +470,8 @@ Java_java_net_NetworkInterface_init(JNIEnv *env, jclass cls)
* populate the InetAddress array based on the IP addresses for this
* interface.
*/
-jobject createNetworkInterface(JNIEnv *env, netif *ifs, int netaddrCount, netaddr *netaddrP)
+jobject createNetworkInterface
+ (JNIEnv *env, netif *ifs, int netaddrCount, netaddr *netaddrP)
{
jobject netifObj;
jobject name, displayName;
@@ -596,7 +486,8 @@ jobject createNetworkInterface(JNIEnv *env, netif *ifs, int netaddrCount, netadd
netifObj = (*env)->NewObject(env, ni_class, ni_ctor);
name = (*env)->NewStringUTF(env, ifs->name);
if (ifs->dNameIsUnicode) {
- displayName = (*env)->NewString(env, (PWCHAR)ifs->displayName, wcslen ((PWCHAR)ifs->displayName));
+ displayName = (*env)->NewString(env, (PWCHAR)ifs->displayName,
+ (jsize)wcslen ((PWCHAR)ifs->displayName));
} else {
displayName = (*env)->NewStringUTF(env, ifs->displayName);
}
@@ -612,7 +503,7 @@ jobject createNetworkInterface(JNIEnv *env, netif *ifs, int netaddrCount, netadd
* Note that 0 is a valid number of addresses.
*/
if (netaddrCount < 0) {
- netaddrCount = (*enumAddresses_fn)(env, ifs, &netaddrP);
+ netaddrCount = enumAddresses_win(env, ifs, &netaddrP);
if ((*env)->ExceptionOccurred(env)) {
free_netaddr(netaddrP);
return NULL;
@@ -725,12 +616,13 @@ JNIEXPORT jobject JNICALL Java_java_net_NetworkInterface_getByName0
const char *name_utf;
jobject netifObj = NULL;
- if (os_supports_ipv6 && ipv6_available()) {
+ // Retained for now to support IPv4 only stack, java.net.preferIPv4Stack
+ if (ipv6_available()) {
return Java_java_net_NetworkInterface_getByName0_XP (env, cls, name);
}
/* get the list of interfaces */
- if ((*enumInterfaces_fn)(env, &ifList) < 0) {
+ if (enumInterfaces(env, &ifList) < 0) {
return NULL;
}
@@ -771,12 +663,13 @@ JNIEXPORT jobject JNICALL Java_java_net_NetworkInterface_getByIndex0
netif *ifList, *curr;
jobject netifObj = NULL;
- if (os_supports_ipv6 && ipv6_available()) {
+ // Retained for now to support IPv4 only stack, java.net.preferIPv4Stack
+ if (ipv6_available()) {
return Java_java_net_NetworkInterface_getByIndex0_XP (env, cls, index);
}
/* get the list of interfaces */
- if ((*enumInterfaces_fn)(env, &ifList) < 0) {
+ if (enumInterfaces(env, &ifList) < 0) {
return NULL;
}
@@ -812,12 +705,13 @@ JNIEXPORT jobject JNICALL Java_java_net_NetworkInterface_getByInetAddress0
jint addr = (*env)->GetIntField(env, iaObj, ni_iaAddr);
jobject netifObj = NULL;
- if (os_supports_ipv6 && ipv6_available()) {
+ // Retained for now to support IPv4 only stack, java.net.preferIPv4Stack
+ if (ipv6_available()) {
return Java_java_net_NetworkInterface_getByInetAddress0_XP (env, cls, iaObj);
}
/* get the list of interfaces */
- if ((*enumInterfaces_fn)(env, &ifList) < 0) {
+ if (enumInterfaces(env, &ifList) < 0) {
return NULL;
}
@@ -832,7 +726,7 @@ JNIEXPORT jobject JNICALL Java_java_net_NetworkInterface_getByInetAddress0
netaddr *addrP;
/* enumerate the addresses on this interface */
- count = (*enumAddresses_fn)(env, curr, &addrList);
+ count = enumAddresses_win(env, curr, &addrList);
if (count < 0) {
free_netif(ifList);
return NULL;
@@ -881,14 +775,15 @@ JNIEXPORT jobjectArray JNICALL Java_java_net_NetworkInterface_getAll
jobjectArray netIFArr;
jint arr_index;
- if (os_supports_ipv6 && ipv6_available()) {
+ // Retained for now to support IPv4 only stack, java.net.preferIPv4Stack
+ if (ipv6_available()) {
return Java_java_net_NetworkInterface_getAll_XP (env, cls);
}
/*
* Get list of interfaces
*/
- count = (*enumInterfaces_fn)(env, &ifList);
+ count = enumInterfaces(env, &ifList);
if (count < 0) {
return NULL;
}
@@ -934,13 +829,16 @@ JNIEXPORT jboolean JNICALL Java_java_net_NetworkInterface_isUp0
(JNIEnv *env, jclass cls, jstring name, jint index) {
jboolean ret = JNI_FALSE;
- if (os_supports_ipv6 && ipv6_available()) {
+ // Retained for now to support IPv4 only stack, java.net.preferIPv4Stack
+ if (ipv6_available()) {
return Java_java_net_NetworkInterface_isUp0_XP(env, cls, name, index);
} else {
MIB_IFROW *ifRowP;
ifRowP = getIF(index);
if (ifRowP != NULL) {
- ret = ifRowP->dwAdminStatus == 1 && (ifRowP->dwOperStatus == MIB_IF_OPER_STATUS_OPERATIONAL || ifRowP->dwOperStatus == MIB_IF_OPER_STATUS_CONNECTED);
+ ret = ifRowP->dwAdminStatus == 1 &&
+ (ifRowP->dwOperStatus == MIB_IF_OPER_STATUS_OPERATIONAL ||
+ ifRowP->dwOperStatus == MIB_IF_OPER_STATUS_CONNECTED);
free(ifRowP);
}
}
@@ -952,11 +850,13 @@ JNIEXPORT jboolean JNICALL Java_java_net_NetworkInterface_isUp0
* Method: isP2P0
* Signature: (Ljava/lang/String;I)Z
*/
-JNIEXPORT jboolean JNICALL Java_java_net_NetworkInterface_isP2P0(JNIEnv *env, jclass cls, jstring name, jint index) {
+JNIEXPORT jboolean JNICALL Java_java_net_NetworkInterface_isP2P0
+ (JNIEnv *env, jclass cls, jstring name, jint index) {
MIB_IFROW *ifRowP;
jboolean ret = JNI_FALSE;
- if (os_supports_ipv6 && ipv6_available()) {
+ // Retained for now to support IPv4 only stack, java.net.preferIPv4Stack
+ if (ipv6_available()) {
return Java_java_net_NetworkInterface_isP2P0_XP(env, cls, name, index);
} else {
ifRowP = getIF(index);
@@ -983,7 +883,8 @@ JNIEXPORT jboolean JNICALL Java_java_net_NetworkInterface_isLoopback0
MIB_IFROW *ifRowP;
jboolean ret = JNI_FALSE;
- if (os_supports_ipv6 && ipv6_available()) {
+ // Retained for now to support IPv4 only stack, java.net.preferIPv4Stack
+ if (ipv6_available()) {
return Java_java_net_NetworkInterface_isLoopback0_XP(env, cls, name, index);
} else {
ifRowP = getIF(index);
@@ -1003,22 +904,8 @@ JNIEXPORT jboolean JNICALL Java_java_net_NetworkInterface_isLoopback0
*/
JNIEXPORT jboolean JNICALL Java_java_net_NetworkInterface_supportsMulticast0
(JNIEnv *env, jclass cls, jstring name, jint index) {
- MIB_IFROW *ifRowP;
- jboolean ret = JNI_TRUE;
-
- // Let's try to use the newer API (XP & 2003 only)
- if (GetAdaptersAddresses_fn != NULL) {
- ret = Java_java_net_NetworkInterface_supportsMulticast0_XP(env, cls,
+ return Java_java_net_NetworkInterface_supportsMulticast0_XP(env, cls,
name, index);
- return ret;
- }
- ifRowP = getIF(index);
- if (ifRowP != NULL) {
- if (ifRowP->dwType == MIB_IF_TYPE_LOOPBACK)
- ret = JNI_FALSE;
- free(ifRowP);
- }
- return ret;
}
/*
@@ -1026,12 +913,14 @@ JNIEXPORT jboolean JNICALL Java_java_net_NetworkInterface_supportsMulticast0
* Method: getMacAddr0
* Signature: ([bLjava/lang/String;I)[b
*/
-JNIEXPORT jbyteArray JNICALL Java_java_net_NetworkInterface_getMacAddr0(JNIEnv *env, jclass class, jbyteArray addrArray, jstring name, jint index) {
+JNIEXPORT jbyteArray JNICALL Java_java_net_NetworkInterface_getMacAddr0
+ (JNIEnv *env, jclass class, jbyteArray addrArray, jstring name, jint index) {
jbyteArray ret = NULL;
int len;
MIB_IFROW *ifRowP;
- if (os_supports_ipv6 && ipv6_available()) {
+ // Retained for now to support IPv4 only stack, java.net.preferIPv4Stack
+ if (ipv6_available()) {
return Java_java_net_NetworkInterface_getMacAddr0_XP(env, class, name, index);
} else {
ifRowP = getIF(index);
@@ -1058,11 +947,13 @@ JNIEXPORT jbyteArray JNICALL Java_java_net_NetworkInterface_getMacAddr0(JNIEnv *
* Method: getMTU0
* Signature: ([bLjava/lang/String;I)I
*/
-JNIEXPORT jint JNICALL Java_java_net_NetworkInterface_getMTU0(JNIEnv *env, jclass class, jstring name, jint index) {
+JNIEXPORT jint JNICALL Java_java_net_NetworkInterface_getMTU0
+ (JNIEnv *env, jclass class, jstring name, jint index) {
jint ret = -1;
MIB_IFROW *ifRowP;
- if (os_supports_ipv6 && ipv6_available()) {
+ // Retained for now to support IPv4 only stack, java.net.preferIPv4Stack
+ if (ipv6_available()) {
return Java_java_net_NetworkInterface_getMTU0_XP(env, class, name, index);
} else {
ifRowP = getIF(index);
diff --git a/src/windows/native/java/net/NetworkInterface.h b/src/windows/native/java/net/NetworkInterface.h
index 6d3e1c1a95771a366172dbb8affa63a1b5a806fa..262e15a0db0960492ecf709986e235cbe98016eb 100644
--- a/src/windows/native/java/net/NetworkInterface.h
+++ b/src/windows/native/java/net/NetworkInterface.h
@@ -87,338 +87,6 @@ extern jfieldID ni_ibaddressID; /* InterfaceAddress.address */
extern jfieldID ni_ibbroadcastID; /* InterfaceAddress.broadcast */
extern jfieldID ni_ibmaskID; /* InterfaceAddress.maskLength */
-int enumInterfaces_win(JNIEnv *env, netif **netifPP);
-
-/* We have included iphlpapi.h which includes iptypes.h which has the definition
- * for MAX_ADAPTER_DESCRIPTION_LENGTH (along with the other definitions in this
- * ifndef block). Therefore if MAX_ADAPTER_DESCRIPTION_LENGTH is defined we can
- * be sure that the other definitions are also defined */
-#ifndef MAX_ADAPTER_DESCRIPTION_LENGTH
-
-/*
- * Following includes come from iptypes.h
- */
-
-#pragma warning(push)
-#pragma warning(disable:4201)
-
-#include
-
-// Definitions and structures used by getnetworkparams and getadaptersinfo apis
-
-#define MAX_ADAPTER_DESCRIPTION_LENGTH 128 // arb.
-#define MAX_ADAPTER_NAME_LENGTH 256 // arb.
-#define MAX_ADAPTER_ADDRESS_LENGTH 8 // arb.
-#define DEFAULT_MINIMUM_ENTITIES 32 // arb.
-#define MAX_HOSTNAME_LEN 128 // arb.
-#define MAX_DOMAIN_NAME_LEN 128 // arb.
-#define MAX_SCOPE_ID_LEN 256 // arb.
-
-//
-// types
-//
-
-// Node Type
-
-#define BROADCAST_NODETYPE 1
-#define PEER_TO_PEER_NODETYPE 2
-#define MIXED_NODETYPE 4
-#define HYBRID_NODETYPE 8
-
-//
-// IP_ADDRESS_STRING - store an IP address as a dotted decimal string
-//
-
-typedef struct {
- char String[4 * 4];
-} IP_ADDRESS_STRING, *PIP_ADDRESS_STRING, IP_MASK_STRING, *PIP_MASK_STRING;
-
-//
-// IP_ADDR_STRING - store an IP address with its corresponding subnet mask,
-// both as dotted decimal strings
-//
-
-typedef struct _IP_ADDR_STRING {
- struct _IP_ADDR_STRING* Next;
- IP_ADDRESS_STRING IpAddress;
- IP_MASK_STRING IpMask;
- DWORD Context;
-} IP_ADDR_STRING, *PIP_ADDR_STRING;
-
-//
-// ADAPTER_INFO - per-adapter information. All IP addresses are stored as
-// strings
-//
-
-typedef struct _IP_ADAPTER_INFO {
- struct _IP_ADAPTER_INFO* Next;
- DWORD ComboIndex;
- char AdapterName[MAX_ADAPTER_NAME_LENGTH + 4];
- char Description[MAX_ADAPTER_DESCRIPTION_LENGTH + 4];
- UINT AddressLength;
- BYTE Address[MAX_ADAPTER_ADDRESS_LENGTH];
- DWORD Index;
- UINT Type;
- UINT DhcpEnabled;
- PIP_ADDR_STRING CurrentIpAddress;
- IP_ADDR_STRING IpAddressList;
- IP_ADDR_STRING GatewayList;
- IP_ADDR_STRING DhcpServer;
- BOOL HaveWins;
- IP_ADDR_STRING PrimaryWinsServer;
- IP_ADDR_STRING SecondaryWinsServer;
- time_t LeaseObtained;
- time_t LeaseExpires;
-} IP_ADAPTER_INFO, *PIP_ADAPTER_INFO;
-
-#ifdef _WINSOCK2API_
-
-//
-// The following types require Winsock2.
-//
-
-typedef enum {
- IpPrefixOriginOther = 0,
- IpPrefixOriginManual,
- IpPrefixOriginWellKnown,
- IpPrefixOriginDhcp,
- IpPrefixOriginRouterAdvertisement,
-} IP_PREFIX_ORIGIN;
-
-typedef enum {
- IpSuffixOriginOther = 0,
- IpSuffixOriginManual,
- IpSuffixOriginWellKnown,
- IpSuffixOriginDhcp,
- IpSuffixOriginLinkLayerAddress,
- IpSuffixOriginRandom,
-} IP_SUFFIX_ORIGIN;
-
-typedef enum {
- IpDadStateInvalid = 0,
- IpDadStateTentative,
- IpDadStateDuplicate,
- IpDadStateDeprecated,
- IpDadStatePreferred,
-} IP_DAD_STATE;
-
-typedef struct _IP_ADAPTER_UNICAST_ADDRESS {
- union {
- ULONGLONG Alignment;
- struct {
- ULONG Length;
- DWORD Flags;
- };
- };
- struct _IP_ADAPTER_UNICAST_ADDRESS *Next;
- SOCKET_ADDRESS Address;
-
- IP_PREFIX_ORIGIN PrefixOrigin;
- IP_SUFFIX_ORIGIN SuffixOrigin;
- IP_DAD_STATE DadState;
-
- ULONG ValidLifetime;
- ULONG PreferredLifetime;
- ULONG LeaseLifetime;
-} IP_ADAPTER_UNICAST_ADDRESS, *PIP_ADAPTER_UNICAST_ADDRESS;
-
-typedef struct _IP_ADAPTER_ANYCAST_ADDRESS {
- union {
- ULONGLONG Alignment;
- struct {
- ULONG Length;
- DWORD Flags;
- };
- };
- struct _IP_ADAPTER_ANYCAST_ADDRESS *Next;
- SOCKET_ADDRESS Address;
-} IP_ADAPTER_ANYCAST_ADDRESS, *PIP_ADAPTER_ANYCAST_ADDRESS;
-
-typedef struct _IP_ADAPTER_MULTICAST_ADDRESS {
- union {
- ULONGLONG Alignment;
- struct {
- ULONG Length;
- DWORD Flags;
- };
- };
- struct _IP_ADAPTER_MULTICAST_ADDRESS *Next;
- SOCKET_ADDRESS Address;
-} IP_ADAPTER_MULTICAST_ADDRESS, *PIP_ADAPTER_MULTICAST_ADDRESS;
-
-//
-// Per-address Flags
-//
-#define IP_ADAPTER_ADDRESS_DNS_ELIGIBLE 0x01
-#define IP_ADAPTER_ADDRESS_TRANSIENT 0x02
-
-typedef struct _IP_ADAPTER_DNS_SERVER_ADDRESS {
- union {
- ULONGLONG Alignment;
- struct {
- ULONG Length;
- DWORD Reserved;
- };
- };
- struct _IP_ADAPTER_DNS_SERVER_ADDRESS *Next;
- SOCKET_ADDRESS Address;
-} IP_ADAPTER_DNS_SERVER_ADDRESS, *PIP_ADAPTER_DNS_SERVER_ADDRESS;
-
-typedef struct _IP_ADAPTER_PREFIX {
- union {
- ULONGLONG Alignment;
- struct {
- ULONG Length;
- DWORD Flags;
- };
- };
- struct _IP_ADAPTER_PREFIX *Next;
- SOCKET_ADDRESS Address;
- ULONG PrefixLength;
-} IP_ADAPTER_PREFIX, *PIP_ADAPTER_PREFIX;
-
-//
-// Per-adapter Flags
-//
-#define IP_ADAPTER_DDNS_ENABLED 0x01
-#define IP_ADAPTER_REGISTER_ADAPTER_SUFFIX 0x02
-#define IP_ADAPTER_DHCP_ENABLED 0x04
-#define IP_ADAPTER_RECEIVE_ONLY 0x08
-#define IP_ADAPTER_NO_MULTICAST 0x10
-#define IP_ADAPTER_IPV6_OTHER_STATEFUL_CONFIG 0x20
-
-//
-// OperStatus values from RFC 2863
-//
-typedef enum {
- IfOperStatusUp = 1,
- IfOperStatusDown,
- IfOperStatusTesting,
- IfOperStatusUnknown,
- IfOperStatusDormant,
- IfOperStatusNotPresent,
- IfOperStatusLowerLayerDown
-} IF_OPER_STATUS;
-
-//
-// Scope levels from RFC 2373 used with ZoneIndices array.
-//
-typedef enum {
- ScopeLevelInterface = 1,
- ScopeLevelLink = 2,
- ScopeLevelSubnet = 3,
- ScopeLevelAdmin = 4,
- ScopeLevelSite = 5,
- ScopeLevelOrganization = 8,
- ScopeLevelGlobal = 14
-} SCOPE_LEVEL;
-
-typedef struct _IP_ADAPTER_ADDRESSES {
- union {
- ULONGLONG Alignment;
- struct {
- ULONG Length;
- DWORD IfIndex;
- };
- };
- struct _IP_ADAPTER_ADDRESSES *Next;
- PCHAR AdapterName;
- PIP_ADAPTER_UNICAST_ADDRESS FirstUnicastAddress;
- PIP_ADAPTER_ANYCAST_ADDRESS FirstAnycastAddress;
- PIP_ADAPTER_MULTICAST_ADDRESS FirstMulticastAddress;
- PIP_ADAPTER_DNS_SERVER_ADDRESS FirstDnsServerAddress;
- PWCHAR DnsSuffix;
- PWCHAR Description;
- PWCHAR FriendlyName;
- BYTE PhysicalAddress[MAX_ADAPTER_ADDRESS_LENGTH];
- DWORD PhysicalAddressLength;
- DWORD Flags;
- DWORD Mtu;
- DWORD IfType;
- IF_OPER_STATUS OperStatus;
- DWORD Ipv6IfIndex;
- DWORD ZoneIndices[16];
- PIP_ADAPTER_PREFIX FirstPrefix;
-} IP_ADAPTER_ADDRESSES, *PIP_ADAPTER_ADDRESSES;
-
-//
-// Flags used as argument to GetAdaptersAddresses().
-// "SKIP" flags are added when the default is to include the information.
-// "INCLUDE" flags are added when the default is to skip the information.
-//
-#define GAA_FLAG_SKIP_UNICAST 0x0001
-#define GAA_FLAG_SKIP_ANYCAST 0x0002
-#define GAA_FLAG_SKIP_MULTICAST 0x0004
-#define GAA_FLAG_SKIP_DNS_SERVER 0x0008
-#define GAA_FLAG_INCLUDE_PREFIX 0x0010
-#define GAA_FLAG_SKIP_FRIENDLY_NAME 0x0020
-
-#endif /* _WINSOCK2API_ */
-
-//
-// IP_PER_ADAPTER_INFO - per-adapter IP information such as DNS server list.
-//
-
-typedef struct _IP_PER_ADAPTER_INFO {
- UINT AutoconfigEnabled;
- UINT AutoconfigActive;
- PIP_ADDR_STRING CurrentDnsServer;
- IP_ADDR_STRING DnsServerList;
-} IP_PER_ADAPTER_INFO, *PIP_PER_ADAPTER_INFO;
-
-//
-// FIXED_INFO - the set of IP-related information which does not depend on DHCP
-//
-
-typedef struct {
- char HostName[MAX_HOSTNAME_LEN + 4] ;
- char DomainName[MAX_DOMAIN_NAME_LEN + 4];
- PIP_ADDR_STRING CurrentDnsServer;
- IP_ADDR_STRING DnsServerList;
- UINT NodeType;
- char ScopeId[MAX_SCOPE_ID_LEN + 4];
- UINT EnableRouting;
- UINT EnableProxy;
- UINT EnableDns;
-} FIXED_INFO, *PFIXED_INFO;
-
-#pragma warning(pop)
-
-#endif /*!MAX_ADAPTER_DESCRIPTION_LENGTH*/
-
-#ifndef IP_INTERFACE_NAME_INFO_DEFINED
-#define IP_INTERFACE_NAME_INFO_DEFINED
-
-typedef struct ip_interface_name_info {
- ULONG Index; // Interface Index
- ULONG MediaType; // Interface Types - see ipifcons.h
- UCHAR ConnectionType;
- UCHAR AccessType;
- GUID DeviceGuid; // Device GUID is the guid of the device
- // that IP exposes
- GUID InterfaceGuid; // Interface GUID, if not GUID_NULL is the
- // GUID for the interface mapped to the device.
-} IP_INTERFACE_NAME_INFO, *PIP_INTERFACE_NAME_INFO;
-
-#endif
-
-
-/* from ipifcons.h */
-
-#ifndef IF_TYPE_PPP
-#define IF_TYPE_PPP 23
-#endif
-
-#ifndef IF_TYPE_SOFTWARE_LOOPBACK
-#define IF_TYPE_SOFTWARE_LOOPBACK 24
-#endif
-
-#ifndef IF_TYPE_SLIP
-#define IF_TYPE_SLIP 28
-#endif
-
-#ifndef IF_TYPE_TUNNEL
-#define IF_TYPE_TUNNEL 131
-#endif
+int enumInterfaces(JNIEnv *env, netif **netifPP);
#endif
diff --git a/src/windows/native/java/net/NetworkInterface_win9x.c b/src/windows/native/java/net/NetworkInterface_win9x.c
deleted file mode 100644
index deac1eb7f3da8efb26a4b58945cb3085ac869440..0000000000000000000000000000000000000000
--- a/src/windows/native/java/net/NetworkInterface_win9x.c
+++ /dev/null
@@ -1,1141 +0,0 @@
-/*
- * Copyright (c) 2002, 2008, 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.
- */
-
-#include
-#include
-#include
-
-#include "jni_util.h"
-
-#include "NetworkInterface.h"
-
-/*
- * Windows 9x specific routines to enumerate network interfaces and the
- * IP addresses bound to those interfaces.
- *
- * Windows 95 does not include IP helper library support by default.
- * Additionally Windows 98 can have its IP helper library support
- * trashed by certain IE installations. For these environments we
- * combine information from the registry with the list of IP addresses
- * obtained via SIO_GET_INTERFACE_LIST.
- */
-
-/*
- * Header files are missing these
- */
-#if !defined(SIO_GET_INTERFACE_LIST)
-#define SIO_GET_INTERFACE_LIST _IOR('t', 127, u_long)
-
-struct in_addr6 {
- u_char s6_addr[16];
-};
-
-struct sockaddr_in6 {
- short sin6_family;
- u_short sin6_port;
- u_long sin6_flowinfo;
- struct in_addr6 sin6_addr;
-};
-
-typedef union sockaddr_gen{
- struct sockaddr Address;
- struct sockaddr_in AddressIn;
- struct sockaddr_in6 AddressIn6;
-} sockaddr_gen;
-
-typedef struct _INTERFACE_INFO
-{
- u_long iiFlags;
- sockaddr_gen iiAddress;
- sockaddr_gen iiBroadcastAddress;
- sockaddr_gen iiNetmask;
-} INTERFACE_INFO;
-
-#define IFF_UP 0x00000001
-#endif
-
-
-#define MAX_STR_LEN 256
-
-
-/*
- * A network adapter (similiar to the netif structure except contains
- * Windows 9x specific fields).
- */
-typedef struct _adapter {
- char *name;
- char *displayName;
- int index;
- char *reg_key;
- int is_wan_driver;
- netaddr *addrs;
- struct _adapter *next;
-} adapter;
-
-
-/*
- * Cached adapter list.
- */
-static CRITICAL_SECTION cacheLock;
-static adapter *cachedAdapterList;
-
-/*
- * Initialize cache
- */
-void init_win9x() {
- InitializeCriticalSection(&cacheLock);
-}
-
-
-/*
- * Free adapter list and any addresses bound to the adpater.
- */
-static void free_adapters(adapter *adapterP) {
- adapter *curr = adapterP;
- while (curr != NULL) {
- if (curr->name != NULL)
- free(curr->name);
-
- if (curr->displayName != NULL)
- free(curr->displayName);
-
- if (curr->reg_key != NULL)
- free(curr->reg_key);
-
- if (curr->addrs != NULL)
- free_netaddr(curr->addrs);
-
- adapterP = adapterP->next;
- free(curr);
- curr = adapterP;
- }
-}
-
-
-/*
- * Returns the SIO_GET_INTERFACE_LIST output
- */
-static int getInterfaceList(JNIEnv *env, INTERFACE_INFO *infoP, DWORD dwSize) {
- SOCKET sock;
- DWORD ret;
-
- /* create a socket and do the ioctl */
- sock = socket(AF_INET, SOCK_DGRAM, 0);
- if (sock == INVALID_SOCKET) {
- JNU_ThrowByName(env, "java/lang/Error", "socket failed");
- return -1;
- }
- ret = WSAIoctl(sock, SIO_GET_INTERFACE_LIST, NULL, 0,
- infoP, dwSize, &dwSize, NULL, NULL);
- closesocket(sock);
- if (ret == SOCKET_ERROR) {
- JNU_ThrowByName(env, "java/lang/Error", "WSAIoctl failed");
- return -1;
- }
- return dwSize;
-}
-
-
-/*
- * Gross, ugly, and crude way of guessing if this is a WAN (dial-up) driver.
- * Returns 1 if it's the normal PPCMAC VxD, otherwise 0.
- */
-static int isWanDriver(char *driver) {
- LONG ret;
- HKEY hKey;
- DWORD dwLen;
- ULONG ulType;
- char key[MAX_STR_LEN];
- char vxd[MAX_STR_LEN];
-
- sprintf(key, "System\\CurrentControlSet\\Services\\Class\\%s", driver);
- ret = RegOpenKeyEx(HKEY_LOCAL_MACHINE, key, 0, KEY_READ, (PHKEY)&hKey);
- if (ret != ERROR_SUCCESS) {
- return 0;
- }
- dwLen = sizeof(vxd);
- ret = RegQueryValueEx(hKey, "DeviceVxDs", NULL, &ulType,
- (LPBYTE)vxd, &dwLen);
- RegCloseKey(hKey);
- if (ret != ERROR_SUCCESS) {
- return 0;
- }
- return (strcmp(vxd, "pppmac.vxd") == 0);
-}
-
-/*
- * Windows 9x routine to get the network adapters using the registry.
- * We enumerate HKEY_LOCAL_MACHINE\Enum and iterate through the tree
- * looking for devices of class "Net". As these devices may not have a
- * unique name we assign them a generated name.
- *
- * Returns a list of adapters without IP addresses (addrs member is NULL).
- */
-static int getAdapters(JNIEnv *env, adapter **adapterPP)
-{
- LONG ret;
- HKEY enumKey;
- DWORD dwLen;
- DWORD dwEnumKeys;
- DWORD enumIndex;
- ULONG ulType;
- int adapterCount = 0;
- adapter *adapterP = NULL;
- adapter *curr;
-
- /*
- * Start at HKEY_LOCAL_MACHINE\Enum
- */
- ret = RegOpenKeyEx(HKEY_LOCAL_MACHINE, "Enum", 0, KEY_READ, (PHKEY)&enumKey);
- if (ret != ERROR_SUCCESS) {
- return -1;
- }
- ret = RegQueryInfoKey(enumKey, NULL, NULL, NULL, &dwEnumKeys,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL);
- if (ret != ERROR_SUCCESS) {
- RegCloseKey(enumKey);
- return -1;
- }
-
- /*
- * Iterate through the sub-keys (PCI, Root, ...)
- */
- for(enumIndex = 0; enumIndexis_wan_driver = wan_device;
- curr->name = (char *)malloc(strlen(ps_name) + 1);
- if (curr->name) {
- curr->displayName = (char *)malloc(strlen(deviceDesc) + 1);
- if (curr->displayName) {
- curr->reg_key = (char *)malloc(strlen(key_name)+1);
- if (curr->reg_key == NULL) {
- free(curr->displayName);
- free(curr->name);
- free(curr);
- curr = NULL;
- }
- } else {
- free(curr->name);
- free(curr);
- curr = NULL;
- }
- } else {
- free(curr);
- curr = NULL;
- }
- }
-
- /* At OutOfMemory occurred */
- if (curr == NULL) {
- JNU_ThrowOutOfMemoryError(env, "heap allocation failure");
- free_adapters(adapterP);
- RegCloseKey(clsKey);
- RegCloseKey(nameKey);
- RegCloseKey(deviceKey);
- RegCloseKey(enumKey);
- return -1;
- }
-
- /* index starts at 1 (not 0) */
- curr->index = ++adapterCount;
-
- strcpy(curr->name, ps_name);
- strcpy(curr->displayName, deviceDesc);
- strcpy(curr->reg_key, key_name);
-
- /*
- * Put the adapter at the end of the list.
- */
- if (adapterP == NULL) {
- adapterP = curr;
- } else {
- adapter *tail = adapterP;
- while (tail->next != NULL) {
- tail = tail->next;
- }
- tail->next = curr;
- }
- }
- }
- }
- }
- RegCloseKey(clsKey);
- }
- RegCloseKey(nameKey);
- }
- RegCloseKey(deviceKey);
- }
- RegCloseKey(enumKey);
-
- /*
- * Insert an entry for the loopback interface
- */
- curr = (adapter *)calloc(1, sizeof(adapter));
- if (curr == NULL) {
- JNU_ThrowOutOfMemoryError(env, "heap allocation failure");
- free_adapters(adapterP);
- return -1;
- }
- curr->index = ++adapterCount;
- curr->name = _strdup("lo");
- curr->displayName = _strdup("TCP Loopback interface");
- curr->next = adapterP;
- *adapterPP = curr;
-
- return adapterCount;
-}
-
-/*
- * Windows 9x routine to obtain any static addresses for a specified
- * TCP/IP binding.
- *
- * We first open Enum\Network\${binding} and check that the driver
- * is TCP/IP. If so we pick up the driver and check for any IP addresses
- * in System\\CurrentControlSet\\Services\\Class\\${driver}
- *
- * Returns 0 if found, otherwise -1.
- */
-static int getStaticAddressEntry(char *binding, char *addresses) {
- LONG ret;
- HKEY hKey;
- char name[255];
- char desc[255];
- char driver[255];
- char ipaddr[255];
- DWORD dwName;
- ULONG ulType;
-
- /* assume nothing will be returned */
- strcpy(addresses, "");
-
- /*
- * Open the binding and check that it's TCP/IP
- */
- sprintf(name, "Enum\\Network\\%s", binding);
- ret = RegOpenKeyEx(HKEY_LOCAL_MACHINE, name, 0, KEY_READ, (PHKEY)&hKey);
- if (ret != ERROR_SUCCESS) {
- return -1;
- }
- dwName = sizeof(desc);
- ret = RegQueryValueEx(hKey, "DeviceDesc", NULL, &ulType,
- (LPBYTE)desc, &dwName);
- if (ret != ERROR_SUCCESS) {
- RegCloseKey(hKey);
- return -1;
- }
- if (strcmp(desc, "TCP/IP") != 0) {
- /* ignore non-TCP/IP bindings */
- RegCloseKey(hKey);
- return -1;
- }
-
- /*
- * Get the driver for this TCP/IP binding
- */
- dwName = sizeof(driver);
- ret = RegQueryValueEx(hKey, "Driver", NULL, &ulType,
- (LPBYTE)driver, &dwName);
- RegCloseKey(hKey);
- if (ret != ERROR_SUCCESS) {
- return -1;
- }
-
- /*
- * Finally check if there is an IPAddress value for this driver.
- */
- sprintf(name, "System\\CurrentControlSet\\Services\\Class\\%s", driver);
- ret = RegOpenKeyEx(HKEY_LOCAL_MACHINE, name, 0, KEY_READ, (PHKEY)&hKey);
- if (ret != ERROR_SUCCESS) {
- return -1;
- }
- dwName = sizeof(ipaddr);
- ret = RegQueryValueEx(hKey, "IPAddress", NULL, &ulType,
- (LPBYTE)ipaddr, &dwName);
- RegCloseKey(hKey);
- if (ret != ERROR_SUCCESS) {
- return -1;
- }
-
- /* Return the address(es) */
- strcpy( addresses, ipaddr );
- return 0;
-}
-
-/*
- * Windows 9x routine to enumerate the static IP addresses on a
- * particular interface using the registry.
- *
- * Returns a count of the number of addresses found.
- */
-static int getStaticAddresses(JNIEnv *env, char *reg_key, netaddr **netaddrPP)
-{
- LONG ret;
- HKEY enumKey, bindingKey;
- DWORD dwLen;
- ULONG ulType;
- char addresses[MAX_STR_LEN];
- unsigned long addr; /* IPv4 address */
- unsigned char byte;
- netaddr *netaddrP, *curr;
- int i, addrCount;
-
- /*
- * Open the HKEY_LOCAL_MACHINE\Enum\%s\%s\%s key
- */
- ret = RegOpenKeyEx(HKEY_LOCAL_MACHINE, reg_key, 0, KEY_READ,
- (PHKEY)&enumKey);
- if (ret != ERROR_SUCCESS) {
- /* interface has been removed */
- *netaddrPP = NULL;
- return 0;
- }
-
- /*
- * Iterate through each of the bindings to find any TCP/IP bindings
- * and any static address assoicated with the binding.
- */
- strcpy(addresses, "");
- addrCount = 0;
- netaddrP = NULL;
-
- ret = RegOpenKeyEx(enumKey, "Bindings", 0, KEY_READ, (PHKEY)&bindingKey);
- if (ret == ERROR_SUCCESS) {
- DWORD dwBindingKeys;
- DWORD dwBindingIndex;
-
- ret = RegQueryInfoKey(bindingKey, NULL, NULL, NULL, NULL, NULL, NULL, &dwBindingKeys,
- NULL, NULL, NULL, NULL);
- if (ret == ERROR_SUCCESS) {
- TCHAR binding[MAX_STR_LEN];
-
- dwBindingIndex=0;
- while (dwBindingIndexaddr.him4.sin_family = AF_INET;
- curr->addr.him4.sin_addr.s_addr = htonl(addr);
- curr->next = netaddrP;
-
- netaddrP = curr;
- addrCount++;
-
- /* reset the address for the next iteration */
- addr = 0;
- }
- byte = 0;
- } else {
- if (addresses[i] == '.') {
- addr = (addr << 8) | byte;
- byte = 0;
- } else {
- byte = (byte * 10) + (addresses[i] - '0');
- }
- }
- i++;
- }
- }
- }
- if (addrCount > 0) {
- break;
- }
- dwBindingIndex++;
- }
- }
- RegCloseKey(bindingKey);
- }
-
- /* close the registry */
- RegCloseKey(enumKey);
-
-
- /* return the list */
- *netaddrPP = netaddrP;
- return addrCount;
-}
-
-/*
- * Windows 9x routine to probe the registry for a DHCP allocated address.
- * This routine is only useful if we know that only one interface has its
- * address allocated using DHCP. Returns 0.0.0.0 if none or multiple
- * addresses found.0
- */
-static DWORD getDHCPAddress()
-{
- LONG ret;
- HKEY hKey;
- DWORD dwLen;
- ULONG ulType;
- char key[MAX_STR_LEN];
- int index;
- DWORD dhcp_addr = 0;
-
- index = 0;
- while (index < 99) {
- DWORD addr;
-
- sprintf(key, "SYSTEM\\CurrentControlSet\\Services\\VxD\\DHCP\\DhcpInfo%02d", index);
-
- ret = RegOpenKeyEx(HKEY_LOCAL_MACHINE, key, 0, KEY_READ, (PHKEY)&hKey);
- if (ret != ERROR_SUCCESS) {
- return dhcp_addr;
- }
-
- /*
- * On Windows 9x the DHCP address is in the DhcpIPAddress key. We
- * are assuming here that this is Windows Socket 2. If Windows
- * Sockets is the original 1.1 release then this doesn't work because
- * the IP address if in the DhcpInfo key (a blob with the first 4
- * bytes set to the IP address).
- */
- dwLen = sizeof(addr);
- ret = RegQueryValueEx(hKey, "DhcpIPAddress", NULL, &ulType,
- (LPBYTE)&addr, &dwLen);
- RegCloseKey(hKey);
-
- if (ret == ERROR_SUCCESS) {
- if (addr) {
- /* more than 1 DHCP address in registry */
- if (dhcp_addr) {
- return 0;
- }
- dhcp_addr = htonl(addr);
- }
- }
- index++;
- }
-
- /* if we get here it means we've examined 100 registry entries */
- return 0;
-}
-
-
-/*
- * Attempt to allocate the remaining addresses on addrList to the adpaters
- * on adapterList. Returns the number of address remaining.
- */
-int allocateRemaining(adapter *adapterList, int address_count, netaddr *addrList) {
- adapter *adapterP = adapterList;
- adapter *nobindingsP = NULL;
-
- /*
- * If all addresses have been assigned there's nothing to do.
- */
- if (address_count == 0) {
- return 0;
- }
-
- /*
- * Determine if there is only one adapter without an address
- */
- while (adapterP != NULL) {
- if (adapterP->addrs == NULL) {
- if (nobindingsP == NULL) {
- nobindingsP = adapterP;
- } else {
- nobindingsP = NULL;
- break;
- }
- }
- adapterP = adapterP->next;
- }
-
- /*
- * Found (only one)
- */
- if (nobindingsP) {
- nobindingsP->addrs = addrList;
- address_count = 0;
- }
-
- return address_count;
-}
-
-
-/*
- * 1. Network adapters are enumerated by traversing through the
- * HKEY_LOCAL_MACHINE\Enum tree and picking out class "Net" devices.
- *
- * 2. Address enumeration starts with the list of IP addresses returned
- * by SIO_GET_INTERFACE_LIST and then we "allocate" the addresses to
- * the network adapters enumerated in step 1. Allocation works as
- * follows :-
- *
- * i. Loopback address is assigned to the loopback interface. If there
- * is one network adapter then all other addresses must be bound
- * to that adapter.
- *
- * ii. Enumerate all static IP addresses using the registry. This allows
- * us to allocate all static IP address to the corresponding adapter.
- *
- * iii. After step ii. if there is one network adapter that has not been
- * allocated an IP address then we know that the remaining IP addresses
- * must be bound to this adapter.
- *
- * iv. If we get to this step it means we are dealing with a complex
- * configuration whereby multiple network adapters have their address
- * configured dynamically (eg: NIC using DHCP plus modem using PPP).
- * We employ a gross hack based on a crude determination done in step 1.
- * If there is a DHCP address configured and if one remaining
- * network adapter that is not a WAN adapter then the DHCP address
- * must be bound to it.
- */
-static adapter *loadConfig(JNIEnv *env) {
- adapter *adapterList;
- int adapter_count;
- INTERFACE_INFO interfaceInfo[8];
- DWORD dwSize;
- int address_count, i;
- netaddr *addrList;
-
- /*
- * Enumerate the network adapters
- */
- adapter_count = getAdapters(env, &adapterList);
- if (adapter_count < 0) {
- return NULL;
- }
- /* minimum of loopback interface */
- assert(adapter_count >= 1);
-
- /*
- * Enumerate all IP addresses as known to winsock
- */
- dwSize = getInterfaceList(env, interfaceInfo, sizeof(interfaceInfo));
- if (dwSize < 0) {
- free_adapters(adapterList);
- return NULL;
- }
- address_count = dwSize/sizeof(INTERFACE_INFO);
-
- /* minimum of loopback address */
- assert(address_count >= 1);
-
- /*
- * Create an address list (addrList) from the INTERFACE_INFO
- * structure.
- */
- addrList = NULL;
- for (i=0; iaddr.him4.sin_family = AF_INET;
- addrP->addr.him4.sin_addr.s_addr =
- ((SOCKADDR_IN *)&(interfaceInfo[i].iiAddress))->sin_addr.S_un.S_addr;
-
- addrP->next = addrList;
- addrList = addrP;
- }
-
-
- /*
- * First we assign the loopback address to the lo adapter.
- * If lo is the only adapter then we are done.
- */
- {
- adapter *loopbackAdapter;
- netaddr *addrP, *prevP;
-
- /* find the loopback adapter */
- loopbackAdapter = adapterList;
- while (strcmp(loopbackAdapter->name, "lo") != 0) {
- loopbackAdapter = loopbackAdapter->next;
- }
- assert(loopbackAdapter != NULL);
-
- /* find the loopback address and move it to the loopback adapter */
- addrP = addrList;
- prevP = NULL;
- while (addrP != NULL) {
- if (addrP->addr.him4.sin_addr.s_addr == htonl(0x7f000001)) {
- loopbackAdapter->addrs = addrP;
- if (prevP == NULL) {
- addrList = addrP->next;
- } else {
- prevP->next = addrP->next;
- }
- loopbackAdapter->addrs->next = NULL;
- address_count--;
- break;
- }
- prevP = addrP;
- addrP = addrP->next;
- }
- }
-
-
- /*
- * Special case. If there's only one network adapter then all remaining
- * IP addresses must be bound to that adapter.
- */
- address_count = allocateRemaining(adapterList, address_count, addrList);
- if (address_count == 0) {
- return adapterList;
- }
-
- /*
- * Locate any static IP addresses defined in the registry. Validate the
- * addresses against the SIO_GET_INTERFACE_LIST (as registry may have
- * stale settings). If valid we move the addresses from addrList to
- * the adapter.
- */
- {
- adapter *adapterP;
-
- adapterP = adapterList;
- while (adapterP != NULL) {
- int cnt;
- netaddr *static_addrP;
-
- /*
- * Skip loopback
- */
- if (strcmp(adapterP->name, "lo") == 0) {
- adapterP = adapterP->next;
- continue;
- }
-
- /*
- * Get the static addresses for this adapter.
- */
- cnt = getStaticAddresses(env, adapterP->reg_key, &static_addrP);
- if (cnt < 0) {
- free_netaddr(addrList);
- free(adapterList);
- return NULL;
- }
-
- /*
- * Validate against the SIO_GET_INTERFACE_LIST.
- * (avoids stale registry settings).
- */
- while (static_addrP != NULL) {
- netaddr *addrP = addrList;
- netaddr *prev = NULL;
-
- while (addrP != NULL) {
- if (addrP->addr.him4.sin_addr.s_addr == static_addrP->addr.him4.sin_addr.s_addr)
- break;
-
- prev = addrP;
- addrP = addrP->next;
- }
-
- /*
- * if addrP is not NULL it means we have a match
- * (ie: address from the registry is valid).
- */
- if (addrP != NULL) {
- /* remove from addrList */
- if (prev == NULL) {
- addrList = addrP->next;
- } else {
- prev->next = addrP->next;
- }
- address_count--;
-
- /* add to adapter list */
- addrP->next = adapterP->addrs;
- adapterP->addrs = addrP;
- }
-
- /*
- * On the next static address.
- */
- static_addrP = static_addrP->next;
- }
-
- /* not needed */
- free_netaddr(static_addrP);
-
- adapterP = adapterP->next;
- }
- }
-
-
- /*
- * Static addresses are now assigned so try again to allocate the
- * remaining addresses. This will succeed if there is one adapter
- * with a dynamically assigned address (DHCP or PPP).
- */
- address_count = allocateRemaining(adapterList, address_count, addrList);
- if (address_count == 0) {
- return adapterList;
- }
-
- /*
- * Next we see if there is a DHCP address in the registry. If there is
- * an address (and it's valid) then we know it must be bound to a LAN
- * adapter. Additionally, when we enumerate the network adapters
- * we made a crude determination on if an adapter is dial-up. Thus if
- * we know there is one remaining LAN adapter without an IP address
- * then the DHCP address must be bound to it.
- */
- {
- long dhcp_addr = getDHCPAddress(); /* returns in network order */
- if (dhcp_addr) {
- netaddr *addrP, *prevP;
-
- /*
- * Check that the DHCP address is valid
- */
- addrP = addrList;
- prevP = NULL;
- while (addrP != NULL) {
- if (addrP->addr.him4.sin_addr.s_addr == dhcp_addr) {
- break;
- }
- prevP = addrP;
- addrP = addrP->next;
- }
-
- /*
- * Address is valid - now check how many non-WAN adapters
- * don't have addresses yet.
- */
- if (addrP != NULL) {
- adapter *adapterP = adapterList;
- adapter *nobindingsP = NULL;
-
- while (adapterP != NULL) {
- if (adapterP->addrs == NULL && !adapterP->is_wan_driver) {
- if (nobindingsP == NULL) {
- nobindingsP = adapterP;
- } else {
- /* already found one */
- nobindingsP = NULL;
- break;
- }
- }
- adapterP = adapterP->next;
- }
-
- /*
- * One non-WAN adapter remaining
- */
- if (nobindingsP != NULL) {
- nobindingsP->addrs = addrP;
-
- /* remove from addrList */
- if (prevP == NULL) {
- addrList = addrP->next;
- } else {
- prevP->next = addrP->next;
- }
- addrP->next = NULL;
- address_count--;
- }
- }
- }
- }
-
- /*
- * Finally we do one final attempt to re-assign any remaining
- * addresses. This catches the case of 2 adapters that have their
- * addresses dynamically assigned (specifically NIC with DHCP, and
- * Modem using RAS/PPP).
- */
- address_count = allocateRemaining(adapterList, address_count, addrList);
- if (address_count == 0) {
- return adapterList;
- }
-
- /*
- * Free any unallocated addresses
- */
- if (address_count > 0) {
- free_netaddr(addrList);
- }
-
- /*
- * Return the adapter List.
- */
- return adapterList;
-
-}
-
-
-/*
- * Enumerate network interfaces. If successful returns the number of
- * network interfaces and netifPP returning a list of netif structures.
- * Returns -1 with exception thrown if error.
- */
-int enumInterfaces_win9x(JNIEnv *env, netif **netifPP) {
- adapter *adapters, *adapterP;
- int cnt = 0;
- netif *netifP = NULL;
-
- /* enumerate network configuration */
- adapters = loadConfig(env);
- if (adapters == NULL) {
- return -1;
- }
-
- /*
- * loadConfig returns an adapter list - we need to create a corresponding
- * list of netif structures.
- */
- adapterP = adapters;
- while (adapterP != NULL) {
- netif *ifs = (netif *)calloc(1, sizeof(netif));
-
- if (ifs == NULL) {
- JNU_ThrowOutOfMemoryError(env, "heap allocation failure");
- free_adapters(adapters);
- free_netif(netifP);
- return -1;
- }
-
- ifs->name = _strdup(adapterP->name);
- ifs->displayName = _strdup(adapterP->displayName);
- ifs->dwIndex = adapterP->index;
- ifs->index = adapterP->index;
- ifs->next = netifP;
- netifP = ifs;
-
- if (ifs->name == NULL || ifs->displayName == NULL) {
- JNU_ThrowOutOfMemoryError(env, "heap allocation failure");
- free_adapters(adapters);
- free_netif(netifP);
- return -1;
- }
-
- cnt++;
- adapterP = adapterP->next;
- }
-
- /*
- * Put the adapter list in the cache
- */
- EnterCriticalSection(&cacheLock);
- {
- if (cachedAdapterList != NULL) {
- free_adapters(cachedAdapterList);
- }
- cachedAdapterList = adapters;
- }
- LeaveCriticalSection(&cacheLock);
-
- /*
- * Return the netif list
- */
- *netifPP = netifP;
- return cnt;
-}
-
-/*
- * Enumerate the addresses for the specified network interface. If successful
- * returns the number of addresses bound to the interface and sets netaddrPP
- * to be a list of netaddr structures. Returns -1 if error.
- */
-int enumAddresses_win9x(JNIEnv *env, netif *netifP, netaddr **netaddrPP) {
-
- EnterCriticalSection(&cacheLock);
- {
- adapter *adapterP = cachedAdapterList;
- while (adapterP != NULL) {
- if (strcmp(adapterP->name, netifP->name) == 0) {
-
- netaddr *newlist = NULL;
- netaddr *curr = adapterP->addrs;
- int cnt = 0;
-
- while (curr != NULL) {
- /*
- * Clone the netaddr and add it to newlist.
- */
- netaddr *tmp = (netaddr *)calloc(1, sizeof(netaddr));
- if (tmp == NULL) {
- LeaveCriticalSection(&cacheLock);
- JNU_ThrowOutOfMemoryError(env, "heap allocation failure");
- free_netaddr(newlist);
- return -1;
- }
- tmp->addr = curr->addr;
- tmp->next = newlist;
- newlist = tmp;
-
- cnt++;
- curr = curr->next;
- }
-
- *netaddrPP = newlist;
- LeaveCriticalSection(&cacheLock);
- return cnt;
- }
- adapterP = adapterP->next;
- }
- }
- LeaveCriticalSection(&cacheLock);
-
- *netaddrPP = NULL;
- return 0;
-}
diff --git a/src/windows/native/java/net/NetworkInterface_winXP.c b/src/windows/native/java/net/NetworkInterface_winXP.c
index 283be81b89ae7a54ef4d8763cb1b036dd3f970e6..ecfab4967db5cb2fbd1c9a55aa24d2d28c750d79 100644
--- a/src/windows/native/java/net/NetworkInterface_winXP.c
+++ b/src/windows/native/java/net/NetworkInterface_winXP.c
@@ -43,14 +43,6 @@
extern int enumAddresses_win(JNIEnv *env, netif *netifP, netaddr **netaddrPP);
int getAddrsFromAdapter(IP_ADAPTER_ADDRESSES *ptr, netaddr **netaddrPP);
-/* IP helper library routines */
-int (PASCAL FAR *GetIpAddrTable_fn)();
-int (PASCAL FAR *GetIfTable_fn)();
-int (PASCAL FAR *GetFriendlyIfIndex_fn)();
-int (PASCAL FAR *GetAdaptersAddresses_fn)();
-int (PASCAL FAR *GetAdaptersInfo_fn)();
-int (PASCAL FAR *GetNumberOfInterfaces_fn)();
-
#ifdef DEBUG
void printnif (netif *nif) {
#ifdef _WIN64
@@ -96,14 +88,14 @@ static int getAdapters (JNIEnv *env, IP_ADAPTER_ADDRESSES **adapters) {
flags = GAA_FLAG_SKIP_DNS_SERVER;
flags |= GAA_FLAG_SKIP_MULTICAST;
flags |= GAA_FLAG_INCLUDE_PREFIX;
- ret = (*GetAdaptersAddresses_fn) (AF_UNSPEC, flags, NULL, adapterInfo, &len);
+ ret = GetAdaptersAddresses(AF_UNSPEC, flags, NULL, adapterInfo, &len);
if (ret == ERROR_BUFFER_OVERFLOW) {
adapterInfo = (IP_ADAPTER_ADDRESSES *) realloc (adapterInfo, len);
if (adapterInfo == 0) {
return -1;
}
bufsize = len;
- ret = (*GetAdaptersAddresses_fn) (AF_UNSPEC, flags, NULL, adapterInfo, &len);
+ ret = GetAdaptersAddresses(AF_UNSPEC, flags, NULL, adapterInfo, &len);
}
if (ret != ERROR_SUCCESS) {
free (adapterInfo);
@@ -133,7 +125,7 @@ IP_ADAPTER_ADDRESSES *getAdapter (JNIEnv *env, jint index) {
flags = GAA_FLAG_SKIP_DNS_SERVER;
flags |= GAA_FLAG_SKIP_MULTICAST;
flags |= GAA_FLAG_INCLUDE_PREFIX;
- val = (*GetAdaptersAddresses_fn) (AF_UNSPEC, flags, NULL, adapterInfo, &len);
+ val = GetAdaptersAddresses(AF_UNSPEC, flags, NULL, adapterInfo, &len);
if (val == ERROR_BUFFER_OVERFLOW) {
adapterInfo = (IP_ADAPTER_ADDRESSES *) realloc (adapterInfo, len);
if (adapterInfo == 0) {
@@ -141,7 +133,7 @@ IP_ADAPTER_ADDRESSES *getAdapter (JNIEnv *env, jint index) {
return NULL;
}
bufsize = len;
- val = (*GetAdaptersAddresses_fn) (AF_UNSPEC, flags, NULL, adapterInfo, &len);
+ val = GetAdaptersAddresses(AF_UNSPEC, flags, NULL, adapterInfo, &len);
}
if (val != ERROR_SUCCESS) {
free (adapterInfo);
@@ -182,7 +174,7 @@ int getAllInterfacesAndAddresses (JNIEnv *env, netif **netifPP)
* as what previous JDK versions would return.
*/
- ret = enumInterfaces_win (env, netifPP);
+ ret = enumInterfaces(env, netifPP);
if (ret == -1) {
return -1;
} else {
@@ -221,7 +213,7 @@ int getAllInterfacesAndAddresses (JNIEnv *env, netif **netifPP)
* (b) IPv6 information for IPv6 only interfaces (probably tunnels)
*
* For compatibility with previous releases we use the naming
- * information gotten from enumInterfaces_win() for (a) entries
+ * information gotten from enumInterfaces() for (a) entries
* However, the index numbers are taken from the new API.
*
* The procedure is to go through the list of adapters returned
@@ -439,7 +431,8 @@ static jobject createNetworkInterfaceXP(JNIEnv *env, netif *ifs)
netifObj = (*env)->NewObject(env, ni_class, ni_ctor);
name = (*env)->NewStringUTF(env, ifs->name);
if (ifs->dNameIsUnicode) {
- displayName = (*env)->NewString(env, (PWCHAR)ifs->displayName, wcslen ((PWCHAR)ifs->displayName));
+ displayName = (*env)->NewString(env, (PWCHAR)ifs->displayName,
+ (jsize)wcslen ((PWCHAR)ifs->displayName));
} else {
displayName = (*env)->NewStringUTF(env, ifs->displayName);
}
diff --git a/src/windows/native/java/net/TwoStacksPlainSocketImpl.c b/src/windows/native/java/net/TwoStacksPlainSocketImpl.c
index 71e2b2b124ec6df748b82cee001f4c07f1561800..9c1ffee6c1a3633b8a70f5708de39a29bff6f182 100644
--- a/src/windows/native/java/net/TwoStacksPlainSocketImpl.c
+++ b/src/windows/native/java/net/TwoStacksPlainSocketImpl.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2011, 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
diff --git a/src/windows/native/java/net/net_util_md.c b/src/windows/native/java/net/net_util_md.c
index ffaf52078aa4589672ef4ce4238e9985dc3936df..4cf522e786a908212da1c425774b4b33dba06a60 100644
--- a/src/windows/native/java/net/net_util_md.c
+++ b/src/windows/native/java/net/net_util_md.c
@@ -39,10 +39,6 @@
/* true if SO_RCVTIMEO is supported */
jboolean isRcvTimeoutSupported = JNI_TRUE;
-LPFN_GETADDRINFO getaddrinfo_ptr = NULL;
-LPFN_FREEADDRINFO freaddrinfo_ptr = NULL;
-LPFN_GETNAMEINFO getnameinfo_ptr = NULL;
-
/*
* Table of Windows Sockets errors, the specific exception we
* throw for the error, and the error text.
@@ -233,38 +229,15 @@ NET_GetFileDescriptorID(JNIEnv *env)
jint IPv6_supported()
{
- HMODULE lib;
- int fd = socket(AF_INET6, SOCK_STREAM, 0) ;
- if (fd < 0) {
+ SOCKET s = socket(AF_INET6, SOCK_STREAM, 0) ;
+ if (s == INVALID_SOCKET) {
return JNI_FALSE;
}
- closesocket (fd);
-
- if ((lib = LoadLibrary ("ws2_32.dll")) == NULL) {
- return JNI_FALSE;
- }
- if ((getaddrinfo_ptr = (LPFN_GETADDRINFO)GetProcAddress (lib, "getaddrinfo")) == NULL) {
- FreeLibrary (lib);
- return JNI_FALSE;
- }
- if ((freeaddrinfo_ptr = (LPFN_FREEADDRINFO)GetProcAddress (lib, "freeaddrinfo")) == NULL) {
- FreeLibrary (lib);
- return JNI_FALSE;
- }
- if ((getnameinfo_ptr = (LPFN_GETNAMEINFO)GetProcAddress (lib, "getnameinfo")) == NULL) {
- FreeLibrary (lib);
- return JNI_FALSE;
- }
- FreeLibrary(lib);
+ closesocket(s);
return JNI_TRUE;
}
-jboolean NET_addrtransAvailable() {
- return (jboolean)(getaddrinfo_ptr != NULL);
-}
-
-
/*
* Return the default TOS value
*/
@@ -664,7 +637,7 @@ NET_BindV6(struct ipv6bind* b) {
if (family == AF_INET && (b->addr->him4.sin_addr.s_addr != INADDR_ANY)) {
/* bind to v4 only */
int ret;
- ret = NET_Bind (b->ipv4_fd, (struct sockaddr *)b->addr,
+ ret = NET_Bind ((int)b->ipv4_fd, (struct sockaddr *)b->addr,
sizeof (struct sockaddr_in));
if (ret == SOCKET_ERROR) {
CLOSE_SOCKETS_AND_RETURN;
@@ -676,7 +649,7 @@ NET_BindV6(struct ipv6bind* b) {
if (family == AF_INET6 && (!IN6_IS_ADDR_ANY(&b->addr->him6.sin6_addr))) {
/* bind to v6 only */
int ret;
- ret = NET_Bind (b->ipv6_fd, (struct sockaddr *)b->addr,
+ ret = NET_Bind ((int)b->ipv6_fd, (struct sockaddr *)b->addr,
sizeof (struct SOCKADDR_IN6));
if (ret == SOCKET_ERROR) {
CLOSE_SOCKETS_AND_RETURN;
@@ -691,15 +664,15 @@ NET_BindV6(struct ipv6bind* b) {
memset (&oaddr, 0, sizeof(oaddr));
if (family == AF_INET) {
ofamily = AF_INET6;
- fd = b->ipv4_fd;
- ofd = b->ipv6_fd;
+ fd = (int)b->ipv4_fd;
+ ofd = (int)b->ipv6_fd;
port = (u_short)GET_PORT (b->addr);
IN6ADDR_SETANY (&oaddr.him6);
oaddr.him6.sin6_port = port;
} else {
ofamily = AF_INET;
- ofd = b->ipv4_fd;
- fd = b->ipv6_fd;
+ ofd = (int)b->ipv4_fd;
+ fd = (int)b->ipv6_fd;
port = (u_short)GET_PORT (b->addr);
oaddr.him4.sin_family = AF_INET;
oaddr.him4.sin_port = port;
@@ -744,11 +717,11 @@ NET_BindV6(struct ipv6bind* b) {
b->ipv6_fd = SOCKET_ERROR;
/* create two new sockets */
- fd = socket (family, sotype, 0);
+ fd = (int)socket (family, sotype, 0);
if (fd == SOCKET_ERROR) {
CLOSE_SOCKETS_AND_RETURN;
}
- ofd = socket (ofamily, sotype, 0);
+ ofd = (int)socket (ofamily, sotype, 0);
if (ofd == SOCKET_ERROR) {
CLOSE_SOCKETS_AND_RETURN;
}
@@ -802,7 +775,7 @@ jint getDefaultIPv6Interface(JNIEnv *env, struct SOCKADDR_IN6 *target_addr)
DWORD b;
struct sockaddr_in6 route;
SOCKET fd = socket(AF_INET6, SOCK_STREAM, 0);
- if (fd < 0) {
+ if (fd == INVALID_SOCKET) {
return 0;
}
@@ -810,7 +783,7 @@ jint getDefaultIPv6Interface(JNIEnv *env, struct SOCKADDR_IN6 *target_addr)
(void *)target_addr, sizeof(struct sockaddr_in6),
(void *)&route, sizeof(struct sockaddr_in6),
&b, 0, 0);
- if (ret < 0) {
+ if (ret == SOCKET_ERROR) {
// error
closesocket(fd);
return 0;
@@ -1001,10 +974,10 @@ NET_Wait(JNIEnv *env, jint fd, jint flags, jint timeout)
}
int NET_Socket (int domain, int type, int protocol) {
- int sock;
+ SOCKET sock;
sock = socket (domain, type, protocol);
if (sock != INVALID_SOCKET) {
SetHandleInformation((HANDLE)(uintptr_t)sock, HANDLE_FLAG_INHERIT, FALSE);
}
- return sock;
+ return (int)sock;
}
diff --git a/src/windows/native/java/net/net_util_md.h b/src/windows/native/java/net/net_util_md.h
index b1a37e9b8260aa9af52696d8b6e7dd8d8aa38e10..e764260bb24a861e929fd998464ed98a0aa87146 100644
--- a/src/windows/native/java/net/net_util_md.h
+++ b/src/windows/native/java/net/net_util_md.h
@@ -209,10 +209,6 @@ int
);
#endif
-LPFN_GETADDRINFO getaddrinfo_ptr;
-LPFN_FREEADDRINFO freeaddrinfo_ptr;
-LPFN_GETNAMEINFO getnameinfo_ptr;
-
/* used to disable connection reset messages on Windows XP */
#ifndef SIO_UDP_CONNRESET
#define SIO_UDP_CONNRESET _WSAIOW(IOC_VENDOR,12)
@@ -302,8 +298,6 @@ void NET_ThrowByNameWithLastError(JNIEnv *env, const char *name,
void NET_ThrowSocketException(JNIEnv *env, char* msg);
-jboolean NET_addrtransAvailable();
-
/*
* differs from NET_Timeout() as follows:
*
diff --git a/src/windows/native/sun/java2d/d3d/D3DGraphicsDevice.cpp b/src/windows/native/sun/java2d/d3d/D3DGraphicsDevice.cpp
index efb20c5d3a32b26cfdba26d0daa398cf3bfb5d35..b20bd9c278dd2c85412334878e6dc430a942389f 100644
--- a/src/windows/native/sun/java2d/d3d/D3DGraphicsDevice.cpp
+++ b/src/windows/native/sun/java2d/d3d/D3DGraphicsDevice.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2011, 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
diff --git a/src/windows/native/sun/java2d/windows/GDIBlitLoops.cpp b/src/windows/native/sun/java2d/windows/GDIBlitLoops.cpp
index d3dc21dae146533964006b41f974c4143b6ee90b..5f8889777130d26aa23e25260dc699dd4ac0c181 100644
--- a/src/windows/native/sun/java2d/windows/GDIBlitLoops.cpp
+++ b/src/windows/native/sun/java2d/windows/GDIBlitLoops.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2011, 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
diff --git a/src/windows/native/sun/management/FileSystemImpl.c b/src/windows/native/sun/management/FileSystemImpl.c
index 57abea98541f07ba501fed3057061960da04417a..0747121d35a7b8d47dfc37a17caba9fb089ae6dd 100644
--- a/src/windows/native/sun/management/FileSystemImpl.c
+++ b/src/windows/native/sun/management/FileSystemImpl.c
@@ -36,45 +36,6 @@
*/
#define ANY_ACCESS (FILE_GENERIC_READ | FILE_GENERIC_WRITE | FILE_GENERIC_EXECUTE)
-/*
- * Function prototypes for security functions - we can't statically
- * link because these functions aren't on Windows 9x.
- */
-typedef BOOL (WINAPI *GetFileSecurityFunc)
- (LPCTSTR lpFileName, SECURITY_INFORMATION RequestedInformation,
- PSECURITY_DESCRIPTOR pSecurityDescriptor, DWORD nLength,
- LPDWORD lpnLengthNeeded);
-
-typedef BOOL (WINAPI *GetSecurityDescriptorOwnerFunc)
- (PSECURITY_DESCRIPTOR pSecurityDescriptor, PSID *pOwner,
- LPBOOL lpbOwnerDefaulted);
-
-typedef BOOL (WINAPI *GetSecurityDescriptorDaclFunc)
- (PSECURITY_DESCRIPTOR pSecurityDescriptor, LPBOOL lpbDaclPresent,
- PACL *pDacl, LPBOOL lpbDaclDefaulted);
-
-typedef BOOL (WINAPI *GetAclInformationFunc)
- (PACL pAcl, LPVOID pAclInformation, DWORD nAclInformationLength,
- ACL_INFORMATION_CLASS dwAclInformationClass);
-
-typedef BOOL (WINAPI *GetAceFunc)
- (PACL pAcl, DWORD dwAceIndex, LPVOID *pAce);
-
-typedef BOOL (WINAPI *EqualSidFunc)(PSID pSid1, PSID pSid2);
-
-
-/* Addresses of the security functions */
-static GetFileSecurityFunc GetFileSecurity_func;
-static GetSecurityDescriptorOwnerFunc GetSecurityDescriptorOwner_func;
-static GetSecurityDescriptorDaclFunc GetSecurityDescriptorDacl_func;
-static GetAclInformationFunc GetAclInformation_func;
-static GetAceFunc GetAce_func;
-static EqualSidFunc EqualSid_func;
-
-/* True if this OS is NT kernel based (NT/2000/XP) */
-static int isNT;
-
-
/*
* Returns JNI_TRUE if the specified file is on a file system that supports
* persistent ACLs (On NTFS file systems returns true, on FAT32 file systems
@@ -165,7 +126,7 @@ static SECURITY_DESCRIPTOR* getFileSecurityDescriptor(JNIEnv* env, const char* p
SECURITY_INFORMATION info =
OWNER_SECURITY_INFORMATION | DACL_SECURITY_INFORMATION;
- (*GetFileSecurity_func)(path, info , 0, 0, &len);
+ GetFileSecurityA(path, info , 0, 0, &len);
if (GetLastError() != ERROR_INSUFFICIENT_BUFFER) {
JNU_ThrowIOExceptionWithLastError(env, "GetFileSecurity failed");
return NULL;
@@ -174,7 +135,7 @@ static SECURITY_DESCRIPTOR* getFileSecurityDescriptor(JNIEnv* env, const char* p
if (sd == NULL) {
JNU_ThrowOutOfMemoryError(env, 0);
} else {
- if (!(*GetFileSecurity_func)(path, info, sd, len, &len)) {
+ if (!(*GetFileSecurityA)(path, info, sd, len, &len)) {
JNU_ThrowIOExceptionWithLastError(env, "GetFileSecurity failed");
free(sd);
return NULL;
@@ -191,7 +152,7 @@ static SID* getFileOwner(JNIEnv* env, SECURITY_DESCRIPTOR* sd) {
SID* owner;
BOOL defaulted;
- if (!(*GetSecurityDescriptorOwner_func)(sd, &owner, &defaulted)) {
+ if (!GetSecurityDescriptorOwner(sd, &owner, &defaulted)) {
JNU_ThrowIOExceptionWithLastError(env, "GetSecurityDescriptorOwner failed");
return NULL;
}
@@ -206,7 +167,7 @@ static ACL* getFileDACL(JNIEnv* env, SECURITY_DESCRIPTOR* sd) {
ACL *acl;
int defaulted, present;
- if (!(*GetSecurityDescriptorDacl_func)(sd, &present, &acl, &defaulted)) {
+ if (!GetSecurityDescriptorDacl(sd, &present, &acl, &defaulted)) {
JNU_ThrowIOExceptionWithLastError(env, "GetSecurityDescriptorDacl failed");
return NULL;
}
@@ -235,8 +196,8 @@ static jboolean isAccessUserOnly(JNIEnv* env, SID* owner, ACL* acl) {
/*
* Get the ACE count
*/
- if (!(*GetAclInformation_func)(acl, (void *) &acl_size_info, sizeof(acl_size_info),
- AclSizeInformation)) {
+ if (!GetAclInformation(acl, (void *) &acl_size_info, sizeof(acl_size_info),
+ AclSizeInformation)) {
JNU_ThrowIOExceptionWithLastError(env, "GetAclInformation failed");
return JNI_FALSE;
}
@@ -250,7 +211,7 @@ static jboolean isAccessUserOnly(JNIEnv* env, SID* owner, ACL* acl) {
ACCESS_ALLOWED_ACE *access;
SID* sid;
- if (!(*GetAce_func)(acl, i, &ace)) {
+ if (!GetAce(acl, i, &ace)) {
JNU_ThrowIOExceptionWithLastError(env, "GetAce failed");
return -1;
}
@@ -280,51 +241,7 @@ static jboolean isAccessUserOnly(JNIEnv* env, SID* owner, ACL* acl) {
JNIEXPORT void JNICALL Java_sun_management_FileSystemImpl_init0
(JNIEnv *env, jclass ignored)
{
- OSVERSIONINFO ver;
- HINSTANCE hInst;
-
- /*
- * Get the OS version. If dwPlatformId is VER_PLATFORM_WIN32_NT
- * it means we're running on a Windows NT, 2000, or XP machine.
- */
- ver.dwOSVersionInfoSize = sizeof(ver);
- GetVersionEx(&ver);
- isNT = (ver.dwPlatformId == VER_PLATFORM_WIN32_NT);
- if (!isNT) {
- return;
- }
-
- /*
- * On NT/2000/XP we need the addresses of the security functions
- */
- hInst = LoadLibrary("ADVAPI32.DLL");
- if (hInst == NULL) {
- JNU_ThrowIOExceptionWithLastError(env, "Unable to load ADVAPI32.DLL");
- return;
- }
-
-
- GetFileSecurity_func = (GetFileSecurityFunc)GetProcAddress(hInst, "GetFileSecurityA");
- GetSecurityDescriptorOwner_func =
- (GetSecurityDescriptorOwnerFunc)GetProcAddress(hInst, "GetSecurityDescriptorOwner");
- GetSecurityDescriptorDacl_func =
- (GetSecurityDescriptorDaclFunc)GetProcAddress(hInst, "GetSecurityDescriptorDacl");
- GetAclInformation_func =
- (GetAclInformationFunc)GetProcAddress(hInst, "GetAclInformation");
- GetAce_func = (GetAceFunc)GetProcAddress(hInst, "GetAce");
- EqualSid_func = (EqualSidFunc)GetProcAddress(hInst, "EqualSid");
-
- if (GetFileSecurity_func == NULL ||
- GetSecurityDescriptorDacl_func == NULL ||
- GetSecurityDescriptorDacl_func == NULL ||
- GetAclInformation_func == NULL ||
- GetAce_func == NULL ||
- EqualSid_func == NULL)
- {
- JNU_ThrowIOExceptionWithLastError(env,
- "Unable to get address of security functions");
- return;
- }
+ /* nothing to do */
}
/*
@@ -339,10 +256,6 @@ JNIEXPORT jboolean JNICALL Java_sun_management_FileSystemImpl_isSecuritySupporte
jboolean isCopy;
const char* path;
- if (!isNT) {
- return JNI_FALSE;
- }
-
path = JNU_GetStringPlatformChars(env, str, &isCopy);
if (path != NULL) {
res = isSecuritySupported(env, path);
diff --git a/src/windows/native/sun/net/dns/ResolverConfigurationImpl.c b/src/windows/native/sun/net/dns/ResolverConfigurationImpl.c
index 21a87afa25ecf2f3ddef3d7a5ac3dd203db1b206..8885bdc79020423fd434d470a1690aaf0ab5c49c 100644
--- a/src/windows/native/sun/net/dns/ResolverConfigurationImpl.c
+++ b/src/windows/native/sun/net/dns/ResolverConfigurationImpl.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2011, 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
@@ -30,6 +30,7 @@
#include
#include
#include
+#include
#include "jni_util.h"
@@ -42,93 +43,17 @@
#define IS_SL_FOUND(sts) (sts & STS_SL_FOUND)
#define IS_NS_FOUND(sts) (sts & STS_NS_FOUND)
-/*
- * Visual C++ SP3 (as required by J2SE 1.4.0) is missing some of
- * the definitions required for the IP helper library routines that
- * were added in Windows 98 & Windows 2000.
- */
-#ifndef MAX_ADAPTER_NAME_LENGTH
-
-#define MAX_ADAPTER_ADDRESS_LENGTH 8
-#define MAX_ADAPTER_DESCRIPTION_LENGTH 128
-#define MAX_ADAPTER_NAME_LENGTH 256
-#define MAX_HOSTNAME_LEN 128
-#define MAX_DOMAIN_NAME_LEN 128
-#define MAX_SCOPE_ID_LEN 256
-
-typedef struct {
- char String[4 * 4];
-} IP_ADDRESS_STRING, *PIP_ADDRESS_STRING, IP_MASK_STRING, *PIP_MASK_STRING;
-
-typedef struct _IP_ADDR_STRING {
- struct _IP_ADDR_STRING* Next;
- IP_ADDRESS_STRING IpAddress;
- IP_MASK_STRING IpMask;
- DWORD Context;
-} IP_ADDR_STRING, *PIP_ADDR_STRING;
-
-typedef struct _IP_ADAPTER_INFO {
- struct _IP_ADAPTER_INFO* Next;
- DWORD ComboIndex;
- char AdapterName[MAX_ADAPTER_NAME_LENGTH + 4];
- char Description[MAX_ADAPTER_DESCRIPTION_LENGTH + 4];
- UINT AddressLength;
- BYTE Address[MAX_ADAPTER_ADDRESS_LENGTH];
- DWORD Index;
- UINT Type;
- UINT DhcpEnabled;
- PIP_ADDR_STRING CurrentIpAddress;
- IP_ADDR_STRING IpAddressList;
- IP_ADDR_STRING GatewayList;
- IP_ADDR_STRING DhcpServer;
- BOOL HaveWins;
- IP_ADDR_STRING PrimaryWinsServer;
- IP_ADDR_STRING SecondaryWinsServer;
- time_t LeaseObtained;
- time_t LeaseExpires;
-} IP_ADAPTER_INFO, *PIP_ADAPTER_INFO;
-
-typedef struct _FIXED_INFO {
- char HostName[MAX_HOSTNAME_LEN + 4] ;
- char DomainName[MAX_DOMAIN_NAME_LEN + 4];
- PIP_ADDR_STRING CurrentDnsServer;
- IP_ADDR_STRING DnsServerList;
- UINT NodeType;
- char ScopeId[MAX_SCOPE_ID_LEN + 4];
- UINT EnableRouting;
- UINT EnableProxy;
- UINT EnableDns;
-} FIXED_INFO, *PFIXED_INFO;
-
-#endif
-
-
-/* IP helper library routine used on 98/2000/XP */
-static int (PASCAL FAR *GetNetworkParams_fn)();
-static int (PASCAL FAR *GetAdaptersInfo_fn)();
-static int (PASCAL FAR *NotifyAddrChange_fn)();
-
-/*
- * Routines to obtain domain name and name servers are OS specific
- */
-typedef int (*LoadConfig)(char *sl, char *ns);
-static LoadConfig loadconfig_fn;
-
-
-/*
- * JNI ids
- */
+/* JNI ids */
static jfieldID searchlistID;
static jfieldID nameserversID;
-
/*
* Utility routine to append s2 to s1 with a space delimiter.
* strappend(s1="abc", "def") => "abc def"
* strappend(s1="", "def") => "def
*/
void strappend(char *s1, char *s2) {
- int len;
+ size_t len;
if (s2[0] == '\0') /* nothing to append */
return;
@@ -145,356 +70,6 @@ void strappend(char *s1, char *s2) {
strcat(s1, s2);
}
-
-/*
- * Windows 95/98/ME for static TCP/IP configuration.
- *
- * Use registry approach for statically configured TCP/IP settings.
- * Registry entries described in "MS TCP/IP and Windows 95 Networking"
- * (Microsoft TechNet site).
- */
-static int loadStaticConfig9x(char *sl, char *ns) {
- LONG ret;
- HANDLE hKey;
- DWORD dwLen;
- ULONG ulType;
- char result[MAX_STR_LEN];
- int sts = STS_NO_CONFIG;
-
- ret = RegOpenKeyEx(HKEY_LOCAL_MACHINE,
- "SYSTEM\\CurrentControlSet\\Services\\VxD\\MSTCP",
- 0,
- KEY_READ,
- (PHKEY)&hKey);
- if (ret == ERROR_SUCCESS) {
- /*
- * Determine suffix list
- */
- result[0] = '\0';
- dwLen = sizeof(result);
- ret = RegQueryValueEx(hKey, "SearchList", NULL, &ulType,
- (LPBYTE)&result, &dwLen);
- if ((ret != ERROR_SUCCESS) || (strlen(result) == 0)) {
- dwLen = sizeof(result);
- ret = RegQueryValueEx(hKey, "Domain", NULL, &ulType,
- (LPBYTE)&result, &dwLen);
- }
- if (ret == ERROR_SUCCESS) {
- assert(ulType == REG_SZ);
- if (strlen(result) > 0) {
- strappend(sl, result);
- sts |= STS_SL_FOUND;
- }
- }
-
- /*
- * Determine DNS name server(s)
- */
- result[0] = '\0';
- dwLen = sizeof(result);
- ret = RegQueryValueEx(hKey, "NameServer", NULL, &ulType,
- (LPBYTE)&result, &dwLen);
- if (ret == ERROR_SUCCESS) {
- assert(ulType == REG_SZ);
- if (strlen(result) > 0) {
- strappend(ns, result);
- sts |= STS_NS_FOUND;
- }
- }
-
- RegCloseKey(hKey);
- }
-
- return sts;
-}
-
-
-/*
- * Windows 95
- *
- * Use registry approach for statically configured TCP/IP settings
- * (see loadStaticConfig9x).
- *
- * If DHCP is used we examine the DHCP vendor specific extensions. We parse
- * this based on format described in RFC 2132.
- *
- * If Dial-up Networking (DUN) is used then this TCP/IP settings cannot
- * be determined here.
- */
-static int loadConfig95(char *sl, char *ns) {
- int sts;
- int index;
- LONG ret;
- HANDLE hKey;
- DWORD dwLen;
- ULONG ulType;
- char optionInfo[MAX_STR_LEN];
-
- /*
- * First try static configuration - if found we are done.
- */
- sts = loadStaticConfig9x(sl, ns);
- if (IS_SL_FOUND(sts) && IS_NS_FOUND(sts)) {
- return sts;
- }
-
- /*
- * Try DHCP. DHCP information is stored in :-
- * SYSTEM\CurrentControlSet\Services\VxD\DHCP\DhcpInfoXX
- *
- * The key is normally DhcpInfo00\OptionInfo (see Article Q255245 on
- * Microsoft site). However when multiple cards are added & removed we
- * have observed that it can be located in DhcpInfo{01,02, ...}.
- * As a hack we search all DhcpInfoXX keys until we find OptionInfo.
- */
- for (index=0; index<99; index++) {
- char key[MAX_STR_LEN];
- sprintf(key, "SYSTEM\\CurrentControlSet\\Services\\VxD\\DHCP\\DhcpInfo%02d",
- index);
-
- ret = RegOpenKeyEx(HKEY_LOCAL_MACHINE, key, 0, KEY_READ, (PHKEY)&hKey);
- if (ret != ERROR_SUCCESS) {
- /* end of DhcpInfoXX entries */
- break;
- }
-
- dwLen = sizeof(optionInfo);
- ret = RegQueryValueEx(hKey, "OptionInfo", NULL, &ulType,
- (LPBYTE)optionInfo, &dwLen);
- RegCloseKey(hKey);
-
- if (ret == ERROR_SUCCESS) {
- /* OptionInfo found */
- break;
- }
- }
-
- /*
- * If OptionInfo was found then we parse (as the 'options' field of
- * the DHCP packet - see RFC 2132).
- */
- if (ret == ERROR_SUCCESS) {
- unsigned int pos = 0;
-
- while (pos < dwLen) {
- int code, len;
-
- code = optionInfo[pos];
- pos++;
- if (pos >= dwLen) break; /* bad packet */
-
- len = optionInfo[pos];
- pos++;
-
- if (pos+len > dwLen) break; /* bad packet */
-
- /*
- * Domain Name - see RFC 2132 section 3.17
- */
- if (!IS_SL_FOUND(sts)) {
- if (code == 0xf) {
- char domain[MAX_STR_LEN];
-
- assert(len < MAX_STR_LEN);
-
- memcpy((void *)domain, (void *)&(optionInfo[pos]), (size_t)len);
- domain[len] = '\0';
-
- strappend(sl, domain);
- sts |= STS_SL_FOUND;
- }
- }
-
- /*
- * DNS Option - see RFC 2132 section 3.8
- */
- if (!IS_NS_FOUND(sts)) {
- if (code == 6 && (len % 4) == 0) {
- while (len > 0 && pos < dwLen) {
- char addr[32];
- sprintf(addr, "%d.%d.%d.%d",
- (unsigned char)optionInfo[pos],
- (unsigned char)optionInfo[pos+1],
- (unsigned char)optionInfo[pos+2],
- (unsigned char)optionInfo[pos+3]);
- pos += 4;
- len -= 4;
-
- /*
- * Append to list of name servers
- */
- strappend(ns, addr);
- sts |= STS_NS_FOUND;
- }
- }
- }
-
- /*
- * Onto the next options
- */
- pos += len;
- }
- }
-
- return sts;
-}
-
-/*
- * Windows 98/ME
- *
- * Use registry approach for statically configured TCP/IP settings
- * (see loadStaticConfig9x).
- *
- * If configuration is not static then use IP helper library routine
- * GetNetworkParams to obtain the network settings which include the
- * domain name and the DNS servers. Note that we use the registry in
- * preference to GetNetworkParams as the domain name is not populated
- * by GetNetworkParams if the configuration is static.
- */
-static int loadConfig98(char *sl, char *ns) {
- FIXED_INFO *infoP;
- ULONG size;
- DWORD ret;
- int sts;
-
- /*
- * Use registry approach to pick up static configuation.
- */
- sts = loadStaticConfig9x(sl, ns);
- if (IS_SL_FOUND(sts) && IS_NS_FOUND(sts)) {
- return sts;
- }
-
- /*
- * Use IP helper library to obtain dynamic configuration (DHCP and
- * DUN).
- */
- size = sizeof(FIXED_INFO);
- infoP = (FIXED_INFO *)malloc(size);
- if (infoP) {
- ret = (*GetNetworkParams_fn)(infoP, &size);
- if (ret == ERROR_BUFFER_OVERFLOW) {
- infoP = (FIXED_INFO *)realloc(infoP, size);
- if (infoP != NULL)
- ret = (*GetNetworkParams_fn)(infoP, &size);
- }
- }
- if (infoP == NULL) {
- return sts;
- }
- if (ret == ERROR_SUCCESS) {
- /*
- * Use DomainName if search-list not specified.
- */
- if (!IS_SL_FOUND(sts)) {
- strappend(sl, infoP->DomainName);
- sts |= STS_SL_FOUND;
- }
-
- /*
- * Use DnsServerList if not statically configured.
- */
- if (!IS_NS_FOUND(sts)) {
- PIP_ADDR_STRING dnsP = &(infoP->DnsServerList);
- do {
- strappend(ns, (char *)&(dnsP->IpAddress));
- dnsP = dnsP->Next;
- } while (dnsP != NULL);
- sts |= STS_NS_FOUND;
- }
- }
-
- free(infoP);
-
- return sts;
-}
-
-
-/*
- * Windows NT
- *
- * Use registry approach based on settings described in "TCP/IP and
- * NBT Configuration Parameters for Windows" - Article Q12062 on
- * Microsoft site.
- *
- * All non-RAS TCP/IP settings are stored in HKEY_LOCAL_MACHINE in
- * the SYSTEM\CurrentControlSet\Services\Tcpip\Parameters key.
- *
- * If SearchList if not provided then return Domain or DhcpDomain.
- * If Domain is specified it overrides DhcpDomain even if DHCP is
- * enabled.
- *
- * DNS name servers based on NameServer or DhcpNameServer settings.
- * NameServer overrides DhcpNameServer even if DHCP is enabled.
- */
-static int loadConfigNT(char *sl, char *ns) {
- LONG ret;
- HANDLE hKey;
- DWORD dwLen;
- ULONG ulType;
- char result[MAX_STR_LEN];
- int sts = STS_NO_CONFIG;
-
- ret = RegOpenKeyEx(HKEY_LOCAL_MACHINE,
- "SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters",
- 0,
- KEY_READ,
- (PHKEY)&hKey);
- if (ret != ERROR_SUCCESS) {
- return sts;
- }
-
- /*
- * Determine search list
- */
- result[0] = '\0';
- dwLen = sizeof(result);
- ret = RegQueryValueEx(hKey, "SearchList", NULL, &ulType,
- (LPBYTE)&result, &dwLen);
- if ((ret != ERROR_SUCCESS) || (strlen(result) == 0)) {
- dwLen = sizeof(result);
- ret = RegQueryValueEx(hKey, "Domain", NULL, &ulType,
- (LPBYTE)&result, &dwLen);
- if ((ret != ERROR_SUCCESS) || (strlen(result) == 0)) {
- dwLen = sizeof(result);
- ret = RegQueryValueEx(hKey, "DhcpDomain", NULL, &ulType,
- (LPBYTE)&result, &dwLen);
- }
- }
- if (ret == ERROR_SUCCESS) {
- assert(ulType == REG_SZ);
- if (strlen(result) > 0) {
- strappend(sl, result);
- sts |= STS_SL_FOUND;
- }
- }
-
- /*
- * Determine DNS name server(s)
- */
- result[0] = '\0';
- dwLen = sizeof(result);
- ret = RegQueryValueEx(hKey, "NameServer", NULL, &ulType,
- (LPBYTE)&result, &dwLen);
- if ((ret != ERROR_SUCCESS) || (strlen(result) == 0)) {
- dwLen = sizeof(result);
- ret = RegQueryValueEx(hKey, "DhcpNameServer", NULL, &ulType,
- (LPBYTE)&result, &dwLen);
- }
- if (ret == ERROR_SUCCESS) {
- assert(ulType == REG_SZ);
- if (strlen(result) > 0) {
- strappend(ns, result);
- sts |= STS_NS_FOUND;
- }
- }
-
- RegCloseKey(hKey);
-
- return sts;
-}
-
-
/*
* Windows 2000/XP
*
@@ -510,7 +85,7 @@ static int loadConfigNT(char *sl, char *ns) {
* names of each adapter and then query the corresponding registry
* settings to obtain NameServer/DhcpNameServer and Domain/DhcpDomain.
*/
-static int loadConfig2000(char *sl, char *ns) {
+static int loadConfig(char *sl, char *ns) {
IP_ADAPTER_INFO *adapterP;
ULONG size;
DWORD ret;
@@ -547,10 +122,10 @@ static int loadConfig2000(char *sl, char *ns) {
*/
size = sizeof(IP_ADAPTER_INFO);
adapterP = (IP_ADAPTER_INFO *)malloc(size);
- ret = (*GetAdaptersInfo_fn)(adapterP, &size);
+ ret = GetAdaptersInfo(adapterP, &size);
if (ret == ERROR_BUFFER_OVERFLOW) {
adapterP = (IP_ADAPTER_INFO *)realloc(adapterP, size);
- ret = (*GetAdaptersInfo_fn)(adapterP, &size);
+ ret = GetAdaptersInfo(adapterP, &size);
}
/*
@@ -648,87 +223,15 @@ static int loadConfig2000(char *sl, char *ns) {
/*
- * Initialization :-
- *
- * 1. Based on OS version set the function pointer for OS specific load
- * configuration routine.
- *
- * 2. On 98/2000/XP load the IP helper library.
- *
- * 3. Initialize JNI field IDs.
- *
+ * Initialize JNI field IDs.
*/
JNIEXPORT void JNICALL
Java_sun_net_dns_ResolverConfigurationImpl_init0(JNIEnv *env, jclass cls)
{
- OSVERSIONINFO ver;
- jboolean loadHelperLibrary = JNI_TRUE;
-
- /*
- * First we figure out which OS is running
- */
- ver.dwOSVersionInfoSize = sizeof(ver);
- GetVersionEx(&ver);
-
- if (ver.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS) {
- if ((ver.dwMajorVersion == 4) && (ver.dwMinorVersion == 0)) {
- /*
- * Windows 95
- */
- loadHelperLibrary = JNI_FALSE;
- loadconfig_fn = loadConfig95;
- } else {
- /*
- * Windows 98/ME
- */
- loadHelperLibrary = JNI_TRUE;
- loadconfig_fn = loadConfig98;
- }
- }
-
- if (ver.dwPlatformId == VER_PLATFORM_WIN32_NT) {
- if (ver.dwMajorVersion <= 4) {
- /*
- * Windows NT
- */
- loadHelperLibrary = JNI_FALSE;
- loadconfig_fn = loadConfigNT;
- } else {
- /*
- * Windows 2000/XP
- */
- loadHelperLibrary = JNI_TRUE;
- loadconfig_fn = loadConfig2000;
- }
- }
-
- /*
- * On 98/2000/XP we load the IP Helper Library.
- */
- if (loadHelperLibrary) {
- HANDLE h = LoadLibrary("iphlpapi.dll");
-
- if (h != NULL) {
- GetNetworkParams_fn = (int (PASCAL FAR *)())GetProcAddress(h, "GetNetworkParams");
- GetAdaptersInfo_fn = (int (PASCAL FAR *)())GetProcAddress(h, "GetAdaptersInfo");
-
- NotifyAddrChange_fn = (int (PASCAL FAR *)())GetProcAddress(h, "NotifyAddrChange");
- }
-
- if (GetNetworkParams_fn == NULL || GetAdaptersInfo_fn == NULL) {
- JNU_ThrowByName(env, "java/lang/UnsatisfiedLinkError", "iphlpapi.dll");
- return;
- }
- }
-
- /*
- * Get JNI ids
- */
searchlistID = (*env)->GetStaticFieldID(env, cls, "os_searchlist",
"Ljava/lang/String;");
nameserversID = (*env)->GetStaticFieldID(env, cls, "os_nameservers",
"Ljava/lang/String;");
-
}
/*
@@ -746,8 +249,7 @@ Java_sun_net_dns_ResolverConfigurationImpl_loadDNSconfig0(JNIEnv *env, jclass cl
searchlist[0] = '\0';
nameservers[0] = '\0';
- /* call OS specific routine */
- (void)(*loadconfig_fn)(searchlist, nameservers);
+ loadConfig(searchlist, nameservers);
/*
* Populate static fields in sun.net.DefaultResolverConfiguration
@@ -772,17 +274,15 @@ Java_sun_net_dns_ResolverConfigurationImpl_notifyAddrChange0(JNIEnv *env, jclass
HANDLE h;
DWORD rc, xfer;
- if (NotifyAddrChange_fn != NULL) {
- ol.hEvent = (HANDLE)0;
- rc = (*NotifyAddrChange_fn)(&h, &ol);
- if (rc == ERROR_IO_PENDING) {
- rc = GetOverlappedResult(h, &ol, &xfer, TRUE);
- if (rc != 0) {
- return 0; /* address changed */
- }
+ ol.hEvent = (HANDLE)0;
+ rc = NotifyAddrChange(&h, &ol);
+ if (rc == ERROR_IO_PENDING) {
+ rc = GetOverlappedResult(h, &ol, &xfer, TRUE);
+ if (rc != 0) {
+ return 0; /* address changed */
}
}
- /* NotifyAddrChange not support or error */
+ /* error */
return -1;
}
diff --git a/src/windows/native/sun/net/www/protocol/http/ntlm/NTLMAuthSequence.c b/src/windows/native/sun/net/www/protocol/http/ntlm/NTLMAuthSequence.c
index fca399d3206972bec16e9d372e4f55c0b735fc33..86af0a877a1590bd1c4a79c1f3d83e2c8d2638f6 100644
--- a/src/windows/native/sun/net/www/protocol/http/ntlm/NTLMAuthSequence.c
+++ b/src/windows/native/sun/net/www/protocol/http/ntlm/NTLMAuthSequence.c
@@ -41,18 +41,6 @@
#define SECURITY_WIN32
#include "sspi.h"
-
-/*
- * OS calls loaded from DLL on intialization
- */
-
-static FREE_CREDENTIALS_HANDLE_FN pFreeCredentialsHandle;
-static ACQUIRE_CREDENTIALS_HANDLE_FN pAcquireCredentialsHandle;
-static FREE_CONTEXT_BUFFER_FN pFreeContextBuffer;
-static INITIALIZE_SECURITY_CONTEXT_FN pInitializeSecurityContext;
-static COMPLETE_AUTH_TOKEN_FN pCompleteAuthToken;
-static DELETE_SECURITY_CONTEXT_FN pDeleteSecurityContext;
-
static void endSequence (PCredHandle credHand, PCtxtHandle ctxHandle);
static jfieldID ntlm_ctxHandleID;
@@ -63,48 +51,8 @@ static HINSTANCE lib = NULL;
JNIEXPORT void JNICALL Java_sun_net_www_protocol_http_ntlm_NTLMAuthSequence_initFirst
(JNIEnv *env, jclass clazz)
{
- OSVERSIONINFO version;
- UCHAR libName[MAX_PATH];
-
ntlm_ctxHandleID = (*env)->GetFieldID(env, clazz, "ctxHandle", "J");
ntlm_crdHandleID = (*env)->GetFieldID(env, clazz, "crdHandle", "J");
-
- version.dwOSVersionInfoSize = sizeof (OSVERSIONINFO);
- GetVersionEx (&version);
-
- if (version.dwPlatformId == VER_PLATFORM_WIN32_NT) {
- strcpy (libName, "security.dll" );
- }
- else if (version.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS) {
- strcpy (libName, "secur32.dll" );
- }
-
- lib = LoadLibrary (libName);
-
- pFreeCredentialsHandle
- = (FREE_CREDENTIALS_HANDLE_FN) GetProcAddress(
- lib, "FreeCredentialsHandle" );
-
- pAcquireCredentialsHandle
- = (ACQUIRE_CREDENTIALS_HANDLE_FN) GetProcAddress(
- lib, "AcquireCredentialsHandleA" );
-
- pFreeContextBuffer
- = (FREE_CONTEXT_BUFFER_FN) GetProcAddress(
- lib, "FreeContextBuffer" );
-
- pInitializeSecurityContext
- = (INITIALIZE_SECURITY_CONTEXT_FN) GetProcAddress(
- lib, "InitializeSecurityContextA" );
-
- pCompleteAuthToken
- = (COMPLETE_AUTH_TOKEN_FN) GetProcAddress(
- lib, "CompleteAuthToken" );
-
- pDeleteSecurityContext
- = (DELETE_SECURITY_CONTEXT_FN) GetProcAddress(
- lib, "DeleteSecurityContext" );
-
}
/*
@@ -158,17 +106,17 @@ JNIEXPORT jlong JNICALL Java_sun_net_www_protocol_http_ntlm_NTLMAuthSequence_get
if ( pUser != NULL ) {
AuthId.User = (unsigned char *) pUser;
- AuthId.UserLength = strlen( pUser );
+ AuthId.UserLength = (unsigned long) strlen( pUser );
}
if ( pPassword != NULL ) {
AuthId.Password = (unsigned char *) pPassword;
- AuthId.PasswordLength = strlen( pPassword );
+ AuthId.PasswordLength = (unsigned long) strlen( pPassword );
}
if ( pDomain != NULL ) {
AuthId.Domain = (unsigned char *) pDomain;
- AuthId.DomainLength = strlen( pDomain );
+ AuthId.DomainLength = (unsigned long) strlen( pDomain );
}
AuthId.Flags = SEC_WINNT_AUTH_IDENTITY_ANSI;
@@ -176,7 +124,7 @@ JNIEXPORT jlong JNICALL Java_sun_net_www_protocol_http_ntlm_NTLMAuthSequence_get
pAuthId = NULL;
}
- ss = pAcquireCredentialsHandle(
+ ss = AcquireCredentialsHandleA(
NULL, "NTLM", SECPKG_CRED_OUTBOUND,
NULL, pAuthId, NULL, NULL,
pCred, <ime
@@ -258,7 +206,7 @@ JNIEXPORT jbyteArray JNICALL Java_sun_net_www_protocol_http_ntlm_NTLMAuthSequenc
* need to send the out buffer if there are bytes to send
*/
- ss = pInitializeSecurityContext(
+ ss = InitializeSecurityContextA(
pCred, pCtx, NULL, 0, 0, SECURITY_NATIVE_DREP,
lastToken ? &InBuffDesc : NULL, 0, newContext, &OutBuffDesc,
&ContextAttributes, <ime
@@ -274,7 +222,7 @@ JNIEXPORT jbyteArray JNICALL Java_sun_net_www_protocol_http_ntlm_NTLMAuthSequenc
}
if ((ss == SEC_I_COMPLETE_NEEDED) || (ss == SEC_I_COMPLETE_AND_CONTINUE) ) {
- ss = pCompleteAuthToken( pCtx, &OutBuffDesc );
+ ss = CompleteAuthToken( pCtx, &OutBuffDesc );
if (ss < 0) {
endSequence (pCred, pCtx);
@@ -300,12 +248,12 @@ JNIEXPORT jbyteArray JNICALL Java_sun_net_www_protocol_http_ntlm_NTLMAuthSequenc
static void endSequence (PCredHandle credHand, PCtxtHandle ctxHandle) {
if (credHand != 0) {
- pFreeCredentialsHandle (credHand);
- free (credHand);
+ FreeCredentialsHandle(credHand);
+ free(credHand);
}
if (ctxHandle != 0) {
- pDeleteSecurityContext(ctxHandle);
- free (ctxHandle);
+ DeleteSecurityContext(ctxHandle);
+ free(ctxHandle);
}
}
diff --git a/src/windows/native/sun/nio/ch/Iocp.c b/src/windows/native/sun/nio/ch/Iocp.c
index 773a870ca2b5a4e2ea1e8eed0227ca1ce9863b3e..8f87a8937f764da7a5828ba3985df836d59ee15a 100644
--- a/src/windows/native/sun/nio/ch/Iocp.c
+++ b/src/windows/native/sun/nio/ch/Iocp.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2011, 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
diff --git a/src/windows/native/sun/nio/ch/Net.c b/src/windows/native/sun/nio/ch/Net.c
index 75c9ba4ce66847503e3451b940caf741aad0efc1..55c03a28b5b40fa9ebe20b34e9fc7e5d1cfa0274 100644
--- a/src/windows/native/sun/nio/ch/Net.c
+++ b/src/windows/native/sun/nio/ch/Net.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2011, 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
diff --git a/src/windows/native/sun/nio/fs/RegistryFileTypeDetector.c b/src/windows/native/sun/nio/fs/RegistryFileTypeDetector.c
index 6d082271015e2d34d0952328b2979191fc08d61d..946fc46601dc0616c071e0b7c555c14560cb4850 100644
--- a/src/windows/native/sun/nio/fs/RegistryFileTypeDetector.c
+++ b/src/windows/native/sun/nio/fs/RegistryFileTypeDetector.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2011, 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
diff --git a/src/windows/native/sun/nio/fs/WindowsNativeDispatcher.c b/src/windows/native/sun/nio/fs/WindowsNativeDispatcher.c
index d9d8a9d7cb254e80716c3bf5172ee0883baf61da..5faf34d2458b6e96ee3a72efca98a23912c01f15 100644
--- a/src/windows/native/sun/nio/fs/WindowsNativeDispatcher.c
+++ b/src/windows/native/sun/nio/fs/WindowsNativeDispatcher.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2011, 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,7 +24,7 @@
*/
#ifndef _WIN32_WINNT
-#define _WIN32_WINNT 0x0500
+#define _WIN32_WINNT 0x0501
#endif
#include
@@ -36,6 +36,7 @@
#include
#include
#include
+#include
#include "jni.h"
#include "jni_util.h"
@@ -77,40 +78,20 @@ static jfieldID backupResult_context;
/**
- * Win32 APIs not defined in Visual Studio 2003 header files
+ * Win32 APIs not available in Windows XP
*/
-
-typedef enum {
- FindStreamInfoStandard
-} MY_STREAM_INFO_LEVELS;
-
-typedef struct _MY_WIN32_FIND_STREAM_DATA {
- LARGE_INTEGER StreamSize;
- WCHAR cStreamName[MAX_PATH + 36];
-} MY_WIN32_FIND_STREAM_DATA;
-
-typedef HANDLE (WINAPI* FindFirstStream_Proc)(LPCWSTR, MY_STREAM_INFO_LEVELS, LPVOID, DWORD);
+typedef HANDLE (WINAPI* FindFirstStream_Proc)(LPCWSTR, STREAM_INFO_LEVELS, LPVOID, DWORD);
typedef BOOL (WINAPI* FindNextStream_Proc)(HANDLE, LPVOID);
typedef BOOLEAN (WINAPI* CreateSymbolicLinkProc) (LPCWSTR, LPCWSTR, DWORD);
-typedef BOOL (WINAPI* CreateHardLinkProc) (LPCWSTR, LPCWSTR, LPSECURITY_ATTRIBUTES);
typedef BOOL (WINAPI* GetFinalPathNameByHandleProc) (HANDLE, LPWSTR, DWORD, DWORD);
-typedef BOOL (WINAPI* ConvertSidToStringSidProc) (PSID, LPWSTR*);
-typedef BOOL (WINAPI* ConvertStringSidToSidProc) (LPWSTR, PSID*);
-typedef DWORD (WINAPI* GetLengthSidProc) (PSID);
-
static FindFirstStream_Proc FindFirstStream_func;
static FindNextStream_Proc FindNextStream_func;
static CreateSymbolicLinkProc CreateSymbolicLink_func;
-static CreateHardLinkProc CreateHardLink_func;
static GetFinalPathNameByHandleProc GetFinalPathNameByHandle_func;
-static ConvertSidToStringSidProc ConvertSidToStringSid_func;
-static ConvertStringSidToSidProc ConvertStringSidToSid_func;
-static GetLengthSidProc GetLengthSid_func;
-
static void throwWindowsException(JNIEnv* env, DWORD lastError) {
jobject x = JNU_NewObjectByName(env, "sun/nio/fs/WindowsException",
"(I)V", lastError);
@@ -190,33 +171,23 @@ Java_sun_nio_fs_WindowsNativeDispatcher_initIDs(JNIEnv* env, jclass this)
backupResult_bytesTransferred = (*env)->GetFieldID(env, clazz, "bytesTransferred", "I");
backupResult_context = (*env)->GetFieldID(env, clazz, "context", "J");
-
- h = LoadLibrary("kernel32");
- if (h != INVALID_HANDLE_VALUE) {
+ // get handle to kernel32
+ if (GetModuleHandleExW((GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS |
+ GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT),
+ (LPCWSTR)&CreateFileW, &h) != 0)
+ {
+ // requires Windows Server 2003 or newer
FindFirstStream_func =
(FindFirstStream_Proc)GetProcAddress(h, "FindFirstStreamW");
FindNextStream_func =
(FindNextStream_Proc)GetProcAddress(h, "FindNextStreamW");
+
+ // requires Windows Vista or newer
CreateSymbolicLink_func =
(CreateSymbolicLinkProc)GetProcAddress(h, "CreateSymbolicLinkW");
- CreateHardLink_func =
- (CreateHardLinkProc)GetProcAddress(h, "CreateHardLinkW");
GetFinalPathNameByHandle_func =
(GetFinalPathNameByHandleProc)GetProcAddress(h, "GetFinalPathNameByHandleW");
- FreeLibrary(h);
- }
-
- h = LoadLibrary("advapi32");
- if (h != INVALID_HANDLE_VALUE) {
- ConvertSidToStringSid_func =
- (ConvertSidToStringSidProc)GetProcAddress(h, "ConvertSidToStringSidW");
- ConvertStringSidToSid_func =
- (ConvertStringSidToSidProc)GetProcAddress(h, "ConvertStringSidToSidW");
- GetLengthSid_func =
- (GetLengthSidProc)GetProcAddress(h, "GetLengthSid");
- FreeLibrary(h);
}
-
}
JNIEXPORT jstring JNICALL
@@ -413,7 +384,7 @@ JNIEXPORT void JNICALL
Java_sun_nio_fs_WindowsNativeDispatcher_FindFirstStream0(JNIEnv* env, jclass this,
jlong address, jobject obj)
{
- MY_WIN32_FIND_STREAM_DATA data;
+ WIN32_FIND_STREAM_DATA data;
LPCWSTR lpFileName = jlong_to_ptr(address);
HANDLE handle;
@@ -443,7 +414,7 @@ JNIEXPORT jstring JNICALL
Java_sun_nio_fs_WindowsNativeDispatcher_FindNextStream(JNIEnv* env, jclass this,
jlong handle)
{
- MY_WIN32_FIND_STREAM_DATA data;
+ WIN32_FIND_STREAM_DATA data;
HANDLE h = (HANDLE)jlong_to_ptr(handle);
if (FindNextStream_func == NULL) {
@@ -909,12 +880,7 @@ Java_sun_nio_fs_WindowsNativeDispatcher_GetLengthSid(JNIEnv* env,
jclass this, jlong address)
{
PSID sid = jlong_to_ptr(address);
-
- if (GetLengthSid_func == NULL) {
- JNU_ThrowInternalError(env, "Should not get here");
- return 0;
- }
- return (jint)(*GetLengthSid_func)(sid);
+ return (jint)GetLengthSid(sid);
}
@@ -924,13 +890,7 @@ Java_sun_nio_fs_WindowsNativeDispatcher_ConvertSidToStringSid(JNIEnv* env,
{
PSID sid = jlong_to_ptr(address);
LPWSTR string;
-
- if (ConvertSidToStringSid_func == NULL) {
- JNU_ThrowInternalError(env, "Should not get here");
- return NULL;
- }
-
- if ((*ConvertSidToStringSid_func)(sid, &string) == 0) {
+ if (ConvertSidToStringSidW(sid, &string) == 0) {
throwWindowsException(env, GetLastError());
return NULL;
} else {
@@ -947,15 +907,8 @@ Java_sun_nio_fs_WindowsNativeDispatcher_ConvertStringSidToSid0(JNIEnv* env,
{
LPWSTR lpStringSid = jlong_to_ptr(address);
PSID pSid;
-
- if (ConvertStringSidToSid_func == NULL) {
- JNU_ThrowInternalError(env, "Should not get here");
- return (jlong)0;
- }
-
- if ((*ConvertStringSidToSid_func)(lpStringSid, &pSid) == 0)
+ if (ConvertStringSidToSidW(lpStringSid, &pSid) == 0)
throwWindowsException(env, GetLastError());
-
return ptr_to_jlong(pSid);
}
@@ -1137,11 +1090,7 @@ Java_sun_nio_fs_WindowsNativeDispatcher_CreateHardLink0(JNIEnv* env,
LPCWSTR newFile = jlong_to_ptr(newFileAddress);
LPCWSTR existingFile = jlong_to_ptr(existingFileAddress);
- if (CreateHardLink_func == NULL) {
- JNU_ThrowInternalError(env, "Should not get here");
- return;
- }
- if ((*CreateHardLink_func)(newFile, existingFile, NULL) == 0)
+ if (CreateHardLinkW(newFile, existingFile, NULL) == 0)
throwWindowsException(env, GetLastError());
}
diff --git a/src/windows/native/sun/security/provider/WinCAPISeedGenerator.c b/src/windows/native/sun/security/provider/WinCAPISeedGenerator.c
index d9d91080ddbb3635387846ca3b16c89bf8251b72..968650da591852ae3a1f40cbb2b417f750471e9d 100644
--- a/src/windows/native/sun/security/provider/WinCAPISeedGenerator.c
+++ b/src/windows/native/sun/security/provider/WinCAPISeedGenerator.c
@@ -33,11 +33,6 @@
#include
#include "sun_security_provider_NativeSeedGenerator.h"
-/* Typedefs for runtime linking. */
-typedef BOOL (WINAPI *CryptAcquireContextType)(HCRYPTPROV*, LPCTSTR, LPCTSTR, DWORD, DWORD);
-typedef BOOL (WINAPI *CryptGenRandomType)(HCRYPTPROV, DWORD, BYTE*);
-typedef BOOL (WINAPI *CryptReleaseContextType)(HCRYPTPROV, DWORD);
-
/*
* Get a random seed from the MS CryptoAPI. Return true if successful, false
* otherwise.
@@ -49,48 +44,27 @@ typedef BOOL (WINAPI *CryptReleaseContextType)(HCRYPTPROV, DWORD);
JNIEXPORT jboolean JNICALL Java_sun_security_provider_NativeSeedGenerator_nativeGenerateSeed
(JNIEnv *env, jclass clazz, jbyteArray randArray)
{
- HMODULE lib;
- CryptAcquireContextType acquireContext;
- CryptGenRandomType genRandom;
- CryptReleaseContextType releaseContext;
-
HCRYPTPROV hCryptProv;
jboolean result = JNI_FALSE;
jsize numBytes;
jbyte* randBytes;
- lib = LoadLibrary("ADVAPI32.DLL");
- if (lib == NULL) {
- return result;
- }
-
- acquireContext = (CryptAcquireContextType)GetProcAddress(lib, "CryptAcquireContextA");
- genRandom = (CryptGenRandomType)GetProcAddress(lib, "CryptGenRandom");
- releaseContext = (CryptReleaseContextType)GetProcAddress(lib, "CryptReleaseContext");
-
- if (acquireContext == NULL || genRandom == NULL || releaseContext == NULL) {
- FreeLibrary(lib);
- return result;
- }
-
- if (acquireContext(&hCryptProv, "J2SE", NULL, PROV_RSA_FULL, 0) == FALSE) {
+ if (CryptAcquireContextA(&hCryptProv, "J2SE", NULL, PROV_RSA_FULL, 0) == FALSE) {
/* If CSP context hasn't been created, create one. */
- if (acquireContext(&hCryptProv, "J2SE", NULL, PROV_RSA_FULL,
+ if (CryptAcquireContextA(&hCryptProv, "J2SE", NULL, PROV_RSA_FULL,
CRYPT_NEWKEYSET) == FALSE) {
- FreeLibrary(lib);
return result;
}
}
numBytes = (*env)->GetArrayLength(env, randArray);
randBytes = (*env)->GetByteArrayElements(env, randArray, NULL);
- if (genRandom(hCryptProv, numBytes, randBytes)) {
+ if (CryptGenRandom(hCryptProv, numBytes, randBytes)) {
result = JNI_TRUE;
}
(*env)->ReleaseByteArrayElements(env, randArray, randBytes, 0);
- releaseContext(hCryptProv, 0);
- FreeLibrary(lib);
+ CryptReleaseContext(hCryptProv, 0);
return result;
}
diff --git a/src/windows/native/sun/windows/Devices.h b/src/windows/native/sun/windows/Devices.h
index 748ded20a3fc67d6250f5febb186048fd0c4f629..bbd8a497aaf90a20de9010a6e55858084c678dab 100644
--- a/src/windows/native/sun/windows/Devices.h
+++ b/src/windows/native/sun/windows/Devices.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, 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
diff --git a/src/windows/native/sun/windows/awt_Debug.cpp b/src/windows/native/sun/windows/awt_Debug.cpp
index 42e099bb59985e58fdf15c23e51071a78f65167d..4be1b5d916556c596e04b629163b389231d2e0d5 100644
--- a/src/windows/native/sun/windows/awt_Debug.cpp
+++ b/src/windows/native/sun/windows/awt_Debug.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, 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
diff --git a/src/windows/native/sun/windows/awt_Debug.h b/src/windows/native/sun/windows/awt_Debug.h
index 729e652621a2c4aa1593ca7a9a5a9515e2ce5090..9f7c0c08a8bd9b4df348191ad38b92607e27e55d 100644
--- a/src/windows/native/sun/windows/awt_Debug.h
+++ b/src/windows/native/sun/windows/awt_Debug.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, 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
diff --git a/src/windows/native/sun/windows/awt_Dialog.h b/src/windows/native/sun/windows/awt_Dialog.h
index 15918a6fd887e5dfffb5bd3c5b33d3ff27a25ffd..32199fdf266c5af6d93a556383c0d919383bab5a 100644
--- a/src/windows/native/sun/windows/awt_Dialog.h
+++ b/src/windows/native/sun/windows/awt_Dialog.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2010, 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
diff --git a/src/windows/native/sun/windows/awt_Frame.cpp b/src/windows/native/sun/windows/awt_Frame.cpp
index ca874cac84171353e19d5d6cb50a11eab795fadc..4d3374e573416e975252c2dddbdb020558cd3da3 100644
--- a/src/windows/native/sun/windows/awt_Frame.cpp
+++ b/src/windows/native/sun/windows/awt_Frame.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2011, 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
diff --git a/src/windows/native/sun/windows/awt_Frame.h b/src/windows/native/sun/windows/awt_Frame.h
index 2949ac9292494f0312f70856c0053c57be94afa9..1adca139bf9abd39c21e0ebaa064d6ed15e40de8 100644
--- a/src/windows/native/sun/windows/awt_Frame.h
+++ b/src/windows/native/sun/windows/awt_Frame.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2011, 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
diff --git a/src/windows/native/sun/windows/awt_PrintJob.cpp b/src/windows/native/sun/windows/awt_PrintJob.cpp
index 1deff60252a52e993bbe806792bcb8bb29de0076..43c03fd5490cae5db4924338943932cb485d92f3 100644
--- a/src/windows/native/sun/windows/awt_PrintJob.cpp
+++ b/src/windows/native/sun/windows/awt_PrintJob.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2011, 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
diff --git a/src/windows/native/sun/windows/awt_TextArea.h b/src/windows/native/sun/windows/awt_TextArea.h
index 19a44e7681b08d4e6efeff40815c3ea2294abb85..8a762924203c45f108d35169fbe76f3266fa944c 100644
--- a/src/windows/native/sun/windows/awt_TextArea.h
+++ b/src/windows/native/sun/windows/awt_TextArea.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2010, 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
diff --git a/src/windows/native/sun/windows/awt_Toolkit.cpp b/src/windows/native/sun/windows/awt_Toolkit.cpp
index cab78049f238613890afc30984612524b39aeaf0..ca2bae8325a9c0d4878feb7aee5ccd1cceec6f6d 100644
--- a/src/windows/native/sun/windows/awt_Toolkit.cpp
+++ b/src/windows/native/sun/windows/awt_Toolkit.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2011, 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
@@ -528,9 +528,6 @@ BOOL AwtToolkit::Dispose() {
tk.m_isActive = FALSE;
- awt_dnd_uninitialize();
- awt_clipboard_uninitialize((JNIEnv *)JNU_GetEnv(jvm, JNI_VERSION_1_2));
-
// dispose Direct3D-related resources. This should be done
// before AwtObjectList::Cleanup() as the d3d will attempt to
// shutdown when the last of its windows is disposed of
@@ -539,6 +536,9 @@ BOOL AwtToolkit::Dispose() {
AwtObjectList::Cleanup();
AwtFont::Cleanup();
+ awt_dnd_uninitialize();
+ awt_clipboard_uninitialize((JNIEnv *)JNU_GetEnv(jvm, JNI_VERSION_1_2));
+
if (tk.m_inputMethodHWnd != NULL) {
::SendMessage(tk.m_inputMethodHWnd, WM_IME_CONTROL, IMC_OPENSTATUSWINDOW, 0);
}
diff --git a/src/windows/native/sun/windows/awt_TrayIcon.cpp b/src/windows/native/sun/windows/awt_TrayIcon.cpp
index e43c8130405baee00b5252f423071b501a5a1aac..4156c9cfec16b695bd9abe9c839a97174f726e2e 100644
--- a/src/windows/native/sun/windows/awt_TrayIcon.cpp
+++ b/src/windows/native/sun/windows/awt_TrayIcon.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2011, 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
diff --git a/src/windows/native/sun/windows/awt_Win32GraphicsEnv.cpp b/src/windows/native/sun/windows/awt_Win32GraphicsEnv.cpp
index efe485230a7b78f0bebba34fc9fdf26eae77df78..937007a5fd3519ec3385e619d5d16310f526c529 100644
--- a/src/windows/native/sun/windows/awt_Win32GraphicsEnv.cpp
+++ b/src/windows/native/sun/windows/awt_Win32GraphicsEnv.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2011, 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
diff --git a/src/windows/native/sun/windows/awt_Window.cpp b/src/windows/native/sun/windows/awt_Window.cpp
index a6a5eb64ffa5bc6a1c46f0ed3afeb3b7405db88a..c742aca9000e00dca54446ec066a3aa4e28390c4 100644
--- a/src/windows/native/sun/windows/awt_Window.cpp
+++ b/src/windows/native/sun/windows/awt_Window.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2011, 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
diff --git a/test/Makefile b/test/Makefile
index d1171b9602759a2ca3bca891d3cc85141e849e37..daa8ee9231347ab12378458b51d4244eff6418e9 100644
--- a/test/Makefile
+++ b/test/Makefile
@@ -1,5 +1,5 @@
#
-# Copyright (c) 1995, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1995, 2011, 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
@@ -261,6 +261,7 @@ endif
# Follow command with ";$(BUNDLE_UP_AND_EXIT)", so it always gets executed.
ZIP_UP_RESULTS = ( $(MKDIR) -p `$(DIRNAME) $(ARCHIVE_BUNDLE)` \
&& $(CD) $(ABS_TEST_OUTPUT_DIR) \
+ && $(CHMOD) -R a+r . \
&& $(ZIP) -q -r $(ARCHIVE_BUNDLE) . )
SUMMARY_TXT = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)")/JTreport/text/summary.txt
STATS_TXT_NAME = Stats.txt
@@ -312,7 +313,9 @@ BUNDLE_UP_AND_EXIT = \
else \
$(ECHO) "Missing file: $${_summary}" >> $(STATS_TXT); \
fi; \
- $(CAT) $(STATS_TXT); \
+ if [ -f $(STATS_TXT) ] ; then \
+ $(CAT) $(STATS_TXT); \
+ fi; \
$(ZIP_UP_RESULTS) ; \
$(TESTEXIT) \
)
@@ -370,10 +373,10 @@ EXCLUDELIST=$(ABS_TEST_OUTPUT_DIR)/excludelist.txt
# Create exclude list for this platform and arch
ifdef NO_EXCLUDES
-$(EXCLUDELIST): $(PROBLEM_LISTS) $(TESTDIRS)
+$(EXCLUDELIST): $(PROBLEM_LISTS) $(TEST_DEPENDENCIES)
@$(ECHO) "NOTHING_EXCLUDED" > $@
else
-$(EXCLUDELIST): $(PROBLEM_LISTS) $(TESTDIRS)
+$(EXCLUDELIST): $(PROBLEM_LISTS) $(TEST_DEPENDENCIES)
@$(RM) $@ $@.temp1 $@.temp2
@(($(CAT) $(PROBLEM_LISTS) | $(EGREP) -- '$(OS_NAME)-all' ) ;\
($(CAT) $(PROBLEM_LISTS) | $(EGREP) -- '$(PLATFORM_OS)' ) ;\
@@ -385,7 +388,7 @@ $(EXCLUDELIST): $(PROBLEM_LISTS) $(TESTDIRS)
($(ECHO) "#") ;\
) | $(SED) -e 's@^[\ ]*@@' \
| $(EGREP) -v '^#' > $@.temp1
- @for tdir in $(TESTDIRS) ; do \
+ for tdir in $(TESTDIRS) SOLARIS_10_SH_BUG_NO_EMPTY_FORS ; do \
( ( $(CAT) $@.temp1 | $(EGREP) "^$${tdir}" ) ; $(ECHO) "#" ) >> $@.temp2 ; \
done
@$(ECHO) "# at least one line" >> $@.temp2
@@ -400,11 +403,11 @@ endef
# Running batches of tests with or without samevm
define RunSamevmBatch
$(ECHO) "Running tests in samevm mode: $?"
-$(MAKE) TESTDIRS="$?" USE_JTREG_SAMEVM=true UNIQUE_DIR=$@ jtreg_tests
+$(MAKE) TEST_DEPENDENCIES="$?" TESTDIRS="$?" USE_JTREG_SAMEVM=true UNIQUE_DIR=$@ jtreg_tests
endef
define RunOthervmBatch
$(ECHO) "Running tests in othervm mode: $?"
-$(MAKE) TESTDIRS="$?" USE_JTREG_SAMEVM=false UNIQUE_DIR=$@ jtreg_tests
+$(MAKE) TEST_DEPENDENCIES="$?" TESTDIRS="$?" USE_JTREG_SAMEVM=false UNIQUE_DIR=$@ jtreg_tests
endef
define SummaryInfo
$(ECHO) "########################################################"
@@ -501,7 +504,7 @@ jdk_nio1: $(call TestDirs, java/nio/file)
# Stable samevm testruns (minus items from PROBLEM_LIST)
JDK_ALL_TARGETS += jdk_nio2
jdk_nio2: $(call TestDirs, java/nio/Buffer java/nio/ByteOrder \
- java/nio/channels java/nio/BufferPoolMXBean java/nio/MappedByteBuffer)
+ java/nio/channels java/nio/MappedByteBuffer)
$(call SharedLibraryPermissions,java/nio/channels)
$(call RunSamevmBatch)
@@ -684,7 +687,7 @@ PHONY_LIST += packtest packtest_stress
################################################################
-# perftest to collect statistics
+# perftest to collect statistics
# Expect JPRT to set JPRT_PACKTEST_HOME.
PERFTEST_HOME = $(TEST_ROOT)/perf
@@ -706,7 +709,7 @@ PHONY_LIST += perftest
# vmsqe tests
# Expect JPRT to set JPRT_VMSQE_HOME.
-VMSQE_HOME = /java/sqe/comp/vm/testbase/sqe/vm/current/build/latest/vm
+VMSQE_HOME = $(SLASH_JAVA)/sqe/comp/vm/testbase/sqe/vm/current/build/latest/vm
ifdef JPRT_VMSQE_HOME
VMSQE_HOME = $(JPRT_VMSQE_HOME)
endif
@@ -718,7 +721,7 @@ ifdef JPRT_RUNVMSQE_HOME
endif
# Expect JPRT to set JPRT_TONGA3_HOME.
-TONGA3_HOME = /java/sqe//tools/gtee/harness/tonga
+TONGA3_HOME = $(SLASH_JAVA)/sqe/tools/gtee/harness/tonga
ifdef JPRT_TONGA3_HOME
TONGA3_HOME = $(JPRT_TONGA3_HOME)
endif
@@ -771,148 +774,84 @@ PHONY_LIST += vmsqe_jdwp vmsqe_jdi vmsqe_jdb vmsqe_quick-jdi vmsqe_sajdi \
# jck tests
-JCK_WORK_DIR = $(ABS_TEST_OUTPUT_DIR)/JCKwork
-JCK_REPORT_DIR = $(ABS_TEST_OUTPUT_DIR)/JCKreport
-JCK_PROPERTIES = $(ABS_TEST_OUTPUT_DIR)/jck.properties
-JCK_CONFIG = $(ABS_TEST_OUTPUT_DIR)/jck.config
-
-JCK_JAVA_EXE = $(PRODUCT_HOME)/bin/java$(EXESUFFIX)
-
-JCK_JAVATEST_JAR = $(JCK_HOME)/lib/javatest.jar
-JCK_JAVATEST = $(ALT_BOOTDIR)/bin/java -jar $(JCK_JAVATEST_JAR)
-
-$(JCK_CONFIG): $(TEST_ROOT)/JCK-$(JCK_BUNDLE_NAME)-$(JCK_RELEASE)-base.jti
- $(RM) $@
- $(MKDIR) -p $(@D)
- $(CP) $< $@
-
-$(JCK_PROPERTIES): $(PRODUCT_HOME) $(JCK_JAVA_EXE)
- $(RM) $@
- $(MKDIR) -p $(@D)
- $(ECHO) "jck.env.compiler.compRefExecute.cmdAsFile=$(JCK_JAVA_EXE)" >> $@
- $(ECHO) "jck.env.compiler.compRefExecute.systemRoot=$(SYSTEMROOT)" >> $@
- $(ECHO) "jck.env.compiler.testCompile.testCompileAPImultiJVM.cmdAsFile=$(JCK_JAVA_EXE)" >> $@
- $(ECHO) "jck.tests.tests=$(JCK_BUNDLE_TESTDIRS)" >> $@
-
-jck_tests: prep $(JCK_HOME) $(JCK_PROPERTIES) $(JCK_CONFIG) $(JCK_JAVATEST_JAR)
- $(MKDIR) -p $(JCK_WORK_DIR)
- ( $(JCK_JAVATEST) \
- -verbose:commands,non-pass \
- -testSuite $(JCK_HOME) \
- -workDir $(JCK_WORK_DIR) \
- -config $(JCK_CONFIG) \
- -set -file $(JCK_PROPERTIES) \
- -runtests \
- -writeReport $(JCK_REPORT_DIR) \
- ) ; $(BUNDLE_UP_AND_EXIT)
-
-PHONY_LIST += jck_tests
-
-################################################################
-
-# jck6 tests
-
-JCK6_RELEASE = 6b
-JCK6_DEFAULT_HOME = $(SLASH_JAVA)/re/jck/$(JCK6_RELEASE)/archive/fcs/binaries
-
-# Expect JPRT to set JPRT_JCK6COMPILER_HOME.
-JCK6COMPILER_HOME = $(JCK6_DEFAULT_HOME)/JCK-compiler-$(JCK6_RELEASE)
-ifdef JPRT_JCK6COMPILER_HOME
- JCK6COMPILER_HOME = $(JPRT_JCK6COMPILER_HOME)
-endif
-
-# Expect JPRT to set JPRT_JCK6RUNTIME_HOME.
-JCK6RUNTIME_HOME = $(JCK6_DEFAULT_HOME)/JCK-runtime-$(JCK6_RELEASE)
-ifdef JPRT_JCK6RUNTIME_HOME
- JCK6RUNTIME_HOME = $(JPRT_JCK6RUNTIME_HOME)
-endif
-
-# Expect JPRT to set JPRT_JCK6DEVTOOLS_HOME.
-JCK6DEVTOOLS_HOME = $(JCK6_DEFAULT_HOME)/JCK-devtools-$(JCK6_RELEASE)
-ifdef JPRT_JCK6DEVTOOLS_HOME
- JCK6DEVTOOLS_HOME = $(JPRT_JCK6DEVTOOLS_HOME)
-endif
-
-jck6_tests: JCK_HOME=$(JCK6_HOME)
-jck6_tests: JCK_RELEASE=$(JCK6_RELEASE)
-jck6_tests: jck_tests
-
-jck6compiler: JCK6_HOME=$(JCK6COMPILER_HOME)
-jck6compiler: JCK_BUNDLE_NAME=compiler
-jck6compiler: jck6_tests
-
-jck6compiler_lang: JCK_BUNDLE_TESTDIRS=lang
-jck6compiler_lang: jck6compiler
-
-jck6runtime: JCK6_HOME=$(JCK6RUNTIME_HOME)
-jck6runtime: JCK_BUNDLE_NAME=runtime
-jck6runtime: jck6_tests
-
-jck6runtime_lang: JCK_BUNDLE_TESTDIRS=lang
-jck6runtime_lang: jck6runtime
-
-jck6devtools: JCK6_HOME=$(JCK6DEVTOOLS_HOME)
-jck6devtools: JCK_BUNDLE_NAME=devtools
-jck6devtools: jck6_tests
-
-jck6devtools_lang: JCK_BUNDLE_TESTDIRS=lang
-jck6devtools_lang: jck6devtools
-
-PHONY_LIST += jck6compiler jck6runtime jck6devtools jck6_tests \
- jck6compiler_lang jck6runtime_lang jck6devtools_lang
-
-################################################################
-
-# jck7 tests
-
-JCK7_RELEASE = 7
-JCK7_DEFAULT_HOME = $(SLASH_JAVA)/re/jck/$(JCK7_RELEASE)/archive/fcs/binaries
+# Default is to use jck 7 from /java/re
+JCK7_DEFAULT_HOME = $(SLASH_JAVA)/re/jck/7/promoted/latest/binaries
# Expect JPRT to set JPRT_JCK7COMPILER_HOME.
-JCK7COMPILER_HOME = $(JCK7_DEFAULT_HOME)/JCK-compiler-$(JCK7_RELEASE)
+JCK7COMPILER_HOME = $(JCK7_DEFAULT_HOME)/JCK-compiler-7
ifdef JPRT_JCK7COMPILER_HOME
- JCK7COMPILER_HOME = $(JPRT_JCK7COMPILER_HOME)
+ JCK7COMPILER_HOME = $(JPRT_JCK7COMPILER_HOME)/JCK-compiler-7
endif
# Expect JPRT to set JPRT_JCK7RUNTIME_HOME.
-JCK7RUNTIME_HOME = $(JCK7_DEFAULT_HOME)/JCK-runtime-$(JCK7_RELEASE)
+JCK7RUNTIME_HOME = $(JCK7_DEFAULT_HOME)/JCK-runtime-7
ifdef JPRT_JCK7RUNTIME_HOME
- JCK7RUNTIME_HOME = $(JPRT_JCK7RUNTIME_HOME)
+ JCK7RUNTIME_HOME = $(JPRT_JCK7RUNTIME_HOME)/JCK-runtime-7
endif
# Expect JPRT to set JPRT_JCK7DEVTOOLS_HOME.
-JCK7DEVTOOLS_HOME = $(JCK7_DEFAULT_HOME)/JCK-devtools-$(JCK7_RELEASE)
+JCK7DEVTOOLS_HOME = $(JCK7_DEFAULT_HOME)/JCK-devtools-7
ifdef JPRT_JCK7DEVTOOLS_HOME
- JCK7DEVTOOLS_HOME = $(JPRT_JCK7DEVTOOLS_HOME)
+ JCK7DEVTOOLS_HOME = $(JPRT_JCK7DEVTOOLS_HOME)/JCK-devtools-7
endif
-jck7_tests: JCK_HOME=$(JCK7_HOME)
-jck7_tests: JCK_RELEASE=$(JCK7_RELEASE)
-jck7_tests: jck_tests
-
-jck7compiler: JCK7_HOME=$(JCK7COMPILER_HOME)
-jck7compiler: JCK_BUNDLE_NAME=compiler
-jck7compiler: jck7_tests
-
-jck7compiler_lang: JCK_BUNDLE_TESTDIRS=lang
-jck7compiler_lang: jck7compiler
+# The jtjck.jar utility to use to run the tests
+JTJCK_JAR = $(JCK_HOME)/lib/jtjck.jar
+JTJCK_JAVA_ARGS = -XX:MaxPermSize=256m -Xmx512m
+JTJCK_OPTIONS = -headless -v
-jck7runtime: JCK7_HOME=$(JCK7RUNTIME_HOME)
-jck7runtime: JCK_BUNDLE_NAME=runtime
-jck7runtime: jck7_tests
-
-jck7runtime_lang: JCK_BUNDLE_TESTDIRS=lang
-jck7runtime_lang: jck7runtime
-
-jck7devtools: JCK7_HOME=$(JCK7DEVTOOLS_HOME)
-jck7devtools: JCK_BUNDLE_NAME=devtools
-jck7devtools: jck7_tests
+# Default tests to run
+ifndef JCK_COMPILER_TESTS
+ JCK_COMPILER_TESTS =
+endif
+ifndef JCK_RUNTIME_TESTS
+ JCK_RUNTIME_TESTS =
+endif
+ifndef JCK_DEVTOOLS_TESTS
+ JCK_DEVTOOLS_TESTS =
+endif
-jck7devtools_lang: JCK_BUNDLE_TESTDIRS=lang
-jck7devtools_lang: jck7devtools
+# Generic rule used to run jck tests
+_generic_jck_tests: prep $(PRODUCT_HOME) $(EXCLUDELIST)
+ @$(EXPAND) $(EXCLUDELIST) \
+ | $(CUT) -d' ' -f1 \
+ | $(SED) -e 's@^@Excluding: @'
+ ( $(CD) $(ABS_TEST_OUTPUT_DIR) && \
+ $(PRODUCT_HOME)/bin/java $(JTJCK_JAVA_ARGS) \
+ -jar "$(JTJCK_JAR)" \
+ $(JTJCK_OPTIONS) \
+ -r:$(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)")/JTreport \
+ -w:$(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)")/JTwork \
+ -jdk:$(shell $(GETMIXEDPATH) "$(PRODUCT_HOME)") \
+ $(TESTDIRS) \
+ ) ; $(BUNDLE_UP_AND_EXIT)
-PHONY_LIST += jck7compiler jck7runtime jck7devtools jck7_tests \
- jck7compiler_lang jck7runtime_lang jck7devtools_lang
+# JCK7 compiler tests
+jck7compiler:
+ $(MAKE) UNIQUE_DIR=$@ \
+ JCK_HOME=$(JCK7COMPILER_HOME) \
+ TESTDIRS="$(JCK_COMPILER_TESTS)" \
+ _generic_jck_tests
+
+# JCK7 runtime tests
+jck7runtime:
+ $(MAKE) UNIQUE_DIR=$@ \
+ JCK_HOME=$(JCK7RUNTIME_HOME) \
+ TESTDIRS="$(JCK_RUNTIME_TESTS)" \
+ _generic_jck_tests
+
+# JCK7 devtools tests
+jck7devtools:
+ $(MAKE) UNIQUE_DIR=$@ \
+ JCK_HOME=$(JCK7DEVTOOLS_HOME) \
+ TESTDIRS="$(JCK_DEVTOOLS_TESTS)" \
+ _generic_jck_tests
+
+# Run all 3 sets of JCK7 tests
+jck_all: jck7runtime jck7devtools jck7compiler
+
+PHONY_LIST += jck_all _generic_jck_tests \
+ jck7compiler jck7runtime jck7devtools
################################################################
diff --git a/test/ProblemList.txt b/test/ProblemList.txt
index 27518785b070b0fa0887c82c86838aed19560e01..78ca9534f848a9a9d9eff5b596bfa758e1523d6c 100644
--- a/test/ProblemList.txt
+++ b/test/ProblemList.txt
@@ -1,6 +1,6 @@
###########################################################################
#
-# Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2009, 2011, 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
@@ -690,6 +690,9 @@ sun/tools/jconsole/ResourceCheckTest.sh generic-all
# jdk_util
+# Filed 7027061
+java/util/Locale/Bug6989440.java windows-all
+
# Filed 6933803
java/util/concurrent/ThreadPoolExecutor/CoreThreadTimeOut.java generic-all
diff --git a/test/com/sun/awt/Translucency/WindowOpacity.java b/test/com/sun/awt/Translucency/WindowOpacity.java
index a5d80265d6070ebf40e8b447e1812cb2c341348b..26c611c35d5ed192118fa22a86591561c4ac331d 100644
--- a/test/com/sun/awt/Translucency/WindowOpacity.java
+++ b/test/com/sun/awt/Translucency/WindowOpacity.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2010, 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
diff --git a/test/com/sun/jdi/NativeInstanceFilter.java b/test/com/sun/jdi/NativeInstanceFilter.java
index 90e714e6889854edf50c42152c6d498f0c24ae0a..eaa501a35fef8c3a53e998e597187af41dd4c30b 100644
--- a/test/com/sun/jdi/NativeInstanceFilter.java
+++ b/test/com/sun/jdi/NativeInstanceFilter.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2011, 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
diff --git a/test/com/sun/jdi/NativeInstanceFilterTarg.java b/test/com/sun/jdi/NativeInstanceFilterTarg.java
index 48a21b43aba50ccd399f294799e7bd8ee33f4346..a3179da7078c781ff441ddc6158e1a9ed8a4d5c1 100644
--- a/test/com/sun/jdi/NativeInstanceFilterTarg.java
+++ b/test/com/sun/jdi/NativeInstanceFilterTarg.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2011, 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
diff --git a/test/com/sun/jdi/PrivateTransportTest.sh b/test/com/sun/jdi/PrivateTransportTest.sh
index 75e666fdb5edea358fe888b2106837e6d5e5c058..89a306c9ee99c3441ec16a15a5996c58a20f1279 100644
--- a/test/com/sun/jdi/PrivateTransportTest.sh
+++ b/test/com/sun/jdi/PrivateTransportTest.sh
@@ -1,7 +1,7 @@
#!/bin/ksh -p
#
-# Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2005, 2011, 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
@@ -99,6 +99,8 @@ fi
libdir=${TESTCLASSES}
+is_windows=false
+is_cygwin=false
case `uname -s` in
SunOS)
libarch=`uname -p`
@@ -126,10 +128,13 @@ case `uname -s` in
libloc=`dirname ${xx}`
;;
Windows*)
+ is_windows=true
libloc=${jreloc}/bin
sep=';'
;;
CYGWIN*)
+ is_windows=true
+ is_cygwin=true
libloc=${jreloc}/bin
sep=':'
@@ -176,7 +181,18 @@ fi
#
CP="-classpath \"${TESTCLASSES}\""
#
-DEBUGGEEFLAGS="$DEBUGGEEFLAGS -agentlib:jdwp=transport=${private_transport},server=y,suspend=n"
+if [ "$is_windows" = "true" ]; then
+ if [ "$is_cygwin" = "true" ]; then
+ win_fullpath=`cygpath -m "$fullpath" \
+ | sed -e 's#/#\\\\\\\\#g' -e 's/\.dll//'`
+ else
+ win_fullpath=`echo "$fullpath" \
+ | sed -e 's#/#\\\\\\\\#g' -e 's/\.dll//'`
+ fi
+ DEBUGGEEFLAGS="$DEBUGGEEFLAGS -agentlib:jdwp=transport=${win_fullpath},server=y,suspend=n"
+else
+ DEBUGGEEFLAGS="$DEBUGGEEFLAGS -agentlib:jdwp=transport=${private_transport},server=y,suspend=n"
+fi
echo ${TESTJAVA}/bin/java ${DEBUGGEEFLAGS} ${CP} ${TARGETCLASS}
eval ${TESTJAVA}/bin/java ${DEBUGGEEFLAGS} ${CP} ${TARGETCLASS}
diff --git a/test/com/sun/jdi/ProcessAttachTest.sh b/test/com/sun/jdi/ProcessAttachTest.sh
index f0a6111357413dd8b0caa0978ea17ea98e4f8d22..d48ea5ec82871faaa24ab5c6fba591a946e1a3fd 100644
--- a/test/com/sun/jdi/ProcessAttachTest.sh
+++ b/test/com/sun/jdi/ProcessAttachTest.sh
@@ -1,7 +1,7 @@
#!/bin/sh
#
-# Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2005, 2010, 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
diff --git a/test/com/sun/security/auth/module/LdapLoginModule/CheckConfigs.java b/test/com/sun/security/auth/module/LdapLoginModule/CheckConfigs.java
index f74e69079eda248eb4d5692b7dcb3cfc63f88cbc..fffcf4a204b0cfe73747bda09f1c61251131e7f4 100644
--- a/test/com/sun/security/auth/module/LdapLoginModule/CheckConfigs.java
+++ b/test/com/sun/security/auth/module/LdapLoginModule/CheckConfigs.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2011, 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
diff --git a/test/com/sun/security/auth/module/LdapLoginModule/CheckOptions.java b/test/com/sun/security/auth/module/LdapLoginModule/CheckOptions.java
index 3f7d8e3bac237d9fd18ec7936faff45c38f2a214..7e616ffc51d3f7ec8e459d8d8ba43ee2cfbabeb5 100644
--- a/test/com/sun/security/auth/module/LdapLoginModule/CheckOptions.java
+++ b/test/com/sun/security/auth/module/LdapLoginModule/CheckOptions.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2011, 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
diff --git a/test/com/sun/tools/attach/ApplicationSetup.sh b/test/com/sun/tools/attach/ApplicationSetup.sh
index a07fac420e24331400135a88bb0b70ad45c61c1a..9e40c5ddc26b7c6bb2ef75d0f4b21126a9a2b493 100644
--- a/test/com/sun/tools/attach/ApplicationSetup.sh
+++ b/test/com/sun/tools/attach/ApplicationSetup.sh
@@ -1,7 +1,7 @@
#!/bin/sh
#
-# Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2005, 2010, 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
diff --git a/test/com/sun/tools/attach/BasicTests.sh b/test/com/sun/tools/attach/BasicTests.sh
index 3f8f8571411275a4c944ddf44bd5c651af8872d1..a95060de40ee3e11677a14be3de30c632d2ee901 100644
--- a/test/com/sun/tools/attach/BasicTests.sh
+++ b/test/com/sun/tools/attach/BasicTests.sh
@@ -1,7 +1,7 @@
#!/bin/sh
#
-# Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2005, 2010, 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
diff --git a/test/com/sun/tools/attach/CommonSetup.sh b/test/com/sun/tools/attach/CommonSetup.sh
index b65d50152bf658ae1ee58ec608d1ce1dea58a1c6..b05d5d374e10fc153779bfc3d339dc5b6e97f67d 100644
--- a/test/com/sun/tools/attach/CommonSetup.sh
+++ b/test/com/sun/tools/attach/CommonSetup.sh
@@ -1,7 +1,7 @@
#!/bin/sh
#
-# Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2005, 2010, 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
diff --git a/test/com/sun/tools/attach/PermissionTests.sh b/test/com/sun/tools/attach/PermissionTests.sh
index 65d79104fbe0675185b71271d500e2d3140bd585..22828dcccea1262fadbd785c264f6017f6d89d54 100644
--- a/test/com/sun/tools/attach/PermissionTests.sh
+++ b/test/com/sun/tools/attach/PermissionTests.sh
@@ -1,7 +1,7 @@
#!/bin/sh
#
-# Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2005, 2010, 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
diff --git a/test/demo/zipfs/Basic.java b/test/demo/zipfs/Basic.java
index c0e478bc8f22672008bcb66564133ccc64356441..ae2ad15b52db2493612a171494bb0e205ab046a9 100644
--- a/test/demo/zipfs/Basic.java
+++ b/test/demo/zipfs/Basic.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2011, 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
diff --git a/test/demo/zipfs/PathOps.java b/test/demo/zipfs/PathOps.java
index ea097396dbb529204be759f67c799d263afe2d32..ec1af09c9c5e21231ac1d60b0c54b422d3117390 100644
--- a/test/demo/zipfs/PathOps.java
+++ b/test/demo/zipfs/PathOps.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2011, 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
diff --git a/test/demo/zipfs/basic.sh b/test/demo/zipfs/basic.sh
index 06353dfa761cc2fcd346f1f19fc5c8b6c12c7119..1b44152bc511d6a102de5060c8582c10e38b99f4 100644
--- a/test/demo/zipfs/basic.sh
+++ b/test/demo/zipfs/basic.sh
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2009, 2011, 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
diff --git a/test/java/awt/Container/CheckZOrderChange/CheckZOrderChange.java b/test/java/awt/Container/CheckZOrderChange/CheckZOrderChange.java
index 3c06a523b292d7e38a8c8dc0fdd100ccacbb9b5d..fa888ecfec585fa0424dbd1de88ae7453ee3afaa 100644
--- a/test/java/awt/Container/CheckZOrderChange/CheckZOrderChange.java
+++ b/test/java/awt/Container/CheckZOrderChange/CheckZOrderChange.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2011, 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
diff --git a/test/java/awt/FontClass/LCDScale.java b/test/java/awt/FontClass/LCDScale.java
index 5f8d1f6a16dd26e5a7a788073808b96d9be862de..6a9453e63af5f0fab58388cfe2d9d9035a7a9dd6 100644
--- a/test/java/awt/FontClass/LCDScale.java
+++ b/test/java/awt/FontClass/LCDScale.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2011, 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
diff --git a/test/java/awt/Graphics2D/RenderClipTest/RenderClipTest.java b/test/java/awt/Graphics2D/RenderClipTest/RenderClipTest.java
index e920c4486715d65cd349a820d533d98f15d92b39..29ef55d2ab4d7a05bfbfe85b28702faf44e9f237 100644
--- a/test/java/awt/Graphics2D/RenderClipTest/RenderClipTest.java
+++ b/test/java/awt/Graphics2D/RenderClipTest/RenderClipTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2010, 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
diff --git a/test/java/awt/PrintJob/Text/StringWidth.java b/test/java/awt/PrintJob/Text/StringWidth.java
index e16229eba27756d23967ce44249c73c65ff0cac8..6773b7f6f96854484c4e6a02c9b39784d8c62d57 100644
--- a/test/java/awt/PrintJob/Text/StringWidth.java
+++ b/test/java/awt/PrintJob/Text/StringWidth.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2011, 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
diff --git a/test/java/awt/Toolkit/Headless/GetPrintJob/GetPrintJob.java b/test/java/awt/Toolkit/Headless/GetPrintJob/GetPrintJob.java
new file mode 100644
index 0000000000000000000000000000000000000000..29a0950bf3bdfea4f92c4ac03eff73d9c07ea0fb
--- /dev/null
+++ b/test/java/awt/Toolkit/Headless/GetPrintJob/GetPrintJob.java
@@ -0,0 +1,48 @@
+/*
+@test
+@bug 7023011
+@library ../../../regtesthelpers
+@build Sysout
+@summary Toolkit.getPrintJob() throws wrong exceptions
+@author andrei dmitriev: area=awt.headless
+@run main GetPrintJob
+ */
+
+import java.awt.*;
+import java.util.Properties;
+import test.java.awt.regtesthelpers.Sysout;
+/*
+ * In headfull mode we should always getting NPE on the getPrintJob() call if frame == null.
+ */
+
+public class GetPrintJob {
+
+ public static void main(String[] s) {
+ boolean stage1Passed = false;
+ boolean stage2Passed = false;
+
+ try {
+ Toolkit.getDefaultToolkit().getPrintJob(
+ (Frame) null, "title", new Properties());
+ } catch (NullPointerException e) {
+ stage1Passed = true;
+ Sysout.println("Stage 1 passed. getPrintJob(null, String, property) has thrown NPE.");
+ }
+ if (!stage1Passed) {
+ throw new RuntimeException("getPrintJob() should have thrown NPE but didn't.");
+ }
+
+ try {
+ Toolkit.getDefaultToolkit().getPrintJob(
+ (Frame) null, "title", new JobAttributes(), new PageAttributes());
+ } catch (NullPointerException e) {
+ stage2Passed = true;
+ Sysout.println("Stage 2 passed. getPrintJob(null, String, jobAttrs, pageAttr) has thrown NPE.");
+ }
+ if (!stage2Passed) {
+ throw new RuntimeException("getPrintJob() should have thrown NPE but didn't.");
+ }
+
+ Sysout.println("Test PASSED");
+ }
+}
diff --git a/test/java/awt/Toolkit/Headless/GetPrintJob/GetPrintJobHeadless.java b/test/java/awt/Toolkit/Headless/GetPrintJob/GetPrintJobHeadless.java
new file mode 100644
index 0000000000000000000000000000000000000000..c5edf26095fa76683e17668f5d0270c10f1c9823
--- /dev/null
+++ b/test/java/awt/Toolkit/Headless/GetPrintJob/GetPrintJobHeadless.java
@@ -0,0 +1,50 @@
+/*
+@test
+@bug 7023011
+@library ../../../regtesthelpers
+@build Sysout
+@summary Toolkit.getPrintJob() throws wrong exceptions
+@author andrei dmitriev: area=awt.headless
+@run main/othervm -Djava.awt.headless=true GetPrintJobHeadless
+ */
+
+/*
+ * In headless mode we should always getting NPE on the getPrintJob() call
+ */
+import java.awt.*;
+import java.util.Properties;
+import test.java.awt.regtesthelpers.Sysout;
+
+public class GetPrintJobHeadless {
+
+ public static void main(String[] s) {
+ boolean stage1Passed = false;
+ boolean stage2Passed = false;
+
+ try {
+ Toolkit.getDefaultToolkit().getPrintJob(
+ (Frame) null, "title", new Properties());
+ } catch (NullPointerException e) {
+ stage1Passed = true;
+ e.printStackTrace();
+ Sysout.println("Stage 1 passed. getPrintJob(null, String, property) has thrown NPE.");
+ }
+ if (!stage1Passed) {
+ throw new RuntimeException("getPrintJob() should have thrown NPE but didn't.");
+ }
+
+ try {
+ Toolkit.getDefaultToolkit().getPrintJob(
+ (Frame) null, "title", new JobAttributes(), new PageAttributes());
+ } catch (NullPointerException e) {
+ stage2Passed = true;
+ e.printStackTrace();
+ Sysout.println("Stage 2 passed. getPrintJob(null, String, jobAttrs, pageAttr) has thrown NPE.");
+ }
+ if (!stage2Passed) {
+ throw new RuntimeException("getPrintJob() should have thrown NPE but didn't.");
+ }
+
+ Sysout.println("Test PASSED");
+ }
+}
diff --git a/test/java/awt/font/FontNames/LocaleFamilyNames.java b/test/java/awt/font/FontNames/LocaleFamilyNames.java
index e6d71feb814a37dcdaa9ae41b888aff8788a4bc2..5356464334e2dd0f47bb6b37c42ca50052f21c95 100644
--- a/test/java/awt/font/FontNames/LocaleFamilyNames.java
+++ b/test/java/awt/font/FontNames/LocaleFamilyNames.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2011, 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
diff --git a/test/java/awt/xembed/server/TestXEmbedServer.java b/test/java/awt/xembed/server/TestXEmbedServer.java
index 56756526a5939045a65a37f16eab24f9e00e9ac2..236ce0fd4dfabf88baafd472d7a803d54b1bd56e 100644
--- a/test/java/awt/xembed/server/TestXEmbedServer.java
+++ b/test/java/awt/xembed/server/TestXEmbedServer.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2004, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2010, 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
diff --git a/test/java/io/File/IsHidden.java b/test/java/io/File/IsHidden.java
index d2b43c5b64104fc4ae520e7b73ab5510e45eea5a..a5b87794af5037c91d9531ebaa6043afc2e70375 100644
--- a/test/java/io/File/IsHidden.java
+++ b/test/java/io/File/IsHidden.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2011, 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
diff --git a/test/java/io/File/SetAccess.java b/test/java/io/File/SetAccess.java
index 745deab1f7b89529b5a57b4ff4199a238591ccea..f9287ee5318eb0de7bcca4b9e0b2543ca1ff756c 100644
--- a/test/java/io/File/SetAccess.java
+++ b/test/java/io/File/SetAccess.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2011, 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
diff --git a/test/java/io/File/SetLastModified.java b/test/java/io/File/SetLastModified.java
index fada781a202ec7cc43b441450eaccd23c2ef1896..249b7cca94c6b11cefc56a3f596f37fdacf0e66d 100644
--- a/test/java/io/File/SetLastModified.java
+++ b/test/java/io/File/SetLastModified.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2011, 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
diff --git a/test/java/io/File/SymLinks.java b/test/java/io/File/SymLinks.java
index 355b28875d465e6104fa020ede170d732f4981be..df78f15529bf5412e0d12bae846477cf75be54a3 100644
--- a/test/java/io/File/SymLinks.java
+++ b/test/java/io/File/SymLinks.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2011, 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
diff --git a/test/java/io/File/basic.sh b/test/java/io/File/basic.sh
index 14e6eefcc2d6eb03c631dd7cfad76bc6a9a5d131..4244233e9c07af484deb0440c1b63fa8eee83032 100644
--- a/test/java/io/File/basic.sh
+++ b/test/java/io/File/basic.sh
@@ -1,7 +1,7 @@
#! /bin/sh
#
-# Copyright (c) 1998, 1999, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1998, 2010, 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
diff --git a/test/java/io/FileInputStream/LargeFileAvailable.java b/test/java/io/FileInputStream/LargeFileAvailable.java
index 0e33d9a969fd5f62d650a24ee441ebbb4943d6a7..4f82ec1b78b3abd373b624bafc229815e28f18d0 100644
--- a/test/java/io/FileInputStream/LargeFileAvailable.java
+++ b/test/java/io/FileInputStream/LargeFileAvailable.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2011, 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
diff --git a/test/java/io/FileOutputStream/AtomicAppend.java b/test/java/io/FileOutputStream/AtomicAppend.java
index c5f18e6cd9844a6e52ed92a574e6bfc16e754edd..ccc4b59cdb11589d1f7e029ca6c00b94a448d212 100644
--- a/test/java/io/FileOutputStream/AtomicAppend.java
+++ b/test/java/io/FileOutputStream/AtomicAppend.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2007, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2011, 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
diff --git a/test/java/io/OutputStreamWriter/Encode.java b/test/java/io/OutputStreamWriter/Encode.java
index fda2d03cc54f4853e0a5d7b40dffc239bfee0d73..6f7a0269b7e377177a040c1f03758315a08379f7 100644
--- a/test/java/io/OutputStreamWriter/Encode.java
+++ b/test/java/io/OutputStreamWriter/Encode.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2011, 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
diff --git a/test/java/io/PrintStream/EncodingConstructor.java b/test/java/io/PrintStream/EncodingConstructor.java
index a4b9c88429523cbb9071e8e75bba36a00d0ea4f1..4aeb225bcc8ff602883e099ba94936d6e74c13c0 100644
--- a/test/java/io/PrintStream/EncodingConstructor.java
+++ b/test/java/io/PrintStream/EncodingConstructor.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2011, 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
diff --git a/test/java/io/Serializable/NPEProvoker/NPEProvoker.java b/test/java/io/Serializable/NPEProvoker/NPEProvoker.java
index 47a8516a59475f8df9505c7062eace9872cf05c2..15981432a67f68decf47a5b2a608aae8b8def82b 100644
--- a/test/java/io/Serializable/NPEProvoker/NPEProvoker.java
+++ b/test/java/io/Serializable/NPEProvoker/NPEProvoker.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2010, 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
diff --git a/test/java/io/Serializable/evolution/RenamePackage/install/SerialDriver.java b/test/java/io/Serializable/evolution/RenamePackage/install/SerialDriver.java
index 47f79ea713d37dcb27324bff88a2018c188b9c1c..5a77164a08d6d9b8eafb672abdda34521494b470 100644
--- a/test/java/io/Serializable/evolution/RenamePackage/install/SerialDriver.java
+++ b/test/java/io/Serializable/evolution/RenamePackage/install/SerialDriver.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2011, 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
diff --git a/test/java/io/Serializable/evolution/RenamePackage/test/SerialDriver.java b/test/java/io/Serializable/evolution/RenamePackage/test/SerialDriver.java
index 533df16511d2f0483e5fa180b127c2932ad050ca..7e312695beb1a8b6c8b4e223a273c87a462c65a3 100644
--- a/test/java/io/Serializable/evolution/RenamePackage/test/SerialDriver.java
+++ b/test/java/io/Serializable/evolution/RenamePackage/test/SerialDriver.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2011, 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
diff --git a/test/java/lang/Double/ParseDouble.java b/test/java/lang/Double/ParseDouble.java
index 669d078c0296e6cb5784784ff2b0197570814223..a282a6aac68f3e7cfd12532c6f8f4b3545fef9e6 100644
--- a/test/java/lang/Double/ParseDouble.java
+++ b/test/java/lang/Double/ParseDouble.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2011, 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
diff --git a/test/java/lang/ProcessBuilder/Basic.java b/test/java/lang/ProcessBuilder/Basic.java
index 7ba90e8e8a2726499ad03322c36b3615b8a2d7d7..22916929561f687084fe60dbf44ea144a5220d32 100644
--- a/test/java/lang/ProcessBuilder/Basic.java
+++ b/test/java/lang/ProcessBuilder/Basic.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2011, 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
diff --git a/test/java/lang/Runtime/exec/Duped.java b/test/java/lang/Runtime/exec/Duped.java
index 2788b77e48cefa203c63baec7e45699719fd9f20..bef0a0f8a78a51fed53e9c3007829e8f147a69a6 100644
--- a/test/java/lang/Runtime/exec/Duped.java
+++ b/test/java/lang/Runtime/exec/Duped.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2011, 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
diff --git a/test/java/lang/Runtime/shutdown/ShutdownHooks.java b/test/java/lang/Runtime/shutdown/ShutdownHooks.java
index bfe2b60e3eee14d5a4c03724391e372d03885fb0..98c3614cb53b4b5cc487fd519164cfc195c18553 100644
--- a/test/java/lang/Runtime/shutdown/ShutdownHooks.java
+++ b/test/java/lang/Runtime/shutdown/ShutdownHooks.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2011, 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
diff --git a/test/java/lang/System/finalization/FinExit.sh b/test/java/lang/System/finalization/FinExit.sh
index 30a01ccaa312763a0efd57e4f468fd875e603133..53bc6756171df2f22ebc3ffbc492a02beaa8e7a5 100644
--- a/test/java/lang/System/finalization/FinExit.sh
+++ b/test/java/lang/System/finalization/FinExit.sh
@@ -1,7 +1,7 @@
#! /bin/sh
#
-# Copyright (c) 1998, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1998, 2010, 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
diff --git a/test/java/lang/Thread/StartOOMTest.java b/test/java/lang/Thread/StartOOMTest.java
index 57edd723c31ae97d44430ea14fb263395d3eacd9..d543749a6a05bbfd8e33348fdd4c065fa88e6048 100644
--- a/test/java/lang/Thread/StartOOMTest.java
+++ b/test/java/lang/Thread/StartOOMTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2011, 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
diff --git a/test/java/lang/Throwable/SuppressedExceptions.java b/test/java/lang/Throwable/SuppressedExceptions.java
index f1c30b358adfc972beda6bacfb9481f3ec89b7dd..b987600dca39e45133752007cf94f6f4b879303e 100644
--- a/test/java/lang/Throwable/SuppressedExceptions.java
+++ b/test/java/lang/Throwable/SuppressedExceptions.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -26,7 +26,7 @@ import java.util.*;
/*
* @test
- * @bug 6911258 6962571 6963622 6991528
+ * @bug 6911258 6962571 6963622 6991528 7005628
* @summary Basic tests of suppressed exceptions
* @author Joseph D. Darcy
*/
@@ -50,14 +50,6 @@ public class SuppressedExceptions {
} catch (IllegalArgumentException iae) {
; // Expected
}
-
- throwable.addSuppressed(null); // Immutable suppression list
- try {
- throwable.addSuppressed(throwable);
- throw new RuntimeException("IllegalArgumentException for self-suppresion not thrown.");
- } catch (IllegalArgumentException iae) {
- ; // Expected
- }
}
private static void basicSupressionTest() {
@@ -153,19 +145,19 @@ public class SuppressedExceptions {
(byte)0x02, (byte)0x00, (byte)0x00, (byte)0x78, (byte)0x70,
};
- ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
- ObjectInputStream ois = new ObjectInputStream(bais);
-
- Object o = ois.readObject();
- Throwable throwable = (Throwable) o;
+ try(ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
+ ObjectInputStream ois = new ObjectInputStream(bais)) {
+ Object o = ois.readObject();
+ Throwable throwable = (Throwable) o;
- System.err.println("TESTING SERIALIZED EXCEPTION");
+ System.err.println("TESTING SERIALIZED EXCEPTION");
- Throwable[] t0 = throwable.getSuppressed();
- if (t0.length != 0) { // Will fail if t0 is null.
- throw new RuntimeException(message);
+ Throwable[] t0 = throwable.getSuppressed();
+ if (t0.length != 0) { // Will fail if t0 is null.
+ throw new RuntimeException(message);
+ }
+ throwable.printStackTrace();
}
- throwable.printStackTrace();
}
private static void selfReference() {
@@ -183,8 +175,7 @@ public class SuppressedExceptions {
}
private static void noModification() {
- Throwable t = new Throwable();
- t.addSuppressed(null);
+ Throwable t = new NoSuppression(false);
Throwable[] t0 = t.getSuppressed();
if (t0.length != 0)
@@ -196,5 +187,24 @@ public class SuppressedExceptions {
t0 = t.getSuppressed();
if (t0.length != 0)
throw new RuntimeException("Bad nonzero length of suppressed exceptions.");
+
+ Throwable suppressed = new ArithmeticException();
+ t = new NoSuppression(true); // Suppression enabled
+ // Make sure addSuppressed(null) throws an NPE
+ try {
+ t.addSuppressed(null);
+ } catch(NullPointerException e) {
+ ; // Expected
+ }
+ t.addSuppressed(suppressed);
+ t0 = t.getSuppressed();
+ if (t0.length != 1 || t0[0] != suppressed)
+ throw new RuntimeException("Expected suppression did not occur.");
+ }
+
+ private static class NoSuppression extends Throwable {
+ public NoSuppression(boolean enableSuppression) {
+ super("The medium.", null, enableSuppression);
+ }
}
}
diff --git a/test/java/lang/annotation/PackageMain.java b/test/java/lang/annotation/PackageMain.java
index 8b3f727d8c72a99a9830e124eff2177bf496c364..5c73a9ebb255eb0cbfa0618ac6f75d72418a642d 100644
--- a/test/java/lang/annotation/PackageMain.java
+++ b/test/java/lang/annotation/PackageMain.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2011, 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
@@ -21,8 +21,6 @@
* questions.
*/
-import java.lang.annotation.Documented;
-
public class PackageMain {
public static void main(String[] args) throws Exception {
Class> c = Class.forName("foo.bar.Baz");
@@ -30,7 +28,7 @@ public class PackageMain {
System.out.println("cl=" + c.getClassLoader());
Package p = c.getPackage();
System.out.println("p=" + p);
- Documented d = p.getAnnotation(Documented.class);
+ Deprecated d = p.getAnnotation(Deprecated.class);
if (d == null) throw new Error();
}
}
diff --git a/test/java/lang/annotation/loaderLeak/LoaderLeak.sh b/test/java/lang/annotation/loaderLeak/LoaderLeak.sh
index 28a7d6c6c48760183c1a4095e2f3cb72adae54c8..6c53bf5f9e4719e68171345e227e11f8ea0ee201 100644
--- a/test/java/lang/annotation/loaderLeak/LoaderLeak.sh
+++ b/test/java/lang/annotation/loaderLeak/LoaderLeak.sh
@@ -1,6 +1,6 @@
#!/bin/sh
-# Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2004, 2010, 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
diff --git a/test/java/lang/annotation/package-info.java b/test/java/lang/annotation/package-info.java
index f5463672c5c7aacdc1c911ccd78cac09c7e3ff14..8b057d87a3d8f2667954ecfde61c31850b52b30f 100644
--- a/test/java/lang/annotation/package-info.java
+++ b/test/java/lang/annotation/package-info.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2011, 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
@@ -31,7 +31,7 @@
* @run main PackageMain
*/
-@java.lang.annotation.Documented
+@Deprecated
package foo.bar;
class Baz {}
diff --git a/test/java/lang/instrument/BootClassPath/Setup.java b/test/java/lang/instrument/BootClassPath/Setup.java
index 3ef40f1321722442e7f3e622cb8f3908c6dbc921..409c5940b90077adc48ef727c56e37cf08dd84f6 100644
--- a/test/java/lang/instrument/BootClassPath/Setup.java
+++ b/test/java/lang/instrument/BootClassPath/Setup.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2004, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2011, 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
diff --git a/test/java/lang/instrument/appendToClassLoaderSearch/CommonSetup.sh b/test/java/lang/instrument/appendToClassLoaderSearch/CommonSetup.sh
index 6074b1dc2f992d7113090118ecfcc4493b848b87..8b8d8ef3e27a363d8f1dcb6b3fba1da43f8ed6d1 100644
--- a/test/java/lang/instrument/appendToClassLoaderSearch/CommonSetup.sh
+++ b/test/java/lang/instrument/appendToClassLoaderSearch/CommonSetup.sh
@@ -1,7 +1,7 @@
#!/bin/sh
#
-# Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2005, 2010, 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
diff --git a/test/java/lang/instrument/ilib/Inject.java b/test/java/lang/instrument/ilib/Inject.java
index 5e0caa4e1dd4aa6c0c9ca6577e647b2ecb687022..22acbc9324b7784baf18c62e19ea5a3cb46cdb09 100644
--- a/test/java/lang/instrument/ilib/Inject.java
+++ b/test/java/lang/instrument/ilib/Inject.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2011, 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
diff --git a/test/java/lang/instrument/ilib/InjectBytecodes.java b/test/java/lang/instrument/ilib/InjectBytecodes.java
index 35e185889ffddd2115a021ece154858c1164fb68..53e6a2feaeabfdddea0d486550f807e403d2556c 100644
--- a/test/java/lang/instrument/ilib/InjectBytecodes.java
+++ b/test/java/lang/instrument/ilib/InjectBytecodes.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2010, 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
diff --git a/test/java/lang/invoke/6987555/Test6987555.java b/test/java/lang/invoke/6987555/Test6987555.java
index 465da236d7c0a6ca58539dc8fec208ca75002075..7a2f45c6efe394511c6544a774f12210fc64ff92 100644
--- a/test/java/lang/invoke/6987555/Test6987555.java
+++ b/test/java/lang/invoke/6987555/Test6987555.java
@@ -27,7 +27,7 @@
* @bug 6987555
* @summary JSR 292 unboxing to a boolean value fails on big-endian SPARC
*
- * @run main/othervm -Xint -ea -XX:+UnlockExperimentalVMOptions -XX:+EnableMethodHandles -XX:+EnableInvokeDynamic -XX:+UnlockDiagnosticVMOptions -XX:+VerifyMethodHandles Test6987555
+ * @run main/othervm -Xint -ea -XX:+UnlockDiagnosticVMOptions -XX:+VerifyMethodHandles Test6987555
*/
import java.lang.invoke.*;
diff --git a/test/java/lang/invoke/6991596/Test6991596.java b/test/java/lang/invoke/6991596/Test6991596.java
index e02bcfc819ea036e74263317db97d51549ad96f6..b349a10c47bde8d192430a77162578b31c1e8065 100644
--- a/test/java/lang/invoke/6991596/Test6991596.java
+++ b/test/java/lang/invoke/6991596/Test6991596.java
@@ -27,7 +27,7 @@
* @bug 6991596
* @summary JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
*
- * @run main/othervm -ea -XX:+UnlockExperimentalVMOptions -XX:+EnableMethodHandles -XX:+EnableInvokeDynamic -XX:+UnlockDiagnosticVMOptions -XX:+VerifyMethodHandles Test6991596
+ * @run main/othervm -ea -XX:+UnlockDiagnosticVMOptions -XX:+VerifyMethodHandles Test6991596
*/
import java.lang.invoke.*;
diff --git a/test/java/lang/invoke/InvokeDynamicPrintArgs.java b/test/java/lang/invoke/InvokeDynamicPrintArgs.java
index 7089e9592235f41e1a8e5d7f4ec8c24fbd381c1f..d8a395d2ba48d4d573fb4e620b4372ae2efa8eb9 100644
--- a/test/java/lang/invoke/InvokeDynamicPrintArgs.java
+++ b/test/java/lang/invoke/InvokeDynamicPrintArgs.java
@@ -25,9 +25,9 @@
* @summary smoke test for invokedynamic instructions
* @build indify.Indify
* @compile InvokeDynamicPrintArgs.java
- * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableInvokeDynamic
+ * @run main/othervm
* indify.Indify
- * --verify-specifier-count=3 --transitionalJSR292=false
+ * --verify-specifier-count=3
* --expand-properties --classpath ${test.classes}
* --java test.java.lang.invoke.InvokeDynamicPrintArgs --check-output
*/
@@ -63,7 +63,8 @@ public class InvokeDynamicPrintArgs {
String testClassPath = System.getProperty("build.test.classes.dir");
if (testClassPath == null) throw new RuntimeException();
String[] args = new String[]{
- "--verify-specifier-count=3", "--transitionalJSR292=false",
+ "--verify-specifier-count=3",
+ "--verbose",
"--expand-properties", "--classpath", testClassPath,
"--java", "test.java.lang.invoke.InvokeDynamicPrintArgs", "--check-output"
};
@@ -159,16 +160,14 @@ public class InvokeDynamicPrintArgs {
shouldNotCallThis();
return ((CallSite) MH_bsm2().invokeGeneric(lookup(),
"bar", methodType(void.class, String.class, int.class)
- , new Object[] { Void.class, "void type!",
- 1, 234.5F, 67.5, (long)89 }
+ , Void.class, "void type!", 1, 234.5F, 67.5, (long)89
)).dynamicInvoker();
}
private static MethodHandle INDY_bar2() throws Throwable {
shouldNotCallThis();
return ((CallSite) MH_bsm2().invokeGeneric(lookup(),
"bar2", methodType(void.class, String.class, int.class)
- , new Object[] { Void.class, "void type!",
- 1, 234.5F, 67.5, (long)89 }
+ , Void.class, "void type!", 1, 234.5F, 67.5, (long)89
)).dynamicInvoker();
}
private static MethodHandle INDY_baz() throws Throwable {
diff --git a/test/java/lang/invoke/InvokeGenericTest.java b/test/java/lang/invoke/InvokeGenericTest.java
index f1aaf9eaa71aa00d94e11b1b8ed373ecf14d4fb8..2da9634c464e8885a19329b0a2f9b782b89c936d 100644
--- a/test/java/lang/invoke/InvokeGenericTest.java
+++ b/test/java/lang/invoke/InvokeGenericTest.java
@@ -25,8 +25,8 @@
/* @test
* @summary unit tests for java.lang.invoke.MethodHandle.invokeGeneric
- * @compile -XDallowTransitionalJSR292=no -target 7 InvokeGenericTest.java
- * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableMethodHandles test.java.lang.invoke.InvokeGenericTest
+ * @compile -target 7 InvokeGenericTest.java
+ * @run junit/othervm test.java.lang.invoke.InvokeGenericTest
*/
package test.java.lang.invoke;
diff --git a/test/java/lang/invoke/JavaDocExamplesTest.java b/test/java/lang/invoke/JavaDocExamplesTest.java
index 7093ea2005a1c5cf0403b3bdb153679fcb66466b..7810399c62dec5cbce949bfe05e635b4cea4d497 100644
--- a/test/java/lang/invoke/JavaDocExamplesTest.java
+++ b/test/java/lang/invoke/JavaDocExamplesTest.java
@@ -25,8 +25,8 @@
/* @test
* @summary example code used in javadoc for java.lang.invoke API
- * @compile -XDallowTransitionalJSR292=no JavaDocExamplesTest.java
- * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableMethodHandles test.java.lang.invoke.JavaDocExamplesTest
+ * @compile JavaDocExamplesTest.java
+ * @run junit/othervm test.java.lang.invoke.JavaDocExamplesTest
*/
/*
@@ -34,7 +34,6 @@
$ $JAVA7X_HOME/bin/javac -cp $JUNIT4_JAR -d /tmp/Classes \
$DAVINCI/sources/jdk/test/java/lang/invoke/JavaDocExamplesTest.java
$ $JAVA7X_HOME/bin/java -cp $JUNIT4_JAR:/tmp/Classes \
- -XX:+UnlockExperimentalVMOptions -XX:+EnableMethodHandles \
-Dtest.java.lang.invoke.JavaDocExamplesTest.verbosity=1 \
test.java.lang.invoke.JavaDocExamplesTest
----
diff --git a/test/java/lang/invoke/MethodHandlesTest.java b/test/java/lang/invoke/MethodHandlesTest.java
index bae38f766bc7f5eb6103cdb85372789cbeb7332d..427229de7c30d80fcefd8da8f3ea06de449fa010 100644
--- a/test/java/lang/invoke/MethodHandlesTest.java
+++ b/test/java/lang/invoke/MethodHandlesTest.java
@@ -25,8 +25,8 @@
/* @test
* @summary unit tests for java.lang.invoke.MethodHandles
- * @compile -source 7 -target 7 -XDallowTransitionalJSR292=no MethodHandlesTest.java
- * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableMethodHandles test.java.lang.invoke.MethodHandlesTest
+ * @compile -source 7 -target 7 MethodHandlesTest.java
+ * @run junit/othervm test.java.lang.invoke.MethodHandlesTest
*/
package test.java.lang.invoke;
diff --git a/test/java/lang/invoke/MethodTypeTest.java b/test/java/lang/invoke/MethodTypeTest.java
index 5cc32771624b5ef3fa93d2743b64f0bed6ba1eef..037015090afbc0777bd8bca6ebb0c360c3a0707e 100644
--- a/test/java/lang/invoke/MethodTypeTest.java
+++ b/test/java/lang/invoke/MethodTypeTest.java
@@ -26,7 +26,7 @@
/* @test
* @summary unit tests for java.lang.invoke.MethodType
* @compile MethodTypeTest.java
- * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableMethodHandles test.java.lang.invoke.MethodTypeTest
+ * @run junit/othervm test.java.lang.invoke.MethodTypeTest
*/
package test.java.lang.invoke;
diff --git a/test/java/lang/invoke/indify/Indify.java b/test/java/lang/invoke/indify/Indify.java
index ac0485a5ebc61d4ec4d6e72c53b0eec379ff8400..6c0661dfef6cacb1e09b8ec1babc3635ae5aad1b 100644
--- a/test/java/lang/invoke/indify/Indify.java
+++ b/test/java/lang/invoke/indify/Indify.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2011, 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
@@ -89,19 +89,15 @@ import java.util.regex.*;
$ JAVA_HOME=(some recent OpenJDK 7 build)
$ ant
$ $JAVA_HOME/bin/java -cp build/classes indify.Indify --overwrite --dest build/testout build/classes/indify/Example.class
-$ $JAVA_HOME/bin/java -XX:+UnlockExperimentalVMOptions -XX:+EnableInvokeDynamic -cp build/classes indify.Example
+$ $JAVA_HOME/bin/java -cp build/classes indify.Example
MT = (java.lang.Object)java.lang.Object
MH = adder(int,int)java.lang.Integer
adder(1,2) = 3
calling indy: 42
-$ $JAVA_HOME/bin/java -XX:+UnlockExperimentalVMOptions -XX:+EnableInvokeDynamic -cp build/testout indify.Example
+$ $JAVA_HOME/bin/java -cp build/testout indify.Example
(same output as above)
*
*
- * Before OpenJDK build b123, the format of {@code CONSTANT_InvokeDynamic} is in transition,
- * and the switch {@code --transitionalJSR292=yes} is recommended.
- * It is turned off by default, but users of earlier builds may need to turn it on.
- *
* A version of this transformation built on top of http://asm.ow2.org/ would be welcome.
* @author John Rose
*/
@@ -117,7 +113,6 @@ public class Indify {
public boolean overwrite = false;
public boolean quiet = false;
public boolean verbose = false;
- public boolean transitionalJSR292 = false; // final version is distributed
public boolean all = false;
public int verifySpecifierCount = -1;
@@ -203,9 +198,6 @@ public class Indify {
case "-v": case "--verbose": case "--verbose=":
verbose = booleanOption(a2); // more output
break;
- case "--transitionalJSR292": case "--transitionalJSR292=":
- transitionalJSR292 = booleanOption(a2); // use older invokedynamic format
- break;
default:
throw new IllegalArgumentException("unrecognized flag: "+a);
}
@@ -330,10 +322,14 @@ public class Indify {
if (resolve) resolveClass(c);
return c;
}
+ } catch (ClassNotFoundException ex) {
+ // fall through
+ } catch (IOException ex) {
+ // fall through
} catch (Exception ex) {
- if (ex instanceof IllegalArgumentException)
- // pass error from reportPatternMethods
- throw (IllegalArgumentException) ex;
+ // pass error from reportPatternMethods, etc.
+ if (ex instanceof RuntimeException) throw (RuntimeException) ex;
+ throw new RuntimeException(ex);
}
}
return super.loadClass(name, resolve);
@@ -403,8 +399,7 @@ public class Indify {
if (blab++ == 0 && !quiet)
System.err.println("patching "+cf.nameString()+"."+m);
//if (blab == 1) { for (Instruction j = m.instructions(); j != null; j = j.next()) System.out.println(" |"+j); }
- if (con.tag == CONSTANT_InvokeDynamic ||
- con.tag == CONSTANT_InvokeDynamic_17) {
+ if (con.tag == CONSTANT_InvokeDynamic) {
// need to patch the following instruction too,
// but there are usually intervening argument pushes too
Instruction i2 = findPop(i);
@@ -566,7 +561,7 @@ public class Indify {
short nt = n12[1];
char cmark = poolMarks[(char)cl];
if (cmark != 0) {
- mark = cmark; // it is a java.dyn.* or java.lang.* method
+ mark = cmark; // it is a java.lang.invoke.* or java.lang.* method
break;
}
String cls = cf.pool.getString(CONSTANT_Class, cl);
@@ -597,8 +592,6 @@ public class Indify {
if (s.startsWith("MT_")) return 'T';
else if (s.startsWith("MH_")) return 'H';
else if (s.startsWith("INDY_")) return 'I';
- else if (transitionalJSR292 &&
- s.startsWith("java/dyn/")) return 'D';
else if (s.startsWith("java/lang/invoke/")) return 'D';
else if (s.startsWith("java/lang/")) return 'J';
return 0;
@@ -623,10 +616,6 @@ public class Indify {
boolean matchType(String descr, String requiredType) {
if (descr.equals(requiredType)) return true;
- if (transitionalJSR292) {
- String oldType = requiredType.replace("Ljava/lang/invoke/", "Ljava/dyn/");
- if (descr.equals(oldType)) return true;
- }
return false;
}
@@ -872,6 +861,7 @@ public class Indify {
continue;
}
break;
+ case "invoke":
case "invokeGeneric":
case "invokeWithArguments":
if (patternMark != 'I') break decode;
@@ -1022,7 +1012,7 @@ public class Indify {
private Constant makeInvokeDynamicCon(List