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/Stylepad nbproject/jfc/SwingApplet nbproject/jfc/TableExample + nbproject/jfc/TransparentRuler nbproject/scripting/jconsole-plugin nbproject/management/FullThreadDump nbproject/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 args) { // E.g.: MH_bsm.invokeGeneric(lookup(), "name", MethodType, "extraArg") removeEmptyJVMSlots(args); - if (args.size() != 4 && args.size() != 5) return null; + if (args.size() < 4) return null; int argi = 0; short nindex, tindex, ntindex, bsmindex; Object con; @@ -1035,22 +1025,17 @@ public class Indify { tindex = ((Constant)con).itemIndex(); ntindex = (short) cf.pool.addConstant(CONSTANT_NameAndType, new Short[]{ nindex, tindex }).index; - if (transitionalJSR292) { - if (argi != args.size()) { - System.err.println("BSM specifier has extra arguments but transitionalJSR292=1"); - return null; - } - return cf.pool.addConstant(CONSTANT_InvokeDynamic_17, - new Short[]{ bsmindex, ntindex }); - } - List extraArgs = Collections.emptyList(); + List extraArgs = new ArrayList(); if (argi < args.size()) { - Object arg = args.get(argi); - if (arg instanceof List) - extraArgs = (List) arg; - else - extraArgs = Arrays.asList(arg); - removeEmptyJVMSlots(args); + extraArgs.addAll(args.subList(argi, args.size() - 1)); + Object lastArg = args.get(args.size() - 1); + if (lastArg instanceof List) { + List lastArgs = (List) lastArg; + removeEmptyJVMSlots(lastArgs); + extraArgs.addAll(lastArgs); + } else { + extraArgs.add(lastArg); + } } List extraArgIndexes = new CountedList<>(Short.class); for (Object x : extraArgs) { @@ -1062,7 +1047,10 @@ public class Indify { if (x instanceof Double) { num = Double.doubleToRawLongBits((Double)x); numTag = CONSTANT_Double; } if (num != null) x = cf.pool.addConstant(numTag, x); } - if (!(x instanceof Constant)) return null; + if (!(x instanceof Constant)) { + System.err.println("warning: unrecognized BSM argument "+x); + return null; + } extraArgIndexes.add((short) ((Constant)x).index); } List specs = bootstrapMethodSpecifiers(true); @@ -1359,7 +1347,6 @@ public class Indify { case CONSTANT_Method: case CONSTANT_InterfaceMethod: case CONSTANT_NameAndType: - case CONSTANT_InvokeDynamic_17: case CONSTANT_InvokeDynamic: // read an ordered pair arg = new Short[] { in.readShort(), in.readShort() }; @@ -1634,7 +1621,6 @@ public class Indify { CONSTANT_NameAndType = 12, CONSTANT_MethodHandle = 15, // JSR 292 CONSTANT_MethodType = 16, // JSR 292 - CONSTANT_InvokeDynamic_17 = 17, // JSR 292, only occurs in old class files CONSTANT_InvokeDynamic = 18; // JSR 292 private static final byte REF_getField = 1, diff --git a/test/java/nio/BufferPoolMXBean/Basic.java b/test/java/lang/management/BufferPoolMXBean/Basic.java similarity index 78% rename from test/java/nio/BufferPoolMXBean/Basic.java rename to test/java/lang/management/BufferPoolMXBean/Basic.java index 255edae0c8b2511422523329c340c60584a36da5..a55f50ef0eff779040e512f796867082edbc28a6 100644 --- a/test/java/nio/BufferPoolMXBean/Basic.java +++ b/test/java/lang/management/BufferPoolMXBean/Basic.java @@ -22,20 +22,22 @@ */ /* @test - * @bug 6606598 - * @summary Unit test for java.nio.BufferPoolMXBean + * @bug 6606598 7024172 + * @summary Unit test for java.lang.management.BufferPoolMXBean * @run main/othervm Basic */ import java.nio.ByteBuffer; import java.nio.MappedByteBuffer; -import java.nio.BufferPoolMXBean; +import java.nio.file.Path; +import java.nio.file.Files; +import static java.nio.file.StandardOpenOption.*; import java.nio.channels.FileChannel; -import java.io.File; -import java.io.RandomAccessFile; +import java.lang.management.BufferPoolMXBean; import java.lang.management.ManagementFactory; import javax.management.MBeanServer; import javax.management.ObjectName; +import java.lang.ref.WeakReference; import java.util.*; public class Basic { @@ -78,21 +80,21 @@ public class Basic { totalCapacity += cap; } - // map a file - File f = File.createTempFile("blah", null); - f.deleteOnExit(); - RandomAccessFile raf = new RandomAccessFile(f, "rw"); - FileChannel fc = raf.getChannel(); - mbb = fc.map(FileChannel.MapMode.READ_WRITE, 10, 100); - bufferCount++; - totalCapacity += mbb.capacity(); + // create a mapped buffer + Path tmpfile = Files.createTempFile("blah", null); + tmpfile.toFile().deleteOnExit(); + try (FileChannel fc = FileChannel.open(tmpfile, READ, WRITE)) { + mbb = fc.map(FileChannel.MapMode.READ_WRITE, 10, 100); + bufferCount++; + totalCapacity += mbb.capacity(); + } - // direct + // use platform MXBeans directly List pools = ManagementFactory.getPlatformMXBeans(BufferPoolMXBean.class); check(pools, bufferCount, totalCapacity); - // using MBeanServer + // use MBeanServer MBeanServer server = ManagementFactory.getPlatformMBeanServer(); Set mbeans = server.queryNames( new ObjectName("java.nio:type=BufferPool,*"), null); @@ -103,5 +105,13 @@ public class Basic { pools.add(pool); } check(pools, bufferCount, totalCapacity); + + // attempt to unmap mapped buffer + WeakReference ref = new WeakReference<>(mbb); + mbb = null; + do { + System.gc(); + Thread.sleep(250); + } while (ref.get() != null); } } diff --git a/test/java/lang/management/ManagementFactory/GetPlatformMXBeans.java b/test/java/lang/management/ManagementFactory/GetPlatformMXBeans.java index 86acdb95dfd219929e8b19008a3be9a65d938e0b..5e88b469e50c5c20730e0b1eb3c344268496c5ef 100644 --- a/test/java/lang/management/ManagementFactory/GetPlatformMXBeans.java +++ b/test/java/lang/management/ManagementFactory/GetPlatformMXBeans.java @@ -23,23 +23,26 @@ /* * @test - * @bug 6610094 - * @summary Basic unit test of ManagementFactory.getPlatformMXBeans() - * and also PlatformManagedObject.getObjectName() + * @bug 6610094 7024172 + * @summary Basic unit test of ManagementFactory.getPlatformMXBean(s) + * methods and PlatformManagedObject.getObjectName() * @author Mandy Chung * * @run main GetPlatformMXBeans */ import java.lang.management.*; -import static java.lang.management.ManagementFactory.*; +import java.io.IOException; import java.util.*; import javax.management.*; +import static java.lang.management.ManagementFactory.*; + public class GetPlatformMXBeans { private static MBeanServer platformMBeanServer = getPlatformMBeanServer(); public static void main(String[] argv) throws Exception { + // singleton platform MXBean checkPlatformMXBean(getClassLoadingMXBean(), ClassLoadingMXBean.class, CLASS_LOADING_MXBEAN_NAME); @@ -58,17 +61,28 @@ public class GetPlatformMXBeans { checkPlatformMXBean(getThreadMXBean(), ThreadMXBean.class, THREAD_MXBEAN_NAME); + + // the following MXBean can have more than one instances checkGarbageCollectorMXBeans(getGarbageCollectorMXBeans()); checkMemoryManagerMXBeans(getMemoryManagerMXBeans()); checkMemoryPoolMXBeans(getMemoryPoolMXBeans()); + + // check invalid platform MXBean + checkInvalidPlatformMXBean(); } private static - void checkPlatformMXBean(T obj, Class mxbeanInterface, - String mxbeanName) throws Exception + void checkPlatformMXBean(T obj, Class mxbeanInterface, + String mxbeanName) + throws Exception { - int numElements = (obj != null ? 1 : 0); - // verify local list of platform MXBeans + // getPlatformMXBean may return null if the mxbean is not implemented + PlatformManagedObject mxbean = getPlatformMXBean(mxbeanInterface); + if (obj != mxbean) { + throw new RuntimeException("Singleton MXBean returned not matched"); + } + + int numElements = obj == null ? 0 : 1; List mxbeans = getPlatformMXBeans(mxbeanInterface); if (mxbeans.size() != numElements) { @@ -77,24 +91,46 @@ public class GetPlatformMXBeans { } if (obj != null) { - PlatformManagedObject pmo = mxbeans.get(0); - if (obj != pmo) { + if (obj != mxbeans.get(0)) { throw new RuntimeException("The list returned by getPlatformMXBeans" + " not matched"); } ObjectName on = new ObjectName(mxbeanName); - if (!on.equals(pmo.getObjectName())) { + if (!on.equals(mxbean.getObjectName())) { throw new RuntimeException("Unmatched ObjectName " + - pmo.getObjectName() + " Expected = " + on); + mxbean.getObjectName() + " Expected = " + on); } + checkRemotePlatformMXBean(obj, platformMBeanServer, + mxbeanInterface, mxbeanName); } + } - // verify platform MXBeans in the platform MBeanServer - mxbeans = getPlatformMXBeans(platformMBeanServer, mxbeanInterface); + // verify platform MXBeans in the platform MBeanServer + private static + void checkRemotePlatformMXBean(T obj, + MBeanServerConnection mbs, + Class mxbeanInterface, + String mxbeanName) + throws Exception + { + PlatformManagedObject mxbean = getPlatformMXBean(mbs, mxbeanInterface); + if ((obj == null && mxbean != null) || (obj != null && mxbean == null)) { + throw new RuntimeException("Singleton MXBean returned not matched"); + } + + int numElements = obj == null ? 0 : 1; + List mxbeans = + getPlatformMXBeans(mbs, mxbeanInterface); if (mxbeans.size() != numElements) { throw new RuntimeException("Unmatched number of platform MXBeans " + mxbeans.size() + ". Expected = " + numElements); } + + ObjectName on = new ObjectName(mxbeanName); + if (!on.equals(mxbean.getObjectName())) { + throw new RuntimeException("Unmatched ObjectName " + + mxbean.getObjectName() + " Expected = " + on); + } } private static void checkMemoryManagerMXBeans(List objs) @@ -148,6 +184,14 @@ public class GetPlatformMXBeans { void checkPlatformMXBeans(List objs, Class mxbeanInterface) throws Exception { + try { + getPlatformMXBean(mxbeanInterface); + // mxbeanInterface is not a singleton + throw new RuntimeException(mxbeanInterface + ": not a singleton MXBean"); + } catch (IllegalArgumentException e) { + // expect IAE + } + // verify local list of platform MXBeans List mxbeans = getPlatformMXBeans(mxbeanInterface); @@ -177,4 +221,40 @@ public class GetPlatformMXBeans { + mxbeans.size() + ". Expected = " + objs.size()); } } + + interface FakeMXBean extends PlatformManagedObject {}; + + private static void checkInvalidPlatformMXBean() throws IOException { + try { + getPlatformMXBean(FakeMXBean.class); + // mxbeanInterface is not a singleton + throw new RuntimeException("Expect IllegalArgumentException but not thrown"); + } catch (IllegalArgumentException e) { + // expect IAE + } + + try { + getPlatformMXBeans(FakeMXBean.class); + // mxbeanInterface is not a singleton + throw new RuntimeException("Expect IllegalArgumentException but not thrown"); + } catch (IllegalArgumentException e) { + // expect IAE + } + + try { + getPlatformMXBean(platformMBeanServer, FakeMXBean.class); + // mxbeanInterface is not a singleton + throw new RuntimeException("Expect IllegalArgumentException but not thrown"); + } catch (IllegalArgumentException e) { + // expect IAE + } + + try { + getPlatformMXBeans(platformMBeanServer, FakeMXBean.class); + // mxbeanInterface is not a singleton + throw new RuntimeException("Expect IllegalArgumentException but not thrown"); + } catch (IllegalArgumentException e) { + // expect IAE + } + } } diff --git a/test/java/lang/management/PlatformLoggingMXBean/LoggingMXBeanTest.java b/test/java/lang/management/PlatformLoggingMXBean/LoggingMXBeanTest.java new file mode 100644 index 0000000000000000000000000000000000000000..17569b4cec1d010ac45db98cd859d73e1d86eb80 --- /dev/null +++ b/test/java/lang/management/PlatformLoggingMXBean/LoggingMXBeanTest.java @@ -0,0 +1,229 @@ +/* + * 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. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 7024172 + * @summary Test if proxy for PlatformLoggingMXBean is equivalent + * to proxy for LoggingMXBean + * + * @build LoggingMXBeanTest + * @run main LoggingMXBeanTest + */ + +import java.lang.management.*; +import javax.management.MBeanServer; +import java.util.logging.*; +import java.util.ArrayList; +import java.util.List; + +public class LoggingMXBeanTest +{ + static String LOGGER_NAME_1 = "com.sun.management.Logger"; + static String LOGGER_NAME_2 = "com.sun.management.Logger.Logger2"; + static String UNKNOWN_LOGGER_NAME = "com.sun.management.Unknown"; + + public static void main(String[] argv) throws Exception { + MBeanServer mbs = ManagementFactory.getPlatformMBeanServer(); + LoggingMXBean proxy = + ManagementFactory.newPlatformMXBeanProxy(mbs, + LogManager.LOGGING_MXBEAN_NAME, + LoggingMXBean.class); + + // test LoggingMXBean proxy + LoggingMXBeanTest p = new LoggingMXBeanTest(proxy); + + // check if the attributes implemented by PlatformLoggingMXBean + // and LoggingMXBean return the same value + PlatformLoggingMXBean mxbean = + ManagementFactory.getPlatformMXBean(mbs, PlatformLoggingMXBean.class); + + checkAttributes(proxy, mxbean); + } + + // same verification as in java/util/logging/LoggingMXBeanTest2 + public LoggingMXBeanTest(LoggingMXBean mbean) throws Exception { + + Logger logger1 = Logger.getLogger( LOGGER_NAME_1 ); + logger1.setLevel(Level.FINE); + Logger logger2 = Logger.getLogger( LOGGER_NAME_2 ); + logger2.setLevel(null); + + /* + * Check for the existence of our new Loggers + */ + System.out.println("Test Logger Name retrieval (getLoggerNames)"); + boolean log1 = false, log2 = false; + List loggers = mbean.getLoggerNames(); + if (loggers == null || loggers.size() < 2) { + throw new RuntimeException( + "Could not Detect the presense of the new Loggers"); + } + + for (String logger : loggers) { + if (logger.equals(LOGGER_NAME_1)) { + log1 = true; + System.out.println(" : Found new Logger : " + logger); + } + if (logger.equals(LOGGER_NAME_2)) { + log2 = true; + System.out.println(" : Found new Logger : " + logger); + } + } + if ( log1 && log2 ) + System.out.println(" : PASSED." ); + else { + System.out.println(" : FAILED. Could not Detect the new Loggers." ); + throw new RuntimeException( + "Could not Detect the presense of the new Loggers"); + } + + System.out.println("Test getLoggerLevel"); + String l1 = mbean.getLoggerLevel(LOGGER_NAME_1); + System.out.println(" : Level for Logger " + LOGGER_NAME_1 + " : " + l1); + if (!l1.equals(Level.FINE.getName())) { + throw new RuntimeException( + "Expected level for " + LOGGER_NAME_1 + " = " + + Level.FINE.getName() + " but got " + l1); + } + String l2 = mbean.getLoggerLevel(LOGGER_NAME_2); + System.out.println(" : Level for Logger " + LOGGER_NAME_2 + " : " + l2); + if (!l2.equals("")) { + throw new RuntimeException( + "Expected level for " + LOGGER_NAME_2 + " = \"\"" + + " but got " + l2); + } + String l3 = mbean.getLoggerLevel(UNKNOWN_LOGGER_NAME); + System.out.println(" : Level for unknown logger : " + l3); + if (l3 != null) { + throw new RuntimeException( + "Expected level for " + UNKNOWN_LOGGER_NAME + " = null" + + " but got " + l3); + } + + System.out.println("Test setLoggerLevel"); + mbean.setLoggerLevel(LOGGER_NAME_1, "INFO"); + System.out.println(" : Set Level for Logger " + LOGGER_NAME_1 + " to: INFO"); + Level l = logger1.getLevel(); + if (l != Level.INFO) { + throw new RuntimeException( + "Expected level for " + LOGGER_NAME_1 + " = " + + Level.INFO + " but got " + l); + } + + mbean.setLoggerLevel(LOGGER_NAME_2, "SEVERE"); + System.out.println(" : Set Level for Logger " + LOGGER_NAME_2 + " to: SERVER"); + l = logger2.getLevel(); + if (l != Level.SEVERE) { + throw new RuntimeException( + "Expected level for " + LOGGER_NAME_2 + " = " + + Level.SEVERE+ " but got " + l); + } + + mbean.setLoggerLevel(LOGGER_NAME_1, null); + System.out.println(" : Set Level for Logger " + LOGGER_NAME_1 + " to: null"); + l = logger1.getLevel(); + if (l != null) { + throw new RuntimeException( + "Expected level for " + LOGGER_NAME_1 + " = null " + + " but got " + l); + } + + boolean iaeCaught = false; + System.out.println(" : Set Level for unknown Logger to: FINE"); + try { + mbean.setLoggerLevel(UNKNOWN_LOGGER_NAME, "FINE"); + } catch (IllegalArgumentException e) { + // expected + iaeCaught = true; + System.out.println(" : IllegalArgumentException caught as expected"); + } + if (!iaeCaught) { + throw new RuntimeException( + "Expected IllegalArgumentException for setting level for " + + UNKNOWN_LOGGER_NAME + " not thrown"); + } + iaeCaught = false; + System.out.println(" : Set Level for Logger " + LOGGER_NAME_1 + " to: DUMMY"); + try { + mbean.setLoggerLevel(LOGGER_NAME_1, "DUMMY"); + } catch (IllegalArgumentException e) { + // expected + iaeCaught = true; + System.out.println(" : IllegalArgumentException caught as expected"); + } + if (!iaeCaught) { + throw new RuntimeException( + "Expected IllegalArgumentException for invalid level."); + } + + + System.out.println("Test getParentLoggerName"); + String p1 = mbean.getParentLoggerName(LOGGER_NAME_2); + System.out.println(" : Parent Logger for " + LOGGER_NAME_2 + " : " + p1); + if (!p1.equals(LOGGER_NAME_1)) { + throw new RuntimeException( + "Expected parent for " + LOGGER_NAME_2 + " = " + + LOGGER_NAME_1 + " but got " + p1); + } + String p2 = mbean.getParentLoggerName(""); + System.out.println(" : Parent Logger for \"\" : " + p2); + if (!p2.equals("")) { + throw new RuntimeException( + "Expected parent for root logger \"\" = \"\"" + + " but got " + p2); + } + String p3 = mbean.getParentLoggerName(UNKNOWN_LOGGER_NAME); + System.out.println(" : Parent Logger for unknown logger : " + p3); + if (p3 != null) { + throw new RuntimeException( + "Expected level for " + UNKNOWN_LOGGER_NAME + " = null" + + " but got " + p3); + } + } + + private static void checkAttributes(LoggingMXBean mxbean1, + PlatformLoggingMXBean mxbean2) { + // verify logger names + List loggers1 = mxbean1.getLoggerNames(); + List loggers2 = mxbean2.getLoggerNames(); + if (loggers1.size() != loggers2.size()) + throw new RuntimeException("LoggerNames: unmatched number of entries"); + List loggers3 = new ArrayList<>(loggers1); + loggers3.removeAll(loggers2); + if (loggers3.size() != 0) + throw new RuntimeException("LoggerNames: unmatched loggers"); + + // verify logger's level and parent + for (String logger : loggers1) { + if (!mxbean1.getLoggerLevel(logger) + .equals(mxbean2.getLoggerLevel(logger))) + throw new RuntimeException( + "LoggerLevel: unmatched level for " + logger); + if (!mxbean1.getParentLoggerName(logger) + .equals(mxbean2.getParentLoggerName(logger))) + throw new RuntimeException( + "ParentLoggerName: unmatched parent logger's name for " + logger); + } + } +} diff --git a/test/java/util/logging/PlatformLoggingMXBean/PlatformLoggingMXBeanTest.java b/test/java/lang/management/PlatformLoggingMXBean/PlatformLoggingMXBeanTest.java similarity index 95% rename from test/java/util/logging/PlatformLoggingMXBean/PlatformLoggingMXBeanTest.java rename to test/java/lang/management/PlatformLoggingMXBean/PlatformLoggingMXBeanTest.java index f76a3d3ff1021112ec50adcfab3029c37db05cf4..3694641351dc8adeef742b52520c5253e7c8817d 100644 --- a/test/java/util/logging/PlatformLoggingMXBean/PlatformLoggingMXBeanTest.java +++ b/test/java/lang/management/PlatformLoggingMXBean/PlatformLoggingMXBeanTest.java @@ -23,10 +23,11 @@ /* * @test - * @bug 6876135 + * @bug 6876135 7024172 * * @summary Test PlatformLoggingMXBean - * This test performs similar testing as LoggingMXBeanTest. + * This test performs similar testing as + * java/util/logging/LoggingMXBeanTest. * * @build PlatformLoggingMXBeanTest * @run main PlatformLoggingMXBeanTest @@ -34,6 +35,7 @@ import javax.management.*; import java.lang.management.ManagementFactory; +import java.lang.management.PlatformLoggingMXBean; import java.util.logging.*; import java.util.List; @@ -247,14 +249,8 @@ public class PlatformLoggingMXBeanTest } public static void main(String[] argv) throws Exception { - List result = - ManagementFactory.getPlatformMXBeans(PlatformLoggingMXBean.class); - if (result.size() != 1) { - throw new RuntimeException("Unexpected number of PlatformLoggingMXBean instances: " + - result.size()); - } - - PlatformLoggingMXBean mbean = result.get(0); + PlatformLoggingMXBean mbean = + ManagementFactory.getPlatformMXBean(PlatformLoggingMXBean.class); ObjectName objname = mbean.getObjectName(); if (!objname.equals(new ObjectName(LogManager.LOGGING_MXBEAN_NAME))) { throw new RuntimeException("Invalid ObjectName " + objname); @@ -263,11 +259,12 @@ public class PlatformLoggingMXBeanTest // check if the PlatformLoggingMXBean is registered in the platform MBeanServer MBeanServer platformMBS = ManagementFactory.getPlatformMBeanServer(); ObjectName objName = new ObjectName(LogManager.LOGGING_MXBEAN_NAME); + // We could call mbs.isRegistered(objName) here. // Calling getMBeanInfo will throw exception if not found. platformMBS.getMBeanInfo(objName); - if (!platformMBS.isInstanceOf(objName, "java.util.logging.PlatformLoggingMXBean") || + if (!platformMBS.isInstanceOf(objName, "java.lang.management.PlatformLoggingMXBean") || !platformMBS.isInstanceOf(objName, "java.util.logging.LoggingMXBean")) { throw new RuntimeException(objName + " is of unexpected type"); } diff --git a/test/java/lang/reflect/Generics/TestPlainArrayNotGeneric.java b/test/java/lang/reflect/Generics/TestPlainArrayNotGeneric.java index de25d58b4ab7d8d445b252073a0183c1941cb520..3f2ef6230b867af80685868d50a1591968f8a80f 100644 --- a/test/java/lang/reflect/Generics/TestPlainArrayNotGeneric.java +++ b/test/java/lang/reflect/Generics/TestPlainArrayNotGeneric.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/lang/reflect/Method/InheritedMethods.java b/test/java/lang/reflect/Method/InheritedMethods.java index 9da23d69832fd845749a4037564c912e849ed306..ebfdc0823cda9a1089bc834e6d2c5f127e576bba 100644 --- a/test/java/lang/reflect/Method/InheritedMethods.java +++ b/test/java/lang/reflect/Method/InheritedMethods.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2007, 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 @@ -23,17 +23,14 @@ /* @test @bug 4471738 - @ignore until 6825739 fixed @summary Failure to properly traverse class hierarchy in Class.getMethod() */ import java.lang.reflect.Method; import java.util.Collection; import java.util.List; -import javax.swing.JPanel; -import javax.swing.JLabel; -public class InheritedMethods extends JPanel { +public class InheritedMethods { public static void main(String[] args) throws Exception { new InheritedMethods(); } InheritedMethods() throws Exception { Class c = Foo.class; @@ -41,7 +38,6 @@ public class InheritedMethods extends JPanel { if (m.getDeclaringClass() != java.util.List.class) { throw new RuntimeException("TEST FAILED"); } - add(new JLabel("Test")); } interface Foo extends List { } } diff --git a/test/java/math/BigInteger/BigIntegerTest.java b/test/java/math/BigInteger/BigIntegerTest.java index c23563f2208d083e8dd44c7f92cc84b073bad909..3566a1f361970f811ae42ffa987cb0827e251ea5 100644 --- a/test/java/math/BigInteger/BigIntegerTest.java +++ b/test/java/math/BigInteger/BigIntegerTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2003, 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/net/URI/Test.java b/test/java/net/URI/Test.java index 3f157ea75610db71c68e4ee54063779dddf29acc..fb0fa3326294652965b93e3ada87e28fb7902cd0 100644 --- a/test/java/net/URI/Test.java +++ b/test/java/net/URI/Test.java @@ -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/test/java/net/URLClassLoader/closetest/CloseTest.java b/test/java/net/URLClassLoader/closetest/CloseTest.java index fcd8b6b13630098e99175f0e82cd3be24f8b8865..22071944e0112b044552811e9f8b2fa82fcefe3f 100644 --- a/test/java/net/URLClassLoader/closetest/CloseTest.java +++ b/test/java/net/URLClassLoader/closetest/CloseTest.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/java/nio/MappedByteBuffer/Force.java b/test/java/nio/MappedByteBuffer/Force.java index 81f908bacee21b9570fc7d3a61dc37966c15e90d..52717642c9498eb208133814358e6b6d24be41a3 100644 --- a/test/java/nio/MappedByteBuffer/Force.java +++ b/test/java/nio/MappedByteBuffer/Force.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 diff --git a/test/java/nio/MappedByteBuffer/ZeroMap.java b/test/java/nio/MappedByteBuffer/ZeroMap.java index 81cd3532d13dfe957f8cb2cacd13d999f55acbd1..7c00bf7275055c97915a933e7f6cf154b8bed490 100644 --- a/test/java/nio/MappedByteBuffer/ZeroMap.java +++ b/test/java/nio/MappedByteBuffer/ZeroMap.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/nio/channels/AsynchronousSocketChannel/Basic.java b/test/java/nio/channels/AsynchronousSocketChannel/Basic.java index afe61d6d80a95868f8dd2f5827f9000f90191937..277ed40d4fe5a4cc78c4a5e553a86cc3f4a0f609 100644 --- a/test/java/nio/channels/AsynchronousSocketChannel/Basic.java +++ b/test/java/nio/channels/AsynchronousSocketChannel/Basic.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/test/java/nio/channels/AsynchronousSocketChannel/Leaky.java b/test/java/nio/channels/AsynchronousSocketChannel/Leaky.java index 2606627446d2fcf64de70a3a0bc8933b291c1e96..39b50187242f865f92d0784a4870dec7bb02a303 100644 --- a/test/java/nio/channels/AsynchronousSocketChannel/Leaky.java +++ b/test/java/nio/channels/AsynchronousSocketChannel/Leaky.java @@ -28,12 +28,12 @@ */ import java.nio.ByteBuffer; -import java.nio.BufferPoolMXBean; import java.nio.channels.*; import java.net.*; import java.util.List; import java.util.concurrent.Future; import java.util.concurrent.ThreadFactory; +import java.lang.management.BufferPoolMXBean; import java.lang.management.ManagementFactory; /** diff --git a/test/java/nio/channels/DatagramChannel/MulticastSendReceiveTests.java b/test/java/nio/channels/DatagramChannel/MulticastSendReceiveTests.java index f4445bb946fed2915d62d9c078134928a618f451..d07df5947adb3cd271ccf705b56761607f5dc1d3 100644 --- a/test/java/nio/channels/DatagramChannel/MulticastSendReceiveTests.java +++ b/test/java/nio/channels/DatagramChannel/MulticastSendReceiveTests.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/nio/channels/FileChannel/AtomicAppend.java b/test/java/nio/channels/FileChannel/AtomicAppend.java index 60bd746f123b1cba2ee57dccdc2f4cafcd7f7227..25f6b64924c92e5c134f78017d1259b3dc7ed093 100644 --- a/test/java/nio/channels/FileChannel/AtomicAppend.java +++ b/test/java/nio/channels/FileChannel/AtomicAppend.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/nio/channels/FileChannel/Position.java b/test/java/nio/channels/FileChannel/Position.java index c6c674d9f4fce738be754079b0b0573bf17a05bf..cbb7dd9de6e440049d57f547080e02be2e67398a 100644 --- a/test/java/nio/channels/FileChannel/Position.java +++ b/test/java/nio/channels/FileChannel/Position.java @@ -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/test/java/nio/channels/FileChannel/Transfer.java b/test/java/nio/channels/FileChannel/Transfer.java index 565f8ff100761bb7e0046cad95e675456e0dab5a..0807ead8d2009a700c5158c6adafe45f2430c12a 100644 --- a/test/java/nio/channels/FileChannel/Transfer.java +++ b/test/java/nio/channels/FileChannel/Transfer.java @@ -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/test/java/nio/charset/coders/CheckSJISMappingProp.sh b/test/java/nio/charset/coders/CheckSJISMappingProp.sh index 96066b65bc3b244c1a8e6c995b34b0f2550dff81..dcde1f47c32934e49bdb8b4f957be77f995e9347 100644 --- a/test/java/nio/charset/coders/CheckSJISMappingProp.sh +++ b/test/java/nio/charset/coders/CheckSJISMappingProp.sh @@ -1,7 +1,7 @@ #!/bin/sh # -# Copyright (c) 2003, 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/test/java/nio/file/DirectoryStream/Basic.java b/test/java/nio/file/DirectoryStream/Basic.java index ec9d68ffd17f202b3bad660bbf9f59caf8f0c19b..ecc66e4ca5f185004b1733753530aa12505bf854 100644 --- a/test/java/nio/file/DirectoryStream/Basic.java +++ b/test/java/nio/file/DirectoryStream/Basic.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/test/java/nio/file/DirectoryStream/DriveLetter.java b/test/java/nio/file/DirectoryStream/DriveLetter.java index a629a027d39093cc6df26e3d734d25d6fa0990ba..cf2e7e5913215655afcdf9503932621b89b4cd2d 100644 --- a/test/java/nio/file/DirectoryStream/DriveLetter.java +++ b/test/java/nio/file/DirectoryStream/DriveLetter.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/test/java/nio/file/DirectoryStream/SecureDS.java b/test/java/nio/file/DirectoryStream/SecureDS.java index fdfcfd9fdfe73b01eda544ae6eb6c54a7877cfd0..60ca72ec3e6d0e16c00f2a362d3ecbed0a29c853 100644 --- a/test/java/nio/file/DirectoryStream/SecureDS.java +++ b/test/java/nio/file/DirectoryStream/SecureDS.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/test/java/nio/file/FileStore/Basic.java b/test/java/nio/file/FileStore/Basic.java index 8a53ca4a47dbcbf3f2f5ed2cd9ddf9eea10476f5..176efef87a2bf750878579fe20ebe19465f2131c 100644 --- a/test/java/nio/file/FileStore/Basic.java +++ b/test/java/nio/file/FileStore/Basic.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/test/java/nio/file/Files/CheckPermissions.java b/test/java/nio/file/Files/CheckPermissions.java index 8137a358d42cd07a56478c52089a3b99bf5c7c19..ba9536a7de679730a883f746fe54ca648857af29 100644 --- a/test/java/nio/file/Files/CheckPermissions.java +++ b/test/java/nio/file/Files/CheckPermissions.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 @@ -521,19 +521,19 @@ public class CheckPermissions { // -- toRealPath -- prepare(); - file.toRealPath(true); + file.toRealPath(); assertCheckRead(file); prepare(); - file.toRealPath(false); + file.toRealPath(LinkOption.NOFOLLOW_LINKS); assertCheckRead(file); prepare(); - Paths.get(".").toRealPath(true); + Paths.get(".").toRealPath(); assertCheckPropertyAccess("user.dir"); prepare(); - Paths.get(".").toRealPath(false); + Paths.get(".").toRealPath(LinkOption.NOFOLLOW_LINKS); assertCheckPropertyAccess("user.dir"); // -- register -- diff --git a/test/java/nio/file/Files/CopyAndMove.java b/test/java/nio/file/Files/CopyAndMove.java index c0d2ba6dd8facb9880e31f0fe9d4f49a7d44afe8..a9cd87b7919e7fedda54c9a7d64af3d9e3e7cb58 100644 --- a/test/java/nio/file/Files/CopyAndMove.java +++ b/test/java/nio/file/Files/CopyAndMove.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/test/java/nio/file/Files/DeleteOnClose.java b/test/java/nio/file/Files/DeleteOnClose.java index 9b50a30b0be07cbaa9accc1fc5742c55e265c9a4..40310ee4eae0286fcdea5ce3af70691f95f67aaf 100644 --- a/test/java/nio/file/Files/DeleteOnClose.java +++ b/test/java/nio/file/Files/DeleteOnClose.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/test/java/nio/file/Files/FileAttributes.java b/test/java/nio/file/Files/FileAttributes.java index d8aea7fe3bae96b3dd3851ec03e05ab350b4d6c0..8b179f8efebc1826402d82086233fdad032b83cb 100644 --- a/test/java/nio/file/Files/FileAttributes.java +++ b/test/java/nio/file/Files/FileAttributes.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/test/java/nio/file/Files/InterruptCopy.java b/test/java/nio/file/Files/InterruptCopy.java index 1502d9e824e5a99ac233b3fc7fc11c749aff50b0..467a5eadfdf687bcdabaa2e76539a508d4897dbc 100644 --- a/test/java/nio/file/Files/InterruptCopy.java +++ b/test/java/nio/file/Files/InterruptCopy.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/test/java/nio/file/Files/Links.java b/test/java/nio/file/Files/Links.java index 0c19a0c92b528eaf039bacb57de672036e83fb3b..a87647e08a639f3dc9d15dab0228cad4584247d3 100644 --- a/test/java/nio/file/Files/Links.java +++ b/test/java/nio/file/Files/Links.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/test/java/nio/file/Files/Misc.java b/test/java/nio/file/Files/Misc.java index 1ff9d0af1903e5a321930bad4b43c72f34c4c7b7..785dbefa1d176c434243cc3f9e8bd4d9ce7ceb39 100644 --- a/test/java/nio/file/Files/Misc.java +++ b/test/java/nio/file/Files/Misc.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/test/java/nio/file/Files/PassThroughFileSystem.java b/test/java/nio/file/Files/PassThroughFileSystem.java index 31345a8bf36d124d0574b7ca27a6ec74d94709e0..0a79211cf4bc923ae79bbb82505040f6d0f8ea86 100644 --- a/test/java/nio/file/Files/PassThroughFileSystem.java +++ b/test/java/nio/file/Files/PassThroughFileSystem.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 @@ -486,8 +486,8 @@ class PassThroughFileSystem extends FileSystem { } @Override - public Path toRealPath(boolean resolveLinks) throws IOException { - return wrap(delegate.toRealPath(resolveLinks)); + public Path toRealPath(LinkOption... options) throws IOException { + return wrap(delegate.toRealPath(options)); } @Override diff --git a/test/java/nio/file/Files/SBC.java b/test/java/nio/file/Files/SBC.java index 6dcf1a92fc01c24963f51b4b20ad5f22ed1cfb88..ab467266edfe25d2c23bc05c7b1d3e4499822bff 100644 --- a/test/java/nio/file/Files/SBC.java +++ b/test/java/nio/file/Files/SBC.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/test/java/nio/file/Files/TemporaryFiles.java b/test/java/nio/file/Files/TemporaryFiles.java index 254f874175addbe346b871f6dc6e9aa5601bc449..4e971bc5427605bafc1aa78884de8cfb19184631 100644 --- a/test/java/nio/file/Files/TemporaryFiles.java +++ b/test/java/nio/file/Files/TemporaryFiles.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/test/java/nio/file/Files/delete_on_close.sh b/test/java/nio/file/Files/delete_on_close.sh index 1f3fb67ea5826a29a276447dacd07bb1e7b4cd8c..7ffa009a8172a875f79937fce0041054c549021b 100644 --- a/test/java/nio/file/Files/delete_on_close.sh +++ b/test/java/nio/file/Files/delete_on_close.sh @@ -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/test/java/nio/file/Files/probeContentType/Basic.java b/test/java/nio/file/Files/probeContentType/Basic.java index ce692121d1c11154693fbd85aac7c43c034f9f84..3980637a77eda846f0aa409c2c3ac200113a9f75 100644 --- a/test/java/nio/file/Files/probeContentType/Basic.java +++ b/test/java/nio/file/Files/probeContentType/Basic.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/test/java/nio/file/Files/probeContentType/ForceLoad.java b/test/java/nio/file/Files/probeContentType/ForceLoad.java index a4bfe5915a162019d43158d66d6aeeba1b5e059f..5bb19ddaaa00cca274d8151a96dfbf048bb3be5a 100644 --- a/test/java/nio/file/Files/probeContentType/ForceLoad.java +++ b/test/java/nio/file/Files/probeContentType/ForceLoad.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/test/java/nio/file/Files/probeContentType/SimpleFileTypeDetector.java b/test/java/nio/file/Files/probeContentType/SimpleFileTypeDetector.java index a6b0e76ecd8f2c80895e013c5bda76018ad51298..858b6a1948574b6b2316fc0fc8f9d840fb9245e7 100644 --- a/test/java/nio/file/Files/probeContentType/SimpleFileTypeDetector.java +++ b/test/java/nio/file/Files/probeContentType/SimpleFileTypeDetector.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/test/java/nio/file/Files/walkFileTree/CreateFileTree.java b/test/java/nio/file/Files/walkFileTree/CreateFileTree.java index c00f058152da6739b14ec9d84da95bf78ec97254..9911bfa405aa52c71c09626d3170177a32397340 100644 --- a/test/java/nio/file/Files/walkFileTree/CreateFileTree.java +++ b/test/java/nio/file/Files/walkFileTree/CreateFileTree.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/test/java/nio/file/Files/walkFileTree/MaxDepth.java b/test/java/nio/file/Files/walkFileTree/MaxDepth.java index 9fab42b2740abe228a436a6d4564d67c80a1c410..ce0d15592d712cb8153cc1b36fc2e258a2246572 100644 --- a/test/java/nio/file/Files/walkFileTree/MaxDepth.java +++ b/test/java/nio/file/Files/walkFileTree/MaxDepth.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/nio/file/Files/walkFileTree/PrintFileTree.java b/test/java/nio/file/Files/walkFileTree/PrintFileTree.java index 048298bcb19689affeb22aefa81ebd34392d590b..11fec7cd6a056628cce4922dc89b0ff9da3859d1 100644 --- a/test/java/nio/file/Files/walkFileTree/PrintFileTree.java +++ b/test/java/nio/file/Files/walkFileTree/PrintFileTree.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/test/java/nio/file/Files/walkFileTree/SkipSiblings.java b/test/java/nio/file/Files/walkFileTree/SkipSiblings.java index 36231987280beb8cdeeba7da6831632962db9e73..cca004427c44429e1bd05f1e118fb6293a8d41e9 100644 --- a/test/java/nio/file/Files/walkFileTree/SkipSiblings.java +++ b/test/java/nio/file/Files/walkFileTree/SkipSiblings.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/test/java/nio/file/Files/walkFileTree/TerminateWalk.java b/test/java/nio/file/Files/walkFileTree/TerminateWalk.java index d72c8816f725596947894d9472c75fa2e55ae628..134d68b749d2da25717d628c25fcf45bd1bee250 100644 --- a/test/java/nio/file/Files/walkFileTree/TerminateWalk.java +++ b/test/java/nio/file/Files/walkFileTree/TerminateWalk.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/test/java/nio/file/Files/walkFileTree/WalkWithSecurity.java b/test/java/nio/file/Files/walkFileTree/WalkWithSecurity.java index 91e61c476be5cc7dc85755f9eb104e37258a604c..9cfc682c956cefad84abc52d74edc41db710a56a 100644 --- a/test/java/nio/file/Files/walkFileTree/WalkWithSecurity.java +++ b/test/java/nio/file/Files/walkFileTree/WalkWithSecurity.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/nio/file/Files/walkFileTree/walk_file_tree.sh b/test/java/nio/file/Files/walkFileTree/walk_file_tree.sh index da3ad3bb59327fd18ebd34b1d6f2bf621c1db5f3..dee0dd06f7113b5aeaffbf209ba9c216d6adbb65 100644 --- a/test/java/nio/file/Files/walkFileTree/walk_file_tree.sh +++ b/test/java/nio/file/Files/walkFileTree/walk_file_tree.sh @@ -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/test/java/nio/file/Path/Misc.java b/test/java/nio/file/Path/Misc.java index b2bf03e3510b15e2cc8c2694e916b14fe85b273d..424a60d6bdc42f62151b7269f93dd7f12ec0e1b6 100644 --- a/test/java/nio/file/Path/Misc.java +++ b/test/java/nio/file/Path/Misc.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 @@ -22,12 +22,13 @@ */ /* @test - * @bug 4313887 6838333 + * @bug 4313887 6838333 7029979 * @summary Unit test for miscellenous java.nio.file.Path methods * @library .. */ import java.nio.file.*; +import static java.nio.file.LinkOption.*; import java.io.*; public class Misc { @@ -96,65 +97,65 @@ public class Misc { final Path link = dir.resolve("link"); /** - * Test: totRealPath(true) will access same file as toRealPath(false) + * Test: totRealPath() will access same file as toRealPath(NOFOLLOW_LINKS) */ - assertTrue(Files.isSameFile(file.toRealPath(true), file.toRealPath(false))); + assertTrue(Files.isSameFile(file.toRealPath(), file.toRealPath(NOFOLLOW_LINKS))); /** * Test: toRealPath should fail if file does not exist */ Path doesNotExist = dir.resolve("DoesNotExist"); try { - doesNotExist.toRealPath(true); + doesNotExist.toRealPath(); throw new RuntimeException("IOException expected"); } catch (IOException expected) { } try { - doesNotExist.toRealPath(false); + doesNotExist.toRealPath(NOFOLLOW_LINKS); throw new RuntimeException("IOException expected"); } catch (IOException expected) { } /** - * Test: toRealPath(true) should resolve links + * Test: toRealPath() should resolve links */ if (supportsLinks) { Files.createSymbolicLink(link, file.toAbsolutePath()); - assertTrue(link.toRealPath(true).equals(file.toRealPath(true))); + assertTrue(link.toRealPath().equals(file.toRealPath())); Files.delete(link); } /** - * Test: toRealPath(false) should not resolve links + * Test: toRealPath(NOFOLLOW_LINKS) should not resolve links */ if (supportsLinks) { Files.createSymbolicLink(link, file.toAbsolutePath()); - assertTrue(link.toRealPath(false).getFileName().equals(link.getFileName())); + assertTrue(link.toRealPath(NOFOLLOW_LINKS).getFileName().equals(link.getFileName())); Files.delete(link); } /** - * Test: toRealPath(false) with broken link + * Test: toRealPath(NOFOLLOW_LINKS) with broken link */ if (supportsLinks) { Path broken = Files.createSymbolicLink(link, doesNotExist); - assertTrue(link.toRealPath(false).getFileName().equals(link.getFileName())); + assertTrue(link.toRealPath(NOFOLLOW_LINKS).getFileName().equals(link.getFileName())); Files.delete(link); } /** * Test: toRealPath should eliminate "." */ - assertTrue(dir.resolve(".").toRealPath(true).equals(dir.toRealPath(true))); - assertTrue(dir.resolve(".").toRealPath(false).equals(dir.toRealPath(false))); + assertTrue(dir.resolve(".").toRealPath().equals(dir.toRealPath())); + assertTrue(dir.resolve(".").toRealPath(NOFOLLOW_LINKS).equals(dir.toRealPath(NOFOLLOW_LINKS))); /** * Test: toRealPath should eliminate ".." when it doesn't follow a * symbolic link */ Path subdir = Files.createDirectory(dir.resolve("subdir")); - assertTrue(subdir.resolve("..").toRealPath(true).equals(dir.toRealPath(true))); - assertTrue(subdir.resolve("..").toRealPath(false).equals(dir.toRealPath(false))); + assertTrue(subdir.resolve("..").toRealPath().equals(dir.toRealPath())); + assertTrue(subdir.resolve("..").toRealPath(NOFOLLOW_LINKS).equals(dir.toRealPath(NOFOLLOW_LINKS))); Files.delete(subdir); // clean-up diff --git a/test/java/nio/file/Path/PathOps.java b/test/java/nio/file/Path/PathOps.java index 00264201201408ce33b2aa6a501be5d5018c2b6e..03177f05d2c3aa877a66e3f3daf2b794e87964c7 100644 --- a/test/java/nio/file/Path/PathOps.java +++ b/test/java/nio/file/Path/PathOps.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/test/java/nio/file/Path/UriImportExport.java b/test/java/nio/file/Path/UriImportExport.java index 1db4d85d19e9be16f1e1405e0bddd39916b80cc8..934098096b615ed858babde6d8de1d11991f40c7 100644 --- a/test/java/nio/file/Path/UriImportExport.java +++ b/test/java/nio/file/Path/UriImportExport.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/test/java/nio/file/TestUtil.java b/test/java/nio/file/TestUtil.java index f77d8f1adb34f04189313cca88a3d462137e87b3..66cf21bfb35ee275a0b054d051f0d988f57071f6 100644 --- a/test/java/nio/file/TestUtil.java +++ b/test/java/nio/file/TestUtil.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/test/java/nio/file/WatchService/Basic.java b/test/java/nio/file/WatchService/Basic.java index 1b4c526dbd8c2a3da554a69e5f9b8e104610b765..a51b07f4588fead989f36a41a0e186f866ec0af4 100644 --- a/test/java/nio/file/WatchService/Basic.java +++ b/test/java/nio/file/WatchService/Basic.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/test/java/nio/file/WatchService/FileTreeModifier.java b/test/java/nio/file/WatchService/FileTreeModifier.java index cde17db11247d9b3d7b19eb8aa7c67a9826e9d87..dfca07f5aeba4970b14f6af0fe854d74b627276e 100644 --- a/test/java/nio/file/WatchService/FileTreeModifier.java +++ b/test/java/nio/file/WatchService/FileTreeModifier.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/test/java/nio/file/WatchService/LotsOfEvents.java b/test/java/nio/file/WatchService/LotsOfEvents.java index 96fb4d81783a09c4204121c7e5f03f756071dee7..3512d0e7e6c6351ddd1c1939f3a3ce1faf68412d 100644 --- a/test/java/nio/file/WatchService/LotsOfEvents.java +++ b/test/java/nio/file/WatchService/LotsOfEvents.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/nio/file/WatchService/SensitivityModifier.java b/test/java/nio/file/WatchService/SensitivityModifier.java index 47ff2b69bcffb0be2a43069ac925fbe48ea9aaf3..a6f5d8a4ae7cf8d1365c7078a2508e63dd717bd0 100644 --- a/test/java/nio/file/WatchService/SensitivityModifier.java +++ b/test/java/nio/file/WatchService/SensitivityModifier.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/test/java/nio/file/attribute/AclFileAttributeView/Basic.java b/test/java/nio/file/attribute/AclFileAttributeView/Basic.java index bc32699cbfaa48cd511cd76c77d9c14924141fd2..aa613e22b7860163f4ee93d99ab441895946b471 100644 --- a/test/java/nio/file/attribute/AclFileAttributeView/Basic.java +++ b/test/java/nio/file/attribute/AclFileAttributeView/Basic.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/test/java/nio/file/attribute/BasicFileAttributeView/Basic.java b/test/java/nio/file/attribute/BasicFileAttributeView/Basic.java index 794a42c1c46755b03a7e4acca867d0ad2a153935..dd005c2c32694edab652f3372a45c5756a73cc8a 100644 --- a/test/java/nio/file/attribute/BasicFileAttributeView/Basic.java +++ b/test/java/nio/file/attribute/BasicFileAttributeView/Basic.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/test/java/nio/file/attribute/DosFileAttributeView/Basic.java b/test/java/nio/file/attribute/DosFileAttributeView/Basic.java index 702c95050cce8c915aab5c94ab2ec549060528a2..b00ceb56d25e6bfb7f42136aca6aaa1b229a45e4 100644 --- a/test/java/nio/file/attribute/DosFileAttributeView/Basic.java +++ b/test/java/nio/file/attribute/DosFileAttributeView/Basic.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/test/java/nio/file/attribute/FileTime/Basic.java b/test/java/nio/file/attribute/FileTime/Basic.java index f907c00f871ff65b33ab1af3f13fdc1699fd855c..9a8bdf68205e9cfb9b5831ba21e1821e62f45290 100644 --- a/test/java/nio/file/attribute/FileTime/Basic.java +++ b/test/java/nio/file/attribute/FileTime/Basic.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/nio/file/attribute/PosixFileAttributeView/Basic.java b/test/java/nio/file/attribute/PosixFileAttributeView/Basic.java index 7d948b9bd3e1001de97cbd56aac930960b9b8204..1ce0c6031cdeba80d516f95fc90f3803b79eaecf 100644 --- a/test/java/nio/file/attribute/PosixFileAttributeView/Basic.java +++ b/test/java/nio/file/attribute/PosixFileAttributeView/Basic.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/test/java/nio/file/attribute/UserDefinedFileAttributeView/Basic.java b/test/java/nio/file/attribute/UserDefinedFileAttributeView/Basic.java index c8c07b4d8e4b951c3460ca4043c7d9f506956d51..69393a30a61b81eead30d893b2673e878dd0b57a 100644 --- a/test/java/nio/file/attribute/UserDefinedFileAttributeView/Basic.java +++ b/test/java/nio/file/attribute/UserDefinedFileAttributeView/Basic.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/test/java/nio/file/spi/SetDefaultProvider.java b/test/java/nio/file/spi/SetDefaultProvider.java index e21be72985ab9d7c9e772f03c782fea565c84800..10629f89b1d47fafa8eaaea41c386f38f3ae5456 100644 --- a/test/java/nio/file/spi/SetDefaultProvider.java +++ b/test/java/nio/file/spi/SetDefaultProvider.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/test/java/nio/file/spi/TestProvider.java b/test/java/nio/file/spi/TestProvider.java index a604b6dfe7e4a132565aefd0a5950cd2deb4802f..b2744f4c0e5d158b8e9ba37bb4c2ea51972213ae 100644 --- a/test/java/nio/file/spi/TestProvider.java +++ b/test/java/nio/file/spi/TestProvider.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/test/java/security/Security/ClassLoaderDeadlock/Deadlock2.sh b/test/java/security/Security/ClassLoaderDeadlock/Deadlock2.sh index f084942af21738d706a945c23c18fb792910ba53..e067300ba4fd54156afb0e9bebe6eba25a640f30 100644 --- a/test/java/security/Security/ClassLoaderDeadlock/Deadlock2.sh +++ b/test/java/security/Security/ClassLoaderDeadlock/Deadlock2.sh @@ -1,7 +1,7 @@ #!/bin/sh # -# Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2009, 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/util/Arrays/Sorting.java b/test/java/util/Arrays/Sorting.java index 9eac7989e12b10249e14e1ff8a0cade199e1b52a..9d56b20d1c555bfb4571b1fcff1ea7885371641f 100644 --- a/test/java/util/Arrays/Sorting.java +++ b/test/java/util/Arrays/Sorting.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/java/util/Collection/MOAT.java b/test/java/util/Collection/MOAT.java index ce7975635a861fbe76684238b451e71b4733ceaa..3953240bda3a7804346705397de6d79e720217f7 100644 --- a/test/java/util/Collection/MOAT.java +++ b/test/java/util/Collection/MOAT.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/util/Currency/ValidateISO4217.java b/test/java/util/Currency/ValidateISO4217.java index 486741fdd2c9473dab09df3b4dcf9a47ba5439bc..cfbe28b831200c211c2e27f541ed5046fea3677e 100644 --- a/test/java/util/Currency/ValidateISO4217.java +++ b/test/java/util/Currency/ValidateISO4217.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/util/Locale/LocaleEnhanceTest.java b/test/java/util/Locale/LocaleEnhanceTest.java index 23445d5afc063a84aa5f8029120865389f29e3c8..d2d997b78b6bcf3eee70c7a06e7e7144486c596c 100644 --- a/test/java/util/Locale/LocaleEnhanceTest.java +++ b/test/java/util/Locale/LocaleEnhanceTest.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/util/Locale/LocaleTest.java b/test/java/util/Locale/LocaleTest.java index 0c21a8ef3544b870269a16349a482425dafb5e80..88a01657191dda1c03fc8aa5eb085a2d48078ec9 100644 --- a/test/java/util/Locale/LocaleTest.java +++ b/test/java/util/Locale/LocaleTest.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/util/Objects/BasicObjectsTest.java b/test/java/util/Objects/BasicObjectsTest.java index bf025a8ad2c7f07a62820513fbd2f829774a5882..695b57a96bfc46415a8004edf306104b0c0eed7c 100644 --- a/test/java/util/Objects/BasicObjectsTest.java +++ b/test/java/util/Objects/BasicObjectsTest.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/util/ResourceBundle/Bug6204853.java b/test/java/util/ResourceBundle/Bug6204853.java index 4ba5386c8e58ff4b6e2a521852525ad86702991a..2bd0ce8575d32b39b9d2907937ea1c1f4ddafca7 100644 --- a/test/java/util/ResourceBundle/Bug6204853.java +++ b/test/java/util/ResourceBundle/Bug6204853.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/util/WeakHashMap/GCDuringIteration.java b/test/java/util/WeakHashMap/GCDuringIteration.java index 482d04426ca1805b6e5a7b6574a483380007af60..4744ecce1813d406ffe2b733ad13ecb8595ce258 100644 --- a/test/java/util/WeakHashMap/GCDuringIteration.java +++ b/test/java/util/WeakHashMap/GCDuringIteration.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/util/concurrent/Executors/AutoShutdown.java b/test/java/util/concurrent/Executors/AutoShutdown.java index fb4976ff87840461ea7fda2f46837f480916715b..eff57592397dc9a50534b2a2a2a2eb787542e874 100644 --- a/test/java/util/concurrent/Executors/AutoShutdown.java +++ b/test/java/util/concurrent/Executors/AutoShutdown.java @@ -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/test/java/util/concurrent/ThreadPoolExecutor/CoreThreadTimeOut.java b/test/java/util/concurrent/ThreadPoolExecutor/CoreThreadTimeOut.java index 547cd2130f0bf4ef7b28717e474f05df0905a9d7..944b466beb0ec594ef187c9afed87eab8c915dd0 100644 --- a/test/java/util/concurrent/ThreadPoolExecutor/CoreThreadTimeOut.java +++ b/test/java/util/concurrent/ThreadPoolExecutor/CoreThreadTimeOut.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/util/jar/JarEntry/GetMethodsReturnClones.java b/test/java/util/jar/JarEntry/GetMethodsReturnClones.java index dfbeeee0a806ae5da20bc35b436f5a751e65ea0a..80ec16e14734c9406e0d5a53303b1a99aa875147 100644 --- a/test/java/util/jar/JarEntry/GetMethodsReturnClones.java +++ b/test/java/util/jar/JarEntry/GetMethodsReturnClones.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/util/jar/JarFile/MevNPE.java b/test/java/util/jar/JarFile/MevNPE.java new file mode 100644 index 0000000000000000000000000000000000000000..f8627d333248bbcb9e7c1a2b7fe993fe67e4044d --- /dev/null +++ b/test/java/util/jar/JarFile/MevNPE.java @@ -0,0 +1,45 @@ +/* + * 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. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* @test + * @bug 7023056 + * @summary NPE from sun.security.util.ManifestEntryVerifier.verify during Maven build + */ +import java.io.*; +import java.util.jar.*; + +public class MevNPE { + public static void main(String[] args) throws Exception { + File f = new File(System.getProperty("test.src", "."), "Signed.jar"); + try (JarFile jf = new JarFile(f, true)) { + try (InputStream s1 = jf.getInputStream( + jf.getJarEntry(JarFile.MANIFEST_NAME))) { + s1.read(new byte[10000]); + }; + try (InputStream s2 = jf.getInputStream( + jf.getJarEntry(JarFile.MANIFEST_NAME))) { + s2.read(new byte[10000]); + }; + } + } +} diff --git a/test/java/util/jar/JarFile/ScanSignedJar.java b/test/java/util/jar/JarFile/ScanSignedJar.java index b13a2313418e93ceb1eaf9abc926cf2eb84c5dc7..fe49cea24aa332d95d9cdd76daad325b8ecc2b0c 100644 --- a/test/java/util/jar/JarFile/ScanSignedJar.java +++ b/test/java/util/jar/JarFile/ScanSignedJar.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/util/logging/ClassLoaderLeakTest.java b/test/java/util/logging/ClassLoaderLeakTest.java index bc29876510dd060f91a4401c4e78fcf47e305ea5..a1c56fa6abe69d8064c1b07b48d6f8439e471190 100644 --- a/test/java/util/logging/ClassLoaderLeakTest.java +++ b/test/java/util/logging/ClassLoaderLeakTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 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/util/logging/SimpleFormatterFormat.java b/test/java/util/logging/SimpleFormatterFormat.java new file mode 100644 index 0000000000000000000000000000000000000000..fc786a0f092d7a7972e2ed68e8f96e05794d62b2 --- /dev/null +++ b/test/java/util/logging/SimpleFormatterFormat.java @@ -0,0 +1,159 @@ +/* + * 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. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 6381464 + * @summary Test the custom simple formatter output + * + * @run main/othervm SimpleFormatterFormat + */ + +import java.io.*; +import java.util.logging.*; +import java.util.regex.*; + +public class SimpleFormatterFormat { + private static final String key = "java.util.logging.SimpleFormatter.format"; + private static final String origFormat = System.getProperty(key); + private static final PrintStream err = System.err; + public static void main(String[] args) throws Exception { + try { + File dir = new File(System.getProperty("user.dir", ".")); + File log = new File(dir, "simpleformat.txt"); + java.nio.file.Files.deleteIfExists(log.toPath()); + PrintStream logps = new PrintStream(log); + System.setProperty(key, "%3$s:%4$s: %5$s [%1$tc] source: %2$s%6$s%n"); + writeLogRecords(logps); + checkLogRecords(log); + } finally { + if (origFormat == null) { + System.clearProperty(key); + } else { + System.setProperty(key, origFormat); + } + System.setErr(err); + } + } + + private static String[] loggers = new String[] { + "test.foo", + "test.foo", + "test.bar", + "test.bar" + }; + private static String[] messages = new String[] { + "severe hello world", + "warning lost connection", + "info welcome", + "warning exception thrown", + }; + private static void writeLogRecords(PrintStream logps) throws Exception { + try { + System.setErr(logps); + + Logger foo = Logger.getLogger("test.foo"); + foo.log(Level.SEVERE, "{0} {1} {2}", new Object[] {"severe", "hello", "world"}); + foo.warning(messages[1]); + + Logger bar = Logger.getLogger("test.bar"); + bar.finest("Dummy message"); + bar.info(messages[2]); + bar.log(Level.WARNING, messages[3], new IllegalArgumentException()); + + } finally { + logps.flush(); + logps.close(); + System.setErr(err); + } + } + + private static void checkLogRecords(File log) throws Exception { + System.out.println("Checking log records in file: " + log); + Pattern p = Pattern.compile("([\\.a-zA-Z:]+) (.*) \\[.*\\] source: (.*)"); + + try (FileInputStream in = new FileInputStream(log)) { + BufferedReader reader = new BufferedReader(new InputStreamReader(in)); + String line; + int i = 0; + while (i < messages.length && + (line = reader.readLine()) != null) { + String expectedLogger = loggers[i]; + String expectedMsg = messages[i]; + i++; + + line = line.trim(); + System.out.println(line); + + Matcher m = p.matcher(line); + if (!m.matches()) { + throw new RuntimeException("Unexpected output format"); + } + if (m.groupCount() != 3) { + throw new RuntimeException("Unexpected group count = " + + m.groupCount()); + } + // verify logger name and level + String[] ss = m.group(1).split(":"); + int len = ss.length; + if (len != 2) { + throw new RuntimeException("Unexpected logger name and level" + + m.group(1)); + } + + verify(expectedLogger, expectedMsg, ss[0], ss[1], m.group(2), m.group(3)); + } + + // expect IllegalArgumentException following it + line = reader.readLine().trim(); + if (!line.equals("java.lang.IllegalArgumentException")) { + throw new RuntimeException("Invalid line: " + line); + } + } + } + + private static void verify(String expectedLogger, String expectedMsg, + String logger, String level, + String msg, String source) { + if (!logger.equals(expectedLogger)) { + throw new RuntimeException("Unexpected logger: " + logger); + } + if (!msg.equals(expectedMsg)) { + throw new RuntimeException("Unexpected message: " + msg); + } + + String[] ss = expectedMsg.split("\\s+"); + String expectedLevel = ss[0].toUpperCase(); + if (!level.equals(expectedLevel)) { + throw new RuntimeException("Unexpected level: " + level); + } + + ss = source.split("\\s+"); + int len = ss.length; + if (!(len == 2 && + ss[0].equals("SimpleFormatterFormat") && + ss[1].equals("writeLogRecords"))) { + throw new RuntimeException("Unexpected source: " + source); + } + } +} diff --git a/test/java/util/regex/RegExTest.java b/test/java/util/regex/RegExTest.java index e323066c3a277ab14ebb50e884bb20917cfce5d2..b444ab4816cf4a352a01f9a55f7c423701e90c2a 100644 --- a/test/java/util/regex/RegExTest.java +++ b/test/java/util/regex/RegExTest.java @@ -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/test/java/util/zip/Available.java b/test/java/util/zip/Available.java index 2a78bd0d8e84f57684652ac874605154e07876fa..f22722431011f52d902f40249edbb3bbde01ab86 100644 --- a/test/java/util/zip/Available.java +++ b/test/java/util/zip/Available.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2003, 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/util/zip/FileBuilder.java b/test/java/util/zip/FileBuilder.java index 7a01a215970b74a5dac4f4af9705b4d4ab79168a..68512321f17a3cb8a82fda95821dffcd5142d06a 100644 --- a/test/java/util/zip/FileBuilder.java +++ b/test/java/util/zip/FileBuilder.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/util/zip/FlaterCriticalArray.java b/test/java/util/zip/FlaterCriticalArray.java new file mode 100644 index 0000000000000000000000000000000000000000..3d90195dea2ca27b34f34275e2df5313425f28c6 --- /dev/null +++ b/test/java/util/zip/FlaterCriticalArray.java @@ -0,0 +1,295 @@ +/* + * 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. + * + * 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. + */ + +/** + * ZIP inflater/deflater performance. + */ + +/* + * Run this test on JDK 6 and on later + * JDKs to compare results: + * java -server -Xms1024M -Xmx1024M -Ddebug=true FlaterCriticalArray + * + * The performance issues can be readily seen on JDK 6, and so this code is + * written to compile on that platform: it does *not* use any JDK 7 - specific + * features. + */ + +import java.io.*; +import java.nio.*; +import java.util.*; +import java.util.zip.*; + +public class FlaterCriticalArray { + // If true, print information about performance + private static final boolean debug = System.getProperty("debug") != null; + + private static void debug(String s) { + if (debug) System.out.println(s); + } + + private static void debug(String name, String inOut, long time, int length) { + debug(name + ": Duration of " + inOut + "(in ms): " + time); + debug(name + ": " + inOut + "d data length: " + length + " bytes"); + } + + private static byte[] grow(byte[] a, int capacity) { + while (a.length < capacity) { + byte[] a2 = new byte[a.length * 2]; + System.arraycopy(a, 0, a2, 0, a.length); + a = a2; + } + return a; + } + + private static byte[] trim(byte[] a, int length) { + byte[] res = new byte[length]; + System.arraycopy(a, 0, res, 0, length); + return res; + } + + /* + * Base class for individual test cases + */ + abstract static private class TestCase { + protected String name; // For information in debug messages + protected byte data[]; // Data to be deflated and subsequently inflated + protected int level; // Compression level for deflater + + protected TestCase(String name, byte data[]) { + this(name, data, -1); + } + + protected TestCase(String name, byte data[], int level) { + this.name = name; + this.data = data; + this.level = level; + } + + public void runTest() throws Throwable { + long time0, time1; + byte deflated[], inflated[]; + + debug(""); + + time0 = System.currentTimeMillis(); + deflated = deflate(data, level); + time1 = System.currentTimeMillis(); + inform("Deflate", time1 - time0, deflated.length); + + time0 = System.currentTimeMillis(); + inflated = inflate(deflated); + time1 = System.currentTimeMillis(); + inform("Inflate", time1 - time0, inflated.length); + + check(Arrays.equals(data, inflated), + name + ": Inflated and deflated arrays do not match"); + } + + private void inform(String inOut, long duration, int length) { + debug(name, inOut, duration, length); + } + + abstract protected byte[] deflate(byte data[], int level) throws Throwable; + + abstract protected byte[] inflate(byte deflated[]) throws Throwable; + } + + /* + * Following are the individual test cases + */ + + private static class StrideTest extends TestCase { + static final int STRIDE = 1024; + + public StrideTest(byte data[], int level) { + super("STRIDE", data, level); + } + + protected byte[] deflate(byte in[], int level) throws Throwable { + final int len = in.length; + final Deflater deflater = new Deflater(level); + final byte[] smallBuffer = new byte[32]; + byte[] flated = new byte[32]; + int count = 0; + for (int i = 0; i 0); + return trim(flated, count); + } + + protected byte[] inflate(byte in[]) throws Throwable { + final int len = in.length; + final Inflater inflater = new Inflater(); + final byte[] smallBuffer = new byte[3200]; + + byte[] flated = new byte[32]; + int count = 0; + + for (int i = 0; i 0) { + flated = grow(flated, count + n); + System.arraycopy(smallBuffer, 0, flated, count, n); + count += n; + } + } + } + return trim(flated, count); + } + } + + private static class NoStrideTest extends TestCase { + public NoStrideTest(byte data[], int level) { + super("NO STRIDE", data, level); + } + + public byte[] deflate(byte in[], int level) throws Throwable { + final Deflater flater = new Deflater(level); + flater.setInput(in); + flater.finish(); + final byte[] smallBuffer = new byte[32]; + byte[] flated = new byte[32]; + int count = 0; + int n; + while ((n = flater.deflate(smallBuffer)) > 0) { + flated = grow(flated, count + n); + System.arraycopy(smallBuffer, 0, flated, count, n); + count += n; + } + return trim(flated, count); + } + + public byte[] inflate(byte in[]) throws Throwable { + final Inflater flater = new Inflater(); + flater.setInput(in); + final byte[] smallBuffer = new byte[32]; + byte[] flated = new byte[32]; + int count = 0; + int n; + while ((n = flater.inflate(smallBuffer)) > 0) { + flated = grow(flated, count + n); + System.arraycopy(smallBuffer, 0, flated, count, n); + count += n; + } + return trim(flated, count); + } + } + + /** + * Check Deflater{In,Out}putStream by way of GZIP{In,Out}putStream + */ + private static class GZIPTest extends TestCase { + public GZIPTest(byte data[]) { + super("GZIP", data); + } + + public byte[] deflate(byte data[], int ignored) throws Throwable { + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + OutputStream gzos = new GZIPOutputStream(baos); + gzos.write(data, 0, data.length); + gzos.close(); + return baos.toByteArray(); + } + + public byte[] inflate(byte deflated[]) throws Throwable { + InputStream bais = new ByteArrayInputStream(deflated); + GZIPInputStream gzis = new GZIPInputStream(bais); + byte[] inflated = new byte[data.length]; + int numRead = 0; + int count = 0; + while ((numRead = gzis.read(inflated, count, data.length - count)) > 0) { + count += numRead; + } + check(count == data.length, name + ": Read " + count + "; expected " + data.length); + return inflated; + } + } + + public static void realMain(String[] args) throws Throwable { + byte data[]; + int level = -1; + if (args.length > 0) { + level = Integer.parseInt(args[0]); + } + debug("Using level " + level); + + if (args.length > 1) { + FileInputStream fis = new FileInputStream(args[1]); + int len = fis.available(); + data = new byte[len]; + check(fis.read(data, 0, len) == len, "Did not read complete file"); + debug("Original data from " + args[1]); + fis.close(); + } else { + ByteBuffer bb = ByteBuffer.allocate(8); + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + for (int i = 0; i < 1024 * 64; i++) { // data length + bb.putDouble(0, Math.random()); + baos.write(bb.array(), 0, 8); + } + data = baos.toByteArray(); + debug("Original data from random byte array"); + } + debug("Original data length: " + data.length + " bytes"); + + new StrideTest(data, level).runTest(); + new NoStrideTest(data, level).runTest(); + new GZIPTest(data).runTest(); + } + + //--------------------- Infrastructure --------------------------- + static volatile int passed = 0, failed = 0; + static void pass() {passed++;} + static void pass(String msg) {System.out.println(msg); passed++;} + static void fail() {failed++; Thread.dumpStack();} + static void fail(String msg) {System.out.println(msg); fail();} + static void unexpected(Throwable t) {failed++; t.printStackTrace();} + static void unexpected(Throwable t, String msg) { + System.out.println(msg); failed++; t.printStackTrace();} + static boolean check(boolean cond) {if (cond) pass(); else fail(); return cond;} + static boolean check(boolean cond, String msg) {if (cond) pass(); else fail(msg); return cond;} + static void equal(Object x, Object y) { + if (x == null ? y == null : x.equals(y)) pass(); + else fail(x + " not equal to " + y);} + public static void main(String[] args) throws Throwable { + try {realMain(args);} catch (Throwable t) {unexpected(t);} + System.out.println("\nPassed = " + passed + " failed = " + failed); + if (failed > 0) throw new AssertionError("Some tests failed");} +} diff --git a/test/java/util/zip/GZIP/Accordion.java b/test/java/util/zip/GZIP/Accordion.java index ec02625a48fa5bf505b89c125312b8334515f651..fa5399e6221339bbc5f74064370279a166f6883d 100644 --- a/test/java/util/zip/GZIP/Accordion.java +++ b/test/java/util/zip/GZIP/Accordion.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/util/zip/GZIP/GZIPInputStreamRead.java b/test/java/util/zip/GZIP/GZIPInputStreamRead.java index 6eac74898726be2754ad6653215a882a45f587e6..ba87f78373ac55061b334b5fa619c75f359e2549 100644 --- a/test/java/util/zip/GZIP/GZIPInputStreamRead.java +++ b/test/java/util/zip/GZIP/GZIPInputStreamRead.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/util/zip/InflaterBufferSize.java b/test/java/util/zip/InflaterBufferSize.java new file mode 100644 index 0000000000000000000000000000000000000000..cf5363fca3e904c08559cb0367c4bac0b439a233 --- /dev/null +++ b/test/java/util/zip/InflaterBufferSize.java @@ -0,0 +1,163 @@ +/* + * 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. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * @test + * @bug 6571338 + * @summary Inflater should not require a buffer to the inflate() methods + * larger than 1 byte. + */ + +import java.io.*; +import java.nio.*; +import java.util.*; +import java.util.zip.*; + +public class InflaterBufferSize { + private static final int DATA_LEN = 1024 *64; + private static byte[] data; + + // If true, print extra info. + private static final boolean debug = System.getProperty("debug") != null; + + private static void debug(String s) { + if (debug) System.out.println(s); + } + + private static void createData() { + ByteBuffer bb = ByteBuffer.allocate(8); + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + for (int i = 0; i < DATA_LEN; i++) { + bb.putDouble(0, Math.random()); + baos.write(bb.array(), 0, 8); + } + data = baos.toByteArray(); + } + + private static byte[] grow(byte[] a, int capacity) { + while (a.length < capacity) { + byte[] a2 = new byte[a.length * 2]; + System.arraycopy(a, 0, a2, 0, a.length); + a = a2; + } + return a; + } + + private static byte[] trim(byte[] a, int length) { + byte[] res = new byte[length]; + System.arraycopy(a, 0, res, 0, length); + return res; + } + + private static byte[] deflate(byte[] in, int level) throws Throwable { + final Deflater flater = new Deflater(level); + flater.setInput(in); + flater.finish(); + final byte[] smallBuffer = new byte[32]; + byte[] flated = new byte[32]; + int count = 0; + int n; + while ((n = flater.deflate(smallBuffer)) > 0) { + flated = grow(flated, count + n); + System.arraycopy(smallBuffer, 0, flated, count, n); + count += n; + } + return trim(flated, count); + } + + private static byte[] inflate(byte[] in) throws Throwable { + final Inflater flater = new Inflater(); + flater.setInput(in); + // This is the buffer of interest. It should be possible to use any + // non-zero size. + final byte[] smallBuffer = new byte[1]; + byte[] flated = new byte[32]; + int count = 0; + int n; + while ((n = flater.inflate(smallBuffer)) > 0) { + flated = grow(flated, count + n); + System.arraycopy(smallBuffer, 0, flated, count, n); + count += n; + } + return trim(flated, count); + } + + public static void realMain(String[] args) throws Throwable { + byte deflated[], inflated[]; + + int level = -1; + if (args.length > 0) { + level = Integer.parseInt(args[0]); + } + debug("Using level " + level); + + if (args.length > 1) { + FileInputStream fis = new FileInputStream(args[1]); + int len = fis.available(); + data = new byte[len]; + check(fis.read(data, 0, len) == len, "Did not read complete file"); + debug("Original data from " + args[1]); + fis.close(); + } else { + createData(); + debug("Original data from random byte array"); + } + debug("Original data length: " + data.length + " bytes"); + + debug(""); + deflated = deflate(data, level); + debug("Deflated data length: " + deflated.length + " bytes"); + + inflated = inflate(deflated); + debug("Inflated data length: "+ inflated.length + " bytes" ); + + if (!check(Arrays.equals(data, inflated), + "Inflated and deflated arrays do not match")) { + OutputStream os = new BufferedOutputStream(new FileOutputStream("deflated.zip")); + try { + os.write(deflated); + } finally { + os.close(); + } + } + } + + //--------------------- Infrastructure --------------------------- + static volatile int passed = 0, failed = 0; + static void pass() {passed++;} + static void pass(String msg) {System.out.println(msg); passed++;} + static void fail() {failed++; Thread.dumpStack();} + static void fail(String msg) {System.out.println(msg); fail();} + static void unexpected(Throwable t) {failed++; t.printStackTrace();} + static void unexpected(Throwable t, String msg) { + System.out.println(msg); failed++; t.printStackTrace();} + static boolean check(boolean cond) {if (cond) pass(); else fail(); return cond;} + static boolean check(boolean cond, String msg) {if (cond) pass(); else fail(msg); return cond;} + static void equal(Object x, Object y) { + if (x == null ? y == null : x.equals(y)) pass(); + else fail(x + " not equal to " + y);} + public static void main(String[] args) throws Throwable { + try {realMain(args);} catch (Throwable t) {unexpected(t);} + System.out.println("\nPassed = " + passed + " failed = " + failed); + if (failed > 0) throw new AssertionError("Some tests failed");} +} diff --git a/test/java/util/zip/InfoZip.java b/test/java/util/zip/InfoZip.java index c7abba251efec96c47c0d3bb4a45be7fb2c4f061..4d9811d99b85a22e25ee8561eeae16da9f600548 100644 --- a/test/java/util/zip/InfoZip.java +++ b/test/java/util/zip/InfoZip.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/util/zip/LargeZip.java b/test/java/util/zip/LargeZip.java index a4f00d23a4128bbb0f509a50e683e98f714a1e94..7d34fd1bc245f152433f47f09e114e991605a23f 100644 --- a/test/java/util/zip/LargeZip.java +++ b/test/java/util/zip/LargeZip.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/util/zip/TestEmptyZip.java b/test/java/util/zip/TestEmptyZip.java index ff4406c976ce2c98db21b0d683718b6808ffdfa9..11d744246854abff59461de78154d50dad4f2f7e 100644 --- a/test/java/util/zip/TestEmptyZip.java +++ b/test/java/util/zip/TestEmptyZip.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/util/zip/ZipCoding.java b/test/java/util/zip/ZipCoding.java index a21a8f2b31fffb615cb4af27c1837a45d68731ac..281df21a2043c879644ef58bd27082611a22bc44 100644 --- a/test/java/util/zip/ZipCoding.java +++ b/test/java/util/zip/ZipCoding.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/util/zip/ZipFile/Assortment.java b/test/java/util/zip/ZipFile/Assortment.java index bb0d9fa8eb487168251437e6ee59459aa4ba9f7e..7e0d4055f031f72098526261109e2d4cce018365 100644 --- a/test/java/util/zip/ZipFile/Assortment.java +++ b/test/java/util/zip/ZipFile/Assortment.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/util/zip/ZipFile/Comment.java b/test/java/util/zip/ZipFile/Comment.java index 61a02521caa1d2621a3f1e434ccd21f7fcd72f79..d9eff5c9d943438be43273fe8bc818e1e75ec696 100644 --- a/test/java/util/zip/ZipFile/Comment.java +++ b/test/java/util/zip/ZipFile/Comment.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/util/zip/ZipFile/CopyJar.java b/test/java/util/zip/ZipFile/CopyJar.java index 217fd730531f61c739bd025c5c1d3a5e0a3ffff3..abeb1f3c46279381e2b247d1d65652c2bedc8dff 100644 --- a/test/java/util/zip/ZipFile/CopyJar.java +++ b/test/java/util/zip/ZipFile/CopyJar.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/util/zip/ZipFile/CorruptedZipFiles.java b/test/java/util/zip/ZipFile/CorruptedZipFiles.java index 51d17508fb8c1b0b37d55c3255ff367f581843a1..6ef3ec5d8f6e74451335ddf4a25a5521e308b22d 100644 --- a/test/java/util/zip/ZipFile/CorruptedZipFiles.java +++ b/test/java/util/zip/ZipFile/CorruptedZipFiles.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/util/zip/ZipFile/DeleteTempJar.java b/test/java/util/zip/ZipFile/DeleteTempJar.java index 9d504cb7e92410c37bc934b621d789b7a18290f2..ae071d82804f54c9810d2f9cd0afbaeb3cec41aa 100644 --- a/test/java/util/zip/ZipFile/DeleteTempJar.java +++ b/test/java/util/zip/ZipFile/DeleteTempJar.java @@ -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/test/java/util/zip/ZipFile/EnumAfterClose.java b/test/java/util/zip/ZipFile/EnumAfterClose.java index 5d112dea12e874e38d82ef1b2afb6681a606108f..38c00466e8f77f688dc7de762766c529f15b7a70 100644 --- a/test/java/util/zip/ZipFile/EnumAfterClose.java +++ b/test/java/util/zip/ZipFile/EnumAfterClose.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/util/zip/ZipFile/FinalizeZipFile.java b/test/java/util/zip/ZipFile/FinalizeZipFile.java index ab89803e5a4054dc806468660939040f3dbe683d..56ac12efb34312979ae01769383dc054f4e188bd 100644 --- a/test/java/util/zip/ZipFile/FinalizeZipFile.java +++ b/test/java/util/zip/ZipFile/FinalizeZipFile.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/util/zip/ZipFile/GetDirEntry.java b/test/java/util/zip/ZipFile/GetDirEntry.java index 0b2af4ffe284ad8f4f2f377487c10a1ba3c3e07c..e74fa6b3154377ca0b172c43e5ebd0ff4434a7fd 100644 --- a/test/java/util/zip/ZipFile/GetDirEntry.java +++ b/test/java/util/zip/ZipFile/GetDirEntry.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 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/util/zip/ZipFile/LargeZipFile.java b/test/java/util/zip/ZipFile/LargeZipFile.java index 2df4ca75486a632a0550bd9d02c9031298de17bb..b88ff5b4541bdc5a7bc498754386e6983df2b7d5 100644 --- a/test/java/util/zip/ZipFile/LargeZipFile.java +++ b/test/java/util/zip/ZipFile/LargeZipFile.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/util/zip/ZipFile/ManyEntries.java b/test/java/util/zip/ZipFile/ManyEntries.java index df741ad0dce5c351abad82668dfb72a3a9a72ae2..4334489e29419e7a4ef3cb23afbf9330357995a5 100644 --- a/test/java/util/zip/ZipFile/ManyEntries.java +++ b/test/java/util/zip/ZipFile/ManyEntries.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/util/zip/ZipFile/ManyZipFiles.java b/test/java/util/zip/ZipFile/ManyZipFiles.java index 27f35b77368ca74c7cdfd5adeadffb4803c7b630..7f64681c11e42edf85425b362f43fe3bc05e446f 100644 --- a/test/java/util/zip/ZipFile/ManyZipFiles.java +++ b/test/java/util/zip/ZipFile/ManyZipFiles.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 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/test/java/util/zip/ZipFile/ReadAfterClose.java b/test/java/util/zip/ZipFile/ReadAfterClose.java index 4391db7e9e2ba99eac7e329a5925c2afa06dcb61..3488245175130cea36ac11549987db05cc5407c5 100644 --- a/test/java/util/zip/ZipFile/ReadAfterClose.java +++ b/test/java/util/zip/ZipFile/ReadAfterClose.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 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/test/java/util/zip/ZipFile/ReadZip.java b/test/java/util/zip/ZipFile/ReadZip.java index 9ee4cccfc75457ab563259e3ae74a891223c36d9..b0e757158f7d937a90f8bbd8af0fddaf8dba0142 100644 --- a/test/java/util/zip/ZipFile/ReadZip.java +++ b/test/java/util/zip/ZipFile/ReadZip.java @@ -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/test/java/util/zip/ZipFile/ShortRead.java b/test/java/util/zip/ZipFile/ShortRead.java index e857f7f552a9a45f66d671774f1cc9feebd931cf..32913394ff4168ada4ae9201feaa5210e37e8a27 100644 --- a/test/java/util/zip/ZipFile/ShortRead.java +++ b/test/java/util/zip/ZipFile/ShortRead.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/util/zip/zip.java b/test/java/util/zip/zip.java index 62fb71398a7a11587b9c125d5824f815c4a05aa2..878e976d7eab64e07510ad80a0a4cfb289270f60 100644 --- a/test/java/util/zip/zip.java +++ b/test/java/util/zip/zip.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/javax/imageio/stream/StreamCloserLeak/run_test.sh b/test/javax/imageio/stream/StreamCloserLeak/run_test.sh index c9dcb393be55b3f4e4b3d49cf881227bae58e8a1..95f0049bb83914a3bae11f4d4df884f3291f6f81 100644 --- a/test/javax/imageio/stream/StreamCloserLeak/run_test.sh +++ b/test/javax/imageio/stream/StreamCloserLeak/run_test.sh @@ -1,6 +1,6 @@ #!/bin/ksh -p # -# Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2009, 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/javax/print/DialogMargins.java b/test/javax/print/DialogMargins.java index 30c15b6d1dd40fbb4ce3a9b530bd52e8b2d4fabe..41b35866d79b26e51b1ea81acf88799260d7d02a 100644 --- a/test/javax/print/DialogMargins.java +++ b/test/javax/print/DialogMargins.java @@ -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/test/javax/print/attribute/ServiceDialogTest.java b/test/javax/print/attribute/ServiceDialogTest.java index 184c8c0687cd9dd76c26a01a210eb1ba74a0a533..bce24e749cf6857b374825e6386afbbddf51614d 100644 --- a/test/javax/print/attribute/ServiceDialogTest.java +++ b/test/javax/print/attribute/ServiceDialogTest.java @@ -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/test/javax/script/CommonSetup.sh b/test/javax/script/CommonSetup.sh index 26af6f09c0e1d3136172db5796dd8f8eaf375161..54276a60f77cf08bcd3295e790812638b58d80d8 100644 --- a/test/javax/script/CommonSetup.sh +++ b/test/javax/script/CommonSetup.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/javax/script/VersionTest.java b/test/javax/script/VersionTest.java index ff28c2c2e172938d88a3d6c31dfe7c4d9060885d..374f43be51c032d832acb7ea2939340df4cfb936 100644 --- a/test/javax/script/VersionTest.java +++ b/test/javax/script/VersionTest.java @@ -1,5 +1,5 @@ /* - * 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/javax/sound/sampled/Clip/ClipSetPos.java b/test/javax/sound/sampled/Clip/ClipSetPos.java index 2968c9b735f6c13e4873b189a464aaf2645dcfd8..715274fe65fcfabfebe527c5c9bb254347125d39 100644 --- a/test/javax/sound/sampled/Clip/ClipSetPos.java +++ b/test/javax/sound/sampled/Clip/ClipSetPos.java @@ -33,6 +33,7 @@ import javax.sound.sampled.AudioFormat; import javax.sound.sampled.AudioSystem; import javax.sound.sampled.Clip; +import javax.sound.sampled.DataLine; import javax.sound.sampled.LineUnavailableException; public class ClipSetPos { @@ -48,12 +49,16 @@ public class ClipSetPos { boolean testPassed = true; Clip clip = null; try { - clip = AudioSystem.getClip(); + clip = (Clip)AudioSystem.getLine(new DataLine.Info(Clip.class, audioFormat)); clip.open(audioFormat, dataBuffer, 0, dataBuffer.length); } catch (LineUnavailableException ex) { log(ex); log("Cannot test (this is not failure)"); return; + } catch (IllegalArgumentException ex) { + log(ex); + log("Cannot test (this is not failure)"); + return; } log("clip: " + clip.getClass().getName()); diff --git a/test/javax/swing/JFileChooser/6342301/bug6342301.java b/test/javax/swing/JFileChooser/6342301/bug6342301.java index 54b4128d96678f0c5a86757e9f62846a4cd1dda0..c2d665525a80a03dedde5277d92fafd7f1cfc20f 100644 --- a/test/javax/swing/JFileChooser/6342301/bug6342301.java +++ b/test/javax/swing/JFileChooser/6342301/bug6342301.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/javax/swing/JFileChooser/6798062/bug6798062.java b/test/javax/swing/JFileChooser/6798062/bug6798062.java index 45df0b643de68bd3964c9f03013257ca0940c257..a43ba18d9e434d74c7344dbb8c1f90b10fbe5358 100644 --- a/test/javax/swing/JFileChooser/6798062/bug6798062.java +++ b/test/javax/swing/JFileChooser/6798062/bug6798062.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/javax/swing/JLabel/7004134/bug7004134.java b/test/javax/swing/JLabel/7004134/bug7004134.java index 09be54bee06526d198f03c7f3e2c4f00d29b50b7..2768263e4587f93d3080db1bcacabeded96ca785 100644 --- a/test/javax/swing/JLabel/7004134/bug7004134.java +++ b/test/javax/swing/JLabel/7004134/bug7004134.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/javax/swing/JScrollBar/6542335/bug6542335.java b/test/javax/swing/JScrollBar/6542335/bug6542335.java index b71ae1cde51c9fcd9806c108ae29ea95f6884f01..1aa5ba18ad91fec9a1014d065b0ac278b80dea1f 100644 --- a/test/javax/swing/JScrollBar/6542335/bug6542335.java +++ b/test/javax/swing/JScrollBar/6542335/bug6542335.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/javax/swing/UIDefaults/6795356/bug6795356.java b/test/javax/swing/UIDefaults/6795356/bug6795356.java index 698dc00e22fb59b14d74154e4ae8566bf12ba02a..f22e5883250c114a77011ec6641a16c4996faeba 100644 --- a/test/javax/swing/UIDefaults/6795356/bug6795356.java +++ b/test/javax/swing/UIDefaults/6795356/bug6795356.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/javax/swing/border/Test4856008.java b/test/javax/swing/border/Test4856008.java index a98e474fbaf357c51e613fd4faa1ccb6c461c320..7c0da08e9309d8d79d45630c0fa18e09aec9987b 100644 --- a/test/javax/swing/border/Test4856008.java +++ b/test/javax/swing/border/Test4856008.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 @@ -23,7 +23,7 @@ /* * @test - * @bug 4856008 + * @bug 4856008 7025987 * @summary Tests border insets * @author Sergey Malenkov */ @@ -59,6 +59,7 @@ import javax.swing.plaf.basic.BasicBorders; import javax.swing.plaf.basic.BasicToolBarUI; import javax.swing.plaf.metal.MetalBorders; import javax.swing.plaf.metal.MetalComboBoxEditor; +import javax.swing.plaf.nimbus.NimbusLookAndFeel; import sun.swing.plaf.synth.SynthFileChooserUI; @@ -134,6 +135,9 @@ public class Test4856008 { //+ SynthFileChooserUI.UIBorder: new SynthFileChooser().getUIBorder(), + + //+ LoweredBorder: + new NimbusLookAndFeel().getDefaults().getBorder("TitledBorder.border"), }; public static void main(String[] args) { diff --git a/test/javax/swing/border/Test6978482.java b/test/javax/swing/border/Test6978482.java index 8bf6b9b33d4aa6681357b1071ec3238664db41ab..804970f2210056cc42e6a2170d9ac0c00d1eea24 100644 --- a/test/javax/swing/border/Test6978482.java +++ b/test/javax/swing/border/Test6978482.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 @@ -23,7 +23,7 @@ /* * @test - * @bug 6978482 + * @bug 6978482 7025987 * @summary Tests unchecked casts * @author Sergey Malenkov */ @@ -58,6 +58,7 @@ import javax.swing.plaf.basic.BasicBorders; import javax.swing.plaf.basic.BasicToolBarUI; import javax.swing.plaf.metal.MetalBorders; import javax.swing.plaf.metal.MetalComboBoxEditor; +import javax.swing.plaf.nimbus.NimbusLookAndFeel; import sun.swing.plaf.synth.SynthFileChooserUI; @@ -132,6 +133,9 @@ public class Test6978482 { //+ SynthFileChooserUI.UIBorder: new SynthFileChooser().getUIBorder(), + + //+ LoweredBorder: + new NimbusLookAndFeel().getDefaults().getBorder("TitledBorder.border"), }; public static void main(String[] args) { diff --git a/test/javax/swing/text/NavigationFilter/6735293/bug6735293.java b/test/javax/swing/text/NavigationFilter/6735293/bug6735293.java index 4d077ceba15ebde66271a4a2bf45f49147df3e12..08658b4f35dfc4b2faeca68661989aa931b5d139 100644 --- a/test/javax/swing/text/NavigationFilter/6735293/bug6735293.java +++ b/test/javax/swing/text/NavigationFilter/6735293/bug6735293.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/javax/swing/text/html/parser/Parser/6990651/bug6990651.java b/test/javax/swing/text/html/parser/Parser/6990651/bug6990651.java index e956140aee7d8c641ae6c02902dadcde1761f0b8..60378e23b2fcbf0c71da50a6a6e82e616ec50d00 100644 --- a/test/javax/swing/text/html/parser/Parser/6990651/bug6990651.java +++ b/test/javax/swing/text/html/parser/Parser/6990651/bug6990651.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/sun/java2d/pipe/RegionOps.java b/test/sun/java2d/pipe/RegionOps.java index e02f280b1feea0b3d235459c07c151e856ed6574..418b73f351533416896c69840516a7d4ac8fcdbf 100644 --- a/test/sun/java2d/pipe/RegionOps.java +++ b/test/sun/java2d/pipe/RegionOps.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/sun/misc/URLClassPath/ClassnameCharTest.sh b/test/sun/misc/URLClassPath/ClassnameCharTest.sh index 7f29ca26b480bd44063accfdf75fb8e16a0fbce8..6325e5732c5e1ab6a80aa8f84296bfbe4e355d6d 100644 --- a/test/sun/misc/URLClassPath/ClassnameCharTest.sh +++ b/test/sun/misc/URLClassPath/ClassnameCharTest.sh @@ -1,7 +1,7 @@ #! /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/sun/misc/Version/Version.java b/test/sun/misc/Version/Version.java index 6e7d3626d9febb2df39f3ed4fe5c2fd65c659cf7..16ecd1ea9c840792d294f3a957da6fbb1771248a 100644 --- a/test/sun/misc/Version/Version.java +++ b/test/sun/misc/Version/Version.java @@ -142,15 +142,21 @@ public class Version { // non-product VM will have -debug|-release appended cs = cs.subSequence(1, cs.length()); String[] res = cs.toString().split("-"); - for (String s : res) { + for (int i = res.length - 1; i >= 0; i--) { + String s = res[i]; if (s.charAt(0) == 'b') { - build = - Integer.valueOf(s.substring(1, s.length())).intValue(); - break; + try { + build = Integer.parseInt(s.substring(1, s.length())); + break; + } catch (NumberFormatException nfe) { + // ignore + } } } } } - return new VersionInfo(major, minor, micro, update, special, build); + VersionInfo vi = new VersionInfo(major, minor, micro, update, special, build); + System.out.printf("newVersionInfo: input=%s output=%s\n", version, vi); + return vi; } } diff --git a/test/sun/net/InetAddress/nameservice/chaining/Providers.java b/test/sun/net/InetAddress/nameservice/chaining/Providers.java index 590f4e25a94b0c110d23394a9bed378d76db6e0d..351a1bef19fb54090feea3d40e0763137536b1b0 100644 --- a/test/sun/net/InetAddress/nameservice/chaining/Providers.java +++ b/test/sun/net/InetAddress/nameservice/chaining/Providers.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/sun/net/InetAddress/nameservice/chaining/Simple1NameServiceDescriptor.java b/test/sun/net/InetAddress/nameservice/chaining/Simple1NameServiceDescriptor.java index 6785cc76c3bbb564545a9085cbb9bb8f5dc172c9..b2572817fb3ba3346a2db680badb2b0fb28d2d41 100644 --- a/test/sun/net/InetAddress/nameservice/chaining/Simple1NameServiceDescriptor.java +++ b/test/sun/net/InetAddress/nameservice/chaining/Simple1NameServiceDescriptor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 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/test/sun/net/InetAddress/nameservice/chaining/Simple2NameServiceDescriptor.java b/test/sun/net/InetAddress/nameservice/chaining/Simple2NameServiceDescriptor.java index dcfcdd4b3ba8758a5260b251ecb00a11ef9ba27a..91eae198d449c0db590a53951b2af1380ee3d76c 100644 --- a/test/sun/net/InetAddress/nameservice/chaining/Simple2NameServiceDescriptor.java +++ b/test/sun/net/InetAddress/nameservice/chaining/Simple2NameServiceDescriptor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 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/test/sun/net/InetAddress/nameservice/chaining/SimpleNameService.java b/test/sun/net/InetAddress/nameservice/chaining/SimpleNameService.java index 1c65578c58cb6c8c104e984890b08f315fa670e3..b3697f2f3dbf6510bd796b4ab232bbe6277a8965 100644 --- a/test/sun/net/InetAddress/nameservice/chaining/SimpleNameService.java +++ b/test/sun/net/InetAddress/nameservice/chaining/SimpleNameService.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 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/test/sun/net/InetAddress/nameservice/simple/CacheTest.java b/test/sun/net/InetAddress/nameservice/simple/CacheTest.java index 0aadfd399ca7d83343af05d867fceb737392df58..48745ced557d2e2323ea9558e3fbd93a36ca41df 100644 --- a/test/sun/net/InetAddress/nameservice/simple/CacheTest.java +++ b/test/sun/net/InetAddress/nameservice/simple/CacheTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 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/test/sun/net/InetAddress/nameservice/simple/DefaultCaching.java b/test/sun/net/InetAddress/nameservice/simple/DefaultCaching.java index f1010daa55f573b4c61de915627fabc400c1429b..4b42af174eb68a5644fd01b6625fae2edbe57f1b 100644 --- a/test/sun/net/InetAddress/nameservice/simple/DefaultCaching.java +++ b/test/sun/net/InetAddress/nameservice/simple/DefaultCaching.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 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/test/sun/net/InetAddress/nameservice/simple/SimpleNameService.java b/test/sun/net/InetAddress/nameservice/simple/SimpleNameService.java index 98ba870d33fe73f679cc7e720ff988d73d7332b7..9d584558b30c8bf132dd50a22bc35878abfa7047 100644 --- a/test/sun/net/InetAddress/nameservice/simple/SimpleNameService.java +++ b/test/sun/net/InetAddress/nameservice/simple/SimpleNameService.java @@ -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 diff --git a/test/sun/net/InetAddress/nameservice/simple/SimpleNameServiceDescriptor.java b/test/sun/net/InetAddress/nameservice/simple/SimpleNameServiceDescriptor.java index 466661ac8c7197faf2a834783948f77473ac76b6..373d10b2dc74e26eb6034d7dde91c35278edd862 100644 --- a/test/sun/net/InetAddress/nameservice/simple/SimpleNameServiceDescriptor.java +++ b/test/sun/net/InetAddress/nameservice/simple/SimpleNameServiceDescriptor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 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/test/sun/security/ec/TestEC.java b/test/sun/security/ec/TestEC.java index fe075cd3f0a4c0d66108e3b6ea3e263ea7240eb2..3c4a89506270f963b26b3ca15a4d4369f29b5ef1 100644 --- a/test/sun/security/ec/TestEC.java +++ b/test/sun/security/ec/TestEC.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 @@ -25,8 +25,6 @@ * @test * @bug 6840752 * @summary Provide out-of-the-box support for ECC algorithms - * @ignore JSSE supported cipher suites are changed with CR 6916074, - * need to update this test case in JDK 7 soon * @library ../pkcs11 * @library ../pkcs11/ec * @library ../pkcs11/sslecc diff --git a/test/sun/security/jgss/GssNPE.java b/test/sun/security/jgss/GssNPE.java index bacf60c5f346fa3a06d2ed921f696458db7e90cb..d2723ba625c57269819c2d09107fa96cbc78e957 100644 --- a/test/sun/security/jgss/GssNPE.java +++ b/test/sun/security/jgss/GssNPE.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2009, 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 @@ -24,6 +24,7 @@ /* * @test * @bug 6345338 + * @run main/othervm GssNPE * @summary GSS throws NPE when the JAAS config file does not exist */ diff --git a/test/sun/security/jgss/spnego/NoSpnegoAsDefMech.java b/test/sun/security/jgss/spnego/NoSpnegoAsDefMech.java index 13b9ee9d47bbd93c6fdbb768af34aeb8e0865067..998f50d339f99b49890a82c899d025d271b76c91 100644 --- a/test/sun/security/jgss/spnego/NoSpnegoAsDefMech.java +++ b/test/sun/security/jgss/spnego/NoSpnegoAsDefMech.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 @@ -24,6 +24,7 @@ /* * @test * @bug 6770883 + * @run main/othervm NoSpnegoAsDefMech * @summary Infinite loop if SPNEGO specified as sun.security.jgss.mechanism */ diff --git a/test/sun/security/krb5/ConfPlusProp.java b/test/sun/security/krb5/ConfPlusProp.java index e29637b1b154289da5c0230daf482278b69cf8b6..9fe1adcf455beb894fe76061fdf1a39fd73b15f0 100644 --- a/test/sun/security/krb5/ConfPlusProp.java +++ b/test/sun/security/krb5/ConfPlusProp.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 @@ -25,6 +25,7 @@ * @bug 6857795 * @bug 6858589 * @bug 6972005 + * @run main/othervm ConfPlusProp * @summary krb5.conf ignored if system properties on realm and kdc are provided */ diff --git a/test/sun/security/krb5/ConfigWithQuotations.java b/test/sun/security/krb5/ConfigWithQuotations.java index adf3919b9a02c02393800a97408378600b2e9cfe..c1286f8cb3acb979f3ef94dd0f511a1d609869fc 100644 --- a/test/sun/security/krb5/ConfigWithQuotations.java +++ b/test/sun/security/krb5/ConfigWithQuotations.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 @@ -23,6 +23,7 @@ /* * @test * @bug 6714845 + * @run main/othervm ConfigWithQuotations * @summary Quotes in Kerberos configuration file are included in the values */ diff --git a/test/sun/security/krb5/DnsFallback.java b/test/sun/security/krb5/DnsFallback.java index e305ac85699325b9bead37d1fdb8084c9c4f9be2..3a48b05d83763ec4304b584d4f22f5e2fb75e9a8 100644 --- a/test/sun/security/krb5/DnsFallback.java +++ b/test/sun/security/krb5/DnsFallback.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 @@ -24,6 +24,7 @@ * @test * @bug 6673164 * @bug 6552334 + * @run main/othervm DnsFallback * @summary fix dns_fallback parse error, and use dns by default */ diff --git a/test/sun/security/krb5/IPv6.java b/test/sun/security/krb5/IPv6.java index 4b4f2a88767623db4780f07f93cb4fdf60c828ad..d1a8bf260bce93a22bc98d94fb8de3976603d4f5 100644 --- a/test/sun/security/krb5/IPv6.java +++ b/test/sun/security/krb5/IPv6.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 @@ -24,6 +24,7 @@ /* * @test * @bug 6877357 6885166 + * @run main/othervm IPv6 * @summary IPv6 address does not work */ diff --git a/test/sun/security/krb5/ParseCAPaths.java b/test/sun/security/krb5/ParseCAPaths.java index ec6f73257fb8054c57e7944b65a2327ec9df0321..f8c30bd7b7d3e16578318e6c4c73eca5bb912eb8 100644 --- a/test/sun/security/krb5/ParseCAPaths.java +++ b/test/sun/security/krb5/ParseCAPaths.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 @@ -23,6 +23,7 @@ /* * @test * @bug 6789935 + * @run main/othervm ParseCAPaths * @summary cross-realm capath search error */ @@ -30,9 +31,10 @@ import java.util.Arrays; import sun.security.krb5.Realm; public class ParseCAPaths { - static boolean failed = false; + static Exception failed = null; public static void main(String[] args) throws Exception { - System.setProperty("java.security.krb5.conf", System.getProperty("test.src", ".") +"/krb5-capaths.conf"); + System.setProperty("java.security.krb5.conf", + System.getProperty("test.src", ".") +"/krb5-capaths.conf"); //System.setProperty("sun.security.krb5.debug", "true"); // Standard example @@ -59,9 +61,13 @@ public class ParseCAPaths { check("G1.COM", "G3.COM", "G1.COM", "COM"); check("H1.COM", "H3.COM", "H1.COM"); check("I1.COM", "I4.COM", "I1.COM", "I5.COM"); - - if (failed) { - throw new Exception("Failed somewhere."); + // J2=J1 is the same as J2=. + check("J1.COM", "J2.COM", "J1.COM"); + // 7019384 + check("A9.PRAGUE.XXX.CZ", "SERVIS.XXX.CZ", + "A9.PRAGUE.XXX.CZ", "PRAGUE.XXX.CZ", "ROOT.XXX.CZ"); + if (failed != null) { + throw failed; } } @@ -69,10 +75,10 @@ public class ParseCAPaths { try { check2(from, to, paths); } catch (Exception e) { - failed = true; - e.printStackTrace(); + failed = e; } } + static void check2(String from, String to, String... paths) throws Exception { System.out.println(from + " -> " + to); diff --git a/test/sun/security/krb5/ParseConfig.java b/test/sun/security/krb5/ParseConfig.java index d4aa590eb2a29b3903ebf1a48f8edae768c7bb48..43c5ce39f3ae5467623ee4a96051fff7e6c0ee95 100644 --- a/test/sun/security/krb5/ParseConfig.java +++ b/test/sun/security/krb5/ParseConfig.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 @@ -23,6 +23,7 @@ /* * @test * @bug 6319046 + * @run main/othervm ParseConfig * @summary Problem with parsing krb5.conf */ diff --git a/test/sun/security/krb5/RFC396xTest.java b/test/sun/security/krb5/RFC396xTest.java index 2bd3f235a9f15bdd61ca07382cbfd3cc6a688cd2..76016c38817d1d96250aadf74434720223f63f77 100644 --- a/test/sun/security/krb5/RFC396xTest.java +++ b/test/sun/security/krb5/RFC396xTest.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 @@ -23,6 +23,7 @@ /* * @test * @bug 6862679 + * @run main/othervm RFC396xTest * @summary ESC: AD Authentication with user with umlauts fails */ diff --git a/test/sun/security/krb5/TimeInCCache.java b/test/sun/security/krb5/TimeInCCache.java index e0e420f33e03fe50816539ea7396b436d0d089c2..6c33d2eae3fed8b8856262d2eaa3cc077ccaa116 100644 --- a/test/sun/security/krb5/TimeInCCache.java +++ b/test/sun/security/krb5/TimeInCCache.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 @@ -23,6 +23,7 @@ /* * @test * @bug 6590930 + * @run main/othervm TimeInCCache * @summary read/write does not match for ccache */ diff --git a/test/sun/security/krb5/auto/Context.java b/test/sun/security/krb5/auto/Context.java index 4c67109121fbe91dad6efae50dac96d067a688c6..676042ba993dd04fe9fa46a66d81d9ee95ec6ab5 100644 --- a/test/sun/security/krb5/auto/Context.java +++ b/test/sun/security/krb5/auto/Context.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/test/sun/security/krb5/auto/HttpNegotiateServer.java b/test/sun/security/krb5/auto/HttpNegotiateServer.java index 423ef0d853d5df91443e25c08c0276534f9156d2..aab6b92137ee3d53a22b60cf84be971aa0356671 100644 --- a/test/sun/security/krb5/auto/HttpNegotiateServer.java +++ b/test/sun/security/krb5/auto/HttpNegotiateServer.java @@ -74,11 +74,10 @@ public class HttpNegotiateServer { final static char[] WEB_PASS = "webby".toCharArray(); final static String PROXY_USER = "pro"; final static char[] PROXY_PASS = "proxy".toCharArray(); - final static int WEB_PORT = 17840; + final static String WEB_HOST = "host.web.domain"; final static String PROXY_HOST = "host.proxy.domain"; - final static int PROXY_PORT = 17841; // web page content final static String CONTENT = "Hello, World!"; @@ -86,18 +85,11 @@ public class HttpNegotiateServer { // For 6829283, count how many times the Authenticator is called. static int count = 0; + static int webPort, proxyPort; + // URLs for web test, proxy test. The proxy server is not a real proxy // since it fakes the same content for any URL. :) - final static URL webUrl, proxyUrl; - static { - URL u1 = null, u2 = null; - try { - u1 = new URL("http://" + WEB_HOST +":" + WEB_PORT + "/a/b/c"); - u2 = new URL("http://nosuchplace/a/b/c"); - } catch (Exception e) { - } - webUrl = u1; proxyUrl = u2; - } + static URL webUrl, proxyUrl; /** * This Authenticator checks everything: @@ -127,7 +119,7 @@ public class HttpNegotiateServer { if (!this.getRequestingHost().equalsIgnoreCase(PROXY_HOST)) { throw new RuntimeException("Bad host"); } - if (this.getRequestingPort() != PROXY_PORT) { + if (this.getRequestingPort() != proxyPort) { throw new RuntimeException("Bad port"); } if (!this.getRequestingURL().equals(proxyUrl)) { @@ -188,10 +180,15 @@ public class HttpNegotiateServer { fos.close(); f.deleteOnExit(); - HttpServer h1 = httpd(WEB_PORT, "Negotiate", false, + HttpServer h1 = httpd("Negotiate", false, "HTTP/" + WEB_HOST + "@" + REALM_WEB, KRB5_TAB); - HttpServer h2 = httpd(PROXY_PORT, "Negotiate", true, + webPort = h1.getAddress().getPort(); + HttpServer h2 = httpd("Negotiate", true, "HTTP/" + PROXY_HOST + "@" + REALM_PROXY, KRB5_TAB); + proxyPort = h2.getAddress().getPort(); + + webUrl = new URL("http://" + WEB_HOST +":" + webPort + "/a/b/c"); + proxyUrl = new URL("http://nosuchplace/a/b/c"); try { Exception e1 = null, e2 = null; @@ -230,7 +227,7 @@ public class HttpNegotiateServer { reader = new BufferedReader(new InputStreamReader( proxyUrl.openConnection( new Proxy(Proxy.Type.HTTP, - new InetSocketAddress(PROXY_HOST, PROXY_PORT))) + new InetSocketAddress(PROXY_HOST, proxyPort))) .getInputStream())); if (!reader.readLine().equals(CONTENT)) { throw new RuntimeException("Bad content"); @@ -258,10 +255,10 @@ public class HttpNegotiateServer { * @param principal the krb5 service principal the server runs with * @return the server */ - public static HttpServer httpd(int port, String scheme, boolean proxy, + public static HttpServer httpd(String scheme, boolean proxy, String principal, String ktab) throws Exception { MyHttpHandler h = new MyHttpHandler(); - HttpServer server = HttpServer.create(new InetSocketAddress(port), 0); + HttpServer server = HttpServer.create(new InetSocketAddress(0), 0); HttpContext hc = server.createContext("/", h); hc.setAuthenticator(new MyServerAuthenticator( proxy, scheme, principal, ktab)); diff --git a/test/sun/security/krb5/auto/KDC.java b/test/sun/security/krb5/auto/KDC.java index 36dc08b4ae677133cadfaab2b55ba60ee7474a83..5d2ff476ea6086795ab8b40006eba0513a10b430 100644 --- a/test/sun/security/krb5/auto/KDC.java +++ b/test/sun/security/krb5/auto/KDC.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/test/sun/security/krb5/etype/ETypeOrder.java b/test/sun/security/krb5/etype/ETypeOrder.java index cb854acf7f58fae34f9807976ad0b1bee4f4038c..9437b16ed05795b357fd3e435985bdad90052b4d 100644 --- a/test/sun/security/krb5/etype/ETypeOrder.java +++ b/test/sun/security/krb5/etype/ETypeOrder.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 @@ -23,6 +23,7 @@ /* * @test * @bug 6844907 + * @run main/othervm ETypeOrder * @summary krb5 etype order should be from strong to weak */ diff --git a/test/sun/security/krb5/krb5-capaths.conf b/test/sun/security/krb5/krb5-capaths.conf index db672820b7d84841ae07dc188c3766d1ed115800..eead02c0b348ada5e6c2c0af9eeeddaf16768b1d 100644 --- a/test/sun/security/krb5/krb5-capaths.conf +++ b/test/sun/security/krb5/krb5-capaths.conf @@ -85,3 +85,13 @@ I1.COM = { I3.COM = I2.COM I4.COM = I2.COM I5.COM } + +J1.COM = { + J2.COM=J1.COM +} + +A9.PRAGUE.XXX.CZ = { + PRAGUE.XXX.CZ = . + ROOT.XXX.CZ = PRAGUE.XXX.CZ + SERVIS.XXX.CZ = ROOT.XXX.CZ +} diff --git a/test/sun/security/krb5/ktab/HighestKvno.java b/test/sun/security/krb5/ktab/HighestKvno.java index 9636bb1b576fe30445e72921fa99e0d897d1f841..92e3aebd630ffff99a2084dd2e3cb565d3bcb1e8 100644 --- a/test/sun/security/krb5/ktab/HighestKvno.java +++ b/test/sun/security/krb5/ktab/HighestKvno.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 @@ -24,6 +24,7 @@ * @test * @bug 6867665 * @bug 6875033 + * @run main/othervm HighestKvno * @summary Problem with keytabs with multiple kvno's (key versions) */ diff --git a/test/sun/security/krb5/tools/KtabCheck.java b/test/sun/security/krb5/tools/KtabCheck.java index e82b83ac740af5f5815e5e8b0a9dee999779534d..ebd18fd70d85bdeecca91aad21e1bab09e197ad5 100644 --- a/test/sun/security/krb5/tools/KtabCheck.java +++ b/test/sun/security/krb5/tools/KtabCheck.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/sun/security/pkcs11/fips/CipherTest.java b/test/sun/security/pkcs11/fips/CipherTest.java index 3736aa07d08460b23c6dd1a9e55c61dfef428cc8..8dad4a76dcc3f23455ba74910d8d984c3ab40a83 100644 --- a/test/sun/security/pkcs11/fips/CipherTest.java +++ b/test/sun/security/pkcs11/fips/CipherTest.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 @@ -114,19 +114,7 @@ public class CipherTest { } boolean isEnabled() { - // ignore SCSV - if (cipherSuite.equals("TLS_EMPTY_RENEGOTIATION_INFO_SCSV")) { - return false; - } - - // ignore exportable cipher suite for TLSv1.1 - if (protocol.equals("TLSv1.1")) { - if(cipherSuite.indexOf("_EXPORT_") != -1) { - return false; - } - } - - return true; + return TLSCipherStatus.isEnabled(cipherSuite, protocol); } public String toString() { @@ -137,6 +125,114 @@ public class CipherTest { return s; } + static enum TLSCipherStatus { + // cipher suites supported since TLS 1.2 + CS_01("TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384", 0x0303, 0xFFFF), + CS_02("TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384", 0x0303, 0xFFFF), + CS_03("TLS_RSA_WITH_AES_256_CBC_SHA256", 0x0303, 0xFFFF), + CS_04("TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384", 0x0303, 0xFFFF), + CS_05("TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384", 0x0303, 0xFFFF), + CS_06("TLS_DHE_RSA_WITH_AES_256_CBC_SHA256", 0x0303, 0xFFFF), + CS_07("TLS_DHE_DSS_WITH_AES_256_CBC_SHA256", 0x0303, 0xFFFF), + + CS_08("TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256", 0x0303, 0xFFFF), + CS_09("TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256", 0x0303, 0xFFFF), + CS_10("TLS_RSA_WITH_AES_128_CBC_SHA256", 0x0303, 0xFFFF), + CS_11("TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256", 0x0303, 0xFFFF), + CS_12("TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256", 0x0303, 0xFFFF), + CS_13("TLS_DHE_RSA_WITH_AES_128_CBC_SHA256", 0x0303, 0xFFFF), + CS_14("TLS_DHE_DSS_WITH_AES_128_CBC_SHA256", 0x0303, 0xFFFF), + + CS_15("TLS_DH_anon_WITH_AES_256_CBC_SHA256", 0x0303, 0xFFFF), + CS_16("TLS_DH_anon_WITH_AES_128_CBC_SHA256", 0x0303, 0xFFFF), + CS_17("TLS_RSA_WITH_NULL_SHA256", 0x0303, 0xFFFF), + + // cipher suites obsoleted since TLS 1.2 + CS_50("SSL_RSA_WITH_DES_CBC_SHA", 0x0000, 0x0303), + CS_51("SSL_DHE_RSA_WITH_DES_CBC_SHA", 0x0000, 0x0303), + CS_52("SSL_DHE_DSS_WITH_DES_CBC_SHA", 0x0000, 0x0303), + CS_53("SSL_DH_anon_WITH_DES_CBC_SHA", 0x0000, 0x0303), + CS_54("TLS_KRB5_WITH_DES_CBC_SHA", 0x0000, 0x0303), + CS_55("TLS_KRB5_WITH_DES_CBC_MD5", 0x0000, 0x0303), + + // cipher suites obsoleted since TLS 1.1 + CS_60("SSL_RSA_EXPORT_WITH_RC4_40_MD5", 0x0000, 0x0302), + CS_61("SSL_DH_anon_EXPORT_WITH_RC4_40_MD5", 0x0000, 0x0302), + CS_62("SSL_RSA_EXPORT_WITH_DES40_CBC_SHA", 0x0000, 0x0302), + CS_63("SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA", 0x0000, 0x0302), + CS_64("SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA", 0x0000, 0x0302), + CS_65("SSL_DH_anon_EXPORT_WITH_DES40_CBC_SHA", 0x0000, 0x0302), + CS_66("TLS_KRB5_EXPORT_WITH_RC4_40_SHA", 0x0000, 0x0302), + CS_67("TLS_KRB5_EXPORT_WITH_RC4_40_MD5", 0x0000, 0x0302), + CS_68("TLS_KRB5_EXPORT_WITH_DES_CBC_40_SHA", 0x0000, 0x0302), + CS_69("TLS_KRB5_EXPORT_WITH_DES_CBC_40_MD5", 0x0000, 0x0302), + + // ignore TLS_EMPTY_RENEGOTIATION_INFO_SCSV always + CS_99("TLS_EMPTY_RENEGOTIATION_INFO_SCSV", 0xFFFF, 0x0000); + + // the cipher suite name + final String cipherSuite; + + // supported since protocol version + final int supportedSince; + + // obsoleted since protocol version + final int obsoletedSince; + + TLSCipherStatus(String cipherSuite, + int supportedSince, int obsoletedSince) { + this.cipherSuite = cipherSuite; + this.supportedSince = supportedSince; + this.obsoletedSince = obsoletedSince; + } + + static boolean isEnabled(String cipherSuite, String protocol) { + int versionNumber = toVersionNumber(protocol); + + if (versionNumber < 0) { + return true; // unlikely to happen + } + + for (TLSCipherStatus status : TLSCipherStatus.values()) { + if (cipherSuite.equals(status.cipherSuite)) { + if ((versionNumber < status.supportedSince) || + (versionNumber >= status.obsoletedSince)) { + return false; + } + + return true; + } + } + + return true; + } + + private static int toVersionNumber(String protocol) { + int versionNumber = -1; + + switch (protocol) { + case "SSLv2Hello": + versionNumber = 0x0002; + break; + case "SSLv3": + versionNumber = 0x0300; + break; + case "TLSv1": + versionNumber = 0x0301; + break; + case "TLSv1.1": + versionNumber = 0x0302; + break; + case "TLSv1.2": + versionNumber = 0x0303; + break; + default: + // unlikely to happen + } + + return versionNumber; + } + } } private List tests; diff --git a/test/sun/security/pkcs11/sslecc/CipherTest.java b/test/sun/security/pkcs11/sslecc/CipherTest.java index 09ab1c66ffbcf5fc1999fb0747047ee2ce264719..64153f58d20653e68a7c84cda37e7304e1976f77 100644 --- a/test/sun/security/pkcs11/sslecc/CipherTest.java +++ b/test/sun/security/pkcs11/sslecc/CipherTest.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 @@ -114,19 +114,7 @@ public class CipherTest { } boolean isEnabled() { - // ignore SCSV - if (cipherSuite.equals("TLS_EMPTY_RENEGOTIATION_INFO_SCSV")) { - return false; - } - - // ignore exportable cipher suite for TLSv1.1 - if (protocol.equals("TLSv1.1")) { - if(cipherSuite.indexOf("_EXPORT_") != -1) { - return false; - } - } - - return true; + return TLSCipherStatus.isEnabled(cipherSuite, protocol); } public String toString() { @@ -137,6 +125,114 @@ public class CipherTest { return s; } + static enum TLSCipherStatus { + // cipher suites supported since TLS 1.2 + CS_01("TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384", 0x0303, 0xFFFF), + CS_02("TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384", 0x0303, 0xFFFF), + CS_03("TLS_RSA_WITH_AES_256_CBC_SHA256", 0x0303, 0xFFFF), + CS_04("TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384", 0x0303, 0xFFFF), + CS_05("TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384", 0x0303, 0xFFFF), + CS_06("TLS_DHE_RSA_WITH_AES_256_CBC_SHA256", 0x0303, 0xFFFF), + CS_07("TLS_DHE_DSS_WITH_AES_256_CBC_SHA256", 0x0303, 0xFFFF), + + CS_08("TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256", 0x0303, 0xFFFF), + CS_09("TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256", 0x0303, 0xFFFF), + CS_10("TLS_RSA_WITH_AES_128_CBC_SHA256", 0x0303, 0xFFFF), + CS_11("TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256", 0x0303, 0xFFFF), + CS_12("TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256", 0x0303, 0xFFFF), + CS_13("TLS_DHE_RSA_WITH_AES_128_CBC_SHA256", 0x0303, 0xFFFF), + CS_14("TLS_DHE_DSS_WITH_AES_128_CBC_SHA256", 0x0303, 0xFFFF), + + CS_15("TLS_DH_anon_WITH_AES_256_CBC_SHA256", 0x0303, 0xFFFF), + CS_16("TLS_DH_anon_WITH_AES_128_CBC_SHA256", 0x0303, 0xFFFF), + CS_17("TLS_RSA_WITH_NULL_SHA256", 0x0303, 0xFFFF), + + // cipher suites obsoleted since TLS 1.2 + CS_50("SSL_RSA_WITH_DES_CBC_SHA", 0x0000, 0x0303), + CS_51("SSL_DHE_RSA_WITH_DES_CBC_SHA", 0x0000, 0x0303), + CS_52("SSL_DHE_DSS_WITH_DES_CBC_SHA", 0x0000, 0x0303), + CS_53("SSL_DH_anon_WITH_DES_CBC_SHA", 0x0000, 0x0303), + CS_54("TLS_KRB5_WITH_DES_CBC_SHA", 0x0000, 0x0303), + CS_55("TLS_KRB5_WITH_DES_CBC_MD5", 0x0000, 0x0303), + + // cipher suites obsoleted since TLS 1.1 + CS_60("SSL_RSA_EXPORT_WITH_RC4_40_MD5", 0x0000, 0x0302), + CS_61("SSL_DH_anon_EXPORT_WITH_RC4_40_MD5", 0x0000, 0x0302), + CS_62("SSL_RSA_EXPORT_WITH_DES40_CBC_SHA", 0x0000, 0x0302), + CS_63("SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA", 0x0000, 0x0302), + CS_64("SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA", 0x0000, 0x0302), + CS_65("SSL_DH_anon_EXPORT_WITH_DES40_CBC_SHA", 0x0000, 0x0302), + CS_66("TLS_KRB5_EXPORT_WITH_RC4_40_SHA", 0x0000, 0x0302), + CS_67("TLS_KRB5_EXPORT_WITH_RC4_40_MD5", 0x0000, 0x0302), + CS_68("TLS_KRB5_EXPORT_WITH_DES_CBC_40_SHA", 0x0000, 0x0302), + CS_69("TLS_KRB5_EXPORT_WITH_DES_CBC_40_MD5", 0x0000, 0x0302), + + // ignore TLS_EMPTY_RENEGOTIATION_INFO_SCSV always + CS_99("TLS_EMPTY_RENEGOTIATION_INFO_SCSV", 0xFFFF, 0x0000); + + // the cipher suite name + final String cipherSuite; + + // supported since protocol version + final int supportedSince; + + // obsoleted since protocol version + final int obsoletedSince; + + TLSCipherStatus(String cipherSuite, + int supportedSince, int obsoletedSince) { + this.cipherSuite = cipherSuite; + this.supportedSince = supportedSince; + this.obsoletedSince = obsoletedSince; + } + + static boolean isEnabled(String cipherSuite, String protocol) { + int versionNumber = toVersionNumber(protocol); + + if (versionNumber < 0) { + return true; // unlikely to happen + } + + for (TLSCipherStatus status : TLSCipherStatus.values()) { + if (cipherSuite.equals(status.cipherSuite)) { + if ((versionNumber < status.supportedSince) || + (versionNumber >= status.obsoletedSince)) { + return false; + } + + return true; + } + } + + return true; + } + + private static int toVersionNumber(String protocol) { + int versionNumber = -1; + + switch (protocol) { + case "SSLv2Hello": + versionNumber = 0x0002; + break; + case "SSLv3": + versionNumber = 0x0300; + break; + case "TLSv1": + versionNumber = 0x0301; + break; + case "TLSv1.1": + versionNumber = 0x0302; + break; + case "TLSv1.2": + versionNumber = 0x0303; + break; + default: + // unlikely to happen + } + + return versionNumber; + } + } } private List tests; @@ -170,11 +266,13 @@ public class CipherTest { // no client with anonymous ciphersuites continue; } + tests.add(new TestParameters(cipherSuite, protocol, clientAuth)); } } } + testIterator = tests.iterator(); } diff --git a/test/sun/security/ssl/sanity/interop/CipherTest.java b/test/sun/security/ssl/sanity/interop/CipherTest.java index c7b544260ae061aa880f2c2c234156b8a2b13c4a..9c5af7eda4afb029a9fa4e1bcb044429dd93051e 100644 --- a/test/sun/security/ssl/sanity/interop/CipherTest.java +++ b/test/sun/security/ssl/sanity/interop/CipherTest.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 @@ -115,19 +115,7 @@ public class CipherTest { } boolean isEnabled() { - // ignore SCSV - if (cipherSuite.equals("TLS_EMPTY_RENEGOTIATION_INFO_SCSV")) { - return false; - } - - // ignore exportable cipher suite for TLSv1.1 - if (protocol.equals("TLSv1.1")) { - if(cipherSuite.indexOf("_EXPORT_") != -1) { - return false; - } - } - - return true; + return TLSCipherStatus.isEnabled(cipherSuite, protocol); } public String toString() { @@ -138,6 +126,114 @@ public class CipherTest { return s; } + static enum TLSCipherStatus { + // cipher suites supported since TLS 1.2 + CS_01("TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384", 0x0303, 0xFFFF), + CS_02("TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384", 0x0303, 0xFFFF), + CS_03("TLS_RSA_WITH_AES_256_CBC_SHA256", 0x0303, 0xFFFF), + CS_04("TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384", 0x0303, 0xFFFF), + CS_05("TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384", 0x0303, 0xFFFF), + CS_06("TLS_DHE_RSA_WITH_AES_256_CBC_SHA256", 0x0303, 0xFFFF), + CS_07("TLS_DHE_DSS_WITH_AES_256_CBC_SHA256", 0x0303, 0xFFFF), + + CS_08("TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256", 0x0303, 0xFFFF), + CS_09("TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256", 0x0303, 0xFFFF), + CS_10("TLS_RSA_WITH_AES_128_CBC_SHA256", 0x0303, 0xFFFF), + CS_11("TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256", 0x0303, 0xFFFF), + CS_12("TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256", 0x0303, 0xFFFF), + CS_13("TLS_DHE_RSA_WITH_AES_128_CBC_SHA256", 0x0303, 0xFFFF), + CS_14("TLS_DHE_DSS_WITH_AES_128_CBC_SHA256", 0x0303, 0xFFFF), + + CS_15("TLS_DH_anon_WITH_AES_256_CBC_SHA256", 0x0303, 0xFFFF), + CS_16("TLS_DH_anon_WITH_AES_128_CBC_SHA256", 0x0303, 0xFFFF), + CS_17("TLS_RSA_WITH_NULL_SHA256", 0x0303, 0xFFFF), + + // cipher suites obsoleted since TLS 1.2 + CS_50("SSL_RSA_WITH_DES_CBC_SHA", 0x0000, 0x0303), + CS_51("SSL_DHE_RSA_WITH_DES_CBC_SHA", 0x0000, 0x0303), + CS_52("SSL_DHE_DSS_WITH_DES_CBC_SHA", 0x0000, 0x0303), + CS_53("SSL_DH_anon_WITH_DES_CBC_SHA", 0x0000, 0x0303), + CS_54("TLS_KRB5_WITH_DES_CBC_SHA", 0x0000, 0x0303), + CS_55("TLS_KRB5_WITH_DES_CBC_MD5", 0x0000, 0x0303), + + // cipher suites obsoleted since TLS 1.1 + CS_60("SSL_RSA_EXPORT_WITH_RC4_40_MD5", 0x0000, 0x0302), + CS_61("SSL_DH_anon_EXPORT_WITH_RC4_40_MD5", 0x0000, 0x0302), + CS_62("SSL_RSA_EXPORT_WITH_DES40_CBC_SHA", 0x0000, 0x0302), + CS_63("SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA", 0x0000, 0x0302), + CS_64("SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA", 0x0000, 0x0302), + CS_65("SSL_DH_anon_EXPORT_WITH_DES40_CBC_SHA", 0x0000, 0x0302), + CS_66("TLS_KRB5_EXPORT_WITH_RC4_40_SHA", 0x0000, 0x0302), + CS_67("TLS_KRB5_EXPORT_WITH_RC4_40_MD5", 0x0000, 0x0302), + CS_68("TLS_KRB5_EXPORT_WITH_DES_CBC_40_SHA", 0x0000, 0x0302), + CS_69("TLS_KRB5_EXPORT_WITH_DES_CBC_40_MD5", 0x0000, 0x0302), + + // ignore TLS_EMPTY_RENEGOTIATION_INFO_SCSV always + CS_99("TLS_EMPTY_RENEGOTIATION_INFO_SCSV", 0xFFFF, 0x0000); + + // the cipher suite name + final String cipherSuite; + + // supported since protocol version + final int supportedSince; + + // obsoleted since protocol version + final int obsoletedSince; + + TLSCipherStatus(String cipherSuite, + int supportedSince, int obsoletedSince) { + this.cipherSuite = cipherSuite; + this.supportedSince = supportedSince; + this.obsoletedSince = obsoletedSince; + } + + static boolean isEnabled(String cipherSuite, String protocol) { + int versionNumber = toVersionNumber(protocol); + + if (versionNumber < 0) { + return true; // unlikely to happen + } + + for (TLSCipherStatus status : TLSCipherStatus.values()) { + if (cipherSuite.equals(status.cipherSuite)) { + if ((versionNumber < status.supportedSince) || + (versionNumber >= status.obsoletedSince)) { + return false; + } + + return true; + } + } + + return true; + } + + private static int toVersionNumber(String protocol) { + int versionNumber = -1; + + switch (protocol) { + case "SSLv2Hello": + versionNumber = 0x0002; + break; + case "SSLv3": + versionNumber = 0x0300; + break; + case "TLSv1": + versionNumber = 0x0301; + break; + case "TLSv1.1": + versionNumber = 0x0302; + break; + case "TLSv1.2": + versionNumber = 0x0303; + break; + default: + // unlikely to happen + } + + return versionNumber; + } + } } private List tests; diff --git a/test/sun/security/ssl/sanity/interop/ClientJSSEServerJSSE.java b/test/sun/security/ssl/sanity/interop/ClientJSSEServerJSSE.java index 74564602d007a9527943bd75fbdd08d7a4ba41aa..953d2ea8e5f40886ba139b447836ec060f435ee4 100644 --- a/test/sun/security/ssl/sanity/interop/ClientJSSEServerJSSE.java +++ b/test/sun/security/ssl/sanity/interop/ClientJSSEServerJSSE.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 @@ -25,8 +25,6 @@ * @test * @bug 4496785 * @summary Verify that all ciphersuites work in all configurations - * @ignore JSSE supported cipher suites are changed with CR 6916074, - * need to update this test case in JDK 7 soon * @author Andreas Sterbenz * @run main/othervm/timeout=300 ClientJSSEServerJSSE */ diff --git a/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/CookieHandlerTest.java b/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/CookieHandlerTest.java index 6b966fc2c79ce915c7338c5f3d950b589ff1affd..66637201d33b34bf81546f5215ddcf6992268d8b 100644 --- a/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/CookieHandlerTest.java +++ b/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/CookieHandlerTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2004, 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/sun/text/resources/LocaleData b/test/sun/text/resources/LocaleData index 36f17917d12efafa8eb91ac176b471097b98834e..9507873623385b6777e6b207ca6a8a415534a2fb 100644 --- a/test/sun/text/resources/LocaleData +++ b/test/sun/text/resources/LocaleData @@ -6356,3 +6356,589 @@ CurrencyNames/pt/zwd=D\u00f3lar do Zimb\u00e1bue # bug 7020960 CurrencyNames/sr_RS/RSD=\u0434\u0438\u043d. + +# bug 7025837 +CurrencyNames/sr-Latn-BA/bam=Bosansko-Hercegova\u010dka konvertibilna marka +CurrencyNames/sr-Latn-BA/eur=Evro +CurrencyNames/sr-Latn-ME/eur=Evro +CurrencyNames/sr-Latn-RS/rsd=Srpski dinar + +CurrencyNames//afa=Afghan Afghani (1927-2002) +CurrencyNames//afn=Afghan Afghani +CurrencyNames//ang=Netherlands Antillean Guilder +CurrencyNames//awg=Aruban Florin +CurrencyNames//azm=Azerbaijani Manat (1993-2006) +CurrencyNames//azn=Azerbaijani Manat +CurrencyNames//bbd=Barbadian Dollar +CurrencyNames//bdt=Bangladeshi Taka +CurrencyNames//bgn=Bulgarian Lev +CurrencyNames//bif=Burundian Franc +CurrencyNames//bob=Bolivian Boliviano +CurrencyNames//btn=Bhutanese Ngultrum +CurrencyNames//byb=Belarusian New Ruble (1994-1999) +CurrencyNames//byr=Belarusian Ruble +CurrencyNames//cdf=Congolese Franc +CurrencyNames//clf=Chilean Unit of Account (UF) +CurrencyNames//cny=Chinese Yuan +CurrencyNames//crc=Costa Rican Col\u00f3n +CurrencyNames//csd=Serbian Dinar (2002-2006) +CurrencyNames//cve=Cape Verdean Escudo +CurrencyNames//cyp=Cypriot Pound +CurrencyNames//dem=German Mark +CurrencyNames//djf=Djiboutian Franc +CurrencyNames//fjd=Fijian Dollar +CurrencyNames//ghc=Ghanaian Cedi (1979-2007) +CurrencyNames//ghs=Ghanaian Cedi +CurrencyNames//gmd=Gambian Dalasi +CurrencyNames//gnf=Guinean Franc +CurrencyNames//gtq=Guatemalan Quetzal +CurrencyNames//gyd=Guyanaese Dollar +CurrencyNames//hnl=Honduran Lempira +CurrencyNames//isk=Icelandic Kr\u00f3na +CurrencyNames//kgs=Kyrgystani Som +CurrencyNames//kmf=Comorian Franc +CurrencyNames//kzt=Kazakhstani Tenge +CurrencyNames//lkr=Sri Lankan Rupee +CurrencyNames//ltl=Lithuanian Litas +CurrencyNames//luf=Luxembourgian Franc +CurrencyNames//mga=Malagasy Ariary +CurrencyNames//mgf=Malagasy Franc +CurrencyNames//mmk=Myanma Kyat +CurrencyNames//mop=Macanese Pataca +CurrencyNames//mro=Mauritanian Ouguiya +CurrencyNames//mur=Mauritian Rupee +CurrencyNames//mvr=Maldivian Rufiyaa +CurrencyNames//mwk=Malawian Kwacha +CurrencyNames//mxv=Mexican Investment Unit +CurrencyNames//mzm=Mozambican Metical (1980-2006) +CurrencyNames//mzn=Mozambican Metical +CurrencyNames//nad=Namibian Dollar +CurrencyNames//nio=Nicaraguan C\u00f3rdoba +CurrencyNames//nlg=Dutch Guilder +CurrencyNames//omr=Omani Rial +CurrencyNames//pen=Peruvian Nuevo Sol +CurrencyNames//pgk=Papua New Guinean Kina +CurrencyNames//pkr=Pakistani Rupee +CurrencyNames//pyg=Paraguayan Guarani +CurrencyNames//rol=Romanian Leu (1952-2006) +CurrencyNames//rsd=Serbian Dinar +CurrencyNames//scr=Seychellois Rupee +CurrencyNames//sdd=Sudanese Dinar (1992-2007) +CurrencyNames//sit=Slovenian Tolar +CurrencyNames//sll=Sierra Leonean Leone +CurrencyNames//srd=Surinamese Dollar +CurrencyNames//srg=Surinamese Guilder +CurrencyNames//std=S\u00e3o Tom\u00e9 and Pr\u00edncipe Dobra +CurrencyNames//svc=Salvadoran Col\u00f3n +CurrencyNames//szl=Swazi Lilangeni +CurrencyNames//tjs=Tajikistani Somoni +CurrencyNames//tmm=Turkmenistani Manat (1993-2009) +CurrencyNames//top=Tongan Pa\u02bbanga +CurrencyNames//tpe=Timorese Escudo +CurrencyNames//trl=Turkish Lira (1922-2005) +CurrencyNames//try=Turkish Lira +CurrencyNames//twd=New Taiwan Dollar +CurrencyNames//uyu=Uruguayan Peso +CurrencyNames//uzs=Uzbekistan Som +CurrencyNames//veb=Venezuelan Bol\u00edvar (1871-2008) +CurrencyNames//vef=Venezuelan Bol\u00edvar +CurrencyNames//wst=Samoan Tala +CurrencyNames//xxx=Unknown Currency +CurrencyNames//yum=Yugoslavian New Dinar (1994-2002) +CurrencyNames//zwd=Zimbabwean Dollar (1980-2008) + +# bug 7020583 +CurrencyNames/de/azm=Aserbaidschan-Manat (1993-2006) +CurrencyNames/de/azn=Aserbaidschan-Manat +CurrencyNames/de/csd=Alter Serbischer Dinar +CurrencyNames/de/cyp=Zypern-Pfund +CurrencyNames/de/esp=Spanische Peseta +CurrencyNames/de/fjd=Fidschi-Dollar +CurrencyNames/de/fkp=Falkland-Pfund +CurrencyNames/de/ghs=Ghanaische Cedi +CurrencyNames/de/gip=Gibraltar-Pfund +CurrencyNames/de/gnf=Guinea-Franc +CurrencyNames/de/gyd=Guyana-Dollar +CurrencyNames/de/hkd=Hongkong-Dollar +CurrencyNames/de/itl=Italienische Lira +CurrencyNames/de/jmd=Jamaika-Dollar +CurrencyNames/de/kes=Kenia-Schilling +CurrencyNames/de/mgf=Madagaskar-Franc +CurrencyNames/de/mur=Mauritius-Rupie +CurrencyNames/de/mzm=Alter Metical +CurrencyNames/de/mzn=Metical +CurrencyNames/de/nad=Namibia-Dollar +CurrencyNames/de/nzd=Neuseeland-Dollar +CurrencyNames/de/ron=Rum\u00e4nischer Leu +CurrencyNames/de/rsd=Serbischer Dinar +CurrencyNames/de/rwf=Ruanda-Franc +CurrencyNames/de/sbd=Salomonen-Dollar +CurrencyNames/de/scr=Seychellen-Rupie +CurrencyNames/de/sdg=Sudanesisches Pfund +CurrencyNames/de/sgd=Singapur-Dollar +CurrencyNames/de/sos=Somalia-Schilling +CurrencyNames/de/srd=Surinamischer Dollar +CurrencyNames/de/tpe=Timor-Escudo +CurrencyNames/de/trl=Alte T\u00fcrkische Lira +CurrencyNames/de/try=T\u00fcrkische Lira +CurrencyNames/de/ttd=Trinidad- und Tobago-Dollar +CurrencyNames/de/twd=Neuer Taiwan-Dollar +CurrencyNames/de/tzs=Tansania-Schilling +CurrencyNames/de/ugx=Uganda-Schilling +CurrencyNames/de/usd=US-Dollar +CurrencyNames/de/vef=Bol\u00edvar Fuerte +CurrencyNames/de/xag=Unze Silber +CurrencyNames/de/xau=Unze Gold +CurrencyNames/de/xbb=Europ\u00e4ische W\u00e4hrungseinheit (XBB) +CurrencyNames/de/xpd=Unze Palladium +CurrencyNames/de/xpt=Unze Platin +CurrencyNames/de/xts=Testw\u00e4hrung +CurrencyNames/de/xxx=Unbekannte W\u00e4hrung +CurrencyNames/de/yer=Jemen-Rial +CurrencyNames/de/zar=S\u00fcdafrikanischer Rand +CurrencyNames/de/zwd=Simbabwe-Dollar + +CurrencyNames/es/aed=d\u00edrham de los Emiratos \u00c1rabes Unidos +CurrencyNames/es/azm=manat azer\u00ed (1993-2006) +CurrencyNames/es/azn=manat azer\u00ed +CurrencyNames/es/csd=antiguo dinar serbio +CurrencyNames/es/ghc=cedi ghan\u00e9s (1979-2007) +CurrencyNames/es/ghs=cedi ghan\u00e9s +CurrencyNames/es/mzm=antiguo metical mozambique\u00f1o +CurrencyNames/es/mzn=metical mozambique\u00f1o +CurrencyNames/es/rsd=dinar serbio +CurrencyNames/es/sdg=libra sudanesa +CurrencyNames/es/trl=lira turca antigua +CurrencyNames/es/vef=bol\u00edvar fuerte venezolano + +CurrencyNames/fr/afa=afghani (1927\u20132002) +CurrencyNames/fr/all=lek albanais +CurrencyNames/fr/ang=florin antillais +CurrencyNames/fr/awg=florin arubais +CurrencyNames/fr/azm=manat az\u00e9ri (1993-2006) +CurrencyNames/fr/azn=manat az\u00e9ri +CurrencyNames/fr/bam=mark convertible bosniaque +CurrencyNames/fr/bbd=dollar barbadien +CurrencyNames/fr/bdt=taka bangladeshi +CurrencyNames/fr/bgl=lev bulgare (1962\u20131999) +CurrencyNames/fr/bgn=nouveau lev bulgare +CurrencyNames/fr/bhd=dinar bahre\u00efni +CurrencyNames/fr/bif=franc burundais +CurrencyNames/fr/bmd=dollar bermudien +CurrencyNames/fr/bnd=dollar brun\u00e9ien +CurrencyNames/fr/bov=mvdol bolivien +CurrencyNames/fr/brl=r\u00e9al br\u00e9silien +CurrencyNames/fr/bsd=dollar baham\u00e9en +CurrencyNames/fr/btn=ngultrum bouthanais +CurrencyNames/fr/bwp=pula botswanais +CurrencyNames/fr/bzd=dollar b\u00e9liz\u00e9en +CurrencyNames/fr/cny=yuan renminbi chinois +CurrencyNames/fr/crc=col\u00f3n costaricain +CurrencyNames/fr/csd=dinar serbo-mont\u00e9n\u00e9grin +CurrencyNames/fr/cve=escudo capverdien +CurrencyNames/fr/cyp=livre chypriote +CurrencyNames/fr/dem=mark allemand +CurrencyNames/fr/djf=franc djiboutien +CurrencyNames/fr/ern=nafka \u00e9rythr\u00e9en +CurrencyNames/fr/etb=birr \u00e9thiopien +CurrencyNames/fr/fjd=dollar fidjien +CurrencyNames/fr/fkp=livre des Falkland +CurrencyNames/fr/gel=lari g\u00e9orgien +CurrencyNames/fr/ghs=c\u00e9di ghan\u00e9en +CurrencyNames/fr/gmd=dalasi gambien +CurrencyNames/fr/grd=drachme grecque +CurrencyNames/fr/gtq=quetzal guat\u00e9malt\u00e8que +CurrencyNames/fr/gwp=peso bissau-guin\u00e9en +CurrencyNames/fr/hnl=lempira hondurien +CurrencyNames/fr/hrk=kuna croate +CurrencyNames/fr/htg=gourde ha\u00eftienne +CurrencyNames/fr/huf=forint hongrois +CurrencyNames/fr/idr=roupie indon\u00e9sienne +CurrencyNames/fr/ils=nouveau shekel isra\u00e9lien +CurrencyNames/fr/iqd=dinar irakien +CurrencyNames/fr/jpy=yen japonais +CurrencyNames/fr/kes=shilling k\u00e9nyan +CurrencyNames/fr/kgs=som kirghize +CurrencyNames/fr/khr=riel cambodgien +CurrencyNames/fr/kmf=franc comorien +CurrencyNames/fr/kwd=dinar kowe\u00eftien +CurrencyNames/fr/kzt=tenge kazakh +CurrencyNames/fr/lak=kip loatien +CurrencyNames/fr/lkr=roupie srilankaise +CurrencyNames/fr/lsl=loti lesothan +CurrencyNames/fr/mga=ariary malgache +CurrencyNames/fr/mkd=denar mac\u00e9donien +CurrencyNames/fr/mmk=kyat myanmarais +CurrencyNames/fr/mnt=tugrik mongol +CurrencyNames/fr/mop=pataca macanaise +CurrencyNames/fr/mro=ouguiya mauritanien +CurrencyNames/fr/mvr=rufiyaa maldivienne +CurrencyNames/fr/mwk=kwacha malawite +CurrencyNames/fr/myr=ringgit malais +CurrencyNames/fr/mzn=metical mozambicain +CurrencyNames/fr/ngn=naira nig\u00e9rian +CurrencyNames/fr/nio=c\u00f3rdoba oro nicaraguayen +CurrencyNames/fr/npr=roupie n\u00e9palaise +CurrencyNames/fr/pab=balboa panam\u00e9en +CurrencyNames/fr/pgk=kina papouan-n\u00e9o-guin\u00e9en +CurrencyNames/fr/pkr=roupie pakistanaise +CurrencyNames/fr/pln=zloty polonais +CurrencyNames/fr/pyg=guaran\u00ed paraguayen +CurrencyNames/fr/qar=rial qatari +CurrencyNames/fr/ron=leu roumain +CurrencyNames/fr/rsd=dinar serbe +CurrencyNames/fr/rub=rouble russe +CurrencyNames/fr/rur=rouble russe (1991\u20131998) +CurrencyNames/fr/sbd=dollar des \u00eeles Salomon +CurrencyNames/fr/sdg=livre soudanaise +CurrencyNames/fr/sit=tolar slov\u00e8ne +CurrencyNames/fr/sll=leone sierra-l\u00e9onais +CurrencyNames/fr/sos=shilling somalien +CurrencyNames/fr/srg=florin surinamais +CurrencyNames/fr/std=dobra santom\u00e9en +CurrencyNames/fr/svc=col\u00f3n salvadorien +CurrencyNames/fr/szl=lilangeni swazi +CurrencyNames/fr/thb=baht tha\u00eflandais +CurrencyNames/fr/tjs=somoni tadjik +CurrencyNames/fr/tmm=manat turkm\u00e8ne +CurrencyNames/fr/top=pa\u2019anga tongan +CurrencyNames/fr/tpe=escudo timorais +CurrencyNames/fr/ttd=dollar trinidadien +CurrencyNames/fr/twd=nouveau dollar ta\u00efwanais +CurrencyNames/fr/tzs=shilling tanzanien +CurrencyNames/fr/uah=hryvnia ukrainienne +CurrencyNames/fr/uzs=sum ouzbek +CurrencyNames/fr/vef=bolivar fuerte v\u00e9n\u00e9zu\u00e9lien +CurrencyNames/fr/vnd=d\u00f4ng vietnamien +CurrencyNames/fr/vuv=vatu vanuatuan +CurrencyNames/fr/wst=tala samoan +CurrencyNames/fr/xts=(devise de test) +CurrencyNames/fr/xxx=devise inconnue ou non valide +CurrencyNames/fr/yer=rial y\u00e9m\u00e9nite +CurrencyNames/fr/zar=rand sud-africain +CurrencyNames/fr/zmk=kwacha zambien +CurrencyNames/fr/zwd=dollar zimbabw\u00e9en + +CurrencyNames/it/azm=Manat Azero (1993-2006) +CurrencyNames/it/ghs=Cedi ghanese +CurrencyNames/it/iep=Sterlina irlandese +CurrencyNames/it/mzn=Metical del Mozambico +CurrencyNames/it/rsd=Dinaro serbo +CurrencyNames/it/sdg=Sterlina sudanese +CurrencyNames/it/srd=Dollaro surinamese +CurrencyNames/it/vef=Bol\u00edvar venezuelano forte +CurrencyNames/it/xag=Argento +CurrencyNames/it/xpd=Palladio + +CurrencyNames/ja/azm=\u30a2\u30bc\u30eb\u30d0\u30a4\u30b8\u30e3\u30f3 \u30de\u30ca\u30c8 (1993-2006) +CurrencyNames/ja/azn=\u30a2\u30bc\u30eb\u30d0\u30a4\u30b8\u30e3\u30f3 \u30de\u30ca\u30c8 +CurrencyNames/ja/ghc=\u30ac\u30fc\u30ca \u30bb\u30c7\u30a3 (1979-2007) +CurrencyNames/ja/ghs=\u30ac\u30fc\u30ca \u30bb\u30c7\u30a3 +CurrencyNames/ja/mzn=\u30e2\u30b6\u30f3\u30d3\u30fc\u30af \u30e1\u30c6\u30a3\u30ab\u30eb +CurrencyNames/ja/rol=\u30eb\u30fc\u30de\u30cb\u30a2 \u65e7\u30ec\u30a4 +CurrencyNames/ja/ron=\u30eb\u30fc\u30de\u30cb\u30a2 \u30ec\u30a4 +CurrencyNames/ja/rsd=\u30c7\u30a3\u30ca\u30fc\u30eb (\u30bb\u30eb\u30d3\u30a2) +CurrencyNames/ja/sdg=\u30b9\u30fc\u30c0\u30f3 \u30dd\u30f3\u30c9 +CurrencyNames/ja/srd=\u30b9\u30ea\u30ca\u30e0 \u30c9\u30eb +CurrencyNames/ja/vef=\u30d9\u30cd\u30ba\u30a8\u30e9 \u30dc\u30ea\u30d0\u30eb\u30d5\u30a8\u30eb\u30c6 +CurrencyNames/ja/xag=\u9280 +CurrencyNames/ja/xpd=\u30d1\u30e9\u30b8\u30a6\u30e0 +CurrencyNames/ja/xpt=\u30d7\u30e9\u30c1\u30ca +CurrencyNames/ja/xts=\u30c6\u30b9\u30c8\u7528\u901a\u8ca8\u30b3\u30fc\u30c9 +CurrencyNames/ja/xxx=\u4e0d\u660e\u307e\u305f\u306f\u7121\u52b9\u306a\u901a\u8ca8 +CurrencyNames/ja/zmk=\u30b6\u30f3\u30d3\u30a2 \u30af\u30ef\u30c1\u30e3 + +CurrencyNames/ko/aed=\uc544\ub78d\uc5d0\ubbf8\ub9ac\ud2b8 \ub514\ub974\ud568 +CurrencyNames/ko/ang=\ub124\ub35c\ub780\ub4dc\ub839 \uc548\ud2f8\ub808\uc2a4 \uae38\ub354 +CurrencyNames/ko/azm=\uc544\uc81c\ub974\ubc14\uc774\uc820 \ub9c8\ub098\ud2b8(1993-2006) +CurrencyNames/ko/azn=\uc544\uc81c\ub974\ubc14\uc774\uc794 \ub9c8\ub098\ud2b8 +CurrencyNames/ko/bov=\ubcfc\ub9ac\ube44\uc544\ub178 Mvdol(\uae30\uae08) +CurrencyNames/ko/chf=\uc2a4\uc704\uc2a4 \ud504\ub791 +CurrencyNames/ko/clf=\uce60\ub808 UF (Unidades de Fomento) +CurrencyNames/ko/csd=\uace0 \uc138\ub974\ube44\uc544 \ub514\ub098\ub974 +CurrencyNames/ko/ghc=\uac00\ub098 \uc2dc\ub514 (1979-2007) +CurrencyNames/ko/ghs=\uac00\ub098 \uc2dc\ub514 +CurrencyNames/ko/mxv=\uba55\uc2dc\ucf54 UDI(Unidad de Inversion) +CurrencyNames/ko/myr=\ub9d0\ub808\uc774\uc2dc\uc544 \ub9c1\uae43 +CurrencyNames/ko/mzm=\uace0 \ubaa8\uc7a0\ube44\ud06c \uba54\ud2f0\uce7c +CurrencyNames/ko/mzn=\ubaa8\uc7a0\ube44\ud06c \uba54\ud2f0\uce7c +CurrencyNames/ko/ron=\ub8e8\ub9c8\ub2c8\uc544 \ub808\uc6b0 +CurrencyNames/ko/rsd=\uc138\ub974\ube44\uc544 \ub514\ub098\ub974 +CurrencyNames/ko/sdg=\uc218\ub2e8 \ud30c\uc6b4\ub4dc +CurrencyNames/ko/srd=\uc218\ub9ac\ub0a8 \ub2ec\ub7ec +CurrencyNames/ko/top=\ud1b5\uac00 \ud30c\uc559\uac00 +CurrencyNames/ko/trl=\ud130\ud0a4 \ub9ac\ub77c +CurrencyNames/ko/try=\uc2e0 \ud130\ud0a4 \ub9ac\ub77c +CurrencyNames/ko/usn=\ubbf8\uad6d \ub2ec\ub7ec(\ub2e4\uc74c\ub0a0) +CurrencyNames/ko/uss=\ubbf8\uad6d \ub2ec\ub7ec(\ub2f9\uc77c) +CurrencyNames/ko/vef=\ubca0\ub124\uc8fc\uc5d8\ub77c \ubcfc\ub9ac\ubc14\ub974 \ud478\uc5d0\ub974\ub5bc +CurrencyNames/ko/xaf=CFA \ud504\ub791 BEAC +CurrencyNames/ko/xag=\uc740\ud654 +CurrencyNames/ko/xba=\uc720\ub974\ucf54 (\uc720\ub7fd \ud68c\uacc4 \ub2e8\uc704) +CurrencyNames/ko/xbb=\uc720\ub7fd \ud1b5\ud654 \ub3d9\ub9f9 +CurrencyNames/ko/xbc=\uc720\ub7fd \uacc4\uc0b0 \ub2e8\uc704 (XBC) +CurrencyNames/ko/xbd=\uc720\ub7fd \uacc4\uc0b0 \ub2e8\uc704 (XBD) +CurrencyNames/ko/xof=CFA \ud504\ub791 BCEAO +CurrencyNames/ko/xpd=\ud314\ub77c\ub4d0 +CurrencyNames/ko/xpf=CFP \ud504\ub791 +CurrencyNames/ko/xpt=\ubc31\uae08 +CurrencyNames/ko/xts=\ud14c\uc2a4\ud2b8 \ud1b5\ud654 \ucf54\ub4dc +CurrencyNames/ko/xxx=\uc54c\uc218\uc5c6\uac70\ub098 \uc720\ud6a8\ud558\uc9c0\uc54a\uc740 \ud1b5\ud654\ub2e8\uc704 +CurrencyNames/ko/zwd=\uc9d0\ubc14\ube0c\uc6e8 \ub2ec\ub7ec + +CurrencyNames/sv/adp=andorransk peseta +CurrencyNames/sv/aed=F\u00f6renade Arabemiratens dirham +CurrencyNames/sv/afa=afghani (1927-2002) +CurrencyNames/sv/afn=afghani +CurrencyNames/sv/all=albansk lek +CurrencyNames/sv/amd=armenisk dram +CurrencyNames/sv/ang=Nederl\u00e4ndska Antillernas gulden +CurrencyNames/sv/aoa=angolansk kwanza +CurrencyNames/sv/ars=argentinsk peso +CurrencyNames/sv/ats=\u00f6sterrikisk schilling +CurrencyNames/sv/aud=australisk dollar +CurrencyNames/sv/awg=Aruba-gulden +CurrencyNames/sv/azm=azerbajdzjansk manat (1993-2006) +CurrencyNames/sv/azn=azerbajdzjansk manat +CurrencyNames/sv/bam=bosnisk-hercegovinsk mark (konvertibel) +CurrencyNames/sv/bbd=Barbados-dollar +CurrencyNames/sv/bdt=bangladeshisk taka +CurrencyNames/sv/bef=belgisk franc +CurrencyNames/sv/bgn=bulgarisk ny lev +CurrencyNames/sv/bhd=Bahrain-dinar +CurrencyNames/sv/bif=burundisk franc +CurrencyNames/sv/bnd=Brunei-dollar +CurrencyNames/sv/bob=boliviano +CurrencyNames/sv/bov=boliviansk mvdol +CurrencyNames/sv/brl=brasiliansk real +CurrencyNames/sv/bsd=Bahamas-dollar +CurrencyNames/sv/btn=bhutanesisk ngultrum +CurrencyNames/sv/bwp=botswansk pula +CurrencyNames/sv/byb=vitrysk ny rubel (1994-1999) +CurrencyNames/sv/byr=vitrysk rubel +CurrencyNames/sv/bzd=belizisk dollar +CurrencyNames/sv/cad=kanadensisk dollar +CurrencyNames/sv/cdf=kongolesisk franc +CurrencyNames/sv/chf=schweizisk franc +CurrencyNames/sv/clf=chilensk unidad de fomento +CurrencyNames/sv/clp=chilensk peso +CurrencyNames/sv/cny=kinesisk yuan renminbi +CurrencyNames/sv/cop=colombiansk peso +CurrencyNames/sv/crc=costarikansk col\u00f3n +CurrencyNames/sv/csd=jugoslavisk dinar +CurrencyNames/sv/cup=kubansk peso +CurrencyNames/sv/cve=kapverdisk escudo +CurrencyNames/sv/cyp=cypriotiskt pund +CurrencyNames/sv/czk=tjeckisk koruna +CurrencyNames/sv/dem=tysk mark +CurrencyNames/sv/djf=djiboutisk franc +CurrencyNames/sv/dkk=dansk krona +CurrencyNames/sv/dop=dominikansk peso +CurrencyNames/sv/dzd=algerisk dinar +CurrencyNames/sv/eek=estnisk krona +CurrencyNames/sv/egp=egyptiskt pund +CurrencyNames/sv/ern=eritreansk nakfa +CurrencyNames/sv/esp=spansk peseta +CurrencyNames/sv/etb=etiopisk birr +CurrencyNames/sv/eur=euro +CurrencyNames/sv/fim=finsk mark +CurrencyNames/sv/fjd=Fiji-dollar +CurrencyNames/sv/frf=fransk franc +CurrencyNames/sv/gbp=brittiskt pund sterling +CurrencyNames/sv/gel=georgisk lari +CurrencyNames/sv/ghc=ghanansk cedi (1979-2007) +CurrencyNames/sv/ghs=ghanansk cedi +CurrencyNames/sv/gip=gibraltiskt pund +CurrencyNames/sv/gmd=gambisk dalasi +CurrencyNames/sv/gnf=guineansk franc +CurrencyNames/sv/grd=grekisk drachma +CurrencyNames/sv/gtq=guatemalansk quetzal +CurrencyNames/sv/gyd=guyanansk dollar +CurrencyNames/sv/hnl=honduransk lempira +CurrencyNames/sv/hrk=kroatisk kuna +CurrencyNames/sv/htg=haitisk gourde +CurrencyNames/sv/huf=ungersk forint +CurrencyNames/sv/idr=indonesisk rupiah +CurrencyNames/sv/iep=irl\u00e4ndskt pund +CurrencyNames/sv/ils=israelisk ny shekel +CurrencyNames/sv/inr=indisk rupie +CurrencyNames/sv/iqd=irakisk dinar +CurrencyNames/sv/irr=iransk rial +CurrencyNames/sv/isk=isl\u00e4ndsk krona +CurrencyNames/sv/itl=italiensk lira +CurrencyNames/sv/jmd=Jamaica-dollar +CurrencyNames/sv/jod=jordansk dinar +CurrencyNames/sv/jpy=japansk yen +CurrencyNames/sv/kes=kenyansk shilling +CurrencyNames/sv/kgs=kirgizisk som +CurrencyNames/sv/khr=kambodjansk riel +CurrencyNames/sv/kmf=komorisk franc +CurrencyNames/sv/kpw=nordkoreansk won +CurrencyNames/sv/krw=sydkoreansk won +CurrencyNames/sv/kwd=kuwaitisk dinar +CurrencyNames/sv/kzt=kazakisk tenge +CurrencyNames/sv/lak=laotisk kip +CurrencyNames/sv/lbp=libanesiskt pund +CurrencyNames/sv/lkr=srilankesisk rupie +CurrencyNames/sv/lrd=Liberia-dollar +CurrencyNames/sv/lsl=lesothisk loti +CurrencyNames/sv/ltl=litauisk litas +CurrencyNames/sv/luf=luxemburgsk franc +CurrencyNames/sv/lvl=lettisk lats +CurrencyNames/sv/lyd=libysk dinar +CurrencyNames/sv/mad=marockansk dirham +CurrencyNames/sv/mdl=moldavisk leu +CurrencyNames/sv/mga=madagaskisk ariary +CurrencyNames/sv/mgf=madagaskisk franc +CurrencyNames/sv/mkd=makedonisk denar +CurrencyNames/sv/mmk=myanmarisk kyat +CurrencyNames/sv/mnt=mongolisk tugrik +CurrencyNames/sv/mop=Macao-pataca +CurrencyNames/sv/mro=mauretansk ouguiya +CurrencyNames/sv/mtl=maltesisk lira +CurrencyNames/sv/mur=mauritisk rupie +CurrencyNames/sv/mvr=maldivisk rufiyaa +CurrencyNames/sv/mwk=malawisk kwacha +CurrencyNames/sv/mxn=mexikansk peso +CurrencyNames/sv/mxv=mexikansk unidad de inversion +CurrencyNames/sv/myr=malaysisk ringgit +CurrencyNames/sv/mzm=gammal mo\u00e7ambikisk metical +CurrencyNames/sv/mzn=mo\u00e7ambikisk metical +CurrencyNames/sv/nad=Namibia-dollar +CurrencyNames/sv/ngn=nigeriansk naira +CurrencyNames/sv/nio=nicaraguansk c\u00f3rdoba oro +CurrencyNames/sv/nlg=nederl\u00e4ndsk gulden +CurrencyNames/sv/nok=norsk krona +CurrencyNames/sv/npr=nepalesisk rupie +CurrencyNames/sv/nzd=nyzeel\u00e4ndsk dollar +CurrencyNames/sv/omr=omansk rial +CurrencyNames/sv/pab=panamansk balboa +CurrencyNames/sv/pen=peruansk sol nuevo +CurrencyNames/sv/pgk=papuansk kina +CurrencyNames/sv/php=filippinsk peso +CurrencyNames/sv/pkr=pakistansk rupie +CurrencyNames/sv/pln=polsk zloty +CurrencyNames/sv/pte=portugisisk escudo +CurrencyNames/sv/pyg=paraguaysk guarani +CurrencyNames/sv/qar=qatarisk rial +CurrencyNames/sv/rol=gammal rum\u00e4nsk leu +CurrencyNames/sv/ron=rum\u00e4nsk leu +CurrencyNames/sv/rsd=Serbisk dinar +CurrencyNames/sv/rub=rysk rubel +CurrencyNames/sv/rur=rysk rubel (1991-1998) +CurrencyNames/sv/rwf=rwandisk franc +CurrencyNames/sv/sar=saudisk riyal +CurrencyNames/sv/scr=seychellisk rupie +CurrencyNames/sv/sdd=sudanesisk dinar +CurrencyNames/sv/sdg=sudanesiskt pund +CurrencyNames/sv/sek=svensk krona +CurrencyNames/sv/sgd=Singapore-dollar +CurrencyNames/sv/sit=slovensk tolar +CurrencyNames/sv/skk=slovakisk koruna +CurrencyNames/sv/sll=sierraleonsk leone +CurrencyNames/sv/sos=somalisk shilling +CurrencyNames/sv/srd=Surinam-dollar +CurrencyNames/sv/srg=surinamesisk gulden +CurrencyNames/sv/svc=salvadoransk col\u00f3n +CurrencyNames/sv/syp=syriskt pund +CurrencyNames/sv/szl=swazil\u00e4ndsk lilangeni +CurrencyNames/sv/thb=thail\u00e4ndsk baht +CurrencyNames/sv/tjs=tadzjikisk somoni +CurrencyNames/sv/tmm=turkmensk manat +CurrencyNames/sv/tnd=tunisisk dinar +CurrencyNames/sv/top=tongansk pa\u02bbanga +CurrencyNames/sv/tpe=timoriansk escudo +CurrencyNames/sv/trl=gammal turkisk lira +CurrencyNames/sv/try=ny turkisk lira +CurrencyNames/sv/ttd=Trinidad ochTobago-dollar +CurrencyNames/sv/twd=taiwanesisk ny dollar +CurrencyNames/sv/tzs=tanzanisk shilling +CurrencyNames/sv/uah=ukrainsk hryvnia +CurrencyNames/sv/ugx=ugandisk shilling +CurrencyNames/sv/uyu=uruguayansk peso +CurrencyNames/sv/uzs=uzbekisk sum +CurrencyNames/sv/veb=venezuelansk bolivar +CurrencyNames/sv/vef=venezuelansk bolivar fuerte +CurrencyNames/sv/vnd=vietnamesisk dong +CurrencyNames/sv/vuv=vanuatisk vatu +CurrencyNames/sv/wst=v\u00e4stsamoansk tala +CurrencyNames/sv/xag=silver +CurrencyNames/sv/xau=guld +CurrencyNames/sv/xba=europeisk kompositenhet +CurrencyNames/sv/xbb=europeisk monet\u00e4r enhet +CurrencyNames/sv/xbc=europeisk kontoenhet (XBC) +CurrencyNames/sv/xbd=europeisk kontoenhet (XBD) +CurrencyNames/sv/xcd=\u00f6stkaribisk dollar +CurrencyNames/sv/xdr=IMF s\u00e4rskild dragningsr\u00e4tt +CurrencyNames/sv/xfo=fransk guldfranc +CurrencyNames/sv/xpd=palladium +CurrencyNames/sv/xpt=platina +CurrencyNames/sv/xts=test-valutakod +CurrencyNames/sv/xxx=ok\u00e4nd eller ogiltig valuta +CurrencyNames/sv/yer=jemenitisk rial +CurrencyNames/sv/yum=jugoslavisk ny dinar +CurrencyNames/sv/zar=sydafrikansk rand +CurrencyNames/sv/zmk=zambisk kwacha +CurrencyNames/sv/zwd=Zimbabwe-dollar + +CurrencyNames/zh_CN/ang=\u8377\u5170\u5b89\u66ff\u5170\u76fe +CurrencyNames/zh_CN/azm=\u963f\u585e\u62dc\u7586\u9a6c\u7eb3\u7279 (1993-2006) +CurrencyNames/zh_CN/azn=\u963f\u585e\u62dc\u7586\u9a6c\u7eb3\u7279 +CurrencyNames/zh_CN/csd=\u65e7\u585e\u5c14\u7ef4\u4e9a\u7b2c\u7eb3\u5c14 +CurrencyNames/zh_CN/ghs=\u52a0\u7eb3\u585e\u5730 +CurrencyNames/zh_CN/mzm=\u65e7\u83ab\u6851\u6bd4\u514b\u7f8e\u63d0\u5361 +CurrencyNames/zh_CN/mzn=\u83ab\u6851\u6bd4\u514b\u7f8e\u63d0\u5361 +CurrencyNames/zh_CN/ron=\u7f57\u9a6c\u5c3c\u4e9a\u5217\u4f0a +CurrencyNames/zh_CN/rsd=\u585e\u5c14\u7ef4\u4e9a\u7b2c\u7eb3\u5c14 +CurrencyNames/zh_CN/shp=\u5723\u8d6b\u52d2\u62ff\u7fa4\u5c9b\u78c5 +CurrencyNames/zh_CN/twd=\u65b0\u53f0\u5e01 +CurrencyNames/zh_CN/vef=\u59d4\u5185\u745e\u62c9\u5f3a\u52bf\u73bb\u5229\u74e6 +CurrencyNames/zh_CN/xxx=\u8d27\u5e01\u672a\u77e5\u6216\u65e0\u6548 + +CurrencyNames/zh_TW/afa=\u963f\u5bcc\u6c57\u5c3c (1927-2002) +CurrencyNames/zh_TW/ang=\u53e4\u82f1\u6587 +CurrencyNames/zh_TW/azm=\u4e9e\u585e\u62dc\u7136\u99ac\u7d0d\u7279 (1993-2006) +CurrencyNames/zh_TW/azn=\u4e9e\u585e\u62dc\u7136\u99ac\u7d0d\u7279 +CurrencyNames/zh_TW/bwp=\u6ce2\u672d\u90a3\u666e\u62c9 +CurrencyNames/zh_TW/bzd=\u8c9d\u91cc\u65af\u5143 +CurrencyNames/zh_TW/csd=\u65e7\u585e\u5c14\u7ef4\u4e9a\u7b2c\u7eb3\u5c14 +CurrencyNames/zh_TW/cyp=\u8cfd\u666e\u52d2\u65af\u938a +CurrencyNames/zh_TW/ghc=\u8fe6\u7d0d\u4ed9\u8515 (1979-2007) +CurrencyNames/zh_TW/ghs=\u8fe6\u7d0d\u4ed9\u8515 +CurrencyNames/zh_TW/gwp=\u5e7e\u5167\u4e9e\u6bd4\u7d22\u62ab\u7d22 +CurrencyNames/zh_TW/huf=\u5308\u7259\u5229\u798f\u6797 +CurrencyNames/zh_TW/idr=\u5370\u5c3c\u76fe +CurrencyNames/zh_TW/inr=\u5370\u5ea6\u76e7\u6bd4 +CurrencyNames/zh_TW/kpw=\u5317\u97d3\u571c +CurrencyNames/zh_TW/krw=\u97d3\u571c +CurrencyNames/zh_TW/lak=\u8001\u631d\u57fa\u666e +CurrencyNames/zh_TW/mad=\u6469\u6d1b\u54e5\u8fea\u62c9\u59c6 +CurrencyNames/zh_TW/mxn=\u58a8\u897f\u54e5\u62ab\u7d22 +CurrencyNames/zh_TW/mxv=\u58a8\u897f\u54e5 Unidad de Inversion (UDI)\uff08\u8d44\u91d1\uff09 +CurrencyNames/zh_TW/myr=\u99ac\u4f86\u897f\u4e9e\u4ee4\u5409 +CurrencyNames/zh_TW/mzn=\u83ab\u4e09\u6bd4\u514b\u7f8e\u63d0\u5361 +CurrencyNames/zh_TW/nio=\u5c3c\u52a0\u62c9\u74dc\u91d1\u79d1\u591a\u5df4 +CurrencyNames/zh_TW/rol=\u65e7\u7f57\u9a6c\u5c3c\u4e9a\u5217\u4f0a +CurrencyNames/zh_TW/ron=\u7f85\u99ac\u5c3c\u4e9e\u5217\u4f0a +CurrencyNames/zh_TW/rsd=\u585e\u723e\u7dad\u4e9e\u6234\u7d0d +CurrencyNames/zh_TW/scr=\u585e\u5e2d\u723e\u76e7\u6bd4 +CurrencyNames/zh_TW/sdg=\u8607\u4e39\u938a +CurrencyNames/zh_TW/shp=\u5723\u8d6b\u52d2\u62ff\u7fa4\u5c9b\u78c5 +CurrencyNames/zh_TW/srd=\u82cf\u91cc\u5357\u5143 +CurrencyNames/zh_TW/srg=\u8607\u5229\u5357\u57fa\u723e +CurrencyNames/zh_TW/svc=\u8428\u5c14\u74e6\u591a\u79d1\u6717 +CurrencyNames/zh_TW/szl=\u65af\u5a01\u58eb\u5170\u91cc\u5170\u5409\u5c3c +CurrencyNames/zh_TW/tpe=\u5e1d\u6c76\u57c3\u65af\u5e93\u591a +CurrencyNames/zh_TW/ttd=\u7279\u7acb\u5c3c\u8fbe\u548c\u591a\u5df4\u54e5\u5143 +CurrencyNames/zh_TW/tzs=\u5766\u6851\u5c3c\u4e9a\u5148\u4ee4 +CurrencyNames/zh_TW/uzs=\u70cf\u8332\u5225\u514b\u7d22\u59c6 +CurrencyNames/zh_TW/veb=\u59d4\u5167\u745e\u62c9\u73bb\u5229\u74e6 +CurrencyNames/zh_TW/vef=\u59d4\u5167\u745e\u62c9\u5f37\u52e2\u73bb\u5229\u74e6 +CurrencyNames/zh_TW/xaf=\u897f\u975e\u6cd5\u90ce BEAC +CurrencyNames/zh_TW/xag=XAG +CurrencyNames/zh_TW/xof=\u897f\u975e\u6cd5\u90ce BCEAO +CurrencyNames/zh_TW/xpd=\u94af +CurrencyNames/zh_TW/xpt=\u94c2 +CurrencyNames/zh_TW/xts=XTS +CurrencyNames/zh_TW/xxx=XXX +CurrencyNames/zh_TW/yer=\u8449\u9580\u91cc\u96c5 diff --git a/test/sun/text/resources/LocaleDataTest.java b/test/sun/text/resources/LocaleDataTest.java index 5cf693cc1aabb7aa30da2af1aff7d11e7310a46f..30e65c52ab530ed7003553f8a93537ec1aaedef3 100644 --- a/test/sun/text/resources/LocaleDataTest.java +++ b/test/sun/text/resources/LocaleDataTest.java @@ -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 @@ -33,7 +33,7 @@ * 6379214 6485516 6486607 4225362 4494727 6533691 6531591 6531593 6570259 * 6509039 6609737 6610748 6645271 6507067 6873931 6450945 6645268 6646611 * 6645405 6650730 6910489 6573250 6870908 6585666 6716626 6914413 6916787 - * 6919624 6998391 7019267 7020960 + * 6919624 6998391 7019267 7020960 7025837 7020583 * @summary Verify locale data * */ diff --git a/test/sun/tools/native2ascii/Native2AsciiTests.sh b/test/sun/tools/native2ascii/Native2AsciiTests.sh index 82ee282bda3f72f4f6e5bf8bb8fc5268eef32c1e..f656bbc8da2582da7796ee25586c5bda64f0bfd2 100644 --- a/test/sun/tools/native2ascii/Native2AsciiTests.sh +++ b/test/sun/tools/native2ascii/Native2AsciiTests.sh @@ -1,7 +1,7 @@ #! /bin/sh -e # -# 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/test/sun/util/logging/PlatformLoggerTest.java b/test/sun/util/logging/PlatformLoggerTest.java index 35fccfc00e6e960086e21fac4a2a7828db838863..9e7435d404551fd8d0bf3d67353f80a380bd1d5a 100644 --- a/test/sun/util/logging/PlatformLoggerTest.java +++ b/test/sun/util/logging/PlatformLoggerTest.java @@ -26,10 +26,11 @@ * @bug 6882376 6985460 * @summary Test if java.util.logging.Logger is created before and after * logging is enabled. Also validate some basic PlatformLogger - * operations. + * operations. othervm mode to make sure java.util.logging + * is not initialized. * * @compile -XDignore.symbol.file PlatformLoggerTest.java - * @run main PlatformLoggerTest + * @run main/othervm PlatformLoggerTest */ import java.util.logging.*; diff --git a/test/tools/launcher/Arrrghs.java b/test/tools/launcher/Arrrghs.java index 1db933833ea335f167b8e6a1c6e96d03996ea1e4..c9b82e7f6b71195a3f20eaeed9b5082929509bf8 100644 --- a/test/tools/launcher/Arrrghs.java +++ b/test/tools/launcher/Arrrghs.java @@ -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/test/tools/launcher/ClassPathWildCard.sh b/test/tools/launcher/ClassPathWildCard.sh index c6b57d4b8d9ef6752111080a76f0f42177db5d89..78c03c8a5741cffc3a01964e4ae08ca11782603a 100644 --- a/test/tools/launcher/ClassPathWildCard.sh +++ b/test/tools/launcher/ClassPathWildCard.sh @@ -6,7 +6,7 @@ # @author Kumar Srinivasan # -# 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/tools/launcher/MiscTests.java b/test/tools/launcher/MiscTests.java index 1d7fcf9514b324d7a9f74332400b7477b3ec1abc..55d3e8b44e2ecd4912ffc8d5fa42fb1fcafe2fef 100644 --- a/test/tools/launcher/MiscTests.java +++ b/test/tools/launcher/MiscTests.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/tools/pack200/CommandLineTests.java b/test/tools/pack200/CommandLineTests.java index fefefd2a8608e84c6e3903c9ece418b85030d6c3..74a1524fa39a631f54947333527084b4b9b040eb 100644 --- a/test/tools/pack200/CommandLineTests.java +++ b/test/tools/pack200/CommandLineTests.java @@ -120,9 +120,9 @@ public class CommandLineTests { // make a backup copy for re-use File bakFile = new File(f.getName() + ".bak"); if (!bakFile.exists()) { // backup - Utils.copyFile(f.getAbsoluteFile(), bakFile.getAbsoluteFile()); + Utils.copyFile(f, bakFile); } else { // restore - Utils.copyFile(bakFile.getAbsoluteFile(), f.getAbsoluteFile()); + Utils.copyFile(bakFile, f); } cmdsList.clear(); cmdsList.add(Utils.getPack200Cmd()); diff --git a/test/tools/pack200/TimeStamp.java b/test/tools/pack200/TimeStamp.java index 3d099e2141c74b4ada6a10114aeb46342d4b1e25..aa82fbb4e16b5a99501fd4312263956de3b853bc 100644 --- a/test/tools/pack200/TimeStamp.java +++ b/test/tools/pack200/TimeStamp.java @@ -56,7 +56,7 @@ public class TimeStamp { // make a local copy of our test file File srcFile = Utils.locateJar("golden.jar"); File goldenFile = new File("golden.jar"); - Utils.copyFile(srcFile, goldenFile.getAbsoluteFile()); + Utils.copyFile(srcFile, goldenFile); JarFile goldenJarFile = new JarFile(goldenFile); File packFile = new File("golden.pack"); diff --git a/test/tools/pack200/Utils.java b/test/tools/pack200/Utils.java index 5cf7663d201a2bdd53ad57ad5c0058c0f4e2114a..53c1a1baa0b9ccb7c0e52d16cc3465edc288deb4 100644 --- a/test/tools/pack200/Utils.java +++ b/test/tools/pack200/Utils.java @@ -21,18 +21,18 @@ * questions. */ +import java.nio.file.Path; import java.io.BufferedReader; import java.io.ByteArrayOutputStream; import java.io.Closeable; import java.io.File; import java.io.FileFilter; -import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.PrintStream; -import java.nio.channels.FileChannel; +import java.nio.file.Files; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; @@ -44,6 +44,8 @@ import java.util.jar.Pack200; import java.util.zip.ZipEntry; import java.util.zip.ZipFile; +import static java.nio.file.StandardCopyOption.*; + /** * * @author ksrini @@ -180,45 +182,12 @@ class Utils { } }; - private static void setFileAttributes(File src, File dst) throws IOException { - dst.setExecutable(src.canExecute()); - dst.setReadable(src.canRead()); - dst.setWritable(src.canWrite()); - dst.setLastModified(src.lastModified()); - } - static void copyFile(File src, File dst) throws IOException { - if (src.isDirectory()) { - dst.mkdirs(); - setFileAttributes(src, dst); - return; - } else { - File baseDirFile = dst.getParentFile(); - if (!baseDirFile.exists()) { - baseDirFile.mkdirs(); - } - } - FileInputStream in = null; - FileOutputStream out = null; - FileChannel srcChannel = null; - FileChannel dstChannel = null; - try { - in = new FileInputStream(src); - out = new FileOutputStream(dst); - srcChannel = in.getChannel(); - dstChannel = out.getChannel(); - - long retval = srcChannel.transferTo(0, src.length(), dstChannel); - if (src.length() != dst.length()) { - throw new IOException("file copy failed for " + src); - } - } finally { - close(srcChannel); - close(dstChannel); - close(in); - close(out); + Path parent = dst.toPath().getParent(); + if (parent != null) { + Files.createDirectories(parent); } - setFileAttributes(src, dst); + Files.copy(src.toPath(), dst.toPath(), COPY_ATTRIBUTES, REPLACE_EXISTING); } static String baseName(File file, String extension) {