From 4a47ea2602921c35d83d75351dd853d8d904a389 Mon Sep 17 00:00:00 2001 From: Volker Simonis Date: Tue, 2 Jul 2013 17:38:40 -0700 Subject: [PATCH 001/377] 8017568: PPC64: Generic build preparations needed to enable new build on Linux/PPC64 Enable new build on Linux/PPC64 Reviewed-by: erikj --- jdk/makefiles/CompileLaunchers.gmk | 31 ++++++++++-- jdk/makefiles/CompileNativeLibraries.gmk | 17 +++++-- .../mapfiles/launchers/mapfile-ppc64 | 39 +++++++++++++++ .../launchers/mapfile-ppc64.anonymous | 40 +++++++++++++++ .../mapfiles/launchers/mapfile-x86.anonymous | 49 +++++++++++++++++++ .../launchers/mapfile-x86_64.anonymous | 40 +++++++++++++++ .../mapfile-vers-unpack200.anonymous | 34 +++++++++++++ jdk/src/solaris/bin/ppc64/jvm.cfg | 33 +++++++++++++ 8 files changed, 273 insertions(+), 10 deletions(-) create mode 100644 jdk/makefiles/mapfiles/launchers/mapfile-ppc64 create mode 100644 jdk/makefiles/mapfiles/launchers/mapfile-ppc64.anonymous create mode 100644 jdk/makefiles/mapfiles/launchers/mapfile-x86.anonymous create mode 100644 jdk/makefiles/mapfiles/launchers/mapfile-x86_64.anonymous create mode 100644 jdk/makefiles/mapfiles/libunpack/mapfile-vers-unpack200.anonymous create mode 100644 jdk/src/solaris/bin/ppc64/jvm.cfg diff --git a/jdk/makefiles/CompileLaunchers.gmk b/jdk/makefiles/CompileLaunchers.gmk index 90348b6360f..cc7008eefa3 100644 --- a/jdk/makefiles/CompileLaunchers.gmk +++ b/jdk/makefiles/CompileLaunchers.gmk @@ -23,7 +23,7 @@ # questions. # -defalt: all +default: all include $(SPEC) include MakeBase.gmk @@ -128,10 +128,21 @@ define SetupLauncher $1_CFLAGS:=$(filter-out -MD,$(CFLAGS_JDKEXE)) endif - ifneq ($(wildcard $(JDK_TOPDIR)/makefiles/mapfiles/launchers/mapfile-$(OPENJDK_TARGET_CPU)),) - $1_MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/launchers/mapfile-$(OPENJDK_TARGET_CPU) + # The linker on older SuSE distros (e.g. on SLES 10) complains with: + # "Invalid version tag `SUNWprivate_1.1'. Only anonymous version tag is allowed in executable." + # if feeded with a version script which contains named tags. + ifeq ($(USING_BROKEN_SUSE_LD),yes) + ifneq ($(wildcard $(JDK_TOPDIR)/makefiles/mapfiles/launchers/mapfile-$(OPENJDK_TARGET_CPU).anonymous),) + $1_MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/launchers/mapfile-$(OPENJDK_TARGET_CPU).anonymous + else + $1_MAPFILE:= + endif else - $1_MAPFILE:= + ifneq ($(wildcard $(JDK_TOPDIR)/makefiles/mapfiles/launchers/mapfile-$(OPENJDK_TARGET_CPU)),) + $1_MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/launchers/mapfile-$(OPENJDK_TARGET_CPU) + else + $1_MAPFILE:= + endif endif $(call SetupNativeCompilation,BUILD_LAUNCHER_$1,\ @@ -448,6 +459,16 @@ ifeq ($(OPENJDK_TARGET_OS),windows) EXE_OUT_OPTION_save:=$(EXE_OUT_OPTION) EXE_OUT_OPTION:=-Fe endif + +# The linker on older SuSE distros (e.g. on SLES 10) complains with: +# "Invalid version tag `SUNWprivate_1.1'. Only anonymous version tag is allowed in executable." +# if feeded with a version script which contains named tags. +ifeq ($(USING_BROKEN_SUSE_LD),yes) + UNPACK_MAPFILE=$(JDK_TOPDIR)/makefiles/mapfiles/libunpack/mapfile-vers-unpack200.anonymous +else + UNPACK_MAPFILE=$(JDK_TOPDIR)/makefiles/mapfiles/libunpack/mapfile-vers-unpack200 +endif + $(eval $(call SetupNativeCompilation,BUILD_UNPACKEXE,\ SRC:=$(JDK_TOPDIR)/src/share/native/com/sun/java/util/jar/pack,\ EXCLUDE_FILES:=jni.cpp,\ @@ -459,7 +480,7 @@ $(eval $(call SetupNativeCompilation,BUILD_UNPACKEXE,\ CFLAGS_linux:=-fPIC,\ CFLAGS_solaris:=-KPIC, \ CFLAGS_macosx:=-fPIC, \ - MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libunpack/mapfile-vers-unpack200,\ + MAPFILE:=$(UNPACK_MAPFILE),\ LDFLAGS:=$(UNPACKEXE_ZIPOBJS),\ LDFLAGS_windows:=$(CXXFLAGS_JDKEXE),\ LDFLAGS_posix:=$(LDFLAGS_JDKEXE) $(LDFLAGS_CXX_JDK) \ diff --git a/jdk/makefiles/CompileNativeLibraries.gmk b/jdk/makefiles/CompileNativeLibraries.gmk index 4fcb6e84695..68a36e90640 100644 --- a/jdk/makefiles/CompileNativeLibraries.gmk +++ b/jdk/makefiles/CompileNativeLibraries.gmk @@ -23,7 +23,7 @@ # questions. # -defalt: all +default: all include $(SPEC) include MakeBase.gmk @@ -2478,11 +2478,14 @@ ifeq ($(OPENJDK_TARGET_OS), macosx) -framework Cocoa \ -F/System/Library/Frameworks/JavaVM.framework/Frameworks \ -framework JavaNativeFoundation -else ifneq ($(OPENJDK_TARGET_OS), windows) - LIBSPLASHSCREEN_LDFLAGS_SUFFIX += -L$(OPENWIN_LIB)$(OPENJDK_TARGET_CPU_ISADIR) -lX11 -lXext $(LIBM) -lpthread -else # OPENJDK_TARGET_OS +else ifeq ($(OPENJDK_TARGET_OS), windows) LIBSPLASHSCREEN_LDFLAGS_SUFFIX += kernel32.lib user32.lib gdi32.lib delayimp.lib -DELAYLOAD:user32.dll -endif # OPENJDK_TARGET_OS +else ifeq ($(OPENJDK_TARGET_OS), solaris) + # Solaris still uses OPENWIN_LIB .. + LIBSPLASHSCREEN_LDFLAGS_SUFFIX += -L$(OPENWIN_LIB)$(OPENJDK_TARGET_CPU_ISADIR) -lX11 -lXext $(LIBM) -lpthread +else # .. all other Unixes can use X_LIBS + LIBSPLASHSCREEN_LDFLAGS_SUFFIX += $(X_LIBS) -lX11 -lXext $(LIBM) -lpthread +endif $(eval $(call SetupNativeCompilation,LIBSPLASHSCREEN,\ LIBRARY:=splashscreen,\ @@ -2862,6 +2865,10 @@ else ifeq ($(OPENJDK_TARGET_CPU), ppc) LIBJSOUND_CFLAGS += -DX_ARCH=X_PPC endif + + ifeq ($(OPENJDK_TARGET_CPU), ppc64) + LIBJSOUND_CFLAGS += -DX_ARCH=X_PPC64 + endif endif LIBJSOUND_CFLAGS += -DEXTRA_SOUND_JNI_LIBS='"$(EXTRA_SOUND_JNI_LIBS)"' diff --git a/jdk/makefiles/mapfiles/launchers/mapfile-ppc64 b/jdk/makefiles/mapfiles/launchers/mapfile-ppc64 new file mode 100644 index 00000000000..fb4ceb5cd3a --- /dev/null +++ b/jdk/makefiles/mapfiles/launchers/mapfile-ppc64 @@ -0,0 +1,39 @@ +# +# Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved. +# 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. +# +# +# Specify what global symbols we export. Note that we're not really +# interested in declaring a version, simply scoping the file is sufficient. +# + +SUNWprivate_1.1 { + global: + main; # Provides basic adb symbol offsets + environ; # Public symbols and required by Java run time + _environ; + __environ_lock; + + local: + *; +}; diff --git a/jdk/makefiles/mapfiles/launchers/mapfile-ppc64.anonymous b/jdk/makefiles/mapfiles/launchers/mapfile-ppc64.anonymous new file mode 100644 index 00000000000..4fcde94d1d8 --- /dev/null +++ b/jdk/makefiles/mapfiles/launchers/mapfile-ppc64.anonymous @@ -0,0 +1,40 @@ +# +# Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved. +# 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. +# +# +# Define anonymous library interface (i.e. without a version tag) for broken SuSE ld because +# the linker on older SuSE distros (e.g. on SLES 10) complains with: +# "Invalid version tag `SUNWprivate_1.1'. Only anonymous version tag is allowed in executable." +# if feeded with a version script which contains named tags. + +{ + global: + main; # Provides basic adb symbol offsets + environ; # Public symbols and required by Java run time + _environ; + __environ_lock; + + local: + *; +}; diff --git a/jdk/makefiles/mapfiles/launchers/mapfile-x86.anonymous b/jdk/makefiles/mapfiles/launchers/mapfile-x86.anonymous new file mode 100644 index 00000000000..49032cd10df --- /dev/null +++ b/jdk/makefiles/mapfiles/launchers/mapfile-x86.anonymous @@ -0,0 +1,49 @@ +# +# Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved. +# 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. +# +# +# Define anonymous library interface (i.e. without a version tag) for broken SuSE ld because +# the linker on older SuSE distros (e.g. on SLES 10) complains with: +# "Invalid version tag `SUNWprivate_1.1'. Only anonymous version tag is allowed in executable." +# if feeded with a version script which contains named tags. + +{ + global: + main; # Provides basic adb symbol offsets + environ; # Public symbols and required by Java run time + _environ; + __environ_lock; + ___Argv; # The following are private, but as they are + _start; # exported from ctr1/crtn, the clever hacker + _init; # might know about them. However note, that + _fini; # their use is strictly not supported. + _lib_version; +# _mcount; + __fsr; + __fsr_init_value; + __longdouble_used; + + local: + *; +}; diff --git a/jdk/makefiles/mapfiles/launchers/mapfile-x86_64.anonymous b/jdk/makefiles/mapfiles/launchers/mapfile-x86_64.anonymous new file mode 100644 index 00000000000..4fcde94d1d8 --- /dev/null +++ b/jdk/makefiles/mapfiles/launchers/mapfile-x86_64.anonymous @@ -0,0 +1,40 @@ +# +# Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved. +# 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. +# +# +# Define anonymous library interface (i.e. without a version tag) for broken SuSE ld because +# the linker on older SuSE distros (e.g. on SLES 10) complains with: +# "Invalid version tag `SUNWprivate_1.1'. Only anonymous version tag is allowed in executable." +# if feeded with a version script which contains named tags. + +{ + global: + main; # Provides basic adb symbol offsets + environ; # Public symbols and required by Java run time + _environ; + __environ_lock; + + local: + *; +}; diff --git a/jdk/makefiles/mapfiles/libunpack/mapfile-vers-unpack200.anonymous b/jdk/makefiles/mapfiles/libunpack/mapfile-vers-unpack200.anonymous new file mode 100644 index 00000000000..7f3a07934bd --- /dev/null +++ b/jdk/makefiles/mapfiles/libunpack/mapfile-vers-unpack200.anonymous @@ -0,0 +1,34 @@ +# +# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. +# 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. +# + +# Define anonymous library interface (i.e. without a version tag) for broken SuSE ld because +# the linker on older SuSE distros (e.g. on SLES 10) complains with: +# "Invalid version tag `SUNWprivate_1.1'. Only anonymous version tag is allowed in executable." +# if feeded with a version script which contains named tags. + +{ + local: + *; +}; diff --git a/jdk/src/solaris/bin/ppc64/jvm.cfg b/jdk/src/solaris/bin/ppc64/jvm.cfg new file mode 100644 index 00000000000..2fc1214175b --- /dev/null +++ b/jdk/src/solaris/bin/ppc64/jvm.cfg @@ -0,0 +1,33 @@ +# 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. +# +-server KNOWN From d42579b6478c6aa848efdee4f9845eb5f3be5e80 Mon Sep 17 00:00:00 2001 From: Weijun Wang Date: Fri, 16 Aug 2013 17:57:27 +0800 Subject: [PATCH 002/377] 8022945: Enhance JNDI implementation classes Reviewed-by: xuelei, ahgross, skoivu --- jdk/src/share/lib/security/java.security-linux | 2 ++ jdk/src/share/lib/security/java.security-macosx | 2 ++ jdk/src/share/lib/security/java.security-solaris | 2 ++ jdk/src/share/lib/security/java.security-windows | 2 ++ jdk/test/java/lang/SecurityManager/CheckPackageAccess.java | 3 ++- 5 files changed, 10 insertions(+), 1 deletion(-) diff --git a/jdk/src/share/lib/security/java.security-linux b/jdk/src/share/lib/security/java.security-linux index 935a10fc00a..0204b5d682c 100644 --- a/jdk/src/share/lib/security/java.security-linux +++ b/jdk/src/share/lib/security/java.security-linux @@ -181,6 +181,7 @@ package.access=sun.,\ com.sun.imageio.,\ com.sun.istack.internal.,\ com.sun.jmx.,\ + com.sun.naming.internal.,\ com.sun.proxy.,\ com.sun.org.apache.bcel.internal.,\ com.sun.org.apache.regexp.internal.,\ @@ -225,6 +226,7 @@ package.definition=sun.,\ com.sun.imageio.,\ com.sun.istack.internal.,\ com.sun.jmx.,\ + com.sun.naming.internal.,\ com.sun.proxy.,\ com.sun.org.apache.bcel.internal.,\ com.sun.org.apache.regexp.internal.,\ diff --git a/jdk/src/share/lib/security/java.security-macosx b/jdk/src/share/lib/security/java.security-macosx index c30834ad220..375c6d7aaf2 100644 --- a/jdk/src/share/lib/security/java.security-macosx +++ b/jdk/src/share/lib/security/java.security-macosx @@ -182,6 +182,7 @@ package.access=sun.,\ com.sun.imageio.,\ com.sun.istack.internal.,\ com.sun.jmx.,\ + com.sun.naming.internal.,\ com.sun.proxy.,\ com.sun.org.apache.bcel.internal.,\ com.sun.org.apache.regexp.internal.,\ @@ -226,6 +227,7 @@ package.definition=sun.,\ com.sun.imageio.,\ com.sun.istack.internal.,\ com.sun.jmx.,\ + com.sun.naming.internal.,\ com.sun.proxy.,\ com.sun.org.apache.bcel.internal.,\ com.sun.org.apache.regexp.internal.,\ diff --git a/jdk/src/share/lib/security/java.security-solaris b/jdk/src/share/lib/security/java.security-solaris index 35414ba9244..234ed1018f4 100644 --- a/jdk/src/share/lib/security/java.security-solaris +++ b/jdk/src/share/lib/security/java.security-solaris @@ -183,6 +183,7 @@ package.access=sun.,\ com.sun.imageio.,\ com.sun.istack.internal.,\ com.sun.jmx.,\ + com.sun.naming.internal.,\ com.sun.proxy.,\ com.sun.org.apache.bcel.internal.,\ com.sun.org.apache.regexp.internal.,\ @@ -226,6 +227,7 @@ package.definition=sun.,\ com.sun.imageio.,\ com.sun.istack.internal.,\ com.sun.jmx.,\ + com.sun.naming.internal.,\ com.sun.proxy.,\ com.sun.org.apache.bcel.internal.,\ com.sun.org.apache.regexp.internal.,\ diff --git a/jdk/src/share/lib/security/java.security-windows b/jdk/src/share/lib/security/java.security-windows index 88293ad60da..81da2f262ca 100644 --- a/jdk/src/share/lib/security/java.security-windows +++ b/jdk/src/share/lib/security/java.security-windows @@ -182,6 +182,7 @@ package.access=sun.,\ com.sun.imageio.,\ com.sun.istack.internal.,\ com.sun.jmx.,\ + com.sun.naming.internal.,\ com.sun.proxy.,\ com.sun.org.apache.bcel.internal.,\ com.sun.org.apache.regexp.internal.,\ @@ -226,6 +227,7 @@ package.definition=sun.,\ com.sun.imageio.,\ com.sun.istack.internal.,\ com.sun.jmx.,\ + com.sun.naming.internal.,\ com.sun.proxy.,\ com.sun.org.apache.bcel.internal.,\ com.sun.org.apache.regexp.internal.,\ diff --git a/jdk/test/java/lang/SecurityManager/CheckPackageAccess.java b/jdk/test/java/lang/SecurityManager/CheckPackageAccess.java index 7167bbb96c8..4f848d51caf 100644 --- a/jdk/test/java/lang/SecurityManager/CheckPackageAccess.java +++ b/jdk/test/java/lang/SecurityManager/CheckPackageAccess.java @@ -23,7 +23,7 @@ /* * @test - * @bug 6741606 7146431 8000450 + * @bug 6741606 7146431 8000450 8022945 * @summary Make sure all restricted packages listed in the package.access * property in the java.security file are blocked * @run main/othervm CheckPackageAccess @@ -54,6 +54,7 @@ public class CheckPackageAccess { "com.sun.imageio.", "com.sun.istack.internal.", "com.sun.jmx.", + "com.sun.naming.internal.", "com.sun.proxy.", "com.sun.org.apache.bcel.internal.", "com.sun.org.apache.regexp.internal.", From 1ea2a0ba0504f779d451371f5b16f06d5c81339c Mon Sep 17 00:00:00 2001 From: Lance Andersen Date: Wed, 21 Aug 2013 11:05:49 -0400 Subject: [PATCH 003/377] 8022904: Enhance JDBC Parsers Reviewed-by: alanb, skoivu --- .../internal/XmlReaderContentHandler.java | 4 +-- .../javax/sql/rowset/spi/SyncFactory.java | 25 +++++++++++++++++-- 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/jdk/src/share/classes/com/sun/rowset/internal/XmlReaderContentHandler.java b/jdk/src/share/classes/com/sun/rowset/internal/XmlReaderContentHandler.java index 5c30d2712f4..31d714187aa 100644 --- a/jdk/src/share/classes/com/sun/rowset/internal/XmlReaderContentHandler.java +++ b/jdk/src/share/classes/com/sun/rowset/internal/XmlReaderContentHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -660,7 +660,7 @@ public class XmlReaderContentHandler extends DefaultHandler { //Added the handling for Class tags to take care of maps //Makes an entry into the map upon end of class tag try{ - typeMap.put(Key_map,Class.forName(Value_map)); + typeMap.put(Key_map,sun.reflect.misc.ReflectUtil.forName(Value_map)); }catch(ClassNotFoundException ex) { throw new SAXException(MessageFormat.format(resBundle.handleGetObject("xmlrch.errmap").toString(), ex.getMessage())); diff --git a/jdk/src/share/classes/javax/sql/rowset/spi/SyncFactory.java b/jdk/src/share/classes/javax/sql/rowset/spi/SyncFactory.java index 6797dc0d397..308d1beef49 100644 --- a/jdk/src/share/classes/javax/sql/rowset/spi/SyncFactory.java +++ b/jdk/src/share/classes/javax/sql/rowset/spi/SyncFactory.java @@ -35,6 +35,8 @@ import java.io.FileInputStream; import java.io.InputStream; import java.io.IOException; import java.io.FileNotFoundException; +import java.security.AccessController; +import java.security.PrivilegedAction; import javax.naming.*; @@ -348,7 +350,17 @@ public class SyncFactory { /* * Dependent on application */ - String strRowsetProperties = System.getProperty("rowset.properties"); + String strRowsetProperties; + try { + strRowsetProperties = AccessController.doPrivileged(new PrivilegedAction() { + public String run() { + return System.getProperty("rowset.properties"); + } + }, null, new PropertyPermission("rowset.properties","read")); + } catch (Exception ex) { + strRowsetProperties = null; + } + if (strRowsetProperties != null) { // Load user's implementation of SyncProvider // here. -Drowset.properties=/abc/def/pqr.txt @@ -393,7 +405,16 @@ public class SyncFactory { * load additional properties from -D command line */ properties.clear(); - String providerImpls = System.getProperty(ROWSET_SYNC_PROVIDER); + String providerImpls; + try { + providerImpls = AccessController.doPrivileged(new PrivilegedAction() { + public String run() { + return System.getProperty(ROWSET_SYNC_PROVIDER); + } + }, null, new PropertyPermission(ROWSET_SYNC_PROVIDER,"read")); + } catch (Exception ex) { + providerImpls = null; + } if (providerImpls != null) { int i = 0; From 064c1ddaa7caafba8444709e5291a5b1627eb58e Mon Sep 17 00:00:00 2001 From: Valerie Peng Date: Wed, 21 Aug 2013 11:40:07 -0700 Subject: [PATCH 004/377] 8022927: Input validation for byte/endian conversions Add additional boundary checks Reviewed-by: ascarpino --- .../security/provider/ByteArrayAccess.java | 51 ++++++++++++++++--- 1 file changed, 45 insertions(+), 6 deletions(-) diff --git a/jdk/src/share/classes/sun/security/provider/ByteArrayAccess.java b/jdk/src/share/classes/sun/security/provider/ByteArrayAccess.java index 1c7641372ab..e06832bf3c6 100644 --- a/jdk/src/share/classes/sun/security/provider/ByteArrayAccess.java +++ b/jdk/src/share/classes/sun/security/provider/ByteArrayAccess.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -43,10 +43,8 @@ import sun.misc.Unsafe; * These are the only platforms we currently support, but other optimized * variants could be added as needed. * - * NOTE that because this code performs unchecked direct memory access, it - * MUST be restricted to trusted code. It is imperative that the caller protects - * against out of bounds memory access by performing the necessary bounds - * checks before calling methods in this class. + * NOTE that ArrayIndexOutOfBoundsException will be thrown if the bounds checks + * failed. * * This class may also be helpful in improving the performance of the * crypto code in the SunJCE provider. However, for now it is only accessible by @@ -103,6 +101,10 @@ final class ByteArrayAccess { * byte[] to int[] conversion, little endian byte order. */ static void b2iLittle(byte[] in, int inOfs, int[] out, int outOfs, int len) { + if ((inOfs < 0) || ((in.length - inOfs) < len) || + (outOfs < 0) || ((out.length - outOfs) < len/4)) { + throw new ArrayIndexOutOfBoundsException(); + } if (littleEndianUnaligned) { inOfs += byteArrayOfs; len += inOfs; @@ -131,6 +133,10 @@ final class ByteArrayAccess { // Special optimization of b2iLittle(in, inOfs, out, 0, 64) static void b2iLittle64(byte[] in, int inOfs, int[] out) { + if ((inOfs < 0) || ((in.length - inOfs) < 64) || + (out.length < 16)) { + throw new ArrayIndexOutOfBoundsException(); + } if (littleEndianUnaligned) { inOfs += byteArrayOfs; out[ 0] = unsafe.getInt(in, (long)(inOfs )); @@ -176,6 +182,10 @@ final class ByteArrayAccess { * int[] to byte[] conversion, little endian byte order. */ static void i2bLittle(int[] in, int inOfs, byte[] out, int outOfs, int len) { + if ((inOfs < 0) || ((in.length - inOfs) < len/4) || + (outOfs < 0) || ((out.length - outOfs) < len)) { + throw new ArrayIndexOutOfBoundsException(); + } if (littleEndianUnaligned) { outOfs += byteArrayOfs; len += outOfs; @@ -204,6 +214,9 @@ final class ByteArrayAccess { // Store one 32-bit value into out[outOfs..outOfs+3] in little endian order. static void i2bLittle4(int val, byte[] out, int outOfs) { + if ((outOfs < 0) || ((out.length - outOfs) < 4)) { + throw new ArrayIndexOutOfBoundsException(); + } if (littleEndianUnaligned) { unsafe.putInt(out, (long)(byteArrayOfs + outOfs), val); } else if (bigEndian && ((outOfs & 3) == 0)) { @@ -220,6 +233,10 @@ final class ByteArrayAccess { * byte[] to int[] conversion, big endian byte order. */ static void b2iBig(byte[] in, int inOfs, int[] out, int outOfs, int len) { + if ((inOfs < 0) || ((in.length - inOfs) < len) || + (outOfs < 0) || ((out.length - outOfs) < len/4)) { + throw new ArrayIndexOutOfBoundsException(); + } if (littleEndianUnaligned) { inOfs += byteArrayOfs; len += inOfs; @@ -248,6 +265,10 @@ final class ByteArrayAccess { // Special optimization of b2iBig(in, inOfs, out, 0, 64) static void b2iBig64(byte[] in, int inOfs, int[] out) { + if ((inOfs < 0) || ((in.length - inOfs) < 64) || + (out.length < 16)) { + throw new ArrayIndexOutOfBoundsException(); + } if (littleEndianUnaligned) { inOfs += byteArrayOfs; out[ 0] = reverseBytes(unsafe.getInt(in, (long)(inOfs ))); @@ -293,6 +314,10 @@ final class ByteArrayAccess { * int[] to byte[] conversion, big endian byte order. */ static void i2bBig(int[] in, int inOfs, byte[] out, int outOfs, int len) { + if ((inOfs < 0) || ((in.length - inOfs) < len/4) || + (outOfs < 0) || ((out.length - outOfs) < len)) { + throw new ArrayIndexOutOfBoundsException(); + } if (littleEndianUnaligned) { outOfs += byteArrayOfs; len += outOfs; @@ -321,6 +346,9 @@ final class ByteArrayAccess { // Store one 32-bit value into out[outOfs..outOfs+3] in big endian order. static void i2bBig4(int val, byte[] out, int outOfs) { + if ((outOfs < 0) || ((out.length - outOfs) < 4)) { + throw new ArrayIndexOutOfBoundsException(); + } if (littleEndianUnaligned) { unsafe.putInt(out, (long)(byteArrayOfs + outOfs), reverseBytes(val)); } else if (bigEndian && ((outOfs & 3) == 0)) { @@ -337,6 +365,10 @@ final class ByteArrayAccess { * byte[] to long[] conversion, big endian byte order. */ static void b2lBig(byte[] in, int inOfs, long[] out, int outOfs, int len) { + if ((inOfs < 0) || ((in.length - inOfs) < len) || + (outOfs < 0) || ((out.length - outOfs) < len/8)) { + throw new ArrayIndexOutOfBoundsException(); + } if (littleEndianUnaligned) { inOfs += byteArrayOfs; len += inOfs; @@ -378,6 +410,10 @@ final class ByteArrayAccess { // Special optimization of b2lBig(in, inOfs, out, 0, 128) static void b2lBig128(byte[] in, int inOfs, long[] out) { + if ((inOfs < 0) || ((in.length - inOfs) < 128) || + (out.length < 16)) { + throw new ArrayIndexOutOfBoundsException(); + } if (littleEndianUnaligned) { inOfs += byteArrayOfs; out[ 0] = reverseBytes(unsafe.getLong(in, (long)(inOfs ))); @@ -406,6 +442,10 @@ final class ByteArrayAccess { * long[] to byte[] conversion, big endian byte order. */ static void l2bBig(long[] in, int inOfs, byte[] out, int outOfs, int len) { + if ((inOfs < 0) || ((in.length - inOfs) < len/8) || + (outOfs < 0) || ((out.length - outOfs) < len)) { + throw new ArrayIndexOutOfBoundsException(); + } len += outOfs; while (outOfs < len) { long i = in[inOfs++]; @@ -419,5 +459,4 @@ final class ByteArrayAccess { out[outOfs++] = (byte)(i ); } } - } From 75e0844f2a178fba27b0fa718f7737f6f0e8eb96 Mon Sep 17 00:00:00 2001 From: Andrew Brygin Date: Fri, 23 Aug 2013 12:41:53 +0400 Subject: [PATCH 005/377] 8021394: Better color profiles Reviewed-by: prr, vadim, mschoene --- .../native/sun/java2d/cmm/lcms/cmsintrp.c | 66 ++++++++----------- 1 file changed, 26 insertions(+), 40 deletions(-) diff --git a/jdk/src/share/native/sun/java2d/cmm/lcms/cmsintrp.c b/jdk/src/share/native/sun/java2d/cmm/lcms/cmsintrp.c index 183d2f84d01..51ec140cfbe 100644 --- a/jdk/src/share/native/sun/java2d/cmm/lcms/cmsintrp.c +++ b/jdk/src/share/native/sun/java2d/cmm/lcms/cmsintrp.c @@ -215,6 +215,11 @@ void LinLerp1D(register const cmsUInt16Number Value[], Output[0] = LinearInterp(rest, y0, y1); } +// To prevent out of bounds indexing +cmsINLINE cmsFloat32Number fclamp(cmsFloat32Number v) +{ + return v < 0.0f ? 0.0f : (v > 1.0f ? 1.0f : v); +} // Floating-point version of 1D interpolation static @@ -227,13 +232,15 @@ void LinLerp1Dfloat(const cmsFloat32Number Value[], int cell0, cell1; const cmsFloat32Number* LutTable = (cmsFloat32Number*) p ->Table; + val2 = fclamp(Value[0]); + // if last value... - if (Value[0] == 1.0) { + if (val2 == 1.0) { Output[0] = LutTable[p -> Domain[0]]; return; } - val2 = p -> Domain[0] * Value[0]; + val2 *= p -> Domain[0]; cell0 = (int) floor(val2); cell1 = (int) ceil(val2); @@ -292,13 +299,15 @@ void Eval1InputFloat(const cmsFloat32Number Value[], cmsUInt32Number OutChan; const cmsFloat32Number* LutTable = (cmsFloat32Number*) p ->Table; + val2 = fclamp(Value[0]); + // if last value... - if (Value[0] == 1.0) { + if (val2 == 1.0) { Output[0] = LutTable[p -> Domain[0]]; return; } - val2 = p -> Domain[0] * Value[0]; + val2 *= p -> Domain[0]; cell0 = (int) floor(val2); cell1 = (int) ceil(val2); @@ -339,8 +348,8 @@ void BilinearInterpFloat(const cmsFloat32Number Input[], dxy; TotalOut = p -> nOutputs; - px = Input[0] * p->Domain[0]; - py = Input[1] * p->Domain[1]; + px = fclamp(Input[0]) * p->Domain[0]; + py = fclamp(Input[1]) * p->Domain[1]; x0 = (int) _cmsQuickFloor(px); fx = px - (cmsFloat32Number) x0; y0 = (int) _cmsQuickFloor(py); fy = py - (cmsFloat32Number) y0; @@ -454,20 +463,9 @@ void TrilinearInterpFloat(const cmsFloat32Number Input[], TotalOut = p -> nOutputs; // We need some clipping here - px = Input[0]; - py = Input[1]; - pz = Input[2]; - - if (px < 0) px = 0; - if (px > 1) px = 1; - if (py < 0) py = 0; - if (py > 1) py = 1; - if (pz < 0) pz = 0; - if (pz > 1) pz = 1; - - px *= p->Domain[0]; - py *= p->Domain[1]; - pz *= p->Domain[2]; + px = fclamp(Input[0]) * p->Domain[0]; + py = fclamp(Input[1]) * p->Domain[1]; + pz = fclamp(Input[2]) * p->Domain[2]; x0 = (int) _cmsQuickFloor(px); fx = px - (cmsFloat32Number) x0; y0 = (int) _cmsQuickFloor(py); fy = py - (cmsFloat32Number) y0; @@ -609,20 +607,9 @@ void TetrahedralInterpFloat(const cmsFloat32Number Input[], TotalOut = p -> nOutputs; // We need some clipping here - px = Input[0]; - py = Input[1]; - pz = Input[2]; - - if (px < 0) px = 0; - if (px > 1) px = 1; - if (py < 0) py = 0; - if (py > 1) py = 1; - if (pz < 0) pz = 0; - if (pz > 1) pz = 1; - - px *= p->Domain[0]; - py *= p->Domain[1]; - pz *= p->Domain[2]; + px = fclamp(Input[0]) * p->Domain[0]; + py = fclamp(Input[1]) * p->Domain[1]; + pz = fclamp(Input[2]) * p->Domain[2]; x0 = (int) _cmsQuickFloor(px); rx = (px - (cmsFloat32Number) x0); y0 = (int) _cmsQuickFloor(py); ry = (py - (cmsFloat32Number) y0); @@ -1039,8 +1026,7 @@ void Eval4InputsFloat(const cmsFloat32Number Input[], cmsFloat32Number Tmp1[MAX_STAGE_CHANNELS], Tmp2[MAX_STAGE_CHANNELS]; cmsInterpParams p1; - - pk = Input[0] * p->Domain[0]; + pk = fclamp(Input[0]) * p->Domain[0]; k0 = _cmsQuickFloor(pk); rest = pk - (cmsFloat32Number) k0; @@ -1127,7 +1113,7 @@ void Eval5InputsFloat(const cmsFloat32Number Input[], cmsFloat32Number Tmp1[MAX_STAGE_CHANNELS], Tmp2[MAX_STAGE_CHANNELS]; cmsInterpParams p1; - pk = Input[0] * p->Domain[0]; + pk = fclamp(Input[0]) * p->Domain[0]; k0 = _cmsQuickFloor(pk); rest = pk - (cmsFloat32Number) k0; @@ -1214,7 +1200,7 @@ void Eval6InputsFloat(const cmsFloat32Number Input[], cmsFloat32Number Tmp1[MAX_STAGE_CHANNELS], Tmp2[MAX_STAGE_CHANNELS]; cmsInterpParams p1; - pk = Input[0] * p->Domain[0]; + pk = fclamp(Input[0]) * p->Domain[0]; k0 = _cmsQuickFloor(pk); rest = pk - (cmsFloat32Number) k0; @@ -1299,7 +1285,7 @@ void Eval7InputsFloat(const cmsFloat32Number Input[], cmsFloat32Number Tmp1[MAX_STAGE_CHANNELS], Tmp2[MAX_STAGE_CHANNELS]; cmsInterpParams p1; - pk = Input[0] * p->Domain[0]; + pk = fclamp(Input[0]) * p->Domain[0]; k0 = _cmsQuickFloor(pk); rest = pk - (cmsFloat32Number) k0; @@ -1384,7 +1370,7 @@ void Eval8InputsFloat(const cmsFloat32Number Input[], cmsFloat32Number Tmp1[MAX_STAGE_CHANNELS], Tmp2[MAX_STAGE_CHANNELS]; cmsInterpParams p1; - pk = Input[0] * p->Domain[0]; + pk = fclamp(Input[0]) * p->Domain[0]; k0 = _cmsQuickFloor(pk); rest = pk - (cmsFloat32Number) k0; From 21289e7c0b86a818a82ba175eb671059d35fddc7 Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Mon, 26 Aug 2013 21:08:58 -0700 Subject: [PATCH 006/377] 8022935: Enhance Apache resolver classes Reviewed-by: alanb, mchung, skoivu --- .../xml/internal/resolver/CatalogManager.java | 13 ++++----- .../resolver/readers/DOMCatalogReader.java | 27 +++++++++---------- .../resolver/readers/SAXCatalogReader.java | 27 +++++++++---------- 3 files changed, 29 insertions(+), 38 deletions(-) diff --git a/jaxp/src/com/sun/org/apache/xml/internal/resolver/CatalogManager.java b/jaxp/src/com/sun/org/apache/xml/internal/resolver/CatalogManager.java index 247bd40fdd0..ab8cd27c647 100644 --- a/jaxp/src/com/sun/org/apache/xml/internal/resolver/CatalogManager.java +++ b/jaxp/src/com/sun/org/apache/xml/internal/resolver/CatalogManager.java @@ -24,20 +24,17 @@ package com.sun.org.apache.xml.internal.resolver; import com.sun.org.apache.xerces.internal.utils.SecuritySupport; +import com.sun.org.apache.xml.internal.resolver.helpers.BootstrapResolver; +import com.sun.org.apache.xml.internal.resolver.helpers.Debug; import java.io.InputStream; - -import java.net.URL; import java.net.MalformedURLException; - +import java.net.URL; import java.util.MissingResourceException; import java.util.PropertyResourceBundle; import java.util.ResourceBundle; import java.util.StringTokenizer; import java.util.Vector; - -import com.sun.org.apache.xml.internal.resolver.helpers.Debug; -import com.sun.org.apache.xml.internal.resolver.helpers.BootstrapResolver; -import com.sun.org.apache.xml.internal.resolver.Catalog; +import sun.reflect.misc.ReflectUtil; /** * CatalogManager provides an interface to the catalog properties. @@ -687,7 +684,7 @@ public class CatalogManager { catalog = new Catalog(); } else { try { - catalog = (Catalog) Class.forName(catalogClassName).newInstance(); + catalog = (Catalog) ReflectUtil.forName(catalogClassName).newInstance(); } catch (ClassNotFoundException cnfe) { debug.message(1,"Catalog class named '" + catalogClassName diff --git a/jaxp/src/com/sun/org/apache/xml/internal/resolver/readers/DOMCatalogReader.java b/jaxp/src/com/sun/org/apache/xml/internal/resolver/readers/DOMCatalogReader.java index 68652decc09..c5740cb1c66 100644 --- a/jaxp/src/com/sun/org/apache/xml/internal/resolver/readers/DOMCatalogReader.java +++ b/jaxp/src/com/sun/org/apache/xml/internal/resolver/readers/DOMCatalogReader.java @@ -23,24 +23,21 @@ package com.sun.org.apache.xml.internal.resolver.readers; -import java.util.Hashtable; -import java.io.IOException; -import java.io.InputStream; -import java.net.URL; -import java.net.URLConnection; -import java.net.MalformedURLException; - -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.ParserConfigurationException; - import com.sun.org.apache.xml.internal.resolver.Catalog; import com.sun.org.apache.xml.internal.resolver.CatalogException; -import com.sun.org.apache.xml.internal.resolver.readers.CatalogReader; import com.sun.org.apache.xml.internal.resolver.helpers.Namespaces; - -import org.xml.sax.SAXException; +import java.io.IOException; +import java.io.InputStream; +import java.net.MalformedURLException; +import java.net.URL; +import java.net.URLConnection; +import java.util.Hashtable; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; import org.w3c.dom.*; +import org.xml.sax.SAXException; +import sun.reflect.misc.ReflectUtil; /** * A DOM-based CatalogReader. @@ -199,7 +196,7 @@ public class DOMCatalogReader implements CatalogReader { DOMCatalogParser domParser = null; try { - domParser = (DOMCatalogParser) Class.forName(domParserClass).newInstance(); + domParser = (DOMCatalogParser) ReflectUtil.forName(domParserClass).newInstance(); } catch (ClassNotFoundException cnfe) { catalog.getCatalogManager().debug.message(1, "Cannot load XML Catalog Parser class", domParserClass); throw new CatalogException(CatalogException.UNPARSEABLE); diff --git a/jaxp/src/com/sun/org/apache/xml/internal/resolver/readers/SAXCatalogReader.java b/jaxp/src/com/sun/org/apache/xml/internal/resolver/readers/SAXCatalogReader.java index 56a8303d03b..105cb7671ae 100644 --- a/jaxp/src/com/sun/org/apache/xml/internal/resolver/readers/SAXCatalogReader.java +++ b/jaxp/src/com/sun/org/apache/xml/internal/resolver/readers/SAXCatalogReader.java @@ -23,19 +23,21 @@ package com.sun.org.apache.xml.internal.resolver.readers; -import java.util.Hashtable; -import java.io.IOException; +import com.sun.org.apache.xml.internal.resolver.Catalog; +import com.sun.org.apache.xml.internal.resolver.CatalogException; +import com.sun.org.apache.xml.internal.resolver.CatalogManager; +import com.sun.org.apache.xml.internal.resolver.helpers.Debug; import java.io.FileNotFoundException; +import java.io.IOException; import java.io.InputStream; +import java.net.MalformedURLException; import java.net.URL; import java.net.URLConnection; -import java.net.MalformedURLException; import java.net.UnknownHostException; - +import java.util.Hashtable; import javax.xml.parsers.ParserConfigurationException; -import javax.xml.parsers.SAXParserFactory; import javax.xml.parsers.SAXParser; - +import javax.xml.parsers.SAXParserFactory; import org.xml.sax.AttributeList; import org.xml.sax.Attributes; import org.xml.sax.ContentHandler; @@ -45,12 +47,7 @@ import org.xml.sax.InputSource; import org.xml.sax.Locator; import org.xml.sax.Parser; import org.xml.sax.SAXException; - -import com.sun.org.apache.xml.internal.resolver.Catalog; -import com.sun.org.apache.xml.internal.resolver.CatalogManager; -import com.sun.org.apache.xml.internal.resolver.CatalogException; -import com.sun.org.apache.xml.internal.resolver.readers.CatalogReader; -import com.sun.org.apache.xml.internal.resolver.helpers.Debug; +import sun.reflect.misc.ReflectUtil; /** * A SAX-based CatalogReader. @@ -246,7 +243,7 @@ public class SAXCatalogReader implements CatalogReader, ContentHandler, Document } parser.parse(new InputSource(is), spHandler); } else { - Parser parser = (Parser) Class.forName(parserClass).newInstance(); + Parser parser = (Parser) ReflectUtil.forName(parserClass).newInstance(); parser.setDocumentHandler(this); if (bResolver != null) { parser.setEntityResolver(bResolver); @@ -352,7 +349,7 @@ public class SAXCatalogReader implements CatalogReader, ContentHandler, Document try { saxParser = (SAXCatalogParser) - Class.forName(saxParserClass).newInstance(); + ReflectUtil.forName(saxParserClass).newInstance(); saxParser.setCatalog(catalog); saxParser.startDocument(); @@ -413,7 +410,7 @@ public class SAXCatalogReader implements CatalogReader, ContentHandler, Document try { saxParser = (SAXCatalogParser) - Class.forName(saxParserClass).newInstance(); + ReflectUtil.forName(saxParserClass).newInstance(); saxParser.setCatalog(catalog); saxParser.startDocument(); From 8508d7f51c08245fa96cd1f6eb613765ba695232 Mon Sep 17 00:00:00 2001 From: Sergey Malenkov Date: Mon, 2 Sep 2013 11:41:21 +0400 Subject: [PATCH 007/377] 8023245: Enhance Beans decoding Reviewed-by: art, skoivu, alanb --- .../classes/com/sun/beans/decoder/DocumentHandler.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/jdk/src/share/classes/com/sun/beans/decoder/DocumentHandler.java b/jdk/src/share/classes/com/sun/beans/decoder/DocumentHandler.java index 4bbb8f4a201..84fbca4be39 100644 --- a/jdk/src/share/classes/com/sun/beans/decoder/DocumentHandler.java +++ b/jdk/src/share/classes/com/sun/beans/decoder/DocumentHandler.java @@ -29,6 +29,7 @@ import com.sun.beans.finder.ClassFinder; import java.beans.ExceptionListener; import java.io.IOException; +import java.io.StringReader; import java.lang.ref.Reference; import java.lang.ref.WeakReference; @@ -245,6 +246,14 @@ public final class DocumentHandler extends DefaultHandler { this.objects.add(object); } + /** + * Disables any external entities. + */ + @Override + public InputSource resolveEntity(String publicId, String systemId) { + return new InputSource(new StringReader("")); + } + /** * Prepares this handler to read objects from XML document. */ From 2656f6d603a029e66ea66b41e421014326945ff1 Mon Sep 17 00:00:00 2001 From: Albert Noll Date: Tue, 17 Dec 2013 08:31:06 +0100 Subject: [PATCH 008/377] 8029091: Bug in calculation of code cache sweeping interval Use signed data type so that no underflow can happen Reviewed-by: kvn, roland --- hotspot/src/share/vm/runtime/sweeper.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/hotspot/src/share/vm/runtime/sweeper.cpp b/hotspot/src/share/vm/runtime/sweeper.cpp index 9034428173e..5632889ed97 100644 --- a/hotspot/src/share/vm/runtime/sweeper.cpp +++ b/hotspot/src/share/vm/runtime/sweeper.cpp @@ -257,9 +257,14 @@ void NMethodSweeper::possibly_sweep() { // Large ReservedCodeCacheSize: (e.g., 256M + code Cache is 90% full). The formula // computes: (256 / 16) - 10 = 6. if (!_should_sweep) { - int time_since_last_sweep = _time_counter - _last_sweep; - double wait_until_next_sweep = (ReservedCodeCacheSize / (16 * M)) - time_since_last_sweep - - CodeCache::reverse_free_ratio(); + const int time_since_last_sweep = _time_counter - _last_sweep; + // ReservedCodeCacheSize has an 'unsigned' type. We need a 'signed' type for max_wait_time, + // since 'time_since_last_sweep' can be larger than 'max_wait_time'. If that happens using + // an unsigned type would cause an underflow (wait_until_next_sweep becomes a large positive + // value) that disables the intended periodic sweeps. + const int max_wait_time = ReservedCodeCacheSize / (16 * M); + double wait_until_next_sweep = max_wait_time - time_since_last_sweep - CodeCache::reverse_free_ratio(); + assert(wait_until_next_sweep <= (double)max_wait_time, "Calculation of code cache sweeper interval is incorrect"); if ((wait_until_next_sweep <= 0.0) || !CompileBroker::should_compile_new_jobs()) { _should_sweep = true; From 0679f774af3c10a90fc67ca0baa003a2ae9ae7a7 Mon Sep 17 00:00:00 2001 From: Albert Noll Date: Thu, 19 Dec 2013 06:09:16 +0100 Subject: [PATCH 009/377] 8026478: -XX:+VerifyAdapterSharing is broken Fix by considering all checks in StubRoutines Reviewed-by: kvn, twisti --- .../src/share/vm/runtime/sharedRuntime.cpp | 63 +++++++++---------- .../src/share/vm/runtime/sharedRuntime.hpp | 13 ++-- 2 files changed, 35 insertions(+), 41 deletions(-) diff --git a/hotspot/src/share/vm/runtime/sharedRuntime.cpp b/hotspot/src/share/vm/runtime/sharedRuntime.cpp index d963c352078..e4a2c0afebf 100644 --- a/hotspot/src/share/vm/runtime/sharedRuntime.cpp +++ b/hotspot/src/share/vm/runtime/sharedRuntime.cpp @@ -2382,7 +2382,7 @@ AdapterHandlerEntry* AdapterHandlerLibrary::get_adapter(methodHandle method) { ResourceMark rm; NOT_PRODUCT(int insts_size); - AdapterBlob* B = NULL; + AdapterBlob* new_adapter = NULL; AdapterHandlerEntry* entry = NULL; AdapterFingerPrint* fingerprint = NULL; { @@ -2414,7 +2414,8 @@ AdapterHandlerEntry* AdapterHandlerLibrary::get_adapter(methodHandle method) { #ifdef ASSERT AdapterHandlerEntry* shared_entry = NULL; - if (VerifyAdapterSharing && entry != NULL) { + // Start adapter sharing verification only after the VM is booted. + if (VerifyAdapterSharing && (entry != NULL)) { shared_entry = entry; entry = NULL; } @@ -2430,41 +2431,44 @@ AdapterHandlerEntry* AdapterHandlerLibrary::get_adapter(methodHandle method) { // Make a C heap allocated version of the fingerprint to store in the adapter fingerprint = new AdapterFingerPrint(total_args_passed, sig_bt); - // Create I2C & C2I handlers + // StubRoutines::code2() is initialized after this function can be called. As a result, + // VerifyAdapterCalls and VerifyAdapterSharing can fail if we re-use code that generated + // prior to StubRoutines::code2() being set. Checks refer to checks generated in an I2C + // stub that ensure that an I2C stub is called from an interpreter frame. + bool contains_all_checks = StubRoutines::code2() != NULL; + // Create I2C & C2I handlers BufferBlob* buf = buffer_blob(); // the temporary code buffer in CodeCache if (buf != NULL) { CodeBuffer buffer(buf); short buffer_locs[20]; buffer.insts()->initialize_shared_locs((relocInfo*)buffer_locs, sizeof(buffer_locs)/sizeof(relocInfo)); - MacroAssembler _masm(&buffer); + MacroAssembler _masm(&buffer); entry = SharedRuntime::generate_i2c2i_adapters(&_masm, total_args_passed, comp_args_on_stack, sig_bt, regs, fingerprint); - #ifdef ASSERT if (VerifyAdapterSharing) { if (shared_entry != NULL) { - assert(shared_entry->compare_code(buf->code_begin(), buffer.insts_size(), total_args_passed, sig_bt), - "code must match"); + assert(shared_entry->compare_code(buf->code_begin(), buffer.insts_size()), "code must match"); // Release the one just created and return the original _adapters->free_entry(entry); return shared_entry; } else { - entry->save_code(buf->code_begin(), buffer.insts_size(), total_args_passed, sig_bt); + entry->save_code(buf->code_begin(), buffer.insts_size()); } } #endif - B = AdapterBlob::create(&buffer); + new_adapter = AdapterBlob::create(&buffer); NOT_PRODUCT(insts_size = buffer.insts_size()); } - if (B == NULL) { + if (new_adapter == NULL) { // CodeCache is full, disable compilation // Ought to log this but compile log is only per compile thread // and we're some non descript Java thread. @@ -2472,7 +2476,7 @@ AdapterHandlerEntry* AdapterHandlerLibrary::get_adapter(methodHandle method) { CompileBroker::handle_full_code_cache(); return NULL; // Out of CodeCache space } - entry->relocate(B->content_begin()); + entry->relocate(new_adapter->content_begin()); #ifndef PRODUCT // debugging suppport if (PrintAdapterHandlers || PrintStubCode) { @@ -2491,22 +2495,25 @@ AdapterHandlerEntry* AdapterHandlerLibrary::get_adapter(methodHandle method) { } } #endif - - _adapters->add(entry); + // Add the entry only if the entry contains all required checks (see sharedRuntime_xxx.cpp) + // The checks are inserted only if -XX:+VerifyAdapterCalls is specified. + if (contains_all_checks || !VerifyAdapterCalls) { + _adapters->add(entry); + } } // Outside of the lock - if (B != NULL) { + if (new_adapter != NULL) { char blob_id[256]; jio_snprintf(blob_id, sizeof(blob_id), "%s(%s)@" PTR_FORMAT, - B->name(), + new_adapter->name(), fingerprint->as_string(), - B->content_begin()); - Forte::register_stub(blob_id, B->content_begin(), B->content_end()); + new_adapter->content_begin()); + Forte::register_stub(blob_id, new_adapter->content_begin(),new_adapter->content_end()); if (JvmtiExport::should_post_dynamic_code_generated()) { - JvmtiExport::post_dynamic_code_generated(blob_id, B->content_begin(), B->content_end()); + JvmtiExport::post_dynamic_code_generated(blob_id, new_adapter->content_begin(), new_adapter->content_end()); } } return entry; @@ -2538,7 +2545,6 @@ void AdapterHandlerEntry::deallocate() { delete _fingerprint; #ifdef ASSERT if (_saved_code) FREE_C_HEAP_ARRAY(unsigned char, _saved_code, mtCode); - if (_saved_sig) FREE_C_HEAP_ARRAY(Basictype, _saved_sig, mtCode); #endif } @@ -2547,26 +2553,19 @@ void AdapterHandlerEntry::deallocate() { // Capture the code before relocation so that it can be compared // against other versions. If the code is captured after relocation // then relative instructions won't be equivalent. -void AdapterHandlerEntry::save_code(unsigned char* buffer, int length, int total_args_passed, BasicType* sig_bt) { +void AdapterHandlerEntry::save_code(unsigned char* buffer, int length) { _saved_code = NEW_C_HEAP_ARRAY(unsigned char, length, mtCode); - _code_length = length; + _saved_code_length = length; memcpy(_saved_code, buffer, length); - _total_args_passed = total_args_passed; - _saved_sig = NEW_C_HEAP_ARRAY(BasicType, _total_args_passed, mtCode); - memcpy(_saved_sig, sig_bt, _total_args_passed * sizeof(BasicType)); } -bool AdapterHandlerEntry::compare_code(unsigned char* buffer, int length, int total_args_passed, BasicType* sig_bt) { - if (length != _code_length) { +bool AdapterHandlerEntry::compare_code(unsigned char* buffer, int length) { + if (length != _saved_code_length) { return false; } - for (int i = 0; i < length; i++) { - if (buffer[i] != _saved_code[i]) { - return false; - } - } - return true; + + return (memcmp(buffer, _saved_code, length) == 0) ? true : false; } #endif diff --git a/hotspot/src/share/vm/runtime/sharedRuntime.hpp b/hotspot/src/share/vm/runtime/sharedRuntime.hpp index 9641bbc7dd4..fe5c84fe748 100644 --- a/hotspot/src/share/vm/runtime/sharedRuntime.hpp +++ b/hotspot/src/share/vm/runtime/sharedRuntime.hpp @@ -612,9 +612,7 @@ class AdapterHandlerEntry : public BasicHashtableEntry { // Captures code and signature used to generate this adapter when // verifing adapter equivalence. unsigned char* _saved_code; - int _code_length; - BasicType* _saved_sig; - int _total_args_passed; + int _saved_code_length; #endif void init(AdapterFingerPrint* fingerprint, address i2c_entry, address c2i_entry, address c2i_unverified_entry) { @@ -624,9 +622,7 @@ class AdapterHandlerEntry : public BasicHashtableEntry { _c2i_unverified_entry = c2i_unverified_entry; #ifdef ASSERT _saved_code = NULL; - _code_length = 0; - _saved_sig = NULL; - _total_args_passed = 0; + _saved_code_length = 0; #endif } @@ -639,7 +635,6 @@ class AdapterHandlerEntry : public BasicHashtableEntry { address get_i2c_entry() const { return _i2c_entry; } address get_c2i_entry() const { return _c2i_entry; } address get_c2i_unverified_entry() const { return _c2i_unverified_entry; } - address base_address(); void relocate(address new_base); @@ -651,8 +646,8 @@ class AdapterHandlerEntry : public BasicHashtableEntry { #ifdef ASSERT // Used to verify that code generated for shared adapters is equivalent - void save_code(unsigned char* code, int length, int total_args_passed, BasicType* sig_bt); - bool compare_code(unsigned char* code, int length, int total_args_passed, BasicType* sig_bt); + void save_code (unsigned char* code, int length); + bool compare_code(unsigned char* code, int length); #endif //virtual void print_on(outputStream* st) const; DO NOT USE From 63f7ba0045eaaf3640dd934e3206af272718c842 Mon Sep 17 00:00:00 2001 From: Tobias Hartmann Date: Thu, 19 Dec 2013 14:08:02 +0100 Subject: [PATCH 010/377] 8025277: Add -XX: flag to print code cache sweeper statistics New diagnostic flag prints statistics about the code cache sweeper Reviewed-by: kvn --- hotspot/src/share/vm/runtime/globals.hpp | 3 ++ hotspot/src/share/vm/runtime/java.cpp | 11 +++++- hotspot/src/share/vm/runtime/sweeper.cpp | 34 +++++++++++++--- hotspot/src/share/vm/runtime/sweeper.hpp | 49 +++++++++++++----------- 4 files changed, 66 insertions(+), 31 deletions(-) diff --git a/hotspot/src/share/vm/runtime/globals.hpp b/hotspot/src/share/vm/runtime/globals.hpp index 4967eadd076..3f1155cd602 100644 --- a/hotspot/src/share/vm/runtime/globals.hpp +++ b/hotspot/src/share/vm/runtime/globals.hpp @@ -2531,6 +2531,9 @@ class CommandLineFlags { develop(bool, PrintMethodFlushing, false, \ "Print the nmethods being flushed") \ \ + diagnostic(bool, PrintMethodFlushingStatistics, false, \ + "print statistics about method flushing") \ + \ develop(bool, UseRelocIndex, false, \ "Use an index to speed random access to relocations") \ \ diff --git a/hotspot/src/share/vm/runtime/java.cpp b/hotspot/src/share/vm/runtime/java.cpp index a356157e4f9..f5fde748fd5 100644 --- a/hotspot/src/share/vm/runtime/java.cpp +++ b/hotspot/src/share/vm/runtime/java.cpp @@ -52,6 +52,7 @@ #include "runtime/memprofiler.hpp" #include "runtime/sharedRuntime.hpp" #include "runtime/statSampler.hpp" +#include "runtime/sweeper.hpp" #include "runtime/task.hpp" #include "runtime/thread.inline.hpp" #include "runtime/timer.hpp" @@ -217,9 +218,7 @@ AllocStats alloc_stats; // General statistics printing (profiling ...) - void print_statistics() { - #ifdef ASSERT if (CountRuntimeCalls) { @@ -315,6 +314,10 @@ void print_statistics() { CodeCache::print(); } + if (PrintMethodFlushingStatistics) { + NMethodSweeper::print(); + } + if (PrintCodeCache2) { MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag); CodeCache::print_internals(); @@ -382,6 +385,10 @@ void print_statistics() { CodeCache::print(); } + if (PrintMethodFlushingStatistics) { + NMethodSweeper::print(); + } + #ifdef COMPILER2 if (PrintPreciseBiasedLockingStatistics) { OptoRuntime::print_named_counters(); diff --git a/hotspot/src/share/vm/runtime/sweeper.cpp b/hotspot/src/share/vm/runtime/sweeper.cpp index 5632889ed97..d8d42be5b72 100644 --- a/hotspot/src/share/vm/runtime/sweeper.cpp +++ b/hotspot/src/share/vm/runtime/sweeper.cpp @@ -129,6 +129,7 @@ void NMethodSweeper::record_sweep(nmethod* nm, int line) { nmethod* NMethodSweeper::_current = NULL; // Current nmethod long NMethodSweeper::_traversals = 0; // Stack scan count, also sweep ID. +long NMethodSweeper::_total_nof_code_cache_sweeps = 0; // Total number of full sweeps of the code cache long NMethodSweeper::_time_counter = 0; // Virtual time used to periodically invoke sweeper long NMethodSweeper::_last_sweep = 0; // Value of _time_counter when the last sweep happened int NMethodSweeper::_seen = 0; // Nof. nmethod we have currently processed in current pass of CodeCache @@ -143,13 +144,16 @@ volatile int NMethodSweeper::_bytes_changed = 0; // Counts the tot // 1) alive -> not_entrant // 2) not_entrant -> zombie // 3) zombie -> marked_for_reclamation +int NMethodSweeper::_hotness_counter_reset_val = 0; + +long NMethodSweeper::_total_nof_methods_reclaimed = 0; // Accumulated nof methods flushed +long NMethodSweeper::_total_nof_c2_methods_reclaimed = 0; // Accumulated nof methods flushed +size_t NMethodSweeper::_total_flushed_size = 0; // Total number of bytes flushed from the code cache +Tickspan NMethodSweeper::_total_time_sweeping; // Accumulated time sweeping +Tickspan NMethodSweeper::_total_time_this_sweep; // Total time this sweep +Tickspan NMethodSweeper::_peak_sweep_time; // Peak time for a full sweep +Tickspan NMethodSweeper::_peak_sweep_fraction_time; // Peak time sweeping one fraction -int NMethodSweeper::_total_nof_methods_reclaimed = 0; // Accumulated nof methods flushed -Tickspan NMethodSweeper::_total_time_sweeping; // Accumulated time sweeping -Tickspan NMethodSweeper::_total_time_this_sweep; // Total time this sweep -Tickspan NMethodSweeper::_peak_sweep_time; // Peak time for a full sweep -Tickspan NMethodSweeper::_peak_sweep_fraction_time; // Peak time sweeping one fraction -int NMethodSweeper::_hotness_counter_reset_val = 0; class MarkActivationClosure: public CodeBlobClosure { @@ -292,6 +296,7 @@ void NMethodSweeper::possibly_sweep() { // We are done with sweeping the code cache once. if (_sweep_fractions_left == 0) { + _total_nof_code_cache_sweeps++; _last_sweep = _time_counter; // Reset flag; temporarily disables sweeper _should_sweep = false; @@ -378,6 +383,7 @@ void NMethodSweeper::sweep_code_cache() { _total_time_sweeping += sweep_time; _total_time_this_sweep += sweep_time; _peak_sweep_fraction_time = MAX2(sweep_time, _peak_sweep_fraction_time); + _total_flushed_size += freed_memory; _total_nof_methods_reclaimed += _flushed_count; EventSweepCodeCache event(UNTIMED); @@ -509,6 +515,9 @@ int NMethodSweeper::process_nmethod(nmethod *nm) { tty->print_cr("### Nmethod %3d/" PTR_FORMAT " (marked for reclamation) being flushed", nm->compile_id(), nm); } freed_memory = nm->total_size(); + if (nm->is_compiled_by_c2()) { + _total_nof_c2_methods_reclaimed++; + } release_nmethod(nm); _flushed_count++; } else { @@ -547,6 +556,9 @@ int NMethodSweeper::process_nmethod(nmethod *nm) { SWEEP(nm); // No inline caches will ever point to osr methods, so we can just remove it freed_memory = nm->total_size(); + if (nm->is_compiled_by_c2()) { + _total_nof_c2_methods_reclaimed++; + } release_nmethod(nm); _flushed_count++; } else { @@ -634,3 +646,13 @@ void NMethodSweeper::log_sweep(const char* msg, const char* format, ...) { xtty->end_elem(); } } + +void NMethodSweeper::print() { + ttyLocker ttyl; + tty->print_cr("Code cache sweeper statistics:"); + tty->print_cr(" Total sweep time: %1.0lfms", (double)_total_time_sweeping.value()/1000000); + tty->print_cr(" Total number of full sweeps: %ld", _total_nof_code_cache_sweeps); + tty->print_cr(" Total number of flushed methods: %ld(%ld C2 methods)", _total_nof_methods_reclaimed, + _total_nof_c2_methods_reclaimed); + tty->print_cr(" Total size of flushed methods: " SIZE_FORMAT "kB", _total_flushed_size/K); +} diff --git a/hotspot/src/share/vm/runtime/sweeper.hpp b/hotspot/src/share/vm/runtime/sweeper.hpp index 9b11264e30b..abee1ec77d2 100644 --- a/hotspot/src/share/vm/runtime/sweeper.hpp +++ b/hotspot/src/share/vm/runtime/sweeper.hpp @@ -54,28 +54,33 @@ // is full. class NMethodSweeper : public AllStatic { - static long _traversals; // Stack scan count, also sweep ID. - static long _time_counter; // Virtual time used to periodically invoke sweeper - static long _last_sweep; // Value of _time_counter when the last sweep happened - static nmethod* _current; // Current nmethod - static int _seen; // Nof. nmethod we have currently processed in current pass of CodeCache - static int _flushed_count; // Nof. nmethods flushed in current sweep - static int _zombified_count; // Nof. nmethods made zombie in current sweep - static int _marked_for_reclamation_count; // Nof. nmethods marked for reclaim in current sweep + static long _traversals; // Stack scan count, also sweep ID. + static long _total_nof_code_cache_sweeps; // Total number of full sweeps of the code cache + static long _time_counter; // Virtual time used to periodically invoke sweeper + static long _last_sweep; // Value of _time_counter when the last sweep happened + static nmethod* _current; // Current nmethod + static int _seen; // Nof. nmethod we have currently processed in current pass of CodeCache + static int _flushed_count; // Nof. nmethods flushed in current sweep + static int _zombified_count; // Nof. nmethods made zombie in current sweep + static int _marked_for_reclamation_count; // Nof. nmethods marked for reclaim in current sweep - static volatile int _sweep_fractions_left; // Nof. invocations left until we are completed with this pass - static volatile int _sweep_started; // Flag to control conc sweeper - static volatile bool _should_sweep; // Indicates if we should invoke the sweeper - static volatile int _bytes_changed; // Counts the total nmethod size if the nmethod changed from: - // 1) alive -> not_entrant - // 2) not_entrant -> zombie - // 3) zombie -> marked_for_reclamation + static volatile int _sweep_fractions_left; // Nof. invocations left until we are completed with this pass + static volatile int _sweep_started; // Flag to control conc sweeper + static volatile bool _should_sweep; // Indicates if we should invoke the sweeper + static volatile int _bytes_changed; // Counts the total nmethod size if the nmethod changed from: + // 1) alive -> not_entrant + // 2) not_entrant -> zombie + // 3) zombie -> marked_for_reclamation // Stat counters - static int _total_nof_methods_reclaimed; // Accumulated nof methods flushed - static Tickspan _total_time_sweeping; // Accumulated time sweeping - static Tickspan _total_time_this_sweep; // Total time this sweep - static Tickspan _peak_sweep_time; // Peak time for a full sweep - static Tickspan _peak_sweep_fraction_time; // Peak time sweeping one fraction + static long _total_nof_methods_reclaimed; // Accumulated nof methods flushed + static long _total_nof_c2_methods_reclaimed; // Accumulated nof C2-compiled methods flushed + static size_t _total_flushed_size; // Total size of flushed methods + static int _hotness_counter_reset_val; + + static Tickspan _total_time_sweeping; // Accumulated time sweeping + static Tickspan _total_time_this_sweep; // Total time this sweep + static Tickspan _peak_sweep_time; // Peak time for a full sweep + static Tickspan _peak_sweep_fraction_time; // Peak time sweeping one fraction static int process_nmethod(nmethod *nm); static void release_nmethod(nmethod* nm); @@ -83,8 +88,6 @@ class NMethodSweeper : public AllStatic { static bool sweep_in_progress(); static void sweep_code_cache(); - static int _hotness_counter_reset_val; - public: static long traversal_count() { return _traversals; } static int total_nof_methods_reclaimed() { return _total_nof_methods_reclaimed; } @@ -105,10 +108,10 @@ class NMethodSweeper : public AllStatic { static void mark_active_nmethods(); // Invoked at the end of each safepoint static void possibly_sweep(); // Compiler threads call this to sweep - static int sort_nmethods_by_hotness(nmethod** nm1, nmethod** nm2); static int hotness_counter_reset_val(); static void report_state_change(nmethod* nm); static void possibly_enable_sweeper(); + static void print(); // Printing/debugging }; #endif // SHARE_VM_RUNTIME_SWEEPER_HPP From 066ad178935101ee4dc315258fbf3c7d6ce4940f Mon Sep 17 00:00:00 2001 From: Albert Noll Date: Fri, 20 Dec 2013 10:29:44 +0100 Subject: [PATCH 011/377] 8030783: Provide regression test for 8026478: -XX:+VerifyAdapterSharing is broken Added simple regression test Reviewed-by: iveresov --- .../compiler/debug/VerifyAdapterSharing.java | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 hotspot/test/compiler/debug/VerifyAdapterSharing.java diff --git a/hotspot/test/compiler/debug/VerifyAdapterSharing.java b/hotspot/test/compiler/debug/VerifyAdapterSharing.java new file mode 100644 index 00000000000..1aac5387d33 --- /dev/null +++ b/hotspot/test/compiler/debug/VerifyAdapterSharing.java @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * 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 8030783 + * @summary Regression test for 8026478 + * @library /testlibrary + * + */ +import com.oracle.java.testlibrary.*; + +public class VerifyAdapterSharing { + public static void main(String[] args) throws Exception { + ProcessBuilder pb; + OutputAnalyzer out; + + pb = ProcessTools.createJavaProcessBuilder("-Xcomp", "-XX:+IgnoreUnrecognizedVMOptions", + "-XX:+VerifyAdapterSharing", "-version"); + out = new OutputAnalyzer(pb.start()); + out.shouldHaveExitValue(0); + } +} From 2eb5e0e89d38be7132b2d361487fcd0790e52d91 Mon Sep 17 00:00:00 2001 From: Albert Noll Date: Fri, 20 Dec 2013 10:31:14 +0100 Subject: [PATCH 012/377] 8028052: compiler/startup/SmallCodeCacheStartup.java fails there is no 'no space to run compiler' in the output Weaken test so that configurations that have no C1 compiler pass Reviewed-by: iveresov --- hotspot/test/compiler/startup/SmallCodeCacheStartup.java | 1 - 1 file changed, 1 deletion(-) diff --git a/hotspot/test/compiler/startup/SmallCodeCacheStartup.java b/hotspot/test/compiler/startup/SmallCodeCacheStartup.java index 74b2b762caa..7a9a11a0836 100644 --- a/hotspot/test/compiler/startup/SmallCodeCacheStartup.java +++ b/hotspot/test/compiler/startup/SmallCodeCacheStartup.java @@ -37,7 +37,6 @@ public class SmallCodeCacheStartup { pb = ProcessTools.createJavaProcessBuilder("-XX:ReservedCodeCacheSize=3m", "-XX:CICompilerCount=64", "-version"); out = new OutputAnalyzer(pb.start()); - out.shouldContain("no space to run compiler"); out.shouldHaveExitValue(0); } } From cfefd0432021f027296f9f3eab0268a0a140cd58 Mon Sep 17 00:00:00 2001 From: Igor Veresov Date: Thu, 26 Dec 2013 21:00:23 -0800 Subject: [PATCH 013/377] 8027388: JVM crashes with SIGSEGV (0xb) at pc=0x00000001077cbbf6 Make object non-scalarizable if it has field with multiple bases one of which is null Reviewed-by: kvn, twisti --- hotspot/src/share/vm/opto/escape.cpp | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/hotspot/src/share/vm/opto/escape.cpp b/hotspot/src/share/vm/opto/escape.cpp index 50afded6a92..028aa2467f2 100644 --- a/hotspot/src/share/vm/opto/escape.cpp +++ b/hotspot/src/share/vm/opto/escape.cpp @@ -1579,9 +1579,20 @@ void ConnectionGraph::adjust_scalar_replaceable_state(JavaObjectNode* jobj) { jobj->set_scalar_replaceable(false); return; } + // 2. An object is not scalar replaceable if the field into which it is + // stored has multiple bases one of which is null. + if (field->base_count() > 1) { + for (BaseIterator i(field); i.has_next(); i.next()) { + PointsToNode* base = i.get(); + if (base == null_obj) { + jobj->set_scalar_replaceable(false); + return; + } + } + } } assert(use->is_Field() || use->is_LocalVar(), "sanity"); - // 2. An object is not scalar replaceable if it is merged with other objects. + // 3. An object is not scalar replaceable if it is merged with other objects. for (EdgeIterator j(use); j.has_next(); j.next()) { PointsToNode* ptn = j.get(); if (ptn->is_JavaObject() && ptn != jobj) { @@ -1600,13 +1611,13 @@ void ConnectionGraph::adjust_scalar_replaceable_state(JavaObjectNode* jobj) { FieldNode* field = j.get()->as_Field(); int offset = field->as_Field()->offset(); - // 3. An object is not scalar replaceable if it has a field with unknown + // 4. An object is not scalar replaceable if it has a field with unknown // offset (array's element is accessed in loop). if (offset == Type::OffsetBot) { jobj->set_scalar_replaceable(false); return; } - // 4. Currently an object is not scalar replaceable if a LoadStore node + // 5. Currently an object is not scalar replaceable if a LoadStore node // access its field since the field value is unknown after it. // Node* n = field->ideal_node(); @@ -1617,7 +1628,7 @@ void ConnectionGraph::adjust_scalar_replaceable_state(JavaObjectNode* jobj) { } } - // 5. Or the address may point to more then one object. This may produce + // 6. Or the address may point to more then one object. This may produce // the false positive result (set not scalar replaceable) // since the flow-insensitive escape analysis can't separate // the case when stores overwrite the field's value from the case From b6d0b72ec0b2d91c71df6cc5bbef850bf6d25afc Mon Sep 17 00:00:00 2001 From: Anton Ivanov Date: Tue, 31 Dec 2013 19:26:57 +0400 Subject: [PATCH 014/377] 8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul Reviewed-by: twisti --- .../mathexact/sanity/AddExactIntTest.java | 45 +++++ .../mathexact/sanity/AddExactLongTest.java | 45 +++++ .../sanity/DecrementExactIntTest.java | 45 +++++ .../sanity/DecrementExactLongTest.java | 45 +++++ .../sanity/IncrementExactIntTest.java | 45 +++++ .../sanity/IncrementExactLongTest.java | 45 +++++ .../mathexact/sanity/IntrinsicBase.java | 155 ++++++++++++++++++ .../mathexact/sanity/MathIntrinsic.java | 155 ++++++++++++++++++ .../sanity/MultiplyExactIntTest.java | 45 +++++ .../sanity/MultiplyExactLongTest.java | 45 +++++ .../mathexact/sanity/NegateExactIntTest.java | 45 +++++ .../mathexact/sanity/NegateExactLongTest.java | 45 +++++ .../sanity/SubtractExactIntTest.java | 46 ++++++ .../sanity/SubtractExactLongTest.java | 45 +++++ .../intrinsics/mathexact/sanity/Verifier.java | 71 ++++++++ .../compiler/tiered/NonTieredLevelsTest.java | 9 +- .../compiler/tiered/TieredLevelsTest.java | 6 +- .../whitebox/ClearMethodStateTest.java | 12 +- .../whitebox/CompilerWhiteBoxTest.java | 108 ++++++++---- .../compiler/whitebox/DeoptimizeAllTest.java | 10 +- .../whitebox/DeoptimizeMethodTest.java | 10 +- .../EnqueueMethodForCompilationTest.java | 8 +- .../whitebox/IsMethodCompilableTest.java | 14 +- .../whitebox/MakeMethodNotCompilableTest.java | 17 +- .../whitebox/SetDontInlineMethodTest.java | 8 +- .../whitebox/SetForceInlineMethodTest.java | 8 +- 26 files changed, 1035 insertions(+), 97 deletions(-) create mode 100644 hotspot/test/compiler/intrinsics/mathexact/sanity/AddExactIntTest.java create mode 100644 hotspot/test/compiler/intrinsics/mathexact/sanity/AddExactLongTest.java create mode 100644 hotspot/test/compiler/intrinsics/mathexact/sanity/DecrementExactIntTest.java create mode 100644 hotspot/test/compiler/intrinsics/mathexact/sanity/DecrementExactLongTest.java create mode 100644 hotspot/test/compiler/intrinsics/mathexact/sanity/IncrementExactIntTest.java create mode 100644 hotspot/test/compiler/intrinsics/mathexact/sanity/IncrementExactLongTest.java create mode 100644 hotspot/test/compiler/intrinsics/mathexact/sanity/IntrinsicBase.java create mode 100644 hotspot/test/compiler/intrinsics/mathexact/sanity/MathIntrinsic.java create mode 100644 hotspot/test/compiler/intrinsics/mathexact/sanity/MultiplyExactIntTest.java create mode 100644 hotspot/test/compiler/intrinsics/mathexact/sanity/MultiplyExactLongTest.java create mode 100644 hotspot/test/compiler/intrinsics/mathexact/sanity/NegateExactIntTest.java create mode 100644 hotspot/test/compiler/intrinsics/mathexact/sanity/NegateExactLongTest.java create mode 100644 hotspot/test/compiler/intrinsics/mathexact/sanity/SubtractExactIntTest.java create mode 100644 hotspot/test/compiler/intrinsics/mathexact/sanity/SubtractExactLongTest.java create mode 100644 hotspot/test/compiler/intrinsics/mathexact/sanity/Verifier.java diff --git a/hotspot/test/compiler/intrinsics/mathexact/sanity/AddExactIntTest.java b/hotspot/test/compiler/intrinsics/mathexact/sanity/AddExactIntTest.java new file mode 100644 index 00000000000..c55f847d2a2 --- /dev/null +++ b/hotspot/test/compiler/intrinsics/mathexact/sanity/AddExactIntTest.java @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * 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 + * @library /testlibrary /testlibrary/whitebox /compiler/whitebox + * @build AddExactIntTest + * @run main ClassFileInstaller sun.hotspot.WhiteBox + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions + * -XX:+IgnoreUnrecognizedVMOptions -XX:+WhiteBoxAPI -XX:+LogCompilation + * -XX:CompileCommand=compileonly,MathIntrinsic*::execMathMethod + * -XX:LogFile=hs_neg.log -XX:-UseMathExactIntrinsics AddExactIntTest + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions + * -XX:+IgnoreUnrecognizedVMOptions -XX:+WhiteBoxAPI -XX:+LogCompilation + * -XX:CompileCommand=compileonly,MathIntrinsic*::execMathMethod + * -XX:LogFile=hs.log -XX:+UseMathExactIntrinsics AddExactIntTest + * @run main Verifier hs_neg.log hs.log + */ + +public class AddExactIntTest { + + public static void main(String[] args) throws Exception { + new IntrinsicBase.IntTest(MathIntrinsic.IntIntrinsic.Add).test(); + } +} diff --git a/hotspot/test/compiler/intrinsics/mathexact/sanity/AddExactLongTest.java b/hotspot/test/compiler/intrinsics/mathexact/sanity/AddExactLongTest.java new file mode 100644 index 00000000000..4823f073f5f --- /dev/null +++ b/hotspot/test/compiler/intrinsics/mathexact/sanity/AddExactLongTest.java @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * 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 + * @library /testlibrary /testlibrary/whitebox /compiler/whitebox + * @build AddExactLongTest + * @run main ClassFileInstaller sun.hotspot.WhiteBox + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions + * -XX:+IgnoreUnrecognizedVMOptions -XX:+WhiteBoxAPI -XX:+LogCompilation + * -XX:CompileCommand=compileonly,MathIntrinsic*::execMathMethod + * -XX:LogFile=hs_neg.log -XX:-UseMathExactIntrinsics AddExactLongTest + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions + * -XX:+IgnoreUnrecognizedVMOptions -XX:+WhiteBoxAPI -XX:+LogCompilation + * -XX:CompileCommand=compileonly,MathIntrinsic*::execMathMethod + * -XX:LogFile=hs.log -XX:+UseMathExactIntrinsics AddExactLongTest + * @run main Verifier hs_neg.log hs.log + */ + +public class AddExactLongTest { + + public static void main(String[] args) throws Exception { + new IntrinsicBase.LongTest(MathIntrinsic.LongIntrinsic.Add).test(); + } +} diff --git a/hotspot/test/compiler/intrinsics/mathexact/sanity/DecrementExactIntTest.java b/hotspot/test/compiler/intrinsics/mathexact/sanity/DecrementExactIntTest.java new file mode 100644 index 00000000000..0b97ab86ae6 --- /dev/null +++ b/hotspot/test/compiler/intrinsics/mathexact/sanity/DecrementExactIntTest.java @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * 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 + * @library /testlibrary /testlibrary/whitebox /compiler/whitebox + * @build DecrementExactIntTest + * @run main ClassFileInstaller sun.hotspot.WhiteBox + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions + * -XX:+IgnoreUnrecognizedVMOptions -XX:+WhiteBoxAPI -XX:+LogCompilation + * -XX:CompileCommand=compileonly,MathIntrinsic*::execMathMethod + * -XX:LogFile=hs_neg.log -XX:-UseMathExactIntrinsics DecrementExactIntTest + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions + * -XX:+IgnoreUnrecognizedVMOptions -XX:+WhiteBoxAPI -XX:+LogCompilation + * -XX:CompileCommand=compileonly,MathIntrinsic*::execMathMethod + * -XX:LogFile=hs.log -XX:+UseMathExactIntrinsics DecrementExactIntTest + * @run main Verifier hs_neg.log hs.log + */ + +public class DecrementExactIntTest { + + public static void main(String[] args) throws Exception { + new IntrinsicBase.IntTest(MathIntrinsic.IntIntrinsic.Decrement).test(); + } +} diff --git a/hotspot/test/compiler/intrinsics/mathexact/sanity/DecrementExactLongTest.java b/hotspot/test/compiler/intrinsics/mathexact/sanity/DecrementExactLongTest.java new file mode 100644 index 00000000000..f2429aa9142 --- /dev/null +++ b/hotspot/test/compiler/intrinsics/mathexact/sanity/DecrementExactLongTest.java @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * 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 + * @library /testlibrary /testlibrary/whitebox /compiler/whitebox + * @build DecrementExactLongTest + * @run main ClassFileInstaller sun.hotspot.WhiteBox + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions + * -XX:+IgnoreUnrecognizedVMOptions -XX:+WhiteBoxAPI -XX:+LogCompilation + * -XX:CompileCommand=compileonly,MathIntrinsic*::execMathMethod + * -XX:LogFile=hs_neg.log -XX:-UseMathExactIntrinsics DecrementExactLongTest + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions + * -XX:+IgnoreUnrecognizedVMOptions -XX:+WhiteBoxAPI -XX:+LogCompilation + * -XX:CompileCommand=compileonly,MathIntrinsic*::execMathMethod + * -XX:LogFile=hs.log -XX:+UseMathExactIntrinsics DecrementExactLongTest + * @run main Verifier hs_neg.log hs.log + */ + +public class DecrementExactLongTest { + + public static void main(String[] args) throws Exception { + new IntrinsicBase.LongTest(MathIntrinsic.LongIntrinsic.Decrement).test(); + } +} \ No newline at end of file diff --git a/hotspot/test/compiler/intrinsics/mathexact/sanity/IncrementExactIntTest.java b/hotspot/test/compiler/intrinsics/mathexact/sanity/IncrementExactIntTest.java new file mode 100644 index 00000000000..714f4e2e04e --- /dev/null +++ b/hotspot/test/compiler/intrinsics/mathexact/sanity/IncrementExactIntTest.java @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * 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 + * @library /testlibrary /testlibrary/whitebox /compiler/whitebox + * @build IncrementExactIntTest + * @run main ClassFileInstaller sun.hotspot.WhiteBox + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions + * -XX:+IgnoreUnrecognizedVMOptions -XX:+WhiteBoxAPI -XX:+LogCompilation + * -XX:CompileCommand=compileonly,MathIntrinsic*::execMathMethod + * -XX:LogFile=hs_neg.log -XX:-UseMathExactIntrinsics IncrementExactIntTest + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions + * -XX:+IgnoreUnrecognizedVMOptions -XX:+WhiteBoxAPI -XX:+LogCompilation + * -XX:CompileCommand=compileonly,MathIntrinsic*::execMathMethod + * -XX:LogFile=hs.log -XX:+UseMathExactIntrinsics IncrementExactIntTest + * @run main Verifier hs_neg.log hs.log + */ + +public class IncrementExactIntTest { + + public static void main(String[] args) throws Exception { + new IntrinsicBase.IntTest(MathIntrinsic.IntIntrinsic.Increment).test(); + } +} diff --git a/hotspot/test/compiler/intrinsics/mathexact/sanity/IncrementExactLongTest.java b/hotspot/test/compiler/intrinsics/mathexact/sanity/IncrementExactLongTest.java new file mode 100644 index 00000000000..19511c49929 --- /dev/null +++ b/hotspot/test/compiler/intrinsics/mathexact/sanity/IncrementExactLongTest.java @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * 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 + * @library /testlibrary /testlibrary/whitebox /compiler/whitebox + * @build IncrementExactLongTest + * @run main ClassFileInstaller sun.hotspot.WhiteBox + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions + * -XX:+IgnoreUnrecognizedVMOptions -XX:+WhiteBoxAPI -XX:+LogCompilation + * -XX:CompileCommand=compileonly,MathIntrinsic*::execMathMethod + * -XX:LogFile=hs_neg.log -XX:-UseMathExactIntrinsics IncrementExactLongTest + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions + * -XX:+IgnoreUnrecognizedVMOptions -XX:+WhiteBoxAPI -XX:+LogCompilation + * -XX:CompileCommand=compileonly,MathIntrinsic*::execMathMethod + * -XX:LogFile=hs.log -XX:+UseMathExactIntrinsics IncrementExactLongTest + * @run main Verifier hs_neg.log hs.log + */ + +public class IncrementExactLongTest { + + public static void main(String[] args) throws Exception { + new IntrinsicBase.LongTest(MathIntrinsic.LongIntrinsic.Increment).test(); + } +} diff --git a/hotspot/test/compiler/intrinsics/mathexact/sanity/IntrinsicBase.java b/hotspot/test/compiler/intrinsics/mathexact/sanity/IntrinsicBase.java new file mode 100644 index 00000000000..cecd6ce2d02 --- /dev/null +++ b/hotspot/test/compiler/intrinsics/mathexact/sanity/IntrinsicBase.java @@ -0,0 +1,155 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * 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. + */ + +import com.oracle.java.testlibrary.Platform; + +import java.io.FileOutputStream; +import java.lang.reflect.Executable; +import java.util.Properties; + +public abstract class IntrinsicBase extends CompilerWhiteBoxTest { + protected String javaVmName; + protected String useMathExactIntrinsics; + + protected IntrinsicBase(TestCase testCase) { + super(testCase); + javaVmName = System.getProperty("java.vm.name"); + useMathExactIntrinsics = getVMOption("UseMathExactIntrinsics"); + } + + @Override + protected void test() throws Exception { + //java.lang.Math should be loaded to allow a compilation of the methods that use Math's method + System.out.println("class java.lang.Math should be loaded. Proof: " + Math.class); + printEnvironmentInfo(); + + int expectedIntrinsicCount = 0; + + switch (MODE) { + case "compiled mode": + case "mixed mode": + if (isServerVM()) { + if (TIERED_COMPILATION) { + int max_level = TIERED_STOP_AT_LEVEL; + expectedIntrinsicCount = (max_level == COMP_LEVEL_MAX) ? 1 : 0; + for (int i = CompilerWhiteBoxTest.COMP_LEVEL_SIMPLE; i <= max_level; ++i) { + deoptimize(); + compileAtLevel(i); + } + } else { + expectedIntrinsicCount = 1; + deoptimize(); + compileAtLevel(CompilerWhiteBoxTest.COMP_LEVEL_MAX); + } + } else { + deoptimize(); + compileAtLevel(CompilerWhiteBoxTest.COMP_LEVEL_SIMPLE); + } + + if (!isIntrinsicSupported()) { + expectedIntrinsicCount = 0; + } + break; + case "interpreted mode": //test is not applicable in this mode; + System.err.println("Warning: This test is not applicable in mode: " + MODE); + break; + default: + throw new RuntimeException("Test bug, unknown VM mode: " + MODE); + } + + System.out.println("Expected intrinsic count is " + expectedIntrinsicCount + " name " + getIntrinsicId()); + + final FileOutputStream out = new FileOutputStream(getVMOption("LogFile") + ".verify.properties"); + Properties expectedProps = new Properties(); + expectedProps.setProperty("intrinsic.name", getIntrinsicId()); + expectedProps.setProperty("intrinsic.expectedCount", String.valueOf(expectedIntrinsicCount)); + expectedProps.store(out, null); + + out.close(); + } + + protected void printEnvironmentInfo() { + System.out.println("java.vm.name=" + javaVmName); + System.out.println("os.arch=" + Platform.getOsArch()); + System.out.println("java.vm.info=" + MODE); + System.out.println("useMathExactIntrinsics=" + useMathExactIntrinsics); + } + + protected void compileAtLevel(int level) { + WHITE_BOX.enqueueMethodForCompilation(method, level); + waitBackgroundCompilation(); + checkCompilation(method, level); + } + + protected void checkCompilation(Executable executable, int level) { + if (!WHITE_BOX.isMethodCompiled(executable)) { + throw new RuntimeException("Test bug, expected compilation (level): " + level + ", but not compiled"); + } + final int compilationLevel = WHITE_BOX.getMethodCompilationLevel(executable); + if (compilationLevel != level) { + if (!(TIERED_COMPILATION && level == COMP_LEVEL_FULL_PROFILE && compilationLevel == COMP_LEVEL_LIMITED_PROFILE)) { //possible case + throw new RuntimeException("Test bug, expected compilation (level): " + level + ", but level: " + compilationLevel); + } + } + } + + protected abstract boolean isIntrinsicSupported(); + + protected abstract String getIntrinsicId(); + + protected boolean isServerVM() { + return javaVmName.toLowerCase().contains("server"); + } + + static class IntTest extends IntrinsicBase { + protected IntTest(MathIntrinsic.IntIntrinsic testCase) { + super(testCase); + } + + @Override + protected boolean isIntrinsicSupported() { + return isServerVM() && Boolean.valueOf(useMathExactIntrinsics) && (Platform.isX86() || Platform.isX64()); + } + + @Override + protected String getIntrinsicId() { + return "_" + testCase.name().toLowerCase() + "ExactI"; + } + } + + static class LongTest extends IntrinsicBase { + protected LongTest(MathIntrinsic.LongIntrinsic testCase) { + super(testCase); + } + + @Override + protected boolean isIntrinsicSupported() { + return isServerVM() && Boolean.valueOf(useMathExactIntrinsics) && Platform.isX64(); + } + + @Override + protected String getIntrinsicId() { + return "_" + testCase.name().toLowerCase() + "ExactL"; + } + } +} diff --git a/hotspot/test/compiler/intrinsics/mathexact/sanity/MathIntrinsic.java b/hotspot/test/compiler/intrinsics/mathexact/sanity/MathIntrinsic.java new file mode 100644 index 00000000000..99039f9a7f3 --- /dev/null +++ b/hotspot/test/compiler/intrinsics/mathexact/sanity/MathIntrinsic.java @@ -0,0 +1,155 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * 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. + */ + +import java.lang.reflect.Executable; +import java.util.concurrent.Callable; + +public class MathIntrinsic { + + enum IntIntrinsic implements CompilerWhiteBoxTest.TestCase { + Add { + @Override + Object execMathMethod() { + return intR = Math.addExact(int1, int2); + } + }, + Subtract { + @Override + Object execMathMethod() { + return intR = Math.subtractExact(int1, int2); + } + }, + Multiply { + @Override + Object execMathMethod() { + return intR = Math.multiplyExact(int1, int2); + } + }, + Increment { + @Override + Object execMathMethod() { + return intR = Math.incrementExact(int1); + } + }, + Decrement { + @Override + Object execMathMethod() { + return intR = Math.decrementExact(int1); + } + }, + Negate { + @Override + Object execMathMethod() { + return intR = Math.negateExact(int1); + } + }; + protected int int1; + protected int int2; + protected int intR; + + abstract Object execMathMethod(); + + @Override + public Executable getExecutable() { + try { + return getClass().getDeclaredMethod("execMathMethod"); + } catch (NoSuchMethodException e) { + throw new RuntimeException("Test bug, no such method: " + e); + } + } + + @Override + public Callable getCallable() { + return null; + } + + @Override + public boolean isOsr() { + return false; + } + + } + + enum LongIntrinsic implements CompilerWhiteBoxTest.TestCase { + Add { + @Override + Object execMathMethod() { + return longR = Math.addExact(long1, long2); + } + }, + Subtract { + @Override + Object execMathMethod() { + return longR = Math.subtractExact(long1, long2); + } + }, + Multiply { + @Override + Object execMathMethod() { + return longR = Math.multiplyExact(long1, long2); + } + }, + Increment { + @Override + Object execMathMethod() { + return longR = Math.incrementExact(long1); + } + }, + Decrement { + @Override + Object execMathMethod() { + return longR = Math.decrementExact(long1); + } + }, + Negate { + @Override + Object execMathMethod() { + return longR = Math.negateExact(long1); + } + }; + protected long long1; + protected long long2; + protected long longR; + + abstract Object execMathMethod(); + + @Override + public Executable getExecutable() { + try { + return getClass().getDeclaredMethod("execMathMethod"); + } catch (NoSuchMethodException e) { + throw new RuntimeException("Test bug, no such method: " + e); + } + } + + @Override + public Callable getCallable() { + return null; + } + + @Override + public boolean isOsr() { + return false; + } + } +} diff --git a/hotspot/test/compiler/intrinsics/mathexact/sanity/MultiplyExactIntTest.java b/hotspot/test/compiler/intrinsics/mathexact/sanity/MultiplyExactIntTest.java new file mode 100644 index 00000000000..bd433500187 --- /dev/null +++ b/hotspot/test/compiler/intrinsics/mathexact/sanity/MultiplyExactIntTest.java @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * 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 + * @library /testlibrary /testlibrary/whitebox /compiler/whitebox + * @build MultiplyExactIntTest + * @run main ClassFileInstaller sun.hotspot.WhiteBox + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions + * -XX:+IgnoreUnrecognizedVMOptions -XX:+WhiteBoxAPI -XX:+LogCompilation + * -XX:CompileCommand=compileonly,MathIntrinsic*::execMathMethod + * -XX:LogFile=hs_neg.log -XX:-UseMathExactIntrinsics MultiplyExactIntTest + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions + * -XX:+IgnoreUnrecognizedVMOptions -XX:+WhiteBoxAPI -XX:+LogCompilation + * -XX:CompileCommand=compileonly,MathIntrinsic*::execMathMethod + * -XX:LogFile=hs.log -XX:+UseMathExactIntrinsics MultiplyExactIntTest + * @run main Verifier hs_neg.log hs.log + */ + +public class MultiplyExactIntTest { + + public static void main(String[] args) throws Exception { + new IntrinsicBase.IntTest(MathIntrinsic.IntIntrinsic.Multiply).test(); + } +} diff --git a/hotspot/test/compiler/intrinsics/mathexact/sanity/MultiplyExactLongTest.java b/hotspot/test/compiler/intrinsics/mathexact/sanity/MultiplyExactLongTest.java new file mode 100644 index 00000000000..70651107dae --- /dev/null +++ b/hotspot/test/compiler/intrinsics/mathexact/sanity/MultiplyExactLongTest.java @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * 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 + * @library /testlibrary /testlibrary/whitebox /compiler/whitebox + * @build MultiplyExactLongTest + * @run main ClassFileInstaller sun.hotspot.WhiteBox + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions + * -XX:+IgnoreUnrecognizedVMOptions -XX:+WhiteBoxAPI -XX:+LogCompilation + * -XX:CompileCommand=compileonly,MathIntrinsic*::execMathMethod + * -XX:LogFile=hs_neg.log -XX:-UseMathExactIntrinsics MultiplyExactLongTest + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions + * -XX:+IgnoreUnrecognizedVMOptions -XX:+WhiteBoxAPI -XX:+LogCompilation + * -XX:CompileCommand=compileonly,MathIntrinsic*::execMathMethod + * -XX:LogFile=hs.log -XX:+UseMathExactIntrinsics MultiplyExactLongTest + * @run main Verifier hs_neg.log hs.log + */ + +public class MultiplyExactLongTest { + + public static void main(String[] args) throws Exception { + new IntrinsicBase.LongTest(MathIntrinsic.LongIntrinsic.Multiply).test(); + } +} diff --git a/hotspot/test/compiler/intrinsics/mathexact/sanity/NegateExactIntTest.java b/hotspot/test/compiler/intrinsics/mathexact/sanity/NegateExactIntTest.java new file mode 100644 index 00000000000..579c2907e91 --- /dev/null +++ b/hotspot/test/compiler/intrinsics/mathexact/sanity/NegateExactIntTest.java @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * 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 + * @library /testlibrary /testlibrary/whitebox /compiler/whitebox + * @build NegateExactIntTest + * @run main ClassFileInstaller sun.hotspot.WhiteBox + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions + * -XX:+IgnoreUnrecognizedVMOptions -XX:+WhiteBoxAPI -XX:+LogCompilation + * -XX:CompileCommand=compileonly,MathIntrinsic*::execMathMethod + * -XX:LogFile=hs_neg.log -XX:-UseMathExactIntrinsics NegateExactIntTest + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions + * -XX:+IgnoreUnrecognizedVMOptions -XX:+WhiteBoxAPI -XX:+LogCompilation + * -XX:CompileCommand=compileonly,MathIntrinsic*::execMathMethod + * -XX:LogFile=hs.log -XX:+UseMathExactIntrinsics NegateExactIntTest + * @run main Verifier hs_neg.log hs.log + */ + +public class NegateExactIntTest { + + public static void main(String[] args) throws Exception { + new IntrinsicBase.IntTest(MathIntrinsic.IntIntrinsic.Negate).test(); + } +} diff --git a/hotspot/test/compiler/intrinsics/mathexact/sanity/NegateExactLongTest.java b/hotspot/test/compiler/intrinsics/mathexact/sanity/NegateExactLongTest.java new file mode 100644 index 00000000000..6f114f632ab --- /dev/null +++ b/hotspot/test/compiler/intrinsics/mathexact/sanity/NegateExactLongTest.java @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * 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 + * @library /testlibrary /testlibrary/whitebox /compiler/whitebox + * @build NegateExactLongTest + * @run main ClassFileInstaller sun.hotspot.WhiteBox + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions + * -XX:+IgnoreUnrecognizedVMOptions -XX:+WhiteBoxAPI -XX:+LogCompilation + * -XX:CompileCommand=compileonly,MathIntrinsic*::execMathMethod + * -XX:LogFile=hs_neg.log -XX:-UseMathExactIntrinsics NegateExactLongTest + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions + * -XX:+IgnoreUnrecognizedVMOptions -XX:+WhiteBoxAPI -XX:+LogCompilation + * -XX:CompileCommand=compileonly,MathIntrinsic*::execMathMethod + * -XX:LogFile=hs.log -XX:+UseMathExactIntrinsics NegateExactLongTest + * @run main Verifier hs_neg.log hs.log + */ + +public class NegateExactLongTest { + + public static void main(String[] args) throws Exception { + new IntrinsicBase.LongTest(MathIntrinsic.LongIntrinsic.Negate).test(); + } +} diff --git a/hotspot/test/compiler/intrinsics/mathexact/sanity/SubtractExactIntTest.java b/hotspot/test/compiler/intrinsics/mathexact/sanity/SubtractExactIntTest.java new file mode 100644 index 00000000000..d1eaf3919d5 --- /dev/null +++ b/hotspot/test/compiler/intrinsics/mathexact/sanity/SubtractExactIntTest.java @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * 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 + * @library /testlibrary /testlibrary/whitebox /compiler/whitebox + * @build SubtractExactIntTest + * @run main ClassFileInstaller sun.hotspot.WhiteBox + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions + * -XX:+IgnoreUnrecognizedVMOptions -XX:+WhiteBoxAPI -XX:+LogCompilation + * -XX:CompileCommand=compileonly,MathIntrinsic*::execMathMethod + * -XX:LogFile=hs_neg.log -XX:-UseMathExactIntrinsics SubtractExactIntTest + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions + * -XX:+IgnoreUnrecognizedVMOptions -XX:+WhiteBoxAPI -XX:+LogCompilation + * -XX:CompileCommand=compileonly,MathIntrinsic*::execMathMethod + * -XX:LogFile=hs.log -XX:+UseMathExactIntrinsics SubtractExactIntTest + * @run main Verifier hs_neg.log hs.log + + */ + +public class SubtractExactIntTest { + + public static void main(String[] args) throws Exception { + new IntrinsicBase.IntTest(MathIntrinsic.IntIntrinsic.Subtract).test(); + } +} diff --git a/hotspot/test/compiler/intrinsics/mathexact/sanity/SubtractExactLongTest.java b/hotspot/test/compiler/intrinsics/mathexact/sanity/SubtractExactLongTest.java new file mode 100644 index 00000000000..fbe8eb1e12e --- /dev/null +++ b/hotspot/test/compiler/intrinsics/mathexact/sanity/SubtractExactLongTest.java @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * 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 + * @library /testlibrary /testlibrary/whitebox /compiler/whitebox + * @build SubtractExactLongTest + * @run main ClassFileInstaller sun.hotspot.WhiteBox + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions + * -XX:+IgnoreUnrecognizedVMOptions -XX:+WhiteBoxAPI -XX:+LogCompilation + * -XX:CompileCommand=compileonly,MathIntrinsic*::execMathMethod + * -XX:LogFile=hs_neg.log -XX:-UseMathExactIntrinsics SubtractExactLongTest + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions + * -XX:+IgnoreUnrecognizedVMOptions -XX:+WhiteBoxAPI -XX:+LogCompilation + * -XX:CompileCommand=compileonly,MathIntrinsic*::execMathMethod + * -XX:LogFile=hs.log -XX:+UseMathExactIntrinsics SubtractExactLongTest + * @run main Verifier hs_neg.log hs.log + */ + +public class SubtractExactLongTest { + + public static void main(String[] args) throws Exception { + new IntrinsicBase.LongTest(MathIntrinsic.LongIntrinsic.Subtract).test(); + } +} diff --git a/hotspot/test/compiler/intrinsics/mathexact/sanity/Verifier.java b/hotspot/test/compiler/intrinsics/mathexact/sanity/Verifier.java new file mode 100644 index 00000000000..7b26d64c648 --- /dev/null +++ b/hotspot/test/compiler/intrinsics/mathexact/sanity/Verifier.java @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * 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. + */ + +import java.io.BufferedReader; +import java.io.FileReader; +import java.util.Properties; + +public class Verifier { + + public static void main(String[] args) throws Exception { + if (args.length == 0) + throw new RuntimeException("Test bug, nothing to verify"); + for (String hsLogFile : args) { + verify(hsLogFile); + } + } + + private static void verify(String hsLogFile) throws Exception { + System.out.println("Verifying " + hsLogFile); + + final Properties expectedProperties = new Properties(); + final FileReader reader = new FileReader(hsLogFile + ".verify.properties"); + expectedProperties.load(reader); + reader.close(); + + int fullMatchCnt = 0; + int suspectCnt = 0; + final String intrinsicId = expectedProperties.getProperty("intrinsic.name"); + final String prefix = " constructor, + String[] args) { + if (args.length == 0) { + for (TestCase test : SimpleTestCase.values()) { + constructor.apply(test).runTest(); + } + } else { + for (String name : args) { + constructor.apply(SimpleTestCase.valueOf(name)).runTest(); + } + } + } + /** tested method */ protected final Executable method; protected final TestCase testCase; @@ -145,7 +159,7 @@ public abstract class CompilerWhiteBoxTest { protected CompilerWhiteBoxTest(TestCase testCase) { Objects.requireNonNull(testCase); System.out.println("TEST CASE:" + testCase.name()); - method = testCase.executable; + method = testCase.getExecutable(); this.testCase = testCase; } @@ -204,7 +218,7 @@ public abstract class CompilerWhiteBoxTest { if (WHITE_BOX.getMethodCompilationLevel(method, true) != 0) { throw new RuntimeException(method + " osr_comp_level must be == 0"); } - } + } /** * Checks, that {@linkplain #method} is compiled. @@ -221,44 +235,46 @@ public abstract class CompilerWhiteBoxTest { method, System.currentTimeMillis() - start); return; } - if (!WHITE_BOX.isMethodCompiled(method, testCase.isOsr)) { + if (!WHITE_BOX.isMethodCompiled(method, testCase.isOsr())) { throw new RuntimeException(method + " must be " - + (testCase.isOsr ? "osr_" : "") + "compiled"); + + (testCase.isOsr() ? "osr_" : "") + "compiled"); } - if (WHITE_BOX.getMethodCompilationLevel(method, testCase.isOsr) == 0) { + if (WHITE_BOX.getMethodCompilationLevel(method, testCase.isOsr()) + == 0) { throw new RuntimeException(method - + (testCase.isOsr ? " osr_" : " ") + + (testCase.isOsr() ? " osr_" : " ") + "comp_level must be != 0"); } } protected final void deoptimize() { - WHITE_BOX.deoptimizeMethod(method, testCase.isOsr); - if (testCase.isOsr) { + WHITE_BOX.deoptimizeMethod(method, testCase.isOsr()); + if (testCase.isOsr()) { WHITE_BOX.deoptimizeMethod(method, false); } } protected final int getCompLevel() { - return WHITE_BOX.getMethodCompilationLevel(method, testCase.isOsr); + return WHITE_BOX.getMethodCompilationLevel(method, testCase.isOsr()); } protected final boolean isCompilable() { return WHITE_BOX.isMethodCompilable(method, COMP_LEVEL_ANY, - testCase.isOsr); + testCase.isOsr()); } protected final boolean isCompilable(int compLevel) { - return WHITE_BOX.isMethodCompilable(method, compLevel, testCase.isOsr); + return WHITE_BOX + .isMethodCompilable(method, compLevel, testCase.isOsr()); } protected final void makeNotCompilable() { WHITE_BOX.makeMethodNotCompilable(method, COMP_LEVEL_ANY, - testCase.isOsr); + testCase.isOsr()); } protected final void makeNotCompilable(int compLevel) { - WHITE_BOX.makeMethodNotCompilable(method, compLevel, testCase.isOsr); + WHITE_BOX.makeMethodNotCompilable(method, compLevel, testCase.isOsr()); } /** @@ -298,7 +314,7 @@ public abstract class CompilerWhiteBoxTest { WHITE_BOX.isMethodCompiled(method, true)); System.out.printf("\tosr_comp_level:\t%d%n", WHITE_BOX.getMethodCompilationLevel(method, true)); - System.out.printf("\tin_queue:\t%b%n", + System.out.printf("\tin_queue:\t%b%n", WHITE_BOX.isMethodQueuedForCompilation(method)); System.out.printf("compile_queues_size:\t%d%n%n", WHITE_BOX.getCompileQueuesSize()); @@ -311,13 +327,13 @@ public abstract class CompilerWhiteBoxTest { /** * Tries to trigger compilation of {@linkplain #method} by call - * {@linkplain #testCase.callable} enough times. + * {@linkplain TestCase#getCallable()} enough times. * * @return accumulated result * @see #compile(int) */ protected final int compile() { - if (testCase.isOsr) { + if (testCase.isOsr()) { return compile(1); } else { return compile(THRESHOLD); @@ -326,7 +342,7 @@ public abstract class CompilerWhiteBoxTest { /** * Tries to trigger compilation of {@linkplain #method} by call - * {@linkplain #testCase.callable} specified times. + * {@linkplain TestCase#getCallable()} specified times. * * @param count invocation count * @return accumulated result @@ -336,7 +352,7 @@ public abstract class CompilerWhiteBoxTest { Integer tmp; for (int i = 0; i < count; ++i) { try { - tmp = testCase.callable.call(); + tmp = testCase.getCallable().call(); } catch (Exception e) { tmp = null; } @@ -347,19 +363,32 @@ public abstract class CompilerWhiteBoxTest { } return result; } + + /** + * Utility interface provides tested method and object to invoke it. + */ + public interface TestCase { + /** the name of test case */ + String name(); + + /** tested method */ + Executable getExecutable(); + + /** object to invoke {@linkplain #getExecutable()} */ + Callable getCallable(); + + /** flag for OSR test case */ + boolean isOsr(); + } } -/** - * Utility structure containing tested method and object to invoke it. - */ -enum TestCase { +enum SimpleTestCase implements CompilerWhiteBoxTest.TestCase { /** constructor test case */ CONSTRUCTOR_TEST(Helper.CONSTRUCTOR, Helper.CONSTRUCTOR_CALLABLE, false), /** method test case */ METOD_TEST(Helper.METHOD, Helper.METHOD_CALLABLE, false), /** static method test case */ STATIC_TEST(Helper.STATIC, Helper.STATIC_CALLABLE, false), - /** OSR constructor test case */ OSR_CONSTRUCTOR_TEST(Helper.OSR_CONSTRUCTOR, Helper.OSR_CONSTRUCTOR_CALLABLE, true), @@ -368,20 +397,32 @@ enum TestCase { /** OSR static method test case */ OSR_STATIC_TEST(Helper.OSR_STATIC, Helper.OSR_STATIC_CALLABLE, true); - /** tested method */ - final Executable executable; - /** object to invoke {@linkplain #executable} */ - final Callable callable; - /** flag for OSR test case */ - final boolean isOsr; + private final Executable executable; + private final Callable callable; + private final boolean isOsr; - private TestCase(Executable executable, Callable callable, + private SimpleTestCase(Executable executable, Callable callable, boolean isOsr) { this.executable = executable; this.callable = callable; this.isOsr = isOsr; } + @Override + public Executable getExecutable() { + return executable; + } + + @Override + public Callable getCallable() { + return callable; + } + + @Override + public boolean isOsr() { + return isOsr; + } + private static class Helper { private static final Callable CONSTRUCTOR_CALLABLE @@ -436,7 +477,6 @@ enum TestCase { } }; - private static final Constructor CONSTRUCTOR; private static final Constructor OSR_CONSTRUCTOR; private static final Method METHOD; diff --git a/hotspot/test/compiler/whitebox/DeoptimizeAllTest.java b/hotspot/test/compiler/whitebox/DeoptimizeAllTest.java index 61d8b599845..350c99c8f5c 100644 --- a/hotspot/test/compiler/whitebox/DeoptimizeAllTest.java +++ b/hotspot/test/compiler/whitebox/DeoptimizeAllTest.java @@ -27,19 +27,17 @@ * @library /testlibrary /testlibrary/whitebox * @build DeoptimizeAllTest * @run main ClassFileInstaller sun.hotspot.WhiteBox - * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:CompileCommand=compileonly,TestCase$Helper::* DeoptimizeAllTest + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:CompileCommand=compileonly,SimpleTestCase$Helper::* DeoptimizeAllTest * @summary testing of WB::deoptimizeAll() * @author igor.ignatyev@oracle.com */ public class DeoptimizeAllTest extends CompilerWhiteBoxTest { public static void main(String[] args) throws Exception { - for (TestCase test : TestCase.values()) { - new DeoptimizeAllTest(test).runTest(); - } + CompilerWhiteBoxTest.main(DeoptimizeAllTest::new, args); } - public DeoptimizeAllTest(TestCase testCase) { + private DeoptimizeAllTest(TestCase testCase) { super(testCase); // to prevent inlining of #method WHITE_BOX.testSetDontInlineMethod(method, true); @@ -53,7 +51,7 @@ public class DeoptimizeAllTest extends CompilerWhiteBoxTest { */ @Override protected void test() throws Exception { - if (testCase.isOsr && CompilerWhiteBoxTest.MODE.startsWith( + if (testCase.isOsr() && CompilerWhiteBoxTest.MODE.startsWith( "compiled ")) { System.err.printf("Warning: %s is not applicable in %s%n", testCase.name(), CompilerWhiteBoxTest.MODE); diff --git a/hotspot/test/compiler/whitebox/DeoptimizeMethodTest.java b/hotspot/test/compiler/whitebox/DeoptimizeMethodTest.java index 8ac065bd1e8..565a5b91cd7 100644 --- a/hotspot/test/compiler/whitebox/DeoptimizeMethodTest.java +++ b/hotspot/test/compiler/whitebox/DeoptimizeMethodTest.java @@ -27,19 +27,17 @@ * @library /testlibrary /testlibrary/whitebox * @build DeoptimizeMethodTest * @run main ClassFileInstaller sun.hotspot.WhiteBox - * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:CompileCommand=compileonly,TestCase$Helper::* DeoptimizeMethodTest + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:CompileCommand=compileonly,SimpleTestCase$Helper::* DeoptimizeMethodTest * @summary testing of WB::deoptimizeMethod() * @author igor.ignatyev@oracle.com */ public class DeoptimizeMethodTest extends CompilerWhiteBoxTest { public static void main(String[] args) throws Exception { - for (TestCase test : TestCase.values()) { - new DeoptimizeMethodTest(test).runTest(); - } + CompilerWhiteBoxTest.main(DeoptimizeMethodTest::new, args); } - public DeoptimizeMethodTest(TestCase testCase) { + private DeoptimizeMethodTest(TestCase testCase) { super(testCase); // to prevent inlining of #method WHITE_BOX.testSetDontInlineMethod(method, true); @@ -53,7 +51,7 @@ public class DeoptimizeMethodTest extends CompilerWhiteBoxTest { */ @Override protected void test() throws Exception { - if (testCase.isOsr && CompilerWhiteBoxTest.MODE.startsWith( + if (testCase.isOsr() && CompilerWhiteBoxTest.MODE.startsWith( "compiled ")) { System.err.printf("Warning: %s is not applicable in %s%n", testCase.name(), CompilerWhiteBoxTest.MODE); diff --git a/hotspot/test/compiler/whitebox/EnqueueMethodForCompilationTest.java b/hotspot/test/compiler/whitebox/EnqueueMethodForCompilationTest.java index 6d14d9211e2..d9139dd3674 100644 --- a/hotspot/test/compiler/whitebox/EnqueueMethodForCompilationTest.java +++ b/hotspot/test/compiler/whitebox/EnqueueMethodForCompilationTest.java @@ -27,19 +27,17 @@ * @library /testlibrary /testlibrary/whitebox * @build EnqueueMethodForCompilationTest * @run main ClassFileInstaller sun.hotspot.WhiteBox - * @run main/othervm/timeout=600 -Xbootclasspath/a:. -Xmixed -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:CompileCommand=compileonly,TestCase$Helper::* EnqueueMethodForCompilationTest + * @run main/othervm/timeout=600 -Xbootclasspath/a:. -Xmixed -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:CompileCommand=compileonly,SimpleTestCase$Helper::* EnqueueMethodForCompilationTest * @summary testing of WB::enqueueMethodForCompilation() * @author igor.ignatyev@oracle.com */ public class EnqueueMethodForCompilationTest extends CompilerWhiteBoxTest { public static void main(String[] args) throws Exception { - for (TestCase test : TestCase.values()) { - new EnqueueMethodForCompilationTest(test).runTest(); - } + CompilerWhiteBoxTest.main(EnqueueMethodForCompilationTest::new, args); } - public EnqueueMethodForCompilationTest(TestCase testCase) { + private EnqueueMethodForCompilationTest(TestCase testCase) { super(testCase); // to prevent inlining of #method WHITE_BOX.testSetDontInlineMethod(method, true); diff --git a/hotspot/test/compiler/whitebox/IsMethodCompilableTest.java b/hotspot/test/compiler/whitebox/IsMethodCompilableTest.java index a17fcb82f40..bd5916a7ca8 100644 --- a/hotspot/test/compiler/whitebox/IsMethodCompilableTest.java +++ b/hotspot/test/compiler/whitebox/IsMethodCompilableTest.java @@ -27,7 +27,7 @@ * @library /testlibrary /testlibrary/whitebox * @build IsMethodCompilableTest * @run main ClassFileInstaller sun.hotspot.WhiteBox - * @run main/othervm/timeout=2400 -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:CompileCommand=compileonly,TestCase$Helper::* IsMethodCompilableTest + * @run main/othervm/timeout=2400 -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:CompileCommand=compileonly,SimpleTestCase$Helper::* IsMethodCompilableTest * @summary testing of WB::isMethodCompilable() * @author igor.ignatyev@oracle.com */ @@ -48,12 +48,10 @@ public class IsMethodCompilableTest extends CompilerWhiteBoxTest { } public static void main(String[] args) throws Exception { - for (TestCase test : TestCase.values()) { - new IsMethodCompilableTest(test).runTest(); - } + CompilerWhiteBoxTest.main(IsMethodCompilableTest::new, args); } - public IsMethodCompilableTest(TestCase testCase) { + private IsMethodCompilableTest(TestCase testCase) { super(testCase); // to prevent inlining of #method WHITE_BOX.testSetDontInlineMethod(method, true); @@ -68,7 +66,7 @@ public class IsMethodCompilableTest extends CompilerWhiteBoxTest { */ @Override protected void test() throws Exception { - if (testCase.isOsr && CompilerWhiteBoxTest.MODE.startsWith( + if (testCase.isOsr() && CompilerWhiteBoxTest.MODE.startsWith( "compiled ")) { System.err.printf("Warning: %s is not applicable in %s%n", testCase.name(), CompilerWhiteBoxTest.MODE); @@ -89,7 +87,7 @@ public class IsMethodCompilableTest extends CompilerWhiteBoxTest { for (long i = 0L, n = PER_METHOD_RECOMPILATION_CUTOFF - 1; i < n; ++i) { compileAndDeoptimize(); } - if (!testCase.isOsr && !isCompilable()) { + if (!testCase.isOsr() && !isCompilable()) { // in osr test case count of deopt maybe more than iterations throw new RuntimeException(method + " is not compilable after " + (PER_METHOD_RECOMPILATION_CUTOFF - 1) + " iterations"); @@ -102,7 +100,7 @@ public class IsMethodCompilableTest extends CompilerWhiteBoxTest { && isCompilable(); ++i) { compileAndDeoptimize(); } - if (!testCase.isOsr && i != PER_METHOD_RECOMPILATION_CUTOFF) { + if (!testCase.isOsr() && i != PER_METHOD_RECOMPILATION_CUTOFF) { // in osr test case count of deopt maybe more than iterations throw new RuntimeException(method + " is not compilable after " + i + " iterations, but must only after " diff --git a/hotspot/test/compiler/whitebox/MakeMethodNotCompilableTest.java b/hotspot/test/compiler/whitebox/MakeMethodNotCompilableTest.java index 6a1e3613fec..cbd65da45bd 100644 --- a/hotspot/test/compiler/whitebox/MakeMethodNotCompilableTest.java +++ b/hotspot/test/compiler/whitebox/MakeMethodNotCompilableTest.java @@ -27,26 +27,17 @@ * @library /testlibrary /testlibrary/whitebox * @build MakeMethodNotCompilableTest * @run main ClassFileInstaller sun.hotspot.WhiteBox - * @run main/othervm/timeout=2400 -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:CompileCommand=compileonly,TestCase$Helper::* MakeMethodNotCompilableTest + * @run main/othervm/timeout=2400 -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:CompileCommand=compileonly,SimpleTestCase$Helper::* MakeMethodNotCompilableTest * @summary testing of WB::makeMethodNotCompilable() * @author igor.ignatyev@oracle.com */ public class MakeMethodNotCompilableTest extends CompilerWhiteBoxTest { private int bci; public static void main(String[] args) throws Exception { - if (args.length == 0) { - for (TestCase test : TestCase.values()) { - new MakeMethodNotCompilableTest(test).runTest(); - } - } else { - for (String name : args) { - new MakeMethodNotCompilableTest( - TestCase.valueOf(name)).runTest(); - } - } + CompilerWhiteBoxTest.main(MakeMethodNotCompilableTest::new, args); } - public MakeMethodNotCompilableTest(TestCase testCase) { + private MakeMethodNotCompilableTest(TestCase testCase) { super(testCase); // to prevent inlining of #method WHITE_BOX.testSetDontInlineMethod(method, true); @@ -62,7 +53,7 @@ public class MakeMethodNotCompilableTest extends CompilerWhiteBoxTest { */ @Override protected void test() throws Exception { - if (testCase.isOsr && CompilerWhiteBoxTest.MODE.startsWith( + if (testCase.isOsr() && CompilerWhiteBoxTest.MODE.startsWith( "compiled ")) { System.err.printf("Warning: %s is not applicable in %s%n", testCase.name(), CompilerWhiteBoxTest.MODE); diff --git a/hotspot/test/compiler/whitebox/SetDontInlineMethodTest.java b/hotspot/test/compiler/whitebox/SetDontInlineMethodTest.java index e2bff376cd1..ae42d531ab6 100644 --- a/hotspot/test/compiler/whitebox/SetDontInlineMethodTest.java +++ b/hotspot/test/compiler/whitebox/SetDontInlineMethodTest.java @@ -27,19 +27,17 @@ * @library /testlibrary /testlibrary/whitebox * @build SetDontInlineMethodTest * @run main ClassFileInstaller sun.hotspot.WhiteBox - * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:CompileCommand=compileonly,TestCase$Helper::* SetDontInlineMethodTest + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:CompileCommand=compileonly,SimpleTestCase$Helper::* SetDontInlineMethodTest * @summary testing of WB::testSetDontInlineMethod() * @author igor.ignatyev@oracle.com */ public class SetDontInlineMethodTest extends CompilerWhiteBoxTest { public static void main(String[] args) throws Exception { - for (TestCase test : TestCase.values()) { - new SetDontInlineMethodTest(test).runTest(); - } + CompilerWhiteBoxTest.main(SetDontInlineMethodTest::new, args); } - public SetDontInlineMethodTest(TestCase testCase) { + private SetDontInlineMethodTest(TestCase testCase) { super(testCase); } diff --git a/hotspot/test/compiler/whitebox/SetForceInlineMethodTest.java b/hotspot/test/compiler/whitebox/SetForceInlineMethodTest.java index 5aa90c3fcd6..086d7c22ef5 100644 --- a/hotspot/test/compiler/whitebox/SetForceInlineMethodTest.java +++ b/hotspot/test/compiler/whitebox/SetForceInlineMethodTest.java @@ -27,19 +27,17 @@ * @library /testlibrary /testlibrary/whitebox * @build SetForceInlineMethodTest * @run main ClassFileInstaller sun.hotspot.WhiteBox - * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:CompileCommand=compileonly,TestCase$Helper::* SetForceInlineMethodTest + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:CompileCommand=compileonly,SimpleTestCase$Helper::* SetForceInlineMethodTest * @summary testing of WB::testSetForceInlineMethod() * @author igor.ignatyev@oracle.com */ public class SetForceInlineMethodTest extends CompilerWhiteBoxTest { public static void main(String[] args) throws Exception { - for (TestCase test : TestCase.values()) { - new SetForceInlineMethodTest(test).runTest(); - } + CompilerWhiteBoxTest.main(SetForceInlineMethodTest::new, args); } - public SetForceInlineMethodTest(TestCase testCase) { + private SetForceInlineMethodTest(TestCase testCase) { super(testCase); } From 9169a8f064eb3edd344b02a5b1601b9e1059773c Mon Sep 17 00:00:00 2001 From: Harold Seigel Date: Wed, 4 Dec 2013 08:10:31 -0500 Subject: [PATCH 015/377] 8027458: VM anonymous classes: wrong context for protected access checks Use the anonymous class's host class for protected access checks Reviewed-by: acorn, coleenp, lfoltan --- hotspot/src/share/vm/runtime/reflection.cpp | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/hotspot/src/share/vm/runtime/reflection.cpp b/hotspot/src/share/vm/runtime/reflection.cpp index 0a51b097e11..a8d24fa6d10 100644 --- a/hotspot/src/share/vm/runtime/reflection.cpp +++ b/hotspot/src/share/vm/runtime/reflection.cpp @@ -537,15 +537,26 @@ bool Reflection::verify_field_access(Klass* current_class, return true; } + Klass* host_class = current_class; + while (host_class->oop_is_instance() && + InstanceKlass::cast(host_class)->is_anonymous()) { + Klass* next_host_class = InstanceKlass::cast(host_class)->host_klass(); + if (next_host_class == NULL) break; + host_class = next_host_class; + } + if (host_class == field_class) { + return true; + } + if (access.is_protected()) { if (!protected_restriction) { - // See if current_class is a subclass of field_class - if (current_class->is_subclass_of(field_class)) { + // See if current_class (or outermost host class) is a subclass of field_class + if (host_class->is_subclass_of(field_class)) { if (access.is_static() || // static fields are ok, see 6622385 current_class == resolved_class || field_class == resolved_class || - current_class->is_subclass_of(resolved_class) || - resolved_class->is_subclass_of(current_class)) { + host_class->is_subclass_of(resolved_class) || + resolved_class->is_subclass_of(host_class)) { return true; } } From 62e1b6eddd3e063d0a0bae2b123939ff77667747 Mon Sep 17 00:00:00 2001 From: Staffan Larsen Date: Wed, 4 Dec 2013 14:43:50 +0100 Subject: [PATCH 016/377] 8029395: SA: jstack throws WrongTypeException SA missed some TLABs Reviewed-by: dsamersoff, mgerdin, brutisso --- .../sun/jvm/hotspot/oops/ObjectHeap.java | 58 ++++++++++++------- .../runtime/ThreadLocalAllocBuffer.java | 2 +- 2 files changed, 38 insertions(+), 22 deletions(-) diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ObjectHeap.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ObjectHeap.java index e663ee8e18f..7c255a2e295 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ObjectHeap.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ObjectHeap.java @@ -364,7 +364,7 @@ public class ObjectHeap { } catch (AddressException e) { // This is okay at the top of these regions - } + } catch (UnknownOopException e) { // This is okay at the top of these regions } @@ -373,7 +373,7 @@ public class ObjectHeap { visitor.epilogue(); } - private void addLiveRegions(List input, List output) { + private void addLiveRegions(String name, List input, List output) { for (Iterator itr = input.iterator(); itr.hasNext();) { MemRegion reg = (MemRegion) itr.next(); Address top = reg.end(); @@ -386,6 +386,9 @@ public class ObjectHeap { } output.add(top); output.add(bottom); + if (DEBUG) { + System.err.println("Live region: " + name + ": " + bottom + ", " + top); + } } } @@ -395,7 +398,7 @@ public class ObjectHeap { } public void doSpace(Space s) { - addLiveRegions(s.getLiveRegions(), liveRegions); + addLiveRegions(s.toString(), s.getLiveRegions(), liveRegions); } private List liveRegions; } @@ -426,11 +429,11 @@ public class ObjectHeap { ParallelScavengeHeap psh = (ParallelScavengeHeap) heap; PSYoungGen youngGen = psh.youngGen(); // Add eden space - addLiveRegions(youngGen.edenSpace().getLiveRegions(), liveRegions); + addLiveRegions("eden", youngGen.edenSpace().getLiveRegions(), liveRegions); // Add from-space but not to-space - addLiveRegions(youngGen.fromSpace().getLiveRegions(), liveRegions); + addLiveRegions("from", youngGen.fromSpace().getLiveRegions(), liveRegions); PSOldGen oldGen = psh.oldGen(); - addLiveRegions(oldGen.objectSpace().getLiveRegions(), liveRegions); + addLiveRegions("old ", oldGen.objectSpace().getLiveRegions(), liveRegions); } else if (heap instanceof G1CollectedHeap) { G1CollectedHeap g1h = (G1CollectedHeap) heap; g1h.heapRegionIterate(lrc); @@ -451,23 +454,27 @@ public class ObjectHeap { if (VM.getVM().getUseTLAB()) { for (JavaThread thread = VM.getVM().getThreads().first(); thread != null; thread = thread.next()) { - if (thread.isJavaThread()) { - ThreadLocalAllocBuffer tlab = thread.tlab(); - if (tlab.start() != null) { - if ((tlab.top() == null) || (tlab.end() == null)) { - System.err.print("Warning: skipping invalid TLAB for thread "); + ThreadLocalAllocBuffer tlab = thread.tlab(); + if (tlab.start() != null) { + if ((tlab.top() == null) || (tlab.end() == null)) { + System.err.print("Warning: skipping invalid TLAB for thread "); + thread.printThreadIDOn(System.err); + System.err.println(); + } else { + if (DEBUG) { + System.err.print("TLAB for " + thread.getThreadName() + ", #"); thread.printThreadIDOn(System.err); - System.err.println(); - } else { - // Go from: - // - below start() to start() - // - start() to top() - // - end() and above - liveRegions.add(tlab.start()); - liveRegions.add(tlab.start()); - liveRegions.add(tlab.top()); - liveRegions.add(tlab.hardEnd()); + System.err.print(": "); + tlab.printOn(System.err); } + // Go from: + // - below start() to start() + // - start() to top() + // - end() and above + liveRegions.add(tlab.start()); + liveRegions.add(tlab.start()); + liveRegions.add(tlab.top()); + liveRegions.add(tlab.hardEnd()); } } } @@ -480,6 +487,15 @@ public class ObjectHeap { Assert.that(liveRegions.size() % 2 == 0, "Must have even number of region boundaries"); } + if (DEBUG) { + System.err.println("liveRegions:"); + for (int i = 0; i < liveRegions.size(); i += 2) { + Address bottom = (Address) liveRegions.get(i); + Address top = (Address) liveRegions.get(i+1); + System.err.println(" " + bottom + " - " + top); + } + } + return liveRegions; } diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/ThreadLocalAllocBuffer.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/ThreadLocalAllocBuffer.java index 738dc94fa91..c07a0dae4bf 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/ThreadLocalAllocBuffer.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/ThreadLocalAllocBuffer.java @@ -109,6 +109,6 @@ public class ThreadLocalAllocBuffer extends VMObject { public void printOn(PrintStream tty) { tty.println(" [" + start() + "," + - top() + "," + end() + ")"); + top() + "," + end() + ",{" + hardEnd() + "})"); } } From cd7d5ca1254ed26d2aaeac01627d03e61a6f2553 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20Gr=C3=B6nlund?= Date: Thu, 5 Dec 2013 12:35:38 +0100 Subject: [PATCH 017/377] 8028412: AsyncGetCallTrace() is broken on x86 in JDK 7u40 Reviewed-by: kvn, sspitsyn --- hotspot/src/cpu/x86/vm/frame_x86.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/hotspot/src/cpu/x86/vm/frame_x86.cpp b/hotspot/src/cpu/x86/vm/frame_x86.cpp index f0de7a44e76..4e83863a9f9 100644 --- a/hotspot/src/cpu/x86/vm/frame_x86.cpp +++ b/hotspot/src/cpu/x86/vm/frame_x86.cpp @@ -94,13 +94,6 @@ bool frame::safe_for_sender(JavaThread *thread) { // other generic buffer blobs are more problematic so we just assume they are // ok. adapter blobs never have a frame complete and are never ok. - // check for a valid frame_size, otherwise we are unlikely to get a valid sender_pc - - if (!Interpreter::contains(_pc) && _cb->frame_size() <= 0) { - //assert(0, "Invalid frame_size"); - return false; - } - if (!_cb->is_frame_complete_at(_pc)) { if (_cb->is_nmethod() || _cb->is_adapter_blob() || _cb->is_runtime_stub()) { return false; @@ -144,6 +137,11 @@ bool frame::safe_for_sender(JavaThread *thread) { // must be some sort of compiled/runtime frame // fp does not have to be safe (although it could be check for c1?) + // check for a valid frame_size, otherwise we are unlikely to get a valid sender_pc + if (_cb->frame_size() <= 0) { + return false; + } + sender_sp = _unextended_sp + _cb->frame_size(); // On Intel the return_address is always the word on the stack sender_pc = (address) *(sender_sp-1); From 2078c58bbfed523f6d4df6a619b8904c31d330f1 Mon Sep 17 00:00:00 2001 From: Lois Foltan Date: Fri, 6 Dec 2013 11:33:10 -0500 Subject: [PATCH 018/377] 8029415: java/lang/reflect/Method/invoke/TestPrivateInterfaceMethodReflect.java fails on all platforms with hs25-b61 Check first that a class is not a dynamically-generated bytecode associated with 1.4 reflection implementation, to emitting an ICCE of an invokespecial IMR of a method in an indirect superinterface. Reviewed-by: acorn, hseigel --- hotspot/src/share/vm/interpreter/linkResolver.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/hotspot/src/share/vm/interpreter/linkResolver.cpp b/hotspot/src/share/vm/interpreter/linkResolver.cpp index 573ccc1cf62..d1d38d0b450 100644 --- a/hotspot/src/share/vm/interpreter/linkResolver.cpp +++ b/hotspot/src/share/vm/interpreter/linkResolver.cpp @@ -943,8 +943,17 @@ void LinkResolver::linktime_resolve_special_method(methodHandle& resolved_method Klass *klass_to_check = !InstanceKlass::cast(current_klass())->is_anonymous() ? current_klass() : InstanceKlass::cast(current_klass())->host_klass(); + // As of the fix for 4486457 we disable verification for all of the + // dynamically-generated bytecodes associated with the 1.4 + // reflection implementation, not just those associated with + // sun/reflect/SerializationConstructorAccessor. + bool is_reflect = JDK_Version::is_gte_jdk14x_version() && + UseNewReflection && + klass_to_check->is_subclass_of( + SystemDictionary::reflect_MagicAccessorImpl_klass()); - if (!InstanceKlass::cast(klass_to_check)->is_same_or_direct_interface(resolved_klass())) { + if (!is_reflect && + !InstanceKlass::cast(klass_to_check)->is_same_or_direct_interface(resolved_klass())) { ResourceMark rm(THREAD); char buf[200]; jio_snprintf(buf, sizeof(buf), From 5ece6fc7fd1592740837079f0084b9f6ba44b0f4 Mon Sep 17 00:00:00 2001 From: Lois Foltan Date: Tue, 10 Dec 2013 16:18:26 -0500 Subject: [PATCH 019/377] 8028741: Interface Method Resolution should skip static and non-public methods in j.l.Object Implementation of JDK 8 JVMS 5.4.3.4 specification change to skip static and non-public methods of java.lang.Object for interface method resolution. Reviewed-by: acorn, coleenp --- .../src/share/vm/interpreter/linkResolver.cpp | 42 ++++++++++--------- .../src/share/vm/interpreter/linkResolver.hpp | 2 +- .../test/runtime/8024804/RegisterNatives.java | 12 +++--- 3 files changed, 29 insertions(+), 27 deletions(-) diff --git a/hotspot/src/share/vm/interpreter/linkResolver.cpp b/hotspot/src/share/vm/interpreter/linkResolver.cpp index d1d38d0b450..0187d352f11 100644 --- a/hotspot/src/share/vm/interpreter/linkResolver.cpp +++ b/hotspot/src/share/vm/interpreter/linkResolver.cpp @@ -242,8 +242,20 @@ void LinkResolver::resolve_klass(KlassHandle& result, constantPoolHandle pool, i // Look up method in klasses, including static methods // Then look up local default methods -void LinkResolver::lookup_method_in_klasses(methodHandle& result, KlassHandle klass, Symbol* name, Symbol* signature, bool checkpolymorphism, TRAPS) { +void LinkResolver::lookup_method_in_klasses(methodHandle& result, KlassHandle klass, Symbol* name, Symbol* signature, bool checkpolymorphism, bool in_imethod_resolve, TRAPS) { Method* result_oop = klass->uncached_lookup_method(name, signature); + + // JDK 8, JVMS 5.4.3.4: Interface method resolution should + // ignore static and non-public methods of java.lang.Object, + // like clone, finalize, registerNatives. + if (in_imethod_resolve && + result_oop != NULL && + klass->is_interface() && + (result_oop->is_static() || !result_oop->is_public()) && + result_oop->method_holder() == SystemDictionary::Object_klass()) { + result_oop = NULL; + } + if (result_oop == NULL) { Array* default_methods = InstanceKlass::cast(klass())->default_methods(); if (default_methods != NULL) { @@ -420,28 +432,18 @@ void LinkResolver::check_method_accessability(KlassHandle ref_klass, AccessFlags flags = sel_method->access_flags(); - // Special case #1: arrays always override "clone". JVMS 2.15. + // Special case: arrays always override "clone". JVMS 2.15. // If the resolved klass is an array class, and the declaring class // is java.lang.Object and the method is "clone", set the flags // to public. - // Special case #2: If the resolved klass is an interface, and - // the declaring class is java.lang.Object, and the method is - // "clone" or "finalize", set the flags to public. If the - // resolved interface does not contain "clone" or "finalize" - // methods, the method/interface method resolution looks to - // the interface's super class, java.lang.Object. With JDK 8 - // interface accessability check requirement, special casing - // this scenario is necessary to avoid an IAE. // - // We'll check for each method name first and then java.lang.Object - // to best short-circuit out of these tests. - if (((sel_method->name() == vmSymbols::clone_name() && - (resolved_klass->oop_is_array() || resolved_klass->is_interface())) || - (sel_method->name() == vmSymbols::finalize_method_name() && - resolved_klass->is_interface())) && - sel_klass() == SystemDictionary::Object_klass()) { + // We'll check for the method name first, as that's most likely + // to be false (so we'll short-circuit out of these tests). + if (sel_method->name() == vmSymbols::clone_name() && + sel_klass() == SystemDictionary::Object_klass() && + resolved_klass->oop_is_array()) { // We need to change "protected" to "public". - assert(flags.is_protected(), "clone or finalize not protected?"); + assert(flags.is_protected(), "clone not protected?"); jint new_flags = flags.as_int(); new_flags = new_flags & (~JVM_ACC_PROTECTED); new_flags = new_flags | JVM_ACC_PUBLIC; @@ -531,7 +533,7 @@ void LinkResolver::resolve_method(methodHandle& resolved_method, KlassHandle res } // 2. lookup method in resolved klass and its super klasses - lookup_method_in_klasses(resolved_method, resolved_klass, method_name, method_signature, true, CHECK); + lookup_method_in_klasses(resolved_method, resolved_klass, method_name, method_signature, true, false, CHECK); if (resolved_method.is_null()) { // not found in the class hierarchy // 3. lookup method in all the interfaces implemented by the resolved klass @@ -628,7 +630,7 @@ void LinkResolver::resolve_interface_method(methodHandle& resolved_method, // lookup method in this interface or its super, java.lang.Object // JDK8: also look for static methods - lookup_method_in_klasses(resolved_method, resolved_klass, method_name, method_signature, false, CHECK); + lookup_method_in_klasses(resolved_method, resolved_klass, method_name, method_signature, false, true, CHECK); if (resolved_method.is_null()) { // lookup method in all the super-interfaces diff --git a/hotspot/src/share/vm/interpreter/linkResolver.hpp b/hotspot/src/share/vm/interpreter/linkResolver.hpp index 4b13de8789f..f598380591b 100644 --- a/hotspot/src/share/vm/interpreter/linkResolver.hpp +++ b/hotspot/src/share/vm/interpreter/linkResolver.hpp @@ -124,7 +124,7 @@ class LinkResolver: AllStatic { friend class klassItable; private: - static void lookup_method_in_klasses (methodHandle& result, KlassHandle klass, Symbol* name, Symbol* signature, bool checkpolymorphism, TRAPS); + static void lookup_method_in_klasses (methodHandle& result, KlassHandle klass, Symbol* name, Symbol* signature, bool checkpolymorphism, bool in_imethod_resolve, TRAPS); static void lookup_instance_method_in_klasses (methodHandle& result, KlassHandle klass, Symbol* name, Symbol* signature, TRAPS); static void lookup_method_in_interfaces (methodHandle& result, KlassHandle klass, Symbol* name, Symbol* signature, TRAPS); static void lookup_polymorphic_method (methodHandle& result, KlassHandle klass, Symbol* name, Symbol* signature, diff --git a/hotspot/test/runtime/8024804/RegisterNatives.java b/hotspot/test/runtime/8024804/RegisterNatives.java index a0c5ee1f351..e46812752b3 100644 --- a/hotspot/test/runtime/8024804/RegisterNatives.java +++ b/hotspot/test/runtime/8024804/RegisterNatives.java @@ -22,10 +22,10 @@ */ /* - * @ignore 8028741 * @test * @bug 8024804 - * @summary registerNatives() interface resolution should receive IAE + * @bug 8028741 + * @summary interface method resolution should skip finding j.l.Object's registerNatives() and succeed in selecting class B's registerNatives() * @run main RegisterNatives */ public class RegisterNatives { @@ -38,10 +38,10 @@ public class RegisterNatives { try { val.registerNatives(); } catch (IllegalAccessError e) { - System.out.println("TEST PASSES - according to current JVM spec, IAE expected\n"); - return; + System.out.println("TEST FAILS - JDK 8 JVMS, static and non-public methods of j.l.Object should be ignored during interface method resolution\n"); + e.printStackTrace(); + throw e; } - System.out.println("TEST FAILS - no IAE resulted\n"); - System.exit(1); + System.out.println("TEST PASSES - no IAE resulted\n"); } } From 5d5b1157d16ce0163a4172f32cfd2bb69978a5ab Mon Sep 17 00:00:00 2001 From: Erik Helin Date: Mon, 9 Dec 2013 08:20:45 +0100 Subject: [PATCH 020/377] 8029326: G1 does not check if threads gets created Reviewed-by: brutisso, jmasa, jwilhelm --- .../src/share/vm/gc_implementation/g1/concurrentG1Refine.cpp | 5 +++++ hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp | 3 +++ 2 files changed, 8 insertions(+) diff --git a/hotspot/src/share/vm/gc_implementation/g1/concurrentG1Refine.cpp b/hotspot/src/share/vm/gc_implementation/g1/concurrentG1Refine.cpp index f0b4da8a885..2a6acd4a7ee 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/concurrentG1Refine.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/concurrentG1Refine.cpp @@ -27,6 +27,7 @@ #include "gc_implementation/g1/concurrentG1RefineThread.hpp" #include "gc_implementation/g1/g1CollectedHeap.inline.hpp" #include "gc_implementation/g1/g1HotCardCache.hpp" +#include "runtime/java.hpp" ConcurrentG1Refine::ConcurrentG1Refine(G1CollectedHeap* g1h) : _threads(NULL), _n_threads(0), @@ -62,6 +63,10 @@ ConcurrentG1Refine::ConcurrentG1Refine(G1CollectedHeap* g1h) : for (int i = _n_threads - 1; i >= 0; i--) { ConcurrentG1RefineThread* t = new ConcurrentG1RefineThread(this, next, worker_id_offset, i); assert(t != NULL, "Conc refine should have been created"); + if (t->osthread() == NULL) { + vm_shutdown_during_initialization("Could not create ConcurrentG1RefineThread"); + } + assert(t->cg1r() == this, "Conc refine thread should refer to this"); _threads[i] = t; next = t; diff --git a/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp b/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp index 282dd722228..4e458312666 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp @@ -553,6 +553,9 @@ ConcurrentMark::ConcurrentMark(G1CollectedHeap* g1h, ReservedSpace heap_rs) : _cmThread = new ConcurrentMarkThread(this); assert(cmThread() != NULL, "CM Thread should have been created"); assert(cmThread()->cm() != NULL, "CM Thread should refer to this cm"); + if (_cmThread->osthread() == NULL) { + vm_shutdown_during_initialization("Could not create ConcurrentMarkThread"); + } assert(CGC_lock != NULL, "Where's the CGC_lock?"); assert(_markBitMap1.covers(heap_rs), "_markBitMap1 inconsistency"); From 5f4d0e9c253b8d9c76b5dd1fb6fc5189cf0e254a Mon Sep 17 00:00:00 2001 From: Stefan Johansson Date: Tue, 10 Dec 2013 10:31:00 +0100 Subject: [PATCH 021/377] 8028993: Full collections with ParallelScavenge slower in JDK 8 compared to 7u40 Reducing the number of calls to follow_class_loader to speed up the marking phase. Also removed some unnecessary calls to adjust_klass. Reviewed-by: stefank, jmasa, mgerdin --- .../parallelScavenge/psParallelCompact.cpp | 21 ------------ .../parallelScavenge/psParallelCompact.hpp | 10 +++--- .../vm/oops/instanceClassLoaderKlass.cpp | 4 --- hotspot/src/share/vm/oops/instanceKlass.cpp | 1 - .../src/share/vm/oops/instanceMirrorKlass.cpp | 33 +++++++++++-------- hotspot/src/share/vm/oops/objArrayKlass.cpp | 1 - hotspot/src/share/vm/oops/oop.hpp | 5 --- hotspot/src/share/vm/oops/oop.pcgc.inline.hpp | 4 --- 8 files changed, 25 insertions(+), 54 deletions(-) diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp index 8e9dd8ddd72..8b4f0bd46f1 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp @@ -2433,20 +2433,6 @@ void PSParallelCompact::marking_phase(ParCompactionManager* cm, _gc_tracer.report_object_count_after_gc(is_alive_closure()); } -void PSParallelCompact::follow_klass(ParCompactionManager* cm, Klass* klass) { - ClassLoaderData* cld = klass->class_loader_data(); - // The actual processing of the klass is done when we - // traverse the list of Klasses in the class loader data. - PSParallelCompact::follow_class_loader(cm, cld); -} - -void PSParallelCompact::adjust_klass(ParCompactionManager* cm, Klass* klass) { - ClassLoaderData* cld = klass->class_loader_data(); - // The actual processing of the klass is done when we - // traverse the list of Klasses in the class loader data. - PSParallelCompact::adjust_class_loader(cm, cld); -} - void PSParallelCompact::follow_class_loader(ParCompactionManager* cm, ClassLoaderData* cld) { PSParallelCompact::MarkAndPushClosure mark_and_push_closure(cm); @@ -2455,13 +2441,6 @@ void PSParallelCompact::follow_class_loader(ParCompactionManager* cm, cld->oops_do(&mark_and_push_closure, &follow_klass_closure, true); } -void PSParallelCompact::adjust_class_loader(ParCompactionManager* cm, - ClassLoaderData* cld) { - cld->oops_do(PSParallelCompact::adjust_pointer_closure(), - PSParallelCompact::adjust_klass_closure(), - true); -} - // This should be moved to the shared markSweep code! class PSAlwaysTrueClosure: public BoolObjectClosure { public: diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.hpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.hpp index 2ba4eb45f5c..0f1b77b92f2 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.hpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.hpp @@ -1200,13 +1200,10 @@ class PSParallelCompact : AllStatic { T* p); template static inline void adjust_pointer(T* p); - static void follow_klass(ParCompactionManager* cm, Klass* klass); - static void adjust_klass(ParCompactionManager* cm, Klass* klass); + static inline void follow_klass(ParCompactionManager* cm, Klass* klass); static void follow_class_loader(ParCompactionManager* cm, ClassLoaderData* klass); - static void adjust_class_loader(ParCompactionManager* cm, - ClassLoaderData* klass); // Compaction support. // Return true if p is in the range [beg_addr, end_addr). @@ -1380,6 +1377,11 @@ inline void PSParallelCompact::adjust_pointer(T* p) { } } +inline void PSParallelCompact::follow_klass(ParCompactionManager* cm, Klass* klass) { + oop holder = klass->klass_holder(); + PSParallelCompact::mark_and_push(cm, &holder); +} + template inline void PSParallelCompact::KeepAliveClosure::do_oop_work(T* p) { mark_and_push(_compaction_manager, p); diff --git a/hotspot/src/share/vm/oops/instanceClassLoaderKlass.cpp b/hotspot/src/share/vm/oops/instanceClassLoaderKlass.cpp index 507206fc854..e57a0b77197 100644 --- a/hotspot/src/share/vm/oops/instanceClassLoaderKlass.cpp +++ b/hotspot/src/share/vm/oops/instanceClassLoaderKlass.cpp @@ -150,10 +150,6 @@ void InstanceClassLoaderKlass::oop_push_contents(PSPromotionManager* pm, oop obj int InstanceClassLoaderKlass::oop_update_pointers(ParCompactionManager* cm, oop obj) { InstanceKlass::oop_update_pointers(cm, obj); - ClassLoaderData * const loader_data = java_lang_ClassLoader::loader_data(obj); - if (loader_data != NULL) { - PSParallelCompact::adjust_class_loader(cm, loader_data); - } return size_helper(); } #endif // INCLUDE_ALL_GCS diff --git a/hotspot/src/share/vm/oops/instanceKlass.cpp b/hotspot/src/share/vm/oops/instanceKlass.cpp index 77be5307db6..7c63c481057 100644 --- a/hotspot/src/share/vm/oops/instanceKlass.cpp +++ b/hotspot/src/share/vm/oops/instanceKlass.cpp @@ -2199,7 +2199,6 @@ int InstanceKlass::oop_update_pointers(ParCompactionManager* cm, oop obj) { obj, \ PSParallelCompact::adjust_pointer(p), \ assert_is_in) - obj->update_header(cm); return size; } diff --git a/hotspot/src/share/vm/oops/instanceMirrorKlass.cpp b/hotspot/src/share/vm/oops/instanceMirrorKlass.cpp index 825633247d1..0e903b39a5e 100644 --- a/hotspot/src/share/vm/oops/instanceMirrorKlass.cpp +++ b/hotspot/src/share/vm/oops/instanceMirrorKlass.cpp @@ -155,8 +155,13 @@ void InstanceMirrorKlass::oop_follow_contents(oop obj) { // Follow the klass field in the mirror. Klass* klass = java_lang_Class::as_Klass(obj); if (klass != NULL) { - // For anonymous classes we need to handle the class loader data, - // otherwise it won't be claimed and can be unloaded. + // An anonymous class doesn't have its own class loader, so the call + // to follow_klass will mark and push its java mirror instead of the + // class loader. When handling the java mirror for an anonymous class + // we need to make sure its class loader data is claimed, this is done + // by calling follow_class_loader explicitly. For non-anonymous classes + // the call to follow_class_loader is made when the class loader itself + // is handled. if (klass->oop_is_instance() && InstanceKlass::cast(klass)->is_anonymous()) { MarkSweep::follow_class_loader(klass->class_loader_data()); } else { @@ -183,7 +188,18 @@ void InstanceMirrorKlass::oop_follow_contents(ParCompactionManager* cm, // Follow the klass field in the mirror. Klass* klass = java_lang_Class::as_Klass(obj); if (klass != NULL) { - PSParallelCompact::follow_klass(cm, klass); + // An anonymous class doesn't have its own class loader, so the call + // to follow_klass will mark and push its java mirror instead of the + // class loader. When handling the java mirror for an anonymous class + // we need to make sure its class loader data is claimed, this is done + // by calling follow_class_loader explicitly. For non-anonymous classes + // the call to follow_class_loader is made when the class loader itself + // is handled. + if (klass->oop_is_instance() && InstanceKlass::cast(klass)->is_anonymous()) { + PSParallelCompact::follow_class_loader(cm, klass->class_loader_data()); + } else { + PSParallelCompact::follow_klass(cm, klass); + } } else { // If klass is NULL then this a mirror for a primitive type. // We don't have to follow them, since they are handled as strong @@ -332,17 +348,6 @@ int InstanceMirrorKlass::oop_update_pointers(ParCompactionManager* cm, oop obj) int size = oop_size(obj); InstanceKlass::oop_update_pointers(cm, obj); - // Follow the klass field in the mirror. - Klass* klass = java_lang_Class::as_Klass(obj); - if (klass != NULL) { - PSParallelCompact::adjust_klass(cm, klass); - } else { - // If klass is NULL then this a mirror for a primitive type. - // We don't have to follow them, since they are handled as strong - // roots in Universe::oops_do. - assert(java_lang_Class::is_primitive(obj), "Sanity check"); - } - InstanceMirrorKlass_OOP_ITERATE( \ start_of_static_fields(obj), java_lang_Class::static_oop_field_count(obj),\ PSParallelCompact::adjust_pointer(p), \ diff --git a/hotspot/src/share/vm/oops/objArrayKlass.cpp b/hotspot/src/share/vm/oops/objArrayKlass.cpp index 94c990a728e..4631fdd79e2 100644 --- a/hotspot/src/share/vm/oops/objArrayKlass.cpp +++ b/hotspot/src/share/vm/oops/objArrayKlass.cpp @@ -587,7 +587,6 @@ int ObjArrayKlass::oop_update_pointers(ParCompactionManager* cm, oop obj) { assert (obj->is_objArray(), "obj must be obj array"); objArrayOop a = objArrayOop(obj); int size = a->object_size(); - a->update_header(cm); ObjArrayKlass_OOP_ITERATE(a, p, PSParallelCompact::adjust_pointer(p)) return size; } diff --git a/hotspot/src/share/vm/oops/oop.hpp b/hotspot/src/share/vm/oops/oop.hpp index 66a62eaab23..350c0fc6131 100644 --- a/hotspot/src/share/vm/oops/oop.hpp +++ b/hotspot/src/share/vm/oops/oop.hpp @@ -328,11 +328,6 @@ class oopDesc { // return the size of this oop. This is used by the MarkSweep collector. int adjust_pointers(); -#if INCLUDE_ALL_GCS - // Parallel old - void update_header(ParCompactionManager* cm); -#endif // INCLUDE_ALL_GCS - // mark-sweep support void follow_body(int begin, int end); diff --git a/hotspot/src/share/vm/oops/oop.pcgc.inline.hpp b/hotspot/src/share/vm/oops/oop.pcgc.inline.hpp index d8e40477f79..178c8f461ff 100644 --- a/hotspot/src/share/vm/oops/oop.pcgc.inline.hpp +++ b/hotspot/src/share/vm/oops/oop.pcgc.inline.hpp @@ -80,8 +80,4 @@ inline oop oopDesc::forward_to_atomic(oop p) { return forwardee(); } -inline void oopDesc::update_header(ParCompactionManager* cm) { - PSParallelCompact::adjust_klass(cm, klass()); -} - #endif // SHARE_VM_OOPS_OOP_PCGC_INLINE_HPP From 0454a45a80189b56c6519fc3f0f55059ec990a4e Mon Sep 17 00:00:00 2001 From: Stefan Karlsson Date: Mon, 9 Dec 2013 10:03:39 +0100 Subject: [PATCH 022/377] 8029106: JVM crashes in Metachunk::Metachunk during parallel class redefinition (PrivateMLetController, anonymous-simple_copy_1) Fixed overflow bug in VirtualSpaceNode::is_available Reviewed-by: mgerdin, brutisso, coleenp, jmasa --- hotspot/src/share/vm/memory/metaspace.cpp | 74 ++++++++++++++++++++++- 1 file changed, 73 insertions(+), 1 deletion(-) diff --git a/hotspot/src/share/vm/memory/metaspace.cpp b/hotspot/src/share/vm/memory/metaspace.cpp index 826dde3838c..19c03661a44 100644 --- a/hotspot/src/share/vm/memory/metaspace.cpp +++ b/hotspot/src/share/vm/memory/metaspace.cpp @@ -287,7 +287,7 @@ class VirtualSpaceNode : public CHeapObj { VirtualSpace* virtual_space() const { return (VirtualSpace*) &_virtual_space; } // Returns true if "word_size" is available in the VirtualSpace - bool is_available(size_t word_size) { return _top + word_size <= end(); } + bool is_available(size_t word_size) { return word_size <= pointer_delta(end(), _top, sizeof(MetaWord)); } MetaWord* top() const { return _top; } void inc_top(size_t word_size) { _top += word_size; } @@ -3641,10 +3641,82 @@ class TestVirtualSpaceNodeTest { } } + +#define assert_is_available_positive(word_size) \ + assert(vsn.is_available(word_size), \ + err_msg(#word_size ": " PTR_FORMAT " bytes were not available in " \ + "VirtualSpaceNode [" PTR_FORMAT ", " PTR_FORMAT ")", \ + (uintptr_t)(word_size * BytesPerWord), vsn.bottom(), vsn.end())); + +#define assert_is_available_negative(word_size) \ + assert(!vsn.is_available(word_size), \ + err_msg(#word_size ": " PTR_FORMAT " bytes should not be available in " \ + "VirtualSpaceNode [" PTR_FORMAT ", " PTR_FORMAT ")", \ + (uintptr_t)(word_size * BytesPerWord), vsn.bottom(), vsn.end())); + + static void test_is_available_positive() { + // Reserve some memory. + VirtualSpaceNode vsn(os::vm_allocation_granularity()); + assert(vsn.initialize(), "Failed to setup VirtualSpaceNode"); + + // Commit some memory. + size_t commit_word_size = os::vm_allocation_granularity() / BytesPerWord; + bool expanded = vsn.expand_by(commit_word_size, commit_word_size); + assert(expanded, "Failed to commit"); + + // Check that is_available accepts the committed size. + assert_is_available_positive(commit_word_size); + + // Check that is_available accepts half the committed size. + size_t expand_word_size = commit_word_size / 2; + assert_is_available_positive(expand_word_size); + } + + static void test_is_available_negative() { + // Reserve some memory. + VirtualSpaceNode vsn(os::vm_allocation_granularity()); + assert(vsn.initialize(), "Failed to setup VirtualSpaceNode"); + + // Commit some memory. + size_t commit_word_size = os::vm_allocation_granularity() / BytesPerWord; + bool expanded = vsn.expand_by(commit_word_size, commit_word_size); + assert(expanded, "Failed to commit"); + + // Check that is_available doesn't accept a too large size. + size_t two_times_commit_word_size = commit_word_size * 2; + assert_is_available_negative(two_times_commit_word_size); + } + + static void test_is_available_overflow() { + // Reserve some memory. + VirtualSpaceNode vsn(os::vm_allocation_granularity()); + assert(vsn.initialize(), "Failed to setup VirtualSpaceNode"); + + // Commit some memory. + size_t commit_word_size = os::vm_allocation_granularity() / BytesPerWord; + bool expanded = vsn.expand_by(commit_word_size, commit_word_size); + assert(expanded, "Failed to commit"); + + // Calculate a size that will overflow the virtual space size. + void* virtual_space_max = (void*)(uintptr_t)-1; + size_t bottom_to_max = pointer_delta(virtual_space_max, vsn.bottom(), 1); + size_t overflow_size = bottom_to_max + BytesPerWord; + size_t overflow_word_size = overflow_size / BytesPerWord; + + // Check that is_available can handle the overflow. + assert_is_available_negative(overflow_word_size); + } + + static void test_is_available() { + TestVirtualSpaceNodeTest::test_is_available_positive(); + TestVirtualSpaceNodeTest::test_is_available_negative(); + TestVirtualSpaceNodeTest::test_is_available_overflow(); + } }; void TestVirtualSpaceNode_test() { TestVirtualSpaceNodeTest::test(); + TestVirtualSpaceNodeTest::test_is_available(); } #endif From f3fc753f2621b4a77f63bc721973842cda5c9327 Mon Sep 17 00:00:00 2001 From: Vladimir Kozlov Date: Fri, 6 Dec 2013 12:11:51 -0800 Subject: [PATCH 023/377] 8028107: Kitchensink crashed with EAV Check the state of caller and callee nmethods and skip call site patching if any of them is not alive Reviewed-by: jrose, twisti --- hotspot/src/share/vm/code/compiledIC.cpp | 4 +-- hotspot/src/share/vm/code/nmethod.cpp | 14 +++++----- hotspot/src/share/vm/code/nmethod.hpp | 15 +++++----- .../src/share/vm/runtime/sharedRuntime.cpp | 28 +++++++++++++++---- 4 files changed, 40 insertions(+), 21 deletions(-) diff --git a/hotspot/src/share/vm/code/compiledIC.cpp b/hotspot/src/share/vm/code/compiledIC.cpp index 489e649fadc..251a4c79c43 100644 --- a/hotspot/src/share/vm/code/compiledIC.cpp +++ b/hotspot/src/share/vm/code/compiledIC.cpp @@ -418,7 +418,7 @@ void CompiledIC::compute_monomorphic_entry(methodHandle method, TRAPS) { nmethod* method_code = method->code(); address entry = NULL; - if (method_code != NULL) { + if (method_code != NULL && method_code->is_in_use()) { // Call to compiled code if (static_bound || is_optimized) { entry = method_code->verified_entry_point(); @@ -545,7 +545,7 @@ void CompiledStaticCall::set(const StaticCallInfo& info) { void CompiledStaticCall::compute_entry(methodHandle m, StaticCallInfo& info) { nmethod* m_code = m->code(); info._callee = m; - if (m_code != NULL) { + if (m_code != NULL && m_code->is_in_use()) { info._to_interpreter = false; info._entry = m_code->verified_entry_point(); } else { diff --git a/hotspot/src/share/vm/code/nmethod.cpp b/hotspot/src/share/vm/code/nmethod.cpp index 68718499a00..b9dd9903440 100644 --- a/hotspot/src/share/vm/code/nmethod.cpp +++ b/hotspot/src/share/vm/code/nmethod.cpp @@ -459,7 +459,7 @@ const char* nmethod::compile_kind() const { // Fill in default values for various flag fields void nmethod::init_defaults() { - _state = alive; + _state = in_use; _marked_for_reclamation = 0; _has_flushed_dependencies = 0; _has_unsafe_access = 0; @@ -1660,8 +1660,8 @@ void nmethod::do_unloading(BoolObjectClosure* is_alive, bool unloading_occurred) CompiledICHolder* cichk_oop = ic->cached_icholder(); if (cichk_oop->holder_method()->method_holder()->is_loader_alive(is_alive) && cichk_oop->holder_klass()->is_loader_alive(is_alive)) { - continue; - } + continue; + } } else { Metadata* ic_oop = ic->cached_metadata(); if (ic_oop != NULL) { @@ -1677,8 +1677,8 @@ void nmethod::do_unloading(BoolObjectClosure* is_alive, bool unloading_occurred) ShouldNotReachHere(); } } - } - ic->set_to_clean(); + } + ic->set_to_clean(); } } } @@ -2393,8 +2393,8 @@ void nmethod::verify() { void nmethod::verify_interrupt_point(address call_site) { // Verify IC only when nmethod installation is finished. - bool is_installed = (method()->code() == this) // nmethod is in state 'alive' and installed - || !this->is_in_use(); // nmethod is installed, but not in 'alive' state + bool is_installed = (method()->code() == this) // nmethod is in state 'in_use' and installed + || !this->is_in_use(); // nmethod is installed, but not in 'in_use' state if (is_installed) { Thread *cur = Thread::current(); if (CompiledIC_lock->owner() == cur || diff --git a/hotspot/src/share/vm/code/nmethod.hpp b/hotspot/src/share/vm/code/nmethod.hpp index 538bcf77837..4e1afcc046b 100644 --- a/hotspot/src/share/vm/code/nmethod.hpp +++ b/hotspot/src/share/vm/code/nmethod.hpp @@ -184,11 +184,12 @@ class nmethod : public CodeBlob { bool _oops_are_stale; // indicates that it's no longer safe to access oops section #endif - enum { alive = 0, - not_entrant = 1, // uncommon trap has happened but activations may still exist - zombie = 2, - unloaded = 3 }; - + enum { in_use = 0, // executable nmethod + not_entrant = 1, // marked for deoptimization but activations may still exist, + // will be transformed to zombie when all activations are gone + zombie = 2, // no activations exist, nmethod is ready for purge + unloaded = 3 }; // there should be no activations, should not be called, + // will be transformed to zombie immediately jbyte _scavenge_root_state; @@ -407,8 +408,8 @@ class nmethod : public CodeBlob { address verified_entry_point() const { return _verified_entry_point; } // if klass is correct // flag accessing and manipulation - bool is_in_use() const { return _state == alive; } - bool is_alive() const { return _state == alive || _state == not_entrant; } + bool is_in_use() const { return _state == in_use; } + bool is_alive() const { return _state == in_use || _state == not_entrant; } bool is_not_entrant() const { return _state == not_entrant; } bool is_zombie() const { return _state == zombie; } bool is_unloaded() const { return _state == unloaded; } diff --git a/hotspot/src/share/vm/runtime/sharedRuntime.cpp b/hotspot/src/share/vm/runtime/sharedRuntime.cpp index e4a2c0afebf..0f521ae5f5e 100644 --- a/hotspot/src/share/vm/runtime/sharedRuntime.cpp +++ b/hotspot/src/share/vm/runtime/sharedRuntime.cpp @@ -1178,12 +1178,12 @@ methodHandle SharedRuntime::resolve_sub_helper(JavaThread *thread, CodeBlob* caller_cb = caller_frame.cb(); guarantee(caller_cb != NULL && caller_cb->is_nmethod(), "must be called from nmethod"); nmethod* caller_nm = caller_cb->as_nmethod_or_null(); + // make sure caller is not getting deoptimized // and removed before we are done with it. // CLEANUP - with lazy deopt shouldn't need this lock nmethodLocker caller_lock(caller_nm); - // determine call info & receiver // note: a) receiver is NULL for static calls // b) an exception is thrown if receiver is NULL for non-static calls @@ -1198,6 +1198,11 @@ methodHandle SharedRuntime::resolve_sub_helper(JavaThread *thread, (!is_virtual && invoke_code == Bytecodes::_invokedynamic) || ( is_virtual && invoke_code != Bytecodes::_invokestatic ), "inconsistent bytecode"); + // We do not patch the call site if the caller nmethod has been made non-entrant. + if (!caller_nm->is_in_use()) { + return callee_method; + } + #ifndef PRODUCT // tracing/debugging/statistics int *addr = (is_optimized) ? (&_resolve_opt_virtual_ctr) : @@ -1237,6 +1242,10 @@ methodHandle SharedRuntime::resolve_sub_helper(JavaThread *thread, // Make sure the callee nmethod does not get deoptimized and removed before // we are done patching the code. nmethod* callee_nm = callee_method->code(); + if (callee_nm != NULL && !callee_nm->is_in_use()) { + // Patch call site to C2I adapter if callee nmethod is deoptimized or unloaded. + callee_nm = NULL; + } nmethodLocker nl_callee(callee_nm); #ifdef ASSERT address dest_entry_point = callee_nm == NULL ? 0 : callee_nm->entry_point(); // used below @@ -1258,15 +1267,24 @@ methodHandle SharedRuntime::resolve_sub_helper(JavaThread *thread, { MutexLocker ml_patch(CompiledIC_lock); + // Lock blocks for safepoint during which both nmethods can change state. + // Now that we are ready to patch if the Method* was redefined then // don't update call site and let the caller retry. - - if (!callee_method->is_old()) { + // Don't update call site if caller nmethod has been made non-entrant + // as it is a waste of time. + // Don't update call site if callee nmethod was unloaded or deoptimized. + // Don't update call site if callee nmethod was replaced by an other nmethod + // which may happen when multiply alive nmethod (tiered compilation) + // will be supported. + if (!callee_method->is_old() && caller_nm->is_in_use() && + (callee_nm == NULL || callee_nm->is_in_use() && (callee_method->code() == callee_nm))) { #ifdef ASSERT // We must not try to patch to jump to an already unloaded method. if (dest_entry_point != 0) { - assert(CodeCache::find_blob(dest_entry_point) != NULL, - "should not unload nmethod while locked"); + CodeBlob* cb = CodeCache::find_blob(dest_entry_point); + assert((cb != NULL) && cb->is_nmethod() && (((nmethod*)cb) == callee_nm), + "should not call unloaded nmethod"); } #endif if (is_virtual) { From e71c8df213fd64091da7d8bedfa68ad020976ed9 Mon Sep 17 00:00:00 2001 From: Christian Thalinger Date: Fri, 6 Dec 2013 16:43:56 -0800 Subject: [PATCH 024/377] 8029366: ShouldNotReachHere error when creating an array with component type of void Reviewed-by: kvn --- hotspot/src/share/vm/opto/memnode.cpp | 5 +++ .../reflection/ArrayNewInstanceOfVoid.java | 44 +++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 hotspot/test/compiler/reflection/ArrayNewInstanceOfVoid.java diff --git a/hotspot/src/share/vm/opto/memnode.cpp b/hotspot/src/share/vm/opto/memnode.cpp index 49694b6e92e..d72340bf6dd 100644 --- a/hotspot/src/share/vm/opto/memnode.cpp +++ b/hotspot/src/share/vm/opto/memnode.cpp @@ -2071,6 +2071,11 @@ const Type *LoadNode::klass_value_common( PhaseTransform *phase ) const { if (t != NULL) { // constant oop => constant klass if (offset == java_lang_Class::array_klass_offset_in_bytes()) { + if (t->is_void()) { + // We cannot create a void array. Since void is a primitive type return null + // klass. Users of this result need to do a null check on the returned klass. + return TypePtr::NULL_PTR; + } return TypeKlassPtr::make(ciArrayKlass::make(t)); } if (!t->is_klass()) { diff --git a/hotspot/test/compiler/reflection/ArrayNewInstanceOfVoid.java b/hotspot/test/compiler/reflection/ArrayNewInstanceOfVoid.java new file mode 100644 index 00000000000..6f8a2735cc9 --- /dev/null +++ b/hotspot/test/compiler/reflection/ArrayNewInstanceOfVoid.java @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * 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 8029366 + * @summary ShouldNotReachHere error when creating an array with component type of void + */ + +public class ArrayNewInstanceOfVoid { + public static void main(String[] args) { + for (int i = 0; i < 100_000; i++) { + test(); + } + } + + private static void test() { + try { + java.lang.reflect.Array.newInstance(void.class, 2); + } catch (IllegalArgumentException e) { + // expected + } + } +} From 5e69eb1595b5608b420bc993615c235409b6305c Mon Sep 17 00:00:00 2001 From: Igor Ignatyev Date: Wed, 11 Dec 2013 01:04:34 +0400 Subject: [PATCH 025/377] 8028122: [TESTBUG] compiler/regalloc/C1ObjectSpillInLogicOp.java Reviewed-by: kvn, twisti --- hotspot/test/compiler/regalloc/C1ObjectSpillInLogicOp.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hotspot/test/compiler/regalloc/C1ObjectSpillInLogicOp.java b/hotspot/test/compiler/regalloc/C1ObjectSpillInLogicOp.java index d6976bd3bdf..17571820b3e 100644 --- a/hotspot/test/compiler/regalloc/C1ObjectSpillInLogicOp.java +++ b/hotspot/test/compiler/regalloc/C1ObjectSpillInLogicOp.java @@ -34,8 +34,9 @@ */ import java.util.concurrent.atomic.*; -class C1ObjectSpillInLogicOp { - static public void main(String[] args) { + +public class C1ObjectSpillInLogicOp { + public static void main(String[] args) { AtomicReferenceArray x = new AtomicReferenceArray(128); Integer y = new Integer(0); for (int i = 0; i < 50000; i++) { From 6780ffeaa6cfdce7ee744584eff040148926e781 Mon Sep 17 00:00:00 2001 From: Igor Ignatyev Date: Wed, 11 Dec 2013 01:09:04 +0400 Subject: [PATCH 026/377] 8029153: [TESTBUG] test/compiler/7141637/SpreadNullArg.java fails because it expects NullPointerException Reviewed-by: twisti --- hotspot/test/compiler/7141637/SpreadNullArg.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/hotspot/test/compiler/7141637/SpreadNullArg.java b/hotspot/test/compiler/7141637/SpreadNullArg.java index 3f3524e19c0..195e106d542 100644 --- a/hotspot/test/compiler/7141637/SpreadNullArg.java +++ b/hotspot/test/compiler/7141637/SpreadNullArg.java @@ -46,13 +46,17 @@ public class SpreadNullArg { mh_spread_target = MethodHandles.lookup().findStatic(SpreadNullArg.class, "target_spread_arg", mt_ref_arg); result = (int) mh_spreadInvoker.invokeExact(mh_spread_target, (Object[]) null); - } catch(NullPointerException e) { - // Expected exception - do nothing! - } catch(Throwable e) { + throw new Error("Expected IllegalArgumentException was not thrown"); + } catch (IllegalArgumentException e) { + System.out.println("Expected exception : " + e); + } catch (Throwable e) { throw new Error(e); } - if (result != 42) throw new Error("Expected NullPointerException was not thrown"); + if (result != 42) { + throw new Error("result [" + result + + "] != 42 : Expected IllegalArgumentException was not thrown?"); + } } public static int target_spread_arg(Integer i1) { From b38f891924c1cdf81205881093cbfc26cea72841 Mon Sep 17 00:00:00 2001 From: Joseph Provino Date: Wed, 11 Dec 2013 13:51:28 -0500 Subject: [PATCH 027/377] 8029566: PPC: OrderAccess::load_acquire(julong) is broken JFR needs this fix to run on PPC Reviewed-by: sla, mikael --- hotspot/src/share/vm/utilities/globalDefinitions_gcc.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/hotspot/src/share/vm/utilities/globalDefinitions_gcc.hpp b/hotspot/src/share/vm/utilities/globalDefinitions_gcc.hpp index a69708f8c8f..f66fb721e3a 100644 --- a/hotspot/src/share/vm/utilities/globalDefinitions_gcc.hpp +++ b/hotspot/src/share/vm/utilities/globalDefinitions_gcc.hpp @@ -174,6 +174,7 @@ typedef uint64_t julong; inline jint jint_cast (jfloat x) { return *(jint* )&x; } inline jlong jlong_cast (jdouble x) { return *(jlong* )&x; } +inline julong julong_cast (jdouble x) { return *(julong* )&x; } inline jfloat jfloat_cast (jint x) { return *(jfloat* )&x; } inline jdouble jdouble_cast(jlong x) { return *(jdouble*)&x; } From 99d963b5eeb15e72c5c22edf189fe20d4fadbfc4 Mon Sep 17 00:00:00 2001 From: Igor Veresov Date: Thu, 12 Dec 2013 11:25:32 -0800 Subject: [PATCH 028/377] 8029668: Kithcensink crashed with guarantee(Assembler::is_simm13(disp)) failed: Do not match large constant offsets Bailout if we try to reference a stack location that we can't encode Reviewed-by: kvn, twisti --- hotspot/src/cpu/sparc/vm/sparc.ad | 47 ++++++++++++++++--------------- 1 file changed, 24 insertions(+), 23 deletions(-) diff --git a/hotspot/src/cpu/sparc/vm/sparc.ad b/hotspot/src/cpu/sparc/vm/sparc.ad index 9d3856245f2..19283874280 100644 --- a/hotspot/src/cpu/sparc/vm/sparc.ad +++ b/hotspot/src/cpu/sparc/vm/sparc.ad @@ -757,7 +757,7 @@ void verify_oops_warning(const MachNode *n, int ideal_op, int mem_op) { #endif -void emit_form3_mem_reg(CodeBuffer &cbuf, const MachNode* n, int primary, int tertiary, +void emit_form3_mem_reg(CodeBuffer &cbuf, PhaseRegAlloc* ra, const MachNode* n, int primary, int tertiary, int src1_enc, int disp32, int src2_enc, int dst_enc) { #ifdef ASSERT @@ -912,8 +912,14 @@ void emit_form3_mem_reg(CodeBuffer &cbuf, const MachNode* n, int primary, int te uint index = src2_enc; int disp = disp32; - if (src1_enc == R_SP_enc || src1_enc == R_FP_enc) + if (src1_enc == R_SP_enc || src1_enc == R_FP_enc) { disp += STACK_BIAS; + // Quick fix for JDK-8029668: check that stack offset fits, bailout if not + if (!Assembler::is_simm13(disp)) { + ra->C->record_method_not_compilable("unable to handle large constant offsets"); + return; + } + } // We should have a compiler bailout here rather than a guarantee. // Better yet would be some mechanism to handle variable-size matches correctly. @@ -1279,20 +1285,15 @@ static enum RC rc_class( OptoReg::Name reg ) { return rc_float; } -static int impl_helper( const MachNode *mach, CodeBuffer *cbuf, PhaseRegAlloc *ra_, bool do_size, bool is_load, int offset, int reg, int opcode, const char *op_str, int size, outputStream* st ) { - if( cbuf ) { - // Better yet would be some mechanism to handle variable-size matches correctly - if (!Assembler::is_simm13(offset + STACK_BIAS)) { - ra_->C->record_method_not_compilable("unable to handle large constant offsets"); - } else { - emit_form3_mem_reg(*cbuf, mach, opcode, -1, R_SP_enc, offset, 0, Matcher::_regEncode[reg]); - } +static int impl_helper(const MachNode* mach, CodeBuffer* cbuf, PhaseRegAlloc* ra, bool do_size, bool is_load, int offset, int reg, int opcode, const char *op_str, int size, outputStream* st ) { + if (cbuf) { + emit_form3_mem_reg(*cbuf, ra, mach, opcode, -1, R_SP_enc, offset, 0, Matcher::_regEncode[reg]); } #ifndef PRODUCT - else if( !do_size ) { - if( size != 0 ) st->print("\n\t"); - if( is_load ) st->print("%s [R_SP + #%d],R_%s\t! spill",op_str,offset,OptoReg::regname(reg)); - else st->print("%s R_%s,[R_SP + #%d]\t! spill",op_str,OptoReg::regname(reg),offset); + else if (!do_size) { + if (size != 0) st->print("\n\t"); + if (is_load) st->print("%s [R_SP + #%d],R_%s\t! spill",op_str,offset,OptoReg::regname(reg)); + else st->print("%s R_%s,[R_SP + #%d]\t! spill",op_str,OptoReg::regname(reg),offset); } #endif return size+4; @@ -2087,22 +2088,22 @@ encode %{ %} enc_class form3_mem_reg( memory mem, iRegI dst ) %{ - emit_form3_mem_reg(cbuf, this, $primary, $tertiary, + emit_form3_mem_reg(cbuf, ra_, this, $primary, $tertiary, $mem$$base, $mem$$disp, $mem$$index, $dst$$reg); %} enc_class simple_form3_mem_reg( memory mem, iRegI dst ) %{ - emit_form3_mem_reg(cbuf, this, $primary, -1, + emit_form3_mem_reg(cbuf, ra_, this, $primary, -1, $mem$$base, $mem$$disp, $mem$$index, $dst$$reg); %} enc_class form3_mem_prefetch_read( memory mem ) %{ - emit_form3_mem_reg(cbuf, this, $primary, -1, + emit_form3_mem_reg(cbuf, ra_, this, $primary, -1, $mem$$base, $mem$$disp, $mem$$index, 0/*prefetch function many-reads*/); %} enc_class form3_mem_prefetch_write( memory mem ) %{ - emit_form3_mem_reg(cbuf, this, $primary, -1, + emit_form3_mem_reg(cbuf, ra_, this, $primary, -1, $mem$$base, $mem$$disp, $mem$$index, 2/*prefetch function many-writes*/); %} @@ -2110,8 +2111,8 @@ encode %{ assert(Assembler::is_simm13($mem$$disp ), "need disp and disp+4"); assert(Assembler::is_simm13($mem$$disp+4), "need disp and disp+4"); guarantee($mem$$index == R_G0_enc, "double index?"); - emit_form3_mem_reg(cbuf, this, $primary, -1, $mem$$base, $mem$$disp+4, R_G0_enc, R_O7_enc ); - emit_form3_mem_reg(cbuf, this, $primary, -1, $mem$$base, $mem$$disp, R_G0_enc, $reg$$reg ); + emit_form3_mem_reg(cbuf, ra_, this, $primary, -1, $mem$$base, $mem$$disp+4, R_G0_enc, R_O7_enc ); + emit_form3_mem_reg(cbuf, ra_, this, $primary, -1, $mem$$base, $mem$$disp, R_G0_enc, $reg$$reg ); emit3_simm13( cbuf, Assembler::arith_op, $reg$$reg, Assembler::sllx_op3, $reg$$reg, 0x1020 ); emit3( cbuf, Assembler::arith_op, $reg$$reg, Assembler::or_op3, $reg$$reg, 0, R_O7_enc ); %} @@ -2121,14 +2122,14 @@ encode %{ assert(Assembler::is_simm13($mem$$disp+4), "need disp and disp+4"); guarantee($mem$$index == R_G0_enc, "double index?"); // Load long with 2 instructions - emit_form3_mem_reg(cbuf, this, $primary, -1, $mem$$base, $mem$$disp, R_G0_enc, $reg$$reg+0 ); - emit_form3_mem_reg(cbuf, this, $primary, -1, $mem$$base, $mem$$disp+4, R_G0_enc, $reg$$reg+1 ); + emit_form3_mem_reg(cbuf, ra_, this, $primary, -1, $mem$$base, $mem$$disp, R_G0_enc, $reg$$reg+0 ); + emit_form3_mem_reg(cbuf, ra_, this, $primary, -1, $mem$$base, $mem$$disp+4, R_G0_enc, $reg$$reg+1 ); %} //%%% form3_mem_plus_4_reg is a hack--get rid of it enc_class form3_mem_plus_4_reg( memory mem, iRegI dst ) %{ guarantee($mem$$disp, "cannot offset a reg-reg operand by 4"); - emit_form3_mem_reg(cbuf, this, $primary, -1, $mem$$base, $mem$$disp + 4, $mem$$index, $dst$$reg); + emit_form3_mem_reg(cbuf, ra_, this, $primary, -1, $mem$$base, $mem$$disp + 4, $mem$$index, $dst$$reg); %} enc_class form3_g0_rs2_rd_move( iRegI rs2, iRegI rd ) %{ From 55ff73a553a22ae56e9e04fb73e5b8c74c2ed379 Mon Sep 17 00:00:00 2001 From: Igor Ignatyev Date: Fri, 13 Dec 2013 00:34:09 +0400 Subject: [PATCH 029/377] 8026941: [TESTBUG] java.lang.ClassNotFoundException: java.lang.invoke.InvokeGeneric Reviewed-by: kvn, vlivanov --- .../jsr292/ConcurrentClassLoadingTest.java | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/hotspot/test/compiler/jsr292/ConcurrentClassLoadingTest.java b/hotspot/test/compiler/jsr292/ConcurrentClassLoadingTest.java index b87c067a98a..06e900f077d 100644 --- a/hotspot/test/compiler/jsr292/ConcurrentClassLoadingTest.java +++ b/hotspot/test/compiler/jsr292/ConcurrentClassLoadingTest.java @@ -159,34 +159,18 @@ public class ConcurrentClassLoadingTest { } final static String[] classNames = { - "java.lang.invoke.AbstractValidatingLambdaMetafactory", - "java.lang.invoke.BoundMethodHandle", "java.lang.invoke.CallSite", "java.lang.invoke.ConstantCallSite", - "java.lang.invoke.DirectMethodHandle", - "java.lang.invoke.InnerClassLambdaMetafactory", - "java.lang.invoke.InvokeDynamic", - "java.lang.invoke.InvokeGeneric", - "java.lang.invoke.InvokerBytecodeGenerator", - "java.lang.invoke.Invokers", "java.lang.invoke.LambdaConversionException", - "java.lang.invoke.LambdaForm", "java.lang.invoke.LambdaMetafactory", - "java.lang.invoke.MemberName", "java.lang.invoke.MethodHandle", - "java.lang.invoke.MethodHandleImpl", "java.lang.invoke.MethodHandleInfo", - "java.lang.invoke.MethodHandleNatives", "java.lang.invoke.MethodHandleProxies", "java.lang.invoke.MethodHandles", - "java.lang.invoke.MethodHandleStatics", "java.lang.invoke.MethodType", - "java.lang.invoke.MethodTypeForm", "java.lang.invoke.MutableCallSite", "java.lang.invoke.SerializedLambda", - "java.lang.invoke.SimpleMethodHandle", "java.lang.invoke.SwitchPoint", - "java.lang.invoke.TypeConvertingMethodAdapter", "java.lang.invoke.VolatileCallSite", "java.lang.invoke.WrongMethodTypeException" }; From da079783f84cee87c2511e0c4658b290847dff51 Mon Sep 17 00:00:00 2001 From: David Chase Date: Thu, 12 Dec 2013 15:11:35 -0500 Subject: [PATCH 030/377] 8029351: assert(bt != T_OBJECT) failed: Guard is incorrect in VM:defmeth Replace test condition with reference to the proper predicate, encode folk wisdom into an assert Reviewed-by: twisti, coleenp --- hotspot/src/share/vm/oops/generateOopMap.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/hotspot/src/share/vm/oops/generateOopMap.cpp b/hotspot/src/share/vm/oops/generateOopMap.cpp index 9a9dc23d4e8..2207e8c814e 100644 --- a/hotspot/src/share/vm/oops/generateOopMap.cpp +++ b/hotspot/src/share/vm/oops/generateOopMap.cpp @@ -1863,11 +1863,8 @@ void GenerateOopMap::do_ldc(int bci) { constantTag tag = cp->tag_at(ldc.pool_index()); // idx is index in resolved_references BasicType bt = ldc.result_type(); CellTypeState cts; - if (tag.is_klass() || - tag.is_unresolved_klass() || - tag.is_string() || - tag.is_method_handle() || - tag.is_method_type()) { + if (tag.basic_type() == T_OBJECT) { + assert(!tag.is_string_index() && !tag.is_klass_index(), "Unexpected index tag"); assert(bt == T_OBJECT, "Guard is incorrect"); cts = CellTypeState::make_line_ref(bci); } else { From bbb97e5b3914e8a6e205e34f9cb0487aa1ab4add Mon Sep 17 00:00:00 2001 From: Roland Westrelin Date: Fri, 13 Dec 2013 09:25:44 +0100 Subject: [PATCH 031/377] 8029383: assert(counter_changed) failed: failed dependencies, but counter didn't change No call to SystemDictionary::notice_modification() when class is defined through Unsafe.defineAnonymousClass() can caused missed dependency change. Reviewed-by: kvn, twisti --- hotspot/src/share/vm/classfile/systemDictionary.cpp | 3 +++ hotspot/src/share/vm/prims/jvmtiRedefineClasses.cpp | 3 --- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/hotspot/src/share/vm/classfile/systemDictionary.cpp b/hotspot/src/share/vm/classfile/systemDictionary.cpp index ee311b6a85f..f5c5c017dcd 100644 --- a/hotspot/src/share/vm/classfile/systemDictionary.cpp +++ b/hotspot/src/share/vm/classfile/systemDictionary.cpp @@ -1049,6 +1049,9 @@ Klass* SystemDictionary::parse_stream(Symbol* class_name, add_to_hierarchy(k, CHECK_NULL); // No exception, but can block // But, do not add to system dictionary. + + // compiled code dependencies need to be validated anyway + notice_modification(); } // Rewrite and patch constant pool here. diff --git a/hotspot/src/share/vm/prims/jvmtiRedefineClasses.cpp b/hotspot/src/share/vm/prims/jvmtiRedefineClasses.cpp index 1c3bbbfeed0..4a57b20569b 100644 --- a/hotspot/src/share/vm/prims/jvmtiRedefineClasses.cpp +++ b/hotspot/src/share/vm/prims/jvmtiRedefineClasses.cpp @@ -147,9 +147,6 @@ void VM_RedefineClasses::doit() { _scratch_classes[i] = NULL; } - // Disable any dependent concurrent compilations - SystemDictionary::notice_modification(); - // Set flag indicating that some invariants are no longer true. // See jvmtiExport.hpp for detailed explanation. JvmtiExport::set_has_redefined_a_class(); From 810bc0c558626eb1705106bbc78e29bc617a3e3e Mon Sep 17 00:00:00 2001 From: Bengt Rutisson Date: Mon, 16 Dec 2013 08:54:14 +0100 Subject: [PATCH 032/377] 8029524: Remove unsused method CollectedHeap::unsafe_max_alloc() Reviewed-by: pliden, jmasa --- .../gc_implementation/g1/g1CollectedHeap.cpp | 19 ------------------- .../gc_implementation/g1/g1CollectedHeap.hpp | 9 --------- .../parallelScavenge/parallelScavengeHeap.cpp | 4 ---- .../parallelScavenge/parallelScavengeHeap.hpp | 2 -- .../share/vm/gc_interface/collectedHeap.hpp | 9 --------- .../src/share/vm/memory/genCollectedHeap.cpp | 4 ---- .../src/share/vm/memory/genCollectedHeap.hpp | 8 -------- 7 files changed, 55 deletions(-) diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp index 5ae273b26bd..775f6465d66 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp @@ -2376,25 +2376,6 @@ size_t G1CollectedHeap::recalculate_used() const { return blk.result(); } -size_t G1CollectedHeap::unsafe_max_alloc() { - if (free_regions() > 0) return HeapRegion::GrainBytes; - // otherwise, is there space in the current allocation region? - - // We need to store the current allocation region in a local variable - // here. The problem is that this method doesn't take any locks and - // there may be other threads which overwrite the current allocation - // region field. attempt_allocation(), for example, sets it to NULL - // and this can happen *after* the NULL check here but before the call - // to free(), resulting in a SIGSEGV. Note that this doesn't appear - // to be a problem in the optimized build, since the two loads of the - // current allocation region field are optimized away. - HeapRegion* hr = _mutator_alloc_region.get(); - if (hr == NULL) { - return 0; - } - return hr->free(); -} - bool G1CollectedHeap::should_do_concurrent_full_gc(GCCause::Cause cause) { switch (cause) { case GCCause::_gc_locker: return GCLockerInvokesConcurrent; diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp index 69aa3255605..072013efb64 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp @@ -1183,15 +1183,6 @@ public: // end fields defining the extent of the contiguous allocation region.) // But G1CollectedHeap doesn't yet support this. - // Return an estimate of the maximum allocation that could be performed - // without triggering any collection or expansion activity. In a - // generational collector, for example, this is probably the largest - // allocation that could be supported (without expansion) in the youngest - // generation. It is "unsafe" because no locks are taken; the result - // should be treated as an approximation, not a guarantee, for use in - // heuristic resizing decisions. - virtual size_t unsafe_max_alloc(); - virtual bool is_maximal_no_gc() const { return _g1_storage.uncommitted_size() == 0; } diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.cpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.cpp index f93f2e8991f..6a46f9fd13f 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.cpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.cpp @@ -484,10 +484,6 @@ void ParallelScavengeHeap::ensure_parsability(bool retire_tlabs) { young_gen()->eden_space()->ensure_parsability(); } -size_t ParallelScavengeHeap::unsafe_max_alloc() { - return young_gen()->eden_space()->free_in_bytes(); -} - size_t ParallelScavengeHeap::tlab_capacity(Thread* thr) const { return young_gen()->eden_space()->tlab_capacity(thr); } diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.hpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.hpp index 51f40d8c62b..d4c2a1e72e7 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.hpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.hpp @@ -184,8 +184,6 @@ class ParallelScavengeHeap : public CollectedHeap { void accumulate_statistics_all_tlabs(); void resize_all_tlabs(); - size_t unsafe_max_alloc(); - bool supports_tlab_allocation() const { return true; } size_t tlab_capacity(Thread* thr) const; diff --git a/hotspot/src/share/vm/gc_interface/collectedHeap.hpp b/hotspot/src/share/vm/gc_interface/collectedHeap.hpp index 1e60ed116d8..1563b9ef743 100644 --- a/hotspot/src/share/vm/gc_interface/collectedHeap.hpp +++ b/hotspot/src/share/vm/gc_interface/collectedHeap.hpp @@ -389,15 +389,6 @@ class CollectedHeap : public CHeapObj { // allocation from them and necessitating allocation of new TLABs. virtual void ensure_parsability(bool retire_tlabs); - // Return an estimate of the maximum allocation that could be performed - // without triggering any collection or expansion activity. In a - // generational collector, for example, this is probably the largest - // allocation that could be supported (without expansion) in the youngest - // generation. It is "unsafe" because no locks are taken; the result - // should be treated as an approximation, not a guarantee, for use in - // heuristic resizing decisions. - virtual size_t unsafe_max_alloc() = 0; - // Section on thread-local allocation buffers (TLABs) // If the heap supports thread-local allocation buffers, it should override // the following methods: diff --git a/hotspot/src/share/vm/memory/genCollectedHeap.cpp b/hotspot/src/share/vm/memory/genCollectedHeap.cpp index aa6f24bd23e..49c5965a89b 100644 --- a/hotspot/src/share/vm/memory/genCollectedHeap.cpp +++ b/hotspot/src/share/vm/memory/genCollectedHeap.cpp @@ -673,10 +673,6 @@ HeapWord** GenCollectedHeap::end_addr() const { return _gens[0]->end_addr(); } -size_t GenCollectedHeap::unsafe_max_alloc() { - return _gens[0]->unsafe_max_alloc_nogc(); -} - // public collection interfaces void GenCollectedHeap::collect(GCCause::Cause cause) { diff --git a/hotspot/src/share/vm/memory/genCollectedHeap.hpp b/hotspot/src/share/vm/memory/genCollectedHeap.hpp index 5cd8a71280a..b80fd718bd8 100644 --- a/hotspot/src/share/vm/memory/genCollectedHeap.hpp +++ b/hotspot/src/share/vm/memory/genCollectedHeap.hpp @@ -166,14 +166,6 @@ public: HeapWord** top_addr() const; HeapWord** end_addr() const; - // Return an estimate of the maximum allocation that could be performed - // without triggering any collection activity. In a generational - // collector, for example, this is probably the largest allocation that - // could be supported in the youngest generation. It is "unsafe" because - // no locks are taken; the result should be treated as an approximation, - // not a guarantee. - size_t unsafe_max_alloc(); - // Does this heap support heap inspection? (+PrintClassHistogram) virtual bool supports_heap_inspection() const { return true; } From ea73be64ac22f605c11beadc979279295738adca Mon Sep 17 00:00:00 2001 From: Francis Andre Date: Mon, 16 Dec 2013 11:17:33 +0100 Subject: [PATCH 033/377] 8029798: Build warnings in windows/makefiles/sa.make Reviewed-by: sla --- hotspot/make/windows/makefiles/sa.make | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hotspot/make/windows/makefiles/sa.make b/hotspot/make/windows/makefiles/sa.make index 5b5cc2d723c..5292dbb03f7 100644 --- a/hotspot/make/windows/makefiles/sa.make +++ b/hotspot/make/windows/makefiles/sa.make @@ -94,7 +94,7 @@ SA_CFLAGS = -nologo $(MS_RUNTIME_OPTION) -W3 $(GX_OPTION) -Od -D "WIN32" -D "WIN SA_LD_FLAGS = bufferoverflowU.lib !endif !else -SA_CFLAGS = -nologo $(MS_RUNTIME_OPTION) -W3 -Gm $(GX_OPTION) -Od -D "WIN32" -D "_WINDOWS" -D "_DEBUG" -D "_CONSOLE" -D "_MBCS" -YX -FD -GZ -c +SA_CFLAGS = -nologo $(MS_RUNTIME_OPTION) -W3 $(GX_OPTION) -Od -D "WIN32" -D "_WINDOWS" -D "_DEBUG" -D "_CONSOLE" -D "_MBCS" -FD -RTC1 -c !if "$(ENABLE_FULL_DEBUG_SYMBOLS)" == "1" SA_CFLAGS = $(SA_CFLAGS) -ZI !endif From 3a3cc4bad369127472b5b28c354d6e6d4aa823fb Mon Sep 17 00:00:00 2001 From: Zhengyu Gu Date: Mon, 16 Dec 2013 10:57:08 -0800 Subject: [PATCH 034/377] 8026300: VM warning: increase O_BUFLEN in ostream.hpp -- output truncated occurs with fastdebug VM when printing flags Fixed wrong print string format Reviewed-by: sla, ccheung --- hotspot/src/share/vm/runtime/globals.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hotspot/src/share/vm/runtime/globals.cpp b/hotspot/src/share/vm/runtime/globals.cpp index de6fbf70856..76a6b935663 100644 --- a/hotspot/src/share/vm/runtime/globals.cpp +++ b/hotspot/src/share/vm/runtime/globals.cpp @@ -295,7 +295,7 @@ void Flag::print_on(outputStream* st, bool withComments) { else st->print("%-16s", ""); } - st->print("%-20"); + st->print("%-20s", " "); print_kind(st); if (withComments) { From f72107ae20e02a5ea81d144485a3b36b459ab28a Mon Sep 17 00:00:00 2001 From: Staffan Larsen Date: Mon, 16 Dec 2013 10:34:30 +0100 Subject: [PATCH 035/377] 8028737: Remove JVM_AccessVMIntFlag / JVM_AccessVMBooleanFlag / JVM_VMBreakPoint Reviewed-by: dcubed, coleenp --- hotspot/make/bsd/makefiles/mapfile-vers-debug | 5 --- .../make/linux/makefiles/mapfile-vers-debug | 5 --- .../make/solaris/makefiles/mapfile-vers-debug | 4 --- hotspot/src/share/vm/prims/jvm.cpp | 34 ------------------- 4 files changed, 48 deletions(-) diff --git a/hotspot/make/bsd/makefiles/mapfile-vers-debug b/hotspot/make/bsd/makefiles/mapfile-vers-debug index 9a8fc822bc4..d446cc81d84 100644 --- a/hotspot/make/bsd/makefiles/mapfile-vers-debug +++ b/hotspot/make/bsd/makefiles/mapfile-vers-debug @@ -242,11 +242,6 @@ _JVM_Yield _JVM_handle_bsd_signal - # debug _JVM - _JVM_AccessVMBooleanFlag - _JVM_AccessVMIntFlag - _JVM_VMBreakPoint - # miscellaneous functions _jio_fprintf _jio_printf diff --git a/hotspot/make/linux/makefiles/mapfile-vers-debug b/hotspot/make/linux/makefiles/mapfile-vers-debug index 68be2ffefb3..4936ba711f9 100644 --- a/hotspot/make/linux/makefiles/mapfile-vers-debug +++ b/hotspot/make/linux/makefiles/mapfile-vers-debug @@ -244,11 +244,6 @@ SUNWprivate_1.1 { JVM_Yield; JVM_handle_linux_signal; - # debug JVM - JVM_AccessVMBooleanFlag; - JVM_AccessVMIntFlag; - JVM_VMBreakPoint; - # miscellaneous functions jio_fprintf; jio_printf; diff --git a/hotspot/make/solaris/makefiles/mapfile-vers-debug b/hotspot/make/solaris/makefiles/mapfile-vers-debug index 234d391b604..f6b63d5a4bf 100644 --- a/hotspot/make/solaris/makefiles/mapfile-vers-debug +++ b/hotspot/make/solaris/makefiles/mapfile-vers-debug @@ -28,10 +28,6 @@ SUNWprivate_1.1 { global: - # debug JVM - JVM_AccessVMBooleanFlag; - JVM_AccessVMIntFlag; - JVM_VMBreakPoint; # miscellaneous }; diff --git a/hotspot/src/share/vm/prims/jvm.cpp b/hotspot/src/share/vm/prims/jvm.cpp index a757e194827..1059783eb05 100644 --- a/hotspot/src/share/vm/prims/jvm.cpp +++ b/hotspot/src/share/vm/prims/jvm.cpp @@ -3971,40 +3971,6 @@ jclass find_class_from_class_loader(JNIEnv* env, Symbol* name, jboolean init, Ha } -// Internal SQE debugging support /////////////////////////////////////////////////////////// - -#ifndef PRODUCT - -extern "C" { - JNIEXPORT jboolean JNICALL JVM_AccessVMBooleanFlag(const char* name, jboolean* value, jboolean is_get); - JNIEXPORT jboolean JNICALL JVM_AccessVMIntFlag(const char* name, jint* value, jboolean is_get); - JNIEXPORT void JNICALL JVM_VMBreakPoint(JNIEnv *env, jobject obj); -} - -JVM_LEAF(jboolean, JVM_AccessVMBooleanFlag(const char* name, jboolean* value, jboolean is_get)) - JVMWrapper("JVM_AccessBoolVMFlag"); - return is_get ? CommandLineFlags::boolAt((char*) name, (bool*) value) : CommandLineFlags::boolAtPut((char*) name, (bool*) value, Flag::INTERNAL); -JVM_END - -JVM_LEAF(jboolean, JVM_AccessVMIntFlag(const char* name, jint* value, jboolean is_get)) - JVMWrapper("JVM_AccessVMIntFlag"); - intx v; - jboolean result = is_get ? CommandLineFlags::intxAt((char*) name, &v) : CommandLineFlags::intxAtPut((char*) name, &v, Flag::INTERNAL); - *value = (jint)v; - return result; -JVM_END - - -JVM_ENTRY(void, JVM_VMBreakPoint(JNIEnv *env, jobject obj)) - JVMWrapper("JVM_VMBreakPoint"); - oop the_obj = JNIHandles::resolve(obj); - BREAKPOINT; -JVM_END - - -#endif - - // Method /////////////////////////////////////////////////////////////////////////////////////////// JVM_ENTRY(jobject, JVM_InvokeMethod(JNIEnv *env, jobject method, jobject obj, jobjectArray args0)) From fd42fb44467ccdd5fd6761a146a82107857b1cfe Mon Sep 17 00:00:00 2001 From: Bengt Rutisson Date: Mon, 16 Dec 2013 13:43:06 +0100 Subject: [PATCH 036/377] 8027440: DefNew does not log heap change information when a promotion failure occurs Reviewed-by: tamao, jmasa --- .../src/share/vm/memory/defNewGeneration.cpp | 6 +- hotspot/test/gc/defnew/HeapChangeLogging.java | 81 +++++++++++++++++++ 2 files changed, 84 insertions(+), 3 deletions(-) create mode 100644 hotspot/test/gc/defnew/HeapChangeLogging.java diff --git a/hotspot/src/share/vm/memory/defNewGeneration.cpp b/hotspot/src/share/vm/memory/defNewGeneration.cpp index f5fdb4427ce..51c672e4e7c 100644 --- a/hotspot/src/share/vm/memory/defNewGeneration.cpp +++ b/hotspot/src/share/vm/memory/defNewGeneration.cpp @@ -667,9 +667,6 @@ void DefNewGeneration::collect(bool full, // for full GC's. AdaptiveSizePolicy* size_policy = gch->gen_policy()->size_policy(); size_policy->reset_gc_overhead_limit_count(); - if (PrintGC && !PrintGCDetails) { - gch->print_heap_change(gch_prev_used); - } assert(!gch->incremental_collection_failed(), "Should be clear"); } else { assert(_promo_failure_scan_stack.is_empty(), "post condition"); @@ -695,6 +692,9 @@ void DefNewGeneration::collect(bool full, // Reset the PromotionFailureALot counters. NOT_PRODUCT(Universe::heap()->reset_promotion_should_fail();) } + if (PrintGC && !PrintGCDetails) { + gch->print_heap_change(gch_prev_used); + } // set new iteration safe limit for the survivor spaces from()->set_concurrent_iteration_safe_limit(from()->top()); to()->set_concurrent_iteration_safe_limit(to()->top()); diff --git a/hotspot/test/gc/defnew/HeapChangeLogging.java b/hotspot/test/gc/defnew/HeapChangeLogging.java new file mode 100644 index 00000000000..5349e691b76 --- /dev/null +++ b/hotspot/test/gc/defnew/HeapChangeLogging.java @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * 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 HeapChangeLogging.java + * @bug 8027440 + * @library /testlibrary + * @build HeapChangeLogging + * @summary Allocate to get a promotion failure and verify that that heap change logging is present. + * @run main HeapChangeLogging + * + * Test the output of G1SummarizeRSetStats in conjunction with G1SummarizeRSetStatsPeriod. + */ + +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import com.oracle.java.testlibrary.*; + +public class HeapChangeLogging { + public static void main(String[] args) throws Exception { + ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xmx128m", "-Xmn100m", "-XX:+UseSerialGC", "-XX:+PrintGC", "HeapFiller"); + OutputAnalyzer output = new OutputAnalyzer(pb.start()); + String stdout = output.getStdout(); + System.out.println(stdout); + Matcher stdoutMatcher = Pattern.compile("\\[GC .Allocation Failure.*K->.*K\\(.*K\\), .* secs\\]", Pattern.MULTILINE).matcher(stdout); + if (!stdoutMatcher.find()) { + throw new RuntimeException("No proper GC log line found"); + } + output.shouldHaveExitValue(0); + } +} + +class HeapFiller { + public static Entry root; + private static final int PAYLOAD_SIZE = 1000; + + public static void main(String[] args) { + root = new Entry(PAYLOAD_SIZE, null); + Entry current = root; + try { + while (true) { + Entry newEntry = new Entry(PAYLOAD_SIZE, current); + current = newEntry; + } + } catch (OutOfMemoryError e) { + root = null; + } + + } +} + +class Entry { + public Entry previous; + public byte[] payload; + + Entry(int payloadSize, Entry previous) { + payload = new byte[payloadSize]; + this.previous = previous; + } +} \ No newline at end of file From 4856bd53aa40dfc3b6f33b76d2f6e41df6326149 Mon Sep 17 00:00:00 2001 From: Harold Seigel Date: Mon, 16 Dec 2013 08:24:33 -0500 Subject: [PATCH 037/377] 8027804: JCK resolveMethod test fails expecting AbstractMethodError Create AME overpass methods and fix method search logic Reviewed-by: kamg, acorn, lfoltan, coleenp --- .../src/share/vm/classfile/defaultMethods.cpp | 28 +++++++++++++++---- .../src/share/vm/interpreter/linkResolver.cpp | 13 +++++++-- hotspot/src/share/vm/oops/instanceKlass.cpp | 17 +++++++---- hotspot/src/share/vm/oops/instanceKlass.hpp | 3 +- hotspot/src/share/vm/oops/klassVtable.cpp | 6 ++-- 5 files changed, 51 insertions(+), 16 deletions(-) diff --git a/hotspot/src/share/vm/classfile/defaultMethods.cpp b/hotspot/src/share/vm/classfile/defaultMethods.cpp index 129eecbad3b..8a60a6b36a3 100644 --- a/hotspot/src/share/vm/classfile/defaultMethods.cpp +++ b/hotspot/src/share/vm/classfile/defaultMethods.cpp @@ -349,6 +349,7 @@ class MethodFamily : public ResourceObj { } Symbol* generate_no_defaults_message(TRAPS) const; + Symbol* generate_method_message(Symbol *klass_name, Method* method, TRAPS) const; Symbol* generate_conflicts_message(GrowableArray* methods, TRAPS) const; public: @@ -414,21 +415,25 @@ class MethodFamily : public ResourceObj { } } - if (qualified_methods.length() == 0) { - _exception_message = generate_no_defaults_message(CHECK); + if (num_defaults == 0) { + if (qualified_methods.length() == 0) { + _exception_message = generate_no_defaults_message(CHECK); + } else { + assert(root != NULL, "Null root class"); + _exception_message = generate_method_message(root->name(), qualified_methods.at(0), CHECK); + } _exception_name = vmSymbols::java_lang_AbstractMethodError(); // If only one qualified method is default, select that } else if (num_defaults == 1) { _selected_target = qualified_methods.at(default_index); } else if (num_defaults > 1) { - _exception_message = generate_conflicts_message(&qualified_methods,CHECK); - _exception_name = vmSymbols::java_lang_IncompatibleClassChangeError(); + _exception_message = generate_conflicts_message(&qualified_methods,CHECK); + _exception_name = vmSymbols::java_lang_IncompatibleClassChangeError(); if (TraceDefaultMethods) { _exception_message->print_value_on(tty); tty->print_cr(""); } } - // leave abstract methods alone, they will be found via normal search path } bool contains_signature(Symbol* query) { @@ -486,6 +491,19 @@ Symbol* MethodFamily::generate_no_defaults_message(TRAPS) const { return SymbolTable::new_symbol("No qualifying defaults found", CHECK_NULL); } +Symbol* MethodFamily::generate_method_message(Symbol *klass_name, Method* method, TRAPS) const { + stringStream ss; + ss.print("Method "); + Symbol* name = method->name(); + Symbol* signature = method->signature(); + ss.write((const char*)klass_name->bytes(), klass_name->utf8_length()); + ss.print("."); + ss.write((const char*)name->bytes(), name->utf8_length()); + ss.write((const char*)signature->bytes(), signature->utf8_length()); + ss.print(" is abstract"); + return SymbolTable::new_symbol(ss.base(), (int)ss.size(), CHECK_NULL); +} + Symbol* MethodFamily::generate_conflicts_message(GrowableArray* methods, TRAPS) const { stringStream ss; ss.print("Conflicting default methods:"); diff --git a/hotspot/src/share/vm/interpreter/linkResolver.cpp b/hotspot/src/share/vm/interpreter/linkResolver.cpp index 0187d352f11..b63e03bdcf6 100644 --- a/hotspot/src/share/vm/interpreter/linkResolver.cpp +++ b/hotspot/src/share/vm/interpreter/linkResolver.cpp @@ -300,7 +300,7 @@ int LinkResolver::vtable_index_of_interface_method(KlassHandle klass, Symbol* signature = resolved_method->signature(); // First check in default method array - if (!resolved_method->is_abstract() && + if (!resolved_method->is_abstract() && (InstanceKlass::cast(klass())->default_methods() != NULL)) { int index = InstanceKlass::find_method_index(InstanceKlass::cast(klass())->default_methods(), name, signature); if (index >= 0 ) { @@ -318,7 +318,11 @@ int LinkResolver::vtable_index_of_interface_method(KlassHandle klass, void LinkResolver::lookup_method_in_interfaces(methodHandle& result, KlassHandle klass, Symbol* name, Symbol* signature, TRAPS) { InstanceKlass *ik = InstanceKlass::cast(klass()); - result = methodHandle(THREAD, ik->lookup_method_in_all_interfaces(name, signature)); + + // Specify 'true' in order to skip default methods when searching the + // interfaces. Function lookup_method_in_klasses() already looked for + // the method in the default methods table. + result = methodHandle(THREAD, ik->lookup_method_in_all_interfaces(name, signature, true)); } void LinkResolver::lookup_polymorphic_method(methodHandle& result, @@ -620,7 +624,7 @@ void LinkResolver::resolve_interface_method(methodHandle& resolved_method, bool check_access, bool nostatics, TRAPS) { - // check if klass is interface + // check if klass is interface if (!resolved_klass->is_interface()) { ResourceMark rm(THREAD); char buf[200]; @@ -1287,8 +1291,11 @@ void LinkResolver::runtime_resolve_interface_method(CallInfo& result, methodHand resolved_klass()->external_name()); THROW_MSG(vmSymbols::java_lang_IncompatibleClassChangeError(), buf); } + // do lookup based on receiver klass methodHandle sel_method; + // This search must match the linktime preparation search for itable initialization + // to correctly enforce loader constraints for interface method inheritance lookup_instance_method_in_klasses(sel_method, recv_klass, resolved_method->name(), resolved_method->signature(), CHECK); diff --git a/hotspot/src/share/vm/oops/instanceKlass.cpp b/hotspot/src/share/vm/oops/instanceKlass.cpp index 7c63c481057..a6ca58c42c1 100644 --- a/hotspot/src/share/vm/oops/instanceKlass.cpp +++ b/hotspot/src/share/vm/oops/instanceKlass.cpp @@ -1498,13 +1498,18 @@ int InstanceKlass::find_method_by_name( return -1; } -// lookup_method searches both the local methods array and all superclasses methods arrays +// uncached_lookup_method searches both the local class methods array and all +// superclasses methods arrays, skipping any overpass methods in superclasses. Method* InstanceKlass::uncached_lookup_method(Symbol* name, Symbol* signature) const { Klass* klass = const_cast(this); + bool dont_ignore_overpasses = true; // For the class being searched, find its overpasses. while (klass != NULL) { Method* method = InstanceKlass::cast(klass)->find_method(name, signature); - if (method != NULL) return method; + if ((method != NULL) && (dont_ignore_overpasses || !method->is_overpass())) { + return method; + } klass = InstanceKlass::cast(klass)->super(); + dont_ignore_overpasses = false; // Ignore overpass methods in all superclasses. } return NULL; } @@ -1519,7 +1524,7 @@ Method* InstanceKlass::lookup_method_in_ordered_interfaces(Symbol* name, } // Look up interfaces if (m == NULL) { - m = lookup_method_in_all_interfaces(name, signature); + m = lookup_method_in_all_interfaces(name, signature, false); } return m; } @@ -1528,14 +1533,16 @@ Method* InstanceKlass::lookup_method_in_ordered_interfaces(Symbol* name, // Do NOT return private or static methods, new in JDK8 which are not externally visible // They should only be found in the initial InterfaceMethodRef Method* InstanceKlass::lookup_method_in_all_interfaces(Symbol* name, - Symbol* signature) const { + Symbol* signature, + bool skip_default_methods) const { Array* all_ifs = transitive_interfaces(); int num_ifs = all_ifs->length(); InstanceKlass *ik = NULL; for (int i = 0; i < num_ifs; i++) { ik = InstanceKlass::cast(all_ifs->at(i)); Method* m = ik->lookup_method(name, signature); - if (m != NULL && m->is_public() && !m->is_static()) { + if (m != NULL && m->is_public() && !m->is_static() && + (!skip_default_methods || !m->is_default_method())) { return m; } } diff --git a/hotspot/src/share/vm/oops/instanceKlass.hpp b/hotspot/src/share/vm/oops/instanceKlass.hpp index 84cc0046a95..2b7a73a3189 100644 --- a/hotspot/src/share/vm/oops/instanceKlass.hpp +++ b/hotspot/src/share/vm/oops/instanceKlass.hpp @@ -525,7 +525,8 @@ class InstanceKlass: public Klass { // lookup a method in all the interfaces that this class implements // (returns NULL if not found) - Method* lookup_method_in_all_interfaces(Symbol* name, Symbol* signature) const; + Method* lookup_method_in_all_interfaces(Symbol* name, Symbol* signature, bool skip_default_methods) const; + // lookup a method in local defaults then in all interfaces // (returns NULL if not found) Method* lookup_method_in_ordered_interfaces(Symbol* name, Symbol* signature) const; diff --git a/hotspot/src/share/vm/oops/klassVtable.cpp b/hotspot/src/share/vm/oops/klassVtable.cpp index 509c7885360..a7fc062b71e 100644 --- a/hotspot/src/share/vm/oops/klassVtable.cpp +++ b/hotspot/src/share/vm/oops/klassVtable.cpp @@ -622,7 +622,7 @@ bool klassVtable::needs_new_vtable_entry(methodHandle target_method, // this check for all access permissions. InstanceKlass *sk = InstanceKlass::cast(super); if (sk->has_miranda_methods()) { - if (sk->lookup_method_in_all_interfaces(name, signature) != NULL) { + if (sk->lookup_method_in_all_interfaces(name, signature, false) != NULL) { return false; // found a matching miranda; we do not need a new entry } } @@ -743,7 +743,7 @@ void klassVtable::add_new_mirandas_to_lists( if (is_miranda(im, class_methods, default_methods, super)) { // is it a miranda at all? InstanceKlass *sk = InstanceKlass::cast(super); // check if it is a duplicate of a super's miranda - if (sk->lookup_method_in_all_interfaces(im->name(), im->signature()) == NULL) { + if (sk->lookup_method_in_all_interfaces(im->name(), im->signature(), false) == NULL) { new_mirandas->append(im); } if (all_mirandas != NULL) { @@ -1085,6 +1085,8 @@ void klassItable::initialize_itable_for_interface(int method_table_offset, Klass Method* m = methods->at(i); methodHandle target; if (m->has_itable_index()) { + // This search must match the runtime resolution, i.e. selection search for invokeinterface + // to correctly enforce loader constraints for interface method inheritance LinkResolver::lookup_instance_method_in_klasses(target, _klass, m->name(), m->signature(), CHECK); } if (target == NULL || !target->is_public() || target->is_abstract()) { From b91fa108bfcab5be7ca692fd8462aff5ea85047e Mon Sep 17 00:00:00 2001 From: Staffan Larsen Date: Wed, 18 Dec 2013 08:39:06 +0100 Subject: [PATCH 038/377] 8029726: On OS X some dtrace probe names are mismatched with Solaris 8029727: On OS X dtrace probes CallMethodA/CallMethodV are not fired 8029728: On OS X dtrace probes SetStaticBooleanField are not fired Reviewed-by: kamg, dsamersoff --- hotspot/src/os/bsd/dtrace/hotspot.d | 6 +- hotspot/src/share/vm/prims/jni.cpp | 74 +++++++++---------- hotspot/src/share/vm/runtime/synchronizer.cpp | 2 +- hotspot/src/share/vm/runtime/thread.cpp | 4 +- 4 files changed, 43 insertions(+), 43 deletions(-) diff --git a/hotspot/src/os/bsd/dtrace/hotspot.d b/hotspot/src/os/bsd/dtrace/hotspot.d index 0e4802b5105..996e1d782e5 100644 --- a/hotspot/src/os/bsd/dtrace/hotspot.d +++ b/hotspot/src/os/bsd/dtrace/hotspot.d @@ -47,8 +47,8 @@ provider hotspot { probe mem__pool__gc__end( char*, uintptr_t, char*, uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t); - probe thread__probe__start(char*, uintptr_t, uintptr_t, uintptr_t, uintptr_t); - probe thread__probe__stop(char*, uintptr_t, uintptr_t, uintptr_t, uintptr_t); + probe thread__start(char*, uintptr_t, uintptr_t, uintptr_t, uintptr_t); + probe thread__stop(char*, uintptr_t, uintptr_t, uintptr_t, uintptr_t); probe thread__sleep__begin(long long); probe thread__sleep__end(int); probe thread__yield(); @@ -68,7 +68,7 @@ provider hotspot { probe monitor__contended__entered(uintptr_t, uintptr_t, char*, uintptr_t); probe monitor__contended__exit(uintptr_t, uintptr_t, char*, uintptr_t); probe monitor__wait(uintptr_t, uintptr_t, char*, uintptr_t, uintptr_t); - probe monitor__probe__waited(uintptr_t, uintptr_t, char*, uintptr_t); + probe monitor__waited(uintptr_t, uintptr_t, char*, uintptr_t); probe monitor__notify(uintptr_t, uintptr_t, char*, uintptr_t); probe monitor__notifyAll(uintptr_t, uintptr_t, char*, uintptr_t); diff --git a/hotspot/src/share/vm/prims/jni.cpp b/hotspot/src/share/vm/prims/jni.cpp index ab24446baf1..449ed679847 100644 --- a/hotspot/src/share/vm/prims/jni.cpp +++ b/hotspot/src/share/vm/prims/jni.cpp @@ -1804,34 +1804,34 @@ JNI_END // the runtime type of subword integral basic types is integer DEFINE_CALLMETHODV(jboolean, Boolean, T_BOOLEAN - , HOTSPOT_JNI_CALLBOOLEANMETHOD_ENTRY(env, obj, (uintptr_t)methodID), - HOTSPOT_JNI_CALLBOOLEANMETHOD_RETURN(_ret_ref)) + , HOTSPOT_JNI_CALLBOOLEANMETHODV_ENTRY(env, obj, (uintptr_t)methodID), + HOTSPOT_JNI_CALLBOOLEANMETHODV_RETURN(_ret_ref)) DEFINE_CALLMETHODV(jbyte, Byte, T_BYTE - , HOTSPOT_JNI_CALLBYTEMETHOD_ENTRY(env, obj, (uintptr_t)methodID), - HOTSPOT_JNI_CALLBYTEMETHOD_RETURN(_ret_ref)) + , HOTSPOT_JNI_CALLBYTEMETHODV_ENTRY(env, obj, (uintptr_t)methodID), + HOTSPOT_JNI_CALLBYTEMETHODV_RETURN(_ret_ref)) DEFINE_CALLMETHODV(jchar, Char, T_CHAR - , HOTSPOT_JNI_CALLCHARMETHOD_ENTRY(env, obj, (uintptr_t)methodID), - HOTSPOT_JNI_CALLCHARMETHOD_RETURN(_ret_ref)) + , HOTSPOT_JNI_CALLCHARMETHODV_ENTRY(env, obj, (uintptr_t)methodID), + HOTSPOT_JNI_CALLCHARMETHODV_RETURN(_ret_ref)) DEFINE_CALLMETHODV(jshort, Short, T_SHORT - , HOTSPOT_JNI_CALLSHORTMETHOD_ENTRY(env, obj, (uintptr_t)methodID), - HOTSPOT_JNI_CALLSHORTMETHOD_RETURN(_ret_ref)) + , HOTSPOT_JNI_CALLSHORTMETHODV_ENTRY(env, obj, (uintptr_t)methodID), + HOTSPOT_JNI_CALLSHORTMETHODV_RETURN(_ret_ref)) DEFINE_CALLMETHODV(jobject, Object, T_OBJECT - , HOTSPOT_JNI_CALLOBJECTMETHOD_ENTRY(env, obj, (uintptr_t)methodID), - HOTSPOT_JNI_CALLOBJECTMETHOD_RETURN(_ret_ref)) + , HOTSPOT_JNI_CALLOBJECTMETHODV_ENTRY(env, obj, (uintptr_t)methodID), + HOTSPOT_JNI_CALLOBJECTMETHODV_RETURN(_ret_ref)) DEFINE_CALLMETHODV(jint, Int, T_INT, - HOTSPOT_JNI_CALLINTMETHOD_ENTRY(env, obj, (uintptr_t)methodID), - HOTSPOT_JNI_CALLINTMETHOD_RETURN(_ret_ref)) + HOTSPOT_JNI_CALLINTMETHODV_ENTRY(env, obj, (uintptr_t)methodID), + HOTSPOT_JNI_CALLINTMETHODV_RETURN(_ret_ref)) DEFINE_CALLMETHODV(jlong, Long, T_LONG - , HOTSPOT_JNI_CALLLONGMETHOD_ENTRY(env, obj, (uintptr_t)methodID), - HOTSPOT_JNI_CALLLONGMETHOD_RETURN(_ret_ref)) + , HOTSPOT_JNI_CALLLONGMETHODV_ENTRY(env, obj, (uintptr_t)methodID), + HOTSPOT_JNI_CALLLONGMETHODV_RETURN(_ret_ref)) // Float and double probes don't return value because dtrace doesn't currently support it DEFINE_CALLMETHODV(jfloat, Float, T_FLOAT - , HOTSPOT_JNI_CALLFLOATMETHOD_ENTRY(env, obj, (uintptr_t)methodID), - HOTSPOT_JNI_CALLFLOATMETHOD_RETURN()) + , HOTSPOT_JNI_CALLFLOATMETHODV_ENTRY(env, obj, (uintptr_t)methodID), + HOTSPOT_JNI_CALLFLOATMETHODV_RETURN()) DEFINE_CALLMETHODV(jdouble, Double, T_DOUBLE - , HOTSPOT_JNI_CALLDOUBLEMETHOD_ENTRY(env, obj, (uintptr_t)methodID), - HOTSPOT_JNI_CALLDOUBLEMETHOD_RETURN()) + , HOTSPOT_JNI_CALLDOUBLEMETHODV_ENTRY(env, obj, (uintptr_t)methodID), + HOTSPOT_JNI_CALLDOUBLEMETHODV_RETURN()) #define DEFINE_CALLMETHODA(ResultType, Result, Tag \ , EntryProbe, ReturnProbe) \ @@ -1856,34 +1856,34 @@ JNI_END // the runtime type of subword integral basic types is integer DEFINE_CALLMETHODA(jboolean, Boolean, T_BOOLEAN - , HOTSPOT_JNI_CALLBOOLEANMETHOD_ENTRY(env, obj, (uintptr_t)methodID), - HOTSPOT_JNI_CALLBOOLEANMETHOD_RETURN(_ret_ref)) + , HOTSPOT_JNI_CALLBOOLEANMETHODA_ENTRY(env, obj, (uintptr_t)methodID), + HOTSPOT_JNI_CALLBOOLEANMETHODA_RETURN(_ret_ref)) DEFINE_CALLMETHODA(jbyte, Byte, T_BYTE - , HOTSPOT_JNI_CALLBYTEMETHOD_ENTRY(env, obj, (uintptr_t)methodID), - HOTSPOT_JNI_CALLBYTEMETHOD_RETURN(_ret_ref)) + , HOTSPOT_JNI_CALLBYTEMETHODA_ENTRY(env, obj, (uintptr_t)methodID), + HOTSPOT_JNI_CALLBYTEMETHODA_RETURN(_ret_ref)) DEFINE_CALLMETHODA(jchar, Char, T_CHAR - , HOTSPOT_JNI_CALLCHARMETHOD_ENTRY(env, obj, (uintptr_t)methodID), - HOTSPOT_JNI_CALLCHARMETHOD_RETURN(_ret_ref)) + , HOTSPOT_JNI_CALLCHARMETHODA_ENTRY(env, obj, (uintptr_t)methodID), + HOTSPOT_JNI_CALLCHARMETHODA_RETURN(_ret_ref)) DEFINE_CALLMETHODA(jshort, Short, T_SHORT - , HOTSPOT_JNI_CALLSHORTMETHOD_ENTRY(env, obj, (uintptr_t)methodID), - HOTSPOT_JNI_CALLSHORTMETHOD_RETURN(_ret_ref)) + , HOTSPOT_JNI_CALLSHORTMETHODA_ENTRY(env, obj, (uintptr_t)methodID), + HOTSPOT_JNI_CALLSHORTMETHODA_RETURN(_ret_ref)) DEFINE_CALLMETHODA(jobject, Object, T_OBJECT - , HOTSPOT_JNI_CALLOBJECTMETHOD_ENTRY(env, obj, (uintptr_t)methodID), - HOTSPOT_JNI_CALLOBJECTMETHOD_RETURN(_ret_ref)) + , HOTSPOT_JNI_CALLOBJECTMETHODA_ENTRY(env, obj, (uintptr_t)methodID), + HOTSPOT_JNI_CALLOBJECTMETHODA_RETURN(_ret_ref)) DEFINE_CALLMETHODA(jint, Int, T_INT, - HOTSPOT_JNI_CALLINTMETHOD_ENTRY(env, obj, (uintptr_t)methodID), - HOTSPOT_JNI_CALLINTMETHOD_RETURN(_ret_ref)) + HOTSPOT_JNI_CALLINTMETHODA_ENTRY(env, obj, (uintptr_t)methodID), + HOTSPOT_JNI_CALLINTMETHODA_RETURN(_ret_ref)) DEFINE_CALLMETHODA(jlong, Long, T_LONG - , HOTSPOT_JNI_CALLLONGMETHOD_ENTRY(env, obj, (uintptr_t)methodID), - HOTSPOT_JNI_CALLLONGMETHOD_RETURN(_ret_ref)) + , HOTSPOT_JNI_CALLLONGMETHODA_ENTRY(env, obj, (uintptr_t)methodID), + HOTSPOT_JNI_CALLLONGMETHODA_RETURN(_ret_ref)) // Float and double probes don't return value because dtrace doesn't currently support it DEFINE_CALLMETHODA(jfloat, Float, T_FLOAT - , HOTSPOT_JNI_CALLFLOATMETHOD_ENTRY(env, obj, (uintptr_t)methodID), - HOTSPOT_JNI_CALLFLOATMETHOD_RETURN()) + , HOTSPOT_JNI_CALLFLOATMETHODA_ENTRY(env, obj, (uintptr_t)methodID), + HOTSPOT_JNI_CALLFLOATMETHODA_RETURN()) DEFINE_CALLMETHODA(jdouble, Double, T_DOUBLE - , HOTSPOT_JNI_CALLDOUBLEMETHOD_ENTRY(env, obj, (uintptr_t)methodID), - HOTSPOT_JNI_CALLDOUBLEMETHOD_RETURN()) + , HOTSPOT_JNI_CALLDOUBLEMETHODA_ENTRY(env, obj, (uintptr_t)methodID), + HOTSPOT_JNI_CALLDOUBLEMETHODA_RETURN()) DT_VOID_RETURN_MARK_DECL(CallVoidMethod, HOTSPOT_JNI_CALLVOIDMETHOD_RETURN()); DT_VOID_RETURN_MARK_DECL(CallVoidMethodV, HOTSPOT_JNI_CALLVOIDMETHODV_RETURN()); @@ -3145,7 +3145,7 @@ JNI_ENTRY(void, jni_SetStatic##Result##Field(JNIEnv *env, jclass clazz, jfieldID JNI_END DEFINE_SETSTATICFIELD(jboolean, bool, Boolean, 'Z', z - , HOTSPOT_JNI_SETBOOLEANFIELD_ENTRY(env, clazz, (uintptr_t)fieldID, value), + , HOTSPOT_JNI_SETSTATICBOOLEANFIELD_ENTRY(env, clazz, (uintptr_t)fieldID, value), HOTSPOT_JNI_SETBOOLEANFIELD_RETURN()) DEFINE_SETSTATICFIELD(jbyte, byte, Byte, 'B', b , HOTSPOT_JNI_SETSTATICBYTEFIELD_ENTRY(env, clazz, (uintptr_t) fieldID, value), diff --git a/hotspot/src/share/vm/runtime/synchronizer.cpp b/hotspot/src/share/vm/runtime/synchronizer.cpp index 99f0d07771d..8ea34005b03 100644 --- a/hotspot/src/share/vm/runtime/synchronizer.cpp +++ b/hotspot/src/share/vm/runtime/synchronizer.cpp @@ -119,7 +119,7 @@ HS_DTRACE_PROBE_DECL4(hotspot, monitor__waited, } \ } -#define HOTSPOT_MONITOR_PROBE_waited HOTSPOT_MONITOR_PROBE_WAITED +#define HOTSPOT_MONITOR_PROBE_waited HOTSPOT_MONITOR_WAITED #define DTRACE_MONITOR_PROBE(probe, monitor, obj, thread) \ { \ diff --git a/hotspot/src/share/vm/runtime/thread.cpp b/hotspot/src/share/vm/runtime/thread.cpp index 9f31c25b7c6..a7b8068e211 100644 --- a/hotspot/src/share/vm/runtime/thread.cpp +++ b/hotspot/src/share/vm/runtime/thread.cpp @@ -135,8 +135,8 @@ HS_DTRACE_PROBE_DECL5(hotspot, thread__stop, char*, intptr_t, #else /* USDT2 */ -#define HOTSPOT_THREAD_PROBE_start HOTSPOT_THREAD_PROBE_START -#define HOTSPOT_THREAD_PROBE_stop HOTSPOT_THREAD_PROBE_STOP +#define HOTSPOT_THREAD_PROBE_start HOTSPOT_THREAD_START +#define HOTSPOT_THREAD_PROBE_stop HOTSPOT_THREAD_STOP #define DTRACE_THREAD_PROBE(probe, javathread) \ { \ From c684cce0427f88153738a6b5da5f2dd2900adc8a Mon Sep 17 00:00:00 2001 From: Dmitry Samersoff Date: Wed, 18 Dec 2013 20:32:46 +0400 Subject: [PATCH 039/377] 8028408: unused-value warning on forte.cpp when build on Mac Cast argument to void in function type definition Reviewed-by: sla, sspitsyn --- hotspot/src/share/vm/prims/forte.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hotspot/src/share/vm/prims/forte.cpp b/hotspot/src/share/vm/prims/forte.cpp index 4b1fbebc137..f930ad7ca54 100644 --- a/hotspot/src/share/vm/prims/forte.cpp +++ b/hotspot/src/share/vm/prims/forte.cpp @@ -613,7 +613,7 @@ void AsyncGetCallTrace(ASGCT_CallTrace *trace, jint depth, void* ucontext) { #ifdef __APPLE__ // XXXDARWIN: Link errors occur even when __attribute__((weak_import)) // is added -#define collector_func_load(x0,x1,x2,x3,x4,x5,x6) (0) +#define collector_func_load(x0,x1,x2,x3,x4,x5,x6) ((void)(0)) #else void collector_func_load(char* name, void* null_argument_1, From ed5c74480334653ddf5fc1132728a45f3c3c51df Mon Sep 17 00:00:00 2001 From: Dmitry Samersoff Date: Wed, 18 Dec 2013 23:09:57 +0400 Subject: [PATCH 040/377] 6969276: minor memory leak detected by cppcheck in agent/src/os/linux/symtab.c Missed free call on error return Reviewed-by: sla, sspitsyn, igerasim --- hotspot/agent/src/os/linux/symtab.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hotspot/agent/src/os/linux/symtab.c b/hotspot/agent/src/os/linux/symtab.c index f9fc33f14ec..45976658d59 100644 --- a/hotspot/agent/src/os/linux/symtab.c +++ b/hotspot/agent/src/os/linux/symtab.c @@ -214,8 +214,10 @@ static int open_file_from_debug_link(const char *name, + 2); strcpy(debug_pathname, name); char *last_slash = strrchr(debug_pathname, '/'); - if (last_slash == NULL) + if (last_slash == NULL) { + free(debug_pathname); return -1; + } /* Look in the same directory as the object. */ strcpy(last_slash+1, debug_filename); From 208a1a025ebadc7d5ca96f08814eacd4126ad5ba Mon Sep 17 00:00:00 2001 From: Coleen Phillimore Date: Thu, 19 Dec 2013 20:28:45 +0000 Subject: [PATCH 041/377] 8030633: nsk/jvmti/RedefineClasses/StressRedefine failed invalid method ordering length on Solaris A method with no declared methods was getting an AME overpass method with the latest change. The method_ordering array was not updated for the new methods. Reviewed-by: dcubed, acorn, dsamersoff, lfoltan, hseigel --- hotspot/src/share/vm/classfile/defaultMethods.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/hotspot/src/share/vm/classfile/defaultMethods.cpp b/hotspot/src/share/vm/classfile/defaultMethods.cpp index 8a60a6b36a3..0ebeecc624b 100644 --- a/hotspot/src/share/vm/classfile/defaultMethods.cpp +++ b/hotspot/src/share/vm/classfile/defaultMethods.cpp @@ -1044,7 +1044,8 @@ static void merge_in_new_methods(InstanceKlass* klass, Array* merged_methods = MetadataFactory::new_array( klass->class_loader_data(), new_size, NULL, CHECK); - if (original_ordering != NULL && original_ordering->length() > 0) { + // original_ordering might be empty if this class has no methods of its own + if (JvmtiExport::can_maintain_original_method_order() || DumpSharedSpaces) { merged_ordering = MetadataFactory::new_array( klass->class_loader_data(), new_size, CHECK); } @@ -1071,6 +1072,8 @@ static void merge_in_new_methods(InstanceKlass* klass, merged_methods->at_put(i, orig_method); original_methods->at_put(orig_idx, NULL); if (merged_ordering->length() > 0) { + assert(original_ordering != NULL && original_ordering->length() > 0, + "should have original order information for this method"); merged_ordering->at_put(i, original_ordering->at(orig_idx)); } ++orig_idx; @@ -1099,13 +1102,14 @@ static void merge_in_new_methods(InstanceKlass* klass, // Replace klass methods with new merged lists klass->set_methods(merged_methods); klass->set_initial_method_idnum(new_size); + klass->set_method_ordering(merged_ordering); + // Free metadata ClassLoaderData* cld = klass->class_loader_data(); - if (original_methods ->length() > 0) { + if (original_methods->length() > 0) { MetadataFactory::free_array(cld, original_methods); } - if (original_ordering->length() > 0) { - klass->set_method_ordering(merged_ordering); + if (original_ordering != NULL && original_ordering->length() > 0) { MetadataFactory::free_array(cld, original_ordering); } } From dbde42105e2b175be9d35dbe18d732bbd44d56cb Mon Sep 17 00:00:00 2001 From: George Triantafillou Date: Mon, 23 Dec 2013 10:13:42 -0500 Subject: [PATCH 042/377] 8021774: [TESTBUG] Tests failed because of a warning in its output Remove check for warning Reviewed-by: zgu, mseledtsov --- hotspot/test/runtime/NMT/CommandLineDetail.java | 3 +-- hotspot/test/runtime/NMT/CommandLineSummary.java | 3 +-- hotspot/test/runtime/NMT/CommandLineTurnOffNMT.java | 3 +-- hotspot/test/runtime/NMT/PrintNMTStatistics.java | 1 - 4 files changed, 3 insertions(+), 7 deletions(-) diff --git a/hotspot/test/runtime/NMT/CommandLineDetail.java b/hotspot/test/runtime/NMT/CommandLineDetail.java index d993316ba9c..01b0d0d3fae 100644 --- a/hotspot/test/runtime/NMT/CommandLineDetail.java +++ b/hotspot/test/runtime/NMT/CommandLineDetail.java @@ -24,7 +24,7 @@ /* * @test * @key nmt - * @summary Running with NMT detail should not result in an error or warning + * @summary Running with NMT detail should not result in an error * @library /testlibrary */ @@ -39,7 +39,6 @@ public class CommandLineDetail { "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldNotContain("error"); - output.shouldNotContain("warning"); output.shouldHaveExitValue(0); } } diff --git a/hotspot/test/runtime/NMT/CommandLineSummary.java b/hotspot/test/runtime/NMT/CommandLineSummary.java index b8415d1bde9..d07bc7eae63 100644 --- a/hotspot/test/runtime/NMT/CommandLineSummary.java +++ b/hotspot/test/runtime/NMT/CommandLineSummary.java @@ -24,7 +24,7 @@ /* * @test * @key nmt - * @summary Running with NMT summary should not result in an error or warning + * @summary Running with NMT summary should not result in an error * @library /testlibrary */ @@ -39,7 +39,6 @@ public class CommandLineSummary { "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldNotContain("error"); - output.shouldNotContain("warning"); output.shouldHaveExitValue(0); } } diff --git a/hotspot/test/runtime/NMT/CommandLineTurnOffNMT.java b/hotspot/test/runtime/NMT/CommandLineTurnOffNMT.java index e8d950cba0a..4193c9775d4 100644 --- a/hotspot/test/runtime/NMT/CommandLineTurnOffNMT.java +++ b/hotspot/test/runtime/NMT/CommandLineTurnOffNMT.java @@ -24,7 +24,7 @@ /* * @test * @key nmt - * @summary Turning off NMT should not result in an error or warning + * @summary Turning off NMT should not result in an error * @library /testlibrary */ @@ -38,7 +38,6 @@ public class CommandLineTurnOffNMT { "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldNotContain("error"); - output.shouldNotContain("warning"); output.shouldHaveExitValue(0); } } diff --git a/hotspot/test/runtime/NMT/PrintNMTStatistics.java b/hotspot/test/runtime/NMT/PrintNMTStatistics.java index 96bc2f3267f..534fe7ae421 100644 --- a/hotspot/test/runtime/NMT/PrintNMTStatistics.java +++ b/hotspot/test/runtime/NMT/PrintNMTStatistics.java @@ -64,7 +64,6 @@ public class PrintNMTStatistics { OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldContain("Java Heap (reserved="); output.shouldNotContain("error"); - output.shouldNotContain("warning"); output.shouldHaveExitValue(0); } } From cfefbcebf52a395ec4a34bfb98abff96951e2691 Mon Sep 17 00:00:00 2001 From: Igor Ignatyev Date: Mon, 23 Dec 2013 20:56:18 +0400 Subject: [PATCH 043/377] 8029070: memory leak in jmm_SetVMGlobal Reviewed-by: kvn, dholmes --- hotspot/src/share/vm/runtime/globals.cpp | 3 --- hotspot/src/share/vm/runtime/globals.hpp | 2 ++ hotspot/src/share/vm/runtime/globals_extension.hpp | 1 + hotspot/src/share/vm/services/management.cpp | 5 ++++- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/hotspot/src/share/vm/runtime/globals.cpp b/hotspot/src/share/vm/runtime/globals.cpp index 76a6b935663..f1783af15d4 100644 --- a/hotspot/src/share/vm/runtime/globals.cpp +++ b/hotspot/src/share/vm/runtime/globals.cpp @@ -702,8 +702,6 @@ bool CommandLineFlags::ccstrAt(char* name, size_t len, ccstr* value) { return true; } -// Contract: Flag will make private copy of the incoming value. -// Outgoing value is always malloc-ed, and caller MUST call free. bool CommandLineFlags::ccstrAtPut(char* name, size_t len, ccstr* value, Flag::Flags origin) { Flag* result = Flag::find_flag(name, len); if (result == NULL) return false; @@ -726,7 +724,6 @@ bool CommandLineFlags::ccstrAtPut(char* name, size_t len, ccstr* value, Flag::Fl return true; } -// Contract: Flag will make private copy of the incoming value. void CommandLineFlagsEx::ccstrAtPut(CommandLineFlagWithType flag, ccstr value, Flag::Flags origin) { Flag* faddr = address_of_flag(flag); guarantee(faddr != NULL && faddr->is_ccstr(), "wrong flag type"); diff --git a/hotspot/src/share/vm/runtime/globals.hpp b/hotspot/src/share/vm/runtime/globals.hpp index 4967eadd076..3703d65be53 100644 --- a/hotspot/src/share/vm/runtime/globals.hpp +++ b/hotspot/src/share/vm/runtime/globals.hpp @@ -376,6 +376,8 @@ class CommandLineFlags { static bool ccstrAt(char* name, size_t len, ccstr* value); static bool ccstrAt(char* name, ccstr* value) { return ccstrAt(name, strlen(name), value); } + // Contract: Flag will make private copy of the incoming value. + // Outgoing value is always malloc-ed, and caller MUST call free. static bool ccstrAtPut(char* name, size_t len, ccstr* value, Flag::Flags origin); static bool ccstrAtPut(char* name, ccstr* value, Flag::Flags origin) { return ccstrAtPut(name, strlen(name), value, origin); } diff --git a/hotspot/src/share/vm/runtime/globals_extension.hpp b/hotspot/src/share/vm/runtime/globals_extension.hpp index ea3fc60739c..19e697f5fea 100644 --- a/hotspot/src/share/vm/runtime/globals_extension.hpp +++ b/hotspot/src/share/vm/runtime/globals_extension.hpp @@ -201,6 +201,7 @@ class CommandLineFlagsEx : CommandLineFlags { static void uintxAtPut(CommandLineFlagWithType flag, uintx value, Flag::Flags origin); static void uint64_tAtPut(CommandLineFlagWithType flag, uint64_t value, Flag::Flags origin); static void doubleAtPut(CommandLineFlagWithType flag, double value, Flag::Flags origin); + // Contract: Flag will make private copy of the incoming value static void ccstrAtPut(CommandLineFlagWithType flag, ccstr value, Flag::Flags origin); static bool is_default(CommandLineFlag flag); diff --git a/hotspot/src/share/vm/services/management.cpp b/hotspot/src/share/vm/services/management.cpp index 9585960daa2..4876ce9622a 100644 --- a/hotspot/src/share/vm/services/management.cpp +++ b/hotspot/src/share/vm/services/management.cpp @@ -1821,7 +1821,7 @@ JVM_ENTRY(void, jmm_SetVMGlobal(JNIEnv *env, jstring flag_name, jvalue new_value "This flag is not writeable."); } - bool succeed; + bool succeed = false; if (flag->is_bool()) { bool bvalue = (new_value.z == JNI_TRUE ? true : false); succeed = CommandLineFlags::boolAtPut(name, &bvalue, Flag::MANAGEMENT); @@ -1841,6 +1841,9 @@ JVM_ENTRY(void, jmm_SetVMGlobal(JNIEnv *env, jstring flag_name, jvalue new_value } ccstr svalue = java_lang_String::as_utf8_string(str); succeed = CommandLineFlags::ccstrAtPut(name, &svalue, Flag::MANAGEMENT); + if (succeed) { + FREE_C_HEAP_ARRAY(char, svalue, mtInternal); + } } assert(succeed, "Setting flag should succeed"); JVM_END From ac9faf42431b0802988bce8f4e4eeb7a53a790f1 Mon Sep 17 00:00:00 2001 From: Harold Seigel Date: Mon, 23 Dec 2013 18:44:59 -0500 Subject: [PATCH 044/377] 8023735: [TESTBUG] runtime/XCheckJniJsig/XCheckJSig.java fails on MacOS X Look for libjsig in correct locations and do not fail if it's not found Reviewed-by: zgu, ccheung --- .../runtime/XCheckJniJsig/XCheckJSig.java | 33 ++++++++++--------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/hotspot/test/runtime/XCheckJniJsig/XCheckJSig.java b/hotspot/test/runtime/XCheckJniJsig/XCheckJSig.java index aeed6d4bb87..ac22b7493bd 100644 --- a/hotspot/test/runtime/XCheckJniJsig/XCheckJSig.java +++ b/hotspot/test/runtime/XCheckJniJsig/XCheckJSig.java @@ -22,7 +22,6 @@ */ /* - * @ignore 8023735 * @test * @bug 7051189 8023393 * @summary Need to suppress info message if -Xcheck:jni is used with libjsig.so @@ -30,7 +29,8 @@ * @run main XCheckJSig */ -import java.util.*; +import java.io.File; +import java.util.Map; import com.oracle.java.testlibrary.*; public class XCheckJSig { @@ -47,33 +47,36 @@ public class XCheckJSig { String libjsig; String env_var; if (Platform.isOSX()) { - libjsig = jdk_path + "/jre/lib/server/libjsig.dylib"; env_var = "DYLD_INSERT_LIBRARIES"; + libjsig = jdk_path + "/jre/lib/libjsig.dylib"; // jdk location + if (!(new File(libjsig).exists())) { + libjsig = jdk_path + "/lib/libjsig.dylib"; // jre location + } } else { - libjsig = jdk_path + "/jre/lib/" + os_arch + "/libjsig.so"; env_var = "LD_PRELOAD"; - } - String java_program; - if (Platform.isSolaris()) { - // On Solaris, need to call the 64-bit Java directly in order for - // LD_PRELOAD to work because libjsig.so is 64-bit. - java_program = jdk_path + "/jre/bin/" + os_arch + "/java"; - } else { - java_program = JDKToolFinder.getJDKTool("java"); + libjsig = jdk_path + "/jre/lib/" + os_arch + "/libjsig.so"; // jdk location + if (!(new File(libjsig).exists())) { + libjsig = jdk_path + "/lib/" + os_arch + "/libjsig.so"; // jre location + } } // If this test fails, these might be useful to know. System.out.println("libjsig: " + libjsig); System.out.println("osArch: " + os_arch); - System.out.println("java_program: " + java_program); - ProcessBuilder pb = new ProcessBuilder(java_program, "-Xcheck:jni", "-version"); + // Make sure the libjsig file exists. + if (!(new File(libjsig).exists())) { + System.out.println("File " + libjsig + " not found, skipping"); + return; + } + + ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xcheck:jni", "-version"); Map env = pb.environment(); env.put(env_var, libjsig); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldNotContain("libjsig is activated"); output.shouldHaveExitValue(0); - pb = new ProcessBuilder(java_program, "-Xcheck:jni", "-verbose:jni", "-version"); + pb = ProcessTools.createJavaProcessBuilder("-Xcheck:jni", "-verbose:jni", "-version"); env = pb.environment(); env.put(env_var, libjsig); output = new OutputAnalyzer(pb.start()); From a0da47fd66549fb7484d8ea36d070027924f6576 Mon Sep 17 00:00:00 2001 From: Mikael Vidstedt Date: Tue, 24 Dec 2013 11:48:39 -0800 Subject: [PATCH 045/377] 8029233: Update copyright year to match last edit in jdk8 hotspot repository for 2013 Copyright year updated for files modified during 2013 Reviewed-by: twisti, iveresov --- hotspot/agent/make/Makefile | 2 +- hotspot/agent/src/os/linux/libproc.h | 2 +- hotspot/agent/src/os/linux/salibelf.c | 2 +- hotspot/agent/src/os/linux/symtab.c | 2 +- hotspot/agent/src/os/solaris/proc/saproc.cpp | 2 +- hotspot/agent/src/os/win32/windbg/sawindbg.cpp | 2 +- hotspot/agent/src/share/classes/sun/jvm/hotspot/CLHSDB.java | 2 +- .../src/share/classes/sun/jvm/hotspot/CommandProcessor.java | 2 +- hotspot/agent/src/share/classes/sun/jvm/hotspot/HSDB.java | 2 +- .../src/share/classes/sun/jvm/hotspot/LinuxVtblAccess.java | 2 +- .../src/share/classes/sun/jvm/hotspot/asm/Disassembler.java | 2 +- hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciEnv.java | 2 +- .../agent/src/share/classes/sun/jvm/hotspot/ci/ciMethod.java | 2 +- .../agent/src/share/classes/sun/jvm/hotspot/code/NMethod.java | 2 +- .../src/share/classes/sun/jvm/hotspot/compiler/CompileTask.java | 2 +- .../share/classes/sun/jvm/hotspot/debugger/bsd/BsdAddress.java | 2 +- .../share/classes/sun/jvm/hotspot/debugger/bsd/BsdDebugger.java | 2 +- .../classes/sun/jvm/hotspot/debugger/linux/LinuxAddress.java | 2 +- .../sun/jvm/hotspot/debugger/linux/LinuxDebuggerLocal.java | 2 +- .../classes/sun/jvm/hotspot/debugger/linux/LinuxOopHandle.java | 2 +- .../sun/jvm/hotspot/debugger/linux/amd64/LinuxAMD64CFrame.java | 2 +- .../sun/jvm/hotspot/debugger/linux/x86/LinuxX86CFrame.java | 2 +- .../sun/jvm/hotspot/debugger/windbg/WindbgCDebugger.java | 2 +- .../sun/jvm/hotspot/debugger/windbg/WindbgDebuggerLocal.java | 2 +- .../jvm/hotspot/debugger/windows/amd64/WindowsAMD64CFrame.java | 2 +- .../sun/jvm/hotspot/debugger/windows/x86/WindowsX86CFrame.java | 2 +- .../src/share/classes/sun/jvm/hotspot/jdi/JVMTIThreadState.java | 2 +- .../src/share/classes/sun/jvm/hotspot/memory/CMSCollector.java | 2 +- .../share/classes/sun/jvm/hotspot/memory/DictionaryEntry.java | 2 +- .../src/share/classes/sun/jvm/hotspot/memory/SymbolTable.java | 2 +- .../src/share/classes/sun/jvm/hotspot/oops/ArrayKlass.java | 2 +- .../src/share/classes/sun/jvm/hotspot/oops/InstanceKlass.java | 2 +- hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Klass.java | 2 +- .../src/share/classes/sun/jvm/hotspot/oops/MethodCounters.java | 2 +- .../src/share/classes/sun/jvm/hotspot/oops/MethodData.java | 2 +- .../src/share/classes/sun/jvm/hotspot/oops/ObjectHeap.java | 2 +- .../agent/src/share/classes/sun/jvm/hotspot/opto/PhaseCFG.java | 2 +- .../classes/sun/jvm/hotspot/runtime/ThreadLocalAllocBuffer.java | 2 +- hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java | 2 +- .../hotspot/runtime/bsd_amd64/BsdAMD64JavaThreadPDAccess.java | 2 +- .../src/share/classes/sun/jvm/hotspot/tools/FinalizerInfo.java | 2 +- .../src/share/classes/sun/jvm/hotspot/tools/FlagDumper.java | 2 +- .../src/share/classes/sun/jvm/hotspot/tools/HeapDumper.java | 2 +- .../src/share/classes/sun/jvm/hotspot/tools/HeapSummary.java | 2 +- .../agent/src/share/classes/sun/jvm/hotspot/tools/JInfo.java | 2 +- .../agent/src/share/classes/sun/jvm/hotspot/tools/JSnap.java | 2 +- .../agent/src/share/classes/sun/jvm/hotspot/tools/JStack.java | 2 +- .../share/classes/sun/jvm/hotspot/tools/ObjectHistogram.java | 2 +- hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/PMap.java | 2 +- .../src/share/classes/sun/jvm/hotspot/tools/StackTrace.java | 2 +- .../src/share/classes/sun/jvm/hotspot/tools/SysPropsDumper.java | 2 +- hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/Tool.java | 2 +- .../src/share/classes/sun/jvm/hotspot/tools/soql/JSDB.java | 2 +- .../src/share/classes/sun/jvm/hotspot/tools/soql/SOQL.java | 2 +- .../classes/sun/jvm/hotspot/types/basic/BasicTypeDataBase.java | 2 +- hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/SAPanel.java | 2 +- .../sun/jvm/hotspot/utilities/AbstractHeapGraphWriter.java | 2 +- .../share/classes/sun/jvm/hotspot/utilities/HeapGXLWriter.java | 2 +- .../classes/sun/jvm/hotspot/utilities/HeapHprofBinWriter.java | 2 +- .../sun/jvm/hotspot/utilities/soql/JSJavaInstanceKlass.java | 2 +- .../src/share/classes/sun/jvm/hotspot/utilities/soql/sa.js | 2 +- hotspot/make/bsd/makefiles/adlc.make | 2 +- hotspot/make/bsd/makefiles/minimal1.make | 2 +- hotspot/make/hotspot.script | 2 +- hotspot/make/linux/makefiles/adlc.make | 2 +- hotspot/make/linux/makefiles/jsig.make | 2 +- hotspot/make/linux/makefiles/minimal1.make | 2 +- hotspot/make/linux/makefiles/saproc.make | 2 +- hotspot/make/sa.files | 2 +- hotspot/make/solaris/makefiles/adlc.make | 2 +- hotspot/make/solaris/makefiles/gcc.make | 2 +- hotspot/make/windows/build_vm_def.sh | 2 +- hotspot/make/windows/makefiles/adlc.make | 2 +- hotspot/make/windows/makefiles/debug.make | 2 +- hotspot/make/windows/makefiles/product.make | 2 +- hotspot/make/windows/makefiles/rules.make | 2 +- hotspot/make/windows/makefiles/sa.make | 2 +- hotspot/src/cpu/sparc/vm/assembler_sparc.hpp | 2 +- hotspot/src/cpu/sparc/vm/assembler_sparc.inline.hpp | 2 +- hotspot/src/cpu/sparc/vm/c1_CodeStubs_sparc.cpp | 2 +- hotspot/src/cpu/sparc/vm/c1_FrameMap_sparc.cpp | 2 +- hotspot/src/cpu/sparc/vm/c1_MacroAssembler_sparc.cpp | 2 +- hotspot/src/cpu/sparc/vm/c1_Runtime1_sparc.cpp | 2 +- hotspot/src/cpu/sparc/vm/c1_globals_sparc.hpp | 2 +- hotspot/src/cpu/sparc/vm/c2_globals_sparc.hpp | 2 +- hotspot/src/cpu/sparc/vm/c2_init_sparc.cpp | 2 +- hotspot/src/cpu/sparc/vm/disassembler_sparc.hpp | 2 +- hotspot/src/cpu/sparc/vm/frame_sparc.inline.hpp | 2 +- hotspot/src/cpu/sparc/vm/globalDefinitions_sparc.hpp | 2 +- hotspot/src/cpu/sparc/vm/globals_sparc.hpp | 2 +- hotspot/src/cpu/sparc/vm/jni_sparc.h | 2 +- hotspot/src/cpu/sparc/vm/nativeInst_sparc.hpp | 2 +- hotspot/src/cpu/sparc/vm/register_sparc.hpp | 2 +- hotspot/src/cpu/sparc/vm/sharedRuntime_sparc.cpp | 2 +- hotspot/src/cpu/sparc/vm/stubGenerator_sparc.cpp | 2 +- hotspot/src/cpu/sparc/vm/stubRoutines_sparc.cpp | 2 +- hotspot/src/cpu/sparc/vm/stubRoutines_sparc.hpp | 2 +- hotspot/src/cpu/sparc/vm/vmStructs_sparc.hpp | 2 +- hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp | 2 +- hotspot/src/cpu/sparc/vm/vm_version_sparc.hpp | 2 +- hotspot/src/cpu/x86/vm/bytecodeInterpreter_x86.cpp | 2 +- hotspot/src/cpu/x86/vm/c1_CodeStubs_x86.cpp | 2 +- hotspot/src/cpu/x86/vm/c1_FrameMap_x86.cpp | 2 +- hotspot/src/cpu/x86/vm/c1_FrameMap_x86.hpp | 2 +- hotspot/src/cpu/x86/vm/c1_LinearScan_x86.cpp | 2 +- hotspot/src/cpu/x86/vm/c1_MacroAssembler_x86.cpp | 2 +- hotspot/src/cpu/x86/vm/c1_Runtime1_x86.cpp | 2 +- hotspot/src/cpu/x86/vm/c1_globals_x86.hpp | 2 +- hotspot/src/cpu/x86/vm/c2_globals_x86.hpp | 2 +- hotspot/src/cpu/x86/vm/frame_x86.hpp | 2 +- hotspot/src/cpu/x86/vm/frame_x86.inline.hpp | 2 +- hotspot/src/cpu/x86/vm/globalDefinitions_x86.hpp | 2 +- hotspot/src/cpu/x86/vm/register_definitions_x86.cpp | 2 +- hotspot/src/cpu/x86/vm/sharedRuntime_x86_32.cpp | 2 +- hotspot/src/cpu/x86/vm/sharedRuntime_x86_64.cpp | 2 +- hotspot/src/cpu/x86/vm/templateInterpreter_x86.hpp | 2 +- hotspot/src/cpu/x86/vm/vmStructs_x86.hpp | 2 +- hotspot/src/cpu/x86/vm/vtableStubs_x86_32.cpp | 2 +- hotspot/src/cpu/x86/vm/vtableStubs_x86_64.cpp | 2 +- hotspot/src/cpu/zero/vm/assembler_zero.cpp | 2 +- hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp | 2 +- hotspot/src/cpu/zero/vm/entryFrame_zero.hpp | 2 +- hotspot/src/cpu/zero/vm/frame_zero.cpp | 2 +- hotspot/src/cpu/zero/vm/frame_zero.inline.hpp | 2 +- hotspot/src/cpu/zero/vm/globals_zero.hpp | 2 +- hotspot/src/cpu/zero/vm/icBuffer_zero.cpp | 2 +- hotspot/src/cpu/zero/vm/interp_masm_zero.hpp | 2 +- hotspot/src/cpu/zero/vm/interpreter_zero.cpp | 2 +- hotspot/src/cpu/zero/vm/jni_zero.h | 2 +- hotspot/src/cpu/zero/vm/nativeInst_zero.hpp | 2 +- hotspot/src/cpu/zero/vm/register_zero.cpp | 2 +- hotspot/src/cpu/zero/vm/relocInfo_zero.cpp | 2 +- hotspot/src/cpu/zero/vm/sharedRuntime_zero.cpp | 2 +- hotspot/src/cpu/zero/vm/sharkFrame_zero.hpp | 2 +- hotspot/src/cpu/zero/vm/stubGenerator_zero.cpp | 2 +- hotspot/src/cpu/zero/vm/vmStructs_zero.hpp | 2 +- hotspot/src/cpu/zero/vm/vtableStubs_zero.cpp | 2 +- hotspot/src/os/bsd/dtrace/jvm_dtrace.c | 2 +- hotspot/src/os/posix/vm/os_posix.hpp | 2 +- hotspot/src/os/solaris/dtrace/jvm_dtrace.c | 2 +- hotspot/src/os/solaris/vm/globals_solaris.hpp | 2 +- hotspot/src/os/windows/vm/decoder_windows.hpp | 2 +- hotspot/src/os_cpu/bsd_x86/vm/bsd_x86_32.s | 2 +- hotspot/src/os_cpu/bsd_x86/vm/bsd_x86_64.s | 2 +- hotspot/src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp | 2 +- hotspot/src/os_cpu/bsd_x86/vm/vmStructs_bsd_x86.hpp | 2 +- hotspot/src/os_cpu/bsd_zero/vm/globals_bsd_zero.hpp | 2 +- hotspot/src/os_cpu/bsd_zero/vm/os_bsd_zero.cpp | 2 +- hotspot/src/os_cpu/bsd_zero/vm/thread_bsd_zero.hpp | 2 +- hotspot/src/os_cpu/bsd_zero/vm/vmStructs_bsd_zero.hpp | 2 +- hotspot/src/os_cpu/linux_sparc/vm/globals_linux_sparc.hpp | 2 +- hotspot/src/os_cpu/linux_sparc/vm/linux_sparc.s | 2 +- hotspot/src/os_cpu/linux_sparc/vm/os_linux_sparc.cpp | 2 +- hotspot/src/os_cpu/linux_sparc/vm/vmStructs_linux_sparc.hpp | 2 +- hotspot/src/os_cpu/linux_x86/vm/globals_linux_x86.hpp | 2 +- hotspot/src/os_cpu/linux_x86/vm/linux_x86_32.s | 2 +- hotspot/src/os_cpu/linux_x86/vm/linux_x86_64.s | 2 +- hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp | 2 +- hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.hpp | 2 +- hotspot/src/os_cpu/linux_x86/vm/vmStructs_linux_x86.hpp | 2 +- hotspot/src/os_cpu/linux_zero/vm/globals_linux_zero.hpp | 2 +- hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.cpp | 2 +- hotspot/src/os_cpu/linux_zero/vm/vmStructs_linux_zero.hpp | 2 +- hotspot/src/os_cpu/solaris_sparc/vm/globals_solaris_sparc.hpp | 2 +- hotspot/src/os_cpu/solaris_sparc/vm/solaris_sparc.il | 2 +- hotspot/src/os_cpu/solaris_sparc/vm/solaris_sparc.s | 2 +- hotspot/src/os_cpu/solaris_sparc/vm/vmStructs_solaris_sparc.hpp | 2 +- hotspot/src/os_cpu/solaris_x86/vm/globals_solaris_x86.hpp | 2 +- hotspot/src/os_cpu/solaris_x86/vm/solaris_x86_32.s | 2 +- hotspot/src/os_cpu/solaris_x86/vm/solaris_x86_64.s | 2 +- hotspot/src/os_cpu/solaris_x86/vm/vmStructs_solaris_x86.hpp | 2 +- hotspot/src/os_cpu/windows_x86/vm/globals_windows_x86.hpp | 2 +- hotspot/src/os_cpu/windows_x86/vm/os_windows_x86.cpp | 2 +- hotspot/src/os_cpu/windows_x86/vm/os_windows_x86.hpp | 2 +- hotspot/src/os_cpu/windows_x86/vm/vmStructs_windows_x86.hpp | 2 +- .../src/com/sun/hotspot/tools/compiler/CallSite.java | 2 +- .../src/com/sun/hotspot/tools/compiler/LogParser.java | 2 +- hotspot/src/share/tools/ProjectCreator/WinGammaPlatformVC7.java | 2 +- hotspot/src/share/tools/hsdis/hsdis.c | 2 +- hotspot/src/share/vm/adlc/adlparse.cpp | 2 +- hotspot/src/share/vm/adlc/archDesc.cpp | 2 +- hotspot/src/share/vm/adlc/dfa.cpp | 2 +- hotspot/src/share/vm/adlc/dict2.cpp | 2 +- hotspot/src/share/vm/adlc/formssel.cpp | 2 +- hotspot/src/share/vm/adlc/formssel.hpp | 2 +- hotspot/src/share/vm/adlc/output_c.cpp | 2 +- hotspot/src/share/vm/adlc/output_h.cpp | 2 +- hotspot/src/share/vm/asm/assembler.cpp | 2 +- hotspot/src/share/vm/asm/assembler.hpp | 2 +- hotspot/src/share/vm/asm/codeBuffer.cpp | 2 +- hotspot/src/share/vm/asm/macroAssembler.hpp | 2 +- hotspot/src/share/vm/asm/macroAssembler.inline.hpp | 2 +- hotspot/src/share/vm/c1/c1_Canonicalizer.cpp | 2 +- hotspot/src/share/vm/c1/c1_Canonicalizer.hpp | 2 +- hotspot/src/share/vm/c1/c1_CodeStubs.hpp | 2 +- hotspot/src/share/vm/c1/c1_Compilation.cpp | 2 +- hotspot/src/share/vm/c1/c1_Compiler.cpp | 2 +- hotspot/src/share/vm/c1/c1_Compiler.hpp | 2 +- hotspot/src/share/vm/c1/c1_FrameMap.cpp | 2 +- hotspot/src/share/vm/c1/c1_FrameMap.hpp | 2 +- hotspot/src/share/vm/c1/c1_GraphBuilder.hpp | 2 +- hotspot/src/share/vm/c1/c1_IR.cpp | 2 +- hotspot/src/share/vm/c1/c1_IR.hpp | 2 +- hotspot/src/share/vm/c1/c1_Instruction.cpp | 2 +- hotspot/src/share/vm/c1/c1_InstructionPrinter.hpp | 2 +- hotspot/src/share/vm/c1/c1_LIRAssembler.cpp | 2 +- hotspot/src/share/vm/c1/c1_LinearScan.cpp | 2 +- hotspot/src/share/vm/c1/c1_Optimizer.cpp | 2 +- hotspot/src/share/vm/c1/c1_RangeCheckElimination.cpp | 2 +- hotspot/src/share/vm/c1/c1_RangeCheckElimination.hpp | 2 +- hotspot/src/share/vm/c1/c1_Runtime1.hpp | 2 +- hotspot/src/share/vm/c1/c1_ValueMap.cpp | 2 +- hotspot/src/share/vm/c1/c1_ValueMap.hpp | 2 +- hotspot/src/share/vm/c1/c1_globals.cpp | 2 +- hotspot/src/share/vm/c1/c1_globals.hpp | 2 +- hotspot/src/share/vm/ci/bcEscapeAnalyzer.cpp | 2 +- hotspot/src/share/vm/ci/bcEscapeAnalyzer.hpp | 2 +- hotspot/src/share/vm/ci/ciArray.cpp | 2 +- hotspot/src/share/vm/ci/ciArray.hpp | 2 +- hotspot/src/share/vm/ci/ciClassList.hpp | 2 +- hotspot/src/share/vm/ci/ciConstant.hpp | 2 +- hotspot/src/share/vm/ci/ciEnv.hpp | 2 +- hotspot/src/share/vm/ci/ciFlags.hpp | 2 +- hotspot/src/share/vm/ci/ciInstance.cpp | 2 +- hotspot/src/share/vm/ci/ciInstanceKlass.hpp | 2 +- hotspot/src/share/vm/ci/ciKlass.cpp | 2 +- hotspot/src/share/vm/ci/ciKlass.hpp | 2 +- hotspot/src/share/vm/ci/ciMethodData.cpp | 2 +- hotspot/src/share/vm/ci/ciMethodData.hpp | 2 +- hotspot/src/share/vm/ci/ciObjArrayKlass.cpp | 2 +- hotspot/src/share/vm/ci/ciObjArrayKlass.hpp | 2 +- hotspot/src/share/vm/ci/ciObjectFactory.cpp | 2 +- hotspot/src/share/vm/ci/ciObjectFactory.hpp | 2 +- hotspot/src/share/vm/ci/ciStreams.hpp | 2 +- hotspot/src/share/vm/ci/ciType.cpp | 2 +- hotspot/src/share/vm/ci/ciType.hpp | 2 +- hotspot/src/share/vm/ci/ciTypeArray.cpp | 2 +- hotspot/src/share/vm/ci/ciTypeArrayKlass.hpp | 2 +- hotspot/src/share/vm/ci/ciTypeFlow.cpp | 2 +- hotspot/src/share/vm/ci/ciUtilities.hpp | 2 +- hotspot/src/share/vm/classfile/bytecodeAssembler.cpp | 2 +- hotspot/src/share/vm/classfile/classFileStream.cpp | 2 +- hotspot/src/share/vm/classfile/classFileStream.hpp | 2 +- hotspot/src/share/vm/classfile/classLoaderData.inline.hpp | 2 +- hotspot/src/share/vm/classfile/vmSymbols.cpp | 2 +- hotspot/src/share/vm/code/compiledIC.hpp | 2 +- hotspot/src/share/vm/code/compressedStream.cpp | 2 +- hotspot/src/share/vm/code/debugInfo.hpp | 2 +- hotspot/src/share/vm/code/icBuffer.hpp | 2 +- hotspot/src/share/vm/code/relocInfo.cpp | 2 +- hotspot/src/share/vm/code/stubs.cpp | 2 +- hotspot/src/share/vm/code/stubs.hpp | 2 +- hotspot/src/share/vm/compiler/abstractCompiler.cpp | 2 +- hotspot/src/share/vm/compiler/abstractCompiler.hpp | 2 +- hotspot/src/share/vm/compiler/compileLog.cpp | 2 +- hotspot/src/share/vm/compiler/compileLog.hpp | 2 +- hotspot/src/share/vm/compiler/compilerOracle.cpp | 2 +- hotspot/src/share/vm/compiler/disassembler.cpp | 2 +- hotspot/src/share/vm/compiler/disassembler.hpp | 2 +- .../gc_implementation/concurrentMarkSweep/adaptiveFreeList.cpp | 2 +- .../gc_implementation/concurrentMarkSweep/adaptiveFreeList.hpp | 2 +- .../concurrentMarkSweep/cmsCollectorPolicy.hpp | 2 +- .../vm/gc_implementation/concurrentMarkSweep/cmsOopClosures.hpp | 2 +- .../concurrentMarkSweep/compactibleFreeListSpace.hpp | 2 +- .../concurrentMarkSweep/concurrentMarkSweepThread.cpp | 2 +- .../concurrentMarkSweep/concurrentMarkSweepThread.hpp | 2 +- .../src/share/vm/gc_implementation/g1/collectionSetChooser.cpp | 2 +- .../src/share/vm/gc_implementation/g1/collectionSetChooser.hpp | 2 +- hotspot/src/share/vm/gc_implementation/g1/g1AllocRegion.hpp | 2 +- .../src/share/vm/gc_implementation/g1/g1BlockOffsetTable.cpp | 2 +- .../share/vm/gc_implementation/g1/g1CollectedHeap.inline.hpp | 2 +- hotspot/src/share/vm/gc_implementation/g1/g1EvacFailure.hpp | 2 +- .../src/share/vm/gc_implementation/g1/g1MonitoringSupport.cpp | 2 +- .../share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.hpp | 2 +- hotspot/src/share/vm/gc_implementation/g1/heapRegionRemSet.hpp | 2 +- hotspot/src/share/vm/gc_implementation/g1/heapRegionSeq.cpp | 2 +- hotspot/src/share/vm/gc_implementation/g1/heapRegionSeq.hpp | 2 +- .../src/share/vm/gc_implementation/g1/heapRegionSeq.inline.hpp | 2 +- hotspot/src/share/vm/gc_implementation/g1/ptrQueue.cpp | 2 +- hotspot/src/share/vm/gc_implementation/g1/ptrQueue.hpp | 2 +- hotspot/src/share/vm/gc_implementation/g1/sparsePRT.cpp | 2 +- hotspot/src/share/vm/gc_implementation/g1/sparsePRT.hpp | 2 +- hotspot/src/share/vm/gc_implementation/g1/vmStructs_g1.hpp | 2 +- .../share/vm/gc_implementation/parNew/parCardTableModRefBS.cpp | 2 +- .../gc_implementation/parallelScavenge/adjoiningGenerations.cpp | 2 +- .../gc_implementation/parallelScavenge/adjoiningGenerations.hpp | 2 +- .../share/vm/gc_implementation/parallelScavenge/asPSOldGen.cpp | 2 +- .../share/vm/gc_implementation/parallelScavenge/asPSOldGen.hpp | 2 +- .../vm/gc_implementation/parallelScavenge/asPSYoungGen.cpp | 2 +- .../vm/gc_implementation/parallelScavenge/gcTaskThread.cpp | 2 +- .../vm/gc_implementation/parallelScavenge/objectStartArray.cpp | 2 +- .../src/share/vm/gc_implementation/parallelScavenge/pcTasks.hpp | 2 +- .../share/vm/gc_implementation/parallelScavenge/psMarkSweep.hpp | 2 +- .../gc_implementation/parallelScavenge/psMarkSweepDecorator.cpp | 2 +- .../share/vm/gc_implementation/parallelScavenge/psOldGen.cpp | 2 +- .../share/vm/gc_implementation/parallelScavenge/psOldGen.hpp | 2 +- .../src/share/vm/gc_implementation/parallelScavenge/psTasks.cpp | 2 +- .../src/share/vm/gc_implementation/parallelScavenge/psTasks.hpp | 2 +- .../share/vm/gc_implementation/parallelScavenge/psYoungGen.cpp | 2 +- .../src/share/vm/gc_implementation/shared/allocationStats.cpp | 2 +- .../share/vm/gc_implementation/shared/concurrentGCThread.hpp | 2 +- .../src/share/vm/gc_implementation/shared/gSpaceCounters.cpp | 2 +- .../src/share/vm/gc_implementation/shared/gSpaceCounters.hpp | 2 +- .../vm/gc_implementation/shared/gcAdaptivePolicyCounters.hpp | 2 +- .../src/share/vm/gc_implementation/shared/immutableSpace.cpp | 2 +- .../src/share/vm/gc_implementation/shared/isGCActiveMark.hpp | 2 +- .../src/share/vm/gc_implementation/shared/markSweep.inline.hpp | 2 +- .../src/share/vm/gc_implementation/shared/mutableNUMASpace.cpp | 2 +- .../src/share/vm/gc_implementation/shared/mutableNUMASpace.hpp | 2 +- hotspot/src/share/vm/gc_implementation/shared/mutableSpace.cpp | 2 +- .../src/share/vm/gc_implementation/shared/parGCAllocBuffer.hpp | 2 +- hotspot/src/share/vm/gc_implementation/shared/spaceCounters.cpp | 2 +- hotspot/src/share/vm/gc_implementation/shared/spaceCounters.hpp | 2 +- hotspot/src/share/vm/gc_interface/collectedHeap.inline.hpp | 2 +- hotspot/src/share/vm/gc_interface/gcCause.cpp | 2 +- hotspot/src/share/vm/gc_interface/gcCause.hpp | 2 +- hotspot/src/share/vm/interpreter/bytecodeInterpreter.cpp | 2 +- hotspot/src/share/vm/interpreter/cppInterpreter.hpp | 2 +- hotspot/src/share/vm/interpreter/interpreter.hpp | 2 +- hotspot/src/share/vm/interpreter/templateInterpreter.hpp | 2 +- .../src/share/vm/interpreter/templateInterpreterGenerator.hpp | 2 +- hotspot/src/share/vm/interpreter/templateTable.hpp | 2 +- hotspot/src/share/vm/memory/binaryTreeDictionary.hpp | 2 +- hotspot/src/share/vm/memory/blockOffsetTable.cpp | 2 +- hotspot/src/share/vm/memory/freeBlockDictionary.cpp | 2 +- hotspot/src/share/vm/memory/freeList.cpp | 2 +- hotspot/src/share/vm/memory/freeList.hpp | 2 +- hotspot/src/share/vm/memory/gcLocker.cpp | 2 +- hotspot/src/share/vm/memory/gcLocker.hpp | 2 +- hotspot/src/share/vm/memory/genRemSet.cpp | 2 +- hotspot/src/share/vm/memory/genRemSet.hpp | 2 +- hotspot/src/share/vm/memory/generation.hpp | 2 +- hotspot/src/share/vm/memory/generationSpec.cpp | 2 +- hotspot/src/share/vm/memory/heap.hpp | 2 +- hotspot/src/share/vm/memory/iterator.cpp | 2 +- hotspot/src/share/vm/memory/iterator.hpp | 2 +- hotspot/src/share/vm/memory/metaspaceCounters.cpp | 2 +- hotspot/src/share/vm/memory/metaspaceCounters.hpp | 2 +- hotspot/src/share/vm/memory/sharedHeap.hpp | 2 +- hotspot/src/share/vm/memory/space.cpp | 2 +- hotspot/src/share/vm/memory/space.hpp | 2 +- hotspot/src/share/vm/memory/specialized_oop_closures.hpp | 2 +- hotspot/src/share/vm/memory/tenuredGeneration.cpp | 2 +- hotspot/src/share/vm/memory/tenuredGeneration.hpp | 2 +- hotspot/src/share/vm/oops/arrayKlass.cpp | 2 +- hotspot/src/share/vm/oops/arrayOop.hpp | 2 +- hotspot/src/share/vm/oops/compiledICHolder.cpp | 2 +- hotspot/src/share/vm/oops/fieldInfo.hpp | 2 +- hotspot/src/share/vm/oops/instanceClassLoaderKlass.cpp | 2 +- hotspot/src/share/vm/oops/instanceClassLoaderKlass.hpp | 2 +- hotspot/src/share/vm/oops/instanceMirrorKlass.cpp | 2 +- hotspot/src/share/vm/oops/instanceOop.hpp | 2 +- hotspot/src/share/vm/oops/instanceRefKlass.hpp | 2 +- hotspot/src/share/vm/oops/klassPS.hpp | 2 +- hotspot/src/share/vm/oops/objArrayKlass.cpp | 2 +- hotspot/src/share/vm/oops/objArrayKlass.hpp | 2 +- hotspot/src/share/vm/oops/objArrayKlass.inline.hpp | 2 +- hotspot/src/share/vm/oops/oop.pcgc.inline.hpp | 2 +- hotspot/src/share/vm/oops/oop.psgc.inline.hpp | 2 +- hotspot/src/share/vm/oops/typeArrayKlass.cpp | 2 +- hotspot/src/share/vm/oops/typeArrayKlass.hpp | 2 +- hotspot/src/share/vm/opto/block.cpp | 2 +- hotspot/src/share/vm/opto/block.hpp | 2 +- hotspot/src/share/vm/opto/buildOopMap.cpp | 2 +- hotspot/src/share/vm/opto/bytecodeInfo.cpp | 2 +- hotspot/src/share/vm/opto/c2compiler.cpp | 2 +- hotspot/src/share/vm/opto/c2compiler.hpp | 2 +- hotspot/src/share/vm/opto/callGenerator.cpp | 2 +- hotspot/src/share/vm/opto/callnode.cpp | 2 +- hotspot/src/share/vm/opto/chaitin.hpp | 2 +- hotspot/src/share/vm/opto/classes.cpp | 2 +- hotspot/src/share/vm/opto/classes.hpp | 2 +- hotspot/src/share/vm/opto/coalesce.hpp | 2 +- hotspot/src/share/vm/opto/connode.cpp | 2 +- hotspot/src/share/vm/opto/doCall.cpp | 2 +- hotspot/src/share/vm/opto/domgraph.cpp | 2 +- hotspot/src/share/vm/opto/gcm.cpp | 2 +- hotspot/src/share/vm/opto/generateOptoStub.cpp | 2 +- hotspot/src/share/vm/opto/graphKit.cpp | 2 +- hotspot/src/share/vm/opto/graphKit.hpp | 2 +- hotspot/src/share/vm/opto/idealKit.cpp | 2 +- hotspot/src/share/vm/opto/idealKit.hpp | 2 +- hotspot/src/share/vm/opto/ifg.cpp | 2 +- hotspot/src/share/vm/opto/ifnode.cpp | 2 +- hotspot/src/share/vm/opto/lcm.cpp | 2 +- hotspot/src/share/vm/opto/live.cpp | 2 +- hotspot/src/share/vm/opto/live.hpp | 2 +- hotspot/src/share/vm/opto/loopPredicate.cpp | 2 +- hotspot/src/share/vm/opto/loopTransform.cpp | 2 +- hotspot/src/share/vm/opto/loopnode.hpp | 2 +- hotspot/src/share/vm/opto/loopopts.cpp | 2 +- hotspot/src/share/vm/opto/macro.cpp | 2 +- hotspot/src/share/vm/opto/macro.hpp | 2 +- hotspot/src/share/vm/opto/matcher.hpp | 2 +- hotspot/src/share/vm/opto/memnode.cpp | 2 +- hotspot/src/share/vm/opto/memnode.hpp | 2 +- hotspot/src/share/vm/opto/multnode.cpp | 2 +- hotspot/src/share/vm/opto/multnode.hpp | 2 +- hotspot/src/share/vm/opto/node.cpp | 2 +- hotspot/src/share/vm/opto/optoreg.hpp | 2 +- hotspot/src/share/vm/opto/output.cpp | 2 +- hotspot/src/share/vm/opto/output.hpp | 2 +- hotspot/src/share/vm/opto/parse.hpp | 2 +- hotspot/src/share/vm/opto/parse1.cpp | 2 +- hotspot/src/share/vm/opto/parse2.cpp | 2 +- hotspot/src/share/vm/opto/phase.cpp | 2 +- hotspot/src/share/vm/opto/phase.hpp | 2 +- hotspot/src/share/vm/opto/phaseX.cpp | 2 +- hotspot/src/share/vm/opto/phaseX.hpp | 2 +- hotspot/src/share/vm/opto/postaloc.cpp | 2 +- hotspot/src/share/vm/opto/reg_split.cpp | 2 +- hotspot/src/share/vm/opto/regalloc.cpp | 2 +- hotspot/src/share/vm/opto/regalloc.hpp | 2 +- hotspot/src/share/vm/opto/subnode.cpp | 2 +- hotspot/src/share/vm/opto/subnode.hpp | 2 +- hotspot/src/share/vm/opto/superword.cpp | 2 +- hotspot/src/share/vm/opto/superword.hpp | 2 +- hotspot/src/share/vm/precompiled/precompiled.hpp | 2 +- hotspot/src/share/vm/prims/forte.cpp | 2 +- hotspot/src/share/vm/prims/jniCheck.cpp | 2 +- hotspot/src/share/vm/prims/jvm_misc.hpp | 2 +- hotspot/src/share/vm/prims/jvmtiClassFileReconstituter.cpp | 2 +- hotspot/src/share/vm/prims/jvmtiClassFileReconstituter.hpp | 2 +- hotspot/src/share/vm/prims/jvmtiEnter.xsl | 2 +- hotspot/src/share/vm/prims/jvmtiEnvBase.hpp | 2 +- hotspot/src/share/vm/prims/jvmtiEnvThreadState.cpp | 2 +- hotspot/src/share/vm/prims/jvmtiEventController.cpp | 2 +- hotspot/src/share/vm/prims/jvmtiExport.hpp | 2 +- hotspot/src/share/vm/prims/jvmtiGetLoadedClasses.cpp | 2 +- hotspot/src/share/vm/prims/jvmtiTrace.hpp | 2 +- hotspot/src/share/vm/prims/nativeLookup.cpp | 2 +- hotspot/src/share/vm/prims/perf.cpp | 2 +- hotspot/src/share/vm/prims/wbtestmethods/parserTests.hpp | 2 +- hotspot/src/share/vm/prims/whitebox.hpp | 2 +- hotspot/src/share/vm/runtime/advancedThresholdPolicy.hpp | 2 +- hotspot/src/share/vm/runtime/atomic.cpp | 2 +- hotspot/src/share/vm/runtime/atomic.hpp | 2 +- hotspot/src/share/vm/runtime/compilationPolicy.hpp | 2 +- hotspot/src/share/vm/runtime/fprofiler.hpp | 2 +- hotspot/src/share/vm/runtime/globals_extension.hpp | 2 +- hotspot/src/share/vm/runtime/handles.inline.hpp | 2 +- hotspot/src/share/vm/runtime/javaCalls.hpp | 2 +- hotspot/src/share/vm/runtime/jniHandles.cpp | 2 +- hotspot/src/share/vm/runtime/mutex.cpp | 2 +- hotspot/src/share/vm/runtime/perfData.hpp | 2 +- hotspot/src/share/vm/runtime/reflection.hpp | 2 +- hotspot/src/share/vm/runtime/sharedRuntime.hpp | 2 +- hotspot/src/share/vm/runtime/signature.cpp | 2 +- hotspot/src/share/vm/runtime/signature.hpp | 2 +- hotspot/src/share/vm/runtime/stubCodeGenerator.cpp | 2 +- hotspot/src/share/vm/runtime/synchronizer.hpp | 2 +- hotspot/src/share/vm/runtime/unhandledOops.hpp | 2 +- hotspot/src/share/vm/runtime/vframe.cpp | 2 +- hotspot/src/share/vm/runtime/vframe.hpp | 2 +- hotspot/src/share/vm/runtime/vframeArray.hpp | 2 +- hotspot/src/share/vm/runtime/virtualspace.hpp | 2 +- hotspot/src/share/vm/runtime/vm_version.hpp | 2 +- hotspot/src/share/vm/services/classLoadingService.hpp | 2 +- hotspot/src/share/vm/services/dtraceAttacher.cpp | 2 +- hotspot/src/share/vm/services/g1MemoryPool.hpp | 2 +- hotspot/src/share/vm/services/memReporter.cpp | 2 +- hotspot/src/share/vm/services/memReporter.hpp | 2 +- hotspot/src/share/vm/services/memSnapshot.hpp | 2 +- hotspot/src/share/vm/services/memoryManager.hpp | 2 +- hotspot/src/share/vm/services/memoryPool.hpp | 2 +- hotspot/src/share/vm/services/memoryService.cpp | 2 +- hotspot/src/share/vm/services/memoryService.hpp | 2 +- hotspot/src/share/vm/services/memoryUsage.hpp | 2 +- hotspot/src/share/vm/services/psMemoryPool.hpp | 2 +- hotspot/src/share/vm/services/threadService.hpp | 2 +- hotspot/src/share/vm/shark/sharkBlock.cpp | 2 +- hotspot/src/share/vm/shark/sharkBuilder.cpp | 2 +- hotspot/src/share/vm/shark/sharkCompiler.cpp | 2 +- hotspot/src/share/vm/shark/sharkCompiler.hpp | 2 +- hotspot/src/share/vm/shark/sharkConstant.cpp | 2 +- hotspot/src/share/vm/shark/sharkFunction.cpp | 2 +- hotspot/src/share/vm/shark/sharkInliner.cpp | 2 +- hotspot/src/share/vm/shark/sharkInvariants.hpp | 2 +- hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp | 2 +- hotspot/src/share/vm/utilities/bitMap.cpp | 2 +- hotspot/src/share/vm/utilities/bitMap.hpp | 2 +- hotspot/src/share/vm/utilities/bitMap.inline.hpp | 2 +- hotspot/src/share/vm/utilities/decoder.cpp | 2 +- hotspot/src/share/vm/utilities/decoder.hpp | 2 +- hotspot/src/share/vm/utilities/elfFile.cpp | 2 +- hotspot/src/share/vm/utilities/elfFile.hpp | 2 +- hotspot/src/share/vm/utilities/exceptions.cpp | 2 +- hotspot/src/share/vm/utilities/globalDefinitions.cpp | 2 +- hotspot/src/share/vm/utilities/globalDefinitions_visCPP.hpp | 2 +- hotspot/src/share/vm/utilities/growableArray.hpp | 2 +- hotspot/src/share/vm/utilities/hashtable.hpp | 2 +- hotspot/src/share/vm/utilities/macros.hpp | 2 +- hotspot/src/share/vm/utilities/numberSeq.cpp | 2 +- hotspot/src/share/vm/utilities/ostream.hpp | 2 +- hotspot/src/share/vm/utilities/top.hpp | 2 +- hotspot/src/share/vm/utilities/yieldingWorkgroup.cpp | 2 +- hotspot/test/Makefile | 2 +- hotspot/test/TEST.ROOT | 2 +- hotspot/test/compiler/5091921/Test7005594.sh | 2 +- hotspot/test/compiler/6431242/Test.java | 2 +- hotspot/test/compiler/6589834/Test_ia32.java | 2 +- hotspot/test/compiler/6636138/Test1.java | 2 +- hotspot/test/compiler/6636138/Test2.java | 2 +- hotspot/test/compiler/6795161/Test.java | 2 +- hotspot/test/compiler/6857159/Test6857159.sh | 2 +- hotspot/test/compiler/7068051/Test7068051.sh | 2 +- hotspot/test/compiler/7070134/Test7070134.sh | 2 +- hotspot/test/compiler/7200264/Test7200264.sh | 2 +- hotspot/test/compiler/8000805/Test8000805.java | 2 +- hotspot/test/compiler/8005419/Test8005419.java | 2 +- hotspot/test/gc/6941923/Test6941923.java | 2 +- hotspot/test/gc/g1/TestHumongousAllocInitialMark.java | 2 +- hotspot/test/runtime/6626217/Test6626217.sh | 2 +- hotspot/test/runtime/7110720/Test7110720.sh | 2 +- hotspot/test/runtime/7162488/Test7162488.sh | 2 +- hotspot/test/runtime/RedefineObject/Agent.java | 2 +- hotspot/test/runtime/RedefineObject/TestRedefineObject.java | 2 +- 517 files changed, 517 insertions(+), 517 deletions(-) diff --git a/hotspot/agent/make/Makefile b/hotspot/agent/make/Makefile index e00bbf2b36f..5efd67e649c 100644 --- a/hotspot/agent/make/Makefile +++ b/hotspot/agent/make/Makefile @@ -1,5 +1,5 @@ # -# Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/agent/src/os/linux/libproc.h b/hotspot/agent/src/os/linux/libproc.h index 4cde0c19d76..30bacaf07b9 100644 --- a/hotspot/agent/src/os/linux/libproc.h +++ b/hotspot/agent/src/os/linux/libproc.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/agent/src/os/linux/salibelf.c b/hotspot/agent/src/os/linux/salibelf.c index 4c860a0fe08..1466119c0f9 100644 --- a/hotspot/agent/src/os/linux/salibelf.c +++ b/hotspot/agent/src/os/linux/salibelf.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/agent/src/os/linux/symtab.c b/hotspot/agent/src/os/linux/symtab.c index f9fc33f14ec..4403227427a 100644 --- a/hotspot/agent/src/os/linux/symtab.c +++ b/hotspot/agent/src/os/linux/symtab.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/agent/src/os/solaris/proc/saproc.cpp b/hotspot/agent/src/os/solaris/proc/saproc.cpp index f2d148e7ec4..5a910d3a357 100644 --- a/hotspot/agent/src/os/solaris/proc/saproc.cpp +++ b/hotspot/agent/src/os/solaris/proc/saproc.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/agent/src/os/win32/windbg/sawindbg.cpp b/hotspot/agent/src/os/win32/windbg/sawindbg.cpp index 5dd64f9e5ae..a6a8b7af2e7 100644 --- a/hotspot/agent/src/os/win32/windbg/sawindbg.cpp +++ b/hotspot/agent/src/os/win32/windbg/sawindbg.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/CLHSDB.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/CLHSDB.java index 9e8d016dcc2..a5393107aa5 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/CLHSDB.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/CLHSDB.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/CommandProcessor.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/CommandProcessor.java index 354f0b906b3..e200826e467 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/CommandProcessor.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/CommandProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/HSDB.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/HSDB.java index d50cbaa5140..9ae362baa48 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/HSDB.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/HSDB.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/LinuxVtblAccess.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/LinuxVtblAccess.java index ae28eb3b283..d1badc37096 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/LinuxVtblAccess.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/LinuxVtblAccess.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/Disassembler.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/Disassembler.java index 9d351cb0917..993bf7bb477 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/Disassembler.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/Disassembler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciEnv.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciEnv.java index c1e6d503196..8a9df1b497d 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciEnv.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciEnv.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciMethod.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciMethod.java index d50e36c2a74..cdf21c946ac 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciMethod.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciMethod.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/NMethod.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/NMethod.java index 243a5397a0d..7c8d43a287a 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/NMethod.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/NMethod.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/compiler/CompileTask.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/compiler/CompileTask.java index 0a4273f3ef8..8a01fbbc35f 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/compiler/CompileTask.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/compiler/CompileTask.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/BsdAddress.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/BsdAddress.java index f25d50ff23c..bab70f28026 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/BsdAddress.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/BsdAddress.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/BsdDebugger.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/BsdDebugger.java index 34e848b4295..d7576d8ba07 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/BsdDebugger.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/BsdDebugger.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxAddress.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxAddress.java index cff29ce8edc..d350f09b4db 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxAddress.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxAddress.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxDebuggerLocal.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxDebuggerLocal.java index 5fffbd32377..f282a228df6 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxDebuggerLocal.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxDebuggerLocal.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxOopHandle.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxOopHandle.java index 99291aada29..4fd5bc1c7f2 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxOopHandle.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxOopHandle.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/amd64/LinuxAMD64CFrame.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/amd64/LinuxAMD64CFrame.java index cf8e073208b..dea4e09e56d 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/amd64/LinuxAMD64CFrame.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/amd64/LinuxAMD64CFrame.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/x86/LinuxX86CFrame.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/x86/LinuxX86CFrame.java index d2370c96319..53a2e26a84b 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/x86/LinuxX86CFrame.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/x86/LinuxX86CFrame.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgCDebugger.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgCDebugger.java index 04c4abbe0a9..ce219b986af 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgCDebugger.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgCDebugger.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgDebuggerLocal.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgDebuggerLocal.java index 22957a27deb..afe11938c42 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgDebuggerLocal.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgDebuggerLocal.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windows/amd64/WindowsAMD64CFrame.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windows/amd64/WindowsAMD64CFrame.java index fe4052f3512..69ad04da51b 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windows/amd64/WindowsAMD64CFrame.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windows/amd64/WindowsAMD64CFrame.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windows/x86/WindowsX86CFrame.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windows/x86/WindowsX86CFrame.java index 5c5f1f161e7..dbc8b71f35c 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windows/x86/WindowsX86CFrame.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windows/x86/WindowsX86CFrame.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/JVMTIThreadState.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/JVMTIThreadState.java index dbf09b29119..0dcb772f913 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/JVMTIThreadState.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/JVMTIThreadState.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/CMSCollector.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/CMSCollector.java index f28caad66e7..28205ae0b03 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/CMSCollector.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/CMSCollector.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/DictionaryEntry.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/DictionaryEntry.java index 301410408d2..3d4a9f6392e 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/DictionaryEntry.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/DictionaryEntry.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/SymbolTable.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/SymbolTable.java index 3069cf6b377..7510d08bfd0 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/SymbolTable.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/SymbolTable.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ArrayKlass.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ArrayKlass.java index 9530cdd977a..ba9422ca8ee 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ArrayKlass.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ArrayKlass.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/InstanceKlass.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/InstanceKlass.java index 01104f59515..75aa05c3954 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/InstanceKlass.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/InstanceKlass.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Klass.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Klass.java index 19a3668c7f3..9e1561bd390 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Klass.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Klass.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/MethodCounters.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/MethodCounters.java index 854aa818c89..ec2cbbe9f4b 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/MethodCounters.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/MethodCounters.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/MethodData.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/MethodData.java index eb643483fe5..41c121468ea 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/MethodData.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/MethodData.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ObjectHeap.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ObjectHeap.java index 7c255a2e295..d550a935fa3 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ObjectHeap.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ObjectHeap.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/PhaseCFG.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/PhaseCFG.java index 66344b553f6..4429754a5fe 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/PhaseCFG.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/PhaseCFG.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/ThreadLocalAllocBuffer.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/ThreadLocalAllocBuffer.java index c07a0dae4bf..74530b8f101 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/ThreadLocalAllocBuffer.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/ThreadLocalAllocBuffer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java index 8088a49993c..29bf9efea7d 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/bsd_amd64/BsdAMD64JavaThreadPDAccess.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/bsd_amd64/BsdAMD64JavaThreadPDAccess.java index 03e35de5695..47571dfdf7d 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/bsd_amd64/BsdAMD64JavaThreadPDAccess.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/bsd_amd64/BsdAMD64JavaThreadPDAccess.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/FinalizerInfo.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/FinalizerInfo.java index 2a8ca2cfb7a..58819a0a7dd 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/FinalizerInfo.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/FinalizerInfo.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/FlagDumper.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/FlagDumper.java index 37fa4c83c26..38244c3b84f 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/FlagDumper.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/FlagDumper.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/HeapDumper.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/HeapDumper.java index e2da202acb9..1b93504313a 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/HeapDumper.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/HeapDumper.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/HeapSummary.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/HeapSummary.java index f87457c3c3e..32c1358cbe2 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/HeapSummary.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/HeapSummary.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/JInfo.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/JInfo.java index bec93e65d9d..7469de28f40 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/JInfo.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/JInfo.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/JSnap.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/JSnap.java index c2e5ed52f84..fc281406d86 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/JSnap.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/JSnap.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/JStack.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/JStack.java index 52fb6654e70..b8609bcdbeb 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/JStack.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/JStack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/ObjectHistogram.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/ObjectHistogram.java index 6c6c555badf..ddedcae5394 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/ObjectHistogram.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/ObjectHistogram.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/PMap.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/PMap.java index e18aa76cfa6..43bcd593f30 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/PMap.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/PMap.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/StackTrace.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/StackTrace.java index bbb0b081b2d..6f519a74b14 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/StackTrace.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/StackTrace.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/SysPropsDumper.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/SysPropsDumper.java index 01465574006..ada81adf58e 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/SysPropsDumper.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/SysPropsDumper.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/Tool.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/Tool.java index 9fd86ccb347..d1da9cfbaaf 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/Tool.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/Tool.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/soql/JSDB.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/soql/JSDB.java index db6dc339394..bd7e4c4ce45 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/soql/JSDB.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/soql/JSDB.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/soql/SOQL.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/soql/SOQL.java index 67f5ed1e920..eceabd39a98 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/soql/SOQL.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/soql/SOQL.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/types/basic/BasicTypeDataBase.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/types/basic/BasicTypeDataBase.java index 12325863163..910e15e0f37 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/types/basic/BasicTypeDataBase.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/types/basic/BasicTypeDataBase.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/SAPanel.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/SAPanel.java index e1829a332da..9bc7e4b4e48 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/SAPanel.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/SAPanel.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/AbstractHeapGraphWriter.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/AbstractHeapGraphWriter.java index 382d2477b52..5dbf8984158 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/AbstractHeapGraphWriter.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/AbstractHeapGraphWriter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/HeapGXLWriter.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/HeapGXLWriter.java index 47494e826b3..dbb95d392b4 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/HeapGXLWriter.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/HeapGXLWriter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/HeapHprofBinWriter.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/HeapHprofBinWriter.java index 6f66723db99..60df0ffe92b 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/HeapHprofBinWriter.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/HeapHprofBinWriter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaInstanceKlass.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaInstanceKlass.java index a76e5ddbf31..069a40326a2 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaInstanceKlass.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaInstanceKlass.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/sa.js b/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/sa.js index 4253740369b..a700f1bc6bd 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/sa.js +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/sa.js @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/make/bsd/makefiles/adlc.make b/hotspot/make/bsd/makefiles/adlc.make index cf5c05e2ac7..e37e60ca97b 100644 --- a/hotspot/make/bsd/makefiles/adlc.make +++ b/hotspot/make/bsd/makefiles/adlc.make @@ -1,5 +1,5 @@ # -# Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/make/bsd/makefiles/minimal1.make b/hotspot/make/bsd/makefiles/minimal1.make index d045db79099..03845fd12b7 100644 --- a/hotspot/make/bsd/makefiles/minimal1.make +++ b/hotspot/make/bsd/makefiles/minimal1.make @@ -1,5 +1,5 @@ # -# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/make/hotspot.script b/hotspot/make/hotspot.script index c6259ba2eee..9177f6efef8 100644 --- a/hotspot/make/hotspot.script +++ b/hotspot/make/hotspot.script @@ -1,6 +1,6 @@ #!/bin/sh -# Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/make/linux/makefiles/adlc.make b/hotspot/make/linux/makefiles/adlc.make index 7b808d9b2ae..8a866917b80 100644 --- a/hotspot/make/linux/makefiles/adlc.make +++ b/hotspot/make/linux/makefiles/adlc.make @@ -1,5 +1,5 @@ # -# Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/make/linux/makefiles/jsig.make b/hotspot/make/linux/makefiles/jsig.make index 1064a965249..6e13959482a 100644 --- a/hotspot/make/linux/makefiles/jsig.make +++ b/hotspot/make/linux/makefiles/jsig.make @@ -1,5 +1,5 @@ # -# Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/make/linux/makefiles/minimal1.make b/hotspot/make/linux/makefiles/minimal1.make index d045db79099..03845fd12b7 100644 --- a/hotspot/make/linux/makefiles/minimal1.make +++ b/hotspot/make/linux/makefiles/minimal1.make @@ -1,5 +1,5 @@ # -# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/make/linux/makefiles/saproc.make b/hotspot/make/linux/makefiles/saproc.make index 90c91136185..7e8f7c430f9 100644 --- a/hotspot/make/linux/makefiles/saproc.make +++ b/hotspot/make/linux/makefiles/saproc.make @@ -1,5 +1,5 @@ # -# Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/make/sa.files b/hotspot/make/sa.files index 44308c2a217..faad4dd109f 100644 --- a/hotspot/make/sa.files +++ b/hotspot/make/sa.files @@ -1,5 +1,5 @@ # -# Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/make/solaris/makefiles/adlc.make b/hotspot/make/solaris/makefiles/adlc.make index 642a7ca6136..88d9d2bc476 100644 --- a/hotspot/make/solaris/makefiles/adlc.make +++ b/hotspot/make/solaris/makefiles/adlc.make @@ -1,5 +1,5 @@ # -# Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/make/solaris/makefiles/gcc.make b/hotspot/make/solaris/makefiles/gcc.make index e946d65d256..fe65ad4f5bf 100644 --- a/hotspot/make/solaris/makefiles/gcc.make +++ b/hotspot/make/solaris/makefiles/gcc.make @@ -1,5 +1,5 @@ # -# Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/make/windows/build_vm_def.sh b/hotspot/make/windows/build_vm_def.sh index fa82d26a81a..3d905198cb6 100644 --- a/hotspot/make/windows/build_vm_def.sh +++ b/hotspot/make/windows/build_vm_def.sh @@ -1,5 +1,5 @@ # -# Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/make/windows/makefiles/adlc.make b/hotspot/make/windows/makefiles/adlc.make index 7bcaef718fd..781e3ac4048 100644 --- a/hotspot/make/windows/makefiles/adlc.make +++ b/hotspot/make/windows/makefiles/adlc.make @@ -1,5 +1,5 @@ # -# Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/make/windows/makefiles/debug.make b/hotspot/make/windows/makefiles/debug.make index 14a07083434..f4e54fc52fb 100644 --- a/hotspot/make/windows/makefiles/debug.make +++ b/hotspot/make/windows/makefiles/debug.make @@ -1,5 +1,5 @@ # -# Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/make/windows/makefiles/product.make b/hotspot/make/windows/makefiles/product.make index 713ec0e54ca..c1ce35a163c 100644 --- a/hotspot/make/windows/makefiles/product.make +++ b/hotspot/make/windows/makefiles/product.make @@ -1,5 +1,5 @@ # -# Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/make/windows/makefiles/rules.make b/hotspot/make/windows/makefiles/rules.make index d728263171b..c5d565a2880 100644 --- a/hotspot/make/windows/makefiles/rules.make +++ b/hotspot/make/windows/makefiles/rules.make @@ -1,5 +1,5 @@ # -# Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/make/windows/makefiles/sa.make b/hotspot/make/windows/makefiles/sa.make index 5b5cc2d723c..3fa7e79755d 100644 --- a/hotspot/make/windows/makefiles/sa.make +++ b/hotspot/make/windows/makefiles/sa.make @@ -1,5 +1,5 @@ # -# Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/cpu/sparc/vm/assembler_sparc.hpp b/hotspot/src/cpu/sparc/vm/assembler_sparc.hpp index 3192a855569..ccbc43e5a92 100644 --- a/hotspot/src/cpu/sparc/vm/assembler_sparc.hpp +++ b/hotspot/src/cpu/sparc/vm/assembler_sparc.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/cpu/sparc/vm/assembler_sparc.inline.hpp b/hotspot/src/cpu/sparc/vm/assembler_sparc.inline.hpp index ade531a3f82..2e5ba210199 100644 --- a/hotspot/src/cpu/sparc/vm/assembler_sparc.inline.hpp +++ b/hotspot/src/cpu/sparc/vm/assembler_sparc.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/cpu/sparc/vm/c1_CodeStubs_sparc.cpp b/hotspot/src/cpu/sparc/vm/c1_CodeStubs_sparc.cpp index c6039055300..8584037f1ca 100644 --- a/hotspot/src/cpu/sparc/vm/c1_CodeStubs_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/c1_CodeStubs_sparc.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/cpu/sparc/vm/c1_FrameMap_sparc.cpp b/hotspot/src/cpu/sparc/vm/c1_FrameMap_sparc.cpp index e6e7212ed4a..87a95e5ec8c 100644 --- a/hotspot/src/cpu/sparc/vm/c1_FrameMap_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/c1_FrameMap_sparc.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/cpu/sparc/vm/c1_MacroAssembler_sparc.cpp b/hotspot/src/cpu/sparc/vm/c1_MacroAssembler_sparc.cpp index 6d10ab81aaf..3da6cd8cf21 100644 --- a/hotspot/src/cpu/sparc/vm/c1_MacroAssembler_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/c1_MacroAssembler_sparc.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/cpu/sparc/vm/c1_Runtime1_sparc.cpp b/hotspot/src/cpu/sparc/vm/c1_Runtime1_sparc.cpp index 742cacc226b..0b065201261 100644 --- a/hotspot/src/cpu/sparc/vm/c1_Runtime1_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/c1_Runtime1_sparc.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/cpu/sparc/vm/c1_globals_sparc.hpp b/hotspot/src/cpu/sparc/vm/c1_globals_sparc.hpp index c6cf521272d..57f871247b0 100644 --- a/hotspot/src/cpu/sparc/vm/c1_globals_sparc.hpp +++ b/hotspot/src/cpu/sparc/vm/c1_globals_sparc.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/cpu/sparc/vm/c2_globals_sparc.hpp b/hotspot/src/cpu/sparc/vm/c2_globals_sparc.hpp index e4fe6bb00a4..fba1d414c36 100644 --- a/hotspot/src/cpu/sparc/vm/c2_globals_sparc.hpp +++ b/hotspot/src/cpu/sparc/vm/c2_globals_sparc.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/cpu/sparc/vm/c2_init_sparc.cpp b/hotspot/src/cpu/sparc/vm/c2_init_sparc.cpp index 6ad04df863d..b4b3bbd45b9 100644 --- a/hotspot/src/cpu/sparc/vm/c2_init_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/c2_init_sparc.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/cpu/sparc/vm/disassembler_sparc.hpp b/hotspot/src/cpu/sparc/vm/disassembler_sparc.hpp index a1f576b26a7..069840975d2 100644 --- a/hotspot/src/cpu/sparc/vm/disassembler_sparc.hpp +++ b/hotspot/src/cpu/sparc/vm/disassembler_sparc.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/cpu/sparc/vm/frame_sparc.inline.hpp b/hotspot/src/cpu/sparc/vm/frame_sparc.inline.hpp index 774e8f3f0f5..61ef794abd0 100644 --- a/hotspot/src/cpu/sparc/vm/frame_sparc.inline.hpp +++ b/hotspot/src/cpu/sparc/vm/frame_sparc.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/cpu/sparc/vm/globalDefinitions_sparc.hpp b/hotspot/src/cpu/sparc/vm/globalDefinitions_sparc.hpp index cadaffe73c7..dd0319f0374 100644 --- a/hotspot/src/cpu/sparc/vm/globalDefinitions_sparc.hpp +++ b/hotspot/src/cpu/sparc/vm/globalDefinitions_sparc.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/cpu/sparc/vm/globals_sparc.hpp b/hotspot/src/cpu/sparc/vm/globals_sparc.hpp index ecc6eb61524..63ab5efa808 100644 --- a/hotspot/src/cpu/sparc/vm/globals_sparc.hpp +++ b/hotspot/src/cpu/sparc/vm/globals_sparc.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/cpu/sparc/vm/jni_sparc.h b/hotspot/src/cpu/sparc/vm/jni_sparc.h index 2b0ce0081c5..a7540600488 100644 --- a/hotspot/src/cpu/sparc/vm/jni_sparc.h +++ b/hotspot/src/cpu/sparc/vm/jni_sparc.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/cpu/sparc/vm/nativeInst_sparc.hpp b/hotspot/src/cpu/sparc/vm/nativeInst_sparc.hpp index aa362012dcf..29273e7fe61 100644 --- a/hotspot/src/cpu/sparc/vm/nativeInst_sparc.hpp +++ b/hotspot/src/cpu/sparc/vm/nativeInst_sparc.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/cpu/sparc/vm/register_sparc.hpp b/hotspot/src/cpu/sparc/vm/register_sparc.hpp index 423a424c936..7d0096ccf59 100644 --- a/hotspot/src/cpu/sparc/vm/register_sparc.hpp +++ b/hotspot/src/cpu/sparc/vm/register_sparc.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/cpu/sparc/vm/sharedRuntime_sparc.cpp b/hotspot/src/cpu/sparc/vm/sharedRuntime_sparc.cpp index 4b6b1c7c00d..e35133122ab 100644 --- a/hotspot/src/cpu/sparc/vm/sharedRuntime_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/sharedRuntime_sparc.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/cpu/sparc/vm/stubGenerator_sparc.cpp b/hotspot/src/cpu/sparc/vm/stubGenerator_sparc.cpp index 612ae118ee4..b9911828174 100644 --- a/hotspot/src/cpu/sparc/vm/stubGenerator_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/stubGenerator_sparc.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/cpu/sparc/vm/stubRoutines_sparc.cpp b/hotspot/src/cpu/sparc/vm/stubRoutines_sparc.cpp index da9e9040683..63fb86a1509 100644 --- a/hotspot/src/cpu/sparc/vm/stubRoutines_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/stubRoutines_sparc.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/cpu/sparc/vm/stubRoutines_sparc.hpp b/hotspot/src/cpu/sparc/vm/stubRoutines_sparc.hpp index 1b23479a1f9..a94f5977f9d 100644 --- a/hotspot/src/cpu/sparc/vm/stubRoutines_sparc.hpp +++ b/hotspot/src/cpu/sparc/vm/stubRoutines_sparc.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/cpu/sparc/vm/vmStructs_sparc.hpp b/hotspot/src/cpu/sparc/vm/vmStructs_sparc.hpp index 11f829385b8..56805aed838 100644 --- a/hotspot/src/cpu/sparc/vm/vmStructs_sparc.hpp +++ b/hotspot/src/cpu/sparc/vm/vmStructs_sparc.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp b/hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp index 84aff34fafd..bae7b3510cd 100644 --- a/hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/cpu/sparc/vm/vm_version_sparc.hpp b/hotspot/src/cpu/sparc/vm/vm_version_sparc.hpp index c8faa7836b6..b8d63f4f862 100644 --- a/hotspot/src/cpu/sparc/vm/vm_version_sparc.hpp +++ b/hotspot/src/cpu/sparc/vm/vm_version_sparc.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/cpu/x86/vm/bytecodeInterpreter_x86.cpp b/hotspot/src/cpu/x86/vm/bytecodeInterpreter_x86.cpp index 56129cc2d2e..3088400c801 100644 --- a/hotspot/src/cpu/x86/vm/bytecodeInterpreter_x86.cpp +++ b/hotspot/src/cpu/x86/vm/bytecodeInterpreter_x86.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/cpu/x86/vm/c1_CodeStubs_x86.cpp b/hotspot/src/cpu/x86/vm/c1_CodeStubs_x86.cpp index 1e0c3d9c55c..a6e7731bdd5 100644 --- a/hotspot/src/cpu/x86/vm/c1_CodeStubs_x86.cpp +++ b/hotspot/src/cpu/x86/vm/c1_CodeStubs_x86.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/cpu/x86/vm/c1_FrameMap_x86.cpp b/hotspot/src/cpu/x86/vm/c1_FrameMap_x86.cpp index 8ef1bea5d83..f75eca72868 100644 --- a/hotspot/src/cpu/x86/vm/c1_FrameMap_x86.cpp +++ b/hotspot/src/cpu/x86/vm/c1_FrameMap_x86.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/cpu/x86/vm/c1_FrameMap_x86.hpp b/hotspot/src/cpu/x86/vm/c1_FrameMap_x86.hpp index 2d1b5f1f3c7..ddd358cc5d9 100644 --- a/hotspot/src/cpu/x86/vm/c1_FrameMap_x86.hpp +++ b/hotspot/src/cpu/x86/vm/c1_FrameMap_x86.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/cpu/x86/vm/c1_LinearScan_x86.cpp b/hotspot/src/cpu/x86/vm/c1_LinearScan_x86.cpp index baecb9df93d..12b01bfab42 100644 --- a/hotspot/src/cpu/x86/vm/c1_LinearScan_x86.cpp +++ b/hotspot/src/cpu/x86/vm/c1_LinearScan_x86.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/cpu/x86/vm/c1_MacroAssembler_x86.cpp b/hotspot/src/cpu/x86/vm/c1_MacroAssembler_x86.cpp index 805fe5a48ca..0aeb8d7979a 100644 --- a/hotspot/src/cpu/x86/vm/c1_MacroAssembler_x86.cpp +++ b/hotspot/src/cpu/x86/vm/c1_MacroAssembler_x86.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/cpu/x86/vm/c1_Runtime1_x86.cpp b/hotspot/src/cpu/x86/vm/c1_Runtime1_x86.cpp index 2f562bbd318..fd6302d21be 100644 --- a/hotspot/src/cpu/x86/vm/c1_Runtime1_x86.cpp +++ b/hotspot/src/cpu/x86/vm/c1_Runtime1_x86.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/cpu/x86/vm/c1_globals_x86.hpp b/hotspot/src/cpu/x86/vm/c1_globals_x86.hpp index 13f3df82c29..2e99c41949f 100644 --- a/hotspot/src/cpu/x86/vm/c1_globals_x86.hpp +++ b/hotspot/src/cpu/x86/vm/c1_globals_x86.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/cpu/x86/vm/c2_globals_x86.hpp b/hotspot/src/cpu/x86/vm/c2_globals_x86.hpp index a45bd9624e5..935c6a21f34 100644 --- a/hotspot/src/cpu/x86/vm/c2_globals_x86.hpp +++ b/hotspot/src/cpu/x86/vm/c2_globals_x86.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/cpu/x86/vm/frame_x86.hpp b/hotspot/src/cpu/x86/vm/frame_x86.hpp index 0033077dde4..8c6a72c2e97 100644 --- a/hotspot/src/cpu/x86/vm/frame_x86.hpp +++ b/hotspot/src/cpu/x86/vm/frame_x86.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/cpu/x86/vm/frame_x86.inline.hpp b/hotspot/src/cpu/x86/vm/frame_x86.inline.hpp index 3c5c225c399..bb161c9d4ea 100644 --- a/hotspot/src/cpu/x86/vm/frame_x86.inline.hpp +++ b/hotspot/src/cpu/x86/vm/frame_x86.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/cpu/x86/vm/globalDefinitions_x86.hpp b/hotspot/src/cpu/x86/vm/globalDefinitions_x86.hpp index 0771794ff99..cfe52751d6b 100644 --- a/hotspot/src/cpu/x86/vm/globalDefinitions_x86.hpp +++ b/hotspot/src/cpu/x86/vm/globalDefinitions_x86.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/cpu/x86/vm/register_definitions_x86.cpp b/hotspot/src/cpu/x86/vm/register_definitions_x86.cpp index f8a9407933b..8ed435dc3eb 100644 --- a/hotspot/src/cpu/x86/vm/register_definitions_x86.cpp +++ b/hotspot/src/cpu/x86/vm/register_definitions_x86.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/cpu/x86/vm/sharedRuntime_x86_32.cpp b/hotspot/src/cpu/x86/vm/sharedRuntime_x86_32.cpp index 003e70b8066..719644cde05 100644 --- a/hotspot/src/cpu/x86/vm/sharedRuntime_x86_32.cpp +++ b/hotspot/src/cpu/x86/vm/sharedRuntime_x86_32.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/cpu/x86/vm/sharedRuntime_x86_64.cpp b/hotspot/src/cpu/x86/vm/sharedRuntime_x86_64.cpp index fbd344c57b5..6960f6de082 100644 --- a/hotspot/src/cpu/x86/vm/sharedRuntime_x86_64.cpp +++ b/hotspot/src/cpu/x86/vm/sharedRuntime_x86_64.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/cpu/x86/vm/templateInterpreter_x86.hpp b/hotspot/src/cpu/x86/vm/templateInterpreter_x86.hpp index ed2cef16e58..071defbab0d 100644 --- a/hotspot/src/cpu/x86/vm/templateInterpreter_x86.hpp +++ b/hotspot/src/cpu/x86/vm/templateInterpreter_x86.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/cpu/x86/vm/vmStructs_x86.hpp b/hotspot/src/cpu/x86/vm/vmStructs_x86.hpp index 847d08ed207..89cbc3b15a5 100644 --- a/hotspot/src/cpu/x86/vm/vmStructs_x86.hpp +++ b/hotspot/src/cpu/x86/vm/vmStructs_x86.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/cpu/x86/vm/vtableStubs_x86_32.cpp b/hotspot/src/cpu/x86/vm/vtableStubs_x86_32.cpp index 3e7b4243510..73c2f3ca20d 100644 --- a/hotspot/src/cpu/x86/vm/vtableStubs_x86_32.cpp +++ b/hotspot/src/cpu/x86/vm/vtableStubs_x86_32.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/cpu/x86/vm/vtableStubs_x86_64.cpp b/hotspot/src/cpu/x86/vm/vtableStubs_x86_64.cpp index 4fc385f9737..089b368d015 100644 --- a/hotspot/src/cpu/x86/vm/vtableStubs_x86_64.cpp +++ b/hotspot/src/cpu/x86/vm/vtableStubs_x86_64.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/cpu/zero/vm/assembler_zero.cpp b/hotspot/src/cpu/zero/vm/assembler_zero.cpp index 5438c9209b6..4a60af98fd4 100644 --- a/hotspot/src/cpu/zero/vm/assembler_zero.cpp +++ b/hotspot/src/cpu/zero/vm/assembler_zero.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright 2007, 2008, 2009 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * diff --git a/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp b/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp index 27c9af71f17..5142870244d 100644 --- a/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp +++ b/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright 2007, 2008, 2009, 2010, 2011 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * diff --git a/hotspot/src/cpu/zero/vm/entryFrame_zero.hpp b/hotspot/src/cpu/zero/vm/entryFrame_zero.hpp index 97b185c3aab..5c6be60bab4 100644 --- a/hotspot/src/cpu/zero/vm/entryFrame_zero.hpp +++ b/hotspot/src/cpu/zero/vm/entryFrame_zero.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright 2008, 2010 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * diff --git a/hotspot/src/cpu/zero/vm/frame_zero.cpp b/hotspot/src/cpu/zero/vm/frame_zero.cpp index c8623f9aade..4be75fdc3b3 100644 --- a/hotspot/src/cpu/zero/vm/frame_zero.cpp +++ b/hotspot/src/cpu/zero/vm/frame_zero.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright 2007, 2008, 2009, 2010, 2011 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * diff --git a/hotspot/src/cpu/zero/vm/frame_zero.inline.hpp b/hotspot/src/cpu/zero/vm/frame_zero.inline.hpp index 7f6ca09978c..8c968599864 100644 --- a/hotspot/src/cpu/zero/vm/frame_zero.inline.hpp +++ b/hotspot/src/cpu/zero/vm/frame_zero.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright 2007, 2008, 2009, 2010 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * diff --git a/hotspot/src/cpu/zero/vm/globals_zero.hpp b/hotspot/src/cpu/zero/vm/globals_zero.hpp index 9a304c7f3fb..fda6a191b44 100644 --- a/hotspot/src/cpu/zero/vm/globals_zero.hpp +++ b/hotspot/src/cpu/zero/vm/globals_zero.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright 2007, 2008, 2009, 2010, 2011 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * diff --git a/hotspot/src/cpu/zero/vm/icBuffer_zero.cpp b/hotspot/src/cpu/zero/vm/icBuffer_zero.cpp index bf2849b6ecc..9a82782ab3a 100644 --- a/hotspot/src/cpu/zero/vm/icBuffer_zero.cpp +++ b/hotspot/src/cpu/zero/vm/icBuffer_zero.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright 2007 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * diff --git a/hotspot/src/cpu/zero/vm/interp_masm_zero.hpp b/hotspot/src/cpu/zero/vm/interp_masm_zero.hpp index 97a105bea80..ccba37b249f 100644 --- a/hotspot/src/cpu/zero/vm/interp_masm_zero.hpp +++ b/hotspot/src/cpu/zero/vm/interp_masm_zero.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright 2007 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * diff --git a/hotspot/src/cpu/zero/vm/interpreter_zero.cpp b/hotspot/src/cpu/zero/vm/interpreter_zero.cpp index 371d65cf9bb..7172443db8f 100644 --- a/hotspot/src/cpu/zero/vm/interpreter_zero.cpp +++ b/hotspot/src/cpu/zero/vm/interpreter_zero.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright 2007, 2008, 2009, 2010, 2011 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * diff --git a/hotspot/src/cpu/zero/vm/jni_zero.h b/hotspot/src/cpu/zero/vm/jni_zero.h index 11157f4f06a..ecf743b65e1 100644 --- a/hotspot/src/cpu/zero/vm/jni_zero.h +++ b/hotspot/src/cpu/zero/vm/jni_zero.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright 2009 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * diff --git a/hotspot/src/cpu/zero/vm/nativeInst_zero.hpp b/hotspot/src/cpu/zero/vm/nativeInst_zero.hpp index 00599206126..559bde79ab6 100644 --- a/hotspot/src/cpu/zero/vm/nativeInst_zero.hpp +++ b/hotspot/src/cpu/zero/vm/nativeInst_zero.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright 2007 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * diff --git a/hotspot/src/cpu/zero/vm/register_zero.cpp b/hotspot/src/cpu/zero/vm/register_zero.cpp index f11bf829aa6..5d695430171 100644 --- a/hotspot/src/cpu/zero/vm/register_zero.cpp +++ b/hotspot/src/cpu/zero/vm/register_zero.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright 2007 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * diff --git a/hotspot/src/cpu/zero/vm/relocInfo_zero.cpp b/hotspot/src/cpu/zero/vm/relocInfo_zero.cpp index f50190829c0..a042bccfc14 100644 --- a/hotspot/src/cpu/zero/vm/relocInfo_zero.cpp +++ b/hotspot/src/cpu/zero/vm/relocInfo_zero.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright 2007, 2009, 2010, 2011 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * diff --git a/hotspot/src/cpu/zero/vm/sharedRuntime_zero.cpp b/hotspot/src/cpu/zero/vm/sharedRuntime_zero.cpp index 2c419b14822..a9ebd9a121c 100644 --- a/hotspot/src/cpu/zero/vm/sharedRuntime_zero.cpp +++ b/hotspot/src/cpu/zero/vm/sharedRuntime_zero.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright 2007, 2008, 2009, 2010, 2011 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * diff --git a/hotspot/src/cpu/zero/vm/sharkFrame_zero.hpp b/hotspot/src/cpu/zero/vm/sharkFrame_zero.hpp index 505241b147f..ff26fbccf86 100644 --- a/hotspot/src/cpu/zero/vm/sharkFrame_zero.hpp +++ b/hotspot/src/cpu/zero/vm/sharkFrame_zero.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright 2008, 2009 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * diff --git a/hotspot/src/cpu/zero/vm/stubGenerator_zero.cpp b/hotspot/src/cpu/zero/vm/stubGenerator_zero.cpp index 1203c315879..b88df23737b 100644 --- a/hotspot/src/cpu/zero/vm/stubGenerator_zero.cpp +++ b/hotspot/src/cpu/zero/vm/stubGenerator_zero.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright 2007, 2008, 2010 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * diff --git a/hotspot/src/cpu/zero/vm/vmStructs_zero.hpp b/hotspot/src/cpu/zero/vm/vmStructs_zero.hpp index 0bbc1f40f45..72783cf341a 100644 --- a/hotspot/src/cpu/zero/vm/vmStructs_zero.hpp +++ b/hotspot/src/cpu/zero/vm/vmStructs_zero.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright 2007 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * diff --git a/hotspot/src/cpu/zero/vm/vtableStubs_zero.cpp b/hotspot/src/cpu/zero/vm/vtableStubs_zero.cpp index 67f0ea88839..4e52a4ed125 100644 --- a/hotspot/src/cpu/zero/vm/vtableStubs_zero.cpp +++ b/hotspot/src/cpu/zero/vm/vtableStubs_zero.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright 2007 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * diff --git a/hotspot/src/os/bsd/dtrace/jvm_dtrace.c b/hotspot/src/os/bsd/dtrace/jvm_dtrace.c index 6cdad788572..36d8b61b19f 100644 --- a/hotspot/src/os/bsd/dtrace/jvm_dtrace.c +++ b/hotspot/src/os/bsd/dtrace/jvm_dtrace.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/os/posix/vm/os_posix.hpp b/hotspot/src/os/posix/vm/os_posix.hpp index 16a065acf30..406baf17237 100644 --- a/hotspot/src/os/posix/vm/os_posix.hpp +++ b/hotspot/src/os/posix/vm/os_posix.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/os/solaris/dtrace/jvm_dtrace.c b/hotspot/src/os/solaris/dtrace/jvm_dtrace.c index 6cdad788572..36d8b61b19f 100644 --- a/hotspot/src/os/solaris/dtrace/jvm_dtrace.c +++ b/hotspot/src/os/solaris/dtrace/jvm_dtrace.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/os/solaris/vm/globals_solaris.hpp b/hotspot/src/os/solaris/vm/globals_solaris.hpp index 2abbe15a7fd..ba5458803e8 100644 --- a/hotspot/src/os/solaris/vm/globals_solaris.hpp +++ b/hotspot/src/os/solaris/vm/globals_solaris.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/os/windows/vm/decoder_windows.hpp b/hotspot/src/os/windows/vm/decoder_windows.hpp index 2555e8c9b79..731b3a3f5dc 100644 --- a/hotspot/src/os/windows/vm/decoder_windows.hpp +++ b/hotspot/src/os/windows/vm/decoder_windows.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/os_cpu/bsd_x86/vm/bsd_x86_32.s b/hotspot/src/os_cpu/bsd_x86/vm/bsd_x86_32.s index 3275996f0c7..3f6958ce385 100644 --- a/hotspot/src/os_cpu/bsd_x86/vm/bsd_x86_32.s +++ b/hotspot/src/os_cpu/bsd_x86/vm/bsd_x86_32.s @@ -1,5 +1,5 @@ # -# Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/os_cpu/bsd_x86/vm/bsd_x86_64.s b/hotspot/src/os_cpu/bsd_x86/vm/bsd_x86_64.s index 2f70fce77a3..95cea3bf2a3 100644 --- a/hotspot/src/os_cpu/bsd_x86/vm/bsd_x86_64.s +++ b/hotspot/src/os_cpu/bsd_x86/vm/bsd_x86_64.s @@ -1,5 +1,5 @@ # -# Copyright (c) 2004, 2007, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp b/hotspot/src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp index a1d7075af55..df24bcdc594 100644 --- a/hotspot/src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp +++ b/hotspot/src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/os_cpu/bsd_x86/vm/vmStructs_bsd_x86.hpp b/hotspot/src/os_cpu/bsd_x86/vm/vmStructs_bsd_x86.hpp index b1460eddc0c..32d0fdc66a2 100644 --- a/hotspot/src/os_cpu/bsd_x86/vm/vmStructs_bsd_x86.hpp +++ b/hotspot/src/os_cpu/bsd_x86/vm/vmStructs_bsd_x86.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/os_cpu/bsd_zero/vm/globals_bsd_zero.hpp b/hotspot/src/os_cpu/bsd_zero/vm/globals_bsd_zero.hpp index 44f72df22cf..e7b7f55d03d 100644 --- a/hotspot/src/os_cpu/bsd_zero/vm/globals_bsd_zero.hpp +++ b/hotspot/src/os_cpu/bsd_zero/vm/globals_bsd_zero.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright 2007, 2008, 2010 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * diff --git a/hotspot/src/os_cpu/bsd_zero/vm/os_bsd_zero.cpp b/hotspot/src/os_cpu/bsd_zero/vm/os_bsd_zero.cpp index 7903217291b..c857b552689 100644 --- a/hotspot/src/os_cpu/bsd_zero/vm/os_bsd_zero.cpp +++ b/hotspot/src/os_cpu/bsd_zero/vm/os_bsd_zero.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright 2007, 2008, 2009, 2010 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * diff --git a/hotspot/src/os_cpu/bsd_zero/vm/thread_bsd_zero.hpp b/hotspot/src/os_cpu/bsd_zero/vm/thread_bsd_zero.hpp index 983aea1a2a6..7afef93eda2 100644 --- a/hotspot/src/os_cpu/bsd_zero/vm/thread_bsd_zero.hpp +++ b/hotspot/src/os_cpu/bsd_zero/vm/thread_bsd_zero.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright 2007, 2008, 2009, 2010 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * diff --git a/hotspot/src/os_cpu/bsd_zero/vm/vmStructs_bsd_zero.hpp b/hotspot/src/os_cpu/bsd_zero/vm/vmStructs_bsd_zero.hpp index 6673f448f81..48e40a8e33f 100644 --- a/hotspot/src/os_cpu/bsd_zero/vm/vmStructs_bsd_zero.hpp +++ b/hotspot/src/os_cpu/bsd_zero/vm/vmStructs_bsd_zero.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright 2007 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * diff --git a/hotspot/src/os_cpu/linux_sparc/vm/globals_linux_sparc.hpp b/hotspot/src/os_cpu/linux_sparc/vm/globals_linux_sparc.hpp index 844279e41e0..b3a215d2b83 100644 --- a/hotspot/src/os_cpu/linux_sparc/vm/globals_linux_sparc.hpp +++ b/hotspot/src/os_cpu/linux_sparc/vm/globals_linux_sparc.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/os_cpu/linux_sparc/vm/linux_sparc.s b/hotspot/src/os_cpu/linux_sparc/vm/linux_sparc.s index d7c2ce87414..33474ecd9c0 100644 --- a/hotspot/src/os_cpu/linux_sparc/vm/linux_sparc.s +++ b/hotspot/src/os_cpu/linux_sparc/vm/linux_sparc.s @@ -1,5 +1,5 @@ # -# Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/os_cpu/linux_sparc/vm/os_linux_sparc.cpp b/hotspot/src/os_cpu/linux_sparc/vm/os_linux_sparc.cpp index e7879bee690..5eaab2d5259 100644 --- a/hotspot/src/os_cpu/linux_sparc/vm/os_linux_sparc.cpp +++ b/hotspot/src/os_cpu/linux_sparc/vm/os_linux_sparc.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/os_cpu/linux_sparc/vm/vmStructs_linux_sparc.hpp b/hotspot/src/os_cpu/linux_sparc/vm/vmStructs_linux_sparc.hpp index 38bc63e6496..1e9280fe36c 100644 --- a/hotspot/src/os_cpu/linux_sparc/vm/vmStructs_linux_sparc.hpp +++ b/hotspot/src/os_cpu/linux_sparc/vm/vmStructs_linux_sparc.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/os_cpu/linux_x86/vm/globals_linux_x86.hpp b/hotspot/src/os_cpu/linux_x86/vm/globals_linux_x86.hpp index 622928aa17b..4ecaeee3354 100644 --- a/hotspot/src/os_cpu/linux_x86/vm/globals_linux_x86.hpp +++ b/hotspot/src/os_cpu/linux_x86/vm/globals_linux_x86.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/os_cpu/linux_x86/vm/linux_x86_32.s b/hotspot/src/os_cpu/linux_x86/vm/linux_x86_32.s index 7936cbf52bd..26cfa51e162 100644 --- a/hotspot/src/os_cpu/linux_x86/vm/linux_x86_32.s +++ b/hotspot/src/os_cpu/linux_x86/vm/linux_x86_32.s @@ -1,5 +1,5 @@ # -# Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/os_cpu/linux_x86/vm/linux_x86_64.s b/hotspot/src/os_cpu/linux_x86/vm/linux_x86_64.s index fb688e7a7b6..89d98cb5837 100644 --- a/hotspot/src/os_cpu/linux_x86/vm/linux_x86_64.s +++ b/hotspot/src/os_cpu/linux_x86/vm/linux_x86_64.s @@ -1,5 +1,5 @@ # -# Copyright (c) 2004, 2007, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp b/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp index 9a7605e696b..195982529ef 100644 --- a/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp +++ b/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.hpp b/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.hpp index fbca6909bb5..1ccfad76fe7 100644 --- a/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.hpp +++ b/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/os_cpu/linux_x86/vm/vmStructs_linux_x86.hpp b/hotspot/src/os_cpu/linux_x86/vm/vmStructs_linux_x86.hpp index 828f992d8ba..897e48aa19f 100644 --- a/hotspot/src/os_cpu/linux_x86/vm/vmStructs_linux_x86.hpp +++ b/hotspot/src/os_cpu/linux_x86/vm/vmStructs_linux_x86.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/os_cpu/linux_zero/vm/globals_linux_zero.hpp b/hotspot/src/os_cpu/linux_zero/vm/globals_linux_zero.hpp index 4e0be5c79f3..663f0ac45c6 100644 --- a/hotspot/src/os_cpu/linux_zero/vm/globals_linux_zero.hpp +++ b/hotspot/src/os_cpu/linux_zero/vm/globals_linux_zero.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright 2007, 2008, 2010 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * diff --git a/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.cpp b/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.cpp index 2618519e2a4..f5f44e0a77b 100644 --- a/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.cpp +++ b/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright 2007, 2008, 2009, 2010 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * diff --git a/hotspot/src/os_cpu/linux_zero/vm/vmStructs_linux_zero.hpp b/hotspot/src/os_cpu/linux_zero/vm/vmStructs_linux_zero.hpp index 34b82a96d79..fe0cc5e10a1 100644 --- a/hotspot/src/os_cpu/linux_zero/vm/vmStructs_linux_zero.hpp +++ b/hotspot/src/os_cpu/linux_zero/vm/vmStructs_linux_zero.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright 2007 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * diff --git a/hotspot/src/os_cpu/solaris_sparc/vm/globals_solaris_sparc.hpp b/hotspot/src/os_cpu/solaris_sparc/vm/globals_solaris_sparc.hpp index e0ed6961e3a..30c955debca 100644 --- a/hotspot/src/os_cpu/solaris_sparc/vm/globals_solaris_sparc.hpp +++ b/hotspot/src/os_cpu/solaris_sparc/vm/globals_solaris_sparc.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/os_cpu/solaris_sparc/vm/solaris_sparc.il b/hotspot/src/os_cpu/solaris_sparc/vm/solaris_sparc.il index 47398351b39..16bd6902a3e 100644 --- a/hotspot/src/os_cpu/solaris_sparc/vm/solaris_sparc.il +++ b/hotspot/src/os_cpu/solaris_sparc/vm/solaris_sparc.il @@ -1,5 +1,5 @@ // -// Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. // DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. // // This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/os_cpu/solaris_sparc/vm/solaris_sparc.s b/hotspot/src/os_cpu/solaris_sparc/vm/solaris_sparc.s index 39aaa77f664..a0f6ddff431 100644 --- a/hotspot/src/os_cpu/solaris_sparc/vm/solaris_sparc.s +++ b/hotspot/src/os_cpu/solaris_sparc/vm/solaris_sparc.s @@ -1,5 +1,5 @@ !! -!! Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved. +!! Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. !! DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. !! !! This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/os_cpu/solaris_sparc/vm/vmStructs_solaris_sparc.hpp b/hotspot/src/os_cpu/solaris_sparc/vm/vmStructs_solaris_sparc.hpp index 40d6ae735aa..08a5fb3980a 100644 --- a/hotspot/src/os_cpu/solaris_sparc/vm/vmStructs_solaris_sparc.hpp +++ b/hotspot/src/os_cpu/solaris_sparc/vm/vmStructs_solaris_sparc.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/os_cpu/solaris_x86/vm/globals_solaris_x86.hpp b/hotspot/src/os_cpu/solaris_x86/vm/globals_solaris_x86.hpp index c1f656b99f8..e6329c28942 100644 --- a/hotspot/src/os_cpu/solaris_x86/vm/globals_solaris_x86.hpp +++ b/hotspot/src/os_cpu/solaris_x86/vm/globals_solaris_x86.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/os_cpu/solaris_x86/vm/solaris_x86_32.s b/hotspot/src/os_cpu/solaris_x86/vm/solaris_x86_32.s index 19e790b6013..a48294ab909 100644 --- a/hotspot/src/os_cpu/solaris_x86/vm/solaris_x86_32.s +++ b/hotspot/src/os_cpu/solaris_x86/vm/solaris_x86_32.s @@ -1,5 +1,5 @@ // -// Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. // DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. // // This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/os_cpu/solaris_x86/vm/solaris_x86_64.s b/hotspot/src/os_cpu/solaris_x86/vm/solaris_x86_64.s index 487b569e58c..9a3e03f175c 100644 --- a/hotspot/src/os_cpu/solaris_x86/vm/solaris_x86_64.s +++ b/hotspot/src/os_cpu/solaris_x86/vm/solaris_x86_64.s @@ -1,5 +1,5 @@ / -/ Copyright (c) 2004, 2005, Oracle and/or its affiliates. All rights reserved. +/ Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. / DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. / / This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/os_cpu/solaris_x86/vm/vmStructs_solaris_x86.hpp b/hotspot/src/os_cpu/solaris_x86/vm/vmStructs_solaris_x86.hpp index 523fdc7cc42..9304bb7242e 100644 --- a/hotspot/src/os_cpu/solaris_x86/vm/vmStructs_solaris_x86.hpp +++ b/hotspot/src/os_cpu/solaris_x86/vm/vmStructs_solaris_x86.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/os_cpu/windows_x86/vm/globals_windows_x86.hpp b/hotspot/src/os_cpu/windows_x86/vm/globals_windows_x86.hpp index 10e0aaff747..de91c32ad33 100644 --- a/hotspot/src/os_cpu/windows_x86/vm/globals_windows_x86.hpp +++ b/hotspot/src/os_cpu/windows_x86/vm/globals_windows_x86.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/os_cpu/windows_x86/vm/os_windows_x86.cpp b/hotspot/src/os_cpu/windows_x86/vm/os_windows_x86.cpp index 09735dae0c6..6178f1988e5 100644 --- a/hotspot/src/os_cpu/windows_x86/vm/os_windows_x86.cpp +++ b/hotspot/src/os_cpu/windows_x86/vm/os_windows_x86.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/os_cpu/windows_x86/vm/os_windows_x86.hpp b/hotspot/src/os_cpu/windows_x86/vm/os_windows_x86.hpp index 22ffeb5dc34..1ac00b10455 100644 --- a/hotspot/src/os_cpu/windows_x86/vm/os_windows_x86.hpp +++ b/hotspot/src/os_cpu/windows_x86/vm/os_windows_x86.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/os_cpu/windows_x86/vm/vmStructs_windows_x86.hpp b/hotspot/src/os_cpu/windows_x86/vm/vmStructs_windows_x86.hpp index a392b63632c..b629e23205a 100644 --- a/hotspot/src/os_cpu/windows_x86/vm/vmStructs_windows_x86.hpp +++ b/hotspot/src/os_cpu/windows_x86/vm/vmStructs_windows_x86.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/tools/LogCompilation/src/com/sun/hotspot/tools/compiler/CallSite.java b/hotspot/src/share/tools/LogCompilation/src/com/sun/hotspot/tools/compiler/CallSite.java index c4a77c02aac..c36f4cae67d 100644 --- a/hotspot/src/share/tools/LogCompilation/src/com/sun/hotspot/tools/compiler/CallSite.java +++ b/hotspot/src/share/tools/LogCompilation/src/com/sun/hotspot/tools/compiler/CallSite.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/tools/LogCompilation/src/com/sun/hotspot/tools/compiler/LogParser.java b/hotspot/src/share/tools/LogCompilation/src/com/sun/hotspot/tools/compiler/LogParser.java index de80e9a1043..c24a2103eb0 100644 --- a/hotspot/src/share/tools/LogCompilation/src/com/sun/hotspot/tools/compiler/LogParser.java +++ b/hotspot/src/share/tools/LogCompilation/src/com/sun/hotspot/tools/compiler/LogParser.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/tools/ProjectCreator/WinGammaPlatformVC7.java b/hotspot/src/share/tools/ProjectCreator/WinGammaPlatformVC7.java index b7a99a652db..9afeb42d422 100644 --- a/hotspot/src/share/tools/ProjectCreator/WinGammaPlatformVC7.java +++ b/hotspot/src/share/tools/ProjectCreator/WinGammaPlatformVC7.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/tools/hsdis/hsdis.c b/hotspot/src/share/tools/hsdis/hsdis.c index 162e2aba3e7..248acfaf37c 100644 --- a/hotspot/src/share/tools/hsdis/hsdis.c +++ b/hotspot/src/share/tools/hsdis/hsdis.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/adlc/adlparse.cpp b/hotspot/src/share/vm/adlc/adlparse.cpp index 8704c68da69..0d5595c6c04 100644 --- a/hotspot/src/share/vm/adlc/adlparse.cpp +++ b/hotspot/src/share/vm/adlc/adlparse.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/adlc/archDesc.cpp b/hotspot/src/share/vm/adlc/archDesc.cpp index fd60e25acb7..073954c9b47 100644 --- a/hotspot/src/share/vm/adlc/archDesc.cpp +++ b/hotspot/src/share/vm/adlc/archDesc.cpp @@ -1,5 +1,5 @@ // -// Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. // DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. // // This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/adlc/dfa.cpp b/hotspot/src/share/vm/adlc/dfa.cpp index 6b15911a067..80ef1af3602 100644 --- a/hotspot/src/share/vm/adlc/dfa.cpp +++ b/hotspot/src/share/vm/adlc/dfa.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/adlc/dict2.cpp b/hotspot/src/share/vm/adlc/dict2.cpp index 24d7fcba023..f341a2b67b0 100644 --- a/hotspot/src/share/vm/adlc/dict2.cpp +++ b/hotspot/src/share/vm/adlc/dict2.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/adlc/formssel.cpp b/hotspot/src/share/vm/adlc/formssel.cpp index cfa9f5b6222..01aedd36a70 100644 --- a/hotspot/src/share/vm/adlc/formssel.cpp +++ b/hotspot/src/share/vm/adlc/formssel.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/adlc/formssel.hpp b/hotspot/src/share/vm/adlc/formssel.hpp index 3bc22b8e269..5f7c970e228 100644 --- a/hotspot/src/share/vm/adlc/formssel.hpp +++ b/hotspot/src/share/vm/adlc/formssel.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/adlc/output_c.cpp b/hotspot/src/share/vm/adlc/output_c.cpp index b8978591355..c9ef6672c32 100644 --- a/hotspot/src/share/vm/adlc/output_c.cpp +++ b/hotspot/src/share/vm/adlc/output_c.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/adlc/output_h.cpp b/hotspot/src/share/vm/adlc/output_h.cpp index 0b01d06dc31..56ba9a582c2 100644 --- a/hotspot/src/share/vm/adlc/output_h.cpp +++ b/hotspot/src/share/vm/adlc/output_h.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/asm/assembler.cpp b/hotspot/src/share/vm/asm/assembler.cpp index ae3034bc969..0eadb5dc273 100644 --- a/hotspot/src/share/vm/asm/assembler.cpp +++ b/hotspot/src/share/vm/asm/assembler.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/asm/assembler.hpp b/hotspot/src/share/vm/asm/assembler.hpp index 8a9e2758a58..eb21a3d1503 100644 --- a/hotspot/src/share/vm/asm/assembler.hpp +++ b/hotspot/src/share/vm/asm/assembler.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/asm/codeBuffer.cpp b/hotspot/src/share/vm/asm/codeBuffer.cpp index f885c415332..7e585990091 100644 --- a/hotspot/src/share/vm/asm/codeBuffer.cpp +++ b/hotspot/src/share/vm/asm/codeBuffer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/asm/macroAssembler.hpp b/hotspot/src/share/vm/asm/macroAssembler.hpp index 96c6b01dc34..3a729d41dbf 100644 --- a/hotspot/src/share/vm/asm/macroAssembler.hpp +++ b/hotspot/src/share/vm/asm/macroAssembler.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/asm/macroAssembler.inline.hpp b/hotspot/src/share/vm/asm/macroAssembler.inline.hpp index e61fc37d96e..7fa323749d4 100644 --- a/hotspot/src/share/vm/asm/macroAssembler.inline.hpp +++ b/hotspot/src/share/vm/asm/macroAssembler.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/c1/c1_Canonicalizer.cpp b/hotspot/src/share/vm/c1/c1_Canonicalizer.cpp index f98edc6f563..932bfb30b95 100644 --- a/hotspot/src/share/vm/c1/c1_Canonicalizer.cpp +++ b/hotspot/src/share/vm/c1/c1_Canonicalizer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/c1/c1_Canonicalizer.hpp b/hotspot/src/share/vm/c1/c1_Canonicalizer.hpp index 43ce4a41c14..c1191830ed0 100644 --- a/hotspot/src/share/vm/c1/c1_Canonicalizer.hpp +++ b/hotspot/src/share/vm/c1/c1_Canonicalizer.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/c1/c1_CodeStubs.hpp b/hotspot/src/share/vm/c1/c1_CodeStubs.hpp index 5f4a04c5b6c..d3c5a0d8bbb 100644 --- a/hotspot/src/share/vm/c1/c1_CodeStubs.hpp +++ b/hotspot/src/share/vm/c1/c1_CodeStubs.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/c1/c1_Compilation.cpp b/hotspot/src/share/vm/c1/c1_Compilation.cpp index 574fda19401..404c4e336f3 100644 --- a/hotspot/src/share/vm/c1/c1_Compilation.cpp +++ b/hotspot/src/share/vm/c1/c1_Compilation.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/c1/c1_Compiler.cpp b/hotspot/src/share/vm/c1/c1_Compiler.cpp index 0fb723c8a95..3aeb2659115 100644 --- a/hotspot/src/share/vm/c1/c1_Compiler.cpp +++ b/hotspot/src/share/vm/c1/c1_Compiler.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/c1/c1_Compiler.hpp b/hotspot/src/share/vm/c1/c1_Compiler.hpp index fe95c8cd780..8c645e65825 100644 --- a/hotspot/src/share/vm/c1/c1_Compiler.hpp +++ b/hotspot/src/share/vm/c1/c1_Compiler.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/c1/c1_FrameMap.cpp b/hotspot/src/share/vm/c1/c1_FrameMap.cpp index f5eef6f0b3b..455cfe278ee 100644 --- a/hotspot/src/share/vm/c1/c1_FrameMap.cpp +++ b/hotspot/src/share/vm/c1/c1_FrameMap.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/c1/c1_FrameMap.hpp b/hotspot/src/share/vm/c1/c1_FrameMap.hpp index 98bb86f8f74..052621e8d66 100644 --- a/hotspot/src/share/vm/c1/c1_FrameMap.hpp +++ b/hotspot/src/share/vm/c1/c1_FrameMap.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/c1/c1_GraphBuilder.hpp b/hotspot/src/share/vm/c1/c1_GraphBuilder.hpp index ce83cb73fe2..c783878efa1 100644 --- a/hotspot/src/share/vm/c1/c1_GraphBuilder.hpp +++ b/hotspot/src/share/vm/c1/c1_GraphBuilder.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/c1/c1_IR.cpp b/hotspot/src/share/vm/c1/c1_IR.cpp index 13a7f790f6f..c377e56ecef 100644 --- a/hotspot/src/share/vm/c1/c1_IR.cpp +++ b/hotspot/src/share/vm/c1/c1_IR.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/c1/c1_IR.hpp b/hotspot/src/share/vm/c1/c1_IR.hpp index bc57300c1f0..ba1abee0d01 100644 --- a/hotspot/src/share/vm/c1/c1_IR.hpp +++ b/hotspot/src/share/vm/c1/c1_IR.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/c1/c1_Instruction.cpp b/hotspot/src/share/vm/c1/c1_Instruction.cpp index e5829611e66..99d00bdec27 100644 --- a/hotspot/src/share/vm/c1/c1_Instruction.cpp +++ b/hotspot/src/share/vm/c1/c1_Instruction.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/c1/c1_InstructionPrinter.hpp b/hotspot/src/share/vm/c1/c1_InstructionPrinter.hpp index 2ad20d3e65a..a3a91033d70 100644 --- a/hotspot/src/share/vm/c1/c1_InstructionPrinter.hpp +++ b/hotspot/src/share/vm/c1/c1_InstructionPrinter.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/c1/c1_LIRAssembler.cpp b/hotspot/src/share/vm/c1/c1_LIRAssembler.cpp index 9ae527054fe..7f1e0750395 100644 --- a/hotspot/src/share/vm/c1/c1_LIRAssembler.cpp +++ b/hotspot/src/share/vm/c1/c1_LIRAssembler.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/c1/c1_LinearScan.cpp b/hotspot/src/share/vm/c1/c1_LinearScan.cpp index 52dff2642c1..089058aa71f 100644 --- a/hotspot/src/share/vm/c1/c1_LinearScan.cpp +++ b/hotspot/src/share/vm/c1/c1_LinearScan.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/c1/c1_Optimizer.cpp b/hotspot/src/share/vm/c1/c1_Optimizer.cpp index 90667b46f39..f366462f60c 100644 --- a/hotspot/src/share/vm/c1/c1_Optimizer.cpp +++ b/hotspot/src/share/vm/c1/c1_Optimizer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/c1/c1_RangeCheckElimination.cpp b/hotspot/src/share/vm/c1/c1_RangeCheckElimination.cpp index 12cdce62fee..599cedb99d0 100644 --- a/hotspot/src/share/vm/c1/c1_RangeCheckElimination.cpp +++ b/hotspot/src/share/vm/c1/c1_RangeCheckElimination.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/c1/c1_RangeCheckElimination.hpp b/hotspot/src/share/vm/c1/c1_RangeCheckElimination.hpp index b022a81374b..f7b68af9862 100644 --- a/hotspot/src/share/vm/c1/c1_RangeCheckElimination.hpp +++ b/hotspot/src/share/vm/c1/c1_RangeCheckElimination.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/c1/c1_Runtime1.hpp b/hotspot/src/share/vm/c1/c1_Runtime1.hpp index e41f2f188dc..276ca44ffbe 100644 --- a/hotspot/src/share/vm/c1/c1_Runtime1.hpp +++ b/hotspot/src/share/vm/c1/c1_Runtime1.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/c1/c1_ValueMap.cpp b/hotspot/src/share/vm/c1/c1_ValueMap.cpp index 370afe46b93..fb52819facc 100644 --- a/hotspot/src/share/vm/c1/c1_ValueMap.cpp +++ b/hotspot/src/share/vm/c1/c1_ValueMap.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/c1/c1_ValueMap.hpp b/hotspot/src/share/vm/c1/c1_ValueMap.hpp index 1404aa0b8a8..e394118b1ce 100644 --- a/hotspot/src/share/vm/c1/c1_ValueMap.hpp +++ b/hotspot/src/share/vm/c1/c1_ValueMap.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/c1/c1_globals.cpp b/hotspot/src/share/vm/c1/c1_globals.cpp index 553b9aa4322..93e641ab698 100644 --- a/hotspot/src/share/vm/c1/c1_globals.cpp +++ b/hotspot/src/share/vm/c1/c1_globals.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/c1/c1_globals.hpp b/hotspot/src/share/vm/c1/c1_globals.hpp index c7136909c40..a6b5fec14b9 100644 --- a/hotspot/src/share/vm/c1/c1_globals.hpp +++ b/hotspot/src/share/vm/c1/c1_globals.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/ci/bcEscapeAnalyzer.cpp b/hotspot/src/share/vm/ci/bcEscapeAnalyzer.cpp index e2fca4845b1..24b2830ed83 100644 --- a/hotspot/src/share/vm/ci/bcEscapeAnalyzer.cpp +++ b/hotspot/src/share/vm/ci/bcEscapeAnalyzer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/ci/bcEscapeAnalyzer.hpp b/hotspot/src/share/vm/ci/bcEscapeAnalyzer.hpp index 3c701b6a4e8..74a0d3106b7 100644 --- a/hotspot/src/share/vm/ci/bcEscapeAnalyzer.hpp +++ b/hotspot/src/share/vm/ci/bcEscapeAnalyzer.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/ci/ciArray.cpp b/hotspot/src/share/vm/ci/ciArray.cpp index fdcc63a0dec..56f57b360dd 100644 --- a/hotspot/src/share/vm/ci/ciArray.cpp +++ b/hotspot/src/share/vm/ci/ciArray.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/ci/ciArray.hpp b/hotspot/src/share/vm/ci/ciArray.hpp index c5c86265d61..d5ff40ba695 100644 --- a/hotspot/src/share/vm/ci/ciArray.hpp +++ b/hotspot/src/share/vm/ci/ciArray.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/ci/ciClassList.hpp b/hotspot/src/share/vm/ci/ciClassList.hpp index c3131f5ee67..ee82685a4df 100644 --- a/hotspot/src/share/vm/ci/ciClassList.hpp +++ b/hotspot/src/share/vm/ci/ciClassList.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/ci/ciConstant.hpp b/hotspot/src/share/vm/ci/ciConstant.hpp index 7a72a7de1e5..5af058f4e9b 100644 --- a/hotspot/src/share/vm/ci/ciConstant.hpp +++ b/hotspot/src/share/vm/ci/ciConstant.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/ci/ciEnv.hpp b/hotspot/src/share/vm/ci/ciEnv.hpp index b235f3b148b..8d9d48fb5c2 100644 --- a/hotspot/src/share/vm/ci/ciEnv.hpp +++ b/hotspot/src/share/vm/ci/ciEnv.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/ci/ciFlags.hpp b/hotspot/src/share/vm/ci/ciFlags.hpp index 87e19466f27..60d5632f4bb 100644 --- a/hotspot/src/share/vm/ci/ciFlags.hpp +++ b/hotspot/src/share/vm/ci/ciFlags.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/ci/ciInstance.cpp b/hotspot/src/share/vm/ci/ciInstance.cpp index 8b48b1b3706..f276a53fb5d 100644 --- a/hotspot/src/share/vm/ci/ciInstance.cpp +++ b/hotspot/src/share/vm/ci/ciInstance.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/ci/ciInstanceKlass.hpp b/hotspot/src/share/vm/ci/ciInstanceKlass.hpp index 34eb84ccfeb..41c42935a6a 100644 --- a/hotspot/src/share/vm/ci/ciInstanceKlass.hpp +++ b/hotspot/src/share/vm/ci/ciInstanceKlass.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/ci/ciKlass.cpp b/hotspot/src/share/vm/ci/ciKlass.cpp index 2a4a25acded..0cd20e5b904 100644 --- a/hotspot/src/share/vm/ci/ciKlass.cpp +++ b/hotspot/src/share/vm/ci/ciKlass.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/ci/ciKlass.hpp b/hotspot/src/share/vm/ci/ciKlass.hpp index 7e03c1ede61..8e6574b22fd 100644 --- a/hotspot/src/share/vm/ci/ciKlass.hpp +++ b/hotspot/src/share/vm/ci/ciKlass.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/ci/ciMethodData.cpp b/hotspot/src/share/vm/ci/ciMethodData.cpp index e8b6ee6af5e..025146885db 100644 --- a/hotspot/src/share/vm/ci/ciMethodData.cpp +++ b/hotspot/src/share/vm/ci/ciMethodData.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/ci/ciMethodData.hpp b/hotspot/src/share/vm/ci/ciMethodData.hpp index 0eeb510e348..f1a7f2634e4 100644 --- a/hotspot/src/share/vm/ci/ciMethodData.hpp +++ b/hotspot/src/share/vm/ci/ciMethodData.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/ci/ciObjArrayKlass.cpp b/hotspot/src/share/vm/ci/ciObjArrayKlass.cpp index 91f2ebc42a0..2b035c2af0f 100644 --- a/hotspot/src/share/vm/ci/ciObjArrayKlass.cpp +++ b/hotspot/src/share/vm/ci/ciObjArrayKlass.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/ci/ciObjArrayKlass.hpp b/hotspot/src/share/vm/ci/ciObjArrayKlass.hpp index 7a45e867438..e50814c0f8e 100644 --- a/hotspot/src/share/vm/ci/ciObjArrayKlass.hpp +++ b/hotspot/src/share/vm/ci/ciObjArrayKlass.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/ci/ciObjectFactory.cpp b/hotspot/src/share/vm/ci/ciObjectFactory.cpp index a22fcf62c8c..d257e8ac467 100644 --- a/hotspot/src/share/vm/ci/ciObjectFactory.cpp +++ b/hotspot/src/share/vm/ci/ciObjectFactory.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/ci/ciObjectFactory.hpp b/hotspot/src/share/vm/ci/ciObjectFactory.hpp index ba3d88c1202..c1baca0ee62 100644 --- a/hotspot/src/share/vm/ci/ciObjectFactory.hpp +++ b/hotspot/src/share/vm/ci/ciObjectFactory.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/ci/ciStreams.hpp b/hotspot/src/share/vm/ci/ciStreams.hpp index 92a1a4adf88..091aa1bdf53 100644 --- a/hotspot/src/share/vm/ci/ciStreams.hpp +++ b/hotspot/src/share/vm/ci/ciStreams.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/ci/ciType.cpp b/hotspot/src/share/vm/ci/ciType.cpp index e74dd921804..15c884213bb 100644 --- a/hotspot/src/share/vm/ci/ciType.cpp +++ b/hotspot/src/share/vm/ci/ciType.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/ci/ciType.hpp b/hotspot/src/share/vm/ci/ciType.hpp index 25f79e01263..c3901e4b06f 100644 --- a/hotspot/src/share/vm/ci/ciType.hpp +++ b/hotspot/src/share/vm/ci/ciType.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/ci/ciTypeArray.cpp b/hotspot/src/share/vm/ci/ciTypeArray.cpp index 2d013e21c0e..15113348e21 100644 --- a/hotspot/src/share/vm/ci/ciTypeArray.cpp +++ b/hotspot/src/share/vm/ci/ciTypeArray.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/ci/ciTypeArrayKlass.hpp b/hotspot/src/share/vm/ci/ciTypeArrayKlass.hpp index b88aecb9c6c..607c00cc50b 100644 --- a/hotspot/src/share/vm/ci/ciTypeArrayKlass.hpp +++ b/hotspot/src/share/vm/ci/ciTypeArrayKlass.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/ci/ciTypeFlow.cpp b/hotspot/src/share/vm/ci/ciTypeFlow.cpp index b76dd3d0fe3..48bcaf369a9 100644 --- a/hotspot/src/share/vm/ci/ciTypeFlow.cpp +++ b/hotspot/src/share/vm/ci/ciTypeFlow.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/ci/ciUtilities.hpp b/hotspot/src/share/vm/ci/ciUtilities.hpp index 2032a8f35e1..bba611fc3b6 100644 --- a/hotspot/src/share/vm/ci/ciUtilities.hpp +++ b/hotspot/src/share/vm/ci/ciUtilities.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/classfile/bytecodeAssembler.cpp b/hotspot/src/share/vm/classfile/bytecodeAssembler.cpp index 77b6a9ea747..cbf3baf7945 100644 --- a/hotspot/src/share/vm/classfile/bytecodeAssembler.cpp +++ b/hotspot/src/share/vm/classfile/bytecodeAssembler.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/classfile/classFileStream.cpp b/hotspot/src/share/vm/classfile/classFileStream.cpp index 1c69dfb2ea6..27479acb64a 100644 --- a/hotspot/src/share/vm/classfile/classFileStream.cpp +++ b/hotspot/src/share/vm/classfile/classFileStream.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/classfile/classFileStream.hpp b/hotspot/src/share/vm/classfile/classFileStream.hpp index 19da924abf2..691ed808fec 100644 --- a/hotspot/src/share/vm/classfile/classFileStream.hpp +++ b/hotspot/src/share/vm/classfile/classFileStream.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/classfile/classLoaderData.inline.hpp b/hotspot/src/share/vm/classfile/classLoaderData.inline.hpp index 018b6761c50..11014f25cbb 100644 --- a/hotspot/src/share/vm/classfile/classLoaderData.inline.hpp +++ b/hotspot/src/share/vm/classfile/classLoaderData.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/classfile/vmSymbols.cpp b/hotspot/src/share/vm/classfile/vmSymbols.cpp index cc38c6d2cd6..855c6bdd773 100644 --- a/hotspot/src/share/vm/classfile/vmSymbols.cpp +++ b/hotspot/src/share/vm/classfile/vmSymbols.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/code/compiledIC.hpp b/hotspot/src/share/vm/code/compiledIC.hpp index 598cbe949e2..0d522af63fe 100644 --- a/hotspot/src/share/vm/code/compiledIC.hpp +++ b/hotspot/src/share/vm/code/compiledIC.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/code/compressedStream.cpp b/hotspot/src/share/vm/code/compressedStream.cpp index 82b05fc03f9..1716ffac651 100644 --- a/hotspot/src/share/vm/code/compressedStream.cpp +++ b/hotspot/src/share/vm/code/compressedStream.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/code/debugInfo.hpp b/hotspot/src/share/vm/code/debugInfo.hpp index 7a4f7e2d41d..cf0a9a6d39f 100644 --- a/hotspot/src/share/vm/code/debugInfo.hpp +++ b/hotspot/src/share/vm/code/debugInfo.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/code/icBuffer.hpp b/hotspot/src/share/vm/code/icBuffer.hpp index 47db2d6b269..471706aaa6d 100644 --- a/hotspot/src/share/vm/code/icBuffer.hpp +++ b/hotspot/src/share/vm/code/icBuffer.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/code/relocInfo.cpp b/hotspot/src/share/vm/code/relocInfo.cpp index 4fe6a2e4949..b5cf45e68b6 100644 --- a/hotspot/src/share/vm/code/relocInfo.cpp +++ b/hotspot/src/share/vm/code/relocInfo.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/code/stubs.cpp b/hotspot/src/share/vm/code/stubs.cpp index a826a3550d3..9044c5f8e73 100644 --- a/hotspot/src/share/vm/code/stubs.cpp +++ b/hotspot/src/share/vm/code/stubs.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/code/stubs.hpp b/hotspot/src/share/vm/code/stubs.hpp index 233f43e2dae..045782f397c 100644 --- a/hotspot/src/share/vm/code/stubs.hpp +++ b/hotspot/src/share/vm/code/stubs.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/compiler/abstractCompiler.cpp b/hotspot/src/share/vm/compiler/abstractCompiler.cpp index 3f452a1b53b..0e9c3cf16ee 100644 --- a/hotspot/src/share/vm/compiler/abstractCompiler.cpp +++ b/hotspot/src/share/vm/compiler/abstractCompiler.cpp @@ -1,5 +1,5 @@ // -// Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. // DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. // // This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/compiler/abstractCompiler.hpp b/hotspot/src/share/vm/compiler/abstractCompiler.hpp index d150e8e8085..11aea60a236 100644 --- a/hotspot/src/share/vm/compiler/abstractCompiler.hpp +++ b/hotspot/src/share/vm/compiler/abstractCompiler.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/compiler/compileLog.cpp b/hotspot/src/share/vm/compiler/compileLog.cpp index 2cce602f3ed..bff35b17392 100644 --- a/hotspot/src/share/vm/compiler/compileLog.cpp +++ b/hotspot/src/share/vm/compiler/compileLog.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/compiler/compileLog.hpp b/hotspot/src/share/vm/compiler/compileLog.hpp index 8b740f9f2a2..d0fe07be91f 100644 --- a/hotspot/src/share/vm/compiler/compileLog.hpp +++ b/hotspot/src/share/vm/compiler/compileLog.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/compiler/compilerOracle.cpp b/hotspot/src/share/vm/compiler/compilerOracle.cpp index 8b9141269cc..cb5068dc4c6 100644 --- a/hotspot/src/share/vm/compiler/compilerOracle.cpp +++ b/hotspot/src/share/vm/compiler/compilerOracle.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/compiler/disassembler.cpp b/hotspot/src/share/vm/compiler/disassembler.cpp index 070e0321e08..8495210c384 100644 --- a/hotspot/src/share/vm/compiler/disassembler.cpp +++ b/hotspot/src/share/vm/compiler/disassembler.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/compiler/disassembler.hpp b/hotspot/src/share/vm/compiler/disassembler.hpp index c81666ec25d..639fe69c2ea 100644 --- a/hotspot/src/share/vm/compiler/disassembler.hpp +++ b/hotspot/src/share/vm/compiler/disassembler.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/adaptiveFreeList.cpp b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/adaptiveFreeList.cpp index cfba2376ea8..501f15fb3ad 100644 --- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/adaptiveFreeList.cpp +++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/adaptiveFreeList.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/adaptiveFreeList.hpp b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/adaptiveFreeList.hpp index 7215119aef5..b628cd7f1b4 100644 --- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/adaptiveFreeList.hpp +++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/adaptiveFreeList.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/cmsCollectorPolicy.hpp b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/cmsCollectorPolicy.hpp index d26959f3d9f..378c5e66436 100644 --- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/cmsCollectorPolicy.hpp +++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/cmsCollectorPolicy.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/cmsOopClosures.hpp b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/cmsOopClosures.hpp index f7730287b94..b910dd6e367 100644 --- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/cmsOopClosures.hpp +++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/cmsOopClosures.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.hpp b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.hpp index 74c97e8df9d..e625d3a18e6 100644 --- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.hpp +++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.cpp b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.cpp index f8b0ccb90fe..29939dd86e7 100644 --- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.cpp +++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.hpp b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.hpp index 5c3f01583ad..cbb59df0e77 100644 --- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.hpp +++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/gc_implementation/g1/collectionSetChooser.cpp b/hotspot/src/share/vm/gc_implementation/g1/collectionSetChooser.cpp index ed4b807fb4a..07b92d0fbe5 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/collectionSetChooser.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/collectionSetChooser.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/gc_implementation/g1/collectionSetChooser.hpp b/hotspot/src/share/vm/gc_implementation/g1/collectionSetChooser.hpp index e9f6f8225af..e177fd1e6ae 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/collectionSetChooser.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/collectionSetChooser.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1AllocRegion.hpp b/hotspot/src/share/vm/gc_implementation/g1/g1AllocRegion.hpp index 7823f77e643..3f6e040bf54 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1AllocRegion.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1AllocRegion.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.cpp b/hotspot/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.cpp index 8fe07693d77..c35681f959c 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.inline.hpp b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.inline.hpp index d309e609f4a..498e65f9b8d 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.inline.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1EvacFailure.hpp b/hotspot/src/share/vm/gc_implementation/g1/g1EvacFailure.hpp index 1333f287047..eb64b87126b 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1EvacFailure.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1EvacFailure.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1MonitoringSupport.cpp b/hotspot/src/share/vm/gc_implementation/g1/g1MonitoringSupport.cpp index 01bb43bef45..8bbe4ff94ca 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1MonitoringSupport.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1MonitoringSupport.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.hpp b/hotspot/src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.hpp index a943c9f6db3..0d82c305c24 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/gc_implementation/g1/heapRegionRemSet.hpp b/hotspot/src/share/vm/gc_implementation/g1/heapRegionRemSet.hpp index e40f6195a12..068f64f412e 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/heapRegionRemSet.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/heapRegionRemSet.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/gc_implementation/g1/heapRegionSeq.cpp b/hotspot/src/share/vm/gc_implementation/g1/heapRegionSeq.cpp index eaa8e10f38d..c7b42b5cdc4 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/heapRegionSeq.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/heapRegionSeq.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/gc_implementation/g1/heapRegionSeq.hpp b/hotspot/src/share/vm/gc_implementation/g1/heapRegionSeq.hpp index b0c3eb48a0b..f58c4f94711 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/heapRegionSeq.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/heapRegionSeq.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/gc_implementation/g1/heapRegionSeq.inline.hpp b/hotspot/src/share/vm/gc_implementation/g1/heapRegionSeq.inline.hpp index 96588dea042..0ee93e45b6e 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/heapRegionSeq.inline.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/heapRegionSeq.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/gc_implementation/g1/ptrQueue.cpp b/hotspot/src/share/vm/gc_implementation/g1/ptrQueue.cpp index 8841f011e4a..aa8718e9952 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/ptrQueue.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/ptrQueue.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/gc_implementation/g1/ptrQueue.hpp b/hotspot/src/share/vm/gc_implementation/g1/ptrQueue.hpp index e39e38277c7..37f0d6562f8 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/ptrQueue.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/ptrQueue.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/gc_implementation/g1/sparsePRT.cpp b/hotspot/src/share/vm/gc_implementation/g1/sparsePRT.cpp index a08e8a9801e..627c6803902 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/sparsePRT.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/sparsePRT.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/gc_implementation/g1/sparsePRT.hpp b/hotspot/src/share/vm/gc_implementation/g1/sparsePRT.hpp index 6e821f73bbc..86d5db16298 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/sparsePRT.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/sparsePRT.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/gc_implementation/g1/vmStructs_g1.hpp b/hotspot/src/share/vm/gc_implementation/g1/vmStructs_g1.hpp index 9268eb78ef4..2e4ed2dfb4a 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/vmStructs_g1.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/vmStructs_g1.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/gc_implementation/parNew/parCardTableModRefBS.cpp b/hotspot/src/share/vm/gc_implementation/parNew/parCardTableModRefBS.cpp index 047c463d39e..dd975440033 100644 --- a/hotspot/src/share/vm/gc_implementation/parNew/parCardTableModRefBS.cpp +++ b/hotspot/src/share/vm/gc_implementation/parNew/parCardTableModRefBS.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/adjoiningGenerations.cpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/adjoiningGenerations.cpp index 90bf630fe36..ee9ce8b89d4 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/adjoiningGenerations.cpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/adjoiningGenerations.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/adjoiningGenerations.hpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/adjoiningGenerations.hpp index 950baa1d53f..e80877e2606 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/adjoiningGenerations.hpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/adjoiningGenerations.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/asPSOldGen.cpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/asPSOldGen.cpp index 9d2e8182e06..829cb3cfe47 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/asPSOldGen.cpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/asPSOldGen.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/asPSOldGen.hpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/asPSOldGen.hpp index eaa1f2b5509..56f215230bb 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/asPSOldGen.hpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/asPSOldGen.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/asPSYoungGen.cpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/asPSYoungGen.cpp index 105772487c0..af5893bcc7b 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/asPSYoungGen.cpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/asPSYoungGen.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/gcTaskThread.cpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/gcTaskThread.cpp index 234d5981a24..d8ee14c283d 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/gcTaskThread.cpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/gcTaskThread.cpp @@ -1,6 +1,6 @@ /* - * Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/objectStartArray.cpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/objectStartArray.cpp index a7713b4dcfa..8dfcf1889e7 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/objectStartArray.cpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/objectStartArray.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/pcTasks.hpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/pcTasks.hpp index f966ccf23e2..f530945e350 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/pcTasks.hpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/pcTasks.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psMarkSweep.hpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psMarkSweep.hpp index 7d96afbb4df..68b3de470ea 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psMarkSweep.hpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psMarkSweep.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psMarkSweepDecorator.cpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psMarkSweepDecorator.cpp index 820696af085..ee43825614b 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psMarkSweepDecorator.cpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psMarkSweepDecorator.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psOldGen.cpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psOldGen.cpp index 2cb3b35e091..5e970eed4c4 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psOldGen.cpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psOldGen.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psOldGen.hpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psOldGen.hpp index cf8f574ddfd..90fa0d5632d 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psOldGen.hpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psOldGen.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psTasks.cpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psTasks.cpp index 00e466a3ea4..6470281a992 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psTasks.cpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psTasks.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psTasks.hpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psTasks.hpp index 7ae1f8a0c28..24be15a4912 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psTasks.hpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psTasks.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psYoungGen.cpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psYoungGen.cpp index c1f5c298794..74ac4477c96 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psYoungGen.cpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psYoungGen.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/gc_implementation/shared/allocationStats.cpp b/hotspot/src/share/vm/gc_implementation/shared/allocationStats.cpp index 7cc37fd9453..1cbfb120aa4 100644 --- a/hotspot/src/share/vm/gc_implementation/shared/allocationStats.cpp +++ b/hotspot/src/share/vm/gc_implementation/shared/allocationStats.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/gc_implementation/shared/concurrentGCThread.hpp b/hotspot/src/share/vm/gc_implementation/shared/concurrentGCThread.hpp index 6530d23b624..4172a95cced 100644 --- a/hotspot/src/share/vm/gc_implementation/shared/concurrentGCThread.hpp +++ b/hotspot/src/share/vm/gc_implementation/shared/concurrentGCThread.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/gc_implementation/shared/gSpaceCounters.cpp b/hotspot/src/share/vm/gc_implementation/shared/gSpaceCounters.cpp index 506322de521..b1ae78d3087 100644 --- a/hotspot/src/share/vm/gc_implementation/shared/gSpaceCounters.cpp +++ b/hotspot/src/share/vm/gc_implementation/shared/gSpaceCounters.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/gc_implementation/shared/gSpaceCounters.hpp b/hotspot/src/share/vm/gc_implementation/shared/gSpaceCounters.hpp index c54e773c364..7a5fdf9ee57 100644 --- a/hotspot/src/share/vm/gc_implementation/shared/gSpaceCounters.hpp +++ b/hotspot/src/share/vm/gc_implementation/shared/gSpaceCounters.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/gc_implementation/shared/gcAdaptivePolicyCounters.hpp b/hotspot/src/share/vm/gc_implementation/shared/gcAdaptivePolicyCounters.hpp index 5024ab9e7ab..70e657d2947 100644 --- a/hotspot/src/share/vm/gc_implementation/shared/gcAdaptivePolicyCounters.hpp +++ b/hotspot/src/share/vm/gc_implementation/shared/gcAdaptivePolicyCounters.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/gc_implementation/shared/immutableSpace.cpp b/hotspot/src/share/vm/gc_implementation/shared/immutableSpace.cpp index c844a3e596d..b1563ac8686 100644 --- a/hotspot/src/share/vm/gc_implementation/shared/immutableSpace.cpp +++ b/hotspot/src/share/vm/gc_implementation/shared/immutableSpace.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/gc_implementation/shared/isGCActiveMark.hpp b/hotspot/src/share/vm/gc_implementation/shared/isGCActiveMark.hpp index c56cbafeb2e..dc1041b28dd 100644 --- a/hotspot/src/share/vm/gc_implementation/shared/isGCActiveMark.hpp +++ b/hotspot/src/share/vm/gc_implementation/shared/isGCActiveMark.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/gc_implementation/shared/markSweep.inline.hpp b/hotspot/src/share/vm/gc_implementation/shared/markSweep.inline.hpp index e70e3af1bc1..270d9de71bf 100644 --- a/hotspot/src/share/vm/gc_implementation/shared/markSweep.inline.hpp +++ b/hotspot/src/share/vm/gc_implementation/shared/markSweep.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/gc_implementation/shared/mutableNUMASpace.cpp b/hotspot/src/share/vm/gc_implementation/shared/mutableNUMASpace.cpp index d3d758b79bd..ba7d00d68ba 100644 --- a/hotspot/src/share/vm/gc_implementation/shared/mutableNUMASpace.cpp +++ b/hotspot/src/share/vm/gc_implementation/shared/mutableNUMASpace.cpp @@ -1,6 +1,6 @@ /* - * Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/gc_implementation/shared/mutableNUMASpace.hpp b/hotspot/src/share/vm/gc_implementation/shared/mutableNUMASpace.hpp index 5621c077c38..c79f2465ac1 100644 --- a/hotspot/src/share/vm/gc_implementation/shared/mutableNUMASpace.hpp +++ b/hotspot/src/share/vm/gc_implementation/shared/mutableNUMASpace.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/gc_implementation/shared/mutableSpace.cpp b/hotspot/src/share/vm/gc_implementation/shared/mutableSpace.cpp index d50edac13ca..7e5b5a81125 100644 --- a/hotspot/src/share/vm/gc_implementation/shared/mutableSpace.cpp +++ b/hotspot/src/share/vm/gc_implementation/shared/mutableSpace.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/gc_implementation/shared/parGCAllocBuffer.hpp b/hotspot/src/share/vm/gc_implementation/shared/parGCAllocBuffer.hpp index aced447c9a1..80a4a223cbd 100644 --- a/hotspot/src/share/vm/gc_implementation/shared/parGCAllocBuffer.hpp +++ b/hotspot/src/share/vm/gc_implementation/shared/parGCAllocBuffer.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/gc_implementation/shared/spaceCounters.cpp b/hotspot/src/share/vm/gc_implementation/shared/spaceCounters.cpp index f606e99e9a1..5a20c0dd4b9 100644 --- a/hotspot/src/share/vm/gc_implementation/shared/spaceCounters.cpp +++ b/hotspot/src/share/vm/gc_implementation/shared/spaceCounters.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/gc_implementation/shared/spaceCounters.hpp b/hotspot/src/share/vm/gc_implementation/shared/spaceCounters.hpp index 17302d420b2..e02bc28da34 100644 --- a/hotspot/src/share/vm/gc_implementation/shared/spaceCounters.hpp +++ b/hotspot/src/share/vm/gc_implementation/shared/spaceCounters.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/gc_interface/collectedHeap.inline.hpp b/hotspot/src/share/vm/gc_interface/collectedHeap.inline.hpp index d17b82f2158..0bf322f82dd 100644 --- a/hotspot/src/share/vm/gc_interface/collectedHeap.inline.hpp +++ b/hotspot/src/share/vm/gc_interface/collectedHeap.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/gc_interface/gcCause.cpp b/hotspot/src/share/vm/gc_interface/gcCause.cpp index e7e7e43f440..2588621aa6b 100644 --- a/hotspot/src/share/vm/gc_interface/gcCause.cpp +++ b/hotspot/src/share/vm/gc_interface/gcCause.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/gc_interface/gcCause.hpp b/hotspot/src/share/vm/gc_interface/gcCause.hpp index 06f11882c95..809bab4c46d 100644 --- a/hotspot/src/share/vm/gc_interface/gcCause.hpp +++ b/hotspot/src/share/vm/gc_interface/gcCause.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/interpreter/bytecodeInterpreter.cpp b/hotspot/src/share/vm/interpreter/bytecodeInterpreter.cpp index 538b836f08a..16e8dabba5c 100644 --- a/hotspot/src/share/vm/interpreter/bytecodeInterpreter.cpp +++ b/hotspot/src/share/vm/interpreter/bytecodeInterpreter.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/interpreter/cppInterpreter.hpp b/hotspot/src/share/vm/interpreter/cppInterpreter.hpp index 71f78840b95..0e05c34601e 100644 --- a/hotspot/src/share/vm/interpreter/cppInterpreter.hpp +++ b/hotspot/src/share/vm/interpreter/cppInterpreter.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/interpreter/interpreter.hpp b/hotspot/src/share/vm/interpreter/interpreter.hpp index 1fb4ac5c8ce..cc26b378d73 100644 --- a/hotspot/src/share/vm/interpreter/interpreter.hpp +++ b/hotspot/src/share/vm/interpreter/interpreter.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/interpreter/templateInterpreter.hpp b/hotspot/src/share/vm/interpreter/templateInterpreter.hpp index 838e2e08473..48e0e217091 100644 --- a/hotspot/src/share/vm/interpreter/templateInterpreter.hpp +++ b/hotspot/src/share/vm/interpreter/templateInterpreter.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/interpreter/templateInterpreterGenerator.hpp b/hotspot/src/share/vm/interpreter/templateInterpreterGenerator.hpp index a80caa96409..ee1b0f5acc5 100644 --- a/hotspot/src/share/vm/interpreter/templateInterpreterGenerator.hpp +++ b/hotspot/src/share/vm/interpreter/templateInterpreterGenerator.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/interpreter/templateTable.hpp b/hotspot/src/share/vm/interpreter/templateTable.hpp index 11c875ef32d..d636465a29d 100644 --- a/hotspot/src/share/vm/interpreter/templateTable.hpp +++ b/hotspot/src/share/vm/interpreter/templateTable.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/memory/binaryTreeDictionary.hpp b/hotspot/src/share/vm/memory/binaryTreeDictionary.hpp index 460a4ea29e1..23d7fe0ae24 100644 --- a/hotspot/src/share/vm/memory/binaryTreeDictionary.hpp +++ b/hotspot/src/share/vm/memory/binaryTreeDictionary.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/memory/blockOffsetTable.cpp b/hotspot/src/share/vm/memory/blockOffsetTable.cpp index 841794a0164..c0b35cdde0f 100644 --- a/hotspot/src/share/vm/memory/blockOffsetTable.cpp +++ b/hotspot/src/share/vm/memory/blockOffsetTable.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/memory/freeBlockDictionary.cpp b/hotspot/src/share/vm/memory/freeBlockDictionary.cpp index 7cb2b17b57b..915ec206395 100644 --- a/hotspot/src/share/vm/memory/freeBlockDictionary.cpp +++ b/hotspot/src/share/vm/memory/freeBlockDictionary.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/memory/freeList.cpp b/hotspot/src/share/vm/memory/freeList.cpp index 78785e8809f..1d521885925 100644 --- a/hotspot/src/share/vm/memory/freeList.cpp +++ b/hotspot/src/share/vm/memory/freeList.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/memory/freeList.hpp b/hotspot/src/share/vm/memory/freeList.hpp index e69c8a32f0e..e971471f9c7 100644 --- a/hotspot/src/share/vm/memory/freeList.hpp +++ b/hotspot/src/share/vm/memory/freeList.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/memory/gcLocker.cpp b/hotspot/src/share/vm/memory/gcLocker.cpp index 1b0c94ee171..09fb73bb035 100644 --- a/hotspot/src/share/vm/memory/gcLocker.cpp +++ b/hotspot/src/share/vm/memory/gcLocker.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/memory/gcLocker.hpp b/hotspot/src/share/vm/memory/gcLocker.hpp index 45b8a8f89e7..60bebdf0fa4 100644 --- a/hotspot/src/share/vm/memory/gcLocker.hpp +++ b/hotspot/src/share/vm/memory/gcLocker.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/memory/genRemSet.cpp b/hotspot/src/share/vm/memory/genRemSet.cpp index c496deafc03..bb3149f5a85 100644 --- a/hotspot/src/share/vm/memory/genRemSet.cpp +++ b/hotspot/src/share/vm/memory/genRemSet.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/memory/genRemSet.hpp b/hotspot/src/share/vm/memory/genRemSet.hpp index 44a43540769..a275320c8da 100644 --- a/hotspot/src/share/vm/memory/genRemSet.hpp +++ b/hotspot/src/share/vm/memory/genRemSet.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/memory/generation.hpp b/hotspot/src/share/vm/memory/generation.hpp index 290cce583a0..e3bceb4446c 100644 --- a/hotspot/src/share/vm/memory/generation.hpp +++ b/hotspot/src/share/vm/memory/generation.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/memory/generationSpec.cpp b/hotspot/src/share/vm/memory/generationSpec.cpp index d97a56fbbcc..128387cc952 100644 --- a/hotspot/src/share/vm/memory/generationSpec.cpp +++ b/hotspot/src/share/vm/memory/generationSpec.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/memory/heap.hpp b/hotspot/src/share/vm/memory/heap.hpp index 725592e67be..29e76d7dc62 100644 --- a/hotspot/src/share/vm/memory/heap.hpp +++ b/hotspot/src/share/vm/memory/heap.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/memory/iterator.cpp b/hotspot/src/share/vm/memory/iterator.cpp index 545ab921363..f69eb4ed75d 100644 --- a/hotspot/src/share/vm/memory/iterator.cpp +++ b/hotspot/src/share/vm/memory/iterator.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/memory/iterator.hpp b/hotspot/src/share/vm/memory/iterator.hpp index e590a3e9be2..dd98234d31e 100644 --- a/hotspot/src/share/vm/memory/iterator.hpp +++ b/hotspot/src/share/vm/memory/iterator.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/memory/metaspaceCounters.cpp b/hotspot/src/share/vm/memory/metaspaceCounters.cpp index 60e26b8c714..3ad462d081d 100644 --- a/hotspot/src/share/vm/memory/metaspaceCounters.cpp +++ b/hotspot/src/share/vm/memory/metaspaceCounters.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/memory/metaspaceCounters.hpp b/hotspot/src/share/vm/memory/metaspaceCounters.hpp index 0fa991291a1..4db551a1e34 100644 --- a/hotspot/src/share/vm/memory/metaspaceCounters.hpp +++ b/hotspot/src/share/vm/memory/metaspaceCounters.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/memory/sharedHeap.hpp b/hotspot/src/share/vm/memory/sharedHeap.hpp index cd810c036d4..f5d9e05f0cf 100644 --- a/hotspot/src/share/vm/memory/sharedHeap.hpp +++ b/hotspot/src/share/vm/memory/sharedHeap.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/memory/space.cpp b/hotspot/src/share/vm/memory/space.cpp index 7eb462ecccc..8f844df81f1 100644 --- a/hotspot/src/share/vm/memory/space.cpp +++ b/hotspot/src/share/vm/memory/space.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/memory/space.hpp b/hotspot/src/share/vm/memory/space.hpp index eb1e209a850..04efc7da593 100644 --- a/hotspot/src/share/vm/memory/space.hpp +++ b/hotspot/src/share/vm/memory/space.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/memory/specialized_oop_closures.hpp b/hotspot/src/share/vm/memory/specialized_oop_closures.hpp index 2aed587f054..24986b95089 100644 --- a/hotspot/src/share/vm/memory/specialized_oop_closures.hpp +++ b/hotspot/src/share/vm/memory/specialized_oop_closures.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/memory/tenuredGeneration.cpp b/hotspot/src/share/vm/memory/tenuredGeneration.cpp index ac1e9316409..a18d6813e2f 100644 --- a/hotspot/src/share/vm/memory/tenuredGeneration.cpp +++ b/hotspot/src/share/vm/memory/tenuredGeneration.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/memory/tenuredGeneration.hpp b/hotspot/src/share/vm/memory/tenuredGeneration.hpp index e6e9b79873c..94a4330aca1 100644 --- a/hotspot/src/share/vm/memory/tenuredGeneration.hpp +++ b/hotspot/src/share/vm/memory/tenuredGeneration.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/oops/arrayKlass.cpp b/hotspot/src/share/vm/oops/arrayKlass.cpp index 6e04c3ac145..9e40206c253 100644 --- a/hotspot/src/share/vm/oops/arrayKlass.cpp +++ b/hotspot/src/share/vm/oops/arrayKlass.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/oops/arrayOop.hpp b/hotspot/src/share/vm/oops/arrayOop.hpp index 0e5ceffe35a..0cc8f2e448d 100644 --- a/hotspot/src/share/vm/oops/arrayOop.hpp +++ b/hotspot/src/share/vm/oops/arrayOop.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/oops/compiledICHolder.cpp b/hotspot/src/share/vm/oops/compiledICHolder.cpp index 2b2cd2ae646..72268079296 100644 --- a/hotspot/src/share/vm/oops/compiledICHolder.cpp +++ b/hotspot/src/share/vm/oops/compiledICHolder.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/oops/fieldInfo.hpp b/hotspot/src/share/vm/oops/fieldInfo.hpp index 6763c42d127..40a192bdcc0 100644 --- a/hotspot/src/share/vm/oops/fieldInfo.hpp +++ b/hotspot/src/share/vm/oops/fieldInfo.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/oops/instanceClassLoaderKlass.cpp b/hotspot/src/share/vm/oops/instanceClassLoaderKlass.cpp index e57a0b77197..a92167a9a7d 100644 --- a/hotspot/src/share/vm/oops/instanceClassLoaderKlass.cpp +++ b/hotspot/src/share/vm/oops/instanceClassLoaderKlass.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/oops/instanceClassLoaderKlass.hpp b/hotspot/src/share/vm/oops/instanceClassLoaderKlass.hpp index d93f2a5c32a..309ebf96c19 100644 --- a/hotspot/src/share/vm/oops/instanceClassLoaderKlass.hpp +++ b/hotspot/src/share/vm/oops/instanceClassLoaderKlass.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/oops/instanceMirrorKlass.cpp b/hotspot/src/share/vm/oops/instanceMirrorKlass.cpp index 0e903b39a5e..70c2ca19132 100644 --- a/hotspot/src/share/vm/oops/instanceMirrorKlass.cpp +++ b/hotspot/src/share/vm/oops/instanceMirrorKlass.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/oops/instanceOop.hpp b/hotspot/src/share/vm/oops/instanceOop.hpp index bdac1992e6f..5186aa3b817 100644 --- a/hotspot/src/share/vm/oops/instanceOop.hpp +++ b/hotspot/src/share/vm/oops/instanceOop.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/oops/instanceRefKlass.hpp b/hotspot/src/share/vm/oops/instanceRefKlass.hpp index d8771608f73..3140977b471 100644 --- a/hotspot/src/share/vm/oops/instanceRefKlass.hpp +++ b/hotspot/src/share/vm/oops/instanceRefKlass.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/oops/klassPS.hpp b/hotspot/src/share/vm/oops/klassPS.hpp index 5fb17b6e801..a92f8738a78 100644 --- a/hotspot/src/share/vm/oops/klassPS.hpp +++ b/hotspot/src/share/vm/oops/klassPS.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/oops/objArrayKlass.cpp b/hotspot/src/share/vm/oops/objArrayKlass.cpp index 4631fdd79e2..7294ebe9adb 100644 --- a/hotspot/src/share/vm/oops/objArrayKlass.cpp +++ b/hotspot/src/share/vm/oops/objArrayKlass.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/oops/objArrayKlass.hpp b/hotspot/src/share/vm/oops/objArrayKlass.hpp index d56a3de846d..af06fd42084 100644 --- a/hotspot/src/share/vm/oops/objArrayKlass.hpp +++ b/hotspot/src/share/vm/oops/objArrayKlass.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/oops/objArrayKlass.inline.hpp b/hotspot/src/share/vm/oops/objArrayKlass.inline.hpp index 23e809a7e0f..e082df55ab4 100644 --- a/hotspot/src/share/vm/oops/objArrayKlass.inline.hpp +++ b/hotspot/src/share/vm/oops/objArrayKlass.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/oops/oop.pcgc.inline.hpp b/hotspot/src/share/vm/oops/oop.pcgc.inline.hpp index 178c8f461ff..596bbc6d123 100644 --- a/hotspot/src/share/vm/oops/oop.pcgc.inline.hpp +++ b/hotspot/src/share/vm/oops/oop.pcgc.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/oops/oop.psgc.inline.hpp b/hotspot/src/share/vm/oops/oop.psgc.inline.hpp index ea184f36339..b959ad531be 100644 --- a/hotspot/src/share/vm/oops/oop.psgc.inline.hpp +++ b/hotspot/src/share/vm/oops/oop.psgc.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/oops/typeArrayKlass.cpp b/hotspot/src/share/vm/oops/typeArrayKlass.cpp index 56863a02469..8d9c6728cf8 100644 --- a/hotspot/src/share/vm/oops/typeArrayKlass.cpp +++ b/hotspot/src/share/vm/oops/typeArrayKlass.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/oops/typeArrayKlass.hpp b/hotspot/src/share/vm/oops/typeArrayKlass.hpp index f8bf2ac74c0..cf363fc76c2 100644 --- a/hotspot/src/share/vm/oops/typeArrayKlass.hpp +++ b/hotspot/src/share/vm/oops/typeArrayKlass.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/opto/block.cpp b/hotspot/src/share/vm/opto/block.cpp index fade19bdb6b..f25e5480e43 100644 --- a/hotspot/src/share/vm/opto/block.cpp +++ b/hotspot/src/share/vm/opto/block.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/opto/block.hpp b/hotspot/src/share/vm/opto/block.hpp index e1574691849..dbb3cfb5039 100644 --- a/hotspot/src/share/vm/opto/block.hpp +++ b/hotspot/src/share/vm/opto/block.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/opto/buildOopMap.cpp b/hotspot/src/share/vm/opto/buildOopMap.cpp index e63be38ed11..9f2dd674e2f 100644 --- a/hotspot/src/share/vm/opto/buildOopMap.cpp +++ b/hotspot/src/share/vm/opto/buildOopMap.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/opto/bytecodeInfo.cpp b/hotspot/src/share/vm/opto/bytecodeInfo.cpp index 1e875c42c50..3e7b7a57fc9 100644 --- a/hotspot/src/share/vm/opto/bytecodeInfo.cpp +++ b/hotspot/src/share/vm/opto/bytecodeInfo.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/opto/c2compiler.cpp b/hotspot/src/share/vm/opto/c2compiler.cpp index 91653bd3ce3..7fa7918263e 100644 --- a/hotspot/src/share/vm/opto/c2compiler.cpp +++ b/hotspot/src/share/vm/opto/c2compiler.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/opto/c2compiler.hpp b/hotspot/src/share/vm/opto/c2compiler.hpp index 48ccc1b5105..635153d1dbf 100644 --- a/hotspot/src/share/vm/opto/c2compiler.hpp +++ b/hotspot/src/share/vm/opto/c2compiler.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/opto/callGenerator.cpp b/hotspot/src/share/vm/opto/callGenerator.cpp index adc27ac02e4..6e9c98d3436 100644 --- a/hotspot/src/share/vm/opto/callGenerator.cpp +++ b/hotspot/src/share/vm/opto/callGenerator.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/opto/callnode.cpp b/hotspot/src/share/vm/opto/callnode.cpp index 594b650decb..3c07fc9a62a 100644 --- a/hotspot/src/share/vm/opto/callnode.cpp +++ b/hotspot/src/share/vm/opto/callnode.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/opto/chaitin.hpp b/hotspot/src/share/vm/opto/chaitin.hpp index da98d16e29c..b188cc9bbf8 100644 --- a/hotspot/src/share/vm/opto/chaitin.hpp +++ b/hotspot/src/share/vm/opto/chaitin.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/opto/classes.cpp b/hotspot/src/share/vm/opto/classes.cpp index 78529511f31..dadc72726e3 100644 --- a/hotspot/src/share/vm/opto/classes.cpp +++ b/hotspot/src/share/vm/opto/classes.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/opto/classes.hpp b/hotspot/src/share/vm/opto/classes.hpp index 002d2db636d..7390c915da9 100644 --- a/hotspot/src/share/vm/opto/classes.hpp +++ b/hotspot/src/share/vm/opto/classes.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/opto/coalesce.hpp b/hotspot/src/share/vm/opto/coalesce.hpp index 3a361b25f11..41d4d8fe3e2 100644 --- a/hotspot/src/share/vm/opto/coalesce.hpp +++ b/hotspot/src/share/vm/opto/coalesce.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/opto/connode.cpp b/hotspot/src/share/vm/opto/connode.cpp index b59025ad4f3..948ff7b4632 100644 --- a/hotspot/src/share/vm/opto/connode.cpp +++ b/hotspot/src/share/vm/opto/connode.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/opto/doCall.cpp b/hotspot/src/share/vm/opto/doCall.cpp index 6768968bebd..223f7da3655 100644 --- a/hotspot/src/share/vm/opto/doCall.cpp +++ b/hotspot/src/share/vm/opto/doCall.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/opto/domgraph.cpp b/hotspot/src/share/vm/opto/domgraph.cpp index 5e1886c24f0..a7fa0532763 100644 --- a/hotspot/src/share/vm/opto/domgraph.cpp +++ b/hotspot/src/share/vm/opto/domgraph.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/opto/gcm.cpp b/hotspot/src/share/vm/opto/gcm.cpp index db60d4d1e60..6d7164347b4 100644 --- a/hotspot/src/share/vm/opto/gcm.cpp +++ b/hotspot/src/share/vm/opto/gcm.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/opto/generateOptoStub.cpp b/hotspot/src/share/vm/opto/generateOptoStub.cpp index 9b64d1f10e2..6721c9dcda2 100644 --- a/hotspot/src/share/vm/opto/generateOptoStub.cpp +++ b/hotspot/src/share/vm/opto/generateOptoStub.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/opto/graphKit.cpp b/hotspot/src/share/vm/opto/graphKit.cpp index 8c5e05c3ac7..c30cdc12c82 100644 --- a/hotspot/src/share/vm/opto/graphKit.cpp +++ b/hotspot/src/share/vm/opto/graphKit.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/opto/graphKit.hpp b/hotspot/src/share/vm/opto/graphKit.hpp index 75e01784e4c..cfd943698c4 100644 --- a/hotspot/src/share/vm/opto/graphKit.hpp +++ b/hotspot/src/share/vm/opto/graphKit.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/opto/idealKit.cpp b/hotspot/src/share/vm/opto/idealKit.cpp index 90eff2bb5d7..504af59e05a 100644 --- a/hotspot/src/share/vm/opto/idealKit.cpp +++ b/hotspot/src/share/vm/opto/idealKit.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/opto/idealKit.hpp b/hotspot/src/share/vm/opto/idealKit.hpp index 16833c0cbfe..132a310d5d4 100644 --- a/hotspot/src/share/vm/opto/idealKit.hpp +++ b/hotspot/src/share/vm/opto/idealKit.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/opto/ifg.cpp b/hotspot/src/share/vm/opto/ifg.cpp index 89ed5b33102..52a6cecce90 100644 --- a/hotspot/src/share/vm/opto/ifg.cpp +++ b/hotspot/src/share/vm/opto/ifg.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/opto/ifnode.cpp b/hotspot/src/share/vm/opto/ifnode.cpp index 029a9f64adc..6e61a1f98bc 100644 --- a/hotspot/src/share/vm/opto/ifnode.cpp +++ b/hotspot/src/share/vm/opto/ifnode.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/opto/lcm.cpp b/hotspot/src/share/vm/opto/lcm.cpp index c497abdb578..bdf076aa341 100644 --- a/hotspot/src/share/vm/opto/lcm.cpp +++ b/hotspot/src/share/vm/opto/lcm.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/opto/live.cpp b/hotspot/src/share/vm/opto/live.cpp index 02bbb1b97ab..787f5ab88c3 100644 --- a/hotspot/src/share/vm/opto/live.cpp +++ b/hotspot/src/share/vm/opto/live.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/opto/live.hpp b/hotspot/src/share/vm/opto/live.hpp index e449bb3f3a6..343c5c6f727 100644 --- a/hotspot/src/share/vm/opto/live.hpp +++ b/hotspot/src/share/vm/opto/live.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/opto/loopPredicate.cpp b/hotspot/src/share/vm/opto/loopPredicate.cpp index 411226acffa..2fbfba0f48c 100644 --- a/hotspot/src/share/vm/opto/loopPredicate.cpp +++ b/hotspot/src/share/vm/opto/loopPredicate.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/opto/loopTransform.cpp b/hotspot/src/share/vm/opto/loopTransform.cpp index 75f35b7d896..af31a9ce1fb 100644 --- a/hotspot/src/share/vm/opto/loopTransform.cpp +++ b/hotspot/src/share/vm/opto/loopTransform.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/opto/loopnode.hpp b/hotspot/src/share/vm/opto/loopnode.hpp index 6d4933893bb..59915ffed6f 100644 --- a/hotspot/src/share/vm/opto/loopnode.hpp +++ b/hotspot/src/share/vm/opto/loopnode.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/opto/loopopts.cpp b/hotspot/src/share/vm/opto/loopopts.cpp index a7bf3ad28e8..ba19f7493cc 100644 --- a/hotspot/src/share/vm/opto/loopopts.cpp +++ b/hotspot/src/share/vm/opto/loopopts.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/opto/macro.cpp b/hotspot/src/share/vm/opto/macro.cpp index 06bf9e608c0..325b014ea08 100644 --- a/hotspot/src/share/vm/opto/macro.cpp +++ b/hotspot/src/share/vm/opto/macro.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/opto/macro.hpp b/hotspot/src/share/vm/opto/macro.hpp index 7a72316dfc8..5e2e97c7e3c 100644 --- a/hotspot/src/share/vm/opto/macro.hpp +++ b/hotspot/src/share/vm/opto/macro.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/opto/matcher.hpp b/hotspot/src/share/vm/opto/matcher.hpp index 1131d09f1d5..f840d0c6edc 100644 --- a/hotspot/src/share/vm/opto/matcher.hpp +++ b/hotspot/src/share/vm/opto/matcher.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/opto/memnode.cpp b/hotspot/src/share/vm/opto/memnode.cpp index d72340bf6dd..14d347b8e69 100644 --- a/hotspot/src/share/vm/opto/memnode.cpp +++ b/hotspot/src/share/vm/opto/memnode.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/opto/memnode.hpp b/hotspot/src/share/vm/opto/memnode.hpp index 88a05ad134d..3a35be5dba3 100644 --- a/hotspot/src/share/vm/opto/memnode.hpp +++ b/hotspot/src/share/vm/opto/memnode.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/opto/multnode.cpp b/hotspot/src/share/vm/opto/multnode.cpp index bb3357abcf0..106a0086c63 100644 --- a/hotspot/src/share/vm/opto/multnode.cpp +++ b/hotspot/src/share/vm/opto/multnode.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/opto/multnode.hpp b/hotspot/src/share/vm/opto/multnode.hpp index e3866c8b9a1..6a0aea721b8 100644 --- a/hotspot/src/share/vm/opto/multnode.hpp +++ b/hotspot/src/share/vm/opto/multnode.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/opto/node.cpp b/hotspot/src/share/vm/opto/node.cpp index 1df5eb51a8c..06e74b6d0f2 100644 --- a/hotspot/src/share/vm/opto/node.cpp +++ b/hotspot/src/share/vm/opto/node.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/opto/optoreg.hpp b/hotspot/src/share/vm/opto/optoreg.hpp index a21311b9c6d..0d45c7a50ab 100644 --- a/hotspot/src/share/vm/opto/optoreg.hpp +++ b/hotspot/src/share/vm/opto/optoreg.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/opto/output.cpp b/hotspot/src/share/vm/opto/output.cpp index 6232c41f0b1..f362669b5ec 100644 --- a/hotspot/src/share/vm/opto/output.cpp +++ b/hotspot/src/share/vm/opto/output.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/opto/output.hpp b/hotspot/src/share/vm/opto/output.hpp index 5fb68c6828a..6758d180689 100644 --- a/hotspot/src/share/vm/opto/output.hpp +++ b/hotspot/src/share/vm/opto/output.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/opto/parse.hpp b/hotspot/src/share/vm/opto/parse.hpp index f60e6a540ea..1e367d41c37 100644 --- a/hotspot/src/share/vm/opto/parse.hpp +++ b/hotspot/src/share/vm/opto/parse.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/opto/parse1.cpp b/hotspot/src/share/vm/opto/parse1.cpp index 808f64d2d9a..de7188ff871 100644 --- a/hotspot/src/share/vm/opto/parse1.cpp +++ b/hotspot/src/share/vm/opto/parse1.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/opto/parse2.cpp b/hotspot/src/share/vm/opto/parse2.cpp index 74119ef9f51..75746213087 100644 --- a/hotspot/src/share/vm/opto/parse2.cpp +++ b/hotspot/src/share/vm/opto/parse2.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/opto/phase.cpp b/hotspot/src/share/vm/opto/phase.cpp index 5359301575d..24fdb45ca7c 100644 --- a/hotspot/src/share/vm/opto/phase.cpp +++ b/hotspot/src/share/vm/opto/phase.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/opto/phase.hpp b/hotspot/src/share/vm/opto/phase.hpp index 582a126db36..1bc68a130f5 100644 --- a/hotspot/src/share/vm/opto/phase.hpp +++ b/hotspot/src/share/vm/opto/phase.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/opto/phaseX.cpp b/hotspot/src/share/vm/opto/phaseX.cpp index 15b9b778883..3e6ab4eafff 100644 --- a/hotspot/src/share/vm/opto/phaseX.cpp +++ b/hotspot/src/share/vm/opto/phaseX.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/opto/phaseX.hpp b/hotspot/src/share/vm/opto/phaseX.hpp index 7f39e538154..d03d47d95bc 100644 --- a/hotspot/src/share/vm/opto/phaseX.hpp +++ b/hotspot/src/share/vm/opto/phaseX.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/opto/postaloc.cpp b/hotspot/src/share/vm/opto/postaloc.cpp index 2ad809d1a58..86078979af1 100644 --- a/hotspot/src/share/vm/opto/postaloc.cpp +++ b/hotspot/src/share/vm/opto/postaloc.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/opto/reg_split.cpp b/hotspot/src/share/vm/opto/reg_split.cpp index 842048f46f5..cfcecadd338 100644 --- a/hotspot/src/share/vm/opto/reg_split.cpp +++ b/hotspot/src/share/vm/opto/reg_split.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/opto/regalloc.cpp b/hotspot/src/share/vm/opto/regalloc.cpp index 7ac02165662..a4844367e43 100644 --- a/hotspot/src/share/vm/opto/regalloc.cpp +++ b/hotspot/src/share/vm/opto/regalloc.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/opto/regalloc.hpp b/hotspot/src/share/vm/opto/regalloc.hpp index 9bea94be5de..3aea8194783 100644 --- a/hotspot/src/share/vm/opto/regalloc.hpp +++ b/hotspot/src/share/vm/opto/regalloc.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/opto/subnode.cpp b/hotspot/src/share/vm/opto/subnode.cpp index 4e2c8b7aef6..fcbead264af 100644 --- a/hotspot/src/share/vm/opto/subnode.cpp +++ b/hotspot/src/share/vm/opto/subnode.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/opto/subnode.hpp b/hotspot/src/share/vm/opto/subnode.hpp index 47eb5c65c05..56ee308d982 100644 --- a/hotspot/src/share/vm/opto/subnode.hpp +++ b/hotspot/src/share/vm/opto/subnode.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/opto/superword.cpp b/hotspot/src/share/vm/opto/superword.cpp index 90f24189fe4..96c81bd999c 100644 --- a/hotspot/src/share/vm/opto/superword.cpp +++ b/hotspot/src/share/vm/opto/superword.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/opto/superword.hpp b/hotspot/src/share/vm/opto/superword.hpp index 050d7588c3d..5081586474d 100644 --- a/hotspot/src/share/vm/opto/superword.hpp +++ b/hotspot/src/share/vm/opto/superword.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/precompiled/precompiled.hpp b/hotspot/src/share/vm/precompiled/precompiled.hpp index d4be22e6cd0..4026c0eb29f 100644 --- a/hotspot/src/share/vm/precompiled/precompiled.hpp +++ b/hotspot/src/share/vm/precompiled/precompiled.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/prims/forte.cpp b/hotspot/src/share/vm/prims/forte.cpp index 4b1fbebc137..53f817bd683 100644 --- a/hotspot/src/share/vm/prims/forte.cpp +++ b/hotspot/src/share/vm/prims/forte.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/prims/jniCheck.cpp b/hotspot/src/share/vm/prims/jniCheck.cpp index b829d14dd23..4313b4bf0ac 100644 --- a/hotspot/src/share/vm/prims/jniCheck.cpp +++ b/hotspot/src/share/vm/prims/jniCheck.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/prims/jvm_misc.hpp b/hotspot/src/share/vm/prims/jvm_misc.hpp index 266ed8690db..39b2d7199d4 100644 --- a/hotspot/src/share/vm/prims/jvm_misc.hpp +++ b/hotspot/src/share/vm/prims/jvm_misc.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/prims/jvmtiClassFileReconstituter.cpp b/hotspot/src/share/vm/prims/jvmtiClassFileReconstituter.cpp index c931e3f8e78..95129c06b9a 100644 --- a/hotspot/src/share/vm/prims/jvmtiClassFileReconstituter.cpp +++ b/hotspot/src/share/vm/prims/jvmtiClassFileReconstituter.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/prims/jvmtiClassFileReconstituter.hpp b/hotspot/src/share/vm/prims/jvmtiClassFileReconstituter.hpp index d9d475b11ad..4170cf9155d 100644 --- a/hotspot/src/share/vm/prims/jvmtiClassFileReconstituter.hpp +++ b/hotspot/src/share/vm/prims/jvmtiClassFileReconstituter.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/prims/jvmtiEnter.xsl b/hotspot/src/share/vm/prims/jvmtiEnter.xsl index f31bd5143b7..ff609eee2f9 100644 --- a/hotspot/src/share/vm/prims/jvmtiEnter.xsl +++ b/hotspot/src/share/vm/prims/jvmtiEnter.xsl @@ -1,6 +1,6 @@ - - + + @@ -328,6 +331,9 @@ grant codeBase "file:/${basedir}/test/script/basic/classloader.js" { verbose="${testng.verbose}" haltonfailure="true" useDefaultListeners="false" listeners="${testng.listeners}" workingDir="${basedir}"> + + + @@ -360,6 +366,9 @@ grant codeBase "file:/${basedir}/test/script/basic/classloader.js" { verbose="${testng.verbose}" haltonfailure="true" useDefaultListeners="false" listeners="${testng.listeners}" workingDir="${basedir}"> + + + diff --git a/nashorn/make/project.properties b/nashorn/make/project.properties index 2ad619bef06..b8f07bfe324 100644 --- a/nashorn/make/project.properties +++ b/nashorn/make/project.properties @@ -71,6 +71,9 @@ fxshell.classes.dir = ${build.dir}/fxshell/classes fxshell.dir = tools/fxshell fxshell.jar = ${dist.dir}/nashornfx.jar +# configuration for java flight recorder +run.test.jvmargs.jfr=-XX:+UnlockCommercialFeatures -XX:+FlightRecorder -XX:FlightRecorderOptions=defaultrecording=true,disk=true,dumponexit=true,dumponexitpath=${build.dir},stackdepth=128 + # jars refererred file.reference.testng.jar=test/lib/testng.jar From 92e64d3a0d7eb2ab0d55ba5c2b3c4e0f1cc376dc Mon Sep 17 00:00:00 2001 From: Michael McMahon Date: Tue, 26 Nov 2013 10:06:57 +0000 Subject: [PATCH 100/377] 8028293: Check local configuration for actual ephemeral port range Reviewed-by: alanb, chegar, smarks --- jdk/make/lib/NetworkingLibraries.gmk | 1 + jdk/make/mapfiles/libnet/mapfile-vers | 2 + .../classes/java/net/SocketPermission.java | 13 +- .../sun/rmi/registry/RegistryImpl.java | 21 ++- .../share/lib/security/java.security-linux | 17 --- .../share/lib/security/java.security-macosx | 19 --- .../share/lib/security/java.security-solaris | 18 --- .../share/lib/security/java.security-windows | 17 --- .../solaris/classes/sun/net/PortConfig.java | 89 +++++++++++++ jdk/src/solaris/native/java/net/net_util_md.c | 9 +- jdk/src/solaris/native/java/net/net_util_md.h | 3 + jdk/src/solaris/native/sun/net/portconfig.c | 123 ++++++++++++++++++ .../windows/classes/sun/net/PortConfig.java | 73 +++++++++++ jdk/src/windows/native/sun/net/portconfig.c | 107 +++++++++++++++ .../RmidViaInheritedChannel.java | 11 ++ .../java/rmi/registry/readTest/readTest.sh | 24 +++- .../java/rmi/testlibrary/TestLibrary.java | 14 +- 17 files changed, 459 insertions(+), 102 deletions(-) create mode 100644 jdk/src/solaris/classes/sun/net/PortConfig.java create mode 100644 jdk/src/solaris/native/sun/net/portconfig.c create mode 100644 jdk/src/windows/classes/sun/net/PortConfig.java create mode 100644 jdk/src/windows/native/sun/net/portconfig.c diff --git a/jdk/make/lib/NetworkingLibraries.gmk b/jdk/make/lib/NetworkingLibraries.gmk index 9f5173ece29..490845eec33 100644 --- a/jdk/make/lib/NetworkingLibraries.gmk +++ b/jdk/make/lib/NetworkingLibraries.gmk @@ -25,6 +25,7 @@ LIBNET_SRC_DIRS := $(JDK_TOPDIR)/src/share/native/java/net \ $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/java/net \ + $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/net/ \ $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/net/dns \ $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/net/spi diff --git a/jdk/make/mapfiles/libnet/mapfile-vers b/jdk/make/mapfiles/libnet/mapfile-vers index 98b6db30117..cdd98f8cce6 100644 --- a/jdk/make/mapfiles/libnet/mapfile-vers +++ b/jdk/make/mapfiles/libnet/mapfile-vers @@ -86,6 +86,8 @@ SUNWprivate_1.1 { Java_java_net_PlainSocketImpl_socketConnect; Java_java_net_PlainDatagramSocketImpl_getTimeToLive; Java_java_net_PlainDatagramSocketImpl_setTimeToLive; + Java_sun_net_PortConfig_getUpper0; + Java_sun_net_PortConfig_getLower0; Java_sun_net_dns_ResolverConfigurationImpl_localDomain0; Java_sun_net_dns_ResolverConfigurationImpl_fallbackDomain0; Java_sun_net_sdp_SdpSupport_convert0; diff --git a/jdk/src/share/classes/java/net/SocketPermission.java b/jdk/src/share/classes/java/net/SocketPermission.java index 88f8a5a4861..70b004af3bc 100644 --- a/jdk/src/share/classes/java/net/SocketPermission.java +++ b/jdk/src/share/classes/java/net/SocketPermission.java @@ -44,6 +44,7 @@ import java.io.ObjectInputStream; import java.io.IOException; import sun.net.util.IPAddressUtil; import sun.net.RegisteredDomain; +import sun.net.PortConfig; import sun.security.util.SecurityConstants; import sun.security.util.Debug; @@ -1217,17 +1218,9 @@ public final class SocketPermission extends Permission if (val != -1) { return val; } else { - String prop = Security.getProperty( - "network.ephemeralPortRange."+suffix - ); - try { - val = Integer.parseInt(prop); - } catch (NumberFormatException e) { - // shouldn't happen - return defval; - } + return suffix.equals("low") ? + PortConfig.getLower() : PortConfig.getUpper(); } - return val; } } ); diff --git a/jdk/src/share/classes/sun/rmi/registry/RegistryImpl.java b/jdk/src/share/classes/sun/rmi/registry/RegistryImpl.java index 8ddbe5cf3bf..f8280552071 100644 --- a/jdk/src/share/classes/sun/rmi/registry/RegistryImpl.java +++ b/jdk/src/share/classes/sun/rmi/registry/RegistryImpl.java @@ -119,8 +119,23 @@ public class RegistryImpl extends java.rmi.server.RemoteServer public RegistryImpl(int port) throws RemoteException { - LiveRef lref = new LiveRef(id, port); - setup(new UnicastServerRef(lref)); + if (port == Registry.REGISTRY_PORT && System.getSecurityManager() != null) { + // grant permission for default port only. + try { + AccessController.doPrivileged(new PrivilegedExceptionAction() { + public Void run() throws RemoteException { + LiveRef lref = new LiveRef(id, port); + setup(new UnicastServerRef(lref)); + return null; + } + }, null, new SocketPermission("localhost:"+port, "listen,accept")); + } catch (PrivilegedActionException pae) { + throw (RemoteException)pae.getException(); + } + } else { + LiveRef lref = new LiveRef(id, port); + setup(new UnicastServerRef(lref)); + } } /* @@ -419,7 +434,7 @@ public class RegistryImpl extends java.rmi.server.RemoteServer * related classes themselves are more tightly limited by RMI. */ perms.add(new SocketPermission("*", "connect,accept")); - perms.add(new SocketPermission("localhost:"+port, "listen,accept")); + perms.add(new SocketPermission("localhost:"+port, "listen,accept")); perms.add(new RuntimePermission("accessClassInPackage.sun.jvmstat.*")); perms.add(new RuntimePermission("accessClassInPackage.sun.jvm.hotspot.*")); diff --git a/jdk/src/share/lib/security/java.security-linux b/jdk/src/share/lib/security/java.security-linux index ed8ba606035..d31a1e37005 100644 --- a/jdk/src/share/lib/security/java.security-linux +++ b/jdk/src/share/lib/security/java.security-linux @@ -496,20 +496,3 @@ jdk.certpath.disabledAlgorithms=MD2, RSA keySize < 1024 # # Example: # jdk.tls.disabledAlgorithms=MD5, SHA1, DSA, RSA keySize < 2048 - -# -# Default ephemeral port ranges (operating system specific) -# used by java.net.SocketPermission to interpret the meaning of the special -# port value zero, as in the following example: -# -# SocketPermission("localhost:0" , "listen"); -# -# These can be overridden by the system properties: -# -# jdk.net.ephemeralPortRange.low and -# jdk.net.ephemeralPortRange.high -# -# respectively. -# -network.ephemeralPortRange.low=32768 -network.ephemeralPortRange.high=65535 diff --git a/jdk/src/share/lib/security/java.security-macosx b/jdk/src/share/lib/security/java.security-macosx index 1f3ac7a5771..78ef913403e 100644 --- a/jdk/src/share/lib/security/java.security-macosx +++ b/jdk/src/share/lib/security/java.security-macosx @@ -497,22 +497,3 @@ jdk.certpath.disabledAlgorithms=MD2, RSA keySize < 1024 # # Example: # jdk.tls.disabledAlgorithms=MD5, SHA1, DSA, RSA keySize < 2048 - - -# -# Default ephemeral port ranges (operating system specific) -# used by java.net.SocketPermission to interpret the meaning of the special -# port value zero, as in the following example: -# -# SocketPermission("localhost:0" , "listen"); -# -# These can be overridden by the system properties: -# -# jdk.net.ephemeralPortRange.low and -# jdk.net.ephemeralPortRange.high -# -# respectively. -# -network.ephemeralPortRange.low=49152 -network.ephemeralPortRange.high=65535 - diff --git a/jdk/src/share/lib/security/java.security-solaris b/jdk/src/share/lib/security/java.security-solaris index c4d84a487b5..7de2ad42995 100644 --- a/jdk/src/share/lib/security/java.security-solaris +++ b/jdk/src/share/lib/security/java.security-solaris @@ -496,21 +496,3 @@ jdk.certpath.disabledAlgorithms=MD2, RSA keySize < 1024 # # Example: # jdk.tls.disabledAlgorithms=MD5, SHA1, DSA, RSA keySize < 2048 - - -# -# Default ephemeral port ranges (operating system specific) -# used by java.net.SocketPermission to interpret the meaning of the special -# port value zero, as in the following example: -# -# SocketPermission("localhost:0" , "listen"); -# -# These can be overridden by the system properties: -# -# jdk.net.ephemeralPortRange.low and -# jdk.net.ephemeralPortRange.high -# -# respectively. -# -network.ephemeralPortRange.low=32768 -network.ephemeralPortRange.high=65535 diff --git a/jdk/src/share/lib/security/java.security-windows b/jdk/src/share/lib/security/java.security-windows index 8b7750c9e9e..f19a0cf703b 100644 --- a/jdk/src/share/lib/security/java.security-windows +++ b/jdk/src/share/lib/security/java.security-windows @@ -497,20 +497,3 @@ jdk.certpath.disabledAlgorithms=MD2, RSA keySize < 1024 # # Example: # jdk.tls.disabledAlgorithms=MD5, SHA1, DSA, RSA keySize < 2048 - -# -# Default ephemeral port ranges (operating system specific) -# used by java.net.SocketPermission to interpret the meaning of the special -# port value zero, as in the following example: -# -# SocketPermission("localhost:0" , "listen"); -# -# These can be overridden by the system properties: -# -# jdk.net.ephemeralPortRange.low and -# jdk.net.ephemeralPortRange.high -# -# respectively. -# -network.ephemeralPortRange.low=49152 -network.ephemeralPortRange.high=65535 diff --git a/jdk/src/solaris/classes/sun/net/PortConfig.java b/jdk/src/solaris/classes/sun/net/PortConfig.java new file mode 100644 index 00000000000..0f4ca744257 --- /dev/null +++ b/jdk/src/solaris/classes/sun/net/PortConfig.java @@ -0,0 +1,89 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.net; + +import java.security.AccessController; + +/** + * Determines the ephemeral port range in use on this system. + * If this cannot be determined, then the default settings + * of the OS are returned. + */ + +public final class PortConfig { + + private static int defaultUpper, defaultLower; + private final static int upper, lower; + + private PortConfig() {} + + static { + AccessController.doPrivileged( + new java.security.PrivilegedAction() { + public Void run() { + System.loadLibrary("net"); + String os = System.getProperty("os.name"); + if (os.startsWith("Linux")) { + defaultLower = 32768; + defaultUpper = 61000; + } else if (os.startsWith("SunOS")) { + defaultLower = 32768; + defaultUpper = 65535; + } else if (os.contains("OS X")) { + defaultLower = 49152; + defaultUpper = 65535; + } else { + throw new InternalError( + "sun.net.PortConfig: unknown OS"); + } + return null; + } + }); + + int v = getLower0(); + if (v == -1) { + v = defaultLower; + } + lower = v; + + v = getUpper0(); + if (v == -1) { + v = defaultUpper; + } + upper = v; + } + + static native int getLower0(); + static native int getUpper0(); + + public static int getLower() { + return lower; + } + + public static int getUpper() { + return upper; + } +} diff --git a/jdk/src/solaris/native/java/net/net_util_md.c b/jdk/src/solaris/native/java/net/net_util_md.c index d7ebbd5a7c9..2ea6fd11932 100644 --- a/jdk/src/solaris/native/java/net/net_util_md.c +++ b/jdk/src/solaris/native/java/net/net_util_md.c @@ -138,8 +138,7 @@ static int useExclBind = 0; * of the parameter is assumed to be an 'int'. If the parameter * cannot be obtained return -1 */ -static int -getParam(char *driver, char *param) +int net_getParam(char *driver, char *param) { struct strioctl stri; char buf [64]; @@ -166,7 +165,7 @@ getParam(char *driver, char *param) /* * Iterative way to find the max value that SO_SNDBUF or SO_RCVBUF - * for Solaris versions that do not support the ioctl() in getParam(). + * for Solaris versions that do not support the ioctl() in net_getParam(). * Ugly, but only called once (for each sotype). * * As an optimization, we make a guess using the default values for Solaris @@ -1359,7 +1358,7 @@ NET_SetSockOpt(int fd, int level, int opt, const void *arg, * If that fails, we use the search algorithm in findMaxBuf() */ if (!init_tcp_max_buf && sotype == SOCK_STREAM) { - tcp_max_buf = getParam("/dev/tcp", "tcp_max_buf"); + tcp_max_buf = net_getParam("/dev/tcp", "tcp_max_buf"); if (tcp_max_buf == -1) { tcp_max_buf = findMaxBuf(fd, opt, SOCK_STREAM); if (tcp_max_buf == -1) { @@ -1368,7 +1367,7 @@ NET_SetSockOpt(int fd, int level, int opt, const void *arg, } init_tcp_max_buf = 1; } else if (!init_udp_max_buf && sotype == SOCK_DGRAM) { - udp_max_buf = getParam("/dev/udp", "udp_max_buf"); + udp_max_buf = net_getParam("/dev/udp", "udp_max_buf"); if (udp_max_buf == -1) { udp_max_buf = findMaxBuf(fd, opt, SOCK_DGRAM); if (udp_max_buf == -1) { diff --git a/jdk/src/solaris/native/java/net/net_util_md.h b/jdk/src/solaris/native/java/net/net_util_md.h index 4470a49b1e2..f7bec897c7d 100644 --- a/jdk/src/solaris/native/java/net/net_util_md.h +++ b/jdk/src/solaris/native/java/net/net_util_md.h @@ -81,6 +81,9 @@ extern int NET_Poll(struct pollfd *ufds, unsigned int nfds, int timeout); int getDefaultIPv6Interface(struct in6_addr *target_addr); #endif +#ifdef __solaris__ +extern int net_getParam(char *driver, char *param); +#endif /* needed from libsocket on Solaris 8 */ diff --git a/jdk/src/solaris/native/sun/net/portconfig.c b/jdk/src/solaris/native/sun/net/portconfig.c new file mode 100644 index 00000000000..56730f0f40a --- /dev/null +++ b/jdk/src/solaris/native/sun/net/portconfig.c @@ -0,0 +1,123 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * 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 + +#if defined(_ALLBSD_SOURCE) +#include +#endif + +#include "jni.h" +#include "net_util.h" +#include "sun_net_PortConfig.h" + +#ifdef __cplusplus +extern "C" { +#endif + +struct portrange { + int lower; + int higher; +}; + +static int getPortRange(struct portrange *range) +{ +#ifdef __linux__ + { + FILE *f; + int ret; + + f = fopen("/proc/sys/net/ipv4/ip_local_port_range", "r"); + if (f != NULL) { + ret = fscanf(f, "%d %d", &range->lower, &range->higher); + fclose(f); + return ret == 2 ? 0 : -1; + } + return -1; + } + +#elif defined(__solaris__) + { + range->higher = net_getParam("/dev/tcp", "tcp_largest_anon_port"); + range->lower = net_getParam("/dev/tcp", "tcp_smallest_anon_port"); + return 0; + } +#elif defined(_ALLBSD_SOURCE) + { + int ret; + size_t size = sizeof(range->lower); + ret = sysctlbyname( + "net.inet.ip.portrange.first", &range->lower, &size, 0, 0 + ); + if (ret == -1) { + return -1; + } + size = sizeof(range->higher); + ret = sysctlbyname( + "net.inet.ip.portrange.last", &range->higher, &size, 0, 0 + ); + return ret; + } +#else + return -1; +#endif +} + +/* + * Class: sun_net_PortConfig + * Method: getLower0 + * Signature: ()I + */ +JNIEXPORT jint JNICALL Java_sun_net_PortConfig_getLower0 + (JNIEnv *env, jclass clazz) +{ + struct portrange range; + if (getPortRange(&range) < 0) { + return -1; + } + return range.lower; +} + +/* + * Class: sun_net_PortConfig + * Method: getUpper0 + * Signature: ()I + */ +JNIEXPORT jint JNICALL Java_sun_net_PortConfig_getUpper0 + (JNIEnv *env, jclass clazz) +{ + struct portrange range; + if (getPortRange(&range) < 0) { + return -1; + } + return range.higher; +} + +#ifdef __cplusplus +} +#endif diff --git a/jdk/src/windows/classes/sun/net/PortConfig.java b/jdk/src/windows/classes/sun/net/PortConfig.java new file mode 100644 index 00000000000..e2ba12fee85 --- /dev/null +++ b/jdk/src/windows/classes/sun/net/PortConfig.java @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.net; + +import java.security.AccessController; + +/** + * Determines the ephemeral port range in use on this system. + * If this cannot be determined, then the default settings + * of the OS are returned. + */ + +public final class PortConfig { + + private static int defaultUpper, defaultLower; + private final static int upper, lower; + + static { + AccessController.doPrivileged( + new java.security.PrivilegedAction() { + public Void run() { + System.loadLibrary("net"); + return null; + } + }); + + int v = getLower0(); + if (v == -1) { + v = defaultLower; + } + lower = v; + + v = getUpper0(); + if (v == -1) { + v = defaultUpper; + } + upper = v; + } + + static native int getLower0(); + static native int getUpper0(); + + public static int getLower() { + return lower; + } + + public static int getUpper() { + return upper; + } +} diff --git a/jdk/src/windows/native/sun/net/portconfig.c b/jdk/src/windows/native/sun/net/portconfig.c new file mode 100644 index 00000000000..f786ef7b511 --- /dev/null +++ b/jdk/src/windows/native/sun/net/portconfig.c @@ -0,0 +1,107 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * 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 "jni.h" +#include "net_util.h" +#include "sun_net_PortConfig.h" + +#ifdef __cplusplus +extern "C" { +#endif + +struct portrange { + int lower; + int higher; +}; + +static int getPortRange(struct portrange *range) +{ + OSVERSIONINFO ver; + ver.dwOSVersionInfoSize = sizeof(ver); + GetVersionEx(&ver); + + /* Check for major version 5 or less = Windows XP/2003 or older */ + if (ver.dwMajorVersion <= 5) { + LONG ret; + HKEY hKey; + range->lower = 1024; + range->higher = 4999; + + /* check registry to see if upper limit was raised */ + ret = RegOpenKeyEx(HKEY_LOCAL_MACHINE, + "SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters", + 0, KEY_READ, (PHKEY)&hKey + ); + if (ret == ERROR_SUCCESS) { + DWORD maxuserport; + ULONG ulType; + DWORD dwLen = sizeof(maxuserport); + ret = RegQueryValueEx(hKey, "MaxUserPort", NULL, &ulType, + (LPBYTE)&maxuserport, &dwLen); + RegCloseKey(hKey); + if (ret == ERROR_SUCCESS) { + range->higher = maxuserport; + } + } + } else { + /* There doesn't seem to be an API to access this. "MaxUserPort" + * is affected, but is not sufficient to determine. + * so we just use the defaults, which are less likely to change + */ + range->lower = 49152; + range->higher = 65535; + } + return 0; +} + +/* + * Class: sun_net_PortConfig + * Method: getLower0 + * Signature: ()I + */ +JNIEXPORT jint JNICALL Java_sun_net_PortConfig_getLower0 + (JNIEnv *env, jclass clazz) +{ + struct portrange range; + getPortRange(&range); + return range.lower; +} + +/* + * Class: sun_net_PortConfig + * Method: getUpper0 + * Signature: ()I + */ +JNIEXPORT jint JNICALL Java_sun_net_PortConfig_getUpper0 + (JNIEnv *env, jclass clazz) +{ + struct portrange range; + getPortRange(&range); + return range.higher; +} +#ifdef __cplusplus +} +#endif diff --git a/jdk/test/java/rmi/activation/rmidViaInheritedChannel/RmidViaInheritedChannel.java b/jdk/test/java/rmi/activation/rmidViaInheritedChannel/RmidViaInheritedChannel.java index be9234d2fb9..6d81b0f1248 100644 --- a/jdk/test/java/rmi/activation/rmidViaInheritedChannel/RmidViaInheritedChannel.java +++ b/jdk/test/java/rmi/activation/rmidViaInheritedChannel/RmidViaInheritedChannel.java @@ -88,6 +88,17 @@ public class RmidViaInheritedChannel implements Callback { TestLibrary.RMIDVIAINHERITEDCHANNEL_ACTIVATION_PORT); rmid.addOptions(new String[]{ "-Djava.nio.channels.spi.SelectorProvider=RmidViaInheritedChannel$RmidSelectorProvider"}); + if (System.getProperty("os.name").startsWith("Windows") && + System.getProperty("os.version").startsWith("5.")) + { + /* Windows XP/2003 or older + * Need to expand ephemeral range to include RMI test ports + */ + rmid.addOptions(new String[]{ + "-Djdk.net.ephemeralPortRange.low=1024", + "-Djdk.net.ephemeralPortRange.high=64000" + }); + } rmid.start(); /* diff --git a/jdk/test/java/rmi/registry/readTest/readTest.sh b/jdk/test/java/rmi/registry/readTest/readTest.sh index bb37f65b4cc..b6e7c55c46b 100644 --- a/jdk/test/java/rmi/registry/readTest/readTest.sh +++ b/jdk/test/java/rmi/registry/readTest/readTest.sh @@ -29,6 +29,10 @@ # @run shell readTest.sh OS=`uname -s` +VER=`uname -r` +ARGS="" +REGARGS="" + case "$OS" in SunOS | Linux | Darwin ) PS=":" @@ -39,11 +43,19 @@ case "$OS" in PS=";" FS="\\" FILEURL="file:/" + if [ "$VER" -eq "5" ]; then + ARGS="-Djdk.net.ephemeralPortRange.low=1024 -Djdk.net.ephemeralPortRange.high=65000" + REGARGS="-J-Djdk.net.ephemeralPortRange.low=1024 -J-Djdk.net.ephemeralPortRange.high=65000" + fi ;; CYGWIN* ) PS=";" FS="/" FILEURL="file:/" + if [ "$VER" -eq "5" ]; then + ARGS="-Djdk.net.ephemeralPortRange.low=1024 -Djdk.net.ephemeralPortRange.high=65000" + REGARGS="-J-Djdk.net.ephemeralPortRange.low=1024 -J-Djdk.net.ephemeralPortRange.high=65000" + fi ;; * ) echo "Unrecognized system!" @@ -61,8 +73,8 @@ RMIREG_OUT=rmi.out #start rmiregistry without any local classes on classpath cd rmi_tmp # NOTE: This RMI Registry port must match TestLibrary.READTEST_REGISTRY_PORT -${TESTJAVA}${FS}bin${FS}rmiregistry -J-Djava.rmi.server.useCodebaseOnly=false \ - ${TESTTOOLVMOPTS} 64005 > ..${FS}${RMIREG_OUT} 2>&1 & +${TESTJAVA}${FS}bin${FS}rmiregistry ${REGARGS} -J-Djava.rmi.server.useCodebaseOnly=false \ + ${TESTTOOLVMOPTS} 60005 > ..${FS}${RMIREG_OUT} 2>&1 & RMIREG_PID=$! # allow some time to start sleep 3 @@ -74,10 +86,10 @@ case "$OS" in ;; * ) CODEBASE=`pwd` - ;; + ;; esac # trailing / after code base is important for rmi codebase property. -${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -cp $TEST_CLASSPATH -Djava.rmi.server.codebase=${FILEURL}$CODEBASE/ readTest > OUT.TXT 2>&1 & +${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -cp $TEST_CLASSPATH ${ARGS} -Djava.rmi.server.codebase=${FILEURL}$CODEBASE/ readTest > OUT.TXT 2>&1 & TEST_PID=$! #bulk of testcase - let it run for a while sleep 5 @@ -100,7 +112,7 @@ grep "Test passed" OUT.TXT result2=$? if [ $result1 -eq 0 -a $result2 -eq 0 ] -then +then echo "Passed" exitCode=0; else @@ -108,6 +120,6 @@ else exitCode=1 fi rm -rf OUT.TXT ${RMIREG_OUT} rmi_tmp -exit ${exitCode} +exit ${exitCode} diff --git a/jdk/test/java/rmi/testlibrary/TestLibrary.java b/jdk/test/java/rmi/testlibrary/TestLibrary.java index 87733be8e8f..8c28b8994ab 100644 --- a/jdk/test/java/rmi/testlibrary/TestLibrary.java +++ b/jdk/test/java/rmi/testlibrary/TestLibrary.java @@ -86,13 +86,13 @@ public class TestLibrary { * FIXED_PORT_MIN or above FIXED_PORT_MAX, then adjust * FIXED_PORT_MIN/MAX appropriately. */ - public final static int FIXED_PORT_MIN = 64001; - public final static int FIXED_PORT_MAX = 64010; - public final static int RMIDVIAINHERITEDCHANNEL_ACTIVATION_PORT = 64001; - public final static int RMIDVIAINHERITEDCHANNEL_REGISTRY_PORT = 64002; - public final static int INHERITEDCHANNELNOTSERVERSOCKET_ACTIVATION_PORT = 64003; - public final static int INHERITEDCHANNELNOTSERVERSOCKET_REGISTRY_PORT = 64004; - public final static int READTEST_REGISTRY_PORT = 64005; + public final static int FIXED_PORT_MIN = 60001; + public final static int FIXED_PORT_MAX = 60010; + public final static int RMIDVIAINHERITEDCHANNEL_ACTIVATION_PORT = 60001; + public final static int RMIDVIAINHERITEDCHANNEL_REGISTRY_PORT = 60002; + public final static int INHERITEDCHANNELNOTSERVERSOCKET_ACTIVATION_PORT = 60003; + public final static int INHERITEDCHANNELNOTSERVERSOCKET_REGISTRY_PORT = 60004; + public final static int READTEST_REGISTRY_PORT = 60005; private final static int MAX_SERVER_SOCKET_TRIES = 2*(FIXED_PORT_MAX-FIXED_PORT_MIN+1); static void mesg(Object mesg) { From 8a6f7a3d4579c1f336d9499e75fabdf4a8deb482 Mon Sep 17 00:00:00 2001 From: Athijegannathan Sundararajan Date: Tue, 26 Nov 2013 18:36:39 +0530 Subject: [PATCH 101/377] 8029031: "ant clean jar" on nashorn repo results in number of ASM deprecated warnings Reviewed-by: lagergren, jlaskey, hannesw --- .../tools/nasgen/MethodGenerator.java | 12 ++++----- .../tools/nasgen/ScriptClassInstrumentor.java | 10 +++---- .../internal/codegen/MethodEmitter.java | 6 ++++- .../nashorn/internal/codegen/types/Type.java | 2 +- .../linker/JavaAdapterBytecodeGenerator.java | 26 +++++++++---------- 5 files changed, 30 insertions(+), 26 deletions(-) diff --git a/nashorn/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/MethodGenerator.java b/nashorn/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/MethodGenerator.java index 475d7328c69..479d1d31f21 100644 --- a/nashorn/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/MethodGenerator.java +++ b/nashorn/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/MethodGenerator.java @@ -349,19 +349,19 @@ public class MethodGenerator extends MethodVisitor { // invokes, field get/sets void invokeInterface(final String owner, final String method, final String desc) { - super.visitMethodInsn(INVOKEINTERFACE, owner, method, desc); + super.visitMethodInsn(INVOKEINTERFACE, owner, method, desc, true); } void invokeVirtual(final String owner, final String method, final String desc) { - super.visitMethodInsn(INVOKEVIRTUAL, owner, method, desc); + super.visitMethodInsn(INVOKEVIRTUAL, owner, method, desc, false); } void invokeSpecial(final String owner, final String method, final String desc) { - super.visitMethodInsn(INVOKESPECIAL, owner, method, desc); + super.visitMethodInsn(INVOKESPECIAL, owner, method, desc, false); } void invokeStatic(final String owner, final String method, final String desc) { - super.visitMethodInsn(INVOKESTATIC, owner, method, desc); + super.visitMethodInsn(INVOKESTATIC, owner, method, desc, false); } void putStatic(final String owner, final String field, final String desc) { @@ -413,7 +413,7 @@ public class MethodGenerator extends MethodVisitor { super.visitMethodInsn(INVOKEVIRTUAL, "java/io/PrintStream", "println", - "(Ljava/lang/String;)V"); + "(Ljava/lang/String;)V", false); } // print the object on the top of the stack @@ -426,6 +426,6 @@ public class MethodGenerator extends MethodVisitor { super.visitMethodInsn(INVOKEVIRTUAL, "java/io/PrintStream", "println", - "(Ljava/lang/Object;)V"); + "(Ljava/lang/Object;)V", false); } } diff --git a/nashorn/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/ScriptClassInstrumentor.java b/nashorn/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/ScriptClassInstrumentor.java index 72250de79bc..0ec233ae8c8 100644 --- a/nashorn/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/ScriptClassInstrumentor.java +++ b/nashorn/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/ScriptClassInstrumentor.java @@ -146,16 +146,16 @@ public class ScriptClassInstrumentor extends ClassVisitor { // call $clinit$ just before return from if (isStaticInit && opcode == RETURN) { super.visitMethodInsn(INVOKESTATIC, scriptClassInfo.getJavaName(), - $CLINIT$, DEFAULT_INIT_DESC); + $CLINIT$, DEFAULT_INIT_DESC, false); } super.visitInsn(opcode); } @Override - public void visitMethodInsn(final int opcode, final String owner, final String name, final String desc) { + public void visitMethodInsn(final int opcode, final String owner, final String name, final String desc, final boolean itf) { if (isConstructor && opcode == INVOKESPECIAL && INIT.equals(name) && SCRIPTOBJECT_TYPE.equals(owner)) { - super.visitMethodInsn(opcode, owner, name, desc); + super.visitMethodInsn(opcode, owner, name, desc, false); if (memberCount > 0) { // initialize @Property fields if needed @@ -166,7 +166,7 @@ public class ScriptClassInstrumentor extends ClassVisitor { super.visitTypeInsn(NEW, clazz); super.visitInsn(DUP); super.visitMethodInsn(INVOKESPECIAL, clazz, - INIT, DEFAULT_INIT_DESC); + INIT, DEFAULT_INIT_DESC, false); super.visitFieldInsn(PUTFIELD, scriptClassInfo.getJavaName(), memInfo.getJavaName(), memInfo.getJavaDesc()); } @@ -180,7 +180,7 @@ public class ScriptClassInstrumentor extends ClassVisitor { } } } else { - super.visitMethodInsn(opcode, owner, name, desc); + super.visitMethodInsn(opcode, owner, name, desc, itf); } } diff --git a/nashorn/src/jdk/nashorn/internal/codegen/MethodEmitter.java b/nashorn/src/jdk/nashorn/internal/codegen/MethodEmitter.java index 9b6d12aae88..91129ece26a 100644 --- a/nashorn/src/jdk/nashorn/internal/codegen/MethodEmitter.java +++ b/nashorn/src/jdk/nashorn/internal/codegen/MethodEmitter.java @@ -1130,7 +1130,11 @@ public class MethodEmitter implements Emitter { popType(Type.OBJECT); } - method.visitMethodInsn(opcode, className, methodName, methodDescriptor); + if (opcode == INVOKEINTERFACE) { + method.visitMethodInsn(opcode, className, methodName, methodDescriptor, true); + } else { + method.visitMethodInsn(opcode, className, methodName, methodDescriptor, false); + } if (returnType != null) { pushType(returnType); diff --git a/nashorn/src/jdk/nashorn/internal/codegen/types/Type.java b/nashorn/src/jdk/nashorn/internal/codegen/types/Type.java index e7c789535d7..4799c264196 100644 --- a/nashorn/src/jdk/nashorn/internal/codegen/types/Type.java +++ b/nashorn/src/jdk/nashorn/internal/codegen/types/Type.java @@ -261,7 +261,7 @@ public abstract class Type implements Comparable, BytecodeOps { } static void invokeStatic(final MethodVisitor method, final Call call) { - method.visitMethodInsn(INVOKESTATIC, call.className(), call.name(), call.descriptor()); + method.visitMethodInsn(INVOKESTATIC, call.className(), call.name(), call.descriptor(), false); } /** diff --git a/nashorn/src/jdk/nashorn/internal/runtime/linker/JavaAdapterBytecodeGenerator.java b/nashorn/src/jdk/nashorn/internal/runtime/linker/JavaAdapterBytecodeGenerator.java index 5b8d4cfe3f0..7ab95a9aed9 100644 --- a/nashorn/src/jdk/nashorn/internal/runtime/linker/JavaAdapterBytecodeGenerator.java +++ b/nashorn/src/jdk/nashorn/internal/runtime/linker/JavaAdapterBytecodeGenerator.java @@ -317,7 +317,7 @@ final class JavaAdapterBytecodeGenerator { final InstructionAdapter mv = new InstructionAdapter(cw.visitMethod(ACC_STATIC, CLASS_INIT, Type.getMethodDescriptor(Type.VOID_TYPE), null, null)); - mv.invokestatic(SERVICES_CLASS_TYPE_NAME, "getClassOverrides", GET_CLASS_INITIALIZER_DESCRIPTOR); + mv.invokestatic(SERVICES_CLASS_TYPE_NAME, "getClassOverrides", GET_CLASS_INITIALIZER_DESCRIPTOR, false); final Label initGlobal; if(samName != null) { // If the class is a SAM, allow having a ScriptFunction passed as class overrides @@ -333,7 +333,7 @@ final class JavaAdapterBytecodeGenerator { if(mi.getName().equals(samName)) { mv.dup(); mv.aconst(Type.getMethodType(mi.type.toMethodDescriptorString())); - mv.invokestatic(SERVICES_CLASS_TYPE_NAME, "getHandle", GET_HANDLE_FUNCTION_DESCRIPTOR); + mv.invokestatic(SERVICES_CLASS_TYPE_NAME, "getHandle", GET_HANDLE_FUNCTION_DESCRIPTOR, false); } else { mv.visitInsn(ACONST_NULL); } @@ -350,7 +350,7 @@ final class JavaAdapterBytecodeGenerator { mv.dup(); mv.aconst(mi.getName()); mv.aconst(Type.getMethodType(mi.type.toMethodDescriptorString())); - mv.invokestatic(SERVICES_CLASS_TYPE_NAME, "getHandle", GET_HANDLE_OBJECT_DESCRIPTOR); + mv.invokestatic(SERVICES_CLASS_TYPE_NAME, "getHandle", GET_HANDLE_OBJECT_DESCRIPTOR, false); mv.putstatic(generatedClassName, mi.methodHandleClassFieldName, METHOD_HANDLE_TYPE_DESCRIPTOR); } @@ -367,7 +367,7 @@ final class JavaAdapterBytecodeGenerator { private static void invokeGetGlobalWithNullCheck(final InstructionAdapter mv) { invokeGetGlobal(mv); mv.dup(); - mv.invokevirtual(OBJECT_TYPE_NAME, "getClass", GET_CLASS_METHOD_DESCRIPTOR); // check against null Context + mv.invokevirtual(OBJECT_TYPE_NAME, "getClass", GET_CLASS_METHOD_DESCRIPTOR, false); // check against null Context mv.pop(); } @@ -424,7 +424,7 @@ final class JavaAdapterBytecodeGenerator { mv.load(offset, argType); offset += argType.getSize(); } - mv.invokespecial(superClassName, INIT, originalCtorType.getDescriptor()); + mv.invokespecial(superClassName, INIT, originalCtorType.getDescriptor(), false); endInitMethod(mv); } @@ -477,7 +477,7 @@ final class JavaAdapterBytecodeGenerator { mv.load(offset, argType); offset += argType.getSize(); } - mv.invokespecial(superClassName, INIT, originalCtorType.getDescriptor()); + mv.invokespecial(superClassName, INIT, originalCtorType.getDescriptor(), false); // Get a descriptor to the appropriate "JavaAdapterFactory.getHandle" method. final String getHandleDescriptor = fromFunction ? GET_HANDLE_FUNCTION_DESCRIPTOR : GET_HANDLE_OBJECT_DESCRIPTOR; @@ -496,7 +496,7 @@ final class JavaAdapterBytecodeGenerator { mv.aconst(mi.getName()); } mv.aconst(Type.getMethodType(mi.type.toMethodDescriptorString())); - mv.invokestatic(SERVICES_CLASS_TYPE_NAME, "getHandle", getHandleDescriptor); + mv.invokestatic(SERVICES_CLASS_TYPE_NAME, "getHandle", getHandleDescriptor, false); } mv.putfield(generatedClassName, mi.methodHandleInstanceFieldName, METHOD_HANDLE_TYPE_DESCRIPTOR); } @@ -520,11 +520,11 @@ final class JavaAdapterBytecodeGenerator { } private static void invokeGetGlobal(final InstructionAdapter mv) { - mv.invokestatic(CONTEXT_TYPE_NAME, "getGlobal", GET_GLOBAL_METHOD_DESCRIPTOR); + mv.invokestatic(CONTEXT_TYPE_NAME, "getGlobal", GET_GLOBAL_METHOD_DESCRIPTOR, false); } private static void invokeSetGlobal(final InstructionAdapter mv) { - mv.invokestatic(CONTEXT_TYPE_NAME, "setGlobal", SET_GLOBAL_METHOD_DESCRIPTOR); + mv.invokestatic(CONTEXT_TYPE_NAME, "setGlobal", SET_GLOBAL_METHOD_DESCRIPTOR, false); } /** @@ -647,7 +647,7 @@ final class JavaAdapterBytecodeGenerator { // If the super method is abstract, throw an exception mv.anew(UNSUPPORTED_OPERATION_TYPE); mv.dup(); - mv.invokespecial(UNSUPPORTED_OPERATION_TYPE_NAME, INIT, VOID_NOARG_METHOD_DESCRIPTOR); + mv.invokespecial(UNSUPPORTED_OPERATION_TYPE_NAME, INIT, VOID_NOARG_METHOD_DESCRIPTOR, false); mv.athrow(); } else { // If the super method is not abstract, delegate to it. @@ -728,7 +728,7 @@ final class JavaAdapterBytecodeGenerator { // Invoke the target method handle final Label tryBlockStart = new Label(); mv.visitLabel(tryBlockStart); - mv.invokevirtual(METHOD_HANDLE_TYPE.getInternalName(), "invokeExact", type.toMethodDescriptorString()); + mv.invokevirtual(METHOD_HANDLE_TYPE.getInternalName(), "invokeExact", type.toMethodDescriptorString(), false); final Label tryBlockEnd = new Label(); mv.visitLabel(tryBlockEnd); emitFinally(mv, currentGlobalVar, globalsDifferVar); @@ -744,7 +744,7 @@ final class JavaAdapterBytecodeGenerator { mv.anew(RUNTIME_EXCEPTION_TYPE); mv.dupX1(); mv.swap(); - mv.invokespecial(RUNTIME_EXCEPTION_TYPE_NAME, INIT, Type.getMethodDescriptor(Type.VOID_TYPE, THROWABLE_TYPE)); + mv.invokespecial(RUNTIME_EXCEPTION_TYPE_NAME, INIT, Type.getMethodDescriptor(Type.VOID_TYPE, THROWABLE_TYPE), false); // Fall through to rethrow handler } else { throwableHandler = null; @@ -843,7 +843,7 @@ final class JavaAdapterBytecodeGenerator { mv.load(nextParam, t); nextParam += t.getSize(); } - mv.invokespecial(superClassName, name, methodDesc); + mv.invokespecial(superClassName, name, methodDesc, false); mv.areturn(methodType.getReturnType()); } From 780a13433f8043fc890902c41d3e5abcb2330ba6 Mon Sep 17 00:00:00 2001 From: Jonathan Lu Date: Tue, 26 Nov 2013 16:40:31 +0100 Subject: [PATCH 102/377] 8024854: PPC64: Basic changes and files to build the class library on AIX Co-authored-by: Steve Poole Co-authored-by: Thomas Stuefe Reviewed-by: alanb, prr, sla, chegar, michaelm, mullan, art --- jdk/makefiles/CompileDemos.gmk | 19 +- jdk/makefiles/lib/Awt2dLibraries.gmk | 8 + jdk/makefiles/lib/NetworkingLibraries.gmk | 6 +- jdk/makefiles/lib/NioLibraries.gmk | 4 +- jdk/makefiles/lib/ServiceabilityLibraries.gmk | 5 + .../awt/fontconfigs/aix.fontconfig.properties | 77 +++ .../ch/AixAsynchronousChannelProvider.java | 91 +++ .../aix/classes/sun/nio/ch/AixPollPort.java | 536 ++++++++++++++++++ .../aix/classes/sun/nio/fs/AixFileStore.java | 106 ++++ .../aix/classes/sun/nio/fs/AixFileSystem.java | 94 +++ .../sun/nio/fs/AixFileSystemProvider.java | 52 ++ .../sun/nio/fs/AixNativeDispatcher.java | 56 ++ .../sun/tools/attach/AixAttachProvider.java | 88 +++ .../sun/tools/attach/AixVirtualMachine.java | 317 +++++++++++ jdk/src/aix/native/java/net/aix_close.c | 427 ++++++++++++++ jdk/src/aix/native/sun/nio/ch/AixPollPort.c | 175 ++++++ .../native/sun/nio/fs/AixNativeDispatcher.c | 227 ++++++++ .../sun/tools/attach/AixVirtualMachine.c | 283 +++++++++ jdk/src/aix/porting/porting_aix.c | 86 +++ jdk/src/aix/porting/porting_aix.h | 59 ++ jdk/src/share/bin/jli_util.h | 3 + jdk/src/share/lib/security/java.security-aix | 497 ++++++++++++++++ jdk/src/share/native/common/check_code.c | 35 ++ jdk/src/share/native/java/net/net_util.c | 4 +- jdk/src/share/native/java/net/net_util.h | 2 +- .../share/native/sun/awt/medialib/mlib_sys.c | 7 +- .../native/sun/awt/medialib/mlib_types.h | 4 +- .../native/sun/font/layout/KernTable.cpp | 14 +- .../native/sun/security/ec/impl/ecc_impl.h | 7 + jdk/src/solaris/back/exec_md.c | 6 +- jdk/src/solaris/bin/java_md_solinux.c | 31 +- jdk/src/solaris/bin/java_md_solinux.h | 20 +- .../classes/java/lang/UNIXProcess.java.aix | 419 ++++++++++++++ .../DefaultAsynchronousChannelProvider.java | 2 + jdk/src/solaris/classes/sun/nio/ch/Port.java | 10 + .../sun/nio/fs/DefaultFileSystemProvider.java | 2 + jdk/src/solaris/demo/jvmti/hprof/hprof_md.c | 18 +- jdk/src/solaris/native/common/jdk_util_md.h | 4 + jdk/src/solaris/native/java/io/io_util_md.c | 2 +- .../solaris/native/java/lang/UNIXProcess_md.c | 8 +- jdk/src/solaris/native/java/lang/childproc.c | 9 + .../native/java/net/NetworkInterface.c | 170 +++++- .../solaris/native/java/net/PlainSocketImpl.c | 2 +- jdk/src/solaris/native/java/net/net_util_md.c | 40 +- jdk/src/solaris/native/java/net/net_util_md.h | 12 +- .../solaris/native/java/util/TimeZone_md.c | 14 +- .../solaris/native/sun/awt/awt_LoadLibrary.c | 4 + jdk/src/solaris/native/sun/awt/fontpath.c | 39 +- .../native/sun/java2d/x11/X11SurfaceData.c | 12 +- .../native/sun/java2d/x11/XRBackendNative.c | 8 +- .../sun/management/OperatingSystemImpl.c | 22 +- jdk/src/solaris/native/sun/nio/ch/Net.c | 82 ++- .../native/sun/nio/fs/UnixNativeDispatcher.c | 29 +- .../native/sun/security/pkcs11/j2secmod_md.c | 6 +- jdk/src/windows/native/java/net/net_util_md.c | 4 +- jdk/test/java/lang/ProcessBuilder/Basic.java | 75 ++- .../java/lang/ProcessBuilder/DestroyTest.java | 3 + 57 files changed, 4239 insertions(+), 103 deletions(-) create mode 100644 jdk/src/aix/classes/sun/awt/fontconfigs/aix.fontconfig.properties create mode 100644 jdk/src/aix/classes/sun/nio/ch/AixAsynchronousChannelProvider.java create mode 100644 jdk/src/aix/classes/sun/nio/ch/AixPollPort.java create mode 100644 jdk/src/aix/classes/sun/nio/fs/AixFileStore.java create mode 100644 jdk/src/aix/classes/sun/nio/fs/AixFileSystem.java create mode 100644 jdk/src/aix/classes/sun/nio/fs/AixFileSystemProvider.java create mode 100644 jdk/src/aix/classes/sun/nio/fs/AixNativeDispatcher.java create mode 100644 jdk/src/aix/classes/sun/tools/attach/AixAttachProvider.java create mode 100644 jdk/src/aix/classes/sun/tools/attach/AixVirtualMachine.java create mode 100644 jdk/src/aix/native/java/net/aix_close.c create mode 100644 jdk/src/aix/native/sun/nio/ch/AixPollPort.c create mode 100644 jdk/src/aix/native/sun/nio/fs/AixNativeDispatcher.c create mode 100644 jdk/src/aix/native/sun/tools/attach/AixVirtualMachine.c create mode 100644 jdk/src/aix/porting/porting_aix.c create mode 100644 jdk/src/aix/porting/porting_aix.h create mode 100644 jdk/src/share/lib/security/java.security-aix create mode 100644 jdk/src/solaris/classes/java/lang/UNIXProcess.java.aix diff --git a/jdk/makefiles/CompileDemos.gmk b/jdk/makefiles/CompileDemos.gmk index beef573275c..2b6c059969d 100644 --- a/jdk/makefiles/CompileDemos.gmk +++ b/jdk/makefiles/CompileDemos.gmk @@ -210,9 +210,12 @@ define SetupJVMTIDemo # Param 5 = libs for posix # Param 6 = libs for windows # Param 7 = libs for solaris + # Param 8 = libs for linux + # Param 9 = extra directories with required sources BUILD_DEMO_JVMTI_$1_EXTRA_SRC := \ $$(wildcard $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/demo/jvmti/$1) \ - $$(wildcard $$(addprefix $(JDK_TOPDIR)/src/share/demo/jvmti/, $2)) + $$(wildcard $$(addprefix $(JDK_TOPDIR)/src/share/demo/jvmti/, $2)) \ + $9 BUILD_DEMO_JVMTI_$1_EXTRA_SRC_EXCLUDE := \ $$(wildcard $$(addprefix $(JDK_TOPDIR)/src/share/demo/jvmti/, $2)/README.txt) \ $$(wildcard $$(addprefix $(JDK_TOPDIR)/src/share/demo/jvmti/, $2)/sample.makefile.txt) @@ -304,9 +307,19 @@ $(eval $(call SetupJVMTIDemo,compiledMethodLoad, agent_util)) $(eval $(call SetupJVMTIDemo,gctest, agent_util)) $(eval $(call SetupJVMTIDemo,heapTracker, agent_util java_crw_demo)) $(eval $(call SetupJVMTIDemo,heapViewer, agent_util)) + +# On AIX, hprof requires 'dladdr' from src/aix/porting/porting_aix.cpp +BUILD_LIBHPROF_AIX_EXTRA_SRC := +BUILD_LIBHPROF_AIX_EXTRA_CFLAGS := +ifeq ($(OPENJDK_TARGET_OS), aix) + BUILD_LIBHPROF_AIX_EXTRA_SRC += $(JDK_TOPDIR)/src/aix/porting + BUILD_LIBHPROF_AIX_EXTRA_CFLAGS += -I$(JDK_TOPDIR)/src/aix/porting +endif + $(eval $(call SetupJVMTIDemo,hprof, java_crw_demo, \ - -I$(JDK_TOPDIR)/src/share/npt -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/npt, C, \ - -ldl, ws2_32.lib winmm.lib, -lsocket -lnsl, -lpthread)) + -I$(JDK_TOPDIR)/src/share/npt -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/npt \ + $(BUILD_LIBHPROF_AIX_EXTRA_CFLAGS), C, \ + -ldl, ws2_32.lib winmm.lib, -lsocket -lnsl, -lpthread, $(BUILD_LIBHPROF_AIX_EXTRA_SRC))) $(eval $(call SetupJVMTIDemo,minst, agent_util java_crw_demo)) $(eval $(call SetupJVMTIDemo,mtrace, agent_util java_crw_demo)) diff --git a/jdk/makefiles/lib/Awt2dLibraries.gmk b/jdk/makefiles/lib/Awt2dLibraries.gmk index 8c786cc5a7c..a18ed24c694 100644 --- a/jdk/makefiles/lib/Awt2dLibraries.gmk +++ b/jdk/makefiles/lib/Awt2dLibraries.gmk @@ -231,6 +231,10 @@ else ifneq ($(OPENJDK_TARGET_OS), macosx) $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/java2d/x11 endif +ifeq ($(OPENJDK_TARGET_OS), aix) + LIBAWT_DIRS += $(JDK_TOPDIR)/src/aix/porting +endif + LIBAWT_CFLAGS += -D__MEDIALIB_OLD_NAMES -D__USE_J2D_NAMES \ $(X_CFLAGS) \ $(foreach dir, $(LIBAWT_DIRS), -I$(dir)) @@ -309,6 +313,10 @@ ifneq (, $(filter $(OPENJDK_TARGET_OS), solaris linux aix)) LIBAWT_FILES += awt_LoadLibrary.c initIDs.c img_colors.c endif +ifeq ($(OPENJDK_TARGET_OS), aix) + LIBAWT_FILES += porting_aix.c +endif + ifeq ($(OPENJDK_TARGET_OS), macosx) LIBAWT_FILES += awt_LoadLibrary.c img_colors.c LIBAWT_CFLAGS += -F/System/Library/Frameworks/JavaVM.framework/Frameworks diff --git a/jdk/makefiles/lib/NetworkingLibraries.gmk b/jdk/makefiles/lib/NetworkingLibraries.gmk index e597f1b373f..84bf25a3ee8 100644 --- a/jdk/makefiles/lib/NetworkingLibraries.gmk +++ b/jdk/makefiles/lib/NetworkingLibraries.gmk @@ -37,7 +37,7 @@ endif LIBNET_CFLAGS := $(foreach dir, $(LIBNET_SRC_DIRS), -I$(dir)) LIBNET_EXCLUDE_FILES := -ifeq (, $(filter $(OPENJDK_TARGET_OS), linux aix)) +ifneq ($(OPENJDK_TARGET_OS), linux) LIBNET_EXCLUDE_FILES += linux_close.c endif @@ -45,6 +45,10 @@ ifneq ($(OPENJDK_TARGET_OS), macosx) LIBNET_EXCLUDE_FILES += bsd_close.c endif +ifeq ($(OPENJDK_TARGET_OS), aix) + LIBNET_SRC_DIRS += $(JDK_TOPDIR)/src/aix/native/java/net/ +endif + ifeq ($(OPENJDK_TARGET_OS), windows) LIBNET_EXCLUDE_FILES += PlainSocketImpl.c PlainDatagramSocketImpl.c SdpSupport.c else diff --git a/jdk/makefiles/lib/NioLibraries.gmk b/jdk/makefiles/lib/NioLibraries.gmk index 26b0f251f41..c111b75e849 100644 --- a/jdk/makefiles/lib/NioLibraries.gmk +++ b/jdk/makefiles/lib/NioLibraries.gmk @@ -114,7 +114,9 @@ endif ifeq ($(OPENJDK_TARGET_OS), aix) BUILD_LIBNIO_MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libnio/mapfile-$(OPENJDK_TARGET_OS) - BUILD_LIBNIO_SRC += $(JDK_TOPDIR)/src/aix/native/sun/nio/ch + BUILD_LIBNIO_SRC += \ + $(JDK_TOPDIR)/src/aix/native/sun/nio/ch \ + $(JDK_TOPDIR)/src/aix/native/sun/nio/fs BUILD_LIBNIO_FILES += \ AixPollPort.c \ InheritedChannel.c \ diff --git a/jdk/makefiles/lib/ServiceabilityLibraries.gmk b/jdk/makefiles/lib/ServiceabilityLibraries.gmk index c6a23339af3..9b7233768f0 100644 --- a/jdk/makefiles/lib/ServiceabilityLibraries.gmk +++ b/jdk/makefiles/lib/ServiceabilityLibraries.gmk @@ -344,6 +344,11 @@ BUILD_LIBHPROF_CFLAGS := -I$(JDK_TOPDIR)/src/share/demo/jvmti/hprof \ -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/npt \ -I$(JDK_TOPDIR)/src/share/demo/jvmti/java_crw_demo +ifeq ($(OPENJDK_TARGET_OS), aix) + BUILD_LIBHPROF_SRC += $(JDK_TOPDIR)/src/aix/porting + BUILD_LIBHPROF_CFLAGS += -I$(JDK_TOPDIR)/src/aix/porting +endif + BUILD_LIBHPROF_LDFLAGS := LIBHPROF_OPTIMIZATION := HIGHEST diff --git a/jdk/src/aix/classes/sun/awt/fontconfigs/aix.fontconfig.properties b/jdk/src/aix/classes/sun/awt/fontconfigs/aix.fontconfig.properties new file mode 100644 index 00000000000..29e7c7d9510 --- /dev/null +++ b/jdk/src/aix/classes/sun/awt/fontconfigs/aix.fontconfig.properties @@ -0,0 +1,77 @@ +# +# +# Copyright 2013 SAP AG. All rights reserved. +# 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. +# + +# Minimal version for AIX using the standard Latin Type1 Fonts from the +# package X11.fnt.iso_T1. These fonts are installed by default into +# "/usr/lpp/X11/lib/X11/fonts/Type1" and sym-linked to "/usr/lib/X11/fonts/Type1" + +# Version + +version=1 + +# Component Font Mappings + +dialog.plain.latin-1=-*-helvetica-medium-r-normal--*-%d-100-100-p-*-iso10646-1 +dialog.bold.latin-1=-*-helvetica-bold-r-normal--*-%d-100-100-p-*-iso10646-1 +dialog.italic.latin-1=-*-helvetica-medium-o-normal--*-%d-100-100-p-*-iso10646-1 +dialog.bolditalic.latin-1=-*-helvetica-bold-o-normal--*-%d-100-100-p-*-iso10646-1 + +dialoginput.plain.latin-1=-*-courier-medium-r-normal--*-%d-100-100-m-*-iso10646-1 +dialoginput.bold.latin-1=-*-courier-bold-r-normal--*-%d-100-100-m-*-iso10646-1 +dialoginput.italic.latin-1=-*-courier-medium-o-normal--*-%d-100-100-m-*-iso10646-1 +dialoginput.bolditalic.latin-1=-*-courier-bold-o-normal--*-%d-100-100-m-*-iso10646-1 + +sansserif.plain.latin-1=-*-helvetica-medium-r-normal--*-%d-100-100-p-*-iso10646-1 +sansserif.bold.latin-1=-*-helvetica-bold-r-normal--*-%d-100-100-p-*-iso10646-1 +sansserif.italic.latin-1=-*-helvetica-medium-o-normal--*-%d-100-100-p-*-iso10646-1 +sansserif.bolditalic.latin-1=-*-helvetica-bold-o-normal--*-%d-100-100-p-*-iso10646-1 + +serif.plain.latin-1=-*-times new roman-medium-r-normal--*-%d-100-100-p-*-iso10646-1 +serif.bold.latin-1=-*-times new roman-bold-r-normal--*-%d-100-100-p-*-iso10646-1 +serif.italic.latin-1=-*-times new roman-medium-i-normal--*-%d-100-100-p-*-iso10646-1 +serif.bolditalic.latin-1=-*-times new roman-bold-i-normal--*-%d-100-100-p-*-iso10646-1 + +monospaced.plain.latin-1=-*-courier-medium-r-normal--*-%d-100-100-m-*-iso10646-1 +monospaced.bold.latin-1=-*-courier-bold-r-normal--*-%d-100-100-m-*-iso10646-1 +monospaced.italic.latin-1=-*-courier-medium-o-normal--*-%d-100-100-m-*-iso10646-1 +monospaced.bolditalic.latin-1=-*-courier-bold-o-normal--*-%d-100-100-m-*-iso10646-1 + +# Search Sequences + +sequence.allfonts=latin-1 + +filename.-*-courier-medium-r-normal--*-%d-100-100-m-*-iso10646-1=/usr/lpp/X11/lib/X11/fonts/Type1/cour.pfa +filename.-*-courier-bold-r-normal--*-%d-100-100-m-*-iso10646-1=/usr/lpp/X11/lib/X11/fonts/Type1/courb.pfa +filename.-*-courier-medium-o-normal--*-%d-100-100-m-*-iso10646-1=/usr/lpp/X11/lib/X11/fonts/Type1/couri.pfa +filename.-*-courier-bold-o-normal--*-%d-100-100-m-*-iso10646-1=/usr/lpp/X11/lib/X11/fonts/Type1/courbi.pfa +filename.-*-helvetica-medium-r-normal--*-%d-100-100-p-*-iso10646-1=/usr/lpp/X11/lib/X11/fonts/Type1/helv.pfa +filename.-*-helvetica-bold-r-normal--*-%d-100-100-p-*-iso10646-1=/usr/lpp/X11/lib/X11/fonts/Type1/helvb.pfa +filename.-*-helvetica-medium-o-normal--*-%d-100-100-p-*-iso10646-1=/usr/lpp/X11/lib/X11/fonts/Type1/helvi.pfa +filename.-*-helvetica-bold-o-normal--*-%d-100-100-p-*-iso10646-1=/usr/lpp/X11/lib/X11/fonts/Type1/helvbi.pfa +filename.-*-times_new_roman-medium-r-normal--*-%d-100-100-p-*-iso10646-1=/usr/lpp/X11/lib/X11/fonts/Type1/tnr.pfa +filename.-*-times_new_roman-bold-r-normal--*-%d-100-100-p-*-iso10646-1=/usr/lpp/X11/lib/X11/fonts/Type1/tnrb.pfa +filename.-*-times_new_roman-medium-i-normal--*-%d-100-100-p-*-iso10646-1=/usr/lpp/X11/lib/X11/fonts/Type1/tnri.pfa +filename.-*-times_new_roman-bold-i-normal--*-%d-100-100-p-*-iso10646-1=/usr/lpp/X11/lib/X11/fonts/Type1/tnrbi.pfa diff --git a/jdk/src/aix/classes/sun/nio/ch/AixAsynchronousChannelProvider.java b/jdk/src/aix/classes/sun/nio/ch/AixAsynchronousChannelProvider.java new file mode 100644 index 00000000000..4c2c3d317bf --- /dev/null +++ b/jdk/src/aix/classes/sun/nio/ch/AixAsynchronousChannelProvider.java @@ -0,0 +1,91 @@ +/* + * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright 2012 SAP AG. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.nio.ch; + +import java.nio.channels.*; +import java.nio.channels.spi.AsynchronousChannelProvider; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.ThreadFactory; +import java.io.IOException; + +public class AixAsynchronousChannelProvider + extends AsynchronousChannelProvider +{ + private static volatile AixPollPort defaultPort; + + private AixPollPort defaultEventPort() throws IOException { + if (defaultPort == null) { + synchronized (AixAsynchronousChannelProvider.class) { + if (defaultPort == null) { + defaultPort = new AixPollPort(this, ThreadPool.getDefault()).start(); + } + } + } + return defaultPort; + } + + public AixAsynchronousChannelProvider() { + } + + @Override + public AsynchronousChannelGroup openAsynchronousChannelGroup(int nThreads, ThreadFactory factory) + throws IOException + { + return new AixPollPort(this, ThreadPool.create(nThreads, factory)).start(); + } + + @Override + public AsynchronousChannelGroup openAsynchronousChannelGroup(ExecutorService executor, int initialSize) + throws IOException + { + return new AixPollPort(this, ThreadPool.wrap(executor, initialSize)).start(); + } + + private Port toPort(AsynchronousChannelGroup group) throws IOException { + if (group == null) { + return defaultEventPort(); + } else { + if (!(group instanceof AixPollPort)) + throw new IllegalChannelGroupException(); + return (Port)group; + } + } + + @Override + public AsynchronousServerSocketChannel openAsynchronousServerSocketChannel(AsynchronousChannelGroup group) + throws IOException + { + return new UnixAsynchronousServerSocketChannelImpl(toPort(group)); + } + + @Override + public AsynchronousSocketChannel openAsynchronousSocketChannel(AsynchronousChannelGroup group) + throws IOException + { + return new UnixAsynchronousSocketChannelImpl(toPort(group)); + } +} diff --git a/jdk/src/aix/classes/sun/nio/ch/AixPollPort.java b/jdk/src/aix/classes/sun/nio/ch/AixPollPort.java new file mode 100644 index 00000000000..82c101434df --- /dev/null +++ b/jdk/src/aix/classes/sun/nio/ch/AixPollPort.java @@ -0,0 +1,536 @@ +/* + * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright 2012 SAP AG. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.nio.ch; + +import java.nio.channels.spi.AsynchronousChannelProvider; +import java.io.IOException; +import java.util.HashSet; +import java.util.Iterator; +import java.util.concurrent.ArrayBlockingQueue; +import java.util.concurrent.RejectedExecutionException; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.concurrent.locks.ReentrantLock; +import sun.misc.Unsafe; + +/** + * AsynchronousChannelGroup implementation based on the AIX pollset framework. + */ +final class AixPollPort + extends Port +{ + private static final Unsafe unsafe = Unsafe.getUnsafe(); + + static { + IOUtil.load(); + init(); + } + + /** + * struct pollfd { + * int fd; + * short events; + * short revents; + * } + */ + private static final int SIZEOF_POLLFD = eventSize(); + private static final int OFFSETOF_EVENTS = eventsOffset(); + private static final int OFFSETOF_REVENTS = reventsOffset(); + private static final int OFFSETOF_FD = fdOffset(); + + // opcodes + private static final int PS_ADD = 0x0; + private static final int PS_MOD = 0x1; + private static final int PS_DELETE = 0x2; + + // maximum number of events to poll at a time + private static final int MAX_POLL_EVENTS = 512; + + // pollset ID + private final int pollset; + + // true if port is closed + private boolean closed; + + // socket pair used for wakeup + private final int sp[]; + + // socket pair used to indicate pending pollsetCtl calls + // Background info: pollsetCtl blocks when another thread is in a pollsetPoll call. + private final int ctlSp[]; + + // number of wakeups pending + private final AtomicInteger wakeupCount = new AtomicInteger(); + + // address of the poll array passed to pollset_poll + private final long address; + + // encapsulates an event for a channel + static class Event { + final PollableChannel channel; + final int events; + + Event(PollableChannel channel, int events) { + this.channel = channel; + this.events = events; + } + + PollableChannel channel() { return channel; } + int events() { return events; } + } + + // queue of events for cases that a polling thread dequeues more than one + // event + private final ArrayBlockingQueue queue; + private final Event NEED_TO_POLL = new Event(null, 0); + private final Event EXECUTE_TASK_OR_SHUTDOWN = new Event(null, 0); + + // encapsulates a pollset control event for a file descriptor + static class ControlEvent { + final int fd; + final int events; + final boolean removeOnly; + int error = 0; + + ControlEvent(int fd, int events, boolean removeOnly) { + this.fd = fd; + this.events = events; + this.removeOnly = removeOnly; + } + + int fd() { return fd; } + int events() { return events; } + boolean removeOnly() { return removeOnly; } + int error() { return error; } + void setError(int error) { this.error = error; } + } + + // queue of control events that need to be processed + // (this object is also used for synchronization) + private final HashSet controlQueue = new HashSet(); + + // lock used to check whether a poll operation is ongoing + private final ReentrantLock controlLock = new ReentrantLock(); + + AixPollPort(AsynchronousChannelProvider provider, ThreadPool pool) + throws IOException + { + super(provider, pool); + + // open pollset + this.pollset = pollsetCreate(); + + // create socket pair for wakeup mechanism + int[] sv = new int[2]; + try { + socketpair(sv); + // register one end with pollset + pollsetCtl(pollset, PS_ADD, sv[0], POLLIN); + } catch (IOException x) { + pollsetDestroy(pollset); + throw x; + } + this.sp = sv; + + // create socket pair for pollset control mechanism + sv = new int[2]; + try { + socketpair(sv); + // register one end with pollset + pollsetCtl(pollset, PS_ADD, sv[0], POLLIN); + } catch (IOException x) { + pollsetDestroy(pollset); + throw x; + } + this.ctlSp = sv; + + // allocate the poll array + this.address = allocatePollArray(MAX_POLL_EVENTS); + + // create the queue and offer the special event to ensure that the first + // threads polls + this.queue = new ArrayBlockingQueue(MAX_POLL_EVENTS); + this.queue.offer(NEED_TO_POLL); + } + + AixPollPort start() { + startThreads(new EventHandlerTask()); + return this; + } + + /** + * Release all resources + */ + private void implClose() { + synchronized (this) { + if (closed) + return; + closed = true; + } + freePollArray(address); + close0(sp[0]); + close0(sp[1]); + close0(ctlSp[0]); + close0(ctlSp[1]); + pollsetDestroy(pollset); + } + + private void wakeup() { + if (wakeupCount.incrementAndGet() == 1) { + // write byte to socketpair to force wakeup + try { + interrupt(sp[1]); + } catch (IOException x) { + throw new AssertionError(x); + } + } + } + + @Override + void executeOnHandlerTask(Runnable task) { + synchronized (this) { + if (closed) + throw new RejectedExecutionException(); + offerTask(task); + wakeup(); + } + } + + @Override + void shutdownHandlerTasks() { + /* + * If no tasks are running then just release resources; otherwise + * write to the one end of the socketpair to wakeup any polling threads. + */ + int nThreads = threadCount(); + if (nThreads == 0) { + implClose(); + } else { + // send interrupt to each thread + while (nThreads-- > 0) { + wakeup(); + } + } + } + + // invoke by clients to register a file descriptor + @Override + void startPoll(int fd, int events) { + queueControlEvent(new ControlEvent(fd, events, false)); + } + + // Callback method for implementations that need special handling when fd is removed + @Override + protected void preUnregister(int fd) { + queueControlEvent(new ControlEvent(fd, 0, true)); + } + + // Add control event into queue and wait for completion. + // In case the control lock is free, this method also tries to apply the control change directly. + private void queueControlEvent(ControlEvent ev) { + // pollsetCtl blocks when a poll call is ongoing. This is very probable. + // Therefore we let the polling thread do the pollsetCtl call. + synchronized (controlQueue) { + controlQueue.add(ev); + // write byte to socketpair to force wakeup + try { + interrupt(ctlSp[1]); + } catch (IOException x) { + throw new AssertionError(x); + } + do { + // Directly empty queue if no poll call is ongoing. + if (controlLock.tryLock()) { + try { + processControlQueue(); + } finally { + controlLock.unlock(); + } + } else { + try { + // Do not starve in case the polling thread returned before + // we could write to ctlSp[1] but the polling thread did not + // release the control lock until we checked. Therefore, use + // a timed wait for the time being. + controlQueue.wait(100); + } catch (InterruptedException e) { + // ignore exception and try again + } + } + } while (controlQueue.contains(ev)); + } + if (ev.error() != 0) { + throw new AssertionError(); + } + } + + // Process all events currently stored in the control queue. + private void processControlQueue() { + synchronized (controlQueue) { + // On Aix it is only possible to set the event + // bits on the first call of pollsetCtl. Later + // calls only add bits, but cannot remove them. + // Therefore, we always remove the file + // descriptor ignoring the error and then add it. + Iterator iter = controlQueue.iterator(); + while (iter.hasNext()) { + ControlEvent ev = iter.next(); + pollsetCtl(pollset, PS_DELETE, ev.fd(), 0); + if (!ev.removeOnly()) { + ev.setError(pollsetCtl(pollset, PS_MOD, ev.fd(), ev.events())); + } + iter.remove(); + } + controlQueue.notifyAll(); + } + } + + /* + * Task to process events from pollset and dispatch to the channel's + * onEvent handler. + * + * Events are retreived from pollset in batch and offered to a BlockingQueue + * where they are consumed by handler threads. A special "NEED_TO_POLL" + * event is used to signal one consumer to re-poll when all events have + * been consumed. + */ + private class EventHandlerTask implements Runnable { + private Event poll() throws IOException { + try { + for (;;) { + int n; + controlLock.lock(); + try { + n = pollsetPoll(pollset, address, MAX_POLL_EVENTS); + } finally { + controlLock.unlock(); + } + /* + * 'n' events have been read. Here we map them to their + * corresponding channel in batch and queue n-1 so that + * they can be handled by other handler threads. The last + * event is handled by this thread (and so is not queued). + */ + fdToChannelLock.readLock().lock(); + try { + while (n-- > 0) { + long eventAddress = getEvent(address, n); + int fd = getDescriptor(eventAddress); + + // To emulate one shot semantic we need to remove + // the file descriptor here. + pollsetCtl(pollset, PS_DELETE, fd, 0); + + // wakeup + if (fd == sp[0]) { + if (wakeupCount.decrementAndGet() == 0) { + // no more wakeups so drain pipe + drain1(sp[0]); + } + + // This is the only file descriptor without + // one shot semantic => register it again. + pollsetCtl(pollset, PS_ADD, sp[0], POLLIN); + + // queue special event if there are more events + // to handle. + if (n > 0) { + queue.offer(EXECUTE_TASK_OR_SHUTDOWN); + continue; + } + return EXECUTE_TASK_OR_SHUTDOWN; + } + + // wakeup to process control event + if (fd == ctlSp[0]) { + synchronized (controlQueue) { + drain1(ctlSp[0]); + // This file descriptor does not have + // one shot semantic => register it again. + pollsetCtl(pollset, PS_ADD, ctlSp[0], POLLIN); + processControlQueue(); + } + continue; + } + + PollableChannel channel = fdToChannel.get(fd); + if (channel != null) { + int events = getRevents(eventAddress); + Event ev = new Event(channel, events); + + // n-1 events are queued; This thread handles + // the last one except for the wakeup + if (n > 0) { + queue.offer(ev); + } else { + return ev; + } + } + } + } finally { + fdToChannelLock.readLock().unlock(); + } + } + } finally { + // to ensure that some thread will poll when all events have + // been consumed + queue.offer(NEED_TO_POLL); + } + } + + public void run() { + Invoker.GroupAndInvokeCount myGroupAndInvokeCount = + Invoker.getGroupAndInvokeCount(); + final boolean isPooledThread = (myGroupAndInvokeCount != null); + boolean replaceMe = false; + Event ev; + try { + for (;;) { + // reset invoke count + if (isPooledThread) + myGroupAndInvokeCount.resetInvokeCount(); + + try { + replaceMe = false; + ev = queue.take(); + + // no events and this thread has been "selected" to + // poll for more. + if (ev == NEED_TO_POLL) { + try { + ev = poll(); + } catch (IOException x) { + x.printStackTrace(); + return; + } + } + } catch (InterruptedException x) { + continue; + } + + // handle wakeup to execute task or shutdown + if (ev == EXECUTE_TASK_OR_SHUTDOWN) { + Runnable task = pollTask(); + if (task == null) { + // shutdown request + return; + } + // run task (may throw error/exception) + replaceMe = true; + task.run(); + continue; + } + + // process event + try { + ev.channel().onEvent(ev.events(), isPooledThread); + } catch (Error x) { + replaceMe = true; throw x; + } catch (RuntimeException x) { + replaceMe = true; throw x; + } + } + } finally { + // last handler to exit when shutdown releases resources + int remaining = threadExit(this, replaceMe); + if (remaining == 0 && isShutdown()) { + implClose(); + } + } + } + } + + /** + * Allocates a poll array to handle up to {@code count} events. + */ + private static long allocatePollArray(int count) { + return unsafe.allocateMemory(count * SIZEOF_POLLFD); + } + + /** + * Free a poll array + */ + private static void freePollArray(long address) { + unsafe.freeMemory(address); + } + + /** + * Returns event[i]; + */ + private static long getEvent(long address, int i) { + return address + (SIZEOF_POLLFD*i); + } + + /** + * Returns event->fd + */ + private static int getDescriptor(long eventAddress) { + return unsafe.getInt(eventAddress + OFFSETOF_FD); + } + + /** + * Returns event->events + */ + private static int getEvents(long eventAddress) { + return unsafe.getChar(eventAddress + OFFSETOF_EVENTS); + } + + /** + * Returns event->revents + */ + private static int getRevents(long eventAddress) { + return unsafe.getChar(eventAddress + OFFSETOF_REVENTS); + } + + // -- Native methods -- + + private static native void init(); + + private static native int eventSize(); + + private static native int eventsOffset(); + + private static native int reventsOffset(); + + private static native int fdOffset(); + + private static native int pollsetCreate() throws IOException; + + private static native int pollsetCtl(int pollset, int opcode, int fd, int events); + + private static native int pollsetPoll(int pollset, long pollAddress, int numfds) + throws IOException; + + private static native void pollsetDestroy(int pollset); + + private static native void socketpair(int[] sv) throws IOException; + + private static native void interrupt(int fd) throws IOException; + + private static native void drain1(int fd) throws IOException; + + private static native void close0(int fd); +} diff --git a/jdk/src/aix/classes/sun/nio/fs/AixFileStore.java b/jdk/src/aix/classes/sun/nio/fs/AixFileStore.java new file mode 100644 index 00000000000..c38cb46a760 --- /dev/null +++ b/jdk/src/aix/classes/sun/nio/fs/AixFileStore.java @@ -0,0 +1,106 @@ +/* + * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright 2013 SAP AG. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.nio.fs; + +import java.nio.file.attribute.*; +import java.util.*; +import java.io.IOException; + +/** + * AIX implementation of FileStore + */ + +class AixFileStore + extends UnixFileStore +{ + + AixFileStore(UnixPath file) throws IOException { + super(file); + } + + AixFileStore(UnixFileSystem fs, UnixMountEntry entry) throws IOException { + super(fs, entry); + } + + /** + * Finds, and returns, the mount entry for the file system where the file + * resides. + */ + @Override + UnixMountEntry findMountEntry() throws IOException { + AixFileSystem fs = (AixFileSystem)file().getFileSystem(); + + // step 1: get realpath + UnixPath path = null; + try { + byte[] rp = UnixNativeDispatcher.realpath(file()); + path = new UnixPath(fs, rp); + } catch (UnixException x) { + x.rethrowAsIOException(file()); + } + + // step 2: find mount point + UnixPath parent = path.getParent(); + while (parent != null) { + UnixFileAttributes attrs = null; + try { + attrs = UnixFileAttributes.get(parent, true); + } catch (UnixException x) { + x.rethrowAsIOException(parent); + } + if (attrs.dev() != dev()) + break; + path = parent; + parent = parent.getParent(); + } + + // step 3: lookup mounted file systems + byte[] dir = path.asByteArray(); + for (UnixMountEntry entry: fs.getMountEntries()) { + if (Arrays.equals(dir, entry.dir())) + return entry; + } + + throw new IOException("Mount point not found"); + } + + // returns true if extended attributes enabled on file system where given + // file resides, returns false if disabled or unable to determine. + private boolean isExtendedAttributesEnabled(UnixPath path) { + return false; + } + + @Override + public boolean supportsFileAttributeView(Class type) { + return super.supportsFileAttributeView(type); + } + + @Override + public boolean supportsFileAttributeView(String name) { + return super.supportsFileAttributeView(name); + } +} diff --git a/jdk/src/aix/classes/sun/nio/fs/AixFileSystem.java b/jdk/src/aix/classes/sun/nio/fs/AixFileSystem.java new file mode 100644 index 00000000000..1169dd31606 --- /dev/null +++ b/jdk/src/aix/classes/sun/nio/fs/AixFileSystem.java @@ -0,0 +1,94 @@ +/* + * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright 2013 SAP AG. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.nio.fs; + +import java.nio.file.*; +import java.nio.file.attribute.*; +import java.io.IOException; +import java.util.*; +import static sun.nio.fs.AixNativeDispatcher.*; + +/** + * AIX implementation of FileSystem + */ + +class AixFileSystem extends UnixFileSystem { + + AixFileSystem(UnixFileSystemProvider provider, String dir) { + super(provider, dir); + } + + @Override + public WatchService newWatchService() + throws IOException + { + return new PollingWatchService(); + } + + // lazy initialization of the list of supported attribute views + private static class SupportedFileFileAttributeViewsHolder { + static final Set supportedFileAttributeViews = + supportedFileAttributeViews(); + private static Set supportedFileAttributeViews() { + Set result = new HashSet(); + result.addAll(UnixFileSystem.standardFileAttributeViews()); + return Collections.unmodifiableSet(result); + } + } + + @Override + public Set supportedFileAttributeViews() { + return SupportedFileFileAttributeViewsHolder.supportedFileAttributeViews; + } + + @Override + void copyNonPosixAttributes(int ofd, int nfd) { + // TODO: Implement if needed. + } + + /** + * Returns object to iterate over the mount entries returned by mntctl + */ + @Override + Iterable getMountEntries() { + UnixMountEntry[] entries = null; + try { + entries = getmntctl(); + } catch (UnixException x) { + // nothing we can do + } + if (entries == null) { + return Collections.emptyList(); + } + return Arrays.asList(entries); + } + + @Override + FileStore getFileStore(UnixMountEntry entry) throws IOException { + return new AixFileStore(this, entry); + } +} diff --git a/jdk/src/aix/classes/sun/nio/fs/AixFileSystemProvider.java b/jdk/src/aix/classes/sun/nio/fs/AixFileSystemProvider.java new file mode 100644 index 00000000000..5718d87b387 --- /dev/null +++ b/jdk/src/aix/classes/sun/nio/fs/AixFileSystemProvider.java @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright 2013 SAP AG. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.nio.fs; + +import java.io.IOException; + +/** + * AIX implementation of FileSystemProvider + */ + +public class AixFileSystemProvider extends UnixFileSystemProvider { + public AixFileSystemProvider() { + super(); + } + + @Override + AixFileSystem newFileSystem(String dir) { + return new AixFileSystem(this, dir); + } + + /** + * @see sun.nio.fs.UnixFileSystemProvider#getFileStore(sun.nio.fs.UnixPath) + */ + @Override + AixFileStore getFileStore(UnixPath path) throws IOException { + return new AixFileStore(path); + } +} diff --git a/jdk/src/aix/classes/sun/nio/fs/AixNativeDispatcher.java b/jdk/src/aix/classes/sun/nio/fs/AixNativeDispatcher.java new file mode 100644 index 00000000000..d46d80fc97f --- /dev/null +++ b/jdk/src/aix/classes/sun/nio/fs/AixNativeDispatcher.java @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright 2013 SAP AG. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.nio.fs; + +import java.security.AccessController; +import java.security.PrivilegedAction; + +/** + * AIX specific system calls. + */ + +class AixNativeDispatcher extends UnixNativeDispatcher { + private AixNativeDispatcher() { } + + /** + * Special implementation of 'getextmntent' (see SolarisNativeDispatcher) + * that returns all entries at once. + */ + static native UnixMountEntry[] getmntctl() throws UnixException; + + // initialize + private static native int init(); + + static { + AccessController.doPrivileged(new PrivilegedAction() { + public Void run() { + System.loadLibrary("nio"); + return null; + }}); + init(); + } +} diff --git a/jdk/src/aix/classes/sun/tools/attach/AixAttachProvider.java b/jdk/src/aix/classes/sun/tools/attach/AixAttachProvider.java new file mode 100644 index 00000000000..a78c6609720 --- /dev/null +++ b/jdk/src/aix/classes/sun/tools/attach/AixAttachProvider.java @@ -0,0 +1,88 @@ +/* + * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright 2013 SAP AG. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package sun.tools.attach; + +import com.sun.tools.attach.VirtualMachine; +import com.sun.tools.attach.VirtualMachineDescriptor; +import com.sun.tools.attach.AttachNotSupportedException; +import com.sun.tools.attach.spi.AttachProvider; + +import java.io.IOException; + +// Based on 'LinuxAttachProvider.java'. All occurrences of the string +// "Linux" have been textually replaced by "Aix" to avoid confusion. + +/* + * An AttachProvider implementation for Aix that uses a UNIX domain + * socket. + */ +public class AixAttachProvider extends HotSpotAttachProvider { + + // perf counter for the JVM version + private static final String JVM_VERSION = "java.property.java.vm.version"; + + public AixAttachProvider() { + } + + public String name() { + return "sun"; + } + + public String type() { + return "socket"; + } + + public VirtualMachine attachVirtualMachine(String vmid) + throws AttachNotSupportedException, IOException + { + checkAttachPermission(); + + // AttachNotSupportedException will be thrown if the target VM can be determined + // to be not attachable. + testAttachable(vmid); + + return new AixVirtualMachine(this, vmid); + } + + public VirtualMachine attachVirtualMachine(VirtualMachineDescriptor vmd) + throws AttachNotSupportedException, IOException + { + if (vmd.provider() != this) { + throw new AttachNotSupportedException("provider mismatch"); + } + // To avoid re-checking if the VM if attachable, we check if the descriptor + // is for a hotspot VM - these descriptors are created by the listVirtualMachines + // implementation which only returns a list of attachable VMs. + if (vmd instanceof HotSpotVirtualMachineDescriptor) { + assert ((HotSpotVirtualMachineDescriptor)vmd).isAttachable(); + checkAttachPermission(); + return new AixVirtualMachine(this, vmd.id()); + } else { + return attachVirtualMachine(vmd.id()); + } + } + +} diff --git a/jdk/src/aix/classes/sun/tools/attach/AixVirtualMachine.java b/jdk/src/aix/classes/sun/tools/attach/AixVirtualMachine.java new file mode 100644 index 00000000000..714f5c0d570 --- /dev/null +++ b/jdk/src/aix/classes/sun/tools/attach/AixVirtualMachine.java @@ -0,0 +1,317 @@ +/* + * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright 2013 SAP AG. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package sun.tools.attach; + +import com.sun.tools.attach.VirtualMachine; +import com.sun.tools.attach.AgentLoadException; +import com.sun.tools.attach.AttachNotSupportedException; +import com.sun.tools.attach.spi.AttachProvider; +import java.io.InputStream; +import java.io.IOException; +import java.io.File; +import java.util.Properties; + +// Based on 'LinuxVirtualMachine.java'. All occurrences of the string +// "Linux" have been textually replaced by "Aix" to avoid confusion. + +/* + * Aix implementation of HotSpotVirtualMachine + */ +public class AixVirtualMachine extends HotSpotVirtualMachine { + // "/tmp" is used as a global well-known location for the files + // .java_pid. and .attach_pid. It is important that this + // location is the same for all processes, otherwise the tools + // will not be able to find all Hotspot processes. + // Any changes to this needs to be synchronized with HotSpot. + private static final String tmpdir = "/tmp"; + + // The patch to the socket file created by the target VM + String path; + + /** + * Attaches to the target VM + */ + AixVirtualMachine(AttachProvider provider, String vmid) + throws AttachNotSupportedException, IOException + { + super(provider, vmid); + + // This provider only understands pids + int pid; + try { + pid = Integer.parseInt(vmid); + } catch (NumberFormatException x) { + throw new AttachNotSupportedException("Invalid process identifier"); + } + + // Find the socket file. If not found then we attempt to start the + // attach mechanism in the target VM by sending it a QUIT signal. + // Then we attempt to find the socket file again. + path = findSocketFile(pid); + if (path == null) { + File f = createAttachFile(pid); + try { + sendQuitTo(pid); + + // give the target VM time to start the attach mechanism + int i = 0; + long delay = 200; + int retries = (int)(attachTimeout() / delay); + do { + try { + Thread.sleep(delay); + } catch (InterruptedException x) { } + path = findSocketFile(pid); + i++; + } while (i <= retries && path == null); + if (path == null) { + throw new AttachNotSupportedException( + "Unable to open socket file: target process not responding " + + "or HotSpot VM not loaded"); + } + } finally { + f.delete(); + } + } + + // Check that the file owner/permission to avoid attaching to + // bogus process + checkPermissions(path); + + // Check that we can connect to the process + // - this ensures we throw the permission denied error now rather than + // later when we attempt to enqueue a command. + int s = socket(); + try { + connect(s, path); + } finally { + close(s); + } + } + + /** + * Detach from the target VM + */ + public void detach() throws IOException { + synchronized (this) { + if (this.path != null) { + this.path = null; + } + } + } + + // protocol version + private final static String PROTOCOL_VERSION = "1"; + + // known errors + private final static int ATTACH_ERROR_BADVERSION = 101; + + /** + * Execute the given command in the target VM. + */ + InputStream execute(String cmd, Object ... args) throws AgentLoadException, IOException { + assert args.length <= 3; // includes null + + // did we detach? + String p; + synchronized (this) { + if (this.path == null) { + throw new IOException("Detached from target VM"); + } + p = this.path; + } + + // create UNIX socket + int s = socket(); + + // connect to target VM + try { + connect(s, p); + } catch (IOException x) { + close(s); + throw x; + } + + IOException ioe = null; + + // connected - write request + // + try { + writeString(s, PROTOCOL_VERSION); + writeString(s, cmd); + + for (int i=0; i<3; i++) { + if (i < args.length && args[i] != null) { + writeString(s, (String)args[i]); + } else { + writeString(s, ""); + } + } + } catch (IOException x) { + ioe = x; + } + + + // Create an input stream to read reply + SocketInputStream sis = new SocketInputStream(s); + + // Read the command completion status + int completionStatus; + try { + completionStatus = readInt(sis); + } catch (IOException x) { + sis.close(); + if (ioe != null) { + throw ioe; + } else { + throw x; + } + } + + if (completionStatus != 0) { + sis.close(); + + // In the event of a protocol mismatch then the target VM + // returns a known error so that we can throw a reasonable + // error. + if (completionStatus == ATTACH_ERROR_BADVERSION) { + throw new IOException("Protocol mismatch with target VM"); + } + + // Special-case the "load" command so that the right exception is + // thrown. + if (cmd.equals("load")) { + throw new AgentLoadException("Failed to load agent library"); + } else { + throw new IOException("Command failed in target VM"); + } + } + + // Return the input stream so that the command output can be read + return sis; + } + + /* + * InputStream for the socket connection to get target VM + */ + private class SocketInputStream extends InputStream { + int s; + + public SocketInputStream(int s) { + this.s = s; + } + + public synchronized int read() throws IOException { + byte b[] = new byte[1]; + int n = this.read(b, 0, 1); + if (n == 1) { + return b[0] & 0xff; + } else { + return -1; + } + } + + public synchronized int read(byte[] bs, int off, int len) throws IOException { + if ((off < 0) || (off > bs.length) || (len < 0) || + ((off + len) > bs.length) || ((off + len) < 0)) { + throw new IndexOutOfBoundsException(); + } else if (len == 0) + return 0; + + return AixVirtualMachine.read(s, bs, off, len); + } + + public void close() throws IOException { + AixVirtualMachine.close(s); + } + } + + // Return the socket file for the given process. + private String findSocketFile(int pid) { + File f = new File(tmpdir, ".java_pid" + pid); + if (!f.exists()) { + return null; + } + return f.getPath(); + } + + // On Solaris/Linux/Aix a simple handshake is used to start the attach mechanism + // if not already started. The client creates a .attach_pid file in the + // target VM's working directory (or temp directory), and the SIGQUIT handler + // checks for the file. + private File createAttachFile(int pid) throws IOException { + String fn = ".attach_pid" + pid; + String path = "/proc/" + pid + "/cwd/" + fn; + File f = new File(path); + try { + f.createNewFile(); + } catch (IOException x) { + f = new File(tmpdir, fn); + f.createNewFile(); + } + return f; + } + + /* + * Write/sends the given to the target VM. String is transmitted in + * UTF-8 encoding. + */ + private void writeString(int fd, String s) throws IOException { + if (s.length() > 0) { + byte b[]; + try { + b = s.getBytes("UTF-8"); + } catch (java.io.UnsupportedEncodingException x) { + throw new InternalError(x); + } + AixVirtualMachine.write(fd, b, 0, b.length); + } + byte b[] = new byte[1]; + b[0] = 0; + write(fd, b, 0, 1); + } + + + //-- native methods + + static native void sendQuitTo(int pid) throws IOException; + + static native void checkPermissions(String path) throws IOException; + + static native int socket() throws IOException; + + static native void connect(int fd, String path) throws IOException; + + static native void close(int fd) throws IOException; + + static native int read(int fd, byte buf[], int off, int bufLen) throws IOException; + + static native void write(int fd, byte buf[], int off, int bufLen) throws IOException; + + static { + System.loadLibrary("attach"); + } +} diff --git a/jdk/src/aix/native/java/net/aix_close.c b/jdk/src/aix/native/java/net/aix_close.c new file mode 100644 index 00000000000..d62ffe772df --- /dev/null +++ b/jdk/src/aix/native/java/net/aix_close.c @@ -0,0 +1,427 @@ +/* + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * 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. + */ + +/* + * This file contains implementations of NET_... functions. The NET_.. functions are + * wrappers for common file- and socket functions plus provisions for non-blocking IO. + * + * (basically, the layers remember all file descriptors waiting for a particular fd; + * all threads waiting on a certain fd can be woken up by sending them a signal; this + * is done e.g. when the fd is closed.) + * + * This was originally copied from the linux_close.c implementation. + * + * Side Note: This coding needs initialization. Under Linux this is done + * automatically via __attribute((constructor)), on AIX this is done manually + * (see aix_close_init). + * + */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +/* + * Stack allocated by thread when doing blocking operation + */ +typedef struct threadEntry { + pthread_t thr; /* this thread */ + struct threadEntry *next; /* next thread */ + int intr; /* interrupted */ +} threadEntry_t; + +/* + * Heap allocated during initialized - one entry per fd + */ +typedef struct { + pthread_mutex_t lock; /* fd lock */ + threadEntry_t *threads; /* threads blocked on fd */ +} fdEntry_t; + +/* + * Signal to unblock thread + */ +static int sigWakeup = (SIGRTMAX - 1); + +/* + * The fd table and the number of file descriptors + */ +static fdEntry_t *fdTable = NULL; +static int fdCount = 0; + +/* + * Null signal handler + */ +static void sig_wakeup(int sig) { +} + +/* + * Initialization routine (executed when library is loaded) + * Allocate fd tables and sets up signal handler. + * + * On AIX we don't have __attribute((constructor)) so we need to initialize + * manually (from JNI_OnLoad() in 'src/share/native/java/net/net_util.c') + */ +void aix_close_init() { + struct rlimit nbr_files; + sigset_t sigset; + struct sigaction sa; + + /* Check already initialized */ + if (fdCount > 0 && fdTable != NULL) { + return; + } + + /* + * Allocate table based on the maximum number of + * file descriptors. + */ + if (-1 == getrlimit(RLIMIT_NOFILE, &nbr_files)) { + fprintf(stderr, "library initialization failed - " + "unable to get max # of allocated fds\n"); + abort(); + } + fdCount = nbr_files.rlim_max; + /* + * We have a conceptual problem here, when the number of files is + * unlimited. As a kind of workaround, we ensure the table is big + * enough for handle even a large number of files. Since SAP itself + * recommends a limit of 32000 files, we just use 64000 as 'infinity'. + */ + if (nbr_files.rlim_max == RLIM_INFINITY) { + fdCount = 64000; + } + fdTable = (fdEntry_t *)calloc(fdCount, sizeof(fdEntry_t)); + if (fdTable == NULL) { + fprintf(stderr, "library initialization failed - " + "unable to allocate file descriptor table - out of memory"); + abort(); + } + + { + int i; + for (i=0; i < fdCount; i++) { + pthread_mutex_init(&fdTable[i].lock, NULL); + } + } + + /* + * Setup the signal handler + */ + sa.sa_handler = sig_wakeup; + sa.sa_flags = 0; + sigemptyset(&sa.sa_mask); + sigaction(sigWakeup, &sa, NULL); + + sigemptyset(&sigset); + sigaddset(&sigset, sigWakeup); + sigprocmask(SIG_UNBLOCK, &sigset, NULL); +} + +/* + * Return the fd table for this fd or NULL is fd out + * of range. + */ +static inline fdEntry_t *getFdEntry(int fd) +{ + if (fd < 0 || fd >= fdCount) { + return NULL; + } + return &fdTable[fd]; +} + +/* + * Start a blocking operation :- + * Insert thread onto thread list for the fd. + */ +static inline void startOp(fdEntry_t *fdEntry, threadEntry_t *self) +{ + self->thr = pthread_self(); + self->intr = 0; + + pthread_mutex_lock(&(fdEntry->lock)); + { + self->next = fdEntry->threads; + fdEntry->threads = self; + } + pthread_mutex_unlock(&(fdEntry->lock)); +} + +/* + * End a blocking operation :- + * Remove thread from thread list for the fd + * If fd has been interrupted then set errno to EBADF + */ +static inline void endOp + (fdEntry_t *fdEntry, threadEntry_t *self) +{ + int orig_errno = errno; + pthread_mutex_lock(&(fdEntry->lock)); + { + threadEntry_t *curr, *prev=NULL; + curr = fdEntry->threads; + while (curr != NULL) { + if (curr == self) { + if (curr->intr) { + orig_errno = EBADF; + } + if (prev == NULL) { + fdEntry->threads = curr->next; + } else { + prev->next = curr->next; + } + break; + } + prev = curr; + curr = curr->next; + } + } + pthread_mutex_unlock(&(fdEntry->lock)); + errno = orig_errno; +} + +/* + * Close or dup2 a file descriptor ensuring that all threads blocked on + * the file descriptor are notified via a wakeup signal. + * + * fd1 < 0 => close(fd2) + * fd1 >= 0 => dup2(fd1, fd2) + * + * Returns -1 with errno set if operation fails. + */ +static int closefd(int fd1, int fd2) { + int rv, orig_errno; + fdEntry_t *fdEntry = getFdEntry(fd2); + if (fdEntry == NULL) { + errno = EBADF; + return -1; + } + + /* + * Lock the fd to hold-off additional I/O on this fd. + */ + pthread_mutex_lock(&(fdEntry->lock)); + + { + /* + * And close/dup the file descriptor + * (restart if interrupted by signal) + */ + do { + if (fd1 < 0) { + rv = close(fd2); + } else { + rv = dup2(fd1, fd2); + } + } while (rv == -1 && errno == EINTR); + + /* + * Send a wakeup signal to all threads blocked on this + * file descriptor. + */ + threadEntry_t *curr = fdEntry->threads; + while (curr != NULL) { + curr->intr = 1; + pthread_kill( curr->thr, sigWakeup ); + curr = curr->next; + } + } + + /* + * Unlock without destroying errno + */ + orig_errno = errno; + pthread_mutex_unlock(&(fdEntry->lock)); + errno = orig_errno; + + return rv; +} + +/* + * Wrapper for dup2 - same semantics as dup2 system call except + * that any threads blocked in an I/O system call on fd2 will be + * preempted and return -1/EBADF; + */ +int NET_Dup2(int fd, int fd2) { + if (fd < 0) { + errno = EBADF; + return -1; + } + return closefd(fd, fd2); +} + +/* + * Wrapper for close - same semantics as close system call + * except that any threads blocked in an I/O on fd will be + * preempted and the I/O system call will return -1/EBADF. + */ +int NET_SocketClose(int fd) { + return closefd(-1, fd); +} + +/************** Basic I/O operations here ***************/ + +/* + * Macro to perform a blocking IO operation. Restarts + * automatically if interrupted by signal (other than + * our wakeup signal) + */ +#define BLOCKING_IO_RETURN_INT(FD, FUNC) { \ + int ret; \ + threadEntry_t self; \ + fdEntry_t *fdEntry = getFdEntry(FD); \ + if (fdEntry == NULL) { \ + errno = EBADF; \ + return -1; \ + } \ + do { \ + startOp(fdEntry, &self); \ + ret = FUNC; \ + endOp(fdEntry, &self); \ + } while (ret == -1 && errno == EINTR); \ + return ret; \ +} + +int NET_Read(int s, void* buf, size_t len) { + BLOCKING_IO_RETURN_INT( s, recv(s, buf, len, 0) ); +} + +int NET_ReadV(int s, const struct iovec * vector, int count) { + BLOCKING_IO_RETURN_INT( s, readv(s, vector, count) ); +} + +int NET_RecvFrom(int s, void *buf, int len, unsigned int flags, + struct sockaddr *from, int *fromlen) { + socklen_t socklen = *fromlen; + BLOCKING_IO_RETURN_INT( s, recvfrom(s, buf, len, flags, from, &socklen) ); + *fromlen = socklen; +} + +int NET_Send(int s, void *msg, int len, unsigned int flags) { + BLOCKING_IO_RETURN_INT( s, send(s, msg, len, flags) ); +} + +int NET_WriteV(int s, const struct iovec * vector, int count) { + BLOCKING_IO_RETURN_INT( s, writev(s, vector, count) ); +} + +int NET_SendTo(int s, const void *msg, int len, unsigned int + flags, const struct sockaddr *to, int tolen) { + BLOCKING_IO_RETURN_INT( s, sendto(s, msg, len, flags, to, tolen) ); +} + +int NET_Accept(int s, struct sockaddr *addr, int *addrlen) { + socklen_t socklen = *addrlen; + BLOCKING_IO_RETURN_INT( s, accept(s, addr, &socklen) ); + *addrlen = socklen; +} + +int NET_Connect(int s, struct sockaddr *addr, int addrlen) { + BLOCKING_IO_RETURN_INT( s, connect(s, addr, addrlen) ); +} + +#ifndef USE_SELECT +int NET_Poll(struct pollfd *ufds, unsigned int nfds, int timeout) { + BLOCKING_IO_RETURN_INT( ufds[0].fd, poll(ufds, nfds, timeout) ); +} +#else +int NET_Select(int s, fd_set *readfds, fd_set *writefds, + fd_set *exceptfds, struct timeval *timeout) { + BLOCKING_IO_RETURN_INT( s-1, + select(s, readfds, writefds, exceptfds, timeout) ); +} +#endif + +/* + * Wrapper for poll(s, timeout). + * Auto restarts with adjusted timeout if interrupted by + * signal other than our wakeup signal. + */ +int NET_Timeout(int s, long timeout) { + long prevtime = 0, newtime; + struct timeval t; + fdEntry_t *fdEntry = getFdEntry(s); + + /* + * Check that fd hasn't been closed. + */ + if (fdEntry == NULL) { + errno = EBADF; + return -1; + } + + /* + * Pick up current time as may need to adjust timeout + */ + if (timeout > 0) { + gettimeofday(&t, NULL); + prevtime = t.tv_sec * 1000 + t.tv_usec / 1000; + } + + for(;;) { + struct pollfd pfd; + int rv; + threadEntry_t self; + + /* + * Poll the fd. If interrupted by our wakeup signal + * errno will be set to EBADF. + */ + pfd.fd = s; + pfd.events = POLLIN | POLLERR; + + startOp(fdEntry, &self); + rv = poll(&pfd, 1, timeout); + endOp(fdEntry, &self); + + /* + * If interrupted then adjust timeout. If timeout + * has expired return 0 (indicating timeout expired). + */ + if (rv < 0 && errno == EINTR) { + if (timeout > 0) { + gettimeofday(&t, NULL); + newtime = t.tv_sec * 1000 + t.tv_usec / 1000; + timeout -= newtime - prevtime; + if (timeout <= 0) { + return 0; + } + prevtime = newtime; + } + } else { + return rv; + } + + } +} diff --git a/jdk/src/aix/native/sun/nio/ch/AixPollPort.c b/jdk/src/aix/native/sun/nio/ch/AixPollPort.c new file mode 100644 index 00000000000..70064b890ef --- /dev/null +++ b/jdk/src/aix/native/sun/nio/ch/AixPollPort.c @@ -0,0 +1,175 @@ +/* + * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright 2012 SAP AG. All rights reserved. + * 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 "jni.h" +#include "jni_util.h" +#include "jvm.h" +#include "jlong.h" + +#include "sun_nio_ch_AixPollPort.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* Initially copied from src/solaris/native/sun/nio/ch/nio_util.h */ +#define RESTARTABLE(_cmd, _result) do { \ + do { \ + _result = _cmd; \ + } while((_result == -1) && (errno == EINTR)); \ +} while(0) + +typedef pollset_t pollset_create_func(int maxfd); +typedef int pollset_destroy_func(pollset_t ps); +typedef int pollset_ctl_func(pollset_t ps, struct poll_ctl *pollctl_array, int array_length); +typedef int pollset_poll_func(pollset_t ps, struct pollfd *polldata_array, int array_length, int timeout); +static pollset_create_func* _pollset_create = NULL; +static pollset_destroy_func* _pollset_destroy = NULL; +static pollset_ctl_func* _pollset_ctl = NULL; +static pollset_poll_func* _pollset_poll = NULL; + +JNIEXPORT void JNICALL +Java_sun_nio_ch_AixPollPort_init(JNIEnv* env, jclass this) { + _pollset_create = (pollset_create_func*) dlsym(RTLD_DEFAULT, "pollset_create"); + _pollset_destroy = (pollset_destroy_func*) dlsym(RTLD_DEFAULT, "pollset_destroy"); + _pollset_ctl = (pollset_ctl_func*) dlsym(RTLD_DEFAULT, "pollset_ctl"); + _pollset_poll = (pollset_poll_func*) dlsym(RTLD_DEFAULT, "pollset_poll"); + if (_pollset_create == NULL || _pollset_destroy == NULL || + _pollset_ctl == NULL || _pollset_poll == NULL) { + JNU_ThrowInternalError(env, "unable to get address of pollset functions"); + } +} + +JNIEXPORT jint JNICALL +Java_sun_nio_ch_AixPollPort_eventSize(JNIEnv* env, jclass this) { + return sizeof(struct pollfd); +} + +JNIEXPORT jint JNICALL +Java_sun_nio_ch_AixPollPort_eventsOffset(JNIEnv* env, jclass this) { + return offsetof(struct pollfd, events); +} + +JNIEXPORT jint JNICALL +Java_sun_nio_ch_AixPollPort_reventsOffset(JNIEnv* env, jclass this) { + return offsetof(struct pollfd, revents); +} + +JNIEXPORT jint JNICALL +Java_sun_nio_ch_AixPollPort_fdOffset(JNIEnv* env, jclass this) { + return offsetof(struct pollfd, fd); +} + +JNIEXPORT jint JNICALL +Java_sun_nio_ch_AixPollPort_pollsetCreate(JNIEnv *env, jclass c) { + /* pollset_create can take the maximum number of fds, but we + * cannot predict this number so we leave it at OPEN_MAX. */ + pollset_t ps = _pollset_create(-1); + if (ps < 0) { + JNU_ThrowIOExceptionWithLastError(env, "pollset_create failed"); + } + return (int)ps; +} + +JNIEXPORT jint JNICALL +Java_sun_nio_ch_AixPollPort_pollsetCtl(JNIEnv *env, jclass c, jint ps, + jint opcode, jint fd, jint events) { + struct poll_ctl event; + int res; + + event.cmd = opcode; + event.events = events; + event.fd = fd; + + RESTARTABLE(_pollset_ctl((pollset_t)ps, &event, 1 /* length */), res); + + return (res == 0) ? 0 : errno; +} + +JNIEXPORT jint JNICALL +Java_sun_nio_ch_AixPollPort_pollsetPoll(JNIEnv *env, jclass c, + jint ps, jlong address, jint numfds) { + struct pollfd *events = jlong_to_ptr(address); + int res; + + RESTARTABLE(_pollset_poll(ps, events, numfds, -1), res); + if (res < 0) { + JNU_ThrowIOExceptionWithLastError(env, "pollset_poll failed"); + } + return res; +} + +JNIEXPORT void JNICALL +Java_sun_nio_ch_AixPollPort_pollsetDestroy(JNIEnv *env, jclass c, jint ps) { + int res; + RESTARTABLE(_pollset_destroy((pollset_t)ps), res); +} + +JNIEXPORT void JNICALL +Java_sun_nio_ch_AixPollPort_socketpair(JNIEnv* env, jclass clazz, jintArray sv) { + int sp[2]; + if (socketpair(PF_UNIX, SOCK_STREAM, 0, sp) == -1) { + JNU_ThrowIOExceptionWithLastError(env, "socketpair failed"); + } else { + jint res[2]; + res[0] = (jint)sp[0]; + res[1] = (jint)sp[1]; + (*env)->SetIntArrayRegion(env, sv, 0, 2, &res[0]); + } +} + +JNIEXPORT void JNICALL +Java_sun_nio_ch_AixPollPort_interrupt(JNIEnv *env, jclass c, jint fd) { + int res; + int buf[1]; + buf[0] = 1; + RESTARTABLE(write(fd, buf, 1), res); + if (res < 0) { + JNU_ThrowIOExceptionWithLastError(env, "write failed"); + } +} + +JNIEXPORT void JNICALL +Java_sun_nio_ch_AixPollPort_drain1(JNIEnv *env, jclass cl, jint fd) { + int res; + char buf[1]; + RESTARTABLE(read(fd, buf, 1), res); + if (res < 0) { + JNU_ThrowIOExceptionWithLastError(env, "drain1 failed"); + } +} + +JNIEXPORT void JNICALL +Java_sun_nio_ch_AixPollPort_close0(JNIEnv *env, jclass c, jint fd) { + int res; + RESTARTABLE(close(fd), res); +} diff --git a/jdk/src/aix/native/sun/nio/fs/AixNativeDispatcher.c b/jdk/src/aix/native/sun/nio/fs/AixNativeDispatcher.c new file mode 100644 index 00000000000..82d8f6203e7 --- /dev/null +++ b/jdk/src/aix/native/sun/nio/fs/AixNativeDispatcher.c @@ -0,0 +1,227 @@ +/* + * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright 2013 SAP AG. All rights reserved. + * 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 + +#include "jni.h" +#include "jni_util.h" + +#include "sun_nio_fs_AixNativeDispatcher.h" + +static jfieldID entry_name; +static jfieldID entry_dir; +static jfieldID entry_fstype; +static jfieldID entry_options; + +static jclass entry_cls; + +/** + * Call this to throw an internal UnixException when a system/library + * call fails + */ +static void throwUnixException(JNIEnv* env, int errnum) { + jobject x = JNU_NewObjectByName(env, "sun/nio/fs/UnixException", + "(I)V", errnum); + if (x != NULL) { + (*env)->Throw(env, x); + } +} + +/** + * Initialization + */ +JNIEXPORT jint JNICALL +Java_sun_nio_fs_AixNativeDispatcher_init(JNIEnv* env, jclass this) +{ + jint flags = 0; + jclass clazz; + + clazz = (*env)->FindClass(env, "sun/nio/fs/UnixMountEntry"); + if (clazz == NULL) { + return 0; + } + entry_name = (*env)->GetFieldID(env, clazz, "name", "[B"); + entry_dir = (*env)->GetFieldID(env, clazz, "dir", "[B"); + entry_fstype = (*env)->GetFieldID(env, clazz, "fstype", "[B"); + entry_options = (*env)->GetFieldID(env, clazz, "opts", "[B"); + entry_cls = (*env)->NewGlobalRef(env, clazz); + + return 0; +} + +/** + * Special implementation of getextmntent (see SolarisNativeDispatcher.c) + * that returns all entries at once. + */ +JNIEXPORT jobjectArray JNICALL +Java_sun_nio_fs_AixNativeDispatcher_getmntctl(JNIEnv* env, jclass this) +{ + int must_free_buf = 0; + char stack_buf[1024]; + char* buffer = stack_buf; + size_t buffer_size = 1024; + int num_entries; + int i; + jobjectArray ret; + struct vmount * vm; + + for (i = 0; i < 5; i++) { + num_entries = mntctl(MCTL_QUERY, buffer_size, buffer); + if (num_entries != 0) { + break; + } + if (must_free_buf) { + free(buffer); + } + buffer_size *= 8; + buffer = malloc(buffer_size); + must_free_buf = 1; + } + /* Treat zero entries like errors. */ + if (num_entries <= 0) { + if (must_free_buf) { + free(buffer); + } + throwUnixException(env, errno); + return NULL; + } + ret = (*env)->NewObjectArray(env, num_entries, entry_cls, NULL); + if (ret == NULL) { + if (must_free_buf) { + free(buffer); + } + return NULL; + } + vm = (struct vmount*)buffer; + for (i = 0; i < num_entries; i++) { + jsize len; + jbyteArray bytes; + const char* fstype; + /* We set all relevant attributes so there is no need to call constructor. */ + jobject entry = (*env)->AllocObject(env, entry_cls); + if (entry == NULL) { + if (must_free_buf) { + free(buffer); + } + return NULL; + } + (*env)->SetObjectArrayElement(env, ret, i, entry); + + /* vm->vmt_data[...].vmt_size is 32 bit aligned and also includes NULL byte. */ + /* Since we only need the characters, it is necessary to check string size manually. */ + len = strlen((char*)vm + vm->vmt_data[VMT_OBJECT].vmt_off); + bytes = (*env)->NewByteArray(env, len); + if (bytes == NULL) { + if (must_free_buf) { + free(buffer); + } + return NULL; + } + (*env)->SetByteArrayRegion(env, bytes, 0, len, (jbyte*)((char *)vm + vm->vmt_data[VMT_OBJECT].vmt_off)); + (*env)->SetObjectField(env, entry, entry_name, bytes); + + len = strlen((char*)vm + vm->vmt_data[VMT_STUB].vmt_off); + bytes = (*env)->NewByteArray(env, len); + if (bytes == NULL) { + if (must_free_buf) { + free(buffer); + } + return NULL; + } + (*env)->SetByteArrayRegion(env, bytes, 0, len, (jbyte*)((char *)vm + vm->vmt_data[VMT_STUB].vmt_off)); + (*env)->SetObjectField(env, entry, entry_dir, bytes); + + switch (vm->vmt_gfstype) { + case MNT_J2: + fstype = "jfs2"; + break; + case MNT_NAMEFS: + fstype = "namefs"; + break; + case MNT_NFS: + fstype = "nfs"; + break; + case MNT_JFS: + fstype = "jfs"; + break; + case MNT_CDROM: + fstype = "cdrom"; + break; + case MNT_PROCFS: + fstype = "procfs"; + break; + case MNT_NFS3: + fstype = "nfs3"; + break; + case MNT_AUTOFS: + fstype = "autofs"; + break; + case MNT_UDF: + fstype = "udfs"; + break; + case MNT_NFS4: + fstype = "nfs4"; + break; + case MNT_CIFS: + fstype = "smbfs"; + break; + default: + fstype = "unknown"; + } + len = strlen(fstype); + bytes = (*env)->NewByteArray(env, len); + if (bytes == NULL) { + if (must_free_buf) { + free(buffer); + } + return NULL; + } + (*env)->SetByteArrayRegion(env, bytes, 0, len, (jbyte*)fstype); + (*env)->SetObjectField(env, entry, entry_fstype, bytes); + + len = strlen((char*)vm + vm->vmt_data[VMT_ARGS].vmt_off); + bytes = (*env)->NewByteArray(env, len); + if (bytes == NULL) { + if (must_free_buf) { + free(buffer); + } + return NULL; + } + (*env)->SetByteArrayRegion(env, bytes, 0, len, (jbyte*)((char *)vm + vm->vmt_data[VMT_ARGS].vmt_off)); + (*env)->SetObjectField(env, entry, entry_options, bytes); + + /* goto the next vmount structure: */ + vm = (struct vmount *)((char *)vm + vm->vmt_length); + } + + if (must_free_buf) { + free(buffer); + } + return ret; +} diff --git a/jdk/src/aix/native/sun/tools/attach/AixVirtualMachine.c b/jdk/src/aix/native/sun/tools/attach/AixVirtualMachine.c new file mode 100644 index 00000000000..a5ba1605132 --- /dev/null +++ b/jdk/src/aix/native/sun/tools/attach/AixVirtualMachine.c @@ -0,0 +1,283 @@ +/* + * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright 2013 SAP AG. All rights reserved. + * 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 "jni.h" +#include "jni_util.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* + * Based on 'LinuxVirtualMachine.c'. Non-relevant code has been removed and all + * occurrences of the string "Linux" have been replaced by "Aix". + */ + +#include "sun_tools_attach_AixVirtualMachine.h" + +#define RESTARTABLE(_cmd, _result) do { \ + do { \ + _result = _cmd; \ + } while((_result == -1) && (errno == EINTR)); \ +} while(0) + + +/* + * Class: sun_tools_attach_AixVirtualMachine + * Method: socket + * Signature: ()I + */ +JNIEXPORT jint JNICALL Java_sun_tools_attach_AixVirtualMachine_socket + (JNIEnv *env, jclass cls) +{ + int fd = socket(PF_UNIX, SOCK_STREAM, 0); + if (fd == -1) { + JNU_ThrowIOExceptionWithLastError(env, "socket"); + } + /* added time out values */ + else { + struct timeval tv; + tv.tv_sec = 2 * 60; + tv.tv_usec = 0; + + setsockopt(fd, SOL_SOCKET, SO_RCVTIMEO, (char*)&tv, sizeof(tv)); + setsockopt(fd, SOL_SOCKET, SO_SNDTIMEO, (char*)&tv, sizeof(tv)); + } + return (jint)fd; +} + +/* + * Class: sun_tools_attach_AixVirtualMachine + * Method: connect + * Signature: (ILjava/lang/String;)I + */ +JNIEXPORT void JNICALL Java_sun_tools_attach_AixVirtualMachine_connect + (JNIEnv *env, jclass cls, jint fd, jstring path) +{ + jboolean isCopy; + const char* p = GetStringPlatformChars(env, path, &isCopy); + if (p != NULL) { + struct sockaddr_un addr; + int err = 0; + + /* added missing structure initialization */ + memset(&addr,0, sizeof(addr)); + addr.sun_family = AF_UNIX; + strcpy(addr.sun_path, p); + /* We must call bind with the actual socketaddr length. This is obligatory for AS400. */ + if (connect(fd, (struct sockaddr*)&addr, SUN_LEN(&addr)) == -1) { + err = errno; + } + + if (isCopy) { + JNU_ReleaseStringPlatformChars(env, path, p); + } + + /* + * If the connect failed then we throw the appropriate exception + * here (can't throw it before releasing the string as can't call + * JNI with pending exception) + */ + if (err != 0) { + if (err == ENOENT) { + JNU_ThrowByName(env, "java/io/FileNotFoundException", NULL); + } else { + char* msg = strdup(strerror(err)); + JNU_ThrowIOException(env, msg); + if (msg != NULL) { + free(msg); + } + } + } + } +} + + +/* + * Structure and callback function used to send a QUIT signal to all + * children of a given process + */ +typedef struct { + pid_t ppid; +} SendQuitContext; + +static void SendQuitCallback(const pid_t pid, void* user_data) { + SendQuitContext* context = (SendQuitContext*)user_data; + pid_t parent = getParent(pid); + if (parent == context->ppid) { + kill(pid, SIGQUIT); + } +} + +/* + * Class: sun_tools_attach_AixVirtualMachine + * Method: sendQuitTo + * Signature: (I)V + */ +JNIEXPORT void JNICALL Java_sun_tools_attach_AixVirtualMachine_sendQuitTo + (JNIEnv *env, jclass cls, jint pid) +{ + if (kill((pid_t)pid, SIGQUIT)) { + JNU_ThrowIOExceptionWithLastError(env, "kill"); + } +} + +/* + * Class: sun_tools_attach_AixVirtualMachine + * Method: checkPermissions + * Signature: (Ljava/lang/String;)V + */ +JNIEXPORT void JNICALL Java_sun_tools_attach_AixVirtualMachine_checkPermissions + (JNIEnv *env, jclass cls, jstring path) +{ + jboolean isCopy; + const char* p = GetStringPlatformChars(env, path, &isCopy); + if (p != NULL) { + struct stat64 sb; + uid_t uid, gid; + int res; + /* added missing initialization of the stat64 buffer */ + memset(&sb, 0, sizeof(struct stat64)); + + /* + * Check that the path is owned by the effective uid/gid of this + * process. Also check that group/other access is not allowed. + */ + uid = geteuid(); + gid = getegid(); + + res = stat64(p, &sb); + if (res != 0) { + /* save errno */ + res = errno; + } + + /* release p here before we throw an I/O exception */ + if (isCopy) { + JNU_ReleaseStringPlatformChars(env, path, p); + } + + if (res == 0) { + if ( (sb.st_uid != uid) || (sb.st_gid != gid) || + ((sb.st_mode & (S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH)) != 0) ) { + JNU_ThrowIOException(env, "well-known file is not secure"); + } + } else { + char* msg = strdup(strerror(res)); + JNU_ThrowIOException(env, msg); + if (msg != NULL) { + free(msg); + } + } + } +} + +/* + * Class: sun_tools_attach_AixVirtualMachine + * Method: close + * Signature: (I)V + */ +JNIEXPORT void JNICALL Java_sun_tools_attach_AixVirtualMachine_close + (JNIEnv *env, jclass cls, jint fd) +{ + int res; + /* Fixed deadlock when this call of close by the client is not seen by the attach server + * which has accepted the (very short) connection already and is waiting for the request. But read don't get a byte, + * because the close is lost without shutdown. + */ + shutdown(fd, 2); + RESTARTABLE(close(fd), res); +} + +/* + * Class: sun_tools_attach_AixVirtualMachine + * Method: read + * Signature: (I[BI)I + */ +JNIEXPORT jint JNICALL Java_sun_tools_attach_AixVirtualMachine_read + (JNIEnv *env, jclass cls, jint fd, jbyteArray ba, jint off, jint baLen) +{ + unsigned char buf[128]; + size_t len = sizeof(buf); + ssize_t n; + + size_t remaining = (size_t)(baLen - off); + if (len > remaining) { + len = remaining; + } + + RESTARTABLE(read(fd, buf+off, len), n); + if (n == -1) { + JNU_ThrowIOExceptionWithLastError(env, "read"); + } else { + if (n == 0) { + n = -1; // EOF + } else { + (*env)->SetByteArrayRegion(env, ba, off, (jint)n, (jbyte *)(buf+off)); + } + } + return n; +} + +/* + * Class: sun_tools_attach_AixVirtualMachine + * Method: write + * Signature: (I[B)V + */ +JNIEXPORT void JNICALL Java_sun_tools_attach_AixVirtualMachine_write + (JNIEnv *env, jclass cls, jint fd, jbyteArray ba, jint off, jint bufLen) +{ + size_t remaining = bufLen; + do { + unsigned char buf[128]; + size_t len = sizeof(buf); + int n; + + if (len > remaining) { + len = remaining; + } + (*env)->GetByteArrayRegion(env, ba, off, len, (jbyte *)buf); + + RESTARTABLE(write(fd, buf, len), n); + if (n > 0) { + off += n; + remaining -= n; + } else { + JNU_ThrowIOExceptionWithLastError(env, "write"); + return; + } + + } while (remaining > 0); +} diff --git a/jdk/src/aix/porting/porting_aix.c b/jdk/src/aix/porting/porting_aix.c new file mode 100644 index 00000000000..659d9c4c06b --- /dev/null +++ b/jdk/src/aix/porting/porting_aix.c @@ -0,0 +1,86 @@ +/* + * Copyright 2012, 2013 SAP AG. All rights reserved. + * 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. + * + */ + +#include +#include +#include + +#include "porting_aix.h" + +static unsigned char dladdr_buffer[0x4000]; + +static void fill_dll_info(void) { + int rc = loadquery(L_GETINFO,dladdr_buffer, sizeof(dladdr_buffer)); + if (rc == -1) { + fprintf(stderr, "loadquery failed (%d %s)", errno, strerror(errno)); + fflush(stderr); + } +} + +static int dladdr_dont_reload(void* addr, Dl_info* info) { + const struct ld_info* p = (struct ld_info*) dladdr_buffer; + info->dli_fbase = 0; info->dli_fname = 0; + info->dli_sname = 0; info->dli_saddr = 0; + for (;;) { + if (addr >= p->ldinfo_textorg && + addr < (((char*)p->ldinfo_textorg) + p->ldinfo_textsize)) { + info->dli_fname = p->ldinfo_filename; + info->dli_fbase = p->ldinfo_textorg; + return 1; /* [sic] */ + } + if (!p->ldinfo_next) { + break; + } + p = (struct ld_info*)(((char*)p) + p->ldinfo_next); + } + return 0; /* [sic] */ +} + +#ifdef __cplusplus +extern "C" +#endif +int dladdr(void *addr, Dl_info *info) { + static int loaded = 0; + if (!loaded) { + fill_dll_info(); + loaded = 1; + } + if (!addr) { + return 0; /* [sic] */ + } + /* Address could be AIX function descriptor? */ + void* const addr0 = *( (void**) addr ); + int rc = dladdr_dont_reload(addr, info); + if (rc == 0) { + rc = dladdr_dont_reload(addr0, info); + if (rc == 0) { /* [sic] */ + fill_dll_info(); /* refill, maybe loadquery info is outdated */ + rc = dladdr_dont_reload(addr, info); + if (rc == 0) { + rc = dladdr_dont_reload(addr0, info); + } + } + } + return rc; +} diff --git a/jdk/src/aix/porting/porting_aix.h b/jdk/src/aix/porting/porting_aix.h new file mode 100644 index 00000000000..79d1062dd67 --- /dev/null +++ b/jdk/src/aix/porting/porting_aix.h @@ -0,0 +1,59 @@ +/* + * Copyright 2012, 2013 SAP AG. All rights reserved. + * 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. + * + */ + +/* + * Header file to contain porting-relevant code which does not have a + * home anywhere else. + * This is intially based on hotspot/src/os/aix/vm/{loadlib,porting}_aix.{hpp,cpp} + */ + +/* + * Aix' own version of dladdr(). + * This function tries to mimick dladdr(3) on Linux + * (see http://linux.die.net/man/3/dladdr) + * dladdr(3) is not POSIX but a GNU extension, and is not available on AIX. + * + * Differences between AIX dladdr and Linux dladdr: + * + * 1) Dl_info.dli_fbase: can never work, is disabled. + * A loaded image on AIX is divided in multiple segments, at least two + * (text and data) but potentially also far more. This is because the loader may + * load each member into an own segment, as for instance happens with the libC.a + * 2) Dl_info.dli_sname: This only works for code symbols (functions); for data, a + * zero-length string is returned (""). + * 3) Dl_info.dli_saddr: For code, this will return the entry point of the function, + * not the function descriptor. + */ + +typedef struct { + const char *dli_fname; /* file path of loaded library */ + void *dli_fbase; /* doesn't make sence on AIX */ + const char *dli_sname; /* symbol name; "" if not known */ + void *dli_saddr; /* address of *entry* of function; not function descriptor; */ +} Dl_info; + +#ifdef __cplusplus +extern "C" +#endif +int dladdr(void *addr, Dl_info *info); diff --git a/jdk/src/share/bin/jli_util.h b/jdk/src/share/bin/jli_util.h index 388910407ff..d3c9f0ff8f2 100644 --- a/jdk/src/share/bin/jli_util.h +++ b/jdk/src/share/bin/jli_util.h @@ -85,6 +85,9 @@ void JLI_CmdToArgs(char *cmdline); #ifdef MACOSX #define JLI_Lseek lseek #endif +#ifdef _AIX +#define JLI_Lseek lseek +#endif #endif /* _WIN32 */ /* diff --git a/jdk/src/share/lib/security/java.security-aix b/jdk/src/share/lib/security/java.security-aix new file mode 100644 index 00000000000..fd49537f609 --- /dev/null +++ b/jdk/src/share/lib/security/java.security-aix @@ -0,0 +1,497 @@ +# +# This is the "master security properties file". +# +# An alternate java.security properties file may be specified +# from the command line via the system property +# +# -Djava.security.properties= +# +# This properties file appends to the master security properties file. +# If both properties files specify values for the same key, the value +# from the command-line properties file is selected, as it is the last +# one loaded. +# +# Also, if you specify +# +# -Djava.security.properties== (2 equals), +# +# then that properties file completely overrides the master security +# properties file. +# +# To disable the ability to specify an additional properties file from +# the command line, set the key security.overridePropertiesFile +# to false in the master security properties file. It is set to true +# by default. + +# In this file, various security properties are set for use by +# java.security classes. This is where users can statically register +# Cryptography Package Providers ("providers" for short). The term +# "provider" refers to a package or set of packages that supply a +# concrete implementation of a subset of the cryptography aspects of +# the Java Security API. A provider may, for example, implement one or +# more digital signature algorithms or message digest algorithms. +# +# Each provider must implement a subclass of the Provider class. +# To register a provider in this master security properties file, +# specify the Provider subclass name and priority in the format +# +# security.provider.= +# +# This declares a provider, and specifies its preference +# order n. The preference order is the order in which providers are +# searched for requested algorithms (when no specific provider is +# requested). The order is 1-based; 1 is the most preferred, followed +# by 2, and so on. +# +# must specify the subclass of the Provider class whose +# constructor sets the values of various properties that are required +# for the Java Security API to look up the algorithms or other +# facilities implemented by the provider. +# +# There must be at least one provider specification in java.security. +# There is a default provider that comes standard with the JDK. It +# is called the "SUN" provider, and its Provider subclass +# named Sun appears in the sun.security.provider package. Thus, the +# "SUN" provider is registered via the following: +# +# security.provider.1=sun.security.provider.Sun +# +# (The number 1 is used for the default provider.) +# +# Note: Providers can be dynamically registered instead by calls to +# either the addProvider or insertProviderAt method in the Security +# class. + +# +# List of providers and their preference orders (see above): +# +security.provider.1=sun.security.provider.Sun +security.provider.2=sun.security.rsa.SunRsaSign +security.provider.3=sun.security.ec.SunEC +security.provider.4=com.sun.net.ssl.internal.ssl.Provider +security.provider.5=com.sun.crypto.provider.SunJCE +security.provider.6=sun.security.jgss.SunProvider +security.provider.7=com.sun.security.sasl.Provider +security.provider.8=org.jcp.xml.dsig.internal.dom.XMLDSigRI +security.provider.9=sun.security.smartcardio.SunPCSC + +# +# Sun Provider SecureRandom seed source. +# +# Select the primary source of seed data for the "SHA1PRNG" and +# "NativePRNG" SecureRandom implementations in the "Sun" provider. +# (Other SecureRandom implementations might also use this property.) +# +# On Unix-like systems (for example, Solaris/Linux/MacOS), the +# "NativePRNG" and "SHA1PRNG" implementations obtains seed data from +# special device files such as file:/dev/random. +# +# On Windows systems, specifying the URLs "file:/dev/random" or +# "file:/dev/urandom" will enable the native Microsoft CryptoAPI seeding +# mechanism for SHA1PRNG. +# +# By default, an attempt is made to use the entropy gathering device +# specified by the "securerandom.source" Security property. If an +# exception occurs while accessing the specified URL: +# +# SHA1PRNG: +# the traditional system/thread activity algorithm will be used. +# +# NativePRNG: +# a default value of /dev/random will be used. If neither +# are available, the implementation will be disabled. +# "file" is the only currently supported protocol type. +# +# The entropy gathering device can also be specified with the System +# property "java.security.egd". For example: +# +# % java -Djava.security.egd=file:/dev/random MainClass +# +# Specifying this System property will override the +# "securerandom.source" Security property. +# +# In addition, if "file:/dev/random" or "file:/dev/urandom" is +# specified, the "NativePRNG" implementation will be more preferred than +# SHA1PRNG in the Sun provider. +# +securerandom.source=file:/dev/random + +# +# A list of known strong SecureRandom implementations. +# +# To help guide applications in selecting a suitable strong +# java.security.SecureRandom implementation, Java distributions should +# indicate a list of known strong implementations using the property. +# +# This is a comma-separated list of algorithm and/or algorithm:provider +# entries. +# +securerandom.strongAlgorithms=NativePRNGBlocking:SUN + +# +# Class to instantiate as the javax.security.auth.login.Configuration +# provider. +# +login.configuration.provider=sun.security.provider.ConfigFile + +# +# Default login configuration file +# +#login.config.url.1=file:${user.home}/.java.login.config + +# +# Class to instantiate as the system Policy. This is the name of the class +# that will be used as the Policy object. +# +policy.provider=sun.security.provider.PolicyFile + +# The default is to have a single system-wide policy file, +# and a policy file in the user's home directory. +policy.url.1=file:${java.home}/lib/security/java.policy +policy.url.2=file:${user.home}/.java.policy + +# whether or not we expand properties in the policy file +# if this is set to false, properties (${...}) will not be expanded in policy +# files. +policy.expandProperties=true + +# whether or not we allow an extra policy to be passed on the command line +# with -Djava.security.policy=somefile. Comment out this line to disable +# this feature. +policy.allowSystemProperty=true + +# whether or not we look into the IdentityScope for trusted Identities +# when encountering a 1.1 signed JAR file. If the identity is found +# and is trusted, we grant it AllPermission. +policy.ignoreIdentityScope=false + +# +# Default keystore type. +# +keystore.type=jks + +# +# List of comma-separated packages that start with or equal this string +# will cause a security exception to be thrown when +# passed to checkPackageAccess unless the +# corresponding RuntimePermission ("accessClassInPackage."+package) has +# been granted. +package.access=sun.,\ + com.sun.xml.internal.,\ + com.sun.imageio.,\ + com.sun.istack.internal.,\ + com.sun.jmx.,\ + com.sun.media.sound.,\ + com.sun.proxy.,\ + com.sun.corba.se.,\ + com.sun.org.apache.bcel.internal.,\ + com.sun.org.apache.regexp.internal.,\ + com.sun.org.apache.xerces.internal.,\ + com.sun.org.apache.xpath.internal.,\ + com.sun.org.apache.xalan.internal.extensions.,\ + com.sun.org.apache.xalan.internal.lib.,\ + com.sun.org.apache.xalan.internal.res.,\ + com.sun.org.apache.xalan.internal.templates.,\ + com.sun.org.apache.xalan.internal.utils.,\ + com.sun.org.apache.xalan.internal.xslt.,\ + com.sun.org.apache.xalan.internal.xsltc.cmdline.,\ + com.sun.org.apache.xalan.internal.xsltc.compiler.,\ + com.sun.org.apache.xalan.internal.xsltc.trax.,\ + com.sun.org.apache.xalan.internal.xsltc.util.,\ + com.sun.org.apache.xml.internal.res.,\ + com.sun.org.apache.xml.internal.security.,\ + com.sun.org.apache.xml.internal.serializer.utils.,\ + com.sun.org.apache.xml.internal.utils.,\ + com.sun.org.glassfish.,\ + com.oracle.xmlns.internal.,\ + com.oracle.webservices.internal.,\ + oracle.jrockit.jfr.,\ + org.jcp.xml.dsig.internal.,\ + jdk.internal.,\ + jdk.nashorn.internal.,\ + jdk.nashorn.tools. + + +# +# List of comma-separated packages that start with or equal this string +# will cause a security exception to be thrown when +# passed to checkPackageDefinition unless the +# corresponding RuntimePermission ("defineClassInPackage."+package) has +# been granted. +# +# by default, none of the class loaders supplied with the JDK call +# checkPackageDefinition. +# +package.definition=sun.,\ + com.sun.xml.internal.,\ + com.sun.imageio.,\ + com.sun.istack.internal.,\ + com.sun.jmx.,\ + com.sun.media.sound.,\ + com.sun.proxy.,\ + com.sun.corba.se.,\ + com.sun.org.apache.bcel.internal.,\ + com.sun.org.apache.regexp.internal.,\ + com.sun.org.apache.xerces.internal.,\ + com.sun.org.apache.xpath.internal.,\ + com.sun.org.apache.xalan.internal.extensions.,\ + com.sun.org.apache.xalan.internal.lib.,\ + com.sun.org.apache.xalan.internal.res.,\ + com.sun.org.apache.xalan.internal.templates.,\ + com.sun.org.apache.xalan.internal.utils.,\ + com.sun.org.apache.xalan.internal.xslt.,\ + com.sun.org.apache.xalan.internal.xsltc.cmdline.,\ + com.sun.org.apache.xalan.internal.xsltc.compiler.,\ + com.sun.org.apache.xalan.internal.xsltc.trax.,\ + com.sun.org.apache.xalan.internal.xsltc.util.,\ + com.sun.org.apache.xml.internal.res.,\ + com.sun.org.apache.xml.internal.security.,\ + com.sun.org.apache.xml.internal.serializer.utils.,\ + com.sun.org.apache.xml.internal.utils.,\ + com.sun.org.glassfish.,\ + com.oracle.xmlns.internal.,\ + com.oracle.webservices.internal.,\ + oracle.jrockit.jfr.,\ + org.jcp.xml.dsig.internal.,\ + jdk.internal.,\ + jdk.nashorn.internal.,\ + jdk.nashorn.tools. + + +# +# Determines whether this properties file can be appended to +# or overridden on the command line via -Djava.security.properties +# +security.overridePropertiesFile=true + +# +# Determines the default key and trust manager factory algorithms for +# the javax.net.ssl package. +# +ssl.KeyManagerFactory.algorithm=SunX509 +ssl.TrustManagerFactory.algorithm=PKIX + +# +# The Java-level namelookup cache policy for successful lookups: +# +# any negative value: caching forever +# any positive value: the number of seconds to cache an address for +# zero: do not cache +# +# default value is forever (FOREVER). For security reasons, this +# caching is made forever when a security manager is set. When a security +# manager is not set, the default behavior in this implementation +# is to cache for 30 seconds. +# +# NOTE: setting this to anything other than the default value can have +# serious security implications. Do not set it unless +# you are sure you are not exposed to DNS spoofing attack. +# +#networkaddress.cache.ttl=-1 + +# The Java-level namelookup cache policy for failed lookups: +# +# any negative value: cache forever +# any positive value: the number of seconds to cache negative lookup results +# zero: do not cache +# +# In some Microsoft Windows networking environments that employ +# the WINS name service in addition to DNS, name service lookups +# that fail may take a noticeably long time to return (approx. 5 seconds). +# For this reason the default caching policy is to maintain these +# results for 10 seconds. +# +# +networkaddress.cache.negative.ttl=10 + +# +# Properties to configure OCSP for certificate revocation checking +# + +# Enable OCSP +# +# By default, OCSP is not used for certificate revocation checking. +# This property enables the use of OCSP when set to the value "true". +# +# NOTE: SocketPermission is required to connect to an OCSP responder. +# +# Example, +# ocsp.enable=true + +# +# Location of the OCSP responder +# +# By default, the location of the OCSP responder is determined implicitly +# from the certificate being validated. This property explicitly specifies +# the location of the OCSP responder. The property is used when the +# Authority Information Access extension (defined in RFC 3280) is absent +# from the certificate or when it requires overriding. +# +# Example, +# ocsp.responderURL=http://ocsp.example.net:80 + +# +# Subject name of the OCSP responder's certificate +# +# By default, the certificate of the OCSP responder is that of the issuer +# of the certificate being validated. This property identifies the certificate +# of the OCSP responder when the default does not apply. Its value is a string +# distinguished name (defined in RFC 2253) which identifies a certificate in +# the set of certificates supplied during cert path validation. In cases where +# the subject name alone is not sufficient to uniquely identify the certificate +# then both the "ocsp.responderCertIssuerName" and +# "ocsp.responderCertSerialNumber" properties must be used instead. When this +# property is set then those two properties are ignored. +# +# Example, +# ocsp.responderCertSubjectName="CN=OCSP Responder, O=XYZ Corp" + +# +# Issuer name of the OCSP responder's certificate +# +# By default, the certificate of the OCSP responder is that of the issuer +# of the certificate being validated. This property identifies the certificate +# of the OCSP responder when the default does not apply. Its value is a string +# distinguished name (defined in RFC 2253) which identifies a certificate in +# the set of certificates supplied during cert path validation. When this +# property is set then the "ocsp.responderCertSerialNumber" property must also +# be set. When the "ocsp.responderCertSubjectName" property is set then this +# property is ignored. +# +# Example, +# ocsp.responderCertIssuerName="CN=Enterprise CA, O=XYZ Corp" + +# +# Serial number of the OCSP responder's certificate +# +# By default, the certificate of the OCSP responder is that of the issuer +# of the certificate being validated. This property identifies the certificate +# of the OCSP responder when the default does not apply. Its value is a string +# of hexadecimal digits (colon or space separators may be present) which +# identifies a certificate in the set of certificates supplied during cert path +# validation. When this property is set then the "ocsp.responderCertIssuerName" +# property must also be set. When the "ocsp.responderCertSubjectName" property +# is set then this property is ignored. +# +# Example, +# ocsp.responderCertSerialNumber=2A:FF:00 + +# +# Policy for failed Kerberos KDC lookups: +# +# When a KDC is unavailable (network error, service failure, etc), it is +# put inside a blacklist and accessed less often for future requests. The +# value (case-insensitive) for this policy can be: +# +# tryLast +# KDCs in the blacklist are always tried after those not on the list. +# +# tryLess[:max_retries,timeout] +# KDCs in the blacklist are still tried by their order in the configuration, +# but with smaller max_retries and timeout values. max_retries and timeout +# are optional numerical parameters (default 1 and 5000, which means once +# and 5 seconds). Please notes that if any of the values defined here is +# more than what is defined in krb5.conf, it will be ignored. +# +# Whenever a KDC is detected as available, it is removed from the blacklist. +# The blacklist is reset when krb5.conf is reloaded. You can add +# refreshKrb5Config=true to a JAAS configuration file so that krb5.conf is +# reloaded whenever a JAAS authentication is attempted. +# +# Example, +# krb5.kdc.bad.policy = tryLast +# krb5.kdc.bad.policy = tryLess:2,2000 +krb5.kdc.bad.policy = tryLast + +# Algorithm restrictions for certification path (CertPath) processing +# +# In some environments, certain algorithms or key lengths may be undesirable +# for certification path building and validation. For example, "MD2" is +# generally no longer considered to be a secure hash algorithm. This section +# describes the mechanism for disabling algorithms based on algorithm name +# and/or key length. This includes algorithms used in certificates, as well +# as revocation information such as CRLs and signed OCSP Responses. +# +# The syntax of the disabled algorithm string is described as this Java +# BNF-style: +# DisabledAlgorithms: +# " DisabledAlgorithm { , DisabledAlgorithm } " +# +# DisabledAlgorithm: +# AlgorithmName [Constraint] +# +# AlgorithmName: +# (see below) +# +# Constraint: +# KeySizeConstraint +# +# KeySizeConstraint: +# keySize Operator DecimalInteger +# +# Operator: +# <= | < | == | != | >= | > +# +# DecimalInteger: +# DecimalDigits +# +# DecimalDigits: +# DecimalDigit {DecimalDigit} +# +# DecimalDigit: one of +# 1 2 3 4 5 6 7 8 9 0 +# +# The "AlgorithmName" is the standard algorithm name of the disabled +# algorithm. See "Java Cryptography Architecture Standard Algorithm Name +# Documentation" for information about Standard Algorithm Names. Matching +# is performed using a case-insensitive sub-element matching rule. (For +# example, in "SHA1withECDSA" the sub-elements are "SHA1" for hashing and +# "ECDSA" for signatures.) If the assertion "AlgorithmName" is a +# sub-element of the certificate algorithm name, the algorithm will be +# rejected during certification path building and validation. For example, +# the assertion algorithm name "DSA" will disable all certificate algorithms +# that rely on DSA, such as NONEwithDSA, SHA1withDSA. However, the assertion +# will not disable algorithms related to "ECDSA". +# +# A "Constraint" provides further guidance for the algorithm being specified. +# The "KeySizeConstraint" requires a key of a valid size range if the +# "AlgorithmName" is of a key algorithm. The "DecimalInteger" indicates the +# key size specified in number of bits. For example, "RSA keySize <= 1024" +# indicates that any RSA key with key size less than or equal to 1024 bits +# should be disabled, and "RSA keySize < 1024, RSA keySize > 2048" indicates +# that any RSA key with key size less than 1024 or greater than 2048 should +# be disabled. Note that the "KeySizeConstraint" only makes sense to key +# algorithms. +# +# Note: This property is currently used by Oracle's PKIX implementation. It +# is not guaranteed to be examined and used by other implementations. +# +# Example: +# jdk.certpath.disabledAlgorithms=MD2, DSA, RSA keySize < 2048 +# +# +jdk.certpath.disabledAlgorithms=MD2, RSA keySize < 1024 + +# Algorithm restrictions for Secure Socket Layer/Transport Layer Security +# (SSL/TLS) processing +# +# In some environments, certain algorithms or key lengths may be undesirable +# when using SSL/TLS. This section describes the mechanism for disabling +# algorithms during SSL/TLS security parameters negotiation, including cipher +# suites selection, peer authentication and key exchange mechanisms. +# +# For PKI-based peer authentication and key exchange mechanisms, this list +# of disabled algorithms will also be checked during certification path +# building and validation, including algorithms used in certificates, as +# well as revocation information such as CRLs and signed OCSP Responses. +# This is in addition to the jdk.certpath.disabledAlgorithms property above. +# +# See the specification of "jdk.certpath.disabledAlgorithms" for the +# syntax of the disabled algorithm string. +# +# Note: This property is currently used by Oracle's JSSE implementation. +# It is not guaranteed to be examined and used by other implementations. +# +# Example: +# jdk.tls.disabledAlgorithms=MD5, SHA1, DSA, RSA keySize < 2048 + diff --git a/jdk/src/share/native/common/check_code.c b/jdk/src/share/native/common/check_code.c index 6a114f1f02b..92d96b19675 100644 --- a/jdk/src/share/native/common/check_code.c +++ b/jdk/src/share/native/common/check_code.c @@ -90,6 +90,41 @@ #include "classfile_constants.h" #include "opcodes.in_out" +/* On AIX malloc(0) and calloc(0, ...) return a NULL pointer, which is legal, + * but the code here does not handles it. So we wrap the methods and return non-NULL + * pointers even if we allocate 0 bytes. + */ +#ifdef _AIX +static int aix_dummy; +static void* aix_malloc(size_t len) { + if (len == 0) { + return &aix_dummy; + } + return malloc(len); +} + +static void* aix_calloc(size_t n, size_t size) { + if (n == 0) { + return &aix_dummy; + } + return calloc(n, size); +} + +static void aix_free(void* p) { + if (p == &aix_dummy) { + return; + } + free(p); +} + +#undef malloc +#undef calloc +#undef free +#define malloc aix_malloc +#define calloc aix_calloc +#define free aix_free +#endif + #ifdef __APPLE__ /* use setjmp/longjmp versions that do not save/restore the signal mask */ #define setjmp _setjmp diff --git a/jdk/src/share/native/java/net/net_util.c b/jdk/src/share/native/java/net/net_util.c index 54aef661bc2..f8a0e90b532 100644 --- a/jdk/src/share/native/java/net/net_util.c +++ b/jdk/src/share/native/java/net/net_util.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -67,7 +67,7 @@ JNI_OnLoad(JavaVM *vm, void *reserved) supporting socket APIs are available */ IPv6_available = IPv6_supported() & (!preferIPv4Stack); - initLocalAddrTable (); + platformInit(); parseExclusiveBindProperty(env); return JNI_VERSION_1_2; diff --git a/jdk/src/share/native/java/net/net_util.h b/jdk/src/share/native/java/net/net_util.h index d38a5f52fcf..c7224945566 100644 --- a/jdk/src/share/native/java/net/net_util.h +++ b/jdk/src/share/native/java/net/net_util.h @@ -140,7 +140,7 @@ NET_InetAddressToSockaddr(JNIEnv *env, jobject iaObj, int port, struct sockaddr JNIEXPORT jobject JNICALL NET_SockaddrToInetAddress(JNIEnv *env, struct sockaddr *him, int *port); -void initLocalAddrTable (); +void platformInit(); void parseExclusiveBindProperty(JNIEnv *env); void diff --git a/jdk/src/share/native/sun/awt/medialib/mlib_sys.c b/jdk/src/share/native/sun/awt/medialib/mlib_sys.c index 70d052051fd..2c07527cd0b 100644 --- a/jdk/src/share/native/sun/awt/medialib/mlib_sys.c +++ b/jdk/src/share/native/sun/awt/medialib/mlib_sys.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -86,10 +86,13 @@ __typeof__ ( __mlib_sincosf) mlib_sincosf void *__mlib_malloc(mlib_u32 size) { -#ifdef _MSC_VER +#if defined(_MSC_VER) || defined(AIX) /* * Currently, all MS C compilers for Win32 platforms default to 8 byte * alignment. -- from stdlib.h of MS VC++5.0. + * + * On AIX, the malloc subroutine returns a pointer to space suitably + * aligned for the storage of any type of object (see 'man malloc'). */ return (void *) malloc(size); #elif defined(MACOSX) diff --git a/jdk/src/share/native/sun/awt/medialib/mlib_types.h b/jdk/src/share/native/sun/awt/medialib/mlib_types.h index 10c3cd3039e..aba0394ffd4 100644 --- a/jdk/src/share/native/sun/awt/medialib/mlib_types.h +++ b/jdk/src/share/native/sun/awt/medialib/mlib_types.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -57,7 +57,7 @@ typedef unsigned int mlib_u32; typedef float mlib_f32; typedef double mlib_d64; -#if defined(__SUNPRO_C) || defined(__SUNPRO_CC) || defined(__GNUC__) +#if defined(__SUNPRO_C) || defined(__SUNPRO_CC) || defined(__GNUC__) || defined(_AIX) #include #include diff --git a/jdk/src/share/native/sun/font/layout/KernTable.cpp b/jdk/src/share/native/sun/font/layout/KernTable.cpp index 2d946513fb8..b0750f56269 100644 --- a/jdk/src/share/native/sun/font/layout/KernTable.cpp +++ b/jdk/src/share/native/sun/font/layout/KernTable.cpp @@ -39,7 +39,7 @@ #include -#define DEBUG 0 +#define DEBUG_KERN_TABLE 0 U_NAMESPACE_BEGIN @@ -99,14 +99,14 @@ KernTable::KernTable(const LETableReference& base, LEErrorCode &success) : pairsSwapped(NULL), fTable(base) { if(LE_FAILURE(success) || (fTable.isEmpty())) { -#if DEBUG +#if DEBUG_KERN_TABLE fprintf(stderr, "no kern data\n"); #endif return; } LEReferenceTo header(fTable, success); -#if DEBUG +#if DEBUG_KERN_TABLE // dump first 32 bytes of header for (int i = 0; i < 64; ++i) { fprintf(stderr, "%0.2x ", ((const char*)header.getAlias())[i]&0xff); @@ -171,7 +171,7 @@ KernTable::KernTable(const LETableReference& base, LEErrorCode &success) fprintf(stderr, " searchRange: %d entrySelector: %d rangeShift: %d\n", searchRange, entrySelector, rangeShift); fprintf(stderr, "[[ ignored font table entries: range %d selector %d shift %d ]]\n", SWAPW(table->searchRange), SWAPW(table->entrySelector), SWAPW(table->rangeShift)); #endif -#if DEBUG +#if DEBUG_KERN_TABLE fprintf(stderr, "coverage: %0.4x nPairs: %d pairs 0x%x\n", coverage, nPairs, pairsSwapped); fprintf(stderr, " searchRange(pairs): %d entrySelector: %d rangeShift(pairs): %d\n", @@ -242,7 +242,7 @@ void KernTable::process(LEGlyphStorage& storage, LEErrorCode &success) p = tp; } -#if DEBUG +#if DEBUG_KERN_TABLE fprintf(stderr, "binary search for %0.8x\n", key); #endif @@ -251,13 +251,13 @@ void KernTable::process(LEGlyphStorage& storage, LEErrorCode &success) probe >>= 1; tp = (const PairInfo*)(p + (probe/KERN_PAIRINFO_SIZE)); le_uint32 tkey = tp->key; -#if DEBUG +#if DEBUG_KERN_TABLE fprintf(stdout, " %.3d (%0.8x)\n", (tp - pairsSwapped), tkey); #endif if (tkey <= key) { if (tkey == key) { le_int16 value = SWAPW(tp->value); -#if DEBUG +#if DEBUG_KERN_TABLE fprintf(stdout, "binary found kerning pair %x:%x at %d, value: 0x%x (%g)\n", storage[i-1], storage[i], i, value & 0xffff, font->xUnitsToPoints(value)); fflush(stdout); diff --git a/jdk/src/share/native/sun/security/ec/impl/ecc_impl.h b/jdk/src/share/native/sun/security/ec/impl/ecc_impl.h index 8a8acfc688e..40d2e335514 100644 --- a/jdk/src/share/native/sun/security/ec/impl/ecc_impl.h +++ b/jdk/src/share/native/sun/security/ec/impl/ecc_impl.h @@ -65,6 +65,13 @@ typedef unsigned long ulong_t; typedef enum boolean { B_FALSE, B_TRUE } boolean_t; #endif /* _ALLBSD_SOURCE */ +#ifdef AIX +#define B_FALSE FALSE +#define B_TRUE TRUE +typedef unsigned char uint8_t; +typedef unsigned long ulong_t; +#endif /* AIX */ + #ifdef _WIN32 typedef unsigned char uint8_t; typedef unsigned long ulong_t; diff --git a/jdk/src/solaris/back/exec_md.c b/jdk/src/solaris/back/exec_md.c index eebfae1f7e7..b756be3297a 100644 --- a/jdk/src/solaris/back/exec_md.c +++ b/jdk/src/solaris/back/exec_md.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -30,8 +30,8 @@ #include "sys.h" #include "util.h" -#if defined(LINUX) || defined(_ALLBSD_SOURCE) - /* Linux */ +#if defined(LINUX) || defined(_ALLBSD_SOURCE) || defined(AIX) + /* Linux, BSD, AIX */ #define FORK() fork() #else /* Solaris (make sure we always get the POSIX-specified behavior) */ diff --git a/jdk/src/solaris/bin/java_md_solinux.c b/jdk/src/solaris/bin/java_md_solinux.c index 52f9cfe468a..d2337d7120f 100644 --- a/jdk/src/solaris/bin/java_md_solinux.c +++ b/jdk/src/solaris/bin/java_md_solinux.c @@ -41,7 +41,11 @@ #define JVM_DLL "libjvm.so" #define JAVA_DLL "libjava.so" +#ifdef AIX +#define LD_LIBRARY_PATH "LIBPATH" +#else #define LD_LIBRARY_PATH "LD_LIBRARY_PATH" +#endif /* help jettison the LD_LIBRARY_PATH settings in the future */ #ifndef SETENV_REQUIRED @@ -287,6 +291,11 @@ RequiresSetenv(int wanted, const char *jvmpath) { char *dmllp = NULL; char *p; /* a utility pointer */ +#ifdef AIX + /* We always have to set the LIBPATH on AIX because ld doesn't support $ORIGIN. */ + return JNI_TRUE; +#endif + llp = getenv("LD_LIBRARY_PATH"); #ifdef __solaris__ dmllp = (CURRENT_DATA_MODEL == 32) @@ -598,7 +607,7 @@ CreateExecutionEnvironment(int *pargc, char ***pargv, * If not on Solaris, assume only a single LD_LIBRARY_PATH * variable. */ - runpath = getenv("LD_LIBRARY_PATH"); + runpath = getenv(LD_LIBRARY_PATH); #endif /* __solaris__ */ /* runpath contains current effective LD_LIBRARY_PATH setting */ @@ -606,8 +615,12 @@ CreateExecutionEnvironment(int *pargc, char ***pargv, jvmpath = JLI_StringDup(jvmpath); new_runpath = JLI_MemAlloc(((runpath != NULL) ? JLI_StrLen(runpath) : 0) + 2 * JLI_StrLen(jrepath) + 2 * JLI_StrLen(arch) + +#ifdef AIX + /* On AIX we additionally need 'jli' in the path because ld doesn't support $ORIGIN. */ + JLI_StrLen(jrepath) + JLI_StrLen(arch) + JLI_StrLen("/lib//jli:") + +#endif JLI_StrLen(jvmpath) + 52); - newpath = new_runpath + JLI_StrLen("LD_LIBRARY_PATH="); + newpath = new_runpath + JLI_StrLen(LD_LIBRARY_PATH "="); /* @@ -619,9 +632,12 @@ CreateExecutionEnvironment(int *pargc, char ***pargv, if (lastslash) *lastslash = '\0'; - sprintf(new_runpath, "LD_LIBRARY_PATH=" + sprintf(new_runpath, LD_LIBRARY_PATH "=" "%s:" "%s/lib/%s:" +#ifdef AIX + "%s/lib/%s/jli:" /* Needed on AIX because ld doesn't support $ORIGIN. */ +#endif "%s/../lib/%s", jvmpath, #ifdef DUAL_MODE @@ -629,6 +645,9 @@ CreateExecutionEnvironment(int *pargc, char ***pargv, jrepath, GetArchPath(wanted) #else /* !DUAL_MODE */ jrepath, arch, +#ifdef AIX + jrepath, arch, +#endif jrepath, arch #endif /* DUAL_MODE */ ); @@ -1000,7 +1019,7 @@ void SplashFreeLibrary() { int ContinueInNewThread0(int (JNICALL *continuation)(void *), jlong stack_size, void * args) { int rslt; -#ifdef __linux__ +#ifndef __solaris__ pthread_t tid; pthread_attr_t attr; pthread_attr_init(&attr); @@ -1025,7 +1044,7 @@ ContinueInNewThread0(int (JNICALL *continuation)(void *), jlong stack_size, void } pthread_attr_destroy(&attr); -#else /* ! __linux__ */ +#else /* __solaris__ */ thread_t tid; long flags = 0; if (thr_create(NULL, stack_size, (void *(*)(void *))continuation, args, flags, &tid) == 0) { @@ -1036,7 +1055,7 @@ ContinueInNewThread0(int (JNICALL *continuation)(void *), jlong stack_size, void /* See above. Continue in current thread if thr_create() failed */ rslt = continuation(args); } -#endif /* __linux__ */ +#endif /* !__solaris__ */ return rslt; } diff --git a/jdk/src/solaris/bin/java_md_solinux.h b/jdk/src/solaris/bin/java_md_solinux.h index a9e4438a5e2..3f1dc115b4d 100644 --- a/jdk/src/solaris/bin/java_md_solinux.h +++ b/jdk/src/solaris/bin/java_md_solinux.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -45,23 +45,19 @@ extern char **environ; * A collection of useful strings. One should think of these as #define * entries, but actual strings can be more efficient (with many compilers). */ -#ifdef __linux__ -static const char *system_dir = "/usr/java"; -static const char *user_dir = "/java"; -#else /* Solaris */ +#ifdef __solaris__ static const char *system_dir = "/usr/jdk"; static const char *user_dir = "/jdk"; +#else /* !__solaris__, i.e. Linux, AIX,.. */ +static const char *system_dir = "/usr/java"; +static const char *user_dir = "/java"; #endif #include -#ifdef __linux__ -#include -#else +#ifdef __solaris__ #include +#else +#include #endif -#define JVM_DLL "libjvm.so" -#define JAVA_DLL "libjava.so" -#define LD_LIBRARY_PATH "LD_LIBRARY_PATH" - #endif /* JAVA_MD_SOLINUX_H */ diff --git a/jdk/src/solaris/classes/java/lang/UNIXProcess.java.aix b/jdk/src/solaris/classes/java/lang/UNIXProcess.java.aix new file mode 100644 index 00000000000..ad90d069409 --- /dev/null +++ b/jdk/src/solaris/classes/java/lang/UNIXProcess.java.aix @@ -0,0 +1,419 @@ +/* + * Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package java.lang; + +import java.io.BufferedInputStream; +import java.io.BufferedOutputStream; +import java.io.ByteArrayInputStream; +import java.io.FileDescriptor; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.util.Arrays; +import java.util.concurrent.Executors; +import java.util.concurrent.Executor; +import java.util.concurrent.ThreadFactory; +import java.util.concurrent.TimeUnit; +import java.security.AccessController; +import static java.security.AccessController.doPrivileged; +import java.security.PrivilegedAction; +import java.security.PrivilegedActionException; +import java.security.PrivilegedExceptionAction; + +/** + * java.lang.Process subclass in the UNIX environment. + * + * @author Mario Wolczko and Ross Knippel. + * @author Konstantin Kladko (ported to Linux) + * @author Martin Buchholz + * @author Volker Simonis (ported to AIX) + */ +final class UNIXProcess extends Process { + private static final sun.misc.JavaIOFileDescriptorAccess fdAccess + = sun.misc.SharedSecrets.getJavaIOFileDescriptorAccess(); + + private final int pid; + private int exitcode; + private boolean hasExited; + + private /* final */ OutputStream stdin; + private /* final */ InputStream stdout; + private /* final */ InputStream stderr; + + private static enum LaunchMechanism { + FORK(1), + POSIX_SPAWN(2); + + private int value; + LaunchMechanism(int x) {value = x;} + }; + + /* On AIX, the default is to spawn */ + private static final LaunchMechanism launchMechanism; + private static byte[] helperpath; + + private static byte[] toCString(String s) { + if (s == null) + return null; + byte[] bytes = s.getBytes(); + byte[] result = new byte[bytes.length + 1]; + System.arraycopy(bytes, 0, + result, 0, + bytes.length); + result[result.length-1] = (byte)0; + return result; + } + + static { + launchMechanism = AccessController.doPrivileged( + new PrivilegedAction() + { + public LaunchMechanism run() { + String javahome = System.getProperty("java.home"); + String osArch = System.getProperty("os.arch"); + + helperpath = toCString(javahome + "/lib/" + osArch + "/jspawnhelper"); + String s = System.getProperty( + "jdk.lang.Process.launchMechanism", "posix_spawn"); + + try { + return LaunchMechanism.valueOf(s.toUpperCase()); + } catch (IllegalArgumentException e) { + throw new Error(s + " is not a supported " + + "process launch mechanism on this platform."); + } + } + }); + } + + /* this is for the reaping thread */ + private native int waitForProcessExit(int pid); + + /** + * Create a process. Depending on the mode flag, this is done by + * one of the following mechanisms. + * - fork(2) and exec(2) + * - clone(2) and exec(2) + * - vfork(2) and exec(2) + * + * @param fds an array of three file descriptors. + * Indexes 0, 1, and 2 correspond to standard input, + * standard output and standard error, respectively. On + * input, a value of -1 means to create a pipe to connect + * child and parent processes. On output, a value which + * is not -1 is the parent pipe fd corresponding to the + * pipe which has been created. An element of this array + * is -1 on input if and only if it is not -1 on + * output. + * @return the pid of the subprocess + */ + private native int forkAndExec(int mode, byte[] helperpath, + byte[] prog, + byte[] argBlock, int argc, + byte[] envBlock, int envc, + byte[] dir, + int[] fds, + boolean redirectErrorStream) + throws IOException; + + /** + * The thread factory used to create "process reaper" daemon threads. + */ + private static class ProcessReaperThreadFactory implements ThreadFactory { + private final static ThreadGroup group = getRootThreadGroup(); + + private static ThreadGroup getRootThreadGroup() { + return doPrivileged(new PrivilegedAction () { + public ThreadGroup run() { + ThreadGroup root = Thread.currentThread().getThreadGroup(); + while (root.getParent() != null) + root = root.getParent(); + return root; + }}); + } + + public Thread newThread(Runnable grimReaper) { + // Our thread stack requirement is quite modest. + Thread t = new Thread(group, grimReaper, "process reaper", 32768); + t.setDaemon(true); + // A small attempt (probably futile) to avoid priority inversion + t.setPriority(Thread.MAX_PRIORITY); + return t; + } + } + + /** + * The thread pool of "process reaper" daemon threads. + */ + private static final Executor processReaperExecutor = + doPrivileged(new PrivilegedAction() { + public Executor run() { + return Executors.newCachedThreadPool + (new ProcessReaperThreadFactory()); + }}); + + UNIXProcess(final byte[] prog, + final byte[] argBlock, final int argc, + final byte[] envBlock, final int envc, + final byte[] dir, + final int[] fds, + final boolean redirectErrorStream) + throws IOException { + + pid = forkAndExec(launchMechanism.value, + helperpath, + prog, + argBlock, argc, + envBlock, envc, + dir, + fds, + redirectErrorStream); + + try { + doPrivileged(new PrivilegedExceptionAction() { + public Void run() throws IOException { + initStreams(fds); + return null; + }}); + } catch (PrivilegedActionException ex) { + throw (IOException) ex.getException(); + } + } + + static FileDescriptor newFileDescriptor(int fd) { + FileDescriptor fileDescriptor = new FileDescriptor(); + fdAccess.set(fileDescriptor, fd); + return fileDescriptor; + } + + void initStreams(int[] fds) throws IOException { + stdin = (fds[0] == -1) ? + ProcessBuilder.NullOutputStream.INSTANCE : + new ProcessPipeOutputStream(fds[0]); + + stdout = (fds[1] == -1) ? + ProcessBuilder.NullInputStream.INSTANCE : + new ProcessPipeInputStream(fds[1]); + + stderr = (fds[2] == -1) ? + ProcessBuilder.NullInputStream.INSTANCE : + new ProcessPipeInputStream(fds[2]); + + processReaperExecutor.execute(new Runnable() { + public void run() { + int exitcode = waitForProcessExit(pid); + UNIXProcess.this.processExited(exitcode); + }}); + } + + void processExited(int exitcode) { + synchronized (this) { + this.exitcode = exitcode; + hasExited = true; + notifyAll(); + } + + if (stdout instanceof ProcessPipeInputStream) + ((ProcessPipeInputStream) stdout).processExited(); + + if (stderr instanceof ProcessPipeInputStream) + ((ProcessPipeInputStream) stderr).processExited(); + + if (stdin instanceof ProcessPipeOutputStream) + ((ProcessPipeOutputStream) stdin).processExited(); + } + + public OutputStream getOutputStream() { + return stdin; + } + + public InputStream getInputStream() { + return stdout; + } + + public InputStream getErrorStream() { + return stderr; + } + + public synchronized int waitFor() throws InterruptedException { + while (!hasExited) { + wait(); + } + return exitcode; + } + + @Override + public synchronized boolean waitFor(long timeout, TimeUnit unit) + throws InterruptedException + { + if (hasExited) return true; + if (timeout <= 0) return false; + + long timeoutAsNanos = unit.toNanos(timeout); + long startTime = System.nanoTime(); + long rem = timeoutAsNanos; + + while (!hasExited && (rem > 0)) { + wait(Math.max(TimeUnit.NANOSECONDS.toMillis(rem), 1)); + rem = timeoutAsNanos - (System.nanoTime() - startTime); + } + return hasExited; + } + + public synchronized int exitValue() { + if (!hasExited) { + throw new IllegalThreadStateException("process hasn't exited"); + } + return exitcode; + } + + private static native void destroyProcess(int pid, boolean force); + private void destroy(boolean force) { + // There is a risk that pid will be recycled, causing us to + // kill the wrong process! So we only terminate processes + // that appear to still be running. Even with this check, + // there is an unavoidable race condition here, but the window + // is very small, and OSes try hard to not recycle pids too + // soon, so this is quite safe. + synchronized (this) { + if (!hasExited) + destroyProcess(pid, force); + } + try { stdin.close(); } catch (IOException ignored) {} + try { stdout.close(); } catch (IOException ignored) {} + try { stderr.close(); } catch (IOException ignored) {} + } + + public void destroy() { + destroy(false); + } + + @Override + public Process destroyForcibly() { + destroy(true); + return this; + } + + @Override + public synchronized boolean isAlive() { + return !hasExited; + } + + private static native void init(); + + static { + init(); + } + + /** + * A buffered input stream for a subprocess pipe file descriptor + * that allows the underlying file descriptor to be reclaimed when + * the process exits, via the processExited hook. + * + * This is tricky because we do not want the user-level InputStream to be + * closed until the user invokes close(), and we need to continue to be + * able to read any buffered data lingering in the OS pipe buffer. + */ + static class ProcessPipeInputStream extends BufferedInputStream { + private final Object closeLock = new Object(); + + ProcessPipeInputStream(int fd) { + super(new FileInputStream(newFileDescriptor(fd))); + } + + private InputStream drainInputStream(InputStream in) + throws IOException { + int n = 0; + int j; + byte[] a = null; + synchronized (closeLock) { + if (buf == null) // asynchronous close()? + return null; // discard + j = in.available(); + } + while (j > 0) { + a = (a == null) ? new byte[j] : Arrays.copyOf(a, n + j); + synchronized (closeLock) { + if (buf == null) // asynchronous close()? + return null; // discard + n += in.read(a, n, j); + j = in.available(); + } + } + return (a == null) ? + ProcessBuilder.NullInputStream.INSTANCE : + new ByteArrayInputStream(n == a.length ? a : Arrays.copyOf(a, n)); + } + + /** Called by the process reaper thread when the process exits. */ + synchronized void processExited() { + try { + InputStream in = this.in; + if (in != null) { + InputStream stragglers = drainInputStream(in); + in.close(); + this.in = stragglers; + } + } catch (IOException ignored) { } + } + + @Override + public void close() throws IOException { + // BufferedInputStream#close() is not synchronized unlike most other methods. + // Synchronizing helps avoid racing with drainInputStream(). + synchronized (closeLock) { + super.close(); + } + } + } + + /** + * A buffered output stream for a subprocess pipe file descriptor + * that allows the underlying file descriptor to be reclaimed when + * the process exits, via the processExited hook. + */ + static class ProcessPipeOutputStream extends BufferedOutputStream { + ProcessPipeOutputStream(int fd) { + super(new FileOutputStream(newFileDescriptor(fd))); + } + + /** Called by the process reaper thread when the process exits. */ + synchronized void processExited() { + OutputStream out = this.out; + if (out != null) { + try { + out.close(); + } catch (IOException ignored) { + // We know of no reason to get an IOException, but if + // we do, there's nothing else to do but carry on. + } + this.out = ProcessBuilder.NullOutputStream.INSTANCE; + } + } + } +} diff --git a/jdk/src/solaris/classes/sun/nio/ch/DefaultAsynchronousChannelProvider.java b/jdk/src/solaris/classes/sun/nio/ch/DefaultAsynchronousChannelProvider.java index 667c51ab59f..7a0ce392299 100644 --- a/jdk/src/solaris/classes/sun/nio/ch/DefaultAsynchronousChannelProvider.java +++ b/jdk/src/solaris/classes/sun/nio/ch/DefaultAsynchronousChannelProvider.java @@ -68,6 +68,8 @@ public class DefaultAsynchronousChannelProvider { return createProvider("sun.nio.ch.LinuxAsynchronousChannelProvider"); if (osname.contains("OS X")) return createProvider("sun.nio.ch.BsdAsynchronousChannelProvider"); + if (osname.equals("AIX")) + return createProvider("sun.nio.ch.AixAsynchronousChannelProvider"); throw new InternalError("platform not recognized"); } } diff --git a/jdk/src/solaris/classes/sun/nio/ch/Port.java b/jdk/src/solaris/classes/sun/nio/ch/Port.java index 94025089933..a644a0f75b9 100644 --- a/jdk/src/solaris/classes/sun/nio/ch/Port.java +++ b/jdk/src/solaris/classes/sun/nio/ch/Port.java @@ -76,12 +76,22 @@ abstract class Port extends AsynchronousChannelGroupImpl { } } + /** + * Callback method for implementations that need special handling when fd is + * removed (currently only needed in the AIX-Port - see AixPollPort.java). + */ + protected void preUnregister(int fd) { + // Do nothing by default. + } + /** * Unregister channel identified by its file descriptor */ final void unregister(int fd) { boolean checkForShutdown = false; + preUnregister(fd); + fdToChannelLock.writeLock().lock(); try { fdToChannel.remove(Integer.valueOf(fd)); diff --git a/jdk/src/solaris/classes/sun/nio/fs/DefaultFileSystemProvider.java b/jdk/src/solaris/classes/sun/nio/fs/DefaultFileSystemProvider.java index d909916450e..595f3c6d187 100644 --- a/jdk/src/solaris/classes/sun/nio/fs/DefaultFileSystemProvider.java +++ b/jdk/src/solaris/classes/sun/nio/fs/DefaultFileSystemProvider.java @@ -63,6 +63,8 @@ public class DefaultFileSystemProvider { return createProvider("sun.nio.fs.LinuxFileSystemProvider"); if (osname.contains("OS X")) return createProvider("sun.nio.fs.MacOSXFileSystemProvider"); + if (osname.equals("AIX")) + return createProvider("sun.nio.fs.AixFileSystemProvider"); throw new AssertionError("Platform not recognized"); } } diff --git a/jdk/src/solaris/demo/jvmti/hprof/hprof_md.c b/jdk/src/solaris/demo/jvmti/hprof/hprof_md.c index 9cfcc592c3a..78a4f606735 100644 --- a/jdk/src/solaris/demo/jvmti/hprof/hprof_md.c +++ b/jdk/src/solaris/demo/jvmti/hprof/hprof_md.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, 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 @@ -42,7 +42,7 @@ #include #include -#if !defined(LINUX) && !defined(_ALLBSD_SOURCE) +#if !defined(LINUX) && !defined(_ALLBSD_SOURCE) && !defined(AIX) #include #endif @@ -65,6 +65,10 @@ #include "jvm_md.h" #include "hprof.h" +#ifdef AIX +#include "porting_aix.h" /* For the 'dladdr' function. */ +#endif + int md_getpid(void) { @@ -86,7 +90,7 @@ md_sleep(unsigned seconds) void md_init(void) { -#if defined(LINUX) || defined(_ALLBSD_SOURCE) +#if defined(LINUX) || defined(_ALLBSD_SOURCE) || defined(AIX) /* No Hi-Res timer option? */ #else if ( gdata->micro_state_accounting ) { @@ -253,7 +257,7 @@ md_timeofday(void) jlong md_get_microsecs(void) { -#if defined(LINUX) || defined(_ALLBSD_SOURCE) +#if defined(LINUX) || defined(_ALLBSD_SOURCE) || defined(AIX) return (jlong)(md_timeofday() * (jlong)1000); /* Milli to micro */ #else return (jlong)(gethrtime()/(hrtime_t)1000); /* Nano seconds to micro seconds */ @@ -271,7 +275,7 @@ md_get_timemillis(void) jlong md_get_thread_cpu_timemillis(void) { -#if defined(LINUX) || defined(_ALLBSD_SOURCE) +#if defined(LINUX) || defined(_ALLBSD_SOURCE) || defined(AIX) return md_timeofday(); #else return (jlong)(gethrvtime()/1000); /* Nano seconds to milli seconds */ @@ -286,7 +290,7 @@ md_get_prelude_path(char *path, int path_len, char *filename) Dl_info dlinfo; libdir[0] = 0; -#if defined(LINUX) || defined(_ALLBSD_SOURCE) +#if defined(LINUX) || defined(_ALLBSD_SOURCE) || defined(AIX) addr = (void*)&Agent_OnLoad; #else /* Just using &Agent_OnLoad will get the first external symbol with @@ -457,3 +461,5 @@ md_find_library_entry(void *handle, const char *name) sym = dlsym(handle, name); return sym; } + + diff --git a/jdk/src/solaris/native/common/jdk_util_md.h b/jdk/src/solaris/native/common/jdk_util_md.h index d9fd2a2557f..c13bb7794e4 100644 --- a/jdk/src/solaris/native/common/jdk_util_md.h +++ b/jdk/src/solaris/native/common/jdk_util_md.h @@ -39,6 +39,10 @@ #include #define ISNANF(f) isnanf(f) #define ISNAND(d) isnan(d) +#elif defined(_AIX) +#include +#define ISNANF(f) _isnanf(f) +#define ISNAND(d) _isnan(d) #else #error "missing platform-specific definition here" #endif diff --git a/jdk/src/solaris/native/java/io/io_util_md.c b/jdk/src/solaris/native/java/io/io_util_md.c index e74bc127102..5899a410347 100644 --- a/jdk/src/solaris/native/java/io/io_util_md.c +++ b/jdk/src/solaris/native/java/io/io_util_md.c @@ -35,7 +35,7 @@ #include #endif -#if defined(__linux__) || defined(_ALLBSD_SOURCE) +#if defined(__linux__) || defined(_ALLBSD_SOURCE) || defined(_AIX) #include #endif diff --git a/jdk/src/solaris/native/java/lang/UNIXProcess_md.c b/jdk/src/solaris/native/java/lang/UNIXProcess_md.c index 177031e5c74..ec85b685dc6 100644 --- a/jdk/src/solaris/native/java/lang/UNIXProcess_md.c +++ b/jdk/src/solaris/native/java/lang/UNIXProcess_md.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -44,7 +44,7 @@ #include #include -#if defined(__solaris__) || defined(_ALLBSD_SOURCE) +#if defined(__solaris__) || defined(_ALLBSD_SOURCE) || defined(_AIX) #include #endif @@ -455,7 +455,7 @@ forkChild(ChildStuff *c) { return resultPid; } -#if defined(__solaris__) || defined(_ALLBSD_SOURCE) +#if defined(__solaris__) || defined(_ALLBSD_SOURCE) || defined(_AIX) static pid_t spawnChild(JNIEnv *env, jobject process, ChildStuff *c, const char *helperpath) { pid_t resultPid; @@ -551,7 +551,7 @@ startChild(JNIEnv *env, jobject process, ChildStuff *c, const char *helperpath) return vforkChild(c); case MODE_FORK: return forkChild(c); -#if defined(__solaris__) || defined(_ALLBSD_SOURCE) +#if defined(__solaris__) || defined(_ALLBSD_SOURCE) || defined(_AIX) case MODE_POSIX_SPAWN: return spawnChild(env, process, c, helperpath); #endif diff --git a/jdk/src/solaris/native/java/lang/childproc.c b/jdk/src/solaris/native/java/lang/childproc.c index 0cfcf6fe9a8..1d183cf1fb2 100644 --- a/jdk/src/solaris/native/java/lang/childproc.c +++ b/jdk/src/solaris/native/java/lang/childproc.c @@ -66,6 +66,9 @@ isAsciiDigit(char c) #define FD_DIR "/dev/fd" #define dirent64 dirent #define readdir64 readdir +#elif defined(_AIX) +/* AIX does not understand '/proc/self' - it requires the real process ID */ +#define FD_DIR aix_fd_dir #else #define FD_DIR "/proc/self/fd" #endif @@ -87,6 +90,12 @@ closeDescriptors(void) close(from_fd); /* for possible use by opendir() */ close(from_fd + 1); /* another one for good luck */ +#if defined(_AIX) + /* AIX does not understand '/proc/self' - it requires the real process ID */ + char aix_fd_dir[32]; /* the pid has at most 19 digits */ + snprintf(aix_fd_dir, 32, "/proc/%d/fd", getpid()); +#endif + if ((dp = opendir(FD_DIR)) == NULL) return 0; diff --git a/jdk/src/solaris/native/java/net/NetworkInterface.c b/jdk/src/solaris/native/java/net/NetworkInterface.c index b2ebd8e222b..51f8e41dfb1 100644 --- a/jdk/src/solaris/native/java/net/NetworkInterface.c +++ b/jdk/src/solaris/native/java/net/NetworkInterface.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -52,6 +52,13 @@ #include #endif +#if defined(_AIX) +#include +#include +#include +#include +#endif + #ifdef __linux__ #define _PATH_PROCNET_IFINET6 "/proc/net/if_inet6" #endif @@ -1041,8 +1048,8 @@ static int openSocket(JNIEnv *env, int proto){ } -/** Linux **/ -#ifdef __linux__ +/** Linux, AIX **/ +#if defined(__linux__) || defined(_AIX) /* Open socket for further ioct calls, try v4 socket first and * if it falls return v6 socket */ @@ -1080,11 +1087,13 @@ static int openSocketWithFallback(JNIEnv *env, const char *ifname){ static netif *enumIPv4Interfaces(JNIEnv *env, int sock, netif *ifs) { struct ifconf ifc; struct ifreq *ifreqP; - char *buf; + char *buf = NULL; int numifs; unsigned i; + int siocgifconfRequest = SIOCGIFCONF; +#if defined(__linux__) /* need to do a dummy SIOCGIFCONF to determine the buffer size. * SIOCGIFCOUNT doesn't work */ @@ -1093,11 +1102,21 @@ static netif *enumIPv4Interfaces(JNIEnv *env, int sock, netif *ifs) { NET_ThrowByNameWithLastError(env , JNU_JAVANETPKG "SocketException", "ioctl SIOCGIFCONF failed"); return ifs; } +#elif defined(_AIX) + ifc.ifc_buf = NULL; + if (ioctl(sock, SIOCGSIZIFCONF, &(ifc.ifc_len)) < 0) { + NET_ThrowByNameWithLastError(env , JNU_JAVANETPKG "SocketException", "ioctl SIOCGSIZIFCONF failed"); + return ifs; + } +#endif /* __linux__ */ CHECKED_MALLOC3(buf,char *, ifc.ifc_len); ifc.ifc_buf = buf; - if (ioctl(sock, SIOCGIFCONF, (char *)&ifc) < 0) { +#if defined(_AIX) + siocgifconfRequest = CSIOCGIFCONF; +#endif + if (ioctl(sock, siocgifconfRequest, (char *)&ifc) < 0) { NET_ThrowByNameWithLastError(env , JNU_JAVANETPKG "SocketException", "ioctl SIOCGIFCONF failed"); (void) free(buf); return ifs; @@ -1108,6 +1127,9 @@ static netif *enumIPv4Interfaces(JNIEnv *env, int sock, netif *ifs) { */ ifreqP = ifc.ifc_req; for (i=0; iifr_addr.sa_family != AF_INET) continue; +#endif /* * Add to the list */ @@ -1135,7 +1157,7 @@ static netif *enumIPv4Interfaces(JNIEnv *env, int sock, netif *ifs) { * Enumerates and returns all IPv6 interfaces on Linux */ -#ifdef AF_INET6 +#if defined(AF_INET6) && defined(__linux__) static netif *enumIPv6Interfaces(JNIEnv *env, int sock, netif *ifs) { FILE *f; char addr6[40], devname[21]; @@ -1179,11 +1201,103 @@ static netif *enumIPv6Interfaces(JNIEnv *env, int sock, netif *ifs) { #endif +/* + * Enumerates and returns all IPv6 interfaces on AIX + */ + +#if defined(AF_INET6) && defined(_AIX) +static netif *enumIPv6Interfaces(JNIEnv *env, int sock, netif *ifs) { + struct ifconf ifc; + struct ifreq *ifreqP; + char *buf; + int numifs; + unsigned i; + unsigned bufsize; + char *cp, *cplimit; + + /* use SIOCGSIZIFCONF to get size for SIOCGIFCONF */ + + ifc.ifc_buf = NULL; + if (ioctl(sock, SIOCGSIZIFCONF, &(ifc.ifc_len)) < 0) { + NET_ThrowByNameWithLastError(env , JNU_JAVANETPKG "SocketException", + "ioctl SIOCGSIZIFCONF failed"); + return ifs; + } + bufsize = ifc.ifc_len; + + buf = (char *)malloc(bufsize); + if (!buf) { + JNU_ThrowOutOfMemoryError(env, "Network interface native buffer allocation failed"); + return ifs; + } + ifc.ifc_len = bufsize; + ifc.ifc_buf = buf; + if (ioctl(sock, SIOCGIFCONF, (char *)&ifc) < 0) { + NET_ThrowByNameWithLastError(env , JNU_JAVANETPKG "SocketException", + "ioctl CSIOCGIFCONF failed"); + free(buf); + return ifs; + } + + /* + * Iterate through each interface + */ + ifreqP = ifc.ifc_req; + cp = (char *)ifc.ifc_req; + cplimit = cp + ifc.ifc_len; + + for ( ; cp < cplimit; cp += (sizeof(ifreqP->ifr_name) + MAX((ifreqP->ifr_addr).sa_len, sizeof(ifreqP->ifr_addr)))) { + ifreqP = (struct ifreq *)cp; + struct ifreq if2; + + memset((char *)&if2, 0, sizeof(if2)); + strcpy(if2.ifr_name, ifreqP->ifr_name); + + /* + * Skip interface that aren't UP + */ + if (ioctl(sock, SIOCGIFFLAGS, (char *)&if2) >= 0) { + if (!(if2.ifr_flags & IFF_UP)) { + continue; + } + } + + if (ifreqP->ifr_addr.sa_family != AF_INET6) + continue; + + /* + * Add to the list + */ + ifs = addif(env, sock, ifreqP->ifr_name, ifs, + (struct sockaddr *)&(ifreqP->ifr_addr), + AF_INET6, 0); + + /* + * If an exception occurred then free the list + */ + if ((*env)->ExceptionOccurred(env)) { + free(buf); + freeif(ifs); + return NULL; + } + } + + /* + * Free socket and buffer + */ + free(buf); + return ifs; +} +#endif + + static int getIndex(int sock, const char *name){ /* * Try to get the interface index - * (Not supported on Solaris 2.6 or 7) */ +#if defined(_AIX) + return if_nametoindex(name); +#else struct ifreq if2; strcpy(if2.ifr_name, name); @@ -1192,6 +1306,7 @@ static int getIndex(int sock, const char *name){ } return if2.ifr_ifindex; +#endif } /** @@ -1258,6 +1373,46 @@ static short getSubnet(JNIEnv *env, int sock, const char *ifname) { * MAC address. Returns -1 if there is no hardware address on that interface. */ static int getMacAddress(JNIEnv *env, int sock, const char* ifname, const struct in_addr* addr, unsigned char *buf) { +#if defined (_AIX) + int size; + struct kinfo_ndd *nddp; + void *end; + + size = getkerninfo(KINFO_NDD, 0, 0, 0); + if (size == 0) { + return -1; + } + + if (size < 0) { + perror("getkerninfo 1"); + return -1; + } + + nddp = (struct kinfo_ndd *)malloc(size); + + if (!nddp) { + return -1; + } + + if (getkerninfo(KINFO_NDD, nddp, &size, 0) < 0) { + perror("getkerninfo 2"); + return -1; + } + + end = (void *)nddp + size; + while ((void *)nddp < end) { + if (!strcmp(nddp->ndd_alias, ifname) || + !strcmp(nddp->ndd_name, ifname)) { + bcopy(nddp->ndd_addr, buf, 6); + return 6; + } else { + nddp++; + } + } + + return -1; + +#elif defined(__linux__) static struct ifreq ifr; int i; @@ -1279,6 +1434,7 @@ static int getMacAddress(JNIEnv *env, int sock, const char* ifname, const struct } return -1; +#endif } static int getMTU(JNIEnv *env, int sock, const char *ifname) { diff --git a/jdk/src/solaris/native/java/net/PlainSocketImpl.c b/jdk/src/solaris/native/java/net/PlainSocketImpl.c index b6f78b9c158..a4958efc512 100644 --- a/jdk/src/solaris/native/java/net/PlainSocketImpl.c +++ b/jdk/src/solaris/native/java/net/PlainSocketImpl.c @@ -963,7 +963,7 @@ Java_java_net_PlainSocketImpl_socketSetOption(JNIEnv *env, jobject this, } if (NET_SetSockOpt(fd, level, optname, (const void *)&optval, optlen) < 0) { -#ifdef __solaris__ +#if defined(__solaris__) || defined(_AIX) if (errno == EINVAL) { // On Solaris setsockopt will set errno to EINVAL if the socket // is closed. The default error message is then confusing diff --git a/jdk/src/solaris/native/java/net/net_util_md.c b/jdk/src/solaris/native/java/net/net_util_md.c index d7ebbd5a7c9..9822de01908 100644 --- a/jdk/src/solaris/native/java/net/net_util_md.c +++ b/jdk/src/solaris/native/java/net/net_util_md.c @@ -738,14 +738,23 @@ static int getLocalScopeID (char *addr) { return 0; } -void initLocalAddrTable () { +void platformInit () { initLoopbackRoutes(); initLocalIfs(); } +#elif defined(_AIX) + +/* Initialize stubs for blocking I/O workarounds (see src/solaris/native/java/net/linux_close.c) */ +extern void aix_close_init(); + +void platformInit () { + aix_close_init(); +} + #else -void initLocalAddrTable () {} +void platformInit () {} #endif @@ -987,7 +996,11 @@ NET_MapSocketOption(jint cmd, int *level, int *optname) { { java_net_SocketOptions_SO_SNDBUF, SOL_SOCKET, SO_SNDBUF }, { java_net_SocketOptions_SO_RCVBUF, SOL_SOCKET, SO_RCVBUF }, { java_net_SocketOptions_SO_KEEPALIVE, SOL_SOCKET, SO_KEEPALIVE }, +#if defined(_AIX) + { java_net_SocketOptions_SO_REUSEADDR, SOL_SOCKET, SO_REUSEPORT }, +#else { java_net_SocketOptions_SO_REUSEADDR, SOL_SOCKET, SO_REUSEADDR }, +#endif { java_net_SocketOptions_SO_BROADCAST, SOL_SOCKET, SO_BROADCAST }, { java_net_SocketOptions_IP_TOS, IPPROTO_IP, IP_TOS }, { java_net_SocketOptions_IP_MULTICAST_IF, IPPROTO_IP, IP_MULTICAST_IF }, @@ -1387,6 +1400,29 @@ NET_SetSockOpt(int fd, int level, int opt, const void *arg, } #endif +#ifdef _AIX + if (level == SOL_SOCKET) { + if (opt == SO_SNDBUF || opt == SO_RCVBUF) { + /* + * Just try to set the requested size. If it fails we will leave the + * socket option as is. Setting the buffer size means only a hint in + * the jse2/java software layer, see javadoc. In the previous + * solution the buffer has always been truncated to a length of + * 0x100000 Byte, even if the technical limit has not been reached. + * This kind of absolute truncation was unexpected in the jck tests. + */ + int ret = setsockopt(fd, level, opt, arg, len); + if ((ret == 0) || (ret == -1 && errno == ENOBUFS)) { + // Accept failure because of insufficient buffer memory resources. + return 0; + } else { + // Deliver all other kinds of errors. + return ret; + } + } + } +#endif + /* * On Linux the receive buffer is used for both socket * structures and the the packet payload. The implication diff --git a/jdk/src/solaris/native/java/net/net_util_md.h b/jdk/src/solaris/native/java/net/net_util_md.h index 4470a49b1e2..f3ab0c0fc2d 100644 --- a/jdk/src/solaris/native/java/net/net_util_md.h +++ b/jdk/src/solaris/native/java/net/net_util_md.h @@ -37,7 +37,17 @@ #endif -#if defined(__linux__) || defined(MACOSX) +/* + AIX needs a workaround for I/O cancellation, see: + http://publib.boulder.ibm.com/infocenter/pseries/v5r3/index.jsp?topic=/com.ibm.aix.basetechref/doc/basetrf1/close.htm + ... + The close subroutine is blocked until all subroutines which use the file + descriptor return to usr space. For example, when a thread is calling close + and another thread is calling select with the same file descriptor, the + close subroutine does not return until the select call returns. + ... +*/ +#if defined(__linux__) || defined(MACOSX) || defined (_AIX) extern int NET_Timeout(int s, long timeout); extern int NET_Read(int s, void* buf, size_t len); extern int NET_RecvFrom(int s, void *buf, int len, unsigned int flags, diff --git a/jdk/src/solaris/native/java/util/TimeZone_md.c b/jdk/src/solaris/native/java/util/TimeZone_md.c index ce2fa5aca8c..e1af8f92556 100644 --- a/jdk/src/solaris/native/java/util/TimeZone_md.c +++ b/jdk/src/solaris/native/java/util/TimeZone_md.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -123,7 +123,7 @@ findZoneinfoFile(char *buf, size_t size, const char *dir) return NULL; } -#if defined(__linux__) || defined(MACOSX) || (defined(__solaris__) \ +#if defined(_AIX) || defined(__linux__) || defined(MACOSX) || (defined(__solaris__) \ && (defined(_POSIX_PTHREAD_SEMANTICS) || defined(_LP64))) while (readdir_r(dirp, entry, &dp) == 0 && dp != NULL) { #else @@ -615,6 +615,14 @@ getSolarisDefaultZoneID() { #endif /*__solaris__*/ #endif /*__linux__*/ +#ifdef _AIX +static char * +getPlatformTimeZoneID() +{ + return NULL; +} +#endif + /* * findJavaTZ_md() maps platform time zone ID to Java time zone ID * using /lib/tzmappings. If the TZ value is not found, it @@ -635,7 +643,7 @@ findJavaTZ_md(const char *java_home_dir, const char *country) #if defined(__linux__) || defined(_ALLBSD_SOURCE) if (tz == NULL) { #else -#ifdef __solaris__ +#if defined (__solaris__) || defined(_AIX) if (tz == NULL || *tz == '\0') { #endif #endif diff --git a/jdk/src/solaris/native/sun/awt/awt_LoadLibrary.c b/jdk/src/solaris/native/sun/awt/awt_LoadLibrary.c index c056e8eac87..f7ac70df393 100644 --- a/jdk/src/solaris/native/sun/awt/awt_LoadLibrary.c +++ b/jdk/src/solaris/native/sun/awt/awt_LoadLibrary.c @@ -37,6 +37,10 @@ #include "awt_Plugin.h" +#ifdef AIX +#include "porting_aix.h" /* For the 'dladdr' function. */ +#endif + #ifdef DEBUG #define VERBOSE_AWT_DEBUG #endif diff --git a/jdk/src/solaris/native/sun/awt/fontpath.c b/jdk/src/solaris/native/sun/awt/fontpath.c index 12c8405beae..19e5d9bf8d8 100644 --- a/jdk/src/solaris/native/sun/awt/fontpath.c +++ b/jdk/src/solaris/native/sun/awt/fontpath.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -64,7 +64,7 @@ extern Display *awt_display; #define MAXFDIRS 512 /* Max number of directories that contain fonts */ -#if !defined(__linux__) +#if defined(__solaris__) /* * This can be set in the makefile to "/usr/X11" if so desired. */ @@ -114,7 +114,7 @@ static char *fullSolarisFontPath[] = { NULL, /* terminates the list */ }; -#else /* __linux */ +#elif defined( __linux__) /* All the known interesting locations we have discovered on * various flavors of Linux */ @@ -134,6 +134,12 @@ static char *fullLinuxFontPath[] = { "/usr/share/fonts/default/Type1", /* RH 9.0 */ NULL, /* terminates the list */ }; +#elif defined(_AIX) +static char *fullAixFontPath[] = { + "/usr/lpp/X11/lib/X11/fonts/Type1", /* from X11.fnt.iso_T1 */ + "/usr/lpp/X11/lib/X11/fonts/TrueType", /* from X11.fnt.ucs.ttf */ + NULL, /* terminates the list */ +}; #endif static char **getFontConfigLocations(); @@ -497,10 +503,11 @@ static char *getPlatformFontPathChars(JNIEnv *env, jboolean noType1) { #if defined(__linux__) knowndirs = fullLinuxFontPath; -#else /* IF SOLARIS */ +#elif defined(__solaris__) knowndirs = fullSolarisFontPath; +#elif defined(_AIX) + knowndirs = fullAixFontPath; #endif - /* REMIND: this code requires to be executed when the GraphicsEnvironment * is already initialised. That is always true, but if it were not so, * this code could throw an exception and the fontpath would fail to @@ -592,6 +599,25 @@ static void* openFontConfig() { } } #endif + +#if defined(_AIX) + /* On AIX, fontconfig is not a standard package supported by IBM. + * instead it has to be installed from the "AIX Toolbox for Linux Applications" + * site http://www-03.ibm.com/systems/power/software/aix/linux/toolbox/alpha.html + * and will be installed under /opt/freeware/lib/libfontconfig.a. + * Notice that the archive contains the real 32- and 64-bit shared libraries. + * We first try to load 'libfontconfig.so' from the default library path in the + * case the user has installed a private version of the library and if that + * doesn't succeed, we try the version from /opt/freeware/lib/libfontconfig.a + */ + libfontconfig = dlopen("libfontconfig.so", RTLD_LOCAL|RTLD_LAZY); + if (libfontconfig == NULL) { + libfontconfig = dlopen("/opt/freeware/lib/libfontconfig.a(libfontconfig.so.1)", RTLD_MEMBER|RTLD_LOCAL|RTLD_LAZY); + if (libfontconfig == NULL) { + return NULL; + } + } +#else /* 64 bit sparc should pick up the right version from the lib path. * New features may be added to libfontconfig, this is expected to * be compatible with old features, but we may need to start @@ -606,6 +632,7 @@ static void* openFontConfig() { return NULL; } } +#endif /* Version 1.0 of libfontconfig crashes if HOME isn't defined in * the environment. This should generally never happen, but we can't @@ -1203,7 +1230,7 @@ Java_sun_font_FontConfigManager_getFontConfig */ if (fontformat != NULL && (strcmp((char*)fontformat, "TrueType") != 0) -#ifdef __linux__ +#if defined(__linux__) || defined(_AIX) && (strcmp((char*)fontformat, "Type 1") != 0) #endif ) { diff --git a/jdk/src/solaris/native/sun/java2d/x11/X11SurfaceData.c b/jdk/src/solaris/native/sun/java2d/x11/X11SurfaceData.c index a35d6fd3065..c0d508958a5 100644 --- a/jdk/src/solaris/native/sun/java2d/x11/X11SurfaceData.c +++ b/jdk/src/solaris/native/sun/java2d/x11/X11SurfaceData.c @@ -56,8 +56,8 @@ typedef struct _X11RIPrivate { int x, y; } X11RIPrivate; -#define MAX(a,b) ((a) > (b) ? (a) : (b)) -#define MIN(a,b) ((a) < (b) ? (a) : (b)) +#define XSD_MAX(a,b) ((a) > (b) ? (a) : (b)) +#define XSD_MIN(a,b) ((a) < (b) ? (a) : (b)) static LockFunc X11SD_Lock; static GetRasInfoFunc X11SD_GetRasInfo; @@ -1090,10 +1090,10 @@ X11SD_ClipToRoot(SurfaceDataBounds *b, SurfaceDataBounds *bounds, x2 = x1 + DisplayWidth(awt_display, xsdo->configData->awt_visInfo.screen); y2 = y1 + DisplayHeight(awt_display, xsdo->configData->awt_visInfo.screen); - x1 = MAX(bounds->x1, x1); - y1 = MAX(bounds->y1, y1); - x2 = MIN(bounds->x2, x2); - y2 = MIN(bounds->y2, y2); + x1 = XSD_MAX(bounds->x1, x1); + y1 = XSD_MAX(bounds->y1, y1); + x2 = XSD_MIN(bounds->x2, x2); + y2 = XSD_MIN(bounds->y2, y2); if ((x1 >= x2) || (y1 >= y2)) { return FALSE; } diff --git a/jdk/src/solaris/native/sun/java2d/x11/XRBackendNative.c b/jdk/src/solaris/native/sun/java2d/x11/XRBackendNative.c index e2554b3209e..733606ec444 100644 --- a/jdk/src/solaris/native/sun/java2d/x11/XRBackendNative.c +++ b/jdk/src/solaris/native/sun/java2d/x11/XRBackendNative.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -72,8 +72,8 @@ typedef struct _XRadialGradient { #include -#ifdef __solaris__ -/* Solaris 10 will not have these symbols at runtime */ +#if defined(__solaris__) || defined(_AIX) +/* Solaris 10 and AIX will not have these symbols at runtime */ typedef Picture (*XRenderCreateLinearGradientFuncType) (Display *dpy, @@ -147,7 +147,7 @@ static jboolean IsXRenderAvailable(jboolean verbose, jboolean ignoreLinuxVersion return JNI_FALSE; } -#ifdef __solaris__ +#if defined(__solaris__) || defined(_AIX) xrenderlib = dlopen("libXrender.so",RTLD_GLOBAL|RTLD_LAZY); if (xrenderlib != NULL) { diff --git a/jdk/src/solaris/native/sun/management/OperatingSystemImpl.c b/jdk/src/solaris/native/sun/management/OperatingSystemImpl.c index f1322ebd90b..c25fd9dcccf 100644 --- a/jdk/src/solaris/native/sun/management/OperatingSystemImpl.c +++ b/jdk/src/solaris/native/sun/management/OperatingSystemImpl.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -41,7 +41,7 @@ #include #include #endif -#else +#elif !defined(_AIX) #include #endif #include @@ -57,9 +57,13 @@ #include #include +#if defined(_AIX) +#include +#endif + static jlong page_size = 0; -#if defined(_ALLBSD_SOURCE) +#if defined(_ALLBSD_SOURCE) || defined(_AIX) #define MB (1024UL * 1024UL) #else @@ -326,6 +330,12 @@ Java_sun_management_OperatingSystemImpl_getFreePhysicalMemorySize */ // throw_internal_error(env, "unimplemented in FreeBSD") return (128 * MB); +#elif defined(_AIX) + perfstat_memory_total_t memory_info; + if (-1 != perfstat_memory_total(NULL, &memory_info, sizeof(perfstat_memory_total_t), 1)) { + return (jlong)(memory_info.real_free * 4L * 1024L); + } + return -1; #else // solaris / linux jlong num_avail_physical_pages = sysconf(_SC_AVPHYS_PAGES); return (num_avail_physical_pages * page_size); @@ -349,6 +359,12 @@ Java_sun_management_OperatingSystemImpl_getTotalPhysicalMemorySize return -1; } return result; +#elif defined(_AIX) + perfstat_memory_total_t memory_info; + if (-1 != perfstat_memory_total(NULL, &memory_info, sizeof(perfstat_memory_total_t), 1)) { + return (jlong)(memory_info.real_total * 4L * 1024L); + } + return -1; #else // solaris / linux jlong num_physical_pages = sysconf(_SC_PHYS_PAGES); return (num_physical_pages * page_size); diff --git a/jdk/src/solaris/native/sun/nio/ch/Net.c b/jdk/src/solaris/native/sun/nio/ch/Net.c index 679a9d8d0da..214f0f76300 100644 --- a/jdk/src/solaris/native/sun/nio/ch/Net.c +++ b/jdk/src/solaris/native/sun/nio/ch/Net.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -40,6 +40,9 @@ #include "nio.h" #include "sun_nio_ch_PollArrayWrapper.h" +#ifdef _AIX +#include +#endif /** * IP_MULTICAST_ALL supported since 2.6.31 but may not be available at @@ -51,24 +54,46 @@ #endif #endif -#ifdef _ALLBSD_SOURCE +#if defined(_ALLBSD_SOURCE) || defined(_AIX) #ifndef IP_BLOCK_SOURCE +#if defined(_AIX) + +#define IP_BLOCK_SOURCE 58 /* Block data from a given source to a given group */ +#define IP_UNBLOCK_SOURCE 59 /* Unblock data from a given source to a given group */ +#define IP_ADD_SOURCE_MEMBERSHIP 60 /* Join a source-specific group */ +#define IP_DROP_SOURCE_MEMBERSHIP 61 /* Leave a source-specific group */ + +#else + #define IP_ADD_SOURCE_MEMBERSHIP 70 /* join a source-specific group */ #define IP_DROP_SOURCE_MEMBERSHIP 71 /* drop a single source */ #define IP_BLOCK_SOURCE 72 /* block a source */ #define IP_UNBLOCK_SOURCE 73 /* unblock a source */ +#endif /* _AIX */ + #endif /* IP_BLOCK_SOURCE */ #ifndef MCAST_BLOCK_SOURCE +#if defined(_AIX) + +#define MCAST_BLOCK_SOURCE 64 +#define MCAST_UNBLOCK_SOURCE 65 +#define MCAST_JOIN_SOURCE_GROUP 66 +#define MCAST_LEAVE_SOURCE_GROUP 67 + +#else + #define MCAST_JOIN_SOURCE_GROUP 82 /* join a source-specific group */ #define MCAST_LEAVE_SOURCE_GROUP 83 /* leave a single source */ #define MCAST_BLOCK_SOURCE 84 /* block a source */ #define MCAST_UNBLOCK_SOURCE 85 /* unblock a source */ +#endif /* _AIX */ + #endif /* MCAST_BLOCK_SOURCE */ #ifndef IPV6_ADD_MEMBERSHIP @@ -123,6 +148,36 @@ static void initGroupSourceReq(JNIEnv* env, jbyteArray group, jint index, } #endif +#ifdef _AIX + +/* + * Checks whether or not "socket extensions for multicast source filters" is supported. + * Returns JNI_TRUE if it is supported, JNI_FALSE otherwise + */ +static jboolean isSourceFilterSupported(){ + static jboolean alreadyChecked = JNI_FALSE; + static jboolean result = JNI_TRUE; + if (alreadyChecked != JNI_TRUE){ + struct utsname uts; + memset(&uts, 0, sizeof(uts)); + strcpy(uts.sysname, "?"); + const int utsRes = uname(&uts); + int major = -1; + int minor = -1; + major = atoi(uts.version); + minor = atoi(uts.release); + if (strcmp(uts.sysname, "AIX") == 0) { + if (major < 6 || (major == 6 && minor < 1)) {// unsupported on aix < 6.1 + result = JNI_FALSE; + } + } + alreadyChecked = JNI_TRUE; + } + return result; +} + +#endif /* _AIX */ + JNIEXPORT void JNICALL Java_sun_nio_ch_Net_initIDs(JNIEnv *env, jclass clazz) { @@ -475,6 +530,14 @@ Java_sun_nio_ch_Net_joinOrDrop4(JNIEnv *env, jobject this, jboolean join, jobjec /* no IPv4 include-mode filtering for now */ return IOS_UNAVAILABLE; #else + +#ifdef _AIX + /* check AIX for support of source filtering */ + if (isSourceFilterSupported() != JNI_TRUE){ + return IOS_UNAVAILABLE; + } +#endif + mreq_source.imr_multiaddr.s_addr = htonl(group); mreq_source.imr_sourceaddr.s_addr = htonl(source); mreq_source.imr_interface.s_addr = htonl(interf); @@ -486,7 +549,7 @@ Java_sun_nio_ch_Net_joinOrDrop4(JNIEnv *env, jobject this, jboolean join, jobjec n = setsockopt(fdval(env,fdo), IPPROTO_IP, opt, optval, optlen); if (n < 0) { - if (join && (errno == ENOPROTOOPT)) + if (join && (errno == ENOPROTOOPT || errno == EOPNOTSUPP)) return IOS_UNAVAILABLE; handleSocketError(env, errno); } @@ -505,6 +568,13 @@ Java_sun_nio_ch_Net_blockOrUnblock4(JNIEnv *env, jobject this, jboolean block, j int n; int opt = (block) ? IP_BLOCK_SOURCE : IP_UNBLOCK_SOURCE; +#ifdef _AIX + /* check AIX for support of source filtering */ + if (isSourceFilterSupported() != JNI_TRUE){ + return IOS_UNAVAILABLE; + } +#endif + mreq_source.imr_multiaddr.s_addr = htonl(group); mreq_source.imr_sourceaddr.s_addr = htonl(source); mreq_source.imr_interface.s_addr = htonl(interf); @@ -512,7 +582,7 @@ Java_sun_nio_ch_Net_blockOrUnblock4(JNIEnv *env, jobject this, jboolean block, j n = setsockopt(fdval(env,fdo), IPPROTO_IP, opt, (void*)&mreq_source, sizeof(mreq_source)); if (n < 0) { - if (block && (errno == ENOPROTOOPT)) + if (block && (errno == ENOPROTOOPT || errno == EOPNOTSUPP)) return IOS_UNAVAILABLE; handleSocketError(env, errno); } @@ -550,7 +620,7 @@ Java_sun_nio_ch_Net_joinOrDrop6(JNIEnv *env, jobject this, jboolean join, jobjec n = setsockopt(fdval(env,fdo), IPPROTO_IPV6, opt, optval, optlen); if (n < 0) { - if (join && (errno == ENOPROTOOPT)) + if (join && (errno == ENOPROTOOPT || errno == EOPNOTSUPP)) return IOS_UNAVAILABLE; handleSocketError(env, errno); } @@ -579,7 +649,7 @@ Java_sun_nio_ch_Net_blockOrUnblock6(JNIEnv *env, jobject this, jboolean block, j n = setsockopt(fdval(env,fdo), IPPROTO_IPV6, opt, (void*)&req, sizeof(req)); if (n < 0) { - if (block && (errno == ENOPROTOOPT)) + if (block && (errno == ENOPROTOOPT || errno == EOPNOTSUPP)) return IOS_UNAVAILABLE; handleSocketError(env, errno); } diff --git a/jdk/src/solaris/native/sun/nio/fs/UnixNativeDispatcher.c b/jdk/src/solaris/native/sun/nio/fs/UnixNativeDispatcher.c index 8f408951e77..12f399d8512 100644 --- a/jdk/src/solaris/native/sun/nio/fs/UnixNativeDispatcher.c +++ b/jdk/src/solaris/native/sun/nio/fs/UnixNativeDispatcher.c @@ -42,7 +42,7 @@ #include #endif -#ifdef __linux__ +#if defined(__linux__) || defined(_AIX) #include #endif @@ -294,7 +294,13 @@ Java_sun_nio_fs_UnixNativeDispatcher_strerror(JNIEnv* env, jclass this, jint err jsize len; jbyteArray bytes; +#ifdef _AIX + /* strerror() is not thread-safe on AIX so we have to use strerror_r() */ + char buffer[256]; + msg = (strerror_r((int)error, buffer, 256) == 0) ? buffer : "Error while calling strerror_r"; +#else msg = strerror((int)error); +#endif len = strlen(msg); bytes = (*env)->NewByteArray(env, len); if (bytes != NULL) { @@ -674,6 +680,15 @@ Java_sun_nio_fs_UnixNativeDispatcher_readdir(JNIEnv* env, jclass this, jlong val /* EINTR not listed as a possible error */ /* TDB: reentrant version probably not required here */ res = readdir64_r(dirp, ptr, &result); + +#ifdef _AIX + /* On AIX, readdir_r() returns EBADF (i.e. '9') and sets 'result' to NULL for the */ + /* directory stream end. Otherwise, 'errno' will contain the error code. */ + if (res != 0) { + res = (result == NULL && res == EBADF) ? 0 : errno; + } +#endif + if (res != 0) { throwUnixException(env, res); return NULL; @@ -877,6 +892,18 @@ Java_sun_nio_fs_UnixNativeDispatcher_statvfs0(JNIEnv* env, jclass this, if (err == -1) { throwUnixException(env, errno); } else { +#ifdef _AIX + /* AIX returns ULONG_MAX in buf.f_blocks for the /proc file system. */ + /* This is too big for a Java signed long and fools various tests. */ + if (buf.f_blocks == ULONG_MAX) { + buf.f_blocks = 0; + } + /* The number of free or available blocks can never exceed the total number of blocks */ + if (buf.f_blocks == 0) { + buf.f_bfree = 0; + buf.f_bavail = 0; + } +#endif (*env)->SetLongField(env, attrs, attrs_f_frsize, long_to_jlong(buf.f_frsize)); (*env)->SetLongField(env, attrs, attrs_f_blocks, long_to_jlong(buf.f_blocks)); (*env)->SetLongField(env, attrs, attrs_f_bfree, long_to_jlong(buf.f_bfree)); diff --git a/jdk/src/solaris/native/sun/security/pkcs11/j2secmod_md.c b/jdk/src/solaris/native/sun/security/pkcs11/j2secmod_md.c index f509c42b559..8b3a62bfdc6 100644 --- a/jdk/src/solaris/native/sun/security/pkcs11/j2secmod_md.c +++ b/jdk/src/solaris/native/sun/security/pkcs11/j2secmod_md.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -50,7 +50,11 @@ JNIEXPORT jlong JNICALL Java_sun_security_pkcs11_Secmod_nssGetLibraryHandle { const char *libName = (*env)->GetStringUTFChars(env, jLibName, NULL); // look up existing handle only, do not load +#if defined(AIX) + void *hModule = dlopen(libName, RTLD_LAZY); +#else void *hModule = dlopen(libName, RTLD_NOLOAD); +#endif dprintf2("-handle for %s: %u\n", libName, hModule); (*env)->ReleaseStringUTFChars(env, jLibName, libName); return ptr_to_jlong(hModule); diff --git a/jdk/src/windows/native/java/net/net_util_md.c b/jdk/src/windows/native/java/net/net_util_md.c index 6ddb2bcfd78..1cacb57386b 100644 --- a/jdk/src/windows/native/java/net/net_util_md.c +++ b/jdk/src/windows/native/java/net/net_util_md.c @@ -125,8 +125,8 @@ DllMain(HINSTANCE hinst, DWORD reason, LPVOID reserved) return TRUE; } -void initLocalAddrTable () {} -void parseExclusiveBindProperty (JNIEnv *env) {} +void platformInit() {} +void parseExclusiveBindProperty(JNIEnv *env) {} /* * Since winsock doesn't have the equivalent of strerror(errno) diff --git a/jdk/test/java/lang/ProcessBuilder/Basic.java b/jdk/test/java/lang/ProcessBuilder/Basic.java index 5a55cb6f0f4..1a62298721a 100644 --- a/jdk/test/java/lang/ProcessBuilder/Basic.java +++ b/jdk/test/java/lang/ProcessBuilder/Basic.java @@ -58,6 +58,9 @@ public class Basic { /* used for Mac OS X only */ static final String cfUserTextEncoding = System.getenv("__CF_USER_TEXT_ENCODING"); + /* used for AIX only */ + static final String libpath = System.getenv("LIBPATH"); + private static String commandOutput(Reader r) throws Throwable { StringBuilder sb = new StringBuilder(); int c; @@ -75,7 +78,11 @@ public class Basic { String output = commandOutput(r); equal(p.waitFor(), 0); equal(p.exitValue(), 0); - return output; + // The debug/fastdebug versions of the VM may write some warnings to stdout + // (i.e. "Warning: Cannot open log file: hotspot.log" if the VM is started + // in a directory without write permissions). These warnings will confuse tests + // which match the entire output of the child process so better filter them out. + return output.replaceAll("Warning:.*\\n", ""); } private static String commandOutput(ProcessBuilder pb) { @@ -584,6 +591,12 @@ public class Basic { System.getProperty("os.name").startsWith("Windows"); } + static class AIX { + public static boolean is() { return is; } + private static final boolean is = + System.getProperty("os.name").equals("AIX"); + } + static class Unix { public static boolean is() { return is; } private static final boolean is = @@ -637,7 +650,7 @@ public class Basic { private static boolean isEnglish(String envvar) { String val = getenv(envvar); - return (val == null) || val.matches("en.*"); + return (val == null) || val.matches("en.*") || val.matches("C"); } /** Returns true if we can expect English OS error strings */ @@ -712,6 +725,14 @@ public class Basic { return cleanedVars.replace(javaMainClassStr,""); } + /* Only used for AIX -- + * AIX adds the variable AIXTHREAD_GUARDPAGES=0 to the environment. + * Remove it from the list of env variables + */ + private static String removeAixExpectedVars(String vars) { + return vars.replace("AIXTHREAD_GUARDPAGES=0,",""); + } + private static String sortByLinesWindowsly(String text) { String[] lines = text.split("\n"); Arrays.sort(lines, new WindowsComparator()); @@ -1160,13 +1181,20 @@ public class Basic { ProcessBuilder pb = new ProcessBuilder(); pb.environment().clear(); String expected = Windows.is() ? "SystemRoot="+systemRoot+",": ""; + expected = AIX.is() ? "LIBPATH="+libpath+",": expected; if (Windows.is()) { pb.environment().put("SystemRoot", systemRoot); } + if (AIX.is()) { + pb.environment().put("LIBPATH", libpath); + } String result = getenvInChild(pb); if (MacOSX.is()) { result = removeMacExpectedVars(result); } + if (AIX.is()) { + result = removeAixExpectedVars(result); + } equal(result, expected); } catch (Throwable t) { unexpected(t); } @@ -1681,10 +1709,14 @@ public class Basic { } Process p = Runtime.getRuntime().exec(cmdp, envp); String expected = Windows.is() ? "=C:=\\,=ExitValue=3,SystemRoot="+systemRoot+"," : "=C:=\\,"; + expected = AIX.is() ? expected + "LIBPATH="+libpath+",": expected; String commandOutput = commandOutput(p); if (MacOSX.is()) { commandOutput = removeMacExpectedVars(commandOutput); } + if (AIX.is()) { + commandOutput = removeAixExpectedVars(commandOutput); + } equal(commandOutput, expected); if (Windows.is()) { ProcessBuilder pb = new ProcessBuilder(childArgs); @@ -1736,9 +1768,14 @@ public class Basic { if (MacOSX.is()) { commandOutput = removeMacExpectedVars(commandOutput); } + if (AIX.is()) { + commandOutput = removeAixExpectedVars(commandOutput); + } check(commandOutput.equals(Windows.is() ? "LC_ALL=C,SystemRoot="+systemRoot+"," - : "LC_ALL=C,"), + : AIX.is() + ? "LC_ALL=C,LIBPATH="+libpath+"," + : "LC_ALL=C,"), "Incorrect handling of envstrings containing NULs"); } catch (Throwable t) { unexpected(t); } @@ -2015,7 +2052,12 @@ public class Basic { if (Unix.is() && new File("/bin/bash").exists() && new File("/bin/sleep").exists()) { - final String[] cmd = { "/bin/bash", "-c", "(/bin/sleep 6666)" }; + // Notice that we only destroy the process created by us (i.e. + // our child) but not our grandchild (i.e. '/bin/sleep'). So + // pay attention that the grandchild doesn't run too long to + // avoid polluting the process space with useless processes. + // Running the grandchild for 60s should be more than enough. + final String[] cmd = { "/bin/bash", "-c", "(/bin/sleep 60)" }; final ProcessBuilder pb = new ProcessBuilder(cmd); final Process p = pb.start(); final InputStream stdout = p.getInputStream(); @@ -2037,12 +2079,26 @@ public class Basic { reader.start(); Thread.sleep(100); p.destroy(); - // Subprocess is now dead, but file descriptors remain open. check(p.waitFor() != 0); check(p.exitValue() != 0); + // Subprocess is now dead, but file descriptors remain open. + // Make sure the test will fail if we don't manage to close + // the open streams within 30 seconds. Notice that this time + // must be shorter than the sleep time of the grandchild. + Timer t = new Timer("test/java/lang/ProcessBuilder/Basic.java process reaper", true); + t.schedule(new TimerTask() { + public void run() { + fail("Subprocesses which create subprocesses of " + + "their own caused the parent to hang while " + + "waiting for file descriptors to be closed."); + System.exit(-1); + } + }, 30000); stdout.close(); stderr.close(); stdin.close(); + // All streams successfully closed so we can cancel the timer. + t.cancel(); //---------------------------------------------------------- // There remain unsolved issues with asynchronous close. // Here's a highly non-portable experiment to demonstrate: @@ -2188,8 +2244,9 @@ public class Basic { } long end = System.nanoTime(); // give waitFor(timeout) a wide berth (100ms) - if ((end - start) > 100000000) - fail("Test failed: waitFor took too long"); + // Old AIX machines my need a little longer. + if ((end - start) > 100000000L * (AIX.is() ? 4 : 1)) + fail("Test failed: waitFor took too long (" + (end - start) + "ns)"); p.destroy(); p.waitFor(); @@ -2216,7 +2273,7 @@ public class Basic { long end = System.nanoTime(); if ((end - start) < 500000000) - fail("Test failed: waitFor didn't take long enough"); + fail("Test failed: waitFor didn't take long enough (" + (end - start) + "ns)"); p.destroy(); @@ -2224,7 +2281,7 @@ public class Basic { p.waitFor(1000, TimeUnit.MILLISECONDS); end = System.nanoTime(); if ((end - start) > 900000000) - fail("Test failed: waitFor took too long on a dead process."); + fail("Test failed: waitFor took too long on a dead process. (" + (end - start) + "ns)"); } catch (Throwable t) { unexpected(t); } //---------------------------------------------------------------- diff --git a/jdk/test/java/lang/ProcessBuilder/DestroyTest.java b/jdk/test/java/lang/ProcessBuilder/DestroyTest.java index ebf00e32b79..401bd146c28 100644 --- a/jdk/test/java/lang/ProcessBuilder/DestroyTest.java +++ b/jdk/test/java/lang/ProcessBuilder/DestroyTest.java @@ -154,6 +154,9 @@ public class DestroyTest { } else if (osName.equals("SunOS")) { return new UnixTest( File.createTempFile("ProcessTrap-", ".sh",null)); + } else if (osName.equals("AIX")) { + return new UnixTest( + File.createTempFile("ProcessTrap-", ".sh",null)); } return null; } From ab92b2401efcef192d3203d96365721a2964f4d1 Mon Sep 17 00:00:00 2001 From: Athijegannathan Sundararajan Date: Wed, 27 Nov 2013 14:13:52 +0530 Subject: [PATCH 103/377] 8028345: Remove nashorn repo "bin" scripts to avoid confusion with JDK bin launcher programs Reviewed-by: lagergren, hannesw --- nashorn/bin/jjs | 29 ----------------------------- nashorn/bin/jjs.bat | 27 --------------------------- nashorn/bin/jjssecure | 29 ----------------------------- nashorn/bin/jjssecure.bat | 27 --------------------------- nashorn/bin/nashorn | 29 ----------------------------- nashorn/bin/nashorn.bat | 27 --------------------------- nashorn/bin/nashornsecure | 29 ----------------------------- nashorn/bin/nashornsecure.bat | 27 --------------------------- 8 files changed, 224 deletions(-) delete mode 100644 nashorn/bin/jjs delete mode 100644 nashorn/bin/jjs.bat delete mode 100644 nashorn/bin/jjssecure delete mode 100644 nashorn/bin/jjssecure.bat delete mode 100644 nashorn/bin/nashorn delete mode 100644 nashorn/bin/nashorn.bat delete mode 100644 nashorn/bin/nashornsecure delete mode 100644 nashorn/bin/nashornsecure.bat diff --git a/nashorn/bin/jjs b/nashorn/bin/jjs deleted file mode 100644 index f89a07c2c9a..00000000000 --- a/nashorn/bin/jjs +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash -# -# Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# 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. -# - -[ -z "$JAVA_HOME" ] && echo "Please set JAVA_HOME" && exit 1; - -$JAVA_HOME/bin/java -server -XX:+TieredCompilation -Xms2G -Xmx2G -esa -ea -Djava.ext.dirs=`dirname $0`/../dist:$JAVA_HOME/jre/lib/ext -XX:+HeapDumpOnOutOfMemoryError -Djava.lang.invoke.MethodHandle.DEBUG_NAMES=false -Dnashorn.debug=true jdk.nashorn.tools.Shell $* diff --git a/nashorn/bin/jjs.bat b/nashorn/bin/jjs.bat deleted file mode 100644 index 3c1c1595c47..00000000000 --- a/nashorn/bin/jjs.bat +++ /dev/null @@ -1,27 +0,0 @@ -rem -rem Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. -rem DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -rem -rem This code is free software; you can redistribute it and/or modify it -rem under the terms of the GNU General Public License version 2 only, as -rem published by the Free Software Foundation. Oracle designates this -rem particular file as subject to the "Classpath" exception as provided -rem by Oracle in the LICENSE file that accompanied this code. -rem -rem This code is distributed in the hope that it will be useful, but WITHOUT -rem ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -rem FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -rem version 2 for more details (a copy is included in the LICENSE file that -rem accompanied this code). -rem -rem You should have received a copy of the GNU General Public License version -rem 2 along with this work; if not, write to the Free Software Foundation, -rem Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -rem -rem Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -rem or visit www.oracle.com if you need additional information or have any -rem questions. -rem -@echo off - -java -Xms2G -Xmx2G -XX:-TieredCompilation -server -esa -ea -Djava.ext.dirs=%~dp0\..\dist -XX:+HeapDumpOnOutOfMemoryError -Dnashorn.debug=true -Djava.lang.invoke.MethodHandle.DEBUG_NAMES=false jdk.nashorn.tools.Shell diff --git a/nashorn/bin/jjssecure b/nashorn/bin/jjssecure deleted file mode 100644 index db6bdfc4178..00000000000 --- a/nashorn/bin/jjssecure +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash -# -# Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# 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. -# - -[ -z "$JAVA_HOME" ] && echo "Please set JAVA_HOME" && exit 1; - -$JAVA_HOME/bin/java -Xms2G -Xmx2G -XX:-TieredCompilation -server -esa -ea -Djava.security.properties=`dirname $0`/../make/java.security.override -Djava.ext.dirs=`dirname $0`/../dist:$JAVA_HOME/jre/lib/ext -XX:+HeapDumpOnOutOfMemoryError -Dnashorn.debug=true -Djava.lang.invoke.MethodHandle.DEBUG_NAMES=true -Dnashorn.home=`dirname $0`/.. -Djava.security.manager jdk.nashorn.tools.Shell $* diff --git a/nashorn/bin/jjssecure.bat b/nashorn/bin/jjssecure.bat deleted file mode 100644 index f8da10aaaf6..00000000000 --- a/nashorn/bin/jjssecure.bat +++ /dev/null @@ -1,27 +0,0 @@ -rem -rem Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. -rem DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -rem -rem This code is free software; you can redistribute it and/or modify it -rem under the terms of the GNU General Public License version 2 only, as -rem published by the Free Software Foundation. Oracle designates this -rem particular file as subject to the "Classpath" exception as provided -rem by Oracle in the LICENSE file that accompanied this code. -rem -rem This code is distributed in the hope that it will be useful, but WITHOUT -rem ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -rem FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -rem version 2 for more details (a copy is included in the LICENSE file that -rem accompanied this code). -rem -rem You should have received a copy of the GNU General Public License version -rem 2 along with this work; if not, write to the Free Software Foundation, -rem Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -rem -rem Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -rem or visit www.oracle.com if you need additional information or have any -rem questions. -rem -@echo off - -java -Xms2G -Xmx2G -XX:-TieredCompilation -server -esa -ea -Djava.security.properties=%~dp0\..\make\java.security.override -Djava.ext.dirs=%~dp0\..\dist -XX:+HeapDumpOnOutOfMemoryError -Dnashorn.debug=true -Djava.lang.invoke.MethodHandle.DEBUG_NAMES=false -Dnashorn.home=%~dp0\.. -Djava.security.manager jdk.nashorn.tools.Shell diff --git a/nashorn/bin/nashorn b/nashorn/bin/nashorn deleted file mode 100644 index da22be1fb01..00000000000 --- a/nashorn/bin/nashorn +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash -# -# Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# 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. -# - -[ -z "$JAVA_HOME" ] && echo "Please set JAVA_HOME" && exit 1; - -$JAVA_HOME/bin/jrunscript -J-Xms2G -J-Xmx2G -J-XX:-TieredCompilation -J-server -J-esa -J-ea -J-Djava.ext.dirs=`dirname $0`/../dist:$JAVA_HOME/jre/lib/ext -J-XX:+HeapDumpOnOutOfMemoryError -J-Djava.lang.invoke.MethodHandle.DEBUG_NAMES=false -J-Dnashorn.debug=true -l nashorn $* diff --git a/nashorn/bin/nashorn.bat b/nashorn/bin/nashorn.bat deleted file mode 100644 index 2961ac699a4..00000000000 --- a/nashorn/bin/nashorn.bat +++ /dev/null @@ -1,27 +0,0 @@ -rem -rem Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. -rem DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -rem -rem This code is free software; you can redistribute it and/or modify it -rem under the terms of the GNU General Public License version 2 only, as -rem published by the Free Software Foundation. Oracle designates this -rem particular file as subject to the "Classpath" exception as provided -rem by Oracle in the LICENSE file that accompanied this code. -rem -rem This code is distributed in the hope that it will be useful, but WITHOUT -rem ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -rem FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -rem version 2 for more details (a copy is included in the LICENSE file that -rem accompanied this code). -rem -rem You should have received a copy of the GNU General Public License version -rem 2 along with this work; if not, write to the Free Software Foundation, -rem Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -rem -rem Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -rem or visit www.oracle.com if you need additional information or have any -rem questions. -rem -@echo off - -jrunscript -J-Xms2G -J-Xmx2G -J-XX:-TieredCompilation -J-server -J-esa -J-ea -J-Djava.ext.dirs=%~dp0\..\dist -J-XX:+HeapDumpOnOutOfMemoryError -J-Dnashorn.debug=true -J-Djava.lang.invoke.MethodHandle.DEBUG_NAMES=false -l nashorn diff --git a/nashorn/bin/nashornsecure b/nashorn/bin/nashornsecure deleted file mode 100644 index 77c7c52933a..00000000000 --- a/nashorn/bin/nashornsecure +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash -# -# Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# 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. -# - -[ -z "$JAVA_HOME" ] && echo "Please set JAVA_HOME" && exit 1; - -$JAVA_HOME/bin/jrunscript -J-Djava.security.properties=`dirname $0`/../make/java.security.override -J-Djava.security.manager -J-Xms2G -J-Xmx2G -J-XX:-TieredCompilation -J-server -J-esa -J-ea -J-Djava.ext.dirs=`dirname $0`/../dist:$JAVA_HOME/jre/lib/ext -J-XX:+HeapDumpOnOutOfMemoryError -J-Djava.lang.invoke.MethodHandle.DEBUG_NAMES=false -J-Dnashorn.debug=true -l nashorn $* diff --git a/nashorn/bin/nashornsecure.bat b/nashorn/bin/nashornsecure.bat deleted file mode 100644 index 5a4eca63c64..00000000000 --- a/nashorn/bin/nashornsecure.bat +++ /dev/null @@ -1,27 +0,0 @@ -rem -rem Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. -rem DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -rem -rem This code is free software; you can redistribute it and/or modify it -rem under the terms of the GNU General Public License version 2 only, as -rem published by the Free Software Foundation. Oracle designates this -rem particular file as subject to the "Classpath" exception as provided -rem by Oracle in the LICENSE file that accompanied this code. -rem -rem This code is distributed in the hope that it will be useful, but WITHOUT -rem ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -rem FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -rem version 2 for more details (a copy is included in the LICENSE file that -rem accompanied this code). -rem -rem You should have received a copy of the GNU General Public License version -rem 2 along with this work; if not, write to the Free Software Foundation, -rem Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -rem -rem Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -rem or visit www.oracle.com if you need additional information or have any -rem questions. -rem -@echo off - -jrunscript -J-Djava.security.properties=%~dp0\..\make\java.security.override -J-Djava.security.manager -J-Xms2G -J-Xmx2G -J-XX:-TieredCompilation -J-server -J-esa -J-ea -J-Djava.ext.dirs=%~dp0\..\dist -J-XX:+HeapDumpOnOutOfMemoryError -J-Dnashorn.debug=true -J-Djava.lang.invoke.MethodHandle.DEBUG_NAMES=false -l nashorn From 31006e8d3372260c592aab1932d829aa29b64c8b Mon Sep 17 00:00:00 2001 From: Athijegannathan Sundararajan Date: Mon, 2 Dec 2013 18:19:26 +0530 Subject: [PATCH 104/377] 8029364: NashornException to expose thrown object Reviewed-by: lagergren, jlaskey --- .../api/scripting/NashornException.java | 32 ++++++++++++ .../api/scripting/NashornScriptEngine.java | 13 +++-- .../api/scripting/ScriptObjectMirror.java | 8 +++ .../internal/runtime/ECMAException.java | 1 + nashorn/test/script/basic/JDK-8029364.js | 49 +++++++++++++++++++ .../test/script/basic/JDK-8029364.js.EXPECTED | 7 +++ 6 files changed, 106 insertions(+), 4 deletions(-) create mode 100644 nashorn/test/script/basic/JDK-8029364.js create mode 100644 nashorn/test/script/basic/JDK-8029364.js.EXPECTED diff --git a/nashorn/src/jdk/nashorn/api/scripting/NashornException.java b/nashorn/src/jdk/nashorn/api/scripting/NashornException.java index d5ec5bb4a60..f570ca71d01 100644 --- a/nashorn/src/jdk/nashorn/api/scripting/NashornException.java +++ b/nashorn/src/jdk/nashorn/api/scripting/NashornException.java @@ -29,6 +29,7 @@ import java.util.ArrayList; import java.util.List; import jdk.nashorn.internal.codegen.CompilerConstants; import jdk.nashorn.internal.runtime.ECMAErrors; +import jdk.nashorn.internal.runtime.ScriptObject; /** * This is base exception for all Nashorn exceptions. These originate from @@ -49,6 +50,8 @@ public abstract class NashornException extends RuntimeException { private final int line; // script column number private final int column; + // underlying ECMA error object - lazily initialized + private Object ecmaError; /** script source name used for "engine.js" */ public static final String ENGINE_SCRIPT_SOURCE_NAME = "nashorn:engine/resources/engine.js"; @@ -188,4 +191,33 @@ public abstract class NashornException extends RuntimeException { } return buf.toString(); } + + protected Object getThrown() { + return null; + } + + protected NashornException initEcmaError(final ScriptObject global) { + if (ecmaError != null) { + return this; // initialized already! + } + + final Object thrown = getThrown(); + if (thrown instanceof ScriptObject) { + ecmaError = ScriptObjectMirror.wrap(thrown, global); + } else { + ecmaError = thrown; + } + + return this; + } + + /** + * Return the underlying ECMA error object, if available. + * + * @return underlying ECMA Error object's mirror or whatever was thrown + * from script such as a String, Number or a Boolean. + */ + public Object getEcmaError() { + return ecmaError; + } } diff --git a/nashorn/src/jdk/nashorn/api/scripting/NashornScriptEngine.java b/nashorn/src/jdk/nashorn/api/scripting/NashornScriptEngine.java index d0fb0c31832..f4e2f23f4d6 100644 --- a/nashorn/src/jdk/nashorn/api/scripting/NashornScriptEngine.java +++ b/nashorn/src/jdk/nashorn/api/scripting/NashornScriptEngine.java @@ -476,16 +476,19 @@ public final class NashornScriptEngine extends AbstractScriptEngine implements C private Object invokeImpl(final Object selfObject, final String name, final Object... args) throws ScriptException, NoSuchMethodException { name.getClass(); // null check + ScriptObject invokeGlobal = null; ScriptObjectMirror selfMirror = null; if (selfObject instanceof ScriptObjectMirror) { selfMirror = (ScriptObjectMirror)selfObject; if (! isOfContext(selfMirror.getHomeGlobal(), nashornContext)) { throw new IllegalArgumentException(getMessage("script.object.from.another.engine")); } + invokeGlobal = selfMirror.getHomeGlobal(); } else if (selfObject instanceof ScriptObject) { // invokeMethod called from script code - in which case we may get 'naked' ScriptObject // Wrap it with oldGlobal to make a ScriptObjectMirror for the same. final ScriptObject oldGlobal = Context.getGlobal(); + invokeGlobal = oldGlobal; if (oldGlobal == null) { throw new IllegalArgumentException(getMessage("no.current.nashorn.global")); } @@ -498,6 +501,7 @@ public final class NashornScriptEngine extends AbstractScriptEngine implements C } else if (selfObject == null) { // selfObject is null => global function call final ScriptObject ctxtGlobal = getNashornGlobalFrom(context); + invokeGlobal = ctxtGlobal; selfMirror = (ScriptObjectMirror)ScriptObjectMirror.wrap(ctxtGlobal, ctxtGlobal); } @@ -509,7 +513,7 @@ public final class NashornScriptEngine extends AbstractScriptEngine implements C if (cause instanceof NoSuchMethodException) { throw (NoSuchMethodException)cause; } - throwAsScriptException(e); + throwAsScriptException(e, invokeGlobal); throw new AssertionError("should not reach here"); } } @@ -543,7 +547,7 @@ public final class NashornScriptEngine extends AbstractScriptEngine implements C } return ScriptObjectMirror.translateUndefined(ScriptObjectMirror.wrap(ScriptRuntime.apply(script, ctxtGlobal), ctxtGlobal)); } catch (final Exception e) { - throwAsScriptException(e); + throwAsScriptException(e, ctxtGlobal); throw new AssertionError("should not reach here"); } finally { if (globalChanged) { @@ -552,7 +556,7 @@ public final class NashornScriptEngine extends AbstractScriptEngine implements C } } - private static void throwAsScriptException(final Exception e) throws ScriptException { + private static void throwAsScriptException(final Exception e, final ScriptObject global) throws ScriptException { if (e instanceof ScriptException) { throw (ScriptException)e; } else if (e instanceof NashornException) { @@ -560,6 +564,7 @@ public final class NashornScriptEngine extends AbstractScriptEngine implements C final ScriptException se = new ScriptException( ne.getMessage(), ne.getFileName(), ne.getLineNumber(), ne.getColumnNumber()); + ne.initEcmaError(global); se.initCause(e); throw se; } else if (e instanceof RuntimeException) { @@ -605,7 +610,7 @@ public final class NashornScriptEngine extends AbstractScriptEngine implements C return nashornContext.compileScript(source, newGlobal); } catch (final Exception e) { - throwAsScriptException(e); + throwAsScriptException(e, newGlobal); throw new AssertionError("should not reach here"); } finally { if (globalChanged) { diff --git a/nashorn/src/jdk/nashorn/api/scripting/ScriptObjectMirror.java b/nashorn/src/jdk/nashorn/api/scripting/ScriptObjectMirror.java index 911f1663cb6..01f72c0008f 100644 --- a/nashorn/src/jdk/nashorn/api/scripting/ScriptObjectMirror.java +++ b/nashorn/src/jdk/nashorn/api/scripting/ScriptObjectMirror.java @@ -108,6 +108,8 @@ public final class ScriptObjectMirror extends AbstractJSObject implements Bindin } throw new RuntimeException("not a function: " + toString()); + } catch (final NashornException ne) { + throw ne.initEcmaError(global); } catch (final RuntimeException | Error e) { throw e; } catch (final Throwable t) { @@ -135,6 +137,8 @@ public final class ScriptObjectMirror extends AbstractJSObject implements Bindin } throw new RuntimeException("not a constructor: " + toString()); + } catch (final NashornException ne) { + throw ne.initEcmaError(global); } catch (final RuntimeException | Error e) { throw e; } catch (final Throwable t) { @@ -182,6 +186,8 @@ public final class ScriptObjectMirror extends AbstractJSObject implements Bindin } throw new NoSuchMethodException("No such function " + functionName); + } catch (final NashornException ne) { + throw ne.initEcmaError(global); } catch (final RuntimeException | Error e) { throw e; } catch (final Throwable t) { @@ -717,6 +723,8 @@ public final class ScriptObjectMirror extends AbstractJSObject implements Bindin } try { return callable.call(); + } catch (final NashornException ne) { + throw ne.initEcmaError(global); } catch (final RuntimeException e) { throw e; } catch (final Exception e) { diff --git a/nashorn/src/jdk/nashorn/internal/runtime/ECMAException.java b/nashorn/src/jdk/nashorn/internal/runtime/ECMAException.java index a32e721cc46..ff524bc0bc9 100644 --- a/nashorn/src/jdk/nashorn/internal/runtime/ECMAException.java +++ b/nashorn/src/jdk/nashorn/internal/runtime/ECMAException.java @@ -88,6 +88,7 @@ public final class ECMAException extends NashornException { * Get the thrown object * @return thrown object */ + @Override public Object getThrown() { return thrown; } diff --git a/nashorn/test/script/basic/JDK-8029364.js b/nashorn/test/script/basic/JDK-8029364.js new file mode 100644 index 00000000000..dfa8ea9de4f --- /dev/null +++ b/nashorn/test/script/basic/JDK-8029364.js @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * 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. + */ + +/** + * JDK-8029364: NashornException to expose thrown object + * + * @test + * @run + */ + +var m = new javax.script.ScriptEngineManager(); +var e = m.getEngineByName("nashorn"); +var g = e.eval("this"); +try { + e.eval("var e = new Error('foo'); e.bar = 33; throw e"); +} catch (se) { + // ScriptException instance's cause is a NashornException + print(se.getClass()); + var cause = se.cause; + print(cause.getClass()); + // NashornException instance has 'ecmaError' bean getter + print(cause.ecmaError); + // access to underlying ECMA Error object + print(cause.ecmaError instanceof g.Error); + print(cause.ecmaError.name); + print(cause.ecmaError.message); + print(cause.ecmaError.bar); +} + diff --git a/nashorn/test/script/basic/JDK-8029364.js.EXPECTED b/nashorn/test/script/basic/JDK-8029364.js.EXPECTED new file mode 100644 index 00000000000..d01bb9ee0b7 --- /dev/null +++ b/nashorn/test/script/basic/JDK-8029364.js.EXPECTED @@ -0,0 +1,7 @@ +class javax.script.ScriptException +class jdk.nashorn.internal.runtime.ECMAException +Error: foo +true +Error +foo +33 From 722570a7ee4a2059530c645eed7c4150b5b2c775 Mon Sep 17 00:00:00 2001 From: John R Rose Date: Thu, 5 Dec 2013 00:36:42 -0800 Subject: [PATCH 105/377] 8029507: Enhance JVM method processing Update MemberName.clazz correctly in MemberName.resolve; also pass lookupClass to MethodHandles::resolve_MemberName Reviewed-by: acorn, vlivanov --- hotspot/src/share/vm/prims/methodHandles.cpp | 66 +++++++++++++------- hotspot/src/share/vm/prims/methodHandles.hpp | 2 +- 2 files changed, 46 insertions(+), 22 deletions(-) diff --git a/hotspot/src/share/vm/prims/methodHandles.cpp b/hotspot/src/share/vm/prims/methodHandles.cpp index 94b5537a6a5..e1fafabf54d 100644 --- a/hotspot/src/share/vm/prims/methodHandles.cpp +++ b/hotspot/src/share/vm/prims/methodHandles.cpp @@ -175,8 +175,8 @@ oop MethodHandles::init_MemberName(Handle mname, Handle target) { oop MethodHandles::init_method_MemberName(Handle mname, CallInfo& info) { assert(info.resolved_appendix().is_null(), "only normal methods here"); - KlassHandle receiver_limit = info.resolved_klass(); methodHandle m = info.resolved_method(); + KlassHandle m_klass = m->method_holder(); int flags = (jushort)( m->access_flags().as_short() & JVM_RECOGNIZED_METHOD_MODIFIERS ); int vmindex = Method::invalid_vtable_index; @@ -184,14 +184,13 @@ oop MethodHandles::init_method_MemberName(Handle mname, CallInfo& info) { case CallInfo::itable_call: vmindex = info.itable_index(); // More importantly, the itable index only works with the method holder. - receiver_limit = m->method_holder(); - assert(receiver_limit->verify_itable_index(vmindex), ""); + assert(m_klass->verify_itable_index(vmindex), ""); flags |= IS_METHOD | (JVM_REF_invokeInterface << REFERENCE_KIND_SHIFT); if (TraceInvokeDynamic) { ResourceMark rm; - tty->print_cr("memberName: invokeinterface method_holder::method: %s, receiver: %s, itableindex: %d, access_flags:", - Method::name_and_sig_as_C_string(receiver_limit(), m->name(), m->signature()), - receiver_limit()->internal_name(), vmindex); + tty->print_cr("memberName: invokeinterface method_holder::method: %s, itableindex: %d, access_flags:", + Method::name_and_sig_as_C_string(m->method_holder(), m->name(), m->signature()), + vmindex); m->access_flags().print_on(tty); if (!m->is_abstract()) { tty->print("default"); @@ -203,12 +202,35 @@ oop MethodHandles::init_method_MemberName(Handle mname, CallInfo& info) { case CallInfo::vtable_call: vmindex = info.vtable_index(); flags |= IS_METHOD | (JVM_REF_invokeVirtual << REFERENCE_KIND_SHIFT); - assert(receiver_limit->is_subtype_of(m->method_holder()), "virtual call must be type-safe"); + assert(info.resolved_klass()->is_subtype_of(m_klass()), "virtual call must be type-safe"); + if (m_klass->is_interface()) { + // This is a vtable call to an interface method (abstract "miranda method" or default method). + // The vtable index is meaningless without a class (not interface) receiver type, so get one. + // (LinkResolver should help us figure this out.) + KlassHandle m_klass_non_interface = info.resolved_klass(); + if (m_klass_non_interface->is_interface()) { + m_klass_non_interface = SystemDictionary::Object_klass(); +#ifdef ASSERT + { ResourceMark rm; + Method* m2 = m_klass_non_interface->vtable()->method_at(vmindex); + assert(m->name() == m2->name() && m->signature() == m2->signature(), + err_msg("at %d, %s != %s", vmindex, + m->name_and_sig_as_C_string(), m2->name_and_sig_as_C_string())); + } +#endif //ASSERT + } + if (!m->is_public()) { + assert(m->is_public(), "virtual call must be to public interface method"); + return NULL; // elicit an error later in product build + } + assert(info.resolved_klass()->is_subtype_of(m_klass_non_interface()), "virtual call must be type-safe"); + m_klass = m_klass_non_interface; + } if (TraceInvokeDynamic) { ResourceMark rm; tty->print_cr("memberName: invokevirtual method_holder::method: %s, receiver: %s, vtableindex: %d, access_flags:", - Method::name_and_sig_as_C_string(receiver_limit(), m->name(), m->signature()), - receiver_limit()->internal_name(), vmindex); + Method::name_and_sig_as_C_string(m->method_holder(), m->name(), m->signature()), + m_klass->internal_name(), vmindex); m->access_flags().print_on(tty); if (m->is_default_method()) { tty->print("default"); @@ -223,10 +245,8 @@ oop MethodHandles::init_method_MemberName(Handle mname, CallInfo& info) { flags |= IS_METHOD | (JVM_REF_invokeStatic << REFERENCE_KIND_SHIFT); } else if (m->is_initializer()) { flags |= IS_CONSTRUCTOR | (JVM_REF_invokeSpecial << REFERENCE_KIND_SHIFT); - assert(receiver_limit == m->method_holder(), "constructor call must be exactly typed"); } else { flags |= IS_METHOD | (JVM_REF_invokeSpecial << REFERENCE_KIND_SHIFT); - assert(receiver_limit->is_subtype_of(m->method_holder()), "special call must be type-safe"); } break; @@ -242,7 +262,7 @@ oop MethodHandles::init_method_MemberName(Handle mname, CallInfo& info) { java_lang_invoke_MemberName::set_flags( mname_oop, flags); java_lang_invoke_MemberName::set_vmtarget(mname_oop, m()); java_lang_invoke_MemberName::set_vmindex( mname_oop, vmindex); // vtable/itable index - java_lang_invoke_MemberName::set_clazz( mname_oop, receiver_limit->java_mirror()); + java_lang_invoke_MemberName::set_clazz( mname_oop, m_klass->java_mirror()); // Note: name and type can be lazily computed by resolve_MemberName, // if Java code needs them as resolved String and MethodType objects. // The clazz must be eagerly stored, because it provides a GC @@ -569,7 +589,7 @@ oop MethodHandles::field_signature_type_or_null(Symbol* s) { // An unresolved member name is a mere symbolic reference. // Resolving it plants a vmtarget/vmindex in it, // which refers directly to JVM internals. -Handle MethodHandles::resolve_MemberName(Handle mname, TRAPS) { +Handle MethodHandles::resolve_MemberName(Handle mname, KlassHandle caller, TRAPS) { Handle empty; assert(java_lang_invoke_MemberName::is_instance(mname()), ""); @@ -646,20 +666,20 @@ Handle MethodHandles::resolve_MemberName(Handle mname, TRAPS) { assert(!HAS_PENDING_EXCEPTION, ""); if (ref_kind == JVM_REF_invokeStatic) { LinkResolver::resolve_static_call(result, - defc, name, type, KlassHandle(), false, false, THREAD); + defc, name, type, caller, caller.not_null(), false, THREAD); } else if (ref_kind == JVM_REF_invokeInterface) { LinkResolver::resolve_interface_call(result, Handle(), defc, - defc, name, type, KlassHandle(), false, false, THREAD); + defc, name, type, caller, caller.not_null(), false, THREAD); } else if (mh_invoke_id != vmIntrinsics::_none) { assert(!is_signature_polymorphic_static(mh_invoke_id), ""); LinkResolver::resolve_handle_call(result, - defc, name, type, KlassHandle(), THREAD); + defc, name, type, caller, THREAD); } else if (ref_kind == JVM_REF_invokeSpecial) { LinkResolver::resolve_special_call(result, - defc, name, type, KlassHandle(), false, THREAD); + defc, name, type, caller, caller.not_null(), THREAD); } else if (ref_kind == JVM_REF_invokeVirtual) { LinkResolver::resolve_virtual_call(result, Handle(), defc, - defc, name, type, KlassHandle(), false, false, THREAD); + defc, name, type, caller, caller.not_null(), false, THREAD); } else { assert(false, err_msg("ref_kind=%d", ref_kind)); } @@ -683,7 +703,7 @@ Handle MethodHandles::resolve_MemberName(Handle mname, TRAPS) { assert(!HAS_PENDING_EXCEPTION, ""); if (name == vmSymbols::object_initializer_name()) { LinkResolver::resolve_special_call(result, - defc, name, type, KlassHandle(), false, THREAD); + defc, name, type, caller, caller.not_null(), THREAD); } else { break; // will throw after end of switch } @@ -700,7 +720,7 @@ Handle MethodHandles::resolve_MemberName(Handle mname, TRAPS) { fieldDescriptor result; // find_field initializes fd if found { assert(!HAS_PENDING_EXCEPTION, ""); - LinkResolver::resolve_field(result, defc, name, type, KlassHandle(), Bytecodes::_nop, false, false, THREAD); + LinkResolver::resolve_field(result, defc, name, type, caller, Bytecodes::_nop, false, false, THREAD); if (HAS_PENDING_EXCEPTION) { return empty; } @@ -1121,7 +1141,11 @@ JVM_ENTRY(jobject, MHN_resolve_Mem(JNIEnv *env, jobject igcls, jobject mname_jh, } } - Handle resolved = MethodHandles::resolve_MemberName(mname, CHECK_NULL); + KlassHandle caller(THREAD, + caller_jh == NULL ? (Klass*) NULL : + java_lang_Class::as_Klass(JNIHandles::resolve_non_null(caller_jh))); + Handle resolved = MethodHandles::resolve_MemberName(mname, caller, CHECK_NULL); + if (resolved.is_null()) { int flags = java_lang_invoke_MemberName::flags(mname()); int ref_kind = (flags >> REFERENCE_KIND_SHIFT) & REFERENCE_KIND_MASK; diff --git a/hotspot/src/share/vm/prims/methodHandles.hpp b/hotspot/src/share/vm/prims/methodHandles.hpp index 7ae7bd36fb5..323cd823664 100644 --- a/hotspot/src/share/vm/prims/methodHandles.hpp +++ b/hotspot/src/share/vm/prims/methodHandles.hpp @@ -55,7 +55,7 @@ class MethodHandles: AllStatic { public: // working with member names - static Handle resolve_MemberName(Handle mname, TRAPS); // compute vmtarget/vmindex from name/type + static Handle resolve_MemberName(Handle mname, KlassHandle caller, TRAPS); // compute vmtarget/vmindex from name/type static void expand_MemberName(Handle mname, int suppress, TRAPS); // expand defc/name/type if missing static Handle new_MemberName(TRAPS); // must be followed by init_MemberName static oop init_MemberName(Handle mname_h, Handle target_h); // compute vmtarget/vmindex from target From 7546938fc2d278a964fe3a16ba8161e5564be4a2 Mon Sep 17 00:00:00 2001 From: Paul Sandoz Date: Fri, 10 Jan 2014 16:17:34 +0100 Subject: [PATCH 106/377] 8031428: CountTest causes lambda Ser/Derialization tests to fail Reviewed-by: chegar --- .../tests/java/util/stream/CountTest.java | 21 +++++++------------ 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/CountTest.java b/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/CountTest.java index 5bf2876f366..c5d337e8539 100644 --- a/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/CountTest.java +++ b/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/CountTest.java @@ -29,7 +29,6 @@ package org.openjdk.tests.java.util.stream; -import java.util.concurrent.atomic.AtomicLong; import java.util.stream.DoubleStream; import java.util.stream.DoubleStreamTestDataProvider; import java.util.stream.IntStream; @@ -47,45 +46,41 @@ public class CountTest extends OpTestCase { @Test(dataProvider = "StreamTestData", dataProviderClass = StreamTestDataProvider.class) public void testOps(String name, TestData.OfRef data) { - AtomicLong expectedCount = new AtomicLong(); - data.stream().forEach(e -> expectedCount.incrementAndGet()); + long expectedCount = data.size(); withData(data). terminal(Stream::count). - expectedResult(expectedCount.get()). + expectedResult(expectedCount). exercise(); } @Test(dataProvider = "IntStreamTestData", dataProviderClass = IntStreamTestDataProvider.class) public void testOps(String name, TestData.OfInt data) { - AtomicLong expectedCount = new AtomicLong(); - data.stream().forEach(e -> expectedCount.incrementAndGet()); + long expectedCount = data.size(); withData(data). terminal(IntStream::count). - expectedResult(expectedCount.get()). + expectedResult(expectedCount). exercise(); } @Test(dataProvider = "LongStreamTestData", dataProviderClass = LongStreamTestDataProvider.class) public void testOps(String name, TestData.OfLong data) { - AtomicLong expectedCount = new AtomicLong(); - data.stream().forEach(e -> expectedCount.incrementAndGet()); + long expectedCount = data.size(); withData(data). terminal(LongStream::count). - expectedResult(expectedCount.get()). + expectedResult(expectedCount). exercise(); } @Test(dataProvider = "DoubleStreamTestData", dataProviderClass = DoubleStreamTestDataProvider.class) public void testOps(String name, TestData.OfDouble data) { - AtomicLong expectedCount = new AtomicLong(); - data.stream().forEach(e -> expectedCount.incrementAndGet()); + long expectedCount = data.size(); withData(data). terminal(DoubleStream::count). - expectedResult(expectedCount.get()). + expectedResult(expectedCount). exercise(); } } From 603a48280ba570502b95769e2eb8550c91d405dd Mon Sep 17 00:00:00 2001 From: Roger Riggs Date: Fri, 10 Jan 2014 10:45:56 -0500 Subject: [PATCH 107/377] 8030875: Macros for checking and returning on exceptions Move exception checking macros to common jni_util.h Reviewed-by: chegar --- .../share/native/com/sun/java/util/jar/pack/coding.cpp | 4 +++- .../share/native/com/sun/java/util/jar/pack/defines.h | 4 ---- jdk/src/share/native/common/jni_util.h | 9 +++++++++ jdk/src/share/native/java/net/net_util.h | 3 --- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/jdk/src/share/native/com/sun/java/util/jar/pack/coding.cpp b/jdk/src/share/native/com/sun/java/util/jar/pack/coding.cpp index 6cedfd80de1..66ecc1bff63 100644 --- a/jdk/src/share/native/com/sun/java/util/jar/pack/coding.cpp +++ b/jdk/src/share/native/com/sun/java/util/jar/pack/coding.cpp @@ -32,6 +32,8 @@ #include #include +#include "jni_util.h" + #include "defines.h" #include "bytes.h" #include "utils.h" @@ -147,7 +149,7 @@ coding* coding::findBySpec(int spec) { break; } coding* ptr = NEW(coding, 1); - CHECK_NULL_0(ptr); + CHECK_NULL_RETURN(ptr, 0); coding* c = ptr->initFrom(spec); if (c == null) { mtrace('f', ptr, 0); diff --git a/jdk/src/share/native/com/sun/java/util/jar/pack/defines.h b/jdk/src/share/native/com/sun/java/util/jar/pack/defines.h index b202892fa7e..644b9ca9af6 100644 --- a/jdk/src/share/native/com/sun/java/util/jar/pack/defines.h +++ b/jdk/src/share/native/com/sun/java/util/jar/pack/defines.h @@ -158,10 +158,6 @@ enum { false, true }; #define CHECK_(y) _CHECK_DO(aborting(), return y) #define CHECK_0 _CHECK_DO(aborting(), return 0) -#define CHECK_NULL(p) _CHECK_DO((p)==null, return) -#define CHECK_NULL_(y,p) _CHECK_DO((p)==null, return y) -#define CHECK_NULL_0(p) _CHECK_DO((p)==null, return 0) - #define CHECK_COUNT(t) if (t < 0){abort("bad value count");} CHECK #define STR_TRUE "true" diff --git a/jdk/src/share/native/common/jni_util.h b/jdk/src/share/native/common/jni_util.h index 4180756fccb..0dab24c3392 100644 --- a/jdk/src/share/native/common/jni_util.h +++ b/jdk/src/share/native/common/jni_util.h @@ -278,6 +278,15 @@ JNU_NotifyAll(JNIEnv *env, jobject object); #define IS_NULL(obj) ((obj) == NULL) #define JNU_IsNull(env,obj) ((obj) == NULL) +/************************************************************************ + * Miscellaneous utilities used by the class libraries to check for exceptions + */ + +#define CHECK_NULL(x) if ((x) == NULL) return; +#define CHECK_NULL_RETURN(x, y) if ((x) == NULL) return (y); + +#define CHECK_EXCEPTION(env) if ((*env)->ExceptionCheck(env)) return; +#define CHECK_EXCEPTION_RETURN(env, y) if ((*env)->ExceptionCheck(env)) return (y); /************************************************************************ * Debugging utilities diff --git a/jdk/src/share/native/java/net/net_util.h b/jdk/src/share/native/java/net/net_util.h index d38a5f52fcf..97351488877 100644 --- a/jdk/src/share/native/java/net/net_util.h +++ b/jdk/src/share/native/java/net/net_util.h @@ -42,9 +42,6 @@ #define NET_ERROR(env, ex, msg) \ { if (!(*env)->ExceptionOccurred(env)) JNU_ThrowByName(env, ex, msg) } -#define CHECK_NULL(x) if ((x) == NULL) return; -#define CHECK_NULL_RETURN(x, y) if ((x) == NULL) return y; - /************************************************************************ * Cached field IDs * From 3bca43355bbe20d346e528bcbf64f71a896ebb86 Mon Sep 17 00:00:00 2001 From: Martin Buchholz Date: Thu, 5 Dec 2013 15:49:53 -0500 Subject: [PATCH 108/377] 8029629: java/lang/ProcessBuilder/Basic.java fails intermittently Improved test for Thread.interrupt Reviewed-by: martin, rriggs --- jdk/test/java/lang/ProcessBuilder/Basic.java | 69 +++++++++++++++----- 1 file changed, 52 insertions(+), 17 deletions(-) diff --git a/jdk/test/java/lang/ProcessBuilder/Basic.java b/jdk/test/java/lang/ProcessBuilder/Basic.java index ff4c3744321..aa1524a3885 100644 --- a/jdk/test/java/lang/ProcessBuilder/Basic.java +++ b/jdk/test/java/lang/ProcessBuilder/Basic.java @@ -58,6 +58,15 @@ public class Basic { /* used for Mac OS X only */ static final String cfUserTextEncoding = System.getenv("__CF_USER_TEXT_ENCODING"); + /** + * Returns the number of milliseconds since time given by + * startNanoTime, which must have been previously returned from a + * call to {@link System.nanoTime()}. + */ + private static long millisElapsedSince(long startNanoTime) { + return TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - startNanoTime); + } + private static String commandOutput(Reader r) throws Throwable { StringBuilder sb = new StringBuilder(); int c; @@ -2232,40 +2241,66 @@ public class Basic { //---------------------------------------------------------------- // Check that Process.waitFor(timeout, TimeUnit.MILLISECONDS) - // interrupt works as expected. + // interrupt works as expected, if interrupted while waiting. //---------------------------------------------------------------- try { List childArgs = new ArrayList(javaChildArgs); childArgs.add("sleep"); final Process p = new ProcessBuilder(childArgs).start(); final long start = System.nanoTime(); - final CountDownLatch ready = new CountDownLatch(1); - final CountDownLatch done = new CountDownLatch(1); + final CountDownLatch aboutToWaitFor = new CountDownLatch(1); final Thread thread = new Thread() { public void run() { try { - final boolean result; - try { - ready.countDown(); - result = p.waitFor(30000, TimeUnit.MILLISECONDS); - } catch (InterruptedException e) { - return; - } + aboutToWaitFor.countDown(); + boolean result = p.waitFor(30L * 1000L, TimeUnit.MILLISECONDS); fail("waitFor() wasn't interrupted, its return value was: " + result); - } catch (Throwable t) { - unexpected(t); - } finally { - done.countDown(); - } + } catch (InterruptedException success) { + } catch (Throwable t) { unexpected(t); } } }; thread.start(); - ready.await(); + aboutToWaitFor.await(); Thread.sleep(1000); thread.interrupt(); - done.await(); + thread.join(10L * 1000L); + check(millisElapsedSince(start) < 10L * 1000L); + check(!thread.isAlive()); + p.destroy(); + } catch (Throwable t) { unexpected(t); } + + //---------------------------------------------------------------- + // Check that Process.waitFor(timeout, TimeUnit.MILLISECONDS) + // interrupt works as expected, if interrupted before waiting. + //---------------------------------------------------------------- + try { + List childArgs = new ArrayList(javaChildArgs); + childArgs.add("sleep"); + final Process p = new ProcessBuilder(childArgs).start(); + final long start = System.nanoTime(); + final CountDownLatch threadStarted = new CountDownLatch(1); + + final Thread thread = new Thread() { + public void run() { + try { + threadStarted.countDown(); + do { Thread.yield(); } + while (!Thread.currentThread().isInterrupted()); + boolean result = p.waitFor(30L * 1000L, TimeUnit.MILLISECONDS); + fail("waitFor() wasn't interrupted, its return value was: " + result); + } catch (InterruptedException success) { + } catch (Throwable t) { unexpected(t); } + } + }; + + thread.start(); + threadStarted.await(); + thread.interrupt(); + thread.join(10L * 1000L); + check(millisElapsedSince(start) < 10L * 1000L); + check(!thread.isAlive()); p.destroy(); } catch (Throwable t) { unexpected(t); } From f3dbbd9d4ff4d3291ddd8fbeb1f37a9feab5bf86 Mon Sep 17 00:00:00 2001 From: Volker Simonis Date: Fri, 6 Dec 2013 14:22:34 +0100 Subject: [PATCH 109/377] 8029669: PPC64: 8027566 changes broke AIX build after sync Reviewed-by: alanb, ihse --- .../{non-build-utils/sharing => data/classlist}/classlist.aix | 0 jdk/make/lib/NioLibraries.gmk | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename jdk/make/{non-build-utils/sharing => data/classlist}/classlist.aix (100%) diff --git a/jdk/make/non-build-utils/sharing/classlist.aix b/jdk/make/data/classlist/classlist.aix similarity index 100% rename from jdk/make/non-build-utils/sharing/classlist.aix rename to jdk/make/data/classlist/classlist.aix diff --git a/jdk/make/lib/NioLibraries.gmk b/jdk/make/lib/NioLibraries.gmk index 9cf07fe2334..5c648c2dbe6 100644 --- a/jdk/make/lib/NioLibraries.gmk +++ b/jdk/make/lib/NioLibraries.gmk @@ -113,7 +113,7 @@ ifeq ($(OPENJDK_TARGET_OS), solaris) endif ifeq ($(OPENJDK_TARGET_OS), aix) - BUILD_LIBNIO_MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libnio/mapfile-$(OPENJDK_TARGET_OS) + BUILD_LIBNIO_MAPFILE:=$(JDK_TOPDIR)/make/mapfiles/libnio/mapfile-$(OPENJDK_TARGET_OS) BUILD_LIBNIO_SRC += \ $(JDK_TOPDIR)/src/aix/native/sun/nio/ch \ $(JDK_TOPDIR)/src/aix/native/sun/nio/fs From 4d993839516f6d84a68f9bfae3b9e7533a68d0c6 Mon Sep 17 00:00:00 2001 From: Vicente Romero Date: Mon, 16 Dec 2013 14:32:12 +0000 Subject: [PATCH 110/377] 8020216: javac, compile time error isn't shown when final static field is not assigned Reviewed-by: jjg --- .../com/sun/tools/javac/comp/Flow.java | 28 ++++++++++++++---- ...imeErrorForNonAssignedStaticFieldTest.java | 29 +++++++++++++++++++ ...TimeErrorForNonAssignedStaticFieldTest.out | 2 ++ 3 files changed, 54 insertions(+), 5 deletions(-) create mode 100644 langtools/test/tools/javac/flow/T8020216/CompileTimeErrorForNonAssignedStaticFieldTest.java create mode 100644 langtools/test/tools/javac/flow/T8020216/CompileTimeErrorForNonAssignedStaticFieldTest.out diff --git a/langtools/src/share/classes/com/sun/tools/javac/comp/Flow.java b/langtools/src/share/classes/com/sun/tools/javac/comp/Flow.java index 0c1b2d29970..10f957c51d4 100644 --- a/langtools/src/share/classes/com/sun/tools/javac/comp/Flow.java +++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Flow.java @@ -1461,9 +1461,19 @@ public class Flow { this.names = names; } + boolean isInitialConstructor = false; + @Override protected void markDead(JCTree tree) { - inits.inclRange(returnadr, nextadr); + if (!isInitialConstructor) { + inits.inclRange(returnadr, nextadr); + } else { + for (int address = returnadr; address < nextadr; address++) { + if (!(isFinalUninitializedStaticField(vardecls[address].sym))) { + inits.incl(address); + } + } + } uninits.inclRange(returnadr, nextadr); } @@ -1476,8 +1486,16 @@ public class Flow { return sym.pos >= startPos && ((sym.owner.kind == MTH || - ((sym.flags() & (FINAL | HASINIT | PARAMETER)) == FINAL && - classDef.sym.isEnclosedBy((ClassSymbol)sym.owner)))); + isFinalUninitializedField(sym))); + } + + boolean isFinalUninitializedField(VarSymbol sym) { + return ((sym.flags() & (FINAL | HASINIT | PARAMETER)) == FINAL && + classDef.sym.isEnclosedBy((ClassSymbol)sym.owner)); + } + + boolean isFinalUninitializedStaticField(VarSymbol sym) { + return isFinalUninitializedField(sym) && sym.isStatic(); } /** Initialize new trackable variable by setting its address field @@ -1733,8 +1751,7 @@ public class Flow { Assert.check(pendingExits.isEmpty()); try { - boolean isInitialConstructor = - TreeInfo.isInitialConstructor(tree); + isInitialConstructor = TreeInfo.isInitialConstructor(tree); if (!isInitialConstructor) { firstadr = nextadr; @@ -1789,6 +1806,7 @@ public class Flow { nextadr = nextadrPrev; firstadr = firstadrPrev; returnadr = returnadrPrev; + isInitialConstructor = false; } } diff --git a/langtools/test/tools/javac/flow/T8020216/CompileTimeErrorForNonAssignedStaticFieldTest.java b/langtools/test/tools/javac/flow/T8020216/CompileTimeErrorForNonAssignedStaticFieldTest.java new file mode 100644 index 00000000000..f357ba5c461 --- /dev/null +++ b/langtools/test/tools/javac/flow/T8020216/CompileTimeErrorForNonAssignedStaticFieldTest.java @@ -0,0 +1,29 @@ +/* + * @test /nodynamiccopyright/ + * @bug 8020216 + * @summary javac, compile time error isn't shown when final static field is not assigned + * @compile/fail/ref=CompileTimeErrorForNonAssignedStaticFieldTest.out -XDrawDiagnostics CompileTimeErrorForNonAssignedStaticFieldTest.java + */ + +public class CompileTimeErrorForNonAssignedStaticFieldTest { + private final static int i; + + public CompileTimeErrorForNonAssignedStaticFieldTest() + throws InstantiationException { + throw new InstantiationException( " Can't instantiate " ); + } + + static class Inner { + private final int j; + public Inner(int x) + throws InstantiationException { + if (x == 0) { + throw new InstantiationException( " Can't instantiate " ); + } else { + j = 1; + } + System.out.println(j); + } + } + +} diff --git a/langtools/test/tools/javac/flow/T8020216/CompileTimeErrorForNonAssignedStaticFieldTest.out b/langtools/test/tools/javac/flow/T8020216/CompileTimeErrorForNonAssignedStaticFieldTest.out new file mode 100644 index 00000000000..7821299792f --- /dev/null +++ b/langtools/test/tools/javac/flow/T8020216/CompileTimeErrorForNonAssignedStaticFieldTest.out @@ -0,0 +1,2 @@ +CompileTimeErrorForNonAssignedStaticFieldTest.java:14:5: compiler.err.var.might.not.have.been.initialized: i +1 error From 213b16163bf7b16ccb358989417217d4b9031019 Mon Sep 17 00:00:00 2001 From: Andrey Nazarov Date: Mon, 16 Dec 2013 15:07:13 +0000 Subject: [PATCH 111/377] 8028708: TEST_BUG, Tests should pass through VM options, langtools tests Reviewed-by: jjg, vromero --- .../api/ToolProvider/HelloWorldTest.java | 44 +++++++++--------- .../api/ToolProvider/ToolProviderTest1.java | 42 ++++++++--------- .../api/ToolProvider/ToolProviderTest2.java | 46 +++++++++---------- langtools/test/tools/javac/lib/ToolBox.java | 22 +++------ 4 files changed, 72 insertions(+), 82 deletions(-) diff --git a/langtools/test/tools/javac/api/ToolProvider/HelloWorldTest.java b/langtools/test/tools/javac/api/ToolProvider/HelloWorldTest.java index 18002545686..022a9d84e63 100644 --- a/langtools/test/tools/javac/api/ToolProvider/HelloWorldTest.java +++ b/langtools/test/tools/javac/api/ToolProvider/HelloWorldTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,10 +25,14 @@ * @test * @bug 6604599 * @summary ToolProvider should be less compiler-specific + * @library /tools/javac/lib + * @build ToolBox + * @run main HelloWorldTest */ -import java.io.*; -import java.util.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; // verify that running a simple program, such as this one, does not trigger // the loading of ToolProvider or any com.sun.tools.javac class @@ -43,32 +47,28 @@ public class HelloWorldTest { } void run() throws Exception { - File javaHome = new File(System.getProperty("java.home")); - if (javaHome.getName().equals("jre")) - javaHome = javaHome.getParentFile(); - File javaExe = new File(new File(javaHome, "bin"), "java"); String classpath = System.getProperty("java.class.path"); - String[] cmd = { - javaExe.getPath(), - "-verbose:class", - "-classpath", classpath, - HelloWorldTest.class.getName(), - "Hello", "World" - }; + List output = new ArrayList<>(); + ToolBox.AnyToolArgs javaParams = + new ToolBox.AnyToolArgs() + .appendArgs(ToolBox.javaBinary) + .appendArgs(ToolBox.testVMOpts) + .appendArgs(ToolBox.testJavaOpts) + .appendArgs("-verbose:class", + "-classpath", classpath, + HelloWorldTest.class.getName(), + "Hello", "World") + .setErrOutput(output) + .setStdOutput(output); - ProcessBuilder pb = new ProcessBuilder(cmd).redirectErrorStream(true); - Process p = pb.start(); - BufferedReader r = new BufferedReader(new InputStreamReader(p.getInputStream())); - String line; - while ((line = r.readLine()) != null) { + ToolBox.executeCommand(javaParams); + + for (String line : output) { System.err.println(line); if (line.contains("javax.tools.ToolProvider") || line.contains("com.sun.tools.javac.")) error(">>> " + line); } - int rc = p.waitFor(); - if (rc != 0) - error("Unexpected exit code: " + rc); if (errors > 0) throw new Exception(errors + " errors occurred"); diff --git a/langtools/test/tools/javac/api/ToolProvider/ToolProviderTest1.java b/langtools/test/tools/javac/api/ToolProvider/ToolProviderTest1.java index aab5474d06f..8699fed25bd 100644 --- a/langtools/test/tools/javac/api/ToolProvider/ToolProviderTest1.java +++ b/langtools/test/tools/javac/api/ToolProvider/ToolProviderTest1.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,9 +25,13 @@ * @test * @bug 6604599 * @summary ToolProvider should be less compiler-specific + * @library /tools/javac/lib + * @build ToolBox + * @run main ToolProviderTest1 */ -import java.io.*; +import java.util.ArrayList; +import java.util.List; // verify that running accessing ToolProvider by itself does not // trigger loading com.sun.tools.javac.* @@ -42,32 +46,28 @@ public class ToolProviderTest1 { } void run() throws Exception { - File javaHome = new File(System.getProperty("java.home")); - if (javaHome.getName().equals("jre")) - javaHome = javaHome.getParentFile(); - File javaExe = new File(new File(javaHome, "bin"), "java"); String classpath = System.getProperty("java.class.path"); - String[] cmd = { - javaExe.getPath(), - "-verbose:class", - "-classpath", classpath, - ToolProviderTest1.class.getName(), - "javax.tools.ToolProvider" - }; + List output = new ArrayList<>(); + ToolBox.AnyToolArgs javaParams = + new ToolBox.AnyToolArgs() + .appendArgs(ToolBox.javaBinary) + .appendArgs(ToolBox.testVMOpts) + .appendArgs(ToolBox.testJavaOpts) + .appendArgs("-verbose:class", + "-classpath", classpath, + ToolProviderTest1.class.getName(), + "javax.tools.ToolProvider") + .setErrOutput(output) + .setStdOutput(output); - ProcessBuilder pb = new ProcessBuilder(cmd).redirectErrorStream(true); - Process p = pb.start(); - BufferedReader r = new BufferedReader(new InputStreamReader(p.getInputStream())); - String line; - while ((line = r.readLine()) != null) { + ToolBox.executeCommand(javaParams); + + for (String line : output) { System.err.println(line); if (line.contains("com.sun.tools.javac.")) error(">>> " + line); } - int rc = p.waitFor(); - if (rc != 0) - error("Unexpected exit code: " + rc); if (errors > 0) throw new Exception(errors + " errors occurred"); diff --git a/langtools/test/tools/javac/api/ToolProvider/ToolProviderTest2.java b/langtools/test/tools/javac/api/ToolProvider/ToolProviderTest2.java index 0a1646fe47c..cd46766e62e 100644 --- a/langtools/test/tools/javac/api/ToolProvider/ToolProviderTest2.java +++ b/langtools/test/tools/javac/api/ToolProvider/ToolProviderTest2.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,10 +25,14 @@ * @test * @bug 6604599 * @summary ToolProvider should be less compiler-specific + * @library /tools/javac/lib + * @build ToolBox + * @run main ToolProviderTest2 */ -import java.io.*; -import javax.tools.*; +import javax.tools.ToolProvider; +import java.util.ArrayList; +import java.util.List; // control for ToolProviderTest1 -- verify that using ToolProvider to // access the compiler does trigger loading com.sun.tools.javac.* @@ -43,36 +47,32 @@ public class ToolProviderTest2 { } void run() throws Exception { - File javaHome = new File(System.getProperty("java.home")); - if (javaHome.getName().equals("jre")) - javaHome = javaHome.getParentFile(); - File javaExe = new File(new File(javaHome, "bin"), "java"); String classpath = System.getProperty("java.class.path"); - String[] cmd = { - javaExe.getPath(), - "-verbose:class", - "-classpath", classpath, - ToolProviderTest2.class.getName(), - "javax.tools.ToolProvider" - }; + List output = new ArrayList<>(); + ToolBox.AnyToolArgs javaParams = + new ToolBox.AnyToolArgs() + .appendArgs(ToolBox.javaBinary) + .appendArgs(ToolBox.testVMOpts) + .appendArgs(ToolBox.testJavaOpts) + .appendArgs( "-verbose:class", + "-classpath", classpath, + ToolProviderTest2.class.getName(), + "javax.tools.ToolProvider") + .setErrOutput(output) + .setStdOutput(output); + + ToolBox.executeCommand(javaParams); - ProcessBuilder pb = new ProcessBuilder(cmd).redirectErrorStream(true); - Process p = pb.start(); - BufferedReader r = new BufferedReader(new InputStreamReader(p.getInputStream())); - String line; boolean found = false; - while ((line = r.readLine()) != null) { + for (String line : output) { System.err.println(line); if (line.contains("com.sun.tools.javac.")) found = true; } - int rc = p.waitFor(); - if (rc != 0) - error("Unexpected exit code: " + rc); if (!found) - System.err.println("expected class name not found"); + error("expected class name not found"); if (errors > 0) throw new Exception(errors + " errors occurred"); diff --git a/langtools/test/tools/javac/lib/ToolBox.java b/langtools/test/tools/javac/lib/ToolBox.java index 49a65b480d1..73db0a42d2f 100644 --- a/langtools/test/tools/javac/lib/ToolBox.java +++ b/langtools/test/tools/javac/lib/ToolBox.java @@ -69,27 +69,17 @@ public class ToolBox { public static final Path javaBinary = Paths.get(jdkUnderTest, "bin", "java"); public static final Path javacBinary = Paths.get(jdkUnderTest, "bin", "javac"); - public static final List testToolVMOpts; - public static final List testVMOpts; + public static final List testVMOpts = readOptions("test.vm.opts"); + public static final List testToolVMOpts = readOptions("test.tool.vm.opts"); + public static final List testJavaOpts = readOptions("test.java.opts"); private static final Charset defaultCharset = Charset.defaultCharset(); static final JavaCompiler comp = ToolProvider.getSystemJavaCompiler(); - static { - String sysProp = System.getProperty("test.tool.vm.opts"); - if (sysProp != null && sysProp.length() > 0) { - testToolVMOpts = Arrays.asList(sysProp.split("\\s+")); - } else { - testToolVMOpts = Collections.emptyList(); - } - - sysProp = System.getProperty("test.vm.opts"); - if (sysProp != null && sysProp.length() > 0) { - testVMOpts = Arrays.asList(sysProp.split("\\s+")); - } else { - testVMOpts = Collections.emptyList(); - } + private static List readOptions(String property) { + String options = System.getProperty(property, ""); + return options.length() > 0 ? Arrays.asList(options.split("\\s+")) : Collections.emptyList(); } /** From ffb2f48033371aba9d502c315c0c3e93f1a7934d Mon Sep 17 00:00:00 2001 From: Vicente Romero Date: Mon, 16 Dec 2013 17:33:18 +0000 Subject: [PATCH 112/377] 8030214: fix for JDK-8020216 breaks the build Reviewed-by: jjg --- .../com/sun/tools/javac/comp/Flow.java | 28 ++++-------------- ...imeErrorForNonAssignedStaticFieldTest.java | 29 ------------------- ...TimeErrorForNonAssignedStaticFieldTest.out | 2 -- 3 files changed, 5 insertions(+), 54 deletions(-) delete mode 100644 langtools/test/tools/javac/flow/T8020216/CompileTimeErrorForNonAssignedStaticFieldTest.java delete mode 100644 langtools/test/tools/javac/flow/T8020216/CompileTimeErrorForNonAssignedStaticFieldTest.out diff --git a/langtools/src/share/classes/com/sun/tools/javac/comp/Flow.java b/langtools/src/share/classes/com/sun/tools/javac/comp/Flow.java index 10f957c51d4..0c1b2d29970 100644 --- a/langtools/src/share/classes/com/sun/tools/javac/comp/Flow.java +++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Flow.java @@ -1461,19 +1461,9 @@ public class Flow { this.names = names; } - boolean isInitialConstructor = false; - @Override protected void markDead(JCTree tree) { - if (!isInitialConstructor) { - inits.inclRange(returnadr, nextadr); - } else { - for (int address = returnadr; address < nextadr; address++) { - if (!(isFinalUninitializedStaticField(vardecls[address].sym))) { - inits.incl(address); - } - } - } + inits.inclRange(returnadr, nextadr); uninits.inclRange(returnadr, nextadr); } @@ -1486,16 +1476,8 @@ public class Flow { return sym.pos >= startPos && ((sym.owner.kind == MTH || - isFinalUninitializedField(sym))); - } - - boolean isFinalUninitializedField(VarSymbol sym) { - return ((sym.flags() & (FINAL | HASINIT | PARAMETER)) == FINAL && - classDef.sym.isEnclosedBy((ClassSymbol)sym.owner)); - } - - boolean isFinalUninitializedStaticField(VarSymbol sym) { - return isFinalUninitializedField(sym) && sym.isStatic(); + ((sym.flags() & (FINAL | HASINIT | PARAMETER)) == FINAL && + classDef.sym.isEnclosedBy((ClassSymbol)sym.owner)))); } /** Initialize new trackable variable by setting its address field @@ -1751,7 +1733,8 @@ public class Flow { Assert.check(pendingExits.isEmpty()); try { - isInitialConstructor = TreeInfo.isInitialConstructor(tree); + boolean isInitialConstructor = + TreeInfo.isInitialConstructor(tree); if (!isInitialConstructor) { firstadr = nextadr; @@ -1806,7 +1789,6 @@ public class Flow { nextadr = nextadrPrev; firstadr = firstadrPrev; returnadr = returnadrPrev; - isInitialConstructor = false; } } diff --git a/langtools/test/tools/javac/flow/T8020216/CompileTimeErrorForNonAssignedStaticFieldTest.java b/langtools/test/tools/javac/flow/T8020216/CompileTimeErrorForNonAssignedStaticFieldTest.java deleted file mode 100644 index f357ba5c461..00000000000 --- a/langtools/test/tools/javac/flow/T8020216/CompileTimeErrorForNonAssignedStaticFieldTest.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * @test /nodynamiccopyright/ - * @bug 8020216 - * @summary javac, compile time error isn't shown when final static field is not assigned - * @compile/fail/ref=CompileTimeErrorForNonAssignedStaticFieldTest.out -XDrawDiagnostics CompileTimeErrorForNonAssignedStaticFieldTest.java - */ - -public class CompileTimeErrorForNonAssignedStaticFieldTest { - private final static int i; - - public CompileTimeErrorForNonAssignedStaticFieldTest() - throws InstantiationException { - throw new InstantiationException( " Can't instantiate " ); - } - - static class Inner { - private final int j; - public Inner(int x) - throws InstantiationException { - if (x == 0) { - throw new InstantiationException( " Can't instantiate " ); - } else { - j = 1; - } - System.out.println(j); - } - } - -} diff --git a/langtools/test/tools/javac/flow/T8020216/CompileTimeErrorForNonAssignedStaticFieldTest.out b/langtools/test/tools/javac/flow/T8020216/CompileTimeErrorForNonAssignedStaticFieldTest.out deleted file mode 100644 index 7821299792f..00000000000 --- a/langtools/test/tools/javac/flow/T8020216/CompileTimeErrorForNonAssignedStaticFieldTest.out +++ /dev/null @@ -1,2 +0,0 @@ -CompileTimeErrorForNonAssignedStaticFieldTest.java:14:5: compiler.err.var.might.not.have.been.initialized: i -1 error From b2651d0972ec037cbaf8cb0bba10dc097d037eb5 Mon Sep 17 00:00:00 2001 From: Joe Darcy Date: Mon, 16 Dec 2013 10:15:38 -0800 Subject: [PATCH 113/377] 8028545: Add -source 9 and -target 9 to javac 8000961: Change javac source and target default to 9 Reviewed-by: jjg --- .../com/sun/tools/javac/code/Source.java | 15 +++++++--- .../com/sun/tools/javac/jvm/Profile.java | 6 ++-- .../com/sun/tools/javac/jvm/Target.java | 12 +++++--- .../test/tools/javac/6330997/T6330997.java | 19 ++++++------- .../warnings/TestSourceVersionWarnings.java | 4 +-- .../javac/profiles/ProfileOptionTest.java | 5 ++-- langtools/test/tools/javac/versions/check.sh | 28 +++++++++++++------ 7 files changed, 55 insertions(+), 34 deletions(-) diff --git a/langtools/src/share/classes/com/sun/tools/javac/code/Source.java b/langtools/src/share/classes/com/sun/tools/javac/code/Source.java index fffa266b530..e9f51706e6b 100644 --- a/langtools/src/share/classes/com/sun/tools/javac/code/Source.java +++ b/langtools/src/share/classes/com/sun/tools/javac/code/Source.java @@ -67,8 +67,11 @@ public enum Source { /** 1.7 introduced try-with-resources, multi-catch, string switch, etc. */ JDK1_7("1.7"), - /** 1.8 covers the to be determined language features that will be added in JDK 8. */ - JDK1_8("1.8"); + /** 1.8 lambda expressions and default methods. */ + JDK1_8("1.8"), + + /** 1.9 covers the to be determined language features that will be added in JDK 9. */ + JDK1_9("1.9"); private static final Context.Key sourceKey = new Context.Key(); @@ -87,7 +90,7 @@ public enum Source { public final String name; - private static final Map tab = new HashMap(); + private static final Map tab = new HashMap<>(); static { for (Source s : values()) { tab.put(s.name, s); @@ -96,19 +99,21 @@ public enum Source { tab.put("6", JDK1_6); // Make 6 an alias for 1.6 tab.put("7", JDK1_7); // Make 7 an alias for 1.7 tab.put("8", JDK1_8); // Make 8 an alias for 1.8 + tab.put("9", JDK1_9); // Make 9 an alias for 1.9 } private Source(String name) { this.name = name; } - public static final Source DEFAULT = JDK1_8; + public static final Source DEFAULT = JDK1_9; public static Source lookup(String name) { return tab.get(name); } public Target requiredTarget() { + if (this.compareTo(JDK1_9) >= 0) return Target.JDK1_9; if (this.compareTo(JDK1_8) >= 0) return Target.JDK1_8; if (this.compareTo(JDK1_7) >= 0) return Target.JDK1_7; if (this.compareTo(JDK1_6) >= 0) return Target.JDK1_6; @@ -243,6 +248,8 @@ public enum Source { return RELEASE_7; case JDK1_8: return RELEASE_8; + case JDK1_9: + return RELEASE_8; // Adjust once RELEASE_9 exists default: return null; } diff --git a/langtools/src/share/classes/com/sun/tools/javac/jvm/Profile.java b/langtools/src/share/classes/com/sun/tools/javac/jvm/Profile.java index 59ba84ed331..f4f3b8978eb 100644 --- a/langtools/src/share/classes/com/sun/tools/javac/jvm/Profile.java +++ b/langtools/src/share/classes/com/sun/tools/javac/jvm/Profile.java @@ -39,9 +39,9 @@ import static com.sun.tools.javac.main.Option.PROFILE; * deletion without notice. */ public enum Profile { - COMPACT1("compact1", 1, Target.JDK1_8), - COMPACT2("compact2", 2, Target.JDK1_8), - COMPACT3("compact3", 3, Target.JDK1_8), + COMPACT1("compact1", 1, Target.JDK1_8, Target.JDK1_9), + COMPACT2("compact2", 2, Target.JDK1_8, Target.JDK1_9), + COMPACT3("compact3", 3, Target.JDK1_8, Target.JDK1_9), DEFAULT { @Override diff --git a/langtools/src/share/classes/com/sun/tools/javac/jvm/Target.java b/langtools/src/share/classes/com/sun/tools/javac/jvm/Target.java index 54eee749b58..6770a56ca47 100644 --- a/langtools/src/share/classes/com/sun/tools/javac/jvm/Target.java +++ b/langtools/src/share/classes/com/sun/tools/javac/jvm/Target.java @@ -48,7 +48,7 @@ public enum Target { /** J2SE1.4 = Merlin. */ JDK1_4("1.4", 48, 0), - /** Tiger. */ + /** JDK 5, codename Tiger. */ JDK1_5("1.5", 49, 0), /** JDK 6. */ @@ -58,7 +58,10 @@ public enum Target { JDK1_7("1.7", 51, 0), /** JDK 8. */ - JDK1_8("1.8", 52, 0); + JDK1_8("1.8", 52, 0), + + /** JDK 9, initially an alias for 8. */ + JDK1_9("1.9", 52, 0); private static final Context.Key targetKey = new Context.Key(); @@ -81,7 +84,7 @@ public enum Target { private static final Target MAX = values()[values().length - 1]; public static Target MAX() { return MAX; } - private static final Map tab = new HashMap(); + private static final Map tab = new HashMap<>(); static { for (Target t : values()) { tab.put(t.name, t); @@ -90,6 +93,7 @@ public enum Target { tab.put("6", JDK1_6); tab.put("7", JDK1_7); tab.put("8", JDK1_8); + tab.put("9", JDK1_9); } public final String name; @@ -101,7 +105,7 @@ public enum Target { this.minorVersion = minorVersion; } - public static final Target DEFAULT = JDK1_8; + public static final Target DEFAULT = JDK1_9; public static Target lookup(String name) { return tab.get(name); diff --git a/langtools/test/tools/javac/6330997/T6330997.java b/langtools/test/tools/javac/6330997/T6330997.java index f32152505ad..98c76e22828 100644 --- a/langtools/test/tools/javac/6330997/T6330997.java +++ b/langtools/test/tools/javac/6330997/T6330997.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,12 +23,12 @@ /** * @test - * @bug 6330997 7025789 + * @bug 6330997 7025789 8000961 * @summary javac should accept class files with major version of the next release * @author Wei Tao * @clean T1 T2 - * @compile -target 8 T1.java - * @compile -target 8 T2.java + * @compile -source 8 -target 8 T1.java + * @compile -source 8 -target 8 T2.java * @run main/othervm T6330997 */ @@ -67,19 +67,16 @@ public class T6330997 { // Increase class file cfile's major version by delta static void increaseMajor(String cfile, int delta) { - try { - RandomAccessFile cls = new RandomAccessFile( - new File(System.getProperty("test.classes", "."), cfile), "rw"); - FileChannel fc = cls.getChannel(); + try (RandomAccessFile cls = + new RandomAccessFile(new File(System.getProperty("test.classes", "."), cfile), "rw"); + FileChannel fc = cls.getChannel()) { ByteBuffer rbuf = ByteBuffer.allocate(2); fc.read(rbuf, 6); ByteBuffer wbuf = ByteBuffer.allocate(2); wbuf.putShort(0, (short)(rbuf.getShort(0) + delta)); fc.write(wbuf, 6); fc.force(false); - cls.close(); - } catch (Exception e){ - e.printStackTrace(); + } catch (Exception e){ throw new RuntimeException("Failed: unexpected exception"); } } diff --git a/langtools/test/tools/javac/processing/warnings/TestSourceVersionWarnings.java b/langtools/test/tools/javac/processing/warnings/TestSourceVersionWarnings.java index 2646f23cf02..1efb7759f4d 100644 --- a/langtools/test/tools/javac/processing/warnings/TestSourceVersionWarnings.java +++ b/langtools/test/tools/javac/processing/warnings/TestSourceVersionWarnings.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -36,7 +36,7 @@ * @compile/ref=gold_sv_none.out -XDrawDiagnostics -processor TestSourceVersionWarnings -proc:only -ASourceVersion=RELEASE_6 -source 1.6 -Xlint:-options HelloWorld.java * @compile/ref=gold_unsp_warn.out -XDrawDiagnostics -processor TestSourceVersionWarnings -proc:only -ASourceVersion=RELEASE_6 -source 1.6 -Xlint:-options -Aunsupported HelloWorld.java * @compile/ref=gold_sv_none.out -XDrawDiagnostics -processor TestSourceVersionWarnings -proc:only -ASourceVersion=RELEASE_7 -source 1.7 -Xlint:-options HelloWorld.java - * @compile/ref=gold_sv_none.out -XDrawDiagnostics -processor TestSourceVersionWarnings -proc:only -ASourceVersion=RELEASE_8 -source 1.8 HelloWorld.java + * @compile/ref=gold_sv_none.out -XDrawDiagnostics -processor TestSourceVersionWarnings -proc:only -ASourceVersion=RELEASE_8 -source 1.8 -Xlint:-options HelloWorld.java */ import java.util.Set; diff --git a/langtools/test/tools/javac/profiles/ProfileOptionTest.java b/langtools/test/tools/javac/profiles/ProfileOptionTest.java index eaae7d99f8a..fb0e1f60441 100644 --- a/langtools/test/tools/javac/profiles/ProfileOptionTest.java +++ b/langtools/test/tools/javac/profiles/ProfileOptionTest.java @@ -23,7 +23,7 @@ /* * @test - * @bug 8004182 + * @bug 8004182 8028545 * @summary Add support for profiles in javac */ @@ -110,7 +110,7 @@ public class ProfileOptionTest { } for (Profile p: Profile.values()) { - List opts = new ArrayList(); + List opts = new ArrayList<>(); opts.addAll(Arrays.asList("-source", t.name, "-target", t.name)); opts.add("-Xlint:-options"); // dont warn about no -bootclasspath if (p != Profile.DEFAULT) @@ -128,6 +128,7 @@ public class ProfileOptionTest { switch (t) { case JDK1_8: + case JDK1_9: if (!out.isEmpty()) error("unexpected output from compiler"); break; diff --git a/langtools/test/tools/javac/versions/check.sh b/langtools/test/tools/javac/versions/check.sh index bc25f7d6065..3f8033863a7 100644 --- a/langtools/test/tools/javac/versions/check.sh +++ b/langtools/test/tools/javac/versions/check.sh @@ -1,5 +1,5 @@ # -# Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -22,7 +22,7 @@ # # @test -# @bug 4981566 5028634 5094412 6304984 7025786 7025789 8001112 +# @bug 4981566 5028634 5094412 6304984 7025786 7025789 8001112 8028545 8000961 # @summary Check interpretation of -target and -source options # @build CheckClassFileVersion # @run shell check.sh @@ -44,7 +44,7 @@ echo 'public enum Y { }' > $TC/Y.java check() { V=$1; shift echo "+ javac $* [$V]" - "$JC" ${TESTTOOLVMOPTS} -d $TC $* $TC/X.java && "$J" $CFV $TC/X.class $V || exit 2 + "$JC" ${TESTTOOLVMOPTS} -Xlint:-options -d $TC $* $TC/X.java && "$J" $CFV $TC/X.class $V || exit 2 } # check for all combinations of target values @@ -78,6 +78,10 @@ check_source_target 52.0 6 8 check_source_target 52.0 7 8 check_source_target 52.0 8 8 +check_target 52.0 1.5 9 +check_source_target 52.0 8 9 +check_source_target 52.0 9 9 + # and finally the default with no options check 52.0 @@ -85,7 +89,7 @@ check 52.0 fail() { echo "+ javac $*" - if "$JC" ${TESTTOOLVMOPTS} -d $TC $*; then + if "$JC" ${TESTTOOLVMOPTS} -Xlint:-options -d $TC $*; then echo "-- did not fail as expected" exit 3 else @@ -95,7 +99,7 @@ fail() { pass() { echo "+ javac $*" - if "$JC" ${TESTTOOLVMOPTS} -d $TC $*; then + if "$JC" ${TESTTOOLVMOPTS} -Xlint:options -d $TC $*; then echo "-- passed" else echo "-- failed" @@ -109,6 +113,7 @@ checksrc15() { pass $* $TC/X.java; pass $* $TC/Y.java; } checksrc16() { checksrc15 $* ; } checksrc17() { checksrc15 $* ; } checksrc18() { checksrc15 $* ; } +checksrc19() { checksrc15 $* ; } checksrc14 -source 1.4 checksrc14 -source 1.4 -target 1.5 @@ -126,14 +131,19 @@ checksrc17 -source 7 checksrc17 -source 1.7 -target 1.7 checksrc17 -source 7 -target 7 -checksrc18 -checksrc18 -target 1.8 -checksrc18 -target 8 checksrc18 -source 1.8 checksrc18 -source 8 checksrc18 -source 1.8 -target 1.8 checksrc18 -source 8 -target 8 +checksrc19 +checksrc19 -source 1.9 +checksrc19 -source 9 +checksrc19 -source 1.9 -target 1.9 +checksrc19 -source 9 -target 9 +checksrc19 -target 1.9 +checksrc19 -target 9 + fail -source 1.5 -target 1.4 $TC/X.java fail -source 1.6 -target 1.4 $TC/X.java fail -source 6 -target 1.4 $TC/X.java @@ -142,3 +152,5 @@ fail -source 6 -target 1.5 $TC/X.java fail -source 7 -target 1.6 $TC/X.java fail -source 8 -target 1.6 $TC/X.java fail -source 8 -target 1.7 $TC/X.java +fail -source 9 -target 1.7 $TC/X.java +fail -source 9 -target 1.8 $TC/X.java From b06d1bfb5507d0b909e32dd123863983c3e4dddc Mon Sep 17 00:00:00 2001 From: Jan Lahoda Date: Tue, 17 Dec 2013 10:55:58 +0100 Subject: [PATCH 114/377] 8029715: test needs bugID added to @bug tag Adding forgotten bug number Reviewed-by: vromero --- .../javac/processing/model/type/IntersectionPropertiesTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/langtools/test/tools/javac/processing/model/type/IntersectionPropertiesTest.java b/langtools/test/tools/javac/processing/model/type/IntersectionPropertiesTest.java index cbbcfa05353..d474a70762a 100644 --- a/langtools/test/tools/javac/processing/model/type/IntersectionPropertiesTest.java +++ b/langtools/test/tools/javac/processing/model/type/IntersectionPropertiesTest.java @@ -23,7 +23,7 @@ /* * @test - * @bug 6499673 + * @bug 6499673 6557966 * @library /tools/javac/lib * @build JavacTestingAbstractProcessor IntersectionPropertiesTest * @run main IntersectionPropertiesTest From 8ebb81fb7affc7abb522aad3348be8b67357bf99 Mon Sep 17 00:00:00 2001 From: Jan Lahoda Date: Tue, 17 Dec 2013 10:55:59 +0100 Subject: [PATCH 115/377] 8029800: Flags.java uses String.toLowerCase without specifying Locale Introducing StringUtils.toLowerCase/toUpperCase independent on the default locale, converting almost all usages of String.toLowerCase/toUpperCase to use the new methods. Reviewed-by: jjg, bpatel --- .../com/sun/tools/classfile/Instruction.java | 6 +- .../formats/html/ConfigurationImpl.java | 7 +- .../formats/html/HtmlDocletWriter.java | 24 ++-- .../formats/html/MethodWriterImpl.java | 3 +- .../doclets/formats/html/markup/HtmlAttr.java | 6 +- .../doclets/formats/html/markup/HtmlTag.java | 4 +- .../internal/toolkit/Configuration.java | 11 +- .../builders/MemberSummaryBuilder.java | 4 +- .../builders/SerializedFormBuilder.java | 3 +- .../toolkit/taglets/SimpleTaglet.java | 3 +- .../toolkit/taglets/TagletManager.java | 7 +- .../doclets/internal/toolkit/util/Util.java | 13 +- .../toolkit/util/VisibleMemberMap.java | 2 +- .../com/sun/tools/doclint/Checker.java | 3 +- .../classes/com/sun/tools/doclint/Env.java | 3 +- .../com/sun/tools/doclint/HtmlTag.java | 12 +- .../com/sun/tools/doclint/Messages.java | 13 +- .../com/sun/tools/javac/code/Flags.java | 3 +- .../com/sun/tools/javac/file/Locations.java | 5 +- .../com/sun/tools/javac/main/Option.java | 3 +- .../tools/javac/parser/DocCommentParser.java | 3 +- .../javac/processing/PrintingProcessor.java | 5 +- .../com/sun/tools/javac/util/StringUtils.java | 53 ++++++++ .../com/sun/tools/javap/AttributeWriter.java | 7 +- .../sun/tools/javap/TypeAnnotationWriter.java | 3 +- .../tools/sjavac/server/CompilerThread.java | 3 +- .../test/tools/javac/NoStringToLower.java | 128 ++++++++++++++++++ .../tools/javac/util/StringUtilsTest.java | 66 +++++++++ 28 files changed, 336 insertions(+), 67 deletions(-) create mode 100644 langtools/src/share/classes/com/sun/tools/javac/util/StringUtils.java create mode 100644 langtools/test/tools/javac/NoStringToLower.java create mode 100644 langtools/test/tools/javac/util/StringUtilsTest.java diff --git a/langtools/src/share/classes/com/sun/tools/classfile/Instruction.java b/langtools/src/share/classes/com/sun/tools/classfile/Instruction.java index 855cc781aa3..f61886a55bc 100644 --- a/langtools/src/share/classes/com/sun/tools/classfile/Instruction.java +++ b/langtools/src/share/classes/com/sun/tools/classfile/Instruction.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,6 +25,8 @@ package com.sun.tools.classfile; +import java.util.Locale; + /** * See JVMS, chapter 6. * @@ -211,7 +213,7 @@ public class Instruction { if (opcode == null) return "bytecode " + getUnsignedByte(0); else - return opcode.toString().toLowerCase(); + return opcode.toString().toLowerCase(Locale.US); } /** Get the length, in bytes, of this instruction, including the opcode diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ConfigurationImpl.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ConfigurationImpl.java index 414db80e410..ea2bdd05fca 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ConfigurationImpl.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ConfigurationImpl.java @@ -37,6 +37,7 @@ import com.sun.tools.doclets.internal.toolkit.util.*; import com.sun.tools.doclint.DocLint; import com.sun.tools.javac.file.JavacFileManager; import com.sun.tools.javac.util.Context; +import com.sun.tools.javac.util.StringUtils; import com.sun.tools.javadoc.RootDocImpl; /** @@ -237,7 +238,7 @@ public class ConfigurationImpl extends Configuration { public void setSpecificDocletOptions(String[][] options) { for (int oi = 0; oi < options.length; ++oi) { String[] os = options[oi]; - String opt = os[0].toLowerCase(); + String opt = StringUtils.toLowerCase(os[0]); if (opt.equals("-footer")) { footer = os[1]; } else if (opt.equals("-header")) { @@ -325,7 +326,7 @@ public class ConfigurationImpl extends Configuration { return result; } // otherwise look for the options we have added - option = option.toLowerCase(); + option = StringUtils.toLowerCase(option); if (option.equals("-nodeprecatedlist") || option.equals("-noindex") || option.equals("-notree") || @@ -389,7 +390,7 @@ public class ConfigurationImpl extends Configuration { // otherwise look at our options for (int oi = 0; oi < options.length; ++oi) { String[] os = options[oi]; - String opt = os[0].toLowerCase(); + String opt = StringUtils.toLowerCase(os[0]); if (opt.equals("-helpfile")) { if (nohelp == true) { reporter.printError(getText("doclet.Option_conflict", diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java index 6271cd3e6df..f3dcaf9d895 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java @@ -34,6 +34,7 @@ import com.sun.tools.doclets.formats.html.markup.*; import com.sun.tools.doclets.internal.toolkit.*; import com.sun.tools.doclets.internal.toolkit.taglets.*; import com.sun.tools.doclets.internal.toolkit.util.*; +import com.sun.tools.javac.util.StringUtils; /** * Class for the Html Format Code Generation specific to JavaDoc. @@ -138,17 +139,17 @@ public class HtmlDocletWriter extends HtmlDocWriter { if (index < 0) { return htmlstr; } - String lowerHtml = htmlstr.toLowerCase(); + String lowerHtml = StringUtils.toLowerCase(htmlstr); + final String docroot = "{@docroot}"; // Return index of first occurrence of {@docroot} // Note: {@docRoot} is not case sensitive when passed in w/command line option - index = lowerHtml.indexOf("{@docroot}", index); + index = lowerHtml.indexOf(docroot, index); if (index < 0) { return htmlstr; } StringBuilder buf = new StringBuilder(); int previndex = 0; while (true) { - final String docroot = "{@docroot}"; // Search for lowercase version of {@docRoot} index = lowerHtml.indexOf(docroot, previndex); // If next {@docRoot} tag not found, append rest of htmlstr and exit loop @@ -1689,13 +1690,13 @@ public class HtmlDocletWriter extends HtmlDocWriter { } //Redirect all relative links. - int end, begin = text.toLowerCase().indexOf("= 0){ StringBuilder textBuff = new StringBuilder(text); while(begin >=0){ if (textBuff.length() > begin + 2 && ! Character.isWhitespace(textBuff.charAt(begin+2))) { - begin = textBuff.toString().toLowerCase().indexOf("' && blockTags.contains(text.substring(tagPos, currPos).toLowerCase())) { + if (ch == '>' && blockTags.contains(StringUtils.toLowerCase(text.substring(tagPos, currPos)))) { result.append(text, startPos, lessThanPos); startPos = currPos + 1; } diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/MethodWriterImpl.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/MethodWriterImpl.java index a6290e237cf..c3178c933fb 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/MethodWriterImpl.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/MethodWriterImpl.java @@ -31,6 +31,7 @@ import com.sun.javadoc.*; import com.sun.tools.doclets.formats.html.markup.*; import com.sun.tools.doclets.internal.toolkit.*; import com.sun.tools.doclets.internal.toolkit.util.*; +import com.sun.tools.javac.util.StringUtils; /** * Writes method documentation in HTML format. @@ -338,7 +339,7 @@ public class MethodWriterImpl extends AbstractExecutableMemberWriter return ""; } - String lc = tag.toLowerCase(); + String lc = StringUtils.toLowerCase(tag); int begin = lc.indexOf(""); int end = lc.indexOf(""); if(begin == -1 || end == -1 || end <= begin){ diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlAttr.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlAttr.java index 4478ccf3e97..c656fc77aad 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlAttr.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlAttr.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,6 +25,8 @@ package com.sun.tools.doclets.formats.html.markup; +import com.sun.tools.javac.util.StringUtils; + /** * Enum representing HTML tag attributes. * @@ -64,7 +66,7 @@ public enum HtmlAttr { private final String value; HtmlAttr() { - this.value = name().toLowerCase(); + this.value = StringUtils.toLowerCase(name()); } HtmlAttr(String name) { diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlTag.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlTag.java index 60895e00e97..2c24a8c62bb 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlTag.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlTag.java @@ -25,7 +25,7 @@ package com.sun.tools.doclets.formats.html.markup; -import java.util.Locale; +import com.sun.tools.javac.util.StringUtils; /** * Enum representing HTML tags. @@ -117,7 +117,7 @@ public enum HtmlTag { HtmlTag(BlockType blockType, EndTag endTag ) { this.blockType = blockType; this.endTag = endTag; - this.value = name().toLowerCase(Locale.US); + this.value = StringUtils.toLowerCase(name()); } /** diff --git a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/Configuration.java b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/Configuration.java index 940f1c91294..667cf55fa95 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/Configuration.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/Configuration.java @@ -29,6 +29,7 @@ import java.io.*; import java.util.*; import java.util.regex.Matcher; import java.util.regex.Pattern; +import javax.tools.JavaFileManager; import com.sun.javadoc.*; import com.sun.tools.javac.sym.Profiles; @@ -36,7 +37,7 @@ import com.sun.tools.javac.jvm.Profile; import com.sun.tools.doclets.internal.toolkit.builders.BuilderFactory; import com.sun.tools.doclets.internal.toolkit.taglets.*; import com.sun.tools.doclets.internal.toolkit.util.*; -import javax.tools.JavaFileManager; +import com.sun.tools.javac.util.StringUtils; /** * Configure the output based on the options. Doclets should sub-class @@ -337,7 +338,7 @@ public abstract class Configuration { * Negative value means error occurred. */ public int optionLength(String option) { - option = option.toLowerCase(); + option = StringUtils.toLowerCase(option); if (option.equals("-author") || option.equals("-docfilessubdirs") || option.equals("-javafx") || @@ -454,7 +455,7 @@ public abstract class Configuration { // the output directory has already been created: so do that first. for (int oi = 0; oi < options.length; ++oi) { String[] os = options[oi]; - String opt = os[0].toLowerCase(); + String opt = StringUtils.toLowerCase(os[0]); if (opt.equals("-d")) { destDirName = addTrailingFileSep(os[1]); docFileDestDirName = destDirName; @@ -465,7 +466,7 @@ public abstract class Configuration { for (int oi = 0; oi < options.length; ++oi) { String[] os = options[oi]; - String opt = os[0].toLowerCase(); + String opt = StringUtils.toLowerCase(os[0]); if (opt.equals("-docfilessubdirs")) { copydocfilesubdirs = true; } else if (opt.equals("-docencoding")) { @@ -708,7 +709,7 @@ public abstract class Configuration { String encoding = ""; for (int oi = 0; oi < options.length; oi++) { String[] os = options[oi]; - String opt = os[0].toLowerCase(); + String opt = StringUtils.toLowerCase(os[0]); if (opt.equals("-docencoding")) { docencodingfound = true; if (!checkOutputFileEncoding(os[1], reporter)) { diff --git a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/MemberSummaryBuilder.java b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/MemberSummaryBuilder.java index fb4f14c8253..1b04e386b82 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/MemberSummaryBuilder.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/MemberSummaryBuilder.java @@ -384,13 +384,13 @@ public class MemberSummaryBuilder extends AbstractMemberBuilder { commentTextBuilder.append( MessageFormat.format( configuration.getText("doclet.PropertySetterWithName"), - Util.propertyNameFromMethodName(member.name()))); + Util.propertyNameFromMethodName(configuration, member.name()))); } if (isGetter) { commentTextBuilder.append( MessageFormat.format( configuration.getText("doclet.PropertyGetterWithName"), - Util.propertyNameFromMethodName(member.name()))); + Util.propertyNameFromMethodName(configuration, member.name()))); } if (propertyDoc.commentText() != null && !propertyDoc.commentText().isEmpty()) { diff --git a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/SerializedFormBuilder.java b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/SerializedFormBuilder.java index 66917109dd8..dfed2ef09f8 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/SerializedFormBuilder.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/SerializedFormBuilder.java @@ -31,6 +31,7 @@ import java.util.*; import com.sun.javadoc.*; import com.sun.tools.doclets.internal.toolkit.*; import com.sun.tools.doclets.internal.toolkit.util.*; +import com.sun.tools.javac.util.StringUtils; /** * Builds the serialized form. @@ -567,7 +568,7 @@ public class SerializedFormBuilder extends AbstractBuilder { } Tag[] serial = doc.tags("serial"); if (serial.length > 0) { - String serialtext = serial[0].text().toLowerCase(); + String serialtext = StringUtils.toLowerCase(serial[0].text()); if (serialtext.indexOf("exclude") >= 0) { return false; } else if (serialtext.indexOf("include") >= 0) { diff --git a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/SimpleTaglet.java b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/SimpleTaglet.java index e201eb6adc8..b91890d2e0e 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/SimpleTaglet.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/SimpleTaglet.java @@ -28,6 +28,7 @@ package com.sun.tools.doclets.internal.toolkit.taglets; import com.sun.javadoc.*; import com.sun.tools.doclets.internal.toolkit.Content; import com.sun.tools.doclets.internal.toolkit.util.DocFinder; +import com.sun.tools.javac.util.StringUtils; /** * A simple single argument custom tag. @@ -110,7 +111,7 @@ public class SimpleTaglet extends BaseTaglet implements InheritableTaglet { public SimpleTaglet(String tagName, String header, String locations) { this.tagName = tagName; this.header = header; - locations = locations.toLowerCase(); + locations = StringUtils.toLowerCase(locations); if (locations.indexOf(ALL) != -1 && locations.indexOf(EXCLUDED) == -1) { this.locations = PACKAGE + TYPE + FIELD + METHOD + CONSTRUCTOR + OVERVIEW; } else { diff --git a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/TagletManager.java b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/TagletManager.java index d1aa9b727de..43c73eaa6fd 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/TagletManager.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/TagletManager.java @@ -35,6 +35,7 @@ import javax.tools.JavaFileManager; import com.sun.javadoc.*; import com.sun.tools.doclets.internal.toolkit.util.*; +import com.sun.tools.javac.util.StringUtils; /** * Manages theTaglets used by doclets. @@ -304,7 +305,7 @@ public class TagletManager { return; } Taglet tag = customTags.get(tagName); - locations = locations.toLowerCase(); + locations = StringUtils.toLowerCase(locations); if (tag == null || header != null) { customTags.remove(tagName); customTags.put(tagName, new SimpleTaglet(tagName, header, locations)); @@ -375,7 +376,7 @@ public class TagletManager { name = name.substring(1, name.length()); } if (! (standardTags.contains(name) || customTags.containsKey(name))) { - if (standardTagsLowercase.contains(name.toLowerCase())) { + if (standardTagsLowercase.contains(StringUtils.toLowerCase(name))) { message.warning(tags[i].position(), "doclet.UnknownTagLowercase", tags[i].name()); continue; } else { @@ -708,7 +709,7 @@ public class TagletManager { private void initStandardTagsLowercase() { Iterator it = standardTags.iterator(); while (it.hasNext()) { - standardTagsLowercase.add(it.next().toLowerCase()); + standardTagsLowercase.add(StringUtils.toLowerCase(it.next())); } } diff --git a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/Util.java b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/Util.java index b3081f421fe..1522cdf91f1 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/Util.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/Util.java @@ -28,11 +28,12 @@ package com.sun.tools.doclets.internal.toolkit.util; import java.io.*; import java.lang.annotation.ElementType; import java.util.*; +import javax.tools.StandardLocation; import com.sun.javadoc.*; import com.sun.javadoc.AnnotationDesc.ElementValuePair; import com.sun.tools.doclets.internal.toolkit.*; -import javax.tools.StandardLocation; +import com.sun.tools.javac.util.StringUtils; /** * Utilities Class for Doclets. @@ -253,8 +254,8 @@ public class Util { */ private static class TypeComparator implements Comparator { public int compare(Type type1, Type type2) { - return type1.qualifiedTypeName().toLowerCase().compareTo( - type2.qualifiedTypeName().toLowerCase()); + return type1.qualifiedTypeName().compareToIgnoreCase( + type2.qualifiedTypeName()); } } @@ -589,7 +590,7 @@ public class Util { typeName = "doclet.Enum"; } return config.getText( - lowerCaseOnly ? typeName.toLowerCase() : typeName); + lowerCaseOnly ? StringUtils.toLowerCase(typeName) : typeName); } /** @@ -724,7 +725,7 @@ public class Util { * @param name name of the getter or setter method. * @return the name of the property of the given setter of getter. */ - public static String propertyNameFromMethodName(String name) { + public static String propertyNameFromMethodName(Configuration configuration, String name) { String propertyName = null; if (name.startsWith("get") || name.startsWith("set")) { propertyName = name.substring(3); @@ -734,7 +735,7 @@ public class Util { if ((propertyName == null) || propertyName.isEmpty()){ return ""; } - return propertyName.substring(0, 1).toLowerCase() + return propertyName.substring(0, 1).toLowerCase(configuration.getLocale()) + propertyName.substring(1); } diff --git a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/VisibleMemberMap.java b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/VisibleMemberMap.java index 15d41773b4e..72cc196d8a1 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/VisibleMemberMap.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/VisibleMemberMap.java @@ -702,7 +702,7 @@ public class VisibleMemberMap { private boolean isPropertyGetterOrSetter(MethodDoc[] members, MethodDoc methodDoc) { boolean found = false; - String propertyName = Util.propertyNameFromMethodName(methodDoc.name()); + String propertyName = Util.propertyNameFromMethodName(configuration, methodDoc.name()); if (!propertyName.isEmpty()) { String propertyMethodName = propertyName + "Property"; for (MethodDoc member: members) { diff --git a/langtools/src/share/classes/com/sun/tools/doclint/Checker.java b/langtools/src/share/classes/com/sun/tools/doclint/Checker.java index 0498c98dd6b..e89a460525f 100644 --- a/langtools/src/share/classes/com/sun/tools/doclint/Checker.java +++ b/langtools/src/share/classes/com/sun/tools/doclint/Checker.java @@ -80,6 +80,7 @@ import com.sun.source.util.DocTreePathScanner; import com.sun.source.util.TreePath; import com.sun.tools.doclint.HtmlTag.AttrKind; import com.sun.tools.javac.tree.DocPretty; +import com.sun.tools.javac.util.StringUtils; import static com.sun.tools.doclint.Messages.Group.*; @@ -243,7 +244,7 @@ public class Checker extends DocTreePathScanner { markEnclosingTag(Flag.HAS_TEXT); String name = tree.getName().toString(); if (name.startsWith("#")) { - int v = name.toLowerCase().startsWith("#x") + int v = StringUtils.toLowerCase(name).startsWith("#x") ? Integer.parseInt(name.substring(2), 16) : Integer.parseInt(name.substring(1), 10); if (!Entity.isValid(v)) { diff --git a/langtools/src/share/classes/com/sun/tools/doclint/Env.java b/langtools/src/share/classes/com/sun/tools/doclint/Env.java index 8ef21dbe0bb..11d572d3663 100644 --- a/langtools/src/share/classes/com/sun/tools/doclint/Env.java +++ b/langtools/src/share/classes/com/sun/tools/doclint/Env.java @@ -44,6 +44,7 @@ import com.sun.source.util.SourcePositions; import com.sun.source.util.TreePath; import com.sun.tools.javac.model.JavacTypes; import com.sun.tools.javac.tree.JCTree; +import com.sun.tools.javac.util.StringUtils; /** * Utility container for current execution environment, @@ -66,7 +67,7 @@ public class Env { static boolean accepts(String opt) { for (AccessKind g: values()) - if (opt.equals(g.name().toLowerCase())) return true; + if (opt.equals(StringUtils.toLowerCase(g.name()))) return true; return false; } diff --git a/langtools/src/share/classes/com/sun/tools/doclint/HtmlTag.java b/langtools/src/share/classes/com/sun/tools/doclint/HtmlTag.java index 2ea92af9ac0..8de43278df6 100644 --- a/langtools/src/share/classes/com/sun/tools/doclint/HtmlTag.java +++ b/langtools/src/share/classes/com/sun/tools/doclint/HtmlTag.java @@ -36,6 +36,7 @@ import java.util.Map; import javax.lang.model.element.Name; import static com.sun.tools.doclint.HtmlTag.Attr.*; +import com.sun.tools.javac.util.StringUtils; /** * Enum representing HTML tags. @@ -352,7 +353,7 @@ public enum HtmlTag { WIDTH; public String getText() { - return toLowerCase(name()); + return StringUtils.toLowerCase(name()); } static final Map index = new HashMap(); @@ -431,11 +432,11 @@ public enum HtmlTag { } public String getText() { - return toLowerCase(name()); + return StringUtils.toLowerCase(name()); } public Attr getAttr(Name attrName) { - return Attr.index.get(toLowerCase(attrName.toString())); + return Attr.index.get(StringUtils.toLowerCase(attrName.toString())); } public AttrKind getAttrKind(Name attrName) { @@ -457,10 +458,7 @@ public enum HtmlTag { } static HtmlTag get(Name tagName) { - return index.get(toLowerCase(tagName.toString())); + return index.get(StringUtils.toLowerCase(tagName.toString())); } - private static String toLowerCase(String s) { - return s.toLowerCase(Locale.US); - } } diff --git a/langtools/src/share/classes/com/sun/tools/doclint/Messages.java b/langtools/src/share/classes/com/sun/tools/doclint/Messages.java index cfa397d349e..a3e89b9402f 100644 --- a/langtools/src/share/classes/com/sun/tools/doclint/Messages.java +++ b/langtools/src/share/classes/com/sun/tools/doclint/Messages.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -42,6 +42,7 @@ import javax.tools.Diagnostic; import com.sun.source.doctree.DocTree; import com.sun.source.tree.Tree; import com.sun.tools.doclint.Env.AccessKind; +import com.sun.tools.javac.util.StringUtils; /** * Message reporting for DocLint. @@ -67,7 +68,7 @@ public class Messages { SYNTAX, REFERENCE; - String optName() { return name().toLowerCase(); } + String optName() { return StringUtils.toLowerCase(name()); } String notOptName() { return "-" + optName(); } static boolean accepts(String opt) { @@ -158,7 +159,7 @@ public class Messages { static boolean isValidOptions(String opts) { for (String opt: opts.split(",")) { - if (!isValidOption(opt.trim().toLowerCase())) + if (!isValidOption(StringUtils.toLowerCase(opt.trim()))) return false; } return true; @@ -203,7 +204,7 @@ public class Messages { setOption(ALL, Env.AccessKind.PRIVATE); else { for (String opt: opts.split(",")) - setOption(opt.trim().toLowerCase()); + setOption(StringUtils.toLowerCase(opt.trim())); } } @@ -215,7 +216,7 @@ public class Messages { int sep = arg.indexOf("/"); if (sep > 0) { - Env.AccessKind ak = Env.AccessKind.valueOf(arg.substring(sep + 1).toUpperCase()); + Env.AccessKind ak = Env.AccessKind.valueOf(StringUtils.toUpperCase(arg.substring(sep + 1))); setOption(arg.substring(0, sep), ak); } else { setOption(arg, null); @@ -290,7 +291,7 @@ public class Messages { out.println("By diagnostic kind..."); Table dkindTable = new Table(); for (Diagnostic.Kind k : Diagnostic.Kind.values()) { - dkindTable.put(k.toString().toLowerCase(), dkindCounts[k.ordinal()]); + dkindTable.put(StringUtils.toLowerCase(k.toString()), dkindCounts[k.ordinal()]); } dkindTable.print(out); out.println(); diff --git a/langtools/src/share/classes/com/sun/tools/javac/code/Flags.java b/langtools/src/share/classes/com/sun/tools/javac/code/Flags.java index e02285d9d65..4c555cef896 100644 --- a/langtools/src/share/classes/com/sun/tools/javac/code/Flags.java +++ b/langtools/src/share/classes/com/sun/tools/javac/code/Flags.java @@ -33,6 +33,7 @@ import java.util.Set; import javax.lang.model.element.Modifier; import com.sun.tools.javac.util.Assert; +import com.sun.tools.javac.util.StringUtils; /** Access flags and other modifiers for Java classes and members. * @@ -388,7 +389,7 @@ public class Flags { Flag(long flag) { this.value = flag; - this.lowercaseName = name().toLowerCase(); + this.lowercaseName = StringUtils.toLowerCase(name()); } @Override diff --git a/langtools/src/share/classes/com/sun/tools/javac/file/Locations.java b/langtools/src/share/classes/com/sun/tools/javac/file/Locations.java index 7ee850bb4d5..efabb6cec77 100644 --- a/langtools/src/share/classes/com/sun/tools/javac/file/Locations.java +++ b/langtools/src/share/classes/com/sun/tools/javac/file/Locations.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -51,6 +51,7 @@ import com.sun.tools.javac.main.Option; import com.sun.tools.javac.util.ListBuffer; import com.sun.tools.javac.util.Log; import com.sun.tools.javac.util.Options; +import com.sun.tools.javac.util.StringUtils; import javax.tools.JavaFileManager; import javax.tools.StandardJavaFileManager; @@ -717,7 +718,7 @@ public class Locations { /** Is this the name of an archive file? */ private boolean isArchive(File file) { - String n = file.getName().toLowerCase(); + String n = StringUtils.toLowerCase(file.getName()); return fsInfo.isFile(file) && (n.endsWith(".jar") || n.endsWith(".zip")); } diff --git a/langtools/src/share/classes/com/sun/tools/javac/main/Option.java b/langtools/src/share/classes/com/sun/tools/javac/main/Option.java index d21e7d4acb1..db0e2247d03 100644 --- a/langtools/src/share/classes/com/sun/tools/javac/main/Option.java +++ b/langtools/src/share/classes/com/sun/tools/javac/main/Option.java @@ -47,6 +47,7 @@ import com.sun.tools.javac.util.Log; import com.sun.tools.javac.util.Log.PrefixKind; import com.sun.tools.javac.util.Log.WriterKind; import com.sun.tools.javac.util.Options; +import com.sun.tools.javac.util.StringUtils; import static com.sun.tools.javac.main.Option.ChoiceKind.*; import static com.sun.tools.javac.main.Option.OptionGroup.*; import static com.sun.tools.javac.main.Option.OptionKind.*; @@ -713,7 +714,7 @@ public enum Option { String v = options.get(XPKGINFO); return (v == null ? PkgInfo.LEGACY - : PkgInfo.valueOf(v.toUpperCase())); + : PkgInfo.valueOf(StringUtils.toUpperCase(v))); } } diff --git a/langtools/src/share/classes/com/sun/tools/javac/parser/DocCommentParser.java b/langtools/src/share/classes/com/sun/tools/javac/parser/DocCommentParser.java index b96c7c32669..1c3b0062782 100644 --- a/langtools/src/share/classes/com/sun/tools/javac/parser/DocCommentParser.java +++ b/langtools/src/share/classes/com/sun/tools/javac/parser/DocCommentParser.java @@ -57,6 +57,7 @@ import com.sun.tools.javac.util.Name; import com.sun.tools.javac.util.Names; import com.sun.tools.javac.util.Options; import com.sun.tools.javac.util.Position; +import com.sun.tools.javac.util.StringUtils; import static com.sun.tools.javac.util.LayoutCharacters.*; /** @@ -993,7 +994,7 @@ public class DocCommentParser { "h1", "h2", "h3", "h4", "h5", "h6", "p", "pre")); protected boolean isSentenceBreak(Name n) { - return htmlBlockTags.contains(n.toString().toLowerCase()); + return htmlBlockTags.contains(StringUtils.toLowerCase(n.toString())); } protected boolean isSentenceBreak(DCTree t) { diff --git a/langtools/src/share/classes/com/sun/tools/javac/processing/PrintingProcessor.java b/langtools/src/share/classes/com/sun/tools/javac/processing/PrintingProcessor.java index 4a85f795f8f..66afbfc2e58 100644 --- a/langtools/src/share/classes/com/sun/tools/javac/processing/PrintingProcessor.java +++ b/langtools/src/share/classes/com/sun/tools/javac/processing/PrintingProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -36,6 +36,7 @@ import javax.lang.model.util.*; import java.io.PrintWriter; import java.io.Writer; import java.util.*; +import com.sun.tools.javac.util.StringUtils; /** * A processor which prints out elements. Used to implement the @@ -202,7 +203,7 @@ public class PrintingProcessor extends AbstractProcessor { writer.print("@interface"); break; default: - writer.print(kind.toString().toLowerCase()); + writer.print(StringUtils.toLowerCase(kind.toString())); } writer.print(" "); writer.print(e.getSimpleName()); diff --git a/langtools/src/share/classes/com/sun/tools/javac/util/StringUtils.java b/langtools/src/share/classes/com/sun/tools/javac/util/StringUtils.java new file mode 100644 index 00000000000..4f6d36ab03e --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/javac/util/StringUtils.java @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package com.sun.tools.javac.util; + +import java.util.Locale; + +/** A collection of utilities for String manipulation. + * + *

This is NOT part of any supported API. + * If you write code that depends on this, you do so at your own risk. + * This code and its internal interfaces are subject to change or + * deletion without notice. + */ +public class StringUtils { + + /**Converts the given String to lower case using the {@link Locale#US US Locale}. The result + * is independent of the default Locale in the current JVM instance. + */ + public static String toLowerCase(String source) { + return source.toLowerCase(Locale.US); + } + + /**Converts the given String to upper case using the {@link Locale#US US Locale}. The result + * is independent of the default Locale in the current JVM instance. + */ + public static String toUpperCase(String source) { + return source.toUpperCase(Locale.US); + } + +} diff --git a/langtools/src/share/classes/com/sun/tools/javap/AttributeWriter.java b/langtools/src/share/classes/com/sun/tools/javap/AttributeWriter.java index 02795a57233..dd721c2c077 100644 --- a/langtools/src/share/classes/com/sun/tools/javap/AttributeWriter.java +++ b/langtools/src/share/classes/com/sun/tools/javap/AttributeWriter.java @@ -62,6 +62,7 @@ import com.sun.tools.classfile.StackMap_attribute; import com.sun.tools.classfile.Synthetic_attribute; import static com.sun.tools.classfile.AccessFlags.*; +import com.sun.tools.javac.util.StringUtils; /* * A writer for writing Attributes as text. @@ -717,14 +718,14 @@ public class AttributeWriter extends BasicWriter } static String toHex(int i) { - return Integer.toString(i, 16).toUpperCase(); + return StringUtils.toUpperCase(Integer.toString(i, 16)); } static String toHex(int i, int w) { - String s = Integer.toHexString(i).toUpperCase(); + String s = StringUtils.toUpperCase(Integer.toHexString(i)); while (s.length() < w) s = "0" + s; - return s.toUpperCase(); + return StringUtils.toUpperCase(s); } private AnnotationWriter annotationWriter; diff --git a/langtools/src/share/classes/com/sun/tools/javap/TypeAnnotationWriter.java b/langtools/src/share/classes/com/sun/tools/javap/TypeAnnotationWriter.java index e5a3a68f1a3..a02b1cbecd7 100644 --- a/langtools/src/share/classes/com/sun/tools/javap/TypeAnnotationWriter.java +++ b/langtools/src/share/classes/com/sun/tools/javap/TypeAnnotationWriter.java @@ -37,6 +37,7 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; +import com.sun.tools.javac.util.StringUtils; /** * Annotate instructions with details about type annotations. @@ -115,7 +116,7 @@ public class TypeAnnotationWriter extends InstructionDetailWriter { print("@"); annotationWriter.write(n.anno, false, true); print(", "); - println(n.kind.toString().toLowerCase()); + println(StringUtils.toLowerCase(n.kind.toString())); } } } diff --git a/langtools/src/share/classes/com/sun/tools/sjavac/server/CompilerThread.java b/langtools/src/share/classes/com/sun/tools/sjavac/server/CompilerThread.java index aa9b3ba21e1..949e35ec48a 100644 --- a/langtools/src/share/classes/com/sun/tools/sjavac/server/CompilerThread.java +++ b/langtools/src/share/classes/com/sun/tools/sjavac/server/CompilerThread.java @@ -49,6 +49,7 @@ import javax.tools.StandardJavaFileManager; import com.sun.tools.javac.util.Context; import com.sun.tools.javac.util.Log; import com.sun.tools.javac.util.BaseFileManager; +import com.sun.tools.javac.util.StringUtils; import com.sun.tools.sjavac.comp.Dependencies; import com.sun.tools.sjavac.comp.JavaCompilerWithDeps; import com.sun.tools.sjavac.comp.SmartFileManager; @@ -256,7 +257,7 @@ public class CompilerThread implements Runnable { // Load visible sources Set visibleSources = new HashSet(); boolean fix_drive_letter_case = - System.getProperty("os.name").toLowerCase().startsWith("windows"); + StringUtils.toLowerCase(System.getProperty("os.name")).startsWith("windows"); for (;;) { String l = in.readLine(); if (l == null) diff --git a/langtools/test/tools/javac/NoStringToLower.java b/langtools/test/tools/javac/NoStringToLower.java new file mode 100644 index 00000000000..e6310653f7d --- /dev/null +++ b/langtools/test/tools/javac/NoStringToLower.java @@ -0,0 +1,128 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * 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 8029800 + * @summary String.toLowerCase()/toUpperCase is generally dangerous, check it is not used in langtools + */ + +import java.io.*; +import java.util.*; +import javax.tools.*; +import com.sun.tools.classfile.*; +import com.sun.tools.classfile.ConstantPool.CONSTANT_Methodref_info; + +public class NoStringToLower { + public static void main(String... args) throws Exception { + NoStringToLower c = new NoStringToLower(); + if (c.run(args)) + return; + + if (is_jtreg()) + throw new Exception(c.errors + " errors occurred"); + else + System.exit(1); + } + + static boolean is_jtreg() { + return (System.getProperty("test.src") != null); + } + + /** + * Main entry point. + */ + boolean run(String... args) throws Exception { + JavaCompiler c = ToolProvider.getSystemJavaCompiler(); + JavaFileManager fm = c.getStandardFileManager(null, null, null); + JavaFileManager.Location javacLoc = findJavacLocation(fm); + String[] pkgs = { + "javax.annotation.processing", + "javax.lang.model", + "javax.tools", + "com.sun.source", + "com.sun.tools" + }; + for (String pkg: pkgs) { + for (JavaFileObject fo: fm.list(javacLoc, + pkg, EnumSet.of(JavaFileObject.Kind.CLASS), true)) { + scan(fo); + } + } + + return (errors == 0); + } + + // depending on how the test is run, javac may be on bootclasspath or classpath + JavaFileManager.Location findJavacLocation(JavaFileManager fm) { + JavaFileManager.Location[] locns = + { StandardLocation.PLATFORM_CLASS_PATH, StandardLocation.CLASS_PATH }; + try { + for (JavaFileManager.Location l: locns) { + JavaFileObject fo = fm.getJavaFileForInput(l, + "com.sun.tools.javac.Main", JavaFileObject.Kind.CLASS); + if (fo != null) + return l; + } + } catch (IOException e) { + throw new Error(e); + } + throw new IllegalStateException("Cannot find javac"); + } + + /** + * Verify there are no references to String.toLowerCase() in a class file. + */ + void scan(JavaFileObject fo) throws IOException { + InputStream in = fo.openInputStream(); + try { + ClassFile cf = ClassFile.read(in); + for (ConstantPool.CPInfo cpinfo: cf.constant_pool.entries()) { + if (cpinfo.getTag() == ConstantPool.CONSTANT_Methodref) { + CONSTANT_Methodref_info ref = (CONSTANT_Methodref_info) cpinfo; + String methodDesc = ref.getClassInfo().getName() + "." + ref.getNameAndTypeInfo().getName() + ":" + ref.getNameAndTypeInfo().getType(); + + if ("java/lang/String.toLowerCase:()Ljava/lang/String;".equals(methodDesc)) { + error("found reference to String.toLowerCase() in: " + fo.getName()); + } + if ("java/lang/String.toUpperCase:()Ljava/lang/String;".equals(methodDesc)) { + error("found reference to String.toLowerCase() in: " + fo.getName()); + } + } + } + } catch (ConstantPoolException ignore) { + } finally { + in.close(); + } + } + + /** + * Report an error. + */ + void error(String msg) { + System.err.println("Error: " + msg); + errors++; + } + + int errors; +} diff --git a/langtools/test/tools/javac/util/StringUtilsTest.java b/langtools/test/tools/javac/util/StringUtilsTest.java new file mode 100644 index 00000000000..ec8db20ef77 --- /dev/null +++ b/langtools/test/tools/javac/util/StringUtilsTest.java @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * 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 8029800 + * @summary Unit test StringUtils + * @run main StringUtilsTest + */ + +import java.util.Locale; +import java.util.Objects; +import com.sun.tools.javac.util.StringUtils; + +public class StringUtilsTest { + public static void main(String... args) throws Exception { + new StringUtilsTest().run(); + } + + void run() throws Exception { + Locale.setDefault(new Locale("tr", "TR")); + + //verify the properties of the default locale: + assertEquals("\u0131", "I".toLowerCase()); + assertEquals("\u0130", "i".toUpperCase()); + + //verify the StringUtils does what it should + assertEquals("i", StringUtils.toLowerCase("I")); + assertEquals("I", StringUtils.toUpperCase("i")); + + //verify we can use index from indexOf of toLowerCase String in the original: + assertEquals(2, StringUtils.toLowerCase("\u0130\u0130lookFor").indexOf("lookfor")); + } + + void assertEquals(String expected, String actual) { + if (!Objects.equals(expected, actual)) { + throw new IllegalStateException("expected=" + expected + "; actual=" + actual); + } + } + + void assertEquals(int expected, int actual) { + if (expected != actual) { + throw new IllegalStateException("expected=" + expected + "; actual=" + actual); + } + } +} From 92c25244aabb560e1bb6cd56848d5887a277404f Mon Sep 17 00:00:00 2001 From: Jan Lahoda Date: Tue, 17 Dec 2013 10:58:21 +0100 Subject: [PATCH 116/377] 8028415: TreeMaker.Literal(Object) creates invalid JCLiterals when passed a Character JCLiteral for char must contain an Integer, not the provided Character. Reviewed-by: jjg --- .../classes/com/sun/tools/javac/tree/TreeMaker.java | 2 +- langtools/test/tools/javac/tree/MakeLiteralTest.java | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/langtools/src/share/classes/com/sun/tools/javac/tree/TreeMaker.java b/langtools/src/share/classes/com/sun/tools/javac/tree/TreeMaker.java index b39fd06471e..68378d3dbf4 100644 --- a/langtools/src/share/classes/com/sun/tools/javac/tree/TreeMaker.java +++ b/langtools/src/share/classes/com/sun/tools/javac/tree/TreeMaker.java @@ -757,7 +757,7 @@ public class TreeMaker implements JCTree.Factory { setType(syms.byteType.constType(value)); } else if (value instanceof Character) { int v = (int) (((Character) value).toString().charAt(0)); - result = Literal(CHAR, value). + result = Literal(CHAR, v). setType(syms.charType.constType(v)); } else if (value instanceof Double) { result = Literal(DOUBLE, value). diff --git a/langtools/test/tools/javac/tree/MakeLiteralTest.java b/langtools/test/tools/javac/tree/MakeLiteralTest.java index 782a2cd0958..b0491f81b56 100644 --- a/langtools/test/tools/javac/tree/MakeLiteralTest.java +++ b/langtools/test/tools/javac/tree/MakeLiteralTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,7 +23,7 @@ /* * @test - * @bug 6504896 + * @bug 6504896 8028415 * @summary TreeMaker.Literal(Object) does not support Booleans */ @@ -76,6 +76,12 @@ public class MakeLiteralTest { + l.type.constValue().getClass() + " " + l.type.constValue() + ": expected:" + constValue.getClass() + " " + constValue); } + if (l.getValue().getClass() != value.getClass() + || !value.equals(l.getValue())) { + error("unexpected const value: " + + l.getValue().getClass() + " " + l.type.constValue() + + ": expected:" + value.getClass() + " " + value); + } } void error(String msg) { From 0f0e04b6a05726155f3b58ff4f94b182e80c9e8c Mon Sep 17 00:00:00 2001 From: Jan Lahoda Date: Tue, 17 Dec 2013 10:58:26 +0100 Subject: [PATCH 117/377] 8028235: Better error recovery for parsing 'void' as a type of the lambda parameter Handle "void" as a primitive type in JavacParser.analyzeParens. Reviewed-by: vromero --- .../sun/tools/javac/parser/JavacParser.java | 2 +- .../javac/lambda/VoidLambdaParameter.java | 12 +++++ .../javac/lambda/VoidLambdaParameter.out | 5 +++ .../tools/javac/parser/JavacParserTest.java | 44 ++++++++++++++++++- 4 files changed, 60 insertions(+), 3 deletions(-) create mode 100644 langtools/test/tools/javac/lambda/VoidLambdaParameter.java create mode 100644 langtools/test/tools/javac/lambda/VoidLambdaParameter.out diff --git a/langtools/src/share/classes/com/sun/tools/javac/parser/JavacParser.java b/langtools/src/share/classes/com/sun/tools/javac/parser/JavacParser.java index 2b82e03c9bb..f1c5624e4c2 100644 --- a/langtools/src/share/classes/com/sun/tools/javac/parser/JavacParser.java +++ b/langtools/src/share/classes/com/sun/tools/javac/parser/JavacParser.java @@ -1547,7 +1547,7 @@ public class JavacParser implements Parser { } break; case BYTE: case SHORT: case INT: case LONG: case FLOAT: - case DOUBLE: case BOOLEAN: case CHAR: + case DOUBLE: case BOOLEAN: case CHAR: case VOID: if (peekToken(lookahead, RPAREN)) { //Type, ')' -> cast return ParensResult.CAST; diff --git a/langtools/test/tools/javac/lambda/VoidLambdaParameter.java b/langtools/test/tools/javac/lambda/VoidLambdaParameter.java new file mode 100644 index 00000000000..230bf16fd9c --- /dev/null +++ b/langtools/test/tools/javac/lambda/VoidLambdaParameter.java @@ -0,0 +1,12 @@ +/* @test /nodynamiccopyright/ + * @bug 8028235 + * @summary Using void as a lambda parameter should produce sane AST and errors + * @compile/fail/ref=VoidLambdaParameter.out -XDrawDiagnostics VoidLambdaParameter.java + */ +public class VoidLambdaParameter { + Runnable r = (void v) -> { }; + I i = (void v) -> { }; + interface I { + public void v(void v); + } +} diff --git a/langtools/test/tools/javac/lambda/VoidLambdaParameter.out b/langtools/test/tools/javac/lambda/VoidLambdaParameter.out new file mode 100644 index 00000000000..5823c894bc4 --- /dev/null +++ b/langtools/test/tools/javac/lambda/VoidLambdaParameter.out @@ -0,0 +1,5 @@ +VoidLambdaParameter.java:7:19: compiler.err.void.not.allowed.here +VoidLambdaParameter.java:7:18: compiler.err.prob.found.req: (compiler.misc.incompatible.arg.types.in.lambda) +VoidLambdaParameter.java:8:12: compiler.err.void.not.allowed.here +VoidLambdaParameter.java:10:23: compiler.err.void.not.allowed.here +4 errors diff --git a/langtools/test/tools/javac/parser/JavacParserTest.java b/langtools/test/tools/javac/parser/JavacParserTest.java index 1dd437a61a3..0ee49fce95f 100644 --- a/langtools/test/tools/javac/parser/JavacParserTest.java +++ b/langtools/test/tools/javac/parser/JavacParserTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,7 +23,7 @@ /* * @test - * @bug 7073631 7159445 7156633 + * @bug 7073631 7159445 7156633 8028235 * @summary tests error and diagnostics positions * @author Jan Lahoda */ @@ -35,9 +35,11 @@ import com.sun.source.tree.CompilationUnitTree; import com.sun.source.tree.ErroneousTree; import com.sun.source.tree.ExpressionStatementTree; import com.sun.source.tree.ExpressionTree; +import com.sun.source.tree.LambdaExpressionTree; import com.sun.source.tree.MethodInvocationTree; import com.sun.source.tree.MethodTree; import com.sun.source.tree.ModifiersTree; +import com.sun.source.tree.PrimitiveTypeTree; import com.sun.source.tree.StatementTree; import com.sun.source.tree.Tree; import com.sun.source.tree.Tree.Kind; @@ -60,6 +62,7 @@ import java.util.Arrays; import java.util.LinkedList; import java.util.List; import java.util.regex.Pattern; +import javax.lang.model.type.TypeKind; import javax.tools.Diagnostic; import javax.tools.DiagnosticCollector; import javax.tools.DiagnosticListener; @@ -895,6 +898,43 @@ public class JavacParserTest extends TestCase { assertEquals("testStartPositionEnumConstantInit", -1, start); } + @Test + void testVoidLambdaParameter() throws IOException { + String code = "package t; class Test { " + + "Runnable r = (void v) -> { };" + + "}"; + DiagnosticCollector coll = + new DiagnosticCollector<>(); + JavacTaskImpl ct = (JavacTaskImpl) tool.getTask(null, null, coll, null, + null, Arrays.asList(new MyFileObject(code))); + + CompilationUnitTree cut = ct.parse().iterator().next(); + ClassTree clazz = (ClassTree) cut.getTypeDecls().get(0); + VariableTree field = (VariableTree) clazz.getMembers().get(0); + + assertEquals("actual kind: " + field.getInitializer().getKind(), + field.getInitializer().getKind(), + Kind.LAMBDA_EXPRESSION); + + LambdaExpressionTree lambda = (LambdaExpressionTree) field.getInitializer(); + + assertEquals("actual parameters: " + lambda.getParameters().size(), + lambda.getParameters().size(), + 1); + + Tree paramType = lambda.getParameters().get(0).getType(); + + assertEquals("actual parameter type: " + paramType.getKind(), + paramType.getKind(), + Kind.PRIMITIVE_TYPE); + + TypeKind primitiveTypeKind = ((PrimitiveTypeTree) paramType).getPrimitiveTypeKind(); + + assertEquals("actual parameter type: " + primitiveTypeKind, + primitiveTypeKind, + TypeKind.VOID); + } + void run(String[] args) throws Exception { int passed = 0, failed = 0; final Pattern p = (args != null && args.length > 0) From f089800ee727a4b4256aa4d3348879fa721a9262 Mon Sep 17 00:00:00 2001 From: Joe Darcy Date: Tue, 17 Dec 2013 10:28:36 -0800 Subject: [PATCH 118/377] 8030080: Correct misstatement in JSR 269 MR (in javax.lang.model) Reviewed-by: jfranck --- .../javax/lang/model/type/IntersectionType.java | 10 ++++++---- .../share/classes/javax/lang/model/util/Types.java | 14 +++++++------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/langtools/src/share/classes/javax/lang/model/type/IntersectionType.java b/langtools/src/share/classes/javax/lang/model/type/IntersectionType.java index 0bfbb285698..9bd96711b6b 100644 --- a/langtools/src/share/classes/javax/lang/model/type/IntersectionType.java +++ b/langtools/src/share/classes/javax/lang/model/type/IntersectionType.java @@ -35,10 +35,12 @@ import java.util.List; * {@code } is an (implicit) intersection * type. As of {@link javax.lang.model.SourceVersion#RELEASE_8 * RELEASE_8}, this is represented by an {@code IntersectionType} with - * {@code Number} and {@code Runnable} as its bounds. Also as of the - * {@link javax.lang.model.SourceVersion#RELEASE_8 RELEASE_8}, - * intersection types can explicitly appear as the target type of a - * cast expression. + * {@code Number} and {@code Runnable} as its bounds. + * + * @implNote Also as of {@link + * javax.lang.model.SourceVersion#RELEASE_8 RELEASE_8}, in the + * reference implementation an {@code IntersectionType} is used to + * model the explicit target type of a cast expression. * * @since 1.8 */ diff --git a/langtools/src/share/classes/javax/lang/model/util/Types.java b/langtools/src/share/classes/javax/lang/model/util/Types.java index 2e50b50b11c..7dc7652a400 100644 --- a/langtools/src/share/classes/javax/lang/model/util/Types.java +++ b/langtools/src/share/classes/javax/lang/model/util/Types.java @@ -60,13 +60,6 @@ public interface Types { /** * Tests whether two {@code TypeMirror} objects represent the same type. * - *

Since annotations are only meta-data associated with a type, - * the set of annotations on either argument is not taken - * into account when computing whether or not two {@code - * TypeMirror} objects are the same type. In particular, two - * {@code TypeMirror} objects can have different annotations and - * still be considered the same. - * *

Caveat: if either of the arguments to this method represents a * wildcard, this method will return false. As a consequence, a wildcard * is not the same type as itself. This might be surprising at first, @@ -77,6 +70,13 @@ public interface Types { * {@code list.add(list.get(0));} * * + *

Since annotations are only meta-data associated with a type, + * the set of annotations on either argument is not taken + * into account when computing whether or not two {@code + * TypeMirror} objects are the same type. In particular, two + * {@code TypeMirror} objects can have different annotations and + * still be considered the same. + * * @param t1 the first type * @param t2 the second type * @return {@code true} if and only if the two types are the same From a183356fde6cb52470acfc7e0ac4e154bbcc7c20 Mon Sep 17 00:00:00 2001 From: Paul Govereau Date: Tue, 17 Dec 2013 18:15:48 -0500 Subject: [PATCH 119/377] 8030642: Add golden files to javac/limits Add golden files to check output of negative compilation tests in javac/limits Reviewed-by: jjg, emc --- langtools/test/tools/javac/limits/ArrayDims2.java | 2 +- langtools/test/tools/javac/limits/ArrayDims4.java | 2 +- langtools/test/tools/javac/limits/ArrayDims5.java | 2 +- langtools/test/tools/javac/limits/CodeSize.java | 2 +- langtools/test/tools/javac/limits/LongName.java | 2 +- langtools/test/tools/javac/limits/PoolSize1.java | 2 +- langtools/test/tools/javac/limits/PoolSize2.java | 2 +- langtools/test/tools/javac/limits/StringLength.java | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/langtools/test/tools/javac/limits/ArrayDims2.java b/langtools/test/tools/javac/limits/ArrayDims2.java index 7049cb21068..fc7f613158e 100644 --- a/langtools/test/tools/javac/limits/ArrayDims2.java +++ b/langtools/test/tools/javac/limits/ArrayDims2.java @@ -27,7 +27,7 @@ * @summary Compiler silently generates bytecode that exceeds VM limits * @author gafter * - * @compile/fail ArrayDims2.java + * @compile/fail/ref=ArrayDims2.out -XDrawDiagnostics ArrayDims2.java */ class ArrayDims2 { diff --git a/langtools/test/tools/javac/limits/ArrayDims4.java b/langtools/test/tools/javac/limits/ArrayDims4.java index ed9c1e3eec0..d3ee5658bb6 100644 --- a/langtools/test/tools/javac/limits/ArrayDims4.java +++ b/langtools/test/tools/javac/limits/ArrayDims4.java @@ -27,7 +27,7 @@ * @summary Compiler silently generates bytecode that exceeds VM limits * @author gafter * - * @compile/fail ArrayDims4.java + * @compile/fail/ref=ArrayDims4.out -XDrawDiagnostics ArrayDims4.java */ class ArrayDims4 { diff --git a/langtools/test/tools/javac/limits/ArrayDims5.java b/langtools/test/tools/javac/limits/ArrayDims5.java index 1cf2a783a5c..4c2a9cdd577 100644 --- a/langtools/test/tools/javac/limits/ArrayDims5.java +++ b/langtools/test/tools/javac/limits/ArrayDims5.java @@ -27,7 +27,7 @@ * @summary javac fails to diagnose too many array dimensions * @author gafter * - * @compile/fail ArrayDims5.java + * @compile/fail/ref=ArrayDims5.out -XDrawDiagnostics ArrayDims5.java */ public abstract class ArrayDims5 { diff --git a/langtools/test/tools/javac/limits/CodeSize.java b/langtools/test/tools/javac/limits/CodeSize.java index 95e7a0bb555..130b7be0cda 100644 --- a/langtools/test/tools/javac/limits/CodeSize.java +++ b/langtools/test/tools/javac/limits/CodeSize.java @@ -27,7 +27,7 @@ * @summary Compiler silently generates bytecode that exceeds VM limits * @author gafter * - * @compile/fail CodeSize.java + * @compile/fail/ref=CodeSize.out -XDrawDiagnostics CodeSize.java */ class CodeSize { diff --git a/langtools/test/tools/javac/limits/LongName.java b/langtools/test/tools/javac/limits/LongName.java index 92dbf488472..943c30274bc 100644 --- a/langtools/test/tools/javac/limits/LongName.java +++ b/langtools/test/tools/javac/limits/LongName.java @@ -27,7 +27,7 @@ * @summary Compiler silently generates bytecode that exceeds VM limits * @author gafter * - * @compile/fail LongName.java + * @compile/fail/ref=LongName.out -XDrawDiagnostics LongName.java */ class LongName { diff --git a/langtools/test/tools/javac/limits/PoolSize1.java b/langtools/test/tools/javac/limits/PoolSize1.java index 52840ba83a2..480feed7c43 100644 --- a/langtools/test/tools/javac/limits/PoolSize1.java +++ b/langtools/test/tools/javac/limits/PoolSize1.java @@ -27,7 +27,7 @@ * @summary Compiler silently generates bytecode that exceeds VM limits * @author gafter * - * @compile/fail PoolSize1.java + * @compile/fail/ref=PoolSize1.out -XDrawDiagnostics PoolSize1.java */ import java.io.PrintStream; diff --git a/langtools/test/tools/javac/limits/PoolSize2.java b/langtools/test/tools/javac/limits/PoolSize2.java index 25d872a6d59..66f4ffe3933 100644 --- a/langtools/test/tools/javac/limits/PoolSize2.java +++ b/langtools/test/tools/javac/limits/PoolSize2.java @@ -27,7 +27,7 @@ * @summary Compiler silently generates bytecode that exceeds VM limits * @author gafter * - * @compile/fail PoolSize2.java + * @compile/fail/ref=PoolSize2.out -XDrawDiagnostics PoolSize2.java */ import java.io.PrintStream; diff --git a/langtools/test/tools/javac/limits/StringLength.java b/langtools/test/tools/javac/limits/StringLength.java index 4438d22499c..5d4e35c3e94 100644 --- a/langtools/test/tools/javac/limits/StringLength.java +++ b/langtools/test/tools/javac/limits/StringLength.java @@ -27,7 +27,7 @@ * @summary Compiler silently generates bytecode that exceeds VM limits * @author gafter * - * @compile/fail StringLength.java + * @compile/fail/ref=StringLength.out -XDrawDiagnostics StringLength.java */ class StringLength { From bedae747dcac7e77c36040db721ecd77aed07d73 Mon Sep 17 00:00:00 2001 From: Eric McCorkle Date: Tue, 17 Dec 2013 19:27:49 -0500 Subject: [PATCH 120/377] 8030687: Add .out files to fix failing tests Forgot to hg add golden files in a previous fix Reviewed-by: jjg --- langtools/test/tools/javac/limits/ArrayDims2.out | 2 ++ langtools/test/tools/javac/limits/ArrayDims4.out | 2 ++ langtools/test/tools/javac/limits/ArrayDims5.out | 2 ++ langtools/test/tools/javac/limits/CodeSize.out | 2 ++ langtools/test/tools/javac/limits/LongName.out | 2 ++ langtools/test/tools/javac/limits/PoolSize1.out | 2 ++ langtools/test/tools/javac/limits/PoolSize2.out | 2 ++ langtools/test/tools/javac/limits/StringLength.out | 2 ++ 8 files changed, 16 insertions(+) create mode 100644 langtools/test/tools/javac/limits/ArrayDims2.out create mode 100644 langtools/test/tools/javac/limits/ArrayDims4.out create mode 100644 langtools/test/tools/javac/limits/ArrayDims5.out create mode 100644 langtools/test/tools/javac/limits/CodeSize.out create mode 100644 langtools/test/tools/javac/limits/LongName.out create mode 100644 langtools/test/tools/javac/limits/PoolSize1.out create mode 100644 langtools/test/tools/javac/limits/PoolSize2.out create mode 100644 langtools/test/tools/javac/limits/StringLength.out diff --git a/langtools/test/tools/javac/limits/ArrayDims2.out b/langtools/test/tools/javac/limits/ArrayDims2.out new file mode 100644 index 00000000000..4479f686a00 --- /dev/null +++ b/langtools/test/tools/javac/limits/ArrayDims2.out @@ -0,0 +1,2 @@ +ArrayDims2.java:60:22: compiler.err.limit.dimensions +1 error diff --git a/langtools/test/tools/javac/limits/ArrayDims4.out b/langtools/test/tools/javac/limits/ArrayDims4.out new file mode 100644 index 00000000000..47799f350ed --- /dev/null +++ b/langtools/test/tools/javac/limits/ArrayDims4.out @@ -0,0 +1,2 @@ +ArrayDims4.java:34:23: compiler.err.limit.dimensions +1 error diff --git a/langtools/test/tools/javac/limits/ArrayDims5.out b/langtools/test/tools/javac/limits/ArrayDims5.out new file mode 100644 index 00000000000..839e77428ca --- /dev/null +++ b/langtools/test/tools/javac/limits/ArrayDims5.out @@ -0,0 +1,2 @@ +ArrayDims5.java:43:9: compiler.err.limit.dimensions +1 error diff --git a/langtools/test/tools/javac/limits/CodeSize.out b/langtools/test/tools/javac/limits/CodeSize.out new file mode 100644 index 00000000000..d31dcc7013c --- /dev/null +++ b/langtools/test/tools/javac/limits/CodeSize.out @@ -0,0 +1,2 @@ +CodeSize.java:34:10: compiler.err.limit.code +1 error diff --git a/langtools/test/tools/javac/limits/LongName.out b/langtools/test/tools/javac/limits/LongName.out new file mode 100644 index 00000000000..5b64c85087b --- /dev/null +++ b/langtools/test/tools/javac/limits/LongName.out @@ -0,0 +1,2 @@ +LongName.java:33:1: compiler.err.limit.string.overflow: abcdefghijklnmopqrst +1 error diff --git a/langtools/test/tools/javac/limits/PoolSize1.out b/langtools/test/tools/javac/limits/PoolSize1.out new file mode 100644 index 00000000000..cfcdbd6c0b9 --- /dev/null +++ b/langtools/test/tools/javac/limits/PoolSize1.out @@ -0,0 +1,2 @@ +PoolSize1.java:35:1: compiler.err.limit.pool +1 error diff --git a/langtools/test/tools/javac/limits/PoolSize2.out b/langtools/test/tools/javac/limits/PoolSize2.out new file mode 100644 index 00000000000..5b688066ceb --- /dev/null +++ b/langtools/test/tools/javac/limits/PoolSize2.out @@ -0,0 +1,2 @@ +PoolSize2.java:35:1: compiler.err.limit.pool +1 error diff --git a/langtools/test/tools/javac/limits/StringLength.out b/langtools/test/tools/javac/limits/StringLength.out new file mode 100644 index 00000000000..b0c3a520a00 --- /dev/null +++ b/langtools/test/tools/javac/limits/StringLength.out @@ -0,0 +1,2 @@ +StringLength.java:45:37: compiler.err.limit.string +1 error From dbcdc1621236b8c240769f89e8dcd5eb642a40bf Mon Sep 17 00:00:00 2001 From: Brian Goetz Date: Wed, 18 Dec 2013 10:29:25 -0500 Subject: [PATCH 121/377] 8030253: Update langtools to use strings-in-switch 8030262: Update langtools to use foreach loops 8030245: Update langtools to use try-with-resources and multi-catch Reviewed-by: darcy --- .../com/sun/tools/classfile/Attributes.java | 3 +- .../com/sun/tools/classfile/ClassWriter.java | 5 +- .../html/AbstractExecutableMemberWriter.java | 12 +- .../formats/html/AbstractIndexWriter.java | 9 +- .../formats/html/AbstractTreeWriter.java | 15 ++- .../formats/html/AllClassesFrameWriter.java | 8 +- .../doclets/formats/html/ClassUseWriter.java | 27 ++-- .../doclets/formats/html/ClassWriterImpl.java | 13 +- .../formats/html/ConfigurationImpl.java | 17 ++- .../formats/html/ConstructorWriterImpl.java | 5 +- .../formats/html/HtmlDocletWriter.java | 37 +++--- .../formats/html/MethodWriterImpl.java | 3 +- .../formats/html/PackageFrameWriter.java | 17 ++- .../formats/html/PackageIndexFrameWriter.java | 8 +- .../formats/html/PackageIndexWriter.java | 9 +- .../formats/html/PackageUseWriter.java | 23 ++-- .../html/ProfilePackageFrameWriter.java | 17 +-- .../html/ProfilePackageIndexFrameWriter.java | 6 +- .../formats/html/SourceToHTMLConverter.java | 31 ++--- .../formats/html/SubWriterHolderWriter.java | 4 +- .../formats/html/TagletWriterImpl.java | 4 +- .../doclets/formats/html/markup/HtmlTree.java | 4 +- .../internal/toolkit/AbstractDoclet.java | 9 +- .../internal/toolkit/Configuration.java | 82 ++++++------- .../builders/ConstantsSummaryBuilder.java | 49 ++++---- .../toolkit/builders/ConstructorBuilder.java | 5 +- .../builders/MemberSummaryBuilder.java | 14 +-- .../builders/ProfileSummaryBuilder.java | 4 +- .../builders/SerializedFormBuilder.java | 30 +++-- .../internal/toolkit/taglets/ParamTaglet.java | 35 +++--- .../toolkit/taglets/SimpleTaglet.java | 14 +-- .../toolkit/taglets/TagletManager.java | 27 ++-- .../toolkit/taglets/TagletWriter.java | 28 ++--- .../toolkit/taglets/ThrowsTaglet.java | 54 ++++---- .../internal/toolkit/taglets/ValueTaglet.java | 7 +- .../toolkit/util/ClassDocCatalog.java | 4 +- .../internal/toolkit/util/ClassTree.java | 47 ++++--- .../internal/toolkit/util/ClassUseMapper.java | 115 ++++++++--------- .../util/DeprecatedAPIListBuilder.java | 16 +-- .../internal/toolkit/util/DocFile.java | 35 ++---- .../internal/toolkit/util/DocFinder.java | 4 +- .../doclets/internal/toolkit/util/Extern.java | 7 +- .../doclets/internal/toolkit/util/Group.java | 6 +- .../toolkit/util/ImplementedMethods.java | 6 +- .../internal/toolkit/util/IndexBuilder.java | 31 +++-- .../internal/toolkit/util/MetaKeywords.java | 7 +- .../internal/toolkit/util/MethodFinder.java | 6 +- .../toolkit/util/PackageListWriter.java | 11 +- .../doclets/internal/toolkit/util/Util.java | 109 ++++++++-------- .../toolkit/util/VisibleMemberMap.java | 62 ++++------ .../com/sun/tools/doclint/DocLint.java | 3 +- .../tools/javac/api/ClientCodeWrapper.java | 116 +++++------------- .../com/sun/tools/javac/file/FSInfo.java | 8 +- .../tools/javac/file/RegularFileObject.java | 5 +- .../com/sun/tools/javac/file/ZipArchive.java | 5 +- .../tools/javac/file/ZipFileIndexArchive.java | 5 +- .../tools/javac/file/ZipFileIndexCache.java | 6 +- .../com/sun/tools/javac/jvm/JNIWriter.java | 51 ++++---- .../com/sun/tools/javac/main/CommandLine.java | 25 ++-- .../sun/tools/javac/main/JavaCompiler.java | 5 +- .../com/sun/tools/javac/main/Main.java | 11 +- .../sun/tools/javac/nio/PathFileObject.java | 5 +- .../sun/tools/javac/sym/CreateSymbols.java | 4 +- .../com/sun/tools/javac/sym/Profiles.java | 12 +- .../javac/util/BasicDiagnosticFormatter.java | 2 +- .../com/sun/tools/javac/util/Convert.java | 8 +- .../com/sun/tools/javac/util/ListBuffer.java | 4 +- .../sun/tools/javac/util/ServiceLoader.java | 9 +- .../com/sun/tools/javadoc/ClassDocImpl.java | 10 +- .../com/sun/tools/javadoc/Comment.java | 56 +++++---- .../com/sun/tools/javadoc/DocLocale.java | 16 ++- .../com/sun/tools/javadoc/DocletInvoker.java | 11 +- .../com/sun/tools/javadoc/SeeTagImpl.java | 5 +- .../com/sun/tools/javadoc/SerializedForm.java | 15 ++- .../com/sun/tools/javah/JavahTool.java | 7 +- .../com/sun/tools/javah/TypeSignature.java | 51 ++++---- .../com/sun/tools/javap/AnnotationWriter.java | 3 +- .../com/sun/tools/javap/JavapTask.java | 3 +- .../com/sun/tools/javap/StackMapWriter.java | 4 +- .../classes/com/sun/tools/sjavac/Log.java | 13 +- .../classes/com/sun/tools/sjavac/Main.java | 5 +- .../javax/lang/model/SourceVersion.java | 14 ++- 82 files changed, 703 insertions(+), 895 deletions(-) diff --git a/langtools/src/share/classes/com/sun/tools/classfile/Attributes.java b/langtools/src/share/classes/com/sun/tools/classfile/Attributes.java index d86c39e9ee7..93205f60ee3 100644 --- a/langtools/src/share/classes/com/sun/tools/classfile/Attributes.java +++ b/langtools/src/share/classes/com/sun/tools/classfile/Attributes.java @@ -56,8 +56,7 @@ public class Attributes implements Iterable { public Attributes(ConstantPool constant_pool, Attribute[] attrs) { this.attrs = attrs; map = new HashMap(); - for (int i = 0; i < attrs.length; i++) { - Attribute attr = attrs[i]; + for (Attribute attr : attrs) { try { map.put(attr.getName(constant_pool), attr); } catch (ConstantPoolException e) { diff --git a/langtools/src/share/classes/com/sun/tools/classfile/ClassWriter.java b/langtools/src/share/classes/com/sun/tools/classfile/ClassWriter.java index 17c21c81b37..7ad5822a904 100644 --- a/langtools/src/share/classes/com/sun/tools/classfile/ClassWriter.java +++ b/langtools/src/share/classes/com/sun/tools/classfile/ClassWriter.java @@ -57,11 +57,8 @@ public class ClassWriter { * Write a ClassFile data structure to a file. */ public void write(ClassFile classFile, File f) throws IOException { - FileOutputStream f_out = new FileOutputStream(f); - try { + try (FileOutputStream f_out = new FileOutputStream(f)) { write(classFile, f_out); - } finally { - f_out.close(); } } diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AbstractExecutableMemberWriter.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AbstractExecutableMemberWriter.java index 4d8cd2c8616..037c07c149f 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AbstractExecutableMemberWriter.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AbstractExecutableMemberWriter.java @@ -268,13 +268,13 @@ public abstract class AbstractExecutableMemberWriter extends AbstractMemberWrite protected ClassDoc implementsMethodInIntfac(MethodDoc method, ClassDoc[] intfacs) { - for (int i = 0; i < intfacs.length; i++) { - MethodDoc[] methods = intfacs[i].methods(); + for (ClassDoc intf : intfacs) { + MethodDoc[] methods = intf.methods(); if (methods.length > 0) { - for (int j = 0; j < methods.length; j++) { - if (methods[j].name().equals(method.name()) && - methods[j].signature().equals(method.signature())) { - return intfacs[i]; + for (MethodDoc md : methods) { + if (md.name().equals(method.name()) && + md.signature().equals(method.signature())) { + return intf; } } } diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AbstractIndexWriter.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AbstractIndexWriter.java index 51992fbcb67..57e59e84974 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AbstractIndexWriter.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AbstractIndexWriter.java @@ -101,14 +101,13 @@ public class AbstractIndexWriter extends HtmlDocletWriter { // Display the list only if there are elements to be displayed. if (memberListSize > 0) { Content dl = new HtmlTree(HtmlTag.DL); - for (int i = 0; i < memberListSize; i++) { - Doc element = memberlist.get(i); + for (Doc element : memberlist) { if (element instanceof MemberDoc) { - addDescription((MemberDoc)element, dl); + addDescription((MemberDoc) element, dl); } else if (element instanceof ClassDoc) { - addDescription((ClassDoc)element, dl); + addDescription((ClassDoc) element, dl); } else if (element instanceof PackageDoc) { - addDescription((PackageDoc)element, dl); + addDescription((PackageDoc) element, dl); } } contentTree.addContent(dl); diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AbstractTreeWriter.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AbstractTreeWriter.java index 8cc0b61045a..a0b5ed5c892 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AbstractTreeWriter.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AbstractTreeWriter.java @@ -87,14 +87,13 @@ public abstract class AbstractTreeWriter extends HtmlDocletWriter { int size = list.size(); if (size > 0) { Content ul = new HtmlTree(HtmlTag.UL); - for (int i = 0; i < size; i++) { - ClassDoc local = list.get(i); + for (ClassDoc local : list) { HtmlTree li = new HtmlTree(HtmlTag.LI); li.addAttr(HtmlAttr.TYPE, LI_CIRCLE); addPartialInfo(local, li); addExtendsImplements(parent, local, li); addLevelInfo(local, classtree.subs(local, isEnum), - isEnum, li); // Recurse + isEnum, li); // Recurse ul.addContent(li); } contentTree.addContent(ul); @@ -135,10 +134,10 @@ public abstract class AbstractTreeWriter extends HtmlDocletWriter { if (interfaces.length > (cd.isInterface()? 1 : 0)) { Arrays.sort(interfaces); int counter = 0; - for (int i = 0; i < interfaces.length; i++) { - if (parent != interfaces[i]) { - if (! (interfaces[i].isPublic() || - Util.isLinkable(interfaces[i], configuration))) { + for (ClassDoc intf : interfaces) { + if (parent != intf) { + if (!(intf.isPublic() || + Util.isLinkable(intf, configuration))) { continue; } if (counter == 0) { @@ -153,7 +152,7 @@ public abstract class AbstractTreeWriter extends HtmlDocletWriter { contentTree.addContent(", "); } addPreQualifiedClassLink(LinkInfoImpl.Kind.TREE, - interfaces[i], contentTree); + intf, contentTree); counter++; } } diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AllClassesFrameWriter.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AllClassesFrameWriter.java index b4e6d8dcd38..3c92d90cbe8 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AllClassesFrameWriter.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AllClassesFrameWriter.java @@ -150,9 +150,9 @@ public class AllClassesFrameWriter extends HtmlDocletWriter { * @param content HtmlTree content to which the links will be added */ protected void addContents(List classlist, boolean wantFrames, - Content content) { - for (int i = 0; i < classlist.size(); i++) { - ClassDoc cd = (ClassDoc)classlist.get(i); + Content content) { + for (Doc doc : classlist) { + ClassDoc cd = (ClassDoc) doc; if (!Util.isCoreClass(cd)) { continue; } @@ -160,7 +160,7 @@ public class AllClassesFrameWriter extends HtmlDocletWriter { Content linkContent; if (wantFrames) { linkContent = getLink(new LinkInfoImpl(configuration, - LinkInfoImpl.Kind.ALL_CLASSES_FRAME, cd).label(label).target("classFrame")); + LinkInfoImpl.Kind.ALL_CLASSES_FRAME, cd).label(label).target("classFrame")); } else { linkContent = getLink(new LinkInfoImpl(configuration, LinkInfoImpl.Kind.DEFAULT, cd).label(label)); } diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ClassUseWriter.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ClassUseWriter.java index 75bc023fd99..efbc1efd18f 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ClassUseWriter.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ClassUseWriter.java @@ -159,22 +159,20 @@ public class ClassUseWriter extends SubWriterHolderWriter { public static void generate(ConfigurationImpl configuration, ClassTree classtree) { ClassUseMapper mapper = new ClassUseMapper(configuration.root, classtree); - ClassDoc[] classes = configuration.root.classes(); - for (int i = 0; i < classes.length; i++) { + for (ClassDoc aClass : configuration.root.classes()) { // If -nodeprecated option is set and the containing package is marked // as deprecated, do not generate the class-use page. We will still generate // the class-use page if the class is marked as deprecated but the containing // package is not since it could still be linked from that package-use page. if (!(configuration.nodeprecated && - Util.isDeprecated(classes[i].containingPackage()))) - ClassUseWriter.generate(configuration, mapper, classes[i]); + Util.isDeprecated(aClass.containingPackage()))) + ClassUseWriter.generate(configuration, mapper, aClass); } - PackageDoc[] pkgs = configuration.packages; - for (int i = 0; i < pkgs.length; i++) { + for (PackageDoc pkg : configuration.packages) { // If -nodeprecated option is set and the package is marked // as deprecated, do not generate the package-use page. - if (!(configuration.nodeprecated && Util.isDeprecated(pkgs[i]))) - PackageUseWriter.generate(configuration, mapper, pkgs[i]); + if (!(configuration.nodeprecated && Util.isDeprecated(pkg))) + PackageUseWriter.generate(configuration, mapper, pkg); } } @@ -183,9 +181,7 @@ public class ClassUseWriter extends SubWriterHolderWriter { List list= classMap.get(classdoc.qualifiedName()); if (list != null) { Collections.sort(list); - Iterator it = list.iterator(); - while (it.hasNext()) { - ProgramElementDoc doc = it.next(); + for (ProgramElementDoc doc : list) { PackageDoc pkg = doc.containingPackage(); pkgSet.add(pkg); List inPkg = map.get(pkg.name()); @@ -336,13 +332,12 @@ public class ClassUseWriter extends SubWriterHolderWriter { protected void addClassList(Content contentTree) throws IOException { HtmlTree ul = new HtmlTree(HtmlTag.UL); ul.addStyle(HtmlStyle.blockList); - for (Iterator it = pkgSet.iterator(); it.hasNext();) { - PackageDoc pkg = it.next(); + for (PackageDoc pkg : pkgSet) { Content li = HtmlTree.LI(HtmlStyle.blockList, getMarkerAnchor(pkg.name())); Content link = getResource("doclet.ClassUse_Uses.of.0.in.1", - getLink(new LinkInfoImpl(configuration, LinkInfoImpl.Kind.CLASS_USE_HEADER, - classdoc)), - getPackageLink(pkg, Util.getPackageName(pkg))); + getLink(new LinkInfoImpl(configuration, LinkInfoImpl.Kind.CLASS_USE_HEADER, + classdoc)), + getPackageLink(pkg, Util.getPackageName(pkg))); Content heading = HtmlTree.HEADING(HtmlConstants.SUMMARY_HEADING, link); li.addContent(heading); addClassUse(pkg, li); diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ClassWriterImpl.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ClassWriterImpl.java index 92b7224d505..a1ac09529d7 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ClassWriterImpl.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ClassWriterImpl.java @@ -273,21 +273,20 @@ public class ClassWriterImpl extends SubWriterHolderWriter Type[] implIntfacs = classDoc.interfaceTypes(); if (implIntfacs != null && implIntfacs.length > 0) { int counter = 0; - for (int i = 0; i < implIntfacs.length; i++) { - ClassDoc classDoc = implIntfacs[i].asClassDoc(); - if (! (classDoc.isPublic() || - Util.isLinkable(classDoc, configuration))) { + for (Type implType : implIntfacs) { + ClassDoc classDoc = implType.asClassDoc(); + if (!(classDoc.isPublic() || Util.isLinkable(classDoc, configuration))) { continue; } if (counter == 0) { pre.addContent(DocletConstants.NL); - pre.addContent(isInterface? "extends " : "implements "); + pre.addContent(isInterface ? "extends " : "implements "); } else { pre.addContent(", "); } Content link = getLink(new LinkInfoImpl(configuration, - LinkInfoImpl.Kind.CLASS_SIGNATURE_PARENT_NAME, - implIntfacs[i])); + LinkInfoImpl.Kind.CLASS_SIGNATURE_PARENT_NAME, + implType)); pre.addContent(link); counter++; } diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ConfigurationImpl.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ConfigurationImpl.java index ea2bdd05fca..4554603b2d8 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ConfigurationImpl.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ConfigurationImpl.java @@ -289,9 +289,9 @@ public class ConfigurationImpl extends Configuration { Map map = new HashMap(); PackageDoc pd; ClassDoc[] classes = root.classes(); - for (int i = 0; i < classes.length; i++) { - pd = classes[i].containingPackage(); - if(! map.containsKey(pd.name())) { + for (ClassDoc aClass : classes) { + pd = aClass.containingPackage(); + if (!map.containsKey(pd.name())) { map.put(pd.name(), pd); } } @@ -512,18 +512,17 @@ public class ConfigurationImpl extends Configuration { if (!nodeprecated) { return classarr[0]; } - for (int i = 0; i < classarr.length; i++) { - if (classarr[i].tags("deprecated").length == 0) { - return classarr[i]; + for (ClassDoc cd : classarr) { + if (cd.tags("deprecated").length == 0) { + return cd; } } return null; } protected boolean checkForDeprecation(RootDoc root) { - ClassDoc[] classarr = root.classes(); - for (int i = 0; i < classarr.length; i++) { - if (isGeneratedDoc(classarr[i])) { + for (ClassDoc cd : root.classes()) { + if (isGeneratedDoc(cd)) { return true; } } diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ConstructorWriterImpl.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ConstructorWriterImpl.java index 856a4827e3c..1228ac8c3b2 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ConstructorWriterImpl.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ConstructorWriterImpl.java @@ -62,9 +62,8 @@ public class ConstructorWriterImpl extends AbstractExecutableMemberWriter VisibleMemberMap visibleMemberMap = new VisibleMemberMap(classDoc, VisibleMemberMap.CONSTRUCTORS, configuration); List constructors = new ArrayList(visibleMemberMap.getMembersFor(classDoc)); - for (int i = 0; i < constructors.size(); i++) { - if ((constructors.get(i)).isProtected() || - (constructors.get(i)).isPrivate()) { + for (ProgramElementDoc constructor : constructors) { + if (constructor.isProtected() || constructor.isPrivate()) { setFoundNonPubConstructor(true); } } diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java index f3dcaf9d895..ef9bb580839 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java @@ -409,8 +409,8 @@ public class HtmlDocletWriter extends HtmlDocWriter { head.addContent(meta); } if (metakeywords != null) { - for (int i=0; i < metakeywords.length; i++) { - Content meta = HtmlTree.META("keywords", metakeywords[i]); + for (String metakeyword : metakeywords) { + Content meta = HtmlTree.META("keywords", metakeyword); head.addContent(meta); } } @@ -1013,9 +1013,8 @@ public class HtmlDocletWriter extends HtmlDocWriter { public Content getPackageLink(PackageDoc pkg, Content label) { boolean included = pkg != null && pkg.isIncluded(); if (! included) { - PackageDoc[] packages = configuration.packages; - for (int i = 0; i < packages.length; i++) { - if (packages[i].equals(pkg)) { + for (PackageDoc p : configuration.packages) { + if (p.equals(pkg)) { included = true; break; } @@ -1714,7 +1713,7 @@ public class HtmlDocletWriter extends HtmlDocWriter { //might be missing '>' character because the href has an inline tag. break; } - if (textBuff.substring(begin, end).indexOf("\"") != -1){ + if (textBuff.substring(begin, end).contains("\"")){ begin = textBuff.indexOf("\"", begin) + 1; end = textBuff.indexOf("\"", begin +1); if (begin == 0 || end == -1){ @@ -1947,15 +1946,15 @@ public class HtmlDocletWriter extends HtmlDocWriter { boolean isJava5DeclarationLocation) { List results = new ArrayList(); ContentBuilder annotation; - for (int i = 0; i < descList.length; i++) { - AnnotationTypeDoc annotationDoc = descList[i].annotationType(); + for (AnnotationDesc aDesc : descList) { + AnnotationTypeDoc annotationDoc = aDesc.annotationType(); // If an annotation is not documented, do not add it to the list. If // the annotation is of a repeatable type, and if it is not documented // and also if its container annotation is not documented, do not add it // to the list. If an annotation of a repeatable type is not documented // but its container is documented, it will be added to the list. - if (! Util.isDocumentedAnnotation(annotationDoc) && - (!isAnnotationDocumented && !isContainerDocumented)) { + if (!Util.isDocumentedAnnotation(annotationDoc) && + (!isAnnotationDocumented && !isContainerDocumented)) { continue; } /* TODO: check logic here to correctly handle declaration @@ -1966,12 +1965,12 @@ public class HtmlDocletWriter extends HtmlDocWriter { annotation = new ContentBuilder(); isAnnotationDocumented = false; LinkInfoImpl linkInfo = new LinkInfoImpl(configuration, - LinkInfoImpl.Kind.ANNOTATION, annotationDoc); - AnnotationDesc.ElementValuePair[] pairs = descList[i].elementValues(); + LinkInfoImpl.Kind.ANNOTATION, annotationDoc); + AnnotationDesc.ElementValuePair[] pairs = aDesc.elementValues(); // If the annotation is synthesized, do not print the container. - if (descList[i].isSynthesized()) { - for (int j = 0; j < pairs.length; j++) { - AnnotationValue annotationValue = pairs[j].value(); + if (aDesc.isSynthesized()) { + for (AnnotationDesc.ElementValuePair pair : pairs) { + AnnotationValue annotationValue = pair.value(); List annotationTypeValues = new ArrayList(); if (annotationValue.value() instanceof AnnotationValue[]) { AnnotationValue[] annotationArray = @@ -2008,12 +2007,12 @@ public class HtmlDocletWriter extends HtmlDocWriter { // repeatable type annotation is not documented, print the container. else { addAnnotations(annotationDoc, linkInfo, annotation, pairs, - indent, false); + indent, false); } } else { addAnnotations(annotationDoc, linkInfo, annotation, pairs, - indent, linkBreak); + indent, linkBreak); } annotation.addContent(linkBreak ? DocletConstants.NL : ""); results.add(annotation); @@ -2085,8 +2084,8 @@ public class HtmlDocletWriter extends HtmlDocWriter { */ private boolean isAnnotationArray(AnnotationDesc.ElementValuePair[] pairs) { AnnotationValue annotationValue; - for (int j = 0; j < pairs.length; j++) { - annotationValue = pairs[j].value(); + for (AnnotationDesc.ElementValuePair pair : pairs) { + annotationValue = pair.value(); if (annotationValue.value() instanceof AnnotationValue[]) { AnnotationValue[] annotationArray = (AnnotationValue[]) annotationValue.value(); diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/MethodWriterImpl.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/MethodWriterImpl.java index c3178c933fb..a63ffac25fa 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/MethodWriterImpl.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/MethodWriterImpl.java @@ -360,8 +360,7 @@ public class MethodWriterImpl extends AbstractExecutableMemberWriter ImplementedMethods implementedMethodsFinder = new ImplementedMethods(method, writer.configuration); MethodDoc[] implementedMethods = implementedMethodsFinder.build(); - for (int i = 0; i < implementedMethods.length; i++) { - MethodDoc implementedMeth = implementedMethods[i]; + for (MethodDoc implementedMeth : implementedMethods) { Type intfac = implementedMethodsFinder.getMethodHolder(implementedMeth); Content intfaclink = writer.getLink(new LinkInfoImpl( writer.configuration, LinkInfoImpl.Kind.METHOD_SPECIFIED_BY, intfac)); diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageFrameWriter.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageFrameWriter.java index 48e09440afc..3947cdee7aa 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageFrameWriter.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageFrameWriter.java @@ -167,25 +167,24 @@ public class PackageFrameWriter extends HtmlDocletWriter { boolean printedHeader = false; HtmlTree ul = new HtmlTree(HtmlTag.UL); ul.setTitle(labelContent); - for (int i = 0; i < arr.length; i++) { - if (documentedClasses != null && - !documentedClasses.contains(arr[i])) { + for (ClassDoc classDoc : arr) { + if (documentedClasses != null && !documentedClasses.contains(classDoc)) { continue; } - if (!Util.isCoreClass(arr[i]) || ! - configuration.isGeneratedDoc(arr[i])) { + if (!Util.isCoreClass(classDoc) || !configuration.isGeneratedDoc(classDoc)) { continue; } if (!printedHeader) { Content heading = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, - true, labelContent); + true, labelContent); contentTree.addContent(heading); printedHeader = true; } - Content arr_i_name = new StringContent(arr[i].name()); - if (arr[i].isInterface()) arr_i_name = HtmlTree.SPAN(HtmlStyle.interfaceName, arr_i_name); + Content arr_i_name = new StringContent(classDoc.name()); + if (classDoc.isInterface()) + arr_i_name = HtmlTree.SPAN(HtmlStyle.interfaceName, arr_i_name); Content link = getLink(new LinkInfoImpl(configuration, - LinkInfoImpl.Kind.PACKAGE_FRAME, arr[i]).label(arr_i_name).target("classFrame")); + LinkInfoImpl.Kind.PACKAGE_FRAME, classDoc).label(arr_i_name).target("classFrame")); Content li = HtmlTree.LI(link); ul.addContent(li); } diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageIndexFrameWriter.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageIndexFrameWriter.java index 9499745ed78..cb0aa51d760 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageIndexFrameWriter.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageIndexFrameWriter.java @@ -85,12 +85,12 @@ public class PackageIndexFrameWriter extends AbstractPackageIndexWriter { Content div = HtmlTree.DIV(HtmlStyle.indexContainer, heading); HtmlTree ul = new HtmlTree(HtmlTag.UL); ul.setTitle(packagesLabel); - for(int i = 0; i < packages.length; i++) { + for (PackageDoc aPackage : packages) { // Do not list the package if -nodeprecated option is set and the // package is marked as deprecated. - if (packages[i] != null && - (!(configuration.nodeprecated && Util.isDeprecated(packages[i])))) { - ul.addContent(getPackage(packages[i])); + if (aPackage != null && + (!(configuration.nodeprecated && Util.isDeprecated(aPackage)))) { + ul.addContent(getPackage(aPackage)); } } div.addContent(ul); diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageIndexWriter.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageIndexWriter.java index ffb93b73f21..1f29d0e9e2c 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageIndexWriter.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageIndexWriter.java @@ -109,13 +109,12 @@ public class PackageIndexWriter extends AbstractPackageIndexWriter { * @param body the documentation tree to which the index will be added */ protected void addIndex(Content body) { - for (int i = 0; i < groupList.size(); i++) { - String groupname = groupList.get(i); - List list = groupPackageMap.get(groupname); + for (String groupname : groupList) { + List list = groupPackageMap.get(groupname); if (list != null && list.size() > 0) { addIndexContents(list.toArray(new PackageDoc[list.size()]), - groupname, configuration.getText("doclet.Member_Table_Summary", - groupname, configuration.getText("doclet.packages")), body); + groupname, configuration.getText("doclet.Member_Table_Summary", + groupname, configuration.getText("doclet.packages")), body); } } } diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageUseWriter.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageUseWriter.java index e2fba89df37..08b2915693d 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageUseWriter.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageUseWriter.java @@ -65,16 +65,13 @@ public class PackageUseWriter extends SubWriterHolderWriter { // by examining all classes in this package, find what packages // use these classes - produce a map between using package and // used classes. - ClassDoc[] content = pkgdoc.allClasses(); - for (int i = 0; i < content.length; ++i) { - ClassDoc usedClass = content[i]; + for (ClassDoc usedClass : pkgdoc.allClasses()) { Set usingClasses = mapper.classToClass.get(usedClass.qualifiedName()); if (usingClasses != null) { - for (Iterator it = usingClasses.iterator(); it.hasNext(); ) { - ClassDoc usingClass = it.next(); + for (ClassDoc usingClass : usingClasses) { PackageDoc usingPackage = usingClass.containingPackage(); Set usedClasses = usingPackageToUsedClasses - .get(usingPackage.name()); + .get(usingPackage.name()); if (usedClasses == null) { usedClasses = new TreeSet(); usingPackageToUsedClasses.put(Util.getPackageName(usingPackage), @@ -185,9 +182,7 @@ public class PackageUseWriter extends SubWriterHolderWriter { configuration.getText("doclet.Class"), configuration.getText("doclet.Description")) }; - Iterator itp = usingPackageToUsedClasses.keySet().iterator(); - while (itp.hasNext()) { - String packageName = itp.next(); + for (String packageName : usingPackageToUsedClasses.keySet()) { PackageDoc usingPackage = configuration.root.packageNamed(packageName); HtmlTree li = new HtmlTree(HtmlTag.LI); li.addStyle(HtmlStyle.blockList); @@ -195,12 +190,12 @@ public class PackageUseWriter extends SubWriterHolderWriter { li.addContent(getMarkerAnchor(usingPackage.name())); } String tableSummary = configuration.getText("doclet.Use_Table_Summary", - configuration.getText("doclet.classes")); + configuration.getText("doclet.classes")); Content table = HtmlTree.TABLE(HtmlStyle.useSummary, 0, 3, 0, tableSummary, - getTableCaption(configuration.getResource( - "doclet.ClassUse_Classes.in.0.used.by.1", - getPackageLink(pkgdoc, Util.getPackageName(pkgdoc)), - getPackageLink(usingPackage, Util.getPackageName(usingPackage))))); + getTableCaption(configuration.getResource( + "doclet.ClassUse_Classes.in.0.used.by.1", + getPackageLink(pkgdoc, Util.getPackageName(pkgdoc)), + getPackageLink(usingPackage, Util.getPackageName(usingPackage))))); table.addContent(getSummaryTableHeader(classTableHeader, "col")); Content tbody = new HtmlTree(HtmlTag.TBODY); Iterator itc = diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ProfilePackageFrameWriter.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ProfilePackageFrameWriter.java index 4e0552b48b9..8222d69df57 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ProfilePackageFrameWriter.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ProfilePackageFrameWriter.java @@ -159,24 +159,25 @@ public class ProfilePackageFrameWriter extends HtmlDocletWriter { boolean printedHeader = false; HtmlTree ul = new HtmlTree(HtmlTag.UL); ul.setTitle(labelContent); - for (int i = 0; i < arr.length; i++) { - if (!isTypeInProfile(arr[i], profileValue)) { + for (ClassDoc classDoc : arr) { + if (!isTypeInProfile(classDoc, profileValue)) { continue; } - if (!Util.isCoreClass(arr[i]) || ! - configuration.isGeneratedDoc(arr[i])) { + if (!Util.isCoreClass(classDoc) || ! + configuration.isGeneratedDoc(classDoc)) { continue; } if (!printedHeader) { Content heading = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, - true, labelContent); + true, labelContent); contentTree.addContent(heading); printedHeader = true; } - Content arr_i_name = new StringContent(arr[i].name()); - if (arr[i].isInterface()) arr_i_name = HtmlTree.SPAN(HtmlStyle.interfaceName, arr_i_name); + Content arr_i_name = new StringContent(classDoc.name()); + if (classDoc.isInterface()) + arr_i_name = HtmlTree.SPAN(HtmlStyle.interfaceName, arr_i_name); Content link = getLink(new LinkInfoImpl(configuration, - LinkInfoImpl.Kind.PACKAGE_FRAME, arr[i]).label(arr_i_name).target("classFrame")); + LinkInfoImpl.Kind.PACKAGE_FRAME, classDoc).label(arr_i_name).target("classFrame")); Content li = HtmlTree.LI(link); ul.addContent(li); } diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ProfilePackageIndexFrameWriter.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ProfilePackageIndexFrameWriter.java index a56f33624df..98387953f95 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ProfilePackageIndexFrameWriter.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ProfilePackageIndexFrameWriter.java @@ -93,9 +93,9 @@ public class ProfilePackageIndexFrameWriter extends AbstractProfileIndexWriter { HtmlTree ul = new HtmlTree(HtmlTag.UL); ul.setTitle(packagesLabel); PackageDoc[] packages = configuration.profilePackages.get(profileName); - for (int i = 0; i < packages.length; i++) { - if ((!(configuration.nodeprecated && Util.isDeprecated(packages[i])))) { - ul.addContent(getPackage(packages[i], profileName)); + for (PackageDoc packageDoc : packages) { + if ((!(configuration.nodeprecated && Util.isDeprecated(packageDoc)))) { + ul.addContent(getPackage(packageDoc, profileName)); } } div.addContent(ul); diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/SourceToHTMLConverter.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/SourceToHTMLConverter.java index 9d528a93521..10935f2637a 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/SourceToHTMLConverter.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/SourceToHTMLConverter.java @@ -95,21 +95,19 @@ public class SourceToHTMLConverter { if (rootDoc == null || outputdir == null) { return; } - PackageDoc[] pds = rootDoc.specifiedPackages(); - for (int i = 0; i < pds.length; i++) { + for (PackageDoc pd : rootDoc.specifiedPackages()) { // If -nodeprecated option is set and the package is marked as deprecated, // do not convert the package files to HTML. - if (!(configuration.nodeprecated && Util.isDeprecated(pds[i]))) - convertPackage(pds[i], outputdir); + if (!(configuration.nodeprecated && Util.isDeprecated(pd))) + convertPackage(pd, outputdir); } - ClassDoc[] cds = rootDoc.specifiedClasses(); - for (int i = 0; i < cds.length; i++) { + for (ClassDoc cd : rootDoc.specifiedClasses()) { // If -nodeprecated option is set and the class is marked as deprecated // or the containing package is deprecated, do not convert the // package files to HTML. if (!(configuration.nodeprecated && - (Util.isDeprecated(cds[i]) || Util.isDeprecated(cds[i].containingPackage())))) - convertClass(cds[i], outputdir); + (Util.isDeprecated(cd) || Util.isDeprecated(cd.containingPackage())))) + convertClass(cd, outputdir); } } @@ -123,14 +121,13 @@ public class SourceToHTMLConverter { if (pd == null) { return; } - ClassDoc[] cds = pd.allClasses(); - for (int i = 0; i < cds.length; i++) { + for (ClassDoc cd : pd.allClasses()) { // If -nodeprecated option is set and the class is marked as deprecated, // do not convert the package files to HTML. We do not check for // containing package deprecation since it is already check in // the calling method above. - if (!(configuration.nodeprecated && Util.isDeprecated(cds[i]))) - convertClass(cds[i], outputdir); + if (!(configuration.nodeprecated && Util.isDeprecated(cd))) + convertClass(cd, outputdir); } } @@ -161,7 +158,6 @@ public class SourceToHTMLConverter { return; r = new FileReader(file); } - LineNumberReader reader = new LineNumberReader(r); int lineno = 1; String line; relativePath = DocPaths.SOURCE_OUTPUT @@ -169,14 +165,12 @@ public class SourceToHTMLConverter { .invert(); Content body = getHeader(); Content pre = new HtmlTree(HtmlTag.PRE); - try { + try (LineNumberReader reader = new LineNumberReader(r)) { while ((line = reader.readLine()) != null) { addLineNo(pre, lineno); addLine(pre, line, lineno); lineno++; } - } finally { - reader.close(); } addBlankLines(pre); Content div = HtmlTree.DIV(HtmlStyle.sourceContainer, pre); @@ -204,11 +198,8 @@ public class SourceToHTMLConverter { Content htmlDocument = new HtmlDocument(htmlDocType, htmlTree); configuration.message.notice("doclet.Generating_0", path.getPath()); DocFile df = DocFile.createFileForOutput(configuration, path); - Writer w = df.openWriter(); - try { + try (Writer w = df.openWriter()) { htmlDocument.write(w, true); - } finally { - w.close(); } } diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/SubWriterHolderWriter.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/SubWriterHolderWriter.java index f634638b874..77d481aa288 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/SubWriterHolderWriter.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/SubWriterHolderWriter.java @@ -95,8 +95,8 @@ public abstract class SubWriterHolderWriter extends HtmlDocletWriter { Content table = HtmlTree.TABLE(HtmlStyle.memberSummary, 0, 3, 0, mw.getTableSummary(), caption); table.addContent(getSummaryTableHeader(mw.getSummaryTableHeader(cd), "col")); - for (int i = 0; i < tableContents.size(); i++) { - table.addContent(tableContents.get(i)); + for (Content tableContent : tableContents) { + table.addContent(tableContent); } return table; } diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/TagletWriterImpl.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/TagletWriterImpl.java index 7beef379a8a..831c13c3962 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/TagletWriterImpl.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/TagletWriterImpl.java @@ -197,9 +197,9 @@ public class TagletWriterImpl extends TagletWriter { public Content seeTagOutput(Doc holder, SeeTag[] seeTags) { ContentBuilder body = new ContentBuilder(); if (seeTags.length > 0) { - for (int i = 0; i < seeTags.length; ++i) { + for (SeeTag seeTag : seeTags) { appendSeparatorIfNotEmpty(body); - body.addContent(htmlWriter.seeTagToContent(seeTags[i])); + body.addContent(htmlWriter.seeTagToContent(seeTag)); } } if (holder.isField() && ((FieldDoc)holder).constantValue() != null && diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlTree.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlTree.java index 8ad5fa2df83..920e82e3a07 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlTree.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlTree.java @@ -196,10 +196,8 @@ public class HtmlTree extends Content { } private static String encodeURL(String url) { - byte[] urlBytes = url.getBytes(Charset.forName("UTF-8")); StringBuilder sb = new StringBuilder(); - for (int i = 0; i < urlBytes.length; i++) { - int c = urlBytes[i]; + for (byte c : url.getBytes(Charset.forName("UTF-8"))) { if (NONENCODING_CHARS.get(c & 0xFF)) { sb.append((char) c); } else { diff --git a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/AbstractDoclet.java b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/AbstractDoclet.java index 39fde45a3da..6d33a2ff7c2 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/AbstractDoclet.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/AbstractDoclet.java @@ -188,8 +188,8 @@ public abstract class AbstractDoclet { protected void generateClassFiles(RootDoc root, ClassTree classtree) { generateClassFiles(classtree); PackageDoc[] packages = root.specifiedPackages(); - for (int i = 0; i < packages.length; i++) { - generateClassFiles(packages[i].allClasses(), classtree); + for (PackageDoc pkg : packages) { + generateClassFiles(pkg.allClasses(), classtree); } } @@ -200,10 +200,9 @@ public abstract class AbstractDoclet { */ private void generateClassFiles(ClassTree classtree) { String[] packageNames = configuration.classDocCatalog.packageNames(); - for (int packageNameIndex = 0; packageNameIndex < packageNames.length; - packageNameIndex++) { + for (String packageName : packageNames) { generateClassFiles(configuration.classDocCatalog.allClasses( - packageNames[packageNameIndex]), classtree); + packageName), classtree); } } } diff --git a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/Configuration.java b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/Configuration.java index 667cf55fa95..f2a8af8b9be 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/Configuration.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/Configuration.java @@ -339,38 +339,39 @@ public abstract class Configuration { */ public int optionLength(String option) { option = StringUtils.toLowerCase(option); - if (option.equals("-author") || - option.equals("-docfilessubdirs") || - option.equals("-javafx") || - option.equals("-keywords") || - option.equals("-linksource") || - option.equals("-nocomment") || - option.equals("-nodeprecated") || - option.equals("-nosince") || - option.equals("-notimestamp") || - option.equals("-quiet") || - option.equals("-xnodate") || - option.equals("-version")) { - return 1; - } else if (option.equals("-d") || - option.equals("-docencoding") || - option.equals("-encoding") || - option.equals("-excludedocfilessubdir") || - option.equals("-link") || - option.equals("-sourcetab") || - option.equals("-noqualifier") || - option.equals("-output") || - option.equals("-sourcepath") || - option.equals("-tag") || - option.equals("-taglet") || - option.equals("-tagletpath") || - option.equals("-xprofilespath")) { - return 2; - } else if (option.equals("-group") || - option.equals("-linkoffline")) { - return 3; - } else { - return -1; // indicate we don't know about it + switch (option) { + case "-author": + case "-docfilessubdirs": + case "-javafx": + case "-keywords": + case "-linksource": + case "-nocomment": + case "-nodeprecated": + case "-nosince": + case "-notimestamp": + case "-quiet": + case "-xnodate": + case "-version": + return 1; + case "-d": + case "-docencoding": + case "-encoding": + case "-excludedocfilessubdir": + case "-link": + case "-sourcetab": + case "-noqualifier": + case "-output": + case "-sourcepath": + case "-tag": + case "-taglet": + case "-tagletpath": + case "-xprofilespath": + return 2; + case "-group": + case "-linkoffline": + return 3; + default: + return -1; // indicate we don't know about it } } @@ -434,9 +435,8 @@ public abstract class Configuration { private void initPackageArray() { Set set = new HashSet(Arrays.asList(root.specifiedPackages())); - ClassDoc[] classes = root.specifiedClasses(); - for (int i = 0; i < classes.length; i++) { - set.add(classes[i].containingPackage()); + for (ClassDoc aClass : root.specifiedClasses()) { + set.add(aClass.containingPackage()); } ArrayList results = new ArrayList(set); Collections.sort(results); @@ -453,8 +453,7 @@ public abstract class Configuration { // Some options, specifically -link and -linkoffline, require that // the output directory has already been created: so do that first. - for (int oi = 0; oi < options.length; ++oi) { - String[] os = options[oi]; + for (String[] os : options) { String opt = StringUtils.toLowerCase(os[0]); if (opt.equals("-d")) { destDirName = addTrailingFileSep(os[1]); @@ -464,8 +463,7 @@ public abstract class Configuration { } } - for (int oi = 0; oi < options.length; ++oi) { - String[] os = options[oi]; + for (String[] os : options) { String opt = StringUtils.toLowerCase(os[0]); if (opt.equals("-docfilessubdirs")) { copydocfilesubdirs = true; @@ -588,15 +586,13 @@ public abstract class Configuration { tagletManager = tagletManager == null ? new TagletManager(nosince, showversion, showauthor, javafx, message) : tagletManager; - String[] args; - for (Iterator it = customTagStrs.iterator(); it.hasNext(); ) { - args = it.next(); + for (String[] args : customTagStrs) { if (args[0].equals("-taglet")) { tagletManager.addCustomTag(args[1], getFileManager(), tagletpath); continue; } String[] tokens = tokenize(args[1], - TagletManager.SIMPLE_TAGLET_OPT_SEPARATOR, 3); + TagletManager.SIMPLE_TAGLET_OPT_SEPARATOR, 3); if (tokens.length == 1) { String tagName = args[1]; if (tagletManager.isKnownCustomTag(tagName)) { diff --git a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ConstantsSummaryBuilder.java b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ConstantsSummaryBuilder.java index c13d4855135..57efa8d94c1 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ConstantsSummaryBuilder.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ConstantsSummaryBuilder.java @@ -151,13 +151,12 @@ public class ConstantsSummaryBuilder extends AbstractBuilder { */ public void buildContents(XMLNode node, Content contentTree) { Content contentListTree = writer.getContentsHeader(); - PackageDoc[] packages = configuration.packages; printedPackageHeaders = new HashSet(); - for (int i = 0; i < packages.length; i++) { - if (hasConstantField(packages[i]) && ! hasPrintedPackageIndex(packages[i].name())) { - writer.addLinkToPackageContent(packages[i], - parsePackageName(packages[i].name()), - printedPackageHeaders, contentListTree); + for (PackageDoc pkg : configuration.packages) { + if (hasConstantField(pkg) && !hasPrintedPackageIndex(pkg.name())) { + writer.addLinkToPackageContent(pkg, + parsePackageName(pkg.name()), + printedPackageHeaders, contentListTree); } } contentTree.addContent(writer.getContentsList(contentListTree)); @@ -170,12 +169,11 @@ public class ConstantsSummaryBuilder extends AbstractBuilder { * @param contentTree the tree to which the summaries will be added */ public void buildConstantSummaries(XMLNode node, Content contentTree) { - PackageDoc[] packages = configuration.packages; printedPackageHeaders = new HashSet(); Content summariesTree = writer.getConstantSummaries(); - for (int i = 0; i < packages.length; i++) { - if (hasConstantField(packages[i])) { - currentPackage = packages[i]; + for (PackageDoc aPackage : configuration.packages) { + if (hasConstantField(aPackage)) { + currentPackage = aPackage; //Build the documentation for the current package. buildChildren(node, summariesTree); } @@ -211,12 +209,12 @@ public class ConstantsSummaryBuilder extends AbstractBuilder { DocletConstants.DEFAULT_PACKAGE_NAME); Arrays.sort(classes); Content classConstantTree = writer.getClassConstantHeader(); - for (int i = 0; i < classes.length; i++) { - if (! classDocsWithConstFields.contains(classes[i]) || - ! classes[i].isIncluded()) { + for (ClassDoc doc : classes) { + if (!classDocsWithConstFields.contains(doc) || + !doc.isIncluded()) { continue; } - currentClass = classes[i]; + currentClass = doc; //Build the documentation for the current class. buildChildren(node, classConstantTree); } @@ -241,16 +239,13 @@ public class ConstantsSummaryBuilder extends AbstractBuilder { * @return true if the given package has constant fields to document. */ private boolean hasConstantField(PackageDoc pkg) { - ClassDoc[] classes; - if (pkg.name().length() > 0) { - classes = pkg.allClasses(); - } else { - classes = configuration.classDocCatalog.allClasses( - DocletConstants.DEFAULT_PACKAGE_NAME); - } + ClassDoc[] classes + = (pkg.name().length() > 0) + ? pkg.allClasses() + : configuration.classDocCatalog.allClasses(DocletConstants.DEFAULT_PACKAGE_NAME); boolean found = false; - for (int j = 0; j < classes.length; j++){ - if (classes[j].isIncluded() && hasConstantField(classes[j])) { + for (ClassDoc doc : classes) { + if (doc.isIncluded() && hasConstantField(doc)) { found = true; } } @@ -267,8 +262,8 @@ public class ConstantsSummaryBuilder extends AbstractBuilder { VisibleMemberMap visibleMemberMapFields = new VisibleMemberMap(classDoc, VisibleMemberMap.FIELDS, configuration); List fields = visibleMemberMapFields.getLeafClassMembers(configuration); - for (Iterator iter = fields.iterator(); iter.hasNext(); ) { - FieldDoc field = (FieldDoc) iter.next(); + for (Object f : fields) { + FieldDoc field = (FieldDoc) f; if (field.constantValueExpression() != null) { classDocsWithConstFields.add(classDoc); return true; @@ -285,8 +280,8 @@ public class ConstantsSummaryBuilder extends AbstractBuilder { */ private boolean hasPrintedPackageIndex(String pkgname) { String[] list = printedPackageHeaders.toArray(new String[] {}); - for (int i = 0; i < list.length; i++) { - if (pkgname.startsWith(list[i])) { + for (String packageHeader : list) { + if (pkgname.startsWith(packageHeader)) { return true; } } diff --git a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ConstructorBuilder.java b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ConstructorBuilder.java index c744678a112..1ed51a29629 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ConstructorBuilder.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ConstructorBuilder.java @@ -96,9 +96,8 @@ public class ConstructorBuilder extends AbstractMemberBuilder { configuration); constructors = new ArrayList(visibleMemberMap.getMembersFor(classDoc)); - for (int i = 0; i < constructors.size(); i++) { - if (constructors.get(i).isProtected() - || constructors.get(i).isPrivate()) { + for (ProgramElementDoc constructor : constructors) { + if (constructor.isProtected() || constructor.isPrivate()) { writer.setFoundNonPubConstructor(true); } } diff --git a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/MemberSummaryBuilder.java b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/MemberSummaryBuilder.java index 1b04e386b82..744e9c64fc5 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/MemberSummaryBuilder.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/MemberSummaryBuilder.java @@ -475,11 +475,9 @@ public class MemberSummaryBuilder extends AbstractMemberBuilder { */ private void buildInheritedSummary(MemberSummaryWriter writer, VisibleMemberMap visibleMemberMap, LinkedList summaryTreeList) { - for (Iterator iter = visibleMemberMap.getVisibleClassesList().iterator(); - iter.hasNext();) { - ClassDoc inhclass = iter.next(); - if (! (inhclass.isPublic() || - Util.isLinkable(inhclass, configuration))) { + for (ClassDoc inhclass : visibleMemberMap.getVisibleClassesList()) { + if (!(inhclass.isPublic() || + Util.isLinkable(inhclass, configuration))) { continue; } if (inhclass == classDoc) { @@ -493,7 +491,7 @@ public class MemberSummaryBuilder extends AbstractMemberBuilder { for (int j = 0; j < inhmembers.size(); ++j) { writer.addInheritedMemberSummary( inhclass.isPackagePrivate() && - ! Util.isLinkable(inhclass, configuration) ? + !Util.isLinkable(inhclass, configuration) ? classDoc : inhclass, inhmembers.get(j), j == 0, @@ -523,8 +521,8 @@ public class MemberSummaryBuilder extends AbstractMemberBuilder { if (!summaryTreeList.isEmpty()) { Content memberTree = writer.getMemberSummaryHeader( classDoc, memberSummaryTree); - for (int i = 0; i < summaryTreeList.size(); i++) { - memberTree.addContent(summaryTreeList.get(i)); + for (Content aSummaryTreeList : summaryTreeList) { + memberTree.addContent(aSummaryTreeList); } memberSummaryTree.addContent(writer.getMemberTree(memberTree)); } diff --git a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ProfileSummaryBuilder.java b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ProfileSummaryBuilder.java index 57cf323f4b1..6795be45db2 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ProfileSummaryBuilder.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ProfileSummaryBuilder.java @@ -166,8 +166,8 @@ public class ProfileSummaryBuilder extends AbstractBuilder { */ public void buildPackageSummary(XMLNode node, Content summaryContentTree) { PackageDoc[] packages = configuration.profilePackages.get(profile.name); - for (int i = 0; i < packages.length; i++) { - this.pkg = packages[i]; + for (PackageDoc aPackage : packages) { + this.pkg = aPackage; Content packageSummaryContentTree = profileWriter.getPackageSummaryHeader(this.pkg); buildChildren(node, packageSummaryContentTree); summaryContentTree.addContent(profileWriter.getPackageSummaryTree( diff --git a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/SerializedFormBuilder.java b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/SerializedFormBuilder.java index dfed2ef09f8..fd230365ba4 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/SerializedFormBuilder.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/SerializedFormBuilder.java @@ -162,9 +162,8 @@ public class SerializedFormBuilder extends AbstractBuilder { */ public void buildSerializedFormSummaries(XMLNode node, Content serializedTree) { Content serializedSummariesTree = writer.getSerializedSummariesHeader(); - PackageDoc[] packages = configuration.packages; - for (int i = 0; i < packages.length; i++) { - currentPackage = packages[i]; + for (PackageDoc pkg : configuration.packages) { + currentPackage = pkg; buildChildren(node, serializedSummariesTree); } serializedTree.addContent(writer.getSerializedContent( @@ -215,12 +214,12 @@ public class SerializedFormBuilder extends AbstractBuilder { Content classSerializedTree = writer.getClassSerializedHeader(); ClassDoc[] classes = currentPackage.allClasses(false); Arrays.sort(classes); - for (int j = 0; j < classes.length; j++) { - currentClass = classes[j]; + for (ClassDoc classDoc : classes) { + currentClass = classDoc; fieldWriter = writer.getSerialFieldWriter(currentClass); methodWriter = writer.getSerialMethodWriter(currentClass); - if(currentClass.isClass() && currentClass.isSerializable()) { - if(!serialClassInclude(currentClass)) { + if (currentClass.isClass() && currentClass.isSerializable()) { + if (!serialClassInclude(currentClass)) { continue; } Content classTree = writer.getClassHeader(currentClass); @@ -239,12 +238,11 @@ public class SerializedFormBuilder extends AbstractBuilder { */ public void buildSerialUIDInfo(XMLNode node, Content classTree) { Content serialUidTree = writer.getSerialUIDInfoHeader(); - FieldDoc[] fields = currentClass.fields(false); - for (int i = 0; i < fields.length; i++) { - if (fields[i].name().equals("serialVersionUID") && - fields[i].constantValueExpression() != null) { + for (FieldDoc field : currentClass.fields(false)) { + if (field.name().equals("serialVersionUID") && + field.constantValueExpression() != null) { writer.addSerialUIDInfo(SERIAL_VERSION_UID_HEADER, - fields[i].constantValueExpression(), serialUidTree); + field.constantValueExpression(), serialUidTree); break; } } @@ -569,9 +567,9 @@ public class SerializedFormBuilder extends AbstractBuilder { Tag[] serial = doc.tags("serial"); if (serial.length > 0) { String serialtext = StringUtils.toLowerCase(serial[0].text()); - if (serialtext.indexOf("exclude") >= 0) { + if (serialtext.contains("exclude")) { return false; - } else if (serialtext.indexOf("include") >= 0) { + } else if (serialtext.contains("include")) { return true; } } @@ -585,8 +583,8 @@ public class SerializedFormBuilder extends AbstractBuilder { * @return true if any of the given classes have a @serialinclude tag. */ private boolean serialClassFoundToDocument(ClassDoc[] classes) { - for (int i = 0; i < classes.length; i++) { - if (serialClassInclude(classes[i])) { + for (ClassDoc aClass : classes) { + if (serialClassInclude(aClass)) { return true; } } diff --git a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/ParamTaglet.java b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/ParamTaglet.java index 557d89cba16..7901f607f8f 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/ParamTaglet.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/ParamTaglet.java @@ -106,13 +106,13 @@ public class ParamTaglet extends BaseTaglet implements InheritableTaglet { Map rankMap = getRankMap(input.isTypeVariableParamTag ? (Object[]) ((MethodDoc)input.element).typeParameters() : (Object[]) ((MethodDoc)input.element).parameters()); - for (int i = 0; i < tags.length; i++) { - if (rankMap.containsKey(tags[i].parameterName()) && - rankMap.get(tags[i].parameterName()).equals((input.tagId))) { + for (ParamTag tag : tags) { + if (rankMap.containsKey(tag.parameterName()) && + rankMap.get(tag.parameterName()).equals((input.tagId))) { output.holder = input.element; - output.holderTag = tags[i]; + output.holderTag = tag; output.inlineTags = input.isFirstSentence ? - tags[i].firstSentenceTags() : tags[i].inlineTags(); + tag.firstSentenceTags() : tag.inlineTags(); return; } } @@ -269,27 +269,26 @@ public class ParamTaglet extends BaseTaglet implements InheritableTaglet { Set alreadyDocumented) { Content result = writer.getOutputInstance(); if (paramTags.length > 0) { - for (int i = 0; i < paramTags.length; ++i) { - ParamTag pt = paramTags[i]; + for (ParamTag pt : paramTags) { String paramName = isNonTypeParams ? - pt.parameterName() : "<" + pt.parameterName() + ">"; - if (! rankMap.containsKey(pt.parameterName())) { + pt.parameterName() : "<" + pt.parameterName() + ">"; + if (!rankMap.containsKey(pt.parameterName())) { writer.getMsgRetriever().warning(pt.position(), - isNonTypeParams ? - "doclet.Parameters_warn" : - "doclet.Type_Parameters_warn", - paramName); + isNonTypeParams ? + "doclet.Parameters_warn" : + "doclet.Type_Parameters_warn", + paramName); } String rank = rankMap.get(pt.parameterName()); if (rank != null && alreadyDocumented.contains(rank)) { writer.getMsgRetriever().warning(pt.position(), - isNonTypeParams ? - "doclet.Parameters_dup_warn" : - "doclet.Type_Parameters_dup_warn", - paramName); + isNonTypeParams ? + "doclet.Parameters_dup_warn" : + "doclet.Type_Parameters_dup_warn", + paramName); } result.addContent(processParamTag(isNonTypeParams, writer, pt, - pt.parameterName(), alreadyDocumented.size() == 0)); + pt.parameterName(), alreadyDocumented.size() == 0)); alreadyDocumented.add(rank); } } diff --git a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/SimpleTaglet.java b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/SimpleTaglet.java index b91890d2e0e..1e47459fa9c 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/SimpleTaglet.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/SimpleTaglet.java @@ -112,7 +112,7 @@ public class SimpleTaglet extends BaseTaglet implements InheritableTaglet { this.tagName = tagName; this.header = header; locations = StringUtils.toLowerCase(locations); - if (locations.indexOf(ALL) != -1 && locations.indexOf(EXCLUDED) == -1) { + if (locations.contains(ALL) && !locations.contains(EXCLUDED)) { this.locations = PACKAGE + TYPE + FIELD + METHOD + CONSTRUCTOR + OVERVIEW; } else { this.locations = locations; @@ -134,7 +134,7 @@ public class SimpleTaglet extends BaseTaglet implements InheritableTaglet { * otherwise. */ public boolean inConstructor() { - return locations.indexOf(CONSTRUCTOR) != -1 && locations.indexOf(EXCLUDED) == -1; + return locations.contains(CONSTRUCTOR) && !locations.contains(EXCLUDED); } /** @@ -145,7 +145,7 @@ public class SimpleTaglet extends BaseTaglet implements InheritableTaglet { * otherwise. */ public boolean inField() { - return locations.indexOf(FIELD) != -1 && locations.indexOf(EXCLUDED) == -1; + return locations.contains(FIELD) && !locations.contains(EXCLUDED); } /** @@ -156,7 +156,7 @@ public class SimpleTaglet extends BaseTaglet implements InheritableTaglet { * otherwise. */ public boolean inMethod() { - return locations.indexOf(METHOD) != -1 && locations.indexOf(EXCLUDED) == -1; + return locations.contains(METHOD) && !locations.contains(EXCLUDED); } /** @@ -167,7 +167,7 @@ public class SimpleTaglet extends BaseTaglet implements InheritableTaglet { * otherwise. */ public boolean inOverview() { - return locations.indexOf(OVERVIEW) != -1 && locations.indexOf(EXCLUDED) == -1; + return locations.contains(OVERVIEW) && !locations.contains(EXCLUDED); } /** @@ -178,7 +178,7 @@ public class SimpleTaglet extends BaseTaglet implements InheritableTaglet { * otherwise. */ public boolean inPackage() { - return locations.indexOf(PACKAGE) != -1 && locations.indexOf(EXCLUDED) == -1; + return locations.contains(PACKAGE) && !locations.contains(EXCLUDED); } /** @@ -189,7 +189,7 @@ public class SimpleTaglet extends BaseTaglet implements InheritableTaglet { * otherwise. */ public boolean inType() { - return locations.indexOf(TYPE) != -1&& locations.indexOf(EXCLUDED) == -1; + return locations.contains(TYPE) && !locations.contains(EXCLUDED); } /** diff --git a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/TagletManager.java b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/TagletManager.java index 43c73eaa6fd..c2f0f34ff3c 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/TagletManager.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/TagletManager.java @@ -370,37 +370,37 @@ public class TagletManager { return; } Taglet taglet; - for (int i = 0; i < tags.length; i++) { - String name = tags[i].name(); + for (Tag tag : tags) { + String name = tag.name(); if (name.length() > 0 && name.charAt(0) == '@') { name = name.substring(1, name.length()); } if (! (standardTags.contains(name) || customTags.containsKey(name))) { if (standardTagsLowercase.contains(StringUtils.toLowerCase(name))) { - message.warning(tags[i].position(), "doclet.UnknownTagLowercase", tags[i].name()); + message.warning(tag.position(), "doclet.UnknownTagLowercase", tag.name()); continue; } else { - message.warning(tags[i].position(), "doclet.UnknownTag", tags[i].name()); + message.warning(tag.position(), "doclet.UnknownTag", tag.name()); continue; } } //Check if this tag is being used in the wrong location. if ((taglet = customTags.get(name)) != null) { if (areInlineTags && ! taglet.isInlineTag()) { - printTagMisuseWarn(taglet, tags[i], "inline"); + printTagMisuseWarn(taglet, tag, "inline"); } if ((doc instanceof RootDoc) && ! taglet.inOverview()) { - printTagMisuseWarn(taglet, tags[i], "overview"); + printTagMisuseWarn(taglet, tag, "overview"); } else if ((doc instanceof PackageDoc) && ! taglet.inPackage()) { - printTagMisuseWarn(taglet, tags[i], "package"); + printTagMisuseWarn(taglet, tag, "package"); } else if ((doc instanceof ClassDoc) && ! taglet.inType()) { - printTagMisuseWarn(taglet, tags[i], "class"); + printTagMisuseWarn(taglet, tag, "class"); } else if ((doc instanceof ConstructorDoc) && ! taglet.inConstructor()) { - printTagMisuseWarn(taglet, tags[i], "constructor"); + printTagMisuseWarn(taglet, tag, "constructor"); } else if ((doc instanceof FieldDoc) && ! taglet.inField()) { - printTagMisuseWarn(taglet, tags[i], "field"); + printTagMisuseWarn(taglet, tag, "field"); } else if ((doc instanceof MethodDoc) && ! taglet.inMethod()) { - printTagMisuseWarn(taglet, tags[i], "method"); + printTagMisuseWarn(taglet, tag, "method"); } } } @@ -707,9 +707,8 @@ public class TagletManager { * Initialize lowercase version of standard Javadoc tags. */ private void initStandardTagsLowercase() { - Iterator it = standardTags.iterator(); - while (it.hasNext()) { - standardTagsLowercase.add(StringUtils.toLowerCase(it.next())); + for (String standardTag : standardTags) { + standardTagsLowercase.add(StringUtils.toLowerCase(standardTag)); } } diff --git a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/TagletWriter.java b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/TagletWriter.java index 9f77cc8915f..32dc5527e57 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/TagletWriter.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/TagletWriter.java @@ -204,30 +204,30 @@ public abstract class TagletWriter { tagletManager.checkTags(doc, doc.tags(), false); tagletManager.checkTags(doc, doc.inlineTags(), true); Content currentOutput = null; - for (int i = 0; i < taglets.length; i++) { + for (Taglet taglet : taglets) { currentOutput = null; - if (doc instanceof ClassDoc && taglets[i] instanceof ParamTaglet) { + if (doc instanceof ClassDoc && taglet instanceof ParamTaglet) { //The type parameters are documented in a special section away //from the tag info, so skip here. continue; } - if (taglets[i] instanceof DeprecatedTaglet) { + if (taglet instanceof DeprecatedTaglet) { //Deprecated information is documented "inline", not in tag info //section. continue; } try { - currentOutput = taglets[i].getTagletOutput(doc, writer); + currentOutput = taglet.getTagletOutput(doc, writer); } catch (IllegalArgumentException e) { //The taglet does not take a member as an argument. Let's try //a single tag. - Tag[] tags = doc.tags(taglets[i].getName()); + Tag[] tags = doc.tags(taglet.getName()); if (tags.length > 0) { - currentOutput = taglets[i].getTagletOutput(tags[0], writer); + currentOutput = taglet.getTagletOutput(tags[0], writer); } } if (currentOutput != null) { - tagletManager.seenCustomTag(taglets[i].getName()); + tagletManager.seenCustomTag(taglet.getName()); output.addContent(currentOutput); } } @@ -246,15 +246,15 @@ public abstract class TagletWriter { Tag holderTag, Tag inlineTag, TagletWriter tagletWriter) { Taglet[] definedTags = tagletManager.getInlineCustomTaglets(); //This is a custom inline tag. - for (int j = 0; j < definedTags.length; j++) { - if (("@"+definedTags[j].getName()).equals(inlineTag.name())) { + for (Taglet definedTag : definedTags) { + if (("@" + definedTag.getName()).equals(inlineTag.name())) { //Given a name of a seen custom tag, remove it from the // set of unseen custom tags. - tagletManager.seenCustomTag(definedTags[j].getName()); - Content output = definedTags[j].getTagletOutput( - holderTag != null && - definedTags[j].getName().equals("inheritDoc") ? - holderTag : inlineTag, tagletWriter); + tagletManager.seenCustomTag(definedTag.getName()); + Content output = definedTag.getTagletOutput( + holderTag != null && + definedTag.getName().equals("inheritDoc") ? + holderTag : inlineTag, tagletWriter); return output; } } diff --git a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/ThrowsTaglet.java b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/ThrowsTaglet.java index dfe1fbba5ee..074d1692f34 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/ThrowsTaglet.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/ThrowsTaglet.java @@ -64,19 +64,18 @@ public class ThrowsTaglet extends BaseExecutableMemberTaglet exception = input.element.containingClass().findClass(input.tagId); } - ThrowsTag[] tags = ((MethodDoc)input.element).throwsTags(); - for (int i = 0; i < tags.length; i++) { - if (input.tagId.equals(tags[i].exceptionName()) || - (tags[i].exception() != null && - (input.tagId.equals(tags[i].exception().qualifiedName())))) { + for (ThrowsTag tag : ((MethodDoc)input.element).throwsTags()) { + if (input.tagId.equals(tag.exceptionName()) || + (tag.exception() != null && + (input.tagId.equals(tag.exception().qualifiedName())))) { output.holder = input.element; - output.holderTag = tags[i]; + output.holderTag = tag; output.inlineTags = input.isFirstSentence ? - tags[i].firstSentenceTags() : tags[i].inlineTags(); - output.tagList.add(tags[i]); - } else if (exception != null && tags[i].exception() != null && - tags[i].exception().subclassOf(exception)) { - output.tagList.add(tags[i]); + tag.firstSentenceTags() : tag.inlineTags(); + output.tagList.add(tag); + } else if (exception != null && tag.exception() != null && + tag.exception().subclassOf(exception)) { + output.tagList.add(tag); } } } @@ -89,17 +88,17 @@ public class ThrowsTaglet extends BaseExecutableMemberTaglet TagletWriter writer) { Content result = writer.getOutputInstance(); //Add links to the exceptions declared but not documented. - for (int i = 0; i < declaredExceptionTypes.length; i++) { - if (declaredExceptionTypes[i].asClassDoc() != null && - ! alreadyDocumented.contains( - declaredExceptionTypes[i].asClassDoc().name()) && - ! alreadyDocumented.contains( - declaredExceptionTypes[i].asClassDoc().qualifiedName())) { + for (Type declaredExceptionType : declaredExceptionTypes) { + if (declaredExceptionType.asClassDoc() != null && + !alreadyDocumented.contains( + declaredExceptionType.asClassDoc().name()) && + !alreadyDocumented.contains( + declaredExceptionType.asClassDoc().qualifiedName())) { if (alreadyDocumented.size() == 0) { result.addContent(writer.getThrowsHeader()); } - result.addContent(writer.throwsTagOutput(declaredExceptionTypes[i])); - alreadyDocumented.add(declaredExceptionTypes[i].asClassDoc().name()); + result.addContent(writer.throwsTagOutput(declaredExceptionType)); + alreadyDocumented.add(declaredExceptionType.asClassDoc().name()); } } return result; @@ -115,14 +114,14 @@ public class ThrowsTaglet extends BaseExecutableMemberTaglet Content result = writer.getOutputInstance(); if (holder instanceof MethodDoc) { Set declaredExceptionTags = new LinkedHashSet(); - for (int j = 0; j < declaredExceptionTypes.length; j++) { + for (Type declaredExceptionType : declaredExceptionTypes) { DocFinder.Output inheritedDoc = - DocFinder.search(new DocFinder.Input((MethodDoc) holder, this, - declaredExceptionTypes[j].typeName())); + DocFinder.search(new DocFinder.Input((MethodDoc) holder, this, + declaredExceptionType.typeName())); if (inheritedDoc.tagList.size() == 0) { inheritedDoc = DocFinder.search(new DocFinder.Input( - (MethodDoc) holder, this, - declaredExceptionTypes[j].qualifiedTypeName())); + (MethodDoc) holder, this, + declaredExceptionType.qualifiedTypeName())); } declaredExceptionTags.addAll(inheritedDoc.tagList); } @@ -167,11 +166,10 @@ public class ThrowsTaglet extends BaseExecutableMemberTaglet TagletWriter writer, Set alreadyDocumented, boolean allowDups) { Content result = writer.getOutputInstance(); if (throwTags.length > 0) { - for (int i = 0; i < throwTags.length; ++i) { - ThrowsTag tt = throwTags[i]; + for (ThrowsTag tt : throwTags) { ClassDoc cd = tt.exception(); if ((!allowDups) && (alreadyDocumented.contains(tt.exceptionName()) || - (cd != null && alreadyDocumented.contains(cd.qualifiedName())))) { + (cd != null && alreadyDocumented.contains(cd.qualifiedName())))) { continue; } if (alreadyDocumented.size() == 0) { @@ -179,7 +177,7 @@ public class ThrowsTaglet extends BaseExecutableMemberTaglet } result.addContent(writer.throwsTagOutput(tt)); alreadyDocumented.add(cd != null ? - cd.qualifiedName() : tt.exceptionName()); + cd.qualifiedName() : tt.exceptionName()); } } return result; diff --git a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/ValueTaglet.java b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/ValueTaglet.java index b1d6f39b8b3..6f6ebdc66e5 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/ValueTaglet.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/ValueTaglet.java @@ -150,10 +150,9 @@ public class ValueTaglet extends BaseInlineTaglet { if (cd == null) { return null; } - FieldDoc[] fields = cd.fields(); - for (int i = 0; i < fields.length; i++) { - if (fields[i].name().equals(memberName)) { - return fields[i]; + for (FieldDoc field : cd.fields()) { + if (field.name().equals(memberName)) { + return field; } } return null; diff --git a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/ClassDocCatalog.java b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/ClassDocCatalog.java index 9e83edffc0b..4e15229008c 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/ClassDocCatalog.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/ClassDocCatalog.java @@ -100,8 +100,8 @@ import com.sun.tools.doclets.internal.toolkit.Configuration; public ClassDocCatalog (ClassDoc[] classdocs, Configuration config) { init(); this.configuration = config; - for (int i = 0; i < classdocs.length; i++) { - addClassDoc(classdocs[i]); + for (ClassDoc classdoc : classdocs) { + addClassDoc(classdoc); } } diff --git a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/ClassTree.java b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/ClassTree.java index 5936339c64f..0596f220d9c 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/ClassTree.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/ClassTree.java @@ -123,43 +123,43 @@ public class ClassTree { * @param configuration the current configuration of the doclet. */ private void buildTree(ClassDoc[] classes, Configuration configuration) { - for (int i = 0; i < classes.length; i++) { + for (ClassDoc aClass : classes) { // In the tree page (e.g overview-tree.html) do not include // information of classes which are deprecated or are a part of a // deprecated package. if (configuration.nodeprecated && - (Util.isDeprecated(classes[i]) || - Util.isDeprecated(classes[i].containingPackage()))) { + (Util.isDeprecated(aClass) || + Util.isDeprecated(aClass.containingPackage()))) { continue; } if (configuration.javafx - && classes[i].tags("treatAsPrivate").length > 0) { + && aClass.tags("treatAsPrivate").length > 0) { continue; } - if (classes[i].isEnum()) { - processType(classes[i], configuration, baseEnums, subEnums); - } else if (classes[i].isClass()) { - processType(classes[i], configuration, baseclasses, subclasses); - } else if (classes[i].isInterface()) { - processInterface(classes[i]); - List list = implementingclasses.get(classes[i]); + if (aClass.isEnum()) { + processType(aClass, configuration, baseEnums, subEnums); + } else if (aClass.isClass()) { + processType(aClass, configuration, baseclasses, subclasses); + } else if (aClass.isInterface()) { + processInterface(aClass); + List list = implementingclasses.get(aClass); if (list != null) { Collections.sort(list); } - } else if (classes[i].isAnnotationType()) { - processType(classes[i], configuration, baseAnnotationTypes, + } else if (aClass.isAnnotationType()) { + processType(aClass, configuration, baseAnnotationTypes, subAnnotationTypes); } } Collections.sort(baseinterfaces); - for (Iterator> it = subinterfaces.values().iterator(); it.hasNext(); ) { - Collections.sort(it.next()); + for (List docs : subinterfaces.values()) { + Collections.sort(docs); } - for (Iterator> it = subclasses.values().iterator(); it.hasNext(); ) { - Collections.sort(it.next()); + for (List docs : subclasses.values()) { + Collections.sort(docs); } } @@ -190,8 +190,8 @@ public class ClassTree { } } List intfacs = Util.getAllInterfaces(cd, configuration); - for (Iterator iter = intfacs.iterator(); iter.hasNext();) { - add(implementingclasses, iter.next().asClassDoc(), cd); + for (Type intfac : intfacs) { + add(implementingclasses, intfac.asClassDoc(), cd); } } @@ -206,11 +206,11 @@ public class ClassTree { private void processInterface(ClassDoc cd) { ClassDoc[] intfacs = cd.interfaces(); if (intfacs.length > 0) { - for (int i = 0; i < intfacs.length; i++) { - if (!add(subinterfaces, intfacs[i], cd)) { + for (ClassDoc intfac : intfacs) { + if (!add(subinterfaces, intfac, cd)) { return; } else { - processInterface(intfacs[i]); // Recurse + processInterface(intfac); // Recurse } } } else { @@ -341,8 +341,7 @@ public class ClassTree { for (int i = 0; i < list.size(); i++) { cd = list.get(i); List tlist = subs(cd, isEnum); - for (int j = 0; j < tlist.size(); j++) { - ClassDoc tcd = tlist.get(j); + for (ClassDoc tcd : tlist) { if (!list.contains(tcd)) { list.add(tcd); } diff --git a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/ClassUseMapper.java b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/ClassUseMapper.java index 5a579773e75..4086f1d2382 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/ClassUseMapper.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/ClassUseMapper.java @@ -186,44 +186,42 @@ public class ClassUseMapper { this.classtree = classtree; // Map subclassing, subinterfacing implementing, ... - for (Iterator it = classtree.baseclasses().iterator(); it.hasNext();) { - subclasses(it.next()); + for (ClassDoc doc : classtree.baseclasses()) { + subclasses(doc); } - for (Iterator it = classtree.baseinterfaces().iterator(); it.hasNext();) { + for (ClassDoc doc : classtree.baseinterfaces()) { // does subinterfacing as side-effect - implementingClasses(it.next()); + implementingClasses(doc); } // Map methods, fields, constructors using a class. ClassDoc[] classes = root.classes(); - for (int i = 0; i < classes.length; i++) { - PackageDoc pkg = classes[i].containingPackage(); + for (ClassDoc aClass : classes) { + PackageDoc pkg = aClass.containingPackage(); mapAnnotations(classToPackageAnnotations, pkg, pkg); - ClassDoc cd = classes[i]; + ClassDoc cd = aClass; mapTypeParameters(classToClassTypeParam, cd, cd); mapAnnotations(classToClassAnnotations, cd, cd); FieldDoc[] fields = cd.fields(); - for (int j = 0; j < fields.length; j++) { - FieldDoc fd = fields[j]; + for (FieldDoc fd : fields) { mapTypeParameters(classToFieldDocTypeParam, fd, fd); mapAnnotations(annotationToFieldDoc, fd, fd); - if (! fd.type().isPrimitive()) { + if (!fd.type().isPrimitive()) { add(classToField, fd.type().asClassDoc(), fd); } } ConstructorDoc[] cons = cd.constructors(); - for (int j = 0; j < cons.length; j++) { - mapAnnotations(classToConstructorAnnotations, cons[j], cons[j]); - mapExecutable(cons[j]); + for (ConstructorDoc con : cons) { + mapAnnotations(classToConstructorAnnotations, con, con); + mapExecutable(con); } MethodDoc[] meths = cd.methods(); - for (int j = 0; j < meths.length; j++) { - MethodDoc md = meths[j]; + for (MethodDoc md : meths) { mapExecutable(md); mapTypeParameters(classToExecMemberDocTypeParam, md, md); mapAnnotations(classToExecMemberDocAnnotations, md, md); - if (! (md.returnType().isPrimitive() || md.returnType() instanceof TypeVariable)) { + if (!(md.returnType().isPrimitive() || md.returnType() instanceof TypeVariable)) { mapTypeParameters(classToExecMemberDocReturnTypeParam, - md.returnType(), md); + md.returnType(), md); add(classToMethodReturn, md.returnType().asClassDoc(), md); } } @@ -240,8 +238,8 @@ public class ClassUseMapper { List subs = classtree.subclasses(cd); if (subs != null) { ret.addAll(subs); - for (Iterator it = subs.iterator(); it.hasNext();) { - ret.addAll(subclasses(it.next())); + for (ClassDoc sub : subs) { + ret.addAll(subclasses(sub)); } } addAll(classToSubclass, cd, ret); @@ -259,8 +257,8 @@ public class ClassUseMapper { List subs = classtree.subinterfaces(cd); if (subs != null) { ret.addAll(subs); - for (Iterator it = subs.iterator(); it.hasNext();) { - ret.addAll(subinterfaces(it.next())); + for (ClassDoc sub : subs) { + ret.addAll(subinterfaces(sub)); } } addAll(classToSubinterface, cd, ret); @@ -281,12 +279,12 @@ public class ClassUseMapper { List impl = classtree.implementingclasses(cd); if (impl != null) { ret.addAll(impl); - for (Iterator it = impl.iterator(); it.hasNext();) { - ret.addAll(subclasses(it.next())); + for (ClassDoc anImpl : impl) { + ret.addAll(subclasses(anImpl)); } } - for (Iterator it = subinterfaces(cd).iterator(); it.hasNext();) { - ret.addAll(implementingClasses(it.next())); + for (ClassDoc doc : subinterfaces(cd)) { + ret.addAll(implementingClasses(doc)); } addAll(classToImplementingClass, cd, ret); } @@ -298,32 +296,30 @@ public class ClassUseMapper { * inverse mapped. */ private void mapExecutable(ExecutableMemberDoc em) { - Parameter[] params = em.parameters(); boolean isConstructor = em.isConstructor(); List classArgs = new ArrayList(); - for (int k = 0; k < params.length; k++) { - Type pcd = params[k].type(); + for (Parameter param : em.parameters()) { + Type pcd = param.type(); // primitives don't get mapped, also avoid dups - if ((! params[k].type().isPrimitive()) && - ! classArgs.contains(pcd) && - ! (pcd instanceof TypeVariable)) { - add(isConstructor? classToConstructorArgs :classToMethodArgs, - pcd.asClassDoc(), em); + if ((!param.type().isPrimitive()) && + !classArgs.contains(pcd) && + !(pcd instanceof TypeVariable)) { + add(isConstructor ? classToConstructorArgs : classToMethodArgs, + pcd.asClassDoc(), em); classArgs.add(pcd); - mapTypeParameters(isConstructor? - classToConstructorDocArgTypeParam : classToExecMemberDocArgTypeParam, - pcd, em); + mapTypeParameters(isConstructor ? + classToConstructorDocArgTypeParam : classToExecMemberDocArgTypeParam, + pcd, em); } mapAnnotations( - isConstructor ? + isConstructor ? classToConstructorParamAnnotation : classToExecMemberDocParamAnnotation, - params[k], em); + param, em); } - ClassDoc[] thr = em.thrownExceptions(); - for (int k = 0; k < thr.length; k++) { - add(isConstructor? classToConstructorThrows : classToMethodThrows, - thr[k], em); + for (ClassDoc anException : em.thrownExceptions()) { + add(isConstructor ? classToConstructorThrows : classToMethodThrows, + anException, em); } } @@ -378,8 +374,7 @@ public class ClassUseMapper { Set pkgSet = packageSet(cd); Set clsSet = classSet(cd); // add ref's package to package map and class map - for (Iterator it = refs.iterator(); it.hasNext();) { - ClassDoc cls = it.next(); + for (ClassDoc cls : refs) { pkgSet.add(cls.containingPackage()); clsSet.add(cls); @@ -400,19 +395,16 @@ public class ClassUseMapper { if (doc instanceof ClassDoc) { typeVariables = ((ClassDoc) doc).typeParameters(); } else if (doc instanceof WildcardType) { - Type[] extendsBounds = ((WildcardType) doc).extendsBounds(); - for (int k = 0; k < extendsBounds.length; k++) { - addTypeParameterToMap(map, extendsBounds[k], holder); + for (Type extendsBound : ((WildcardType) doc).extendsBounds()) { + addTypeParameterToMap(map, extendsBound, holder); } - Type[] superBounds = ((WildcardType) doc).superBounds(); - for (int k = 0; k < superBounds.length; k++) { - addTypeParameterToMap(map, superBounds[k], holder); + for (Type superBound : ((WildcardType) doc).superBounds()) { + addTypeParameterToMap(map, superBound, holder); } return; } else if (doc instanceof ParameterizedType) { - Type[] typeArguments = ((ParameterizedType) doc).typeArguments(); - for (int k = 0; k < typeArguments.length; k++) { - addTypeParameterToMap(map, typeArguments[k], holder); + for (Type typeArgument : ((ParameterizedType) doc).typeArguments()) { + addTypeParameterToMap(map, typeArgument, holder); } return; } else if (doc instanceof ExecutableMemberDoc) { @@ -424,10 +416,9 @@ public class ClassUseMapper { } else { return; } - for (int i = 0; i < typeVariables.length; i++) { - Type[] bounds = typeVariables[i].bounds(); - for (int j = 0; j < bounds.length; j++) { - addTypeParameterToMap(map, bounds[j], holder); + for (TypeVariable typeVariable : typeVariables) { + for (Type bound : typeVariable.bounds()) { + addTypeParameterToMap(map, bound, holder); } } } @@ -454,8 +445,8 @@ public class ClassUseMapper { } else { throw new DocletAbortException("should not happen"); } - for (int i = 0; i < annotations.length; i++) { - AnnotationTypeDoc annotationDoc = annotations[i].annotationType(); + for (AnnotationDesc annotation : annotations) { + AnnotationTypeDoc annotationDoc = annotation.annotationType(); if (isPackage) refList(map, annotationDoc).add(holder); else @@ -474,10 +465,8 @@ public class ClassUseMapper { */ private void mapAnnotations(Map> map, PackageDoc doc, T holder) { - AnnotationDesc[] annotations; - annotations = doc.annotations(); - for (int i = 0; i < annotations.length; i++) { - AnnotationTypeDoc annotationDoc = annotations[i].annotationType(); + for (AnnotationDesc annotation : doc.annotations()) { + AnnotationTypeDoc annotationDoc = annotation.annotationType(); refList(map, annotationDoc).add(holder); } } diff --git a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/DeprecatedAPIListBuilder.java b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/DeprecatedAPIListBuilder.java index 8f8a096e019..f0ccc98c146 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/DeprecatedAPIListBuilder.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/DeprecatedAPIListBuilder.java @@ -85,16 +85,12 @@ public class DeprecatedAPIListBuilder { */ private void buildDeprecatedAPIInfo(Configuration configuration) { PackageDoc[] packages = configuration.packages; - PackageDoc pkg; - for (int c = 0; c < packages.length; c++) { - pkg = packages[c]; + for (PackageDoc pkg : packages) { if (Util.isDeprecated(pkg)) { getList(PACKAGE).add(pkg); } } - ClassDoc[] classes = configuration.root.classes(); - for (int i = 0; i < classes.length; i++) { - ClassDoc cd = classes[i]; + for (ClassDoc cd : configuration.root.classes()) { if (Util.isDeprecated(cd)) { if (cd.isOrdinaryClass()) { getList(CLASS).add(cd); @@ -118,7 +114,7 @@ public class DeprecatedAPIListBuilder { } if (cd.isAnnotationType()) { composeDeprecatedList(getList(ANNOTATION_TYPE_MEMBER), - ((AnnotationTypeDoc) cd).elements()); + ((AnnotationTypeDoc) cd).elements()); } } sortDeprecatedLists(); @@ -131,9 +127,9 @@ public class DeprecatedAPIListBuilder { * @param members members to be added in the list. */ private void composeDeprecatedList(List list, MemberDoc[] members) { - for (int i = 0; i < members.length; i++) { - if (Util.isDeprecated(members[i])) { - list.add(members[i]); + for (MemberDoc member : members) { + if (Util.isDeprecated(member)) { + list.add(member); } } } diff --git a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/DocFile.java b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/DocFile.java index 17f9f0b1375..7bc33a8d916 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/DocFile.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/DocFile.java @@ -132,19 +132,15 @@ public abstract class DocFile { * Copy the contents of another file directly to this file. */ public void copyFile(DocFile fromFile) throws IOException { - InputStream input = fromFile.openInputStream(); - OutputStream output = openOutputStream(); - try { + try (OutputStream output = openOutputStream(); + InputStream input = fromFile.openInputStream()) { byte[] bytearr = new byte[1024]; int len; while ((len = input.read(bytearr)) != -1) { output.write(bytearr, 0, len); } - } catch (FileNotFoundException exc) { - } catch (SecurityException exc) { - } finally { - input.close(); - output.close(); + } + catch (FileNotFoundException | SecurityException exc) { } } @@ -165,35 +161,26 @@ public abstract class DocFile { if (in == null) return; - OutputStream out = openOutputStream(); - try { + try (OutputStream out = openOutputStream()) { if (!replaceNewLine) { byte[] buf = new byte[2048]; int n; - while((n = in.read(buf))>0) out.write(buf,0,n); + while ((n = in.read(buf)) > 0) + out.write(buf, 0, n); } else { - BufferedReader reader = new BufferedReader(new InputStreamReader(in)); - BufferedWriter writer; - if (configuration.docencoding == null) { - writer = new BufferedWriter(new OutputStreamWriter(out)); - } else { - writer = new BufferedWriter(new OutputStreamWriter(out, - configuration.docencoding)); - } - try { + try (BufferedReader reader = new BufferedReader(new InputStreamReader(in)); + BufferedWriter writer = new BufferedWriter(configuration.docencoding == null + ? new OutputStreamWriter(out) + : new OutputStreamWriter(out, configuration.docencoding))) { String line; while ((line = reader.readLine()) != null) { writer.write(line); writer.write(DocletConstants.NL); } - } finally { - reader.close(); - writer.close(); } } } finally { in.close(); - out.close(); } } catch (IOException e) { e.printStackTrace(System.err); diff --git a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/DocFinder.java b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/DocFinder.java index d68b09d1d8d..b7136d51e88 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/DocFinder.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/DocFinder.java @@ -220,8 +220,8 @@ public class DocFinder { // appropriate element here. MethodDoc[] implementedMethods = (new ImplementedMethods((MethodDoc) input.element, null)).build(false); - for (int i = 0; i < implementedMethods.length; i++) { - inheritedSearchInput.element = implementedMethods[i]; + for (MethodDoc implementedMethod : implementedMethods) { + inheritedSearchInput.element = implementedMethod; output = search(inheritedSearchInput); output.isValidInheritDocTag = true; if (output.inlineTags.length > 0) { diff --git a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/Extern.java b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/Extern.java index 0306f7b38c0..6854151d586 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/Extern.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/Extern.java @@ -234,11 +234,10 @@ public class Extern { try { URL link = pkglisturlpath.toURI().resolve(DocPaths.PACKAGE_LIST.getPath()).toURL(); readPackageList(link.openStream(), urlpath, false); - } catch (URISyntaxException exc) { + } catch (URISyntaxException | MalformedURLException exc) { throw new Fault(configuration.getText("doclet.MalformedURL", pkglisturlpath.toString()), exc); - } catch (MalformedURLException exc) { - throw new Fault(configuration.getText("doclet.MalformedURL", pkglisturlpath.toString()), exc); - } catch (IOException exc) { + } + catch (IOException exc) { throw new Fault(configuration.getText("doclet.URL_error", pkglisturlpath.toString()), exc); } } diff --git a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/Group.java b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/Group.java index be5284e91da..ca5c12a255e 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/Group.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/Group.java @@ -185,8 +185,7 @@ public class Group { if (!groupList.contains(defaultGroupName)) { groupList.add(defaultGroupName); } - for (int i = 0; i < packages.length; i++) { - PackageDoc pkg = packages[i]; + for (PackageDoc pkg : packages) { String pkgName = pkg.name(); String groupName = pkgNameGroupMap.get(pkgName); // if this package is not explicitly assigned to a group, @@ -212,8 +211,7 @@ public class Group { * expression list. */ String regExpGroupName(String pkgName) { - for (int j = 0; j < sortedRegExpList.size(); j++) { - String regexp = sortedRegExpList.get(j); + for (String regexp : sortedRegExpList) { if (pkgName.startsWith(regexp)) { return regExpGroupMap.get(regexp); } diff --git a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/ImplementedMethods.java b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/ImplementedMethods.java index c2bfc1359e6..cdf8710d9ad 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/ImplementedMethods.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/ImplementedMethods.java @@ -89,8 +89,7 @@ public class ImplementedMethods { */ private void buildImplementedMethodList(boolean sort) { List intfacs = Util.getAllInterfaces(classdoc, configuration, sort); - for (Iterator iter = intfacs.iterator(); iter.hasNext(); ) { - Type interfaceType = iter.next(); + for (Type interfaceType : intfacs) { MethodDoc found = Util.findMethod(interfaceType.asClassDoc(), method); if (found != null) { removeOverriddenMethod(found); @@ -132,8 +131,7 @@ public class ImplementedMethods { */ private boolean overridingMethodFound(MethodDoc method) { ClassDoc containingClass = method.containingClass(); - for (int i = 0; i < methlist.size(); i++) { - MethodDoc listmethod = methlist.get(i); + for (MethodDoc listmethod : methlist) { if (containingClass == listmethod.containingClass()) { // it's the same method. return true; diff --git a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/IndexBuilder.java b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/IndexBuilder.java index 8976b558723..c931b706a22 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/IndexBuilder.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/IndexBuilder.java @@ -132,8 +132,8 @@ public class IndexBuilder { * sort each element which is a list. */ protected void sortIndexMap() { - for (Iterator> it = indexmap.values().iterator(); it.hasNext(); ) { - Collections.sort(it.next(), new DocComparator()); + for (List docs : indexmap.values()) { + Collections.sort(docs, new DocComparator()); } } @@ -150,9 +150,8 @@ public class IndexBuilder { if (!classesOnly) { if (packages.length == 0) { Set set = new HashSet(); - PackageDoc pd; - for (int i = 0; i < classes.length; i++) { - pd = classes[i].containingPackage(); + for (ClassDoc aClass : classes) { + PackageDoc pd = aClass.containingPackage(); if (pd != null && pd.name().length() > 0) { set.add(pd); } @@ -164,9 +163,9 @@ public class IndexBuilder { } adjustIndexMap(classes); if (!classesOnly) { - for (int i = 0; i < classes.length; i++) { - if (shouldAddToIndexMap(classes[i])) { - putMembersInIndexMap(classes[i]); + for (ClassDoc aClass : classes) { + if (shouldAddToIndexMap(aClass)) { + putMembersInIndexMap(aClass); } } } @@ -194,19 +193,19 @@ public class IndexBuilder { * @param elements Array of members. */ protected void adjustIndexMap(Doc[] elements) { - for (int i = 0; i < elements.length; i++) { - if (shouldAddToIndexMap(elements[i])) { - String name = elements[i].name(); - char ch = (name.length()==0)? - '*' : - Character.toUpperCase(name.charAt(0)); - Character unicode = new Character(ch); + for (Doc element : elements) { + if (shouldAddToIndexMap(element)) { + String name = element.name(); + char ch = (name.length() == 0) ? + '*' : + Character.toUpperCase(name.charAt(0)); + Character unicode = ch; List list = indexmap.get(unicode); if (list == null) { list = new ArrayList(); indexmap.put(unicode, list); } - list.add(elements[i]); + list.add(element); } } } diff --git a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/MetaKeywords.java b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/MetaKeywords.java index 18358ec7036..be1d60142c8 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/MetaKeywords.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/MetaKeywords.java @@ -147,10 +147,9 @@ public class MetaKeywords { protected ArrayList getMemberKeywords(MemberDoc[] memberdocs) { ArrayList results = new ArrayList(); String membername; - for (int i=0; i < memberdocs.length; i++) { - membername = memberdocs[i].name() - + (memberdocs[i].isMethod() ? "()" : ""); - if ( ! results.contains(membername) ) { + for (MemberDoc memberdoc : memberdocs) { + membername = memberdoc.name() + (memberdoc.isMethod() ? "()" : ""); + if (!results.contains(membername)) { results.add(membername); } } diff --git a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/MethodFinder.java b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/MethodFinder.java index 68e082701a1..bb0b53727a5 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/MethodFinder.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/MethodFinder.java @@ -62,9 +62,9 @@ public abstract class MethodFinder { public MethodDoc searchInterfaces(ClassDoc cd, MethodDoc method) { MethodDoc[] implementedMethods = (new ImplementedMethods(method, null)).build(); - for (int i = 0; i < implementedMethods.length; i++) { - if (isCorrectMethod(implementedMethods[i])) { - return implementedMethods[i]; + for (MethodDoc implementedMethod : implementedMethods) { + if (isCorrectMethod(implementedMethod)) { + return implementedMethod; } } return null; diff --git a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/PackageListWriter.java b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/PackageListWriter.java index b5d604081f4..efe3357e604 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/PackageListWriter.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/PackageListWriter.java @@ -76,17 +76,16 @@ public class PackageListWriter extends PrintWriter { } protected void generatePackageListFile(RootDoc root) { - PackageDoc[] packages = configuration.packages; ArrayList names = new ArrayList(); - for (int i = 0; i < packages.length; i++) { + for (PackageDoc pkg : configuration.packages) { // if the -nodeprecated option is set and the package is marked as // deprecated, do not include it in the packages list. - if (!(configuration.nodeprecated && Util.isDeprecated(packages[i]))) - names.add(packages[i].name()); + if (!(configuration.nodeprecated && Util.isDeprecated(pkg))) + names.add(pkg.name()); } Collections.sort(names); - for (int i = 0; i < names.size(); i++) { - println(names.get(i)); + for (String name : names) { + println(name); } } } diff --git a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/Util.java b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/Util.java index 1522cdf91f1..f10d457d746 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/Util.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/Util.java @@ -26,7 +26,9 @@ package com.sun.tools.doclets.internal.toolkit.util; import java.io.*; +import java.lang.annotation.Documented; import java.lang.annotation.ElementType; +import java.lang.annotation.Target; import java.util.*; import javax.tools.StandardLocation; @@ -75,9 +77,9 @@ public class Util { public static List excludeDeprecatedMembersAsList( ProgramElementDoc[] members) { List list = new ArrayList(); - for (int i = 0; i < members.length; i++) { - if (members[i].tags("deprecated").length == 0) { - list.add(members[i]); + for (ProgramElementDoc member : members) { + if (member.tags("deprecated").length == 0) { + list.add(member); } } Collections.sort(list); @@ -102,8 +104,8 @@ public class Util { * @return boolean True if non-public member found, false otherwise. */ public static boolean nonPublicMemberFound(ProgramElementDoc[] members) { - for (int i = 0; i < members.length; i++) { - if (!members[i].isPublic()) { + for (ProgramElementDoc member : members) { + if (!member.isPublic()) { return true; } } @@ -119,9 +121,9 @@ public class Util { */ public static MethodDoc findMethod(ClassDoc cd, MethodDoc method) { MethodDoc[] methods = cd.methods(); - for (int i = 0; i < methods.length; i++) { - if (executableMembersEqual(method, methods[i])) { - return methods[i]; + for (MethodDoc m : methods) { + if (executableMembersEqual(method, m)) { + return m; } } @@ -241,9 +243,7 @@ public class Util { first = false; } - } catch (SecurityException exc) { - throw new DocletAbortException(exc); - } catch (IOException exc) { + } catch (SecurityException | IOException exc) { throw new DocletAbortException(exc); } } @@ -287,18 +287,15 @@ public class Util { superType = type.asClassDoc().superclassType(); } - for (int i = 0; i < interfaceTypes.length; i++) { - Type interfaceType = interfaceTypes[i]; + for (Type interfaceType : interfaceTypes) { ClassDoc interfaceClassDoc = interfaceType.asClassDoc(); - if (! (interfaceClassDoc.isPublic() || - (configuration == null || - isLinkable(interfaceClassDoc, configuration)))) { + if (!(interfaceClassDoc.isPublic() || + (configuration == null || + isLinkable(interfaceClassDoc, configuration)))) { continue; } results.put(interfaceClassDoc, interfaceType); - List superInterfaces = getAllInterfaces(interfaceType, configuration, sort); - for (Iterator iter = superInterfaces.iterator(); iter.hasNext(); ) { - Type t = iter.next(); + for (Type t : getAllInterfaces(interfaceType, configuration, sort)) { results.put(t.asClassDoc(), t); } } @@ -351,20 +348,18 @@ public class Util { private static void addAllInterfaceTypes(Map results, Type type, Type[] interfaceTypes, boolean raw, Configuration configuration) { - for (int i = 0; i < interfaceTypes.length; i++) { - Type interfaceType = interfaceTypes[i]; + for (Type interfaceType : interfaceTypes) { ClassDoc interfaceClassDoc = interfaceType.asClassDoc(); - if (! (interfaceClassDoc.isPublic() || - (configuration != null && - isLinkable(interfaceClassDoc, configuration)))) { + if (!(interfaceClassDoc.isPublic() || + (configuration != null && + isLinkable(interfaceClassDoc, configuration)))) { continue; } if (raw) interfaceType = interfaceType.asClassDoc(); results.put(interfaceClassDoc, interfaceType); List superInterfaces = getAllInterfaces(interfaceType, configuration); - for (Iterator iter = superInterfaces.iterator(); iter.hasNext(); ) { - Type superInterface = iter.next(); + for (Type superInterface : superInterfaces) { results.put(superInterface.asClassDoc(), superInterface); } } @@ -429,10 +424,9 @@ public class Util { * @return true return true if it should be documented and false otherwise. */ public static boolean isDocumentedAnnotation(AnnotationTypeDoc annotationDoc) { - AnnotationDesc[] annotationDescList = annotationDoc.annotations(); - for (int i = 0; i < annotationDescList.length; i++) { - if (annotationDescList[i].annotationType().qualifiedName().equals( - java.lang.annotation.Documented.class.getName())){ + for (AnnotationDesc anno : annotationDoc.annotations()) { + if (anno.annotationType().qualifiedName().equals( + Documented.class.getName())) { return true; } } @@ -448,13 +442,12 @@ public class Util { || !(elems[0].value().value() instanceof AnnotationValue[])) return true; // error recovery - AnnotationValue[] values = (AnnotationValue[])elems[0].value().value(); - for (int i = 0; i < values.length; i++) { - Object value = values[i].value(); + for (AnnotationValue aValue : (AnnotationValue[])elems[0].value().value()) { + Object value = aValue.value(); if (!(value instanceof FieldDoc)) return true; // error recovery - FieldDoc eValue = (FieldDoc)value; + FieldDoc eValue = (FieldDoc) value; if (Util.isJava5DeclarationElementType(eValue)) { return true; } @@ -480,10 +473,10 @@ public class Util { // Annotations with no target are treated as declaration as well if (annotationDescList.length==0) return true; - for (int i = 0; i < annotationDescList.length; i++) { - if (annotationDescList[i].annotationType().qualifiedName().equals( - java.lang.annotation.Target.class.getName())) { - if (isDeclarationTarget(annotationDescList[i])) + for (AnnotationDesc anno : annotationDescList) { + if (anno.annotationType().qualifiedName().equals( + Target.class.getName())) { + if (isDeclarationTarget(anno)) return true; } } @@ -602,7 +595,7 @@ public class Util { * @return the text with all tabs expanded */ public static String replaceTabs(Configuration configuration, String text) { - if (text.indexOf("\t") == -1) + if (!text.contains("\t")) return text; final int tabLength = configuration.sourcetab; @@ -664,32 +657,30 @@ public class Util { */ public static void setEnumDocumentation(Configuration configuration, ClassDoc classDoc) { - MethodDoc[] methods = classDoc.methods(); - for (int j = 0; j < methods.length; j++) { - MethodDoc currentMethod = methods[j]; + for (MethodDoc currentMethod : classDoc.methods()) { if (currentMethod.name().equals("values") && - currentMethod.parameters().length == 0) { + currentMethod.parameters().length == 0) { StringBuilder sb = new StringBuilder(); sb.append(configuration.getText("doclet.enum_values_doc.main", classDoc.name())); sb.append("\n@return "); sb.append(configuration.getText("doclet.enum_values_doc.return")); currentMethod.setRawCommentText(sb.toString()); } else if (currentMethod.name().equals("valueOf") && - currentMethod.parameters().length == 1) { + currentMethod.parameters().length == 1) { Type paramType = currentMethod.parameters()[0].type(); if (paramType != null && - paramType.qualifiedTypeName().equals(String.class.getName())) { - StringBuilder sb = new StringBuilder(); - sb.append(configuration.getText("doclet.enum_valueof_doc.main", classDoc.name())); - sb.append("\n@param name "); - sb.append(configuration.getText("doclet.enum_valueof_doc.param_name")); - sb.append("\n@return "); - sb.append(configuration.getText("doclet.enum_valueof_doc.return")); - sb.append("\n@throws IllegalArgumentException "); - sb.append(configuration.getText("doclet.enum_valueof_doc.throws_ila")); - sb.append("\n@throws NullPointerException "); - sb.append(configuration.getText("doclet.enum_valueof_doc.throws_npe")); - currentMethod.setRawCommentText(sb.toString()); + paramType.qualifiedTypeName().equals(String.class.getName())) { + StringBuilder sb = new StringBuilder(); + sb.append(configuration.getText("doclet.enum_valueof_doc.main", classDoc.name())); + sb.append("\n@param name "); + sb.append(configuration.getText("doclet.enum_valueof_doc.param_name")); + sb.append("\n@return "); + sb.append(configuration.getText("doclet.enum_valueof_doc.return")); + sb.append("\n@throws IllegalArgumentException "); + sb.append(configuration.getText("doclet.enum_valueof_doc.throws_ila")); + sb.append("\n@throws NullPointerException "); + sb.append(configuration.getText("doclet.enum_valueof_doc.throws_npe")); + currentMethod.setRawCommentText(sb.toString()); } } } @@ -710,9 +701,9 @@ public class Util { annotationDescList = ((PackageDoc)doc).annotations(); else annotationDescList = ((ProgramElementDoc)doc).annotations(); - for (int i = 0; i < annotationDescList.length; i++) { - if (annotationDescList[i].annotationType().qualifiedName().equals( - java.lang.Deprecated.class.getName())){ + for (AnnotationDesc anno : annotationDescList) { + if (anno.annotationType().qualifiedName().equals( + Deprecated.class.getName())) { return true; } } diff --git a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/VisibleMemberMap.java b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/VisibleMemberMap.java index 72cc196d8a1..edff1acaeae 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/VisibleMemberMap.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/VisibleMemberMap.java @@ -173,8 +173,7 @@ public class VisibleMemberMap { */ private List getInheritedPackagePrivateMethods(Configuration configuration) { List results = new ArrayList(); - for (Iterator iter = visibleClasses.iterator(); iter.hasNext(); ) { - ClassDoc currentClass = iter.next(); + for (ClassDoc currentClass : visibleClasses) { if (currentClass != classdoc && currentClass.isPackagePrivate() && !Util.isLinkable(currentClass, configuration)) { @@ -221,11 +220,11 @@ public class VisibleMemberMap { private void sort(List list) { List classes = new ArrayList(); List interfaces = new ArrayList(); - for (int i = 0; i < list.size(); i++) { - ClassDoc cd = list.get(i); + for (ClassDoc cd : list) { if (cd.isClass()) { classes.add(cd); - } else { + } + else { interfaces.add(cd); } } @@ -235,23 +234,23 @@ public class VisibleMemberMap { } private void fillMemberLevelMap(List list, String level) { - for (int i = 0; i < list.size(); i++) { - Object key = getMemberKey(list.get(i)); - Map memberLevelMap = memberNameMap.get(key); + for (ProgramElementDoc element : list) { + Object key = getMemberKey(element); + Map memberLevelMap = memberNameMap.get(key); if (memberLevelMap == null) { - memberLevelMap = new HashMap(); + memberLevelMap = new HashMap(); memberNameMap.put(key, memberLevelMap); } - memberLevelMap.put(list.get(i), level); + memberLevelMap.put(element, level); } } private void purgeMemberLevelMap(List list, String level) { - for (int i = 0; i < list.size(); i++) { - Object key = getMemberKey(list.get(i)); + for (ProgramElementDoc element : list) { + Object key = getMemberKey(element); Map memberLevelMap = memberNameMap.get(key); - if (level.equals(memberLevelMap.get(list.get(i)))) - memberLevelMap.remove(list.get(i)); + if (level.equals(memberLevelMap.get(element))) + memberLevelMap.remove(element); } } @@ -273,11 +272,10 @@ public class VisibleMemberMap { } public boolean isEqual(MethodDoc member) { - for (Iterator iter = members.iterator(); iter.hasNext(); ) { - MethodDoc member2 = (MethodDoc) iter.next(); - if (Util.executableMembersEqual(member, member2)) { + for (ProgramElementDoc element : members) { + if (Util.executableMembersEqual(member, (MethodDoc) element)) { members.add(member); - return true; + return true; } } return false; @@ -345,9 +343,9 @@ public class VisibleMemberMap { private void mapClass() { addMembers(mappingClass); ClassDoc[] interfaces = mappingClass.interfaces(); - for (int i = 0; i < interfaces.length; i++) { + for (ClassDoc anInterface : interfaces) { String locallevel = level + 1; - ClassMembers cm = new ClassMembers(interfaces[i], locallevel); + ClassMembers cm = new ClassMembers(anInterface, locallevel); cm.mapClass(); } if (mappingClass.isClass()) { @@ -371,13 +369,12 @@ public class VisibleMemberMap { private void addMembers(ClassDoc fromClass) { List cdmembers = getClassMembers(fromClass, true); List incllist = new ArrayList(); - for (int i = 0; i < cdmembers.size(); i++) { - ProgramElementDoc pgmelem = cdmembers.get(i); + for (ProgramElementDoc pgmelem : cdmembers) { if (!found(members, pgmelem) && memberIsVisible(pgmelem) && !isOverridden(pgmelem, level) && !isTreatedAsPrivate(pgmelem)) { - incllist.add(pgmelem); + incllist.add(pgmelem); } } if (incllist.size() > 0) { @@ -491,18 +488,17 @@ public class VisibleMemberMap { boolean required) { AnnotationTypeElementDoc[] members = doc.elements(); List targetMembers = new ArrayList(); - for (int i = 0; i < members.length; i++) { - if ((required && members[i].defaultValue() == null) || - ((!required) && members[i].defaultValue() != null)){ - targetMembers.add(members[i]); + for (AnnotationTypeElementDoc member : members) { + if ((required && member.defaultValue() == null) || + ((!required) && member.defaultValue() != null)) { + targetMembers.add(member); } } return targetMembers.toArray(new AnnotationTypeElementDoc[]{}); } private boolean found(List list, ProgramElementDoc elem) { - for (int i = 0; i < list.size(); i++) { - ProgramElementDoc pgmelem = list.get(i); + for (ProgramElementDoc pgmelem : list) { if (Util.matches(pgmelem, elem)) { return true; } @@ -520,10 +516,7 @@ public class VisibleMemberMap { Map memberLevelMap = (Map) memberNameMap.get(getMemberKey(pgmdoc)); if (memberLevelMap == null) return false; - String mappedlevel = null; - Iterator iterator = memberLevelMap.values().iterator(); - while (iterator.hasNext()) { - mappedlevel = iterator.next(); + for (String mappedlevel : memberLevelMap.values()) { if (mappedlevel.equals(STARTLEVEL) || (level.startsWith(mappedlevel) && !level.equals(mappedlevel))) { @@ -744,8 +737,7 @@ public class VisibleMemberMap { } private ClassMember getClassMember(MethodDoc member) { - for (Iterator iter = memberNameMap.keySet().iterator(); iter.hasNext();) { - Object key = iter.next(); + for (Object key : memberNameMap.keySet()) { if (key instanceof String) { continue; } else if (((ClassMember) key).isEqual(member)) { diff --git a/langtools/src/share/classes/com/sun/tools/doclint/DocLint.java b/langtools/src/share/classes/com/sun/tools/doclint/DocLint.java index 972a0e05ddd..9f2f6d70b7f 100644 --- a/langtools/src/share/classes/com/sun/tools/doclint/DocLint.java +++ b/langtools/src/share/classes/com/sun/tools/doclint/DocLint.java @@ -257,8 +257,7 @@ public class DocLint implements Plugin { public void init(JavacTask task, String[] args, boolean addTaskListener) { env = new Env(); - for (int i = 0; i < args.length; i++) { - String arg = args[i]; + for (String arg : args) { if (arg.equals(XMSGS_OPTION)) { env.messages.setOptions(null); } else if (arg.startsWith(XMSGS_CUSTOM_PREFIX)) { diff --git a/langtools/src/share/classes/com/sun/tools/javac/api/ClientCodeWrapper.java b/langtools/src/share/classes/com/sun/tools/javac/api/ClientCodeWrapper.java index a4dddf8f909..b83379dc9ad 100644 --- a/langtools/src/share/classes/com/sun/tools/javac/api/ClientCodeWrapper.java +++ b/langtools/src/share/classes/com/sun/tools/javac/api/ClientCodeWrapper.java @@ -218,9 +218,7 @@ public class ClientCodeWrapper { return clientJavaFileManager.getClassLoader(location); } catch (ClientCodeException e) { throw e; - } catch (RuntimeException e) { - throw new ClientCodeException(e); - } catch (Error e) { + } catch (RuntimeException | Error e) { throw new ClientCodeException(e); } } @@ -231,9 +229,7 @@ public class ClientCodeWrapper { return wrapJavaFileObjects(clientJavaFileManager.list(location, packageName, kinds, recurse)); } catch (ClientCodeException e) { throw e; - } catch (RuntimeException e) { - throw new ClientCodeException(e); - } catch (Error e) { + } catch (RuntimeException | Error e) { throw new ClientCodeException(e); } } @@ -244,9 +240,7 @@ public class ClientCodeWrapper { return clientJavaFileManager.inferBinaryName(location, unwrap(file)); } catch (ClientCodeException e) { throw e; - } catch (RuntimeException e) { - throw new ClientCodeException(e); - } catch (Error e) { + } catch (RuntimeException | Error e) { throw new ClientCodeException(e); } } @@ -257,9 +251,7 @@ public class ClientCodeWrapper { return clientJavaFileManager.isSameFile(unwrap(a), unwrap(b)); } catch (ClientCodeException e) { throw e; - } catch (RuntimeException e) { - throw new ClientCodeException(e); - } catch (Error e) { + } catch (RuntimeException | Error e) { throw new ClientCodeException(e); } } @@ -270,9 +262,7 @@ public class ClientCodeWrapper { return clientJavaFileManager.handleOption(current, remaining); } catch (ClientCodeException e) { throw e; - } catch (RuntimeException e) { - throw new ClientCodeException(e); - } catch (Error e) { + } catch (RuntimeException | Error e) { throw new ClientCodeException(e); } } @@ -283,9 +273,7 @@ public class ClientCodeWrapper { return clientJavaFileManager.hasLocation(location); } catch (ClientCodeException e) { throw e; - } catch (RuntimeException e) { - throw new ClientCodeException(e); - } catch (Error e) { + } catch (RuntimeException | Error e) { throw new ClientCodeException(e); } } @@ -296,9 +284,7 @@ public class ClientCodeWrapper { return wrap(clientJavaFileManager.getJavaFileForInput(location, className, kind)); } catch (ClientCodeException e) { throw e; - } catch (RuntimeException e) { - throw new ClientCodeException(e); - } catch (Error e) { + } catch (RuntimeException | Error e) { throw new ClientCodeException(e); } } @@ -309,9 +295,7 @@ public class ClientCodeWrapper { return wrap(clientJavaFileManager.getJavaFileForOutput(location, className, kind, unwrap(sibling))); } catch (ClientCodeException e) { throw e; - } catch (RuntimeException e) { - throw new ClientCodeException(e); - } catch (Error e) { + } catch (RuntimeException | Error e) { throw new ClientCodeException(e); } } @@ -322,9 +306,7 @@ public class ClientCodeWrapper { return wrap(clientJavaFileManager.getFileForInput(location, packageName, relativeName)); } catch (ClientCodeException e) { throw e; - } catch (RuntimeException e) { - throw new ClientCodeException(e); - } catch (Error e) { + } catch (RuntimeException | Error e) { throw new ClientCodeException(e); } } @@ -335,9 +317,7 @@ public class ClientCodeWrapper { return wrap(clientJavaFileManager.getFileForOutput(location, packageName, relativeName, unwrap(sibling))); } catch (ClientCodeException e) { throw e; - } catch (RuntimeException e) { - throw new ClientCodeException(e); - } catch (Error e) { + } catch (RuntimeException | Error e) { throw new ClientCodeException(e); } } @@ -348,9 +328,7 @@ public class ClientCodeWrapper { clientJavaFileManager.flush(); } catch (ClientCodeException e) { throw e; - } catch (RuntimeException e) { - throw new ClientCodeException(e); - } catch (Error e) { + } catch (RuntimeException | Error e) { throw new ClientCodeException(e); } } @@ -361,9 +339,7 @@ public class ClientCodeWrapper { clientJavaFileManager.close(); } catch (ClientCodeException e) { throw e; - } catch (RuntimeException e) { - throw new ClientCodeException(e); - } catch (Error e) { + } catch (RuntimeException | Error e) { throw new ClientCodeException(e); } } @@ -374,9 +350,7 @@ public class ClientCodeWrapper { return clientJavaFileManager.isSupportedOption(option); } catch (ClientCodeException e) { throw e; - } catch (RuntimeException e) { - throw new ClientCodeException(e); - } catch (Error e) { + } catch (RuntimeException | Error e) { throw new ClientCodeException(e); } } @@ -400,9 +374,7 @@ public class ClientCodeWrapper { return clientFileObject.toUri(); } catch (ClientCodeException e) { throw e; - } catch (RuntimeException e) { - throw new ClientCodeException(e); - } catch (Error e) { + } catch (RuntimeException | Error e) { throw new ClientCodeException(e); } } @@ -413,9 +385,7 @@ public class ClientCodeWrapper { return clientFileObject.getName(); } catch (ClientCodeException e) { throw e; - } catch (RuntimeException e) { - throw new ClientCodeException(e); - } catch (Error e) { + } catch (RuntimeException | Error e) { throw new ClientCodeException(e); } } @@ -426,9 +396,7 @@ public class ClientCodeWrapper { return clientFileObject.openInputStream(); } catch (ClientCodeException e) { throw e; - } catch (RuntimeException e) { - throw new ClientCodeException(e); - } catch (Error e) { + } catch (RuntimeException | Error e) { throw new ClientCodeException(e); } } @@ -439,9 +407,7 @@ public class ClientCodeWrapper { return clientFileObject.openOutputStream(); } catch (ClientCodeException e) { throw e; - } catch (RuntimeException e) { - throw new ClientCodeException(e); - } catch (Error e) { + } catch (RuntimeException | Error e) { throw new ClientCodeException(e); } } @@ -452,9 +418,7 @@ public class ClientCodeWrapper { return clientFileObject.openReader(ignoreEncodingErrors); } catch (ClientCodeException e) { throw e; - } catch (RuntimeException e) { - throw new ClientCodeException(e); - } catch (Error e) { + } catch (RuntimeException | Error e) { throw new ClientCodeException(e); } } @@ -465,9 +429,7 @@ public class ClientCodeWrapper { return clientFileObject.getCharContent(ignoreEncodingErrors); } catch (ClientCodeException e) { throw e; - } catch (RuntimeException e) { - throw new ClientCodeException(e); - } catch (Error e) { + } catch (RuntimeException | Error e) { throw new ClientCodeException(e); } } @@ -478,9 +440,7 @@ public class ClientCodeWrapper { return clientFileObject.openWriter(); } catch (ClientCodeException e) { throw e; - } catch (RuntimeException e) { - throw new ClientCodeException(e); - } catch (Error e) { + } catch (RuntimeException | Error e) { throw new ClientCodeException(e); } } @@ -491,9 +451,7 @@ public class ClientCodeWrapper { return clientFileObject.getLastModified(); } catch (ClientCodeException e) { throw e; - } catch (RuntimeException e) { - throw new ClientCodeException(e); - } catch (Error e) { + } catch (RuntimeException | Error e) { throw new ClientCodeException(e); } } @@ -504,9 +462,7 @@ public class ClientCodeWrapper { return clientFileObject.delete(); } catch (ClientCodeException e) { throw e; - } catch (RuntimeException e) { - throw new ClientCodeException(e); - } catch (Error e) { + } catch (RuntimeException | Error e) { throw new ClientCodeException(e); } } @@ -528,9 +484,7 @@ public class ClientCodeWrapper { return ((JavaFileObject)clientFileObject).getKind(); } catch (ClientCodeException e) { throw e; - } catch (RuntimeException e) { - throw new ClientCodeException(e); - } catch (Error e) { + } catch (RuntimeException | Error e) { throw new ClientCodeException(e); } } @@ -541,9 +495,7 @@ public class ClientCodeWrapper { return ((JavaFileObject)clientFileObject).isNameCompatible(simpleName, kind); } catch (ClientCodeException e) { throw e; - } catch (RuntimeException e) { - throw new ClientCodeException(e); - } catch (Error e) { + } catch (RuntimeException | Error e) { throw new ClientCodeException(e); } } @@ -554,9 +506,7 @@ public class ClientCodeWrapper { return ((JavaFileObject)clientFileObject).getNestingKind(); } catch (ClientCodeException e) { throw e; - } catch (RuntimeException e) { - throw new ClientCodeException(e); - } catch (Error e) { + } catch (RuntimeException | Error e) { throw new ClientCodeException(e); } } @@ -567,9 +517,7 @@ public class ClientCodeWrapper { return ((JavaFileObject)clientFileObject).getAccessLevel(); } catch (ClientCodeException e) { throw e; - } catch (RuntimeException e) { - throw new ClientCodeException(e); - } catch (Error e) { + } catch (RuntimeException | Error e) { throw new ClientCodeException(e); } } @@ -593,9 +541,7 @@ public class ClientCodeWrapper { clientDiagnosticListener.report(unwrap(diagnostic)); } catch (ClientCodeException e) { throw e; - } catch (RuntimeException e) { - throw new ClientCodeException(e); - } catch (Error e) { + } catch (RuntimeException | Error e) { throw new ClientCodeException(e); } } @@ -668,9 +614,7 @@ public class ClientCodeWrapper { clientTaskListener.started(ev); } catch (ClientCodeException e) { throw e; - } catch (RuntimeException e) { - throw new ClientCodeException(e); - } catch (Error e) { + } catch (RuntimeException | Error e) { throw new ClientCodeException(e); } } @@ -681,9 +625,7 @@ public class ClientCodeWrapper { clientTaskListener.finished(ev); } catch (ClientCodeException e) { throw e; - } catch (RuntimeException e) { - throw new ClientCodeException(e); - } catch (Error e) { + } catch (RuntimeException | Error e) { throw new ClientCodeException(e); } } diff --git a/langtools/src/share/classes/com/sun/tools/javac/file/FSInfo.java b/langtools/src/share/classes/com/sun/tools/javac/file/FSInfo.java index c8726a55a68..743701d745e 100644 --- a/langtools/src/share/classes/com/sun/tools/javac/file/FSInfo.java +++ b/langtools/src/share/classes/com/sun/tools/javac/file/FSInfo.java @@ -64,8 +64,7 @@ public class FSInfo { public List getJarClassPath(File file) throws IOException { String parent = file.getParent(); - JarFile jarFile = new JarFile(file); - try { + try (JarFile jarFile = new JarFile(file)) { Manifest man = jarFile.getManifest(); if (man == null) return Collections.emptyList(); @@ -80,15 +79,14 @@ public class FSInfo { List list = new ArrayList(); - for (StringTokenizer st = new StringTokenizer(path); st.hasMoreTokens(); ) { + for (StringTokenizer st = new StringTokenizer(path); + st.hasMoreTokens(); ) { String elt = st.nextToken(); File f = (parent == null ? new File(elt) : new File(parent, elt)); list.add(f); } return list; - } finally { - jarFile.close(); } } } diff --git a/langtools/src/share/classes/com/sun/tools/javac/file/RegularFileObject.java b/langtools/src/share/classes/com/sun/tools/javac/file/RegularFileObject.java index 055977f172e..92c886c87f2 100644 --- a/langtools/src/share/classes/com/sun/tools/javac/file/RegularFileObject.java +++ b/langtools/src/share/classes/com/sun/tools/javac/file/RegularFileObject.java @@ -109,8 +109,7 @@ class RegularFileObject extends BaseFileObject { public CharBuffer getCharContent(boolean ignoreEncodingErrors) throws IOException { CharBuffer cb = fileManager.getCachedContent(this); if (cb == null) { - InputStream in = new FileInputStream(file); - try { + try (InputStream in = new FileInputStream(file)) { ByteBuffer bb = fileManager.makeByteBuffer(in); JavaFileObject prev = fileManager.log.useSource(this); try { @@ -122,8 +121,6 @@ class RegularFileObject extends BaseFileObject { if (!ignoreEncodingErrors) { fileManager.cache(this, cb); } - } finally { - in.close(); } } return cb; diff --git a/langtools/src/share/classes/com/sun/tools/javac/file/ZipArchive.java b/langtools/src/share/classes/com/sun/tools/javac/file/ZipArchive.java index 1a89c207cec..99d06a3021f 100644 --- a/langtools/src/share/classes/com/sun/tools/javac/file/ZipArchive.java +++ b/langtools/src/share/classes/com/sun/tools/javac/file/ZipArchive.java @@ -205,8 +205,7 @@ public class ZipArchive implements Archive { public CharBuffer getCharContent(boolean ignoreEncodingErrors) throws IOException { CharBuffer cb = fileManager.getCachedContent(this); if (cb == null) { - InputStream in = zarch.zfile.getInputStream(entry); - try { + try (InputStream in = zarch.zfile.getInputStream(entry)) { ByteBuffer bb = fileManager.makeByteBuffer(in); JavaFileObject prev = fileManager.log.useSource(this); try { @@ -218,8 +217,6 @@ public class ZipArchive implements Archive { if (!ignoreEncodingErrors) { fileManager.cache(this, cb); } - } finally { - in.close(); } } return cb; diff --git a/langtools/src/share/classes/com/sun/tools/javac/file/ZipFileIndexArchive.java b/langtools/src/share/classes/com/sun/tools/javac/file/ZipFileIndexArchive.java index 4a46601908e..48d1f13fdcc 100644 --- a/langtools/src/share/classes/com/sun/tools/javac/file/ZipFileIndexArchive.java +++ b/langtools/src/share/classes/com/sun/tools/javac/file/ZipFileIndexArchive.java @@ -162,8 +162,7 @@ public class ZipFileIndexArchive implements Archive { public CharBuffer getCharContent(boolean ignoreEncodingErrors) throws IOException { CharBuffer cb = fileManager.getCachedContent(this); if (cb == null) { - InputStream in = new ByteArrayInputStream(zfIndex.read(entry)); - try { + try (InputStream in = new ByteArrayInputStream(zfIndex.read(entry))) { ByteBuffer bb = fileManager.makeByteBuffer(in); JavaFileObject prev = fileManager.log.useSource(this); try { @@ -174,8 +173,6 @@ public class ZipFileIndexArchive implements Archive { fileManager.recycleByteBuffer(bb); // save for next time if (!ignoreEncodingErrors) fileManager.cache(this, cb); - } finally { - in.close(); } } return cb; diff --git a/langtools/src/share/classes/com/sun/tools/javac/file/ZipFileIndexCache.java b/langtools/src/share/classes/com/sun/tools/javac/file/ZipFileIndexCache.java index 3c878d71efa..8d4eaa8bc2a 100644 --- a/langtools/src/share/classes/com/sun/tools/javac/file/ZipFileIndexCache.java +++ b/langtools/src/share/classes/com/sun/tools/javac/file/ZipFileIndexCache.java @@ -113,14 +113,12 @@ public class ZipFileIndexCache { } public synchronized void clearCache(long timeNotUsed) { - Iterator cachedFileIterator = map.keySet().iterator(); - while (cachedFileIterator.hasNext()) { - File cachedFile = cachedFileIterator.next(); + for (File cachedFile : map.keySet()) { ZipFileIndex cachedZipIndex = map.get(cachedFile); if (cachedZipIndex != null) { long timeToTest = cachedZipIndex.lastReferenceTimeStamp + timeNotUsed; if (timeToTest < cachedZipIndex.lastReferenceTimeStamp || // Overflow... - System.currentTimeMillis() > timeToTest) { + System.currentTimeMillis() > timeToTest) { map.remove(cachedFile); } } diff --git a/langtools/src/share/classes/com/sun/tools/javac/jvm/JNIWriter.java b/langtools/src/share/classes/com/sun/tools/javac/jvm/JNIWriter.java index be3fe22c1cc..e00bd57b8a4 100644 --- a/langtools/src/share/classes/com/sun/tools/javac/jvm/JNIWriter.java +++ b/langtools/src/share/classes/com/sun/tools/javac/jvm/JNIWriter.java @@ -697,7 +697,7 @@ public class JNIWriter { // Separates parameters. if (signature != null) { - if (signature.indexOf(",") != -1) { + if (signature.contains(",")) { st = new StringTokenizer(signature, ","); if (st != null) { while (st.hasMoreTokens()) { @@ -755,13 +755,13 @@ public class JNIWriter { if(paramsig != null){ - if(paramsig.indexOf("[]") != -1) { + if(paramsig.contains("[]")) { // Gets array dimension. int endindex = paramsig.indexOf("[]"); componentType = paramsig.substring(0, endindex); String dimensionString = paramsig.substring(endindex); if(dimensionString != null){ - while(dimensionString.indexOf("[]") != -1){ + while(dimensionString.contains("[]")){ paramJVMSig += "["; int beginindex = dimensionString.indexOf("]") + 1; if(beginindex < dimensionString.length()){ @@ -785,29 +785,32 @@ public class JNIWriter { String JVMSig = ""; if(componentType != null){ - if(componentType.equals("void")) JVMSig += SIG_VOID ; - else if(componentType.equals("boolean")) JVMSig += SIG_BOOLEAN ; - else if(componentType.equals("byte")) JVMSig += SIG_BYTE ; - else if(componentType.equals("char")) JVMSig += SIG_CHAR ; - else if(componentType.equals("short")) JVMSig += SIG_SHORT ; - else if(componentType.equals("int")) JVMSig += SIG_INT ; - else if(componentType.equals("long")) JVMSig += SIG_LONG ; - else if(componentType.equals("float")) JVMSig += SIG_FLOAT ; - else if(componentType.equals("double")) JVMSig += SIG_DOUBLE ; - else { - if(!componentType.equals("")){ - TypeElement classNameDoc = elems.getTypeElement(componentType); + switch (componentType) { + case "void": JVMSig += SIG_VOID; break; + case "boolean": JVMSig += SIG_BOOLEAN; break; + case "byte": JVMSig += SIG_BYTE; break; + case "char": JVMSig += SIG_CHAR; break; + case "short": JVMSig += SIG_SHORT; break; + case "int": JVMSig += SIG_INT; break; + case "long": JVMSig += SIG_LONG; break; + case "float": JVMSig += SIG_FLOAT; break; + case "double": JVMSig += SIG_DOUBLE; break; + default: + if (!componentType.equals("")) { + TypeElement classNameDoc = elems.getTypeElement(componentType); - if(classNameDoc == null){ - throw new SignatureException(componentType); - }else { - String classname = classNameDoc.getQualifiedName().toString(); - String newclassname = classname.replace('.', '/'); - JVMSig += "L"; - JVMSig += newclassname; - JVMSig += ";"; + if (classNameDoc == null) { + throw new SignatureException(componentType); + } + else { + String classname = classNameDoc.getQualifiedName().toString(); + String newclassname = classname.replace('.', '/'); + JVMSig += "L"; + JVMSig += newclassname; + JVMSig += ";"; + } } - } + break; } } return JVMSig; diff --git a/langtools/src/share/classes/com/sun/tools/javac/main/CommandLine.java b/langtools/src/share/classes/com/sun/tools/javac/main/CommandLine.java index 262dc2db94d..e22ed351ab6 100644 --- a/langtools/src/share/classes/com/sun/tools/javac/main/CommandLine.java +++ b/langtools/src/share/classes/com/sun/tools/javac/main/CommandLine.java @@ -55,8 +55,7 @@ public class CommandLine { throws IOException { ListBuffer newArgs = new ListBuffer(); - for (int i = 0; i < args.length; i++) { - String arg = args[i]; + for (String arg : args) { if (arg.length() > 1 && arg.charAt(0) == '@') { arg = arg.substring(1); if (arg.charAt(0) == '@') { @@ -74,17 +73,17 @@ public class CommandLine { private static void loadCmdFile(String name, ListBuffer args) throws IOException { - Reader r = new BufferedReader(new FileReader(name)); - StreamTokenizer st = new StreamTokenizer(r); - st.resetSyntax(); - st.wordChars(' ', 255); - st.whitespaceChars(0, ' '); - st.commentChar('#'); - st.quoteChar('"'); - st.quoteChar('\''); - while (st.nextToken() != StreamTokenizer.TT_EOF) { - args.append(st.sval); + try (Reader r = new BufferedReader(new FileReader(name))) { + StreamTokenizer st = new StreamTokenizer(r); + st.resetSyntax(); + st.wordChars(' ', 255); + st.whitespaceChars(0, ' '); + st.commentChar('#'); + st.quoteChar('"'); + st.quoteChar('\''); + while (st.nextToken() != StreamTokenizer.TT_EOF) { + args.append(st.sval); + } } - r.close(); } } diff --git a/langtools/src/share/classes/com/sun/tools/javac/main/JavaCompiler.java b/langtools/src/share/classes/com/sun/tools/javac/main/JavaCompiler.java index e592147e256..45f0b617e3f 100644 --- a/langtools/src/share/classes/com/sun/tools/javac/main/JavaCompiler.java +++ b/langtools/src/share/classes/com/sun/tools/javac/main/JavaCompiler.java @@ -726,13 +726,10 @@ public class JavaCompiler { log.error(cdef.pos(), "source.cant.overwrite.input.file", outFile); return null; } else { - BufferedWriter out = new BufferedWriter(outFile.openWriter()); - try { + try (BufferedWriter out = new BufferedWriter(outFile.openWriter())) { new Pretty(out, true).printUnit(env.toplevel, cdef); if (verbose) log.printVerbose("wrote.file", outFile); - } finally { - out.close(); } return outFile; } diff --git a/langtools/src/share/classes/com/sun/tools/javac/main/Main.java b/langtools/src/share/classes/com/sun/tools/javac/main/Main.java index 2842487b4a7..92af3f69b9a 100644 --- a/langtools/src/share/classes/com/sun/tools/javac/main/Main.java +++ b/langtools/src/share/classes/com/sun/tools/javac/main/Main.java @@ -458,10 +458,8 @@ public class Main { pluginsToCall.add(List.from(plugin.split("\\s+"))); } JavacTask task = null; - Iterator iter = sl.iterator(); - while (iter.hasNext()) { - Plugin plugin = iter.next(); - for (List p: pluginsToCall) { + for (Plugin plugin : sl) { + for (List p : pluginsToCall) { if (plugin.getName().equals(p.head)) { pluginsToCall.remove(p); try { @@ -640,14 +638,11 @@ public class Main { final String algorithm = "MD5"; byte[] digest; MessageDigest md = MessageDigest.getInstance(algorithm); - DigestInputStream in = new DigestInputStream(url.openStream(), md); - try { + try (DigestInputStream in = new DigestInputStream(url.openStream(), md)) { byte[] buf = new byte[8192]; int n; do { n = in.read(buf); } while (n > 0); digest = md.digest(); - } finally { - in.close(); } StringBuilder sb = new StringBuilder(); for (byte b: digest) diff --git a/langtools/src/share/classes/com/sun/tools/javac/nio/PathFileObject.java b/langtools/src/share/classes/com/sun/tools/javac/nio/PathFileObject.java index 357fc77f40b..3a8b295233f 100644 --- a/langtools/src/share/classes/com/sun/tools/javac/nio/PathFileObject.java +++ b/langtools/src/share/classes/com/sun/tools/javac/nio/PathFileObject.java @@ -219,8 +219,7 @@ abstract class PathFileObject implements JavaFileObject { public CharSequence getCharContent(boolean ignoreEncodingErrors) throws IOException { CharBuffer cb = fileManager.getCachedContent(this); if (cb == null) { - InputStream in = openInputStream(); - try { + try (InputStream in = openInputStream()) { ByteBuffer bb = fileManager.makeByteBuffer(in); JavaFileObject prev = fileManager.log.useSource(this); try { @@ -232,8 +231,6 @@ abstract class PathFileObject implements JavaFileObject { if (!ignoreEncodingErrors) { fileManager.cache(this, cb); } - } finally { - in.close(); } } return cb; diff --git a/langtools/src/share/classes/com/sun/tools/javac/sym/CreateSymbols.java b/langtools/src/share/classes/com/sun/tools/javac/sym/CreateSymbols.java index 8a930bee9d7..e5cefff3592 100644 --- a/langtools/src/share/classes/com/sun/tools/javac/sym/CreateSymbols.java +++ b/langtools/src/share/classes/com/sun/tools/javac/sym/CreateSymbols.java @@ -265,9 +265,7 @@ public class CreateSymbols extends AbstractProcessor { writeClass(pool, nestedClass, writer); } } - } catch (ClassWriter.StringOverflow ex) { - throw new RuntimeException(ex); - } catch (ClassWriter.PoolOverflow ex) { + } catch (ClassWriter.StringOverflow | ClassWriter.PoolOverflow ex) { throw new RuntimeException(ex); } } diff --git a/langtools/src/share/classes/com/sun/tools/javac/sym/Profiles.java b/langtools/src/share/classes/com/sun/tools/javac/sym/Profiles.java index 1ebea23192d..57ae90763d2 100644 --- a/langtools/src/share/classes/com/sun/tools/javac/sym/Profiles.java +++ b/langtools/src/share/classes/com/sun/tools/javac/sym/Profiles.java @@ -69,30 +69,24 @@ public abstract class Profiles { } for (int i = 1; i <= 4; i++) { - BufferedWriter out = new BufferedWriter(new FileWriter(i + ".txt")); - try { - for (String type: lists.get(i)) { + try (BufferedWriter out = new BufferedWriter(new FileWriter(i + ".txt"))) { + for (String type : lists.get(i)) { out.write(type); out.newLine(); } - } finally { - out.close(); } } } } public static Profiles read(File file) throws IOException { - BufferedInputStream in = new BufferedInputStream(new FileInputStream(file)); - try { + try (BufferedInputStream in = new BufferedInputStream(new FileInputStream(file))) { Properties p = new Properties(); p.load(in); if (p.containsKey("java/lang/Object")) return new SimpleProfiles(p); else return new MakefileProfiles(p); - } finally { - in.close(); } } diff --git a/langtools/src/share/classes/com/sun/tools/javac/util/BasicDiagnosticFormatter.java b/langtools/src/share/classes/com/sun/tools/javac/util/BasicDiagnosticFormatter.java index 7b12009695a..57cd768f5f3 100644 --- a/langtools/src/share/classes/com/sun/tools/javac/util/BasicDiagnosticFormatter.java +++ b/langtools/src/share/classes/com/sun/tools/javac/util/BasicDiagnosticFormatter.java @@ -137,7 +137,7 @@ public class BasicDiagnosticFormatter extends AbstractDiagnosticFormatter { BasicConfiguration conf = getConfiguration(); int indentSource = conf.getIndentation(DiagnosticPart.SOURCE); String sourceLine = "\n" + formatSourceLine(d, indentSource); - boolean singleLine = msg.indexOf("\n") == -1; + boolean singleLine = !msg.contains("\n"); if (singleLine || getConfiguration().getSourcePosition() == SourcePosition.BOTTOM) return msg + sourceLine; else diff --git a/langtools/src/share/classes/com/sun/tools/javac/util/Convert.java b/langtools/src/share/classes/com/sun/tools/javac/util/Convert.java index c4725f3570a..a29b3971f2f 100644 --- a/langtools/src/share/classes/com/sun/tools/javac/util/Convert.java +++ b/langtools/src/share/classes/com/sun/tools/javac/util/Convert.java @@ -63,8 +63,8 @@ public class Convert { char[] cs = s.toCharArray(); int limit = Integer.MAX_VALUE / (radix/2); int n = 0; - for (int i = 0; i < cs.length; i++) { - int d = Character.digit(cs[i], radix); + for (char c : cs) { + int d = Character.digit(c, radix); if (n < 0 || n > limit || n * radix > Integer.MAX_VALUE - d) @@ -85,8 +85,8 @@ public class Convert { char[] cs = s.toCharArray(); long limit = Long.MAX_VALUE / (radix/2); long n = 0; - for (int i = 0; i < cs.length; i++) { - int d = Character.digit(cs[i], radix); + for (char c : cs) { + int d = Character.digit(c, radix); if (n < 0 || n > limit || n * radix > Long.MAX_VALUE - d) diff --git a/langtools/src/share/classes/com/sun/tools/javac/util/ListBuffer.java b/langtools/src/share/classes/com/sun/tools/javac/util/ListBuffer.java index 6d9c1ccda55..ffdf1f2aa15 100644 --- a/langtools/src/share/classes/com/sun/tools/javac/util/ListBuffer.java +++ b/langtools/src/share/classes/com/sun/tools/javac/util/ListBuffer.java @@ -156,8 +156,8 @@ public class ListBuffer extends AbstractQueue { /** Append all elements in an array to buffer. */ public ListBuffer appendArray(A[] xs) { - for (int i = 0; i < xs.length; i++) { - append(xs[i]); + for (A x : xs) { + append(x); } return this; } diff --git a/langtools/src/share/classes/com/sun/tools/javac/util/ServiceLoader.java b/langtools/src/share/classes/com/sun/tools/javac/util/ServiceLoader.java index f24f1fb36fb..9820ebe7a9f 100644 --- a/langtools/src/share/classes/com/sun/tools/javac/util/ServiceLoader.java +++ b/langtools/src/share/classes/com/sun/tools/javac/util/ServiceLoader.java @@ -169,7 +169,6 @@ public final class ServiceLoader throws ServiceConfigurationError { InputStream in = null; - BufferedReader r = null; ArrayList names = new ArrayList<>(); try { // The problem is that by default, streams opened with @@ -186,14 +185,14 @@ public final class ServiceLoader uc.setUseCaches(false); in = uc.getInputStream(); // ... end of workaround. - r = new BufferedReader(new InputStreamReader(in, "utf-8")); - int lc = 1; - while ((lc = parseLine(service, u, r, lc, names)) >= 0); + try (BufferedReader r = new BufferedReader(new InputStreamReader(in, "utf-8"))) { + int lc = 1; + while ((lc = parseLine(service, u, r, lc, names)) >= 0); + } } catch (IOException x) { fail(service, "Error reading configuration file", x); } finally { try { - if (r != null) r.close(); if (in != null) in.close(); } catch (IOException y) { fail(service, "Error closing configuration file", y); diff --git a/langtools/src/share/classes/com/sun/tools/javadoc/ClassDocImpl.java b/langtools/src/share/classes/com/sun/tools/javadoc/ClassDocImpl.java index 9ea169d0866..c135710c7fa 100644 --- a/langtools/src/share/classes/com/sun/tools/javadoc/ClassDocImpl.java +++ b/langtools/src/share/classes/com/sun/tools/javadoc/ClassDocImpl.java @@ -971,9 +971,8 @@ public class ClassDocImpl extends ProgramElementDocImpl implements ClassDoc { } // search interfaces - ClassDoc intf[] = interfaces(); - for (int i = 0; i < intf.length; i++) { - cdi = (ClassDocImpl)intf[i]; + for (ClassDoc intf : interfaces()) { + cdi = (ClassDocImpl) intf; mdi = cdi.searchMethod(methodName, paramTypes, searched); if (mdi != null) { return mdi; @@ -1080,9 +1079,8 @@ public class ClassDocImpl extends ProgramElementDocImpl implements ClassDoc { } // search interfaces - ClassDoc intf[] = interfaces(); - for (int i = 0; i < intf.length; i++) { - cdi = (ClassDocImpl)intf[i]; + for (ClassDoc intf : interfaces()) { + cdi = (ClassDocImpl) intf; FieldDocImpl fdi = cdi.searchField(fieldName, searched); if (fdi != null) { return fdi; diff --git a/langtools/src/share/classes/com/sun/tools/javadoc/Comment.java b/langtools/src/share/classes/com/sun/tools/javadoc/Comment.java index 036ad67bde7..898e16b936d 100644 --- a/langtools/src/share/classes/com/sun/tools/javadoc/Comment.java +++ b/langtools/src/share/classes/com/sun/tools/javadoc/Comment.java @@ -151,29 +151,39 @@ class Comment { text = tx; } else { TagImpl tag; - if (tagName.equals("@exception") || tagName.equals("@throws")) { - warnIfEmpty(tagName, tx); - tag = new ThrowsTagImpl(holder, tagName, tx); - } else if (tagName.equals("@param")) { - warnIfEmpty(tagName, tx); - tag = new ParamTagImpl(holder, tagName, tx); - } else if (tagName.equals("@see")) { - warnIfEmpty(tagName, tx); - tag = new SeeTagImpl(holder, tagName, tx); - } else if (tagName.equals("@serialField")) { - warnIfEmpty(tagName, tx); - tag = new SerialFieldTagImpl(holder, tagName, tx); - } else if (tagName.equals("@return")) { - warnIfEmpty(tagName, tx); - tag = new TagImpl(holder, tagName, tx); - } else if (tagName.equals("@author")) { - warnIfEmpty(tagName, tx); - tag = new TagImpl(holder, tagName, tx); - } else if (tagName.equals("@version")) { - warnIfEmpty(tagName, tx); - tag = new TagImpl(holder, tagName, tx); - } else { - tag = new TagImpl(holder, tagName, tx); + switch (tagName) { + case "@exception": + case "@throws": + warnIfEmpty(tagName, tx); + tag = new ThrowsTagImpl(holder, tagName, tx); + break; + case "@param": + warnIfEmpty(tagName, tx); + tag = new ParamTagImpl(holder, tagName, tx); + break; + case "@see": + warnIfEmpty(tagName, tx); + tag = new SeeTagImpl(holder, tagName, tx); + break; + case "@serialField": + warnIfEmpty(tagName, tx); + tag = new SerialFieldTagImpl(holder, tagName, tx); + break; + case "@return": + warnIfEmpty(tagName, tx); + tag = new TagImpl(holder, tagName, tx); + break; + case "@author": + warnIfEmpty(tagName, tx); + tag = new TagImpl(holder, tagName, tx); + break; + case "@version": + warnIfEmpty(tagName, tx); + tag = new TagImpl(holder, tagName, tx); + break; + default: + tag = new TagImpl(holder, tagName, tx); + break; } tagList.append(tag); } diff --git a/langtools/src/share/classes/com/sun/tools/javadoc/DocLocale.java b/langtools/src/share/classes/com/sun/tools/javadoc/DocLocale.java index 2be308da621..5dcd1b72201 100644 --- a/langtools/src/share/classes/com/sun/tools/javadoc/DocLocale.java +++ b/langtools/src/share/classes/com/sun/tools/javadoc/DocLocale.java @@ -159,12 +159,11 @@ class DocLocale { */ private Locale searchLocale(String language, String country, String variant) { - Locale[] locales = Locale.getAvailableLocales(); - for (int i = 0; i < locales.length; i++) { - if (locales[i].getLanguage().equals(language) && - (country == null || locales[i].getCountry().equals(country)) && - (variant == null || locales[i].getVariant().equals(variant))) { - return locales[i]; + for (Locale loc : Locale.getAvailableLocales()) { + if (loc.getLanguage().equals(language) && + (country == null || loc.getCountry().equals(country)) && + (variant == null || loc.getVariant().equals(variant))) { + return loc; } } return null; @@ -231,11 +230,10 @@ class DocLocale { * return true else return false. */ private boolean htmlSentenceTerminatorFound(String str, int index) { - for (int i = 0; i < sentenceTerminators.length; i++) { - String terminator = sentenceTerminators[i]; + for (String terminator : sentenceTerminators) { if (str.regionMatches(true, index, terminator, 0, terminator.length())) { - return true; + return true; } } return false; diff --git a/langtools/src/share/classes/com/sun/tools/javadoc/DocletInvoker.java b/langtools/src/share/classes/com/sun/tools/javadoc/DocletInvoker.java index 3fedeeea512..f12ffe951c0 100644 --- a/langtools/src/share/classes/com/sun/tools/javadoc/DocletInvoker.java +++ b/langtools/src/share/classes/com/sun/tools/javadoc/DocletInvoker.java @@ -210,7 +210,7 @@ public class DocletInvoker { Class[] paramTypes = { String.class }; Object[] params = { option }; try { - retVal = invoke(methodName, new Integer(0), paramTypes, params); + retVal = invoke(methodName, 0, paramTypes, params); } catch (DocletInvokeException exc) { return -1; } @@ -308,7 +308,7 @@ public class DocletInvoker { if (appClassLoader != null) // will be null if doclet class provided via API Thread.currentThread().setContextClassLoader(appClassLoader); return meth.invoke(null , params); - } catch (IllegalArgumentException exc) { + } catch (IllegalArgumentException | NullPointerException exc) { messager.error(Messager.NOPOS, "main.internal_error_exception_thrown", docletClassName, methodName, exc.toString()); throw new DocletInvokeException(); @@ -316,11 +316,8 @@ public class DocletInvoker { messager.error(Messager.NOPOS, "main.doclet_method_not_accessible", docletClassName, methodName); throw new DocletInvokeException(); - } catch (NullPointerException exc) { - messager.error(Messager.NOPOS, "main.internal_error_exception_thrown", - docletClassName, methodName, exc.toString()); - throw new DocletInvokeException(); - } catch (InvocationTargetException exc) { + } + catch (InvocationTargetException exc) { Throwable err = exc.getTargetException(); if (apiMode) throw new ClientCodeException(err); diff --git a/langtools/src/share/classes/com/sun/tools/javadoc/SeeTagImpl.java b/langtools/src/share/classes/com/sun/tools/javadoc/SeeTagImpl.java index 647b19627db..344f3defaa8 100644 --- a/langtools/src/share/classes/com/sun/tools/javadoc/SeeTagImpl.java +++ b/langtools/src/share/classes/com/sun/tools/javadoc/SeeTagImpl.java @@ -385,10 +385,9 @@ class SeeTagImpl extends TagImpl implements SeeTag, LayoutCharacters { private MemberDoc findReferencedMethod(String memName, String[] paramarr, ClassDoc referencedClass) { MemberDoc meth = findExecutableMember(memName, paramarr, referencedClass); - ClassDoc[] nestedclasses = referencedClass.innerClasses(); if (meth == null) { - for (int i = 0; i < nestedclasses.length; i++) { - meth = findReferencedMethod(memName, paramarr, nestedclasses[i]); + for (ClassDoc nestedClass : referencedClass.innerClasses()) { + meth = findReferencedMethod(memName, paramarr, nestedClass); if (meth != null) { return meth; } diff --git a/langtools/src/share/classes/com/sun/tools/javadoc/SerializedForm.java b/langtools/src/share/classes/com/sun/tools/javadoc/SerializedForm.java index 76dc6a08fd7..b72fe8074f6 100644 --- a/langtools/src/share/classes/com/sun/tools/javadoc/SerializedForm.java +++ b/langtools/src/share/classes/com/sun/tools/javadoc/SerializedForm.java @@ -234,20 +234,19 @@ class SerializedForm { DocEnv env, ClassSymbol def) { Names names = def.name.table.names; - - SerialFieldTag[] sfTag = spfDoc.serialFieldTags(); - for (int i = 0; i < sfTag.length; i++) { - if (sfTag[i].fieldName() == null || sfTag[i].fieldType() == null) // ignore malformed @serialField tags + for (SerialFieldTag tag : spfDoc.serialFieldTags()) { + if (tag.fieldName() == null || tag.fieldType() == null) // ignore malformed @serialField tags continue; - Name fieldName = names.fromString(sfTag[i].fieldName()); + Name fieldName = names.fromString(tag.fieldName()); // Look for a FieldDocImpl that is documented by serialFieldTagImpl. - for (Scope.Entry e = def.members().lookup(fieldName); e.scope != null; e = e.next()) { + for (Scope.Entry e = def.members().lookup(fieldName); + e.scope != null; e = e.next()) { if (e.sym.kind == Kinds.VAR) { - VarSymbol f = (VarSymbol)e.sym; + VarSymbol f = (VarSymbol) e.sym; FieldDocImpl fdi = env.getFieldDoc(f); - ((SerialFieldTagImpl)(sfTag[i])).mapToFieldDocImpl(fdi); + ((SerialFieldTagImpl) (tag)).mapToFieldDocImpl(fdi); break; } } diff --git a/langtools/src/share/classes/com/sun/tools/javah/JavahTool.java b/langtools/src/share/classes/com/sun/tools/javah/JavahTool.java index 09cbdb9cc23..2b37e95b920 100644 --- a/langtools/src/share/classes/com/sun/tools/javah/JavahTool.java +++ b/langtools/src/share/classes/com/sun/tools/javah/JavahTool.java @@ -74,10 +74,9 @@ public class JavahTool implements NativeHeaderTool { } public int isSupportedOption(String option) { - JavahTask.Option[] options = JavahTask.recognizedOptions; - for (int i = 0; i < options.length; i++) { - if (options[i].matches(option)) - return (options[i].hasArg ? 1 : 0); + for (JavahTask.Option opt : JavahTask.recognizedOptions) { + if (opt.matches(option)) + return (opt.hasArg ? 1 : 0); } return -1; } diff --git a/langtools/src/share/classes/com/sun/tools/javah/TypeSignature.java b/langtools/src/share/classes/com/sun/tools/javah/TypeSignature.java index ecd06365bb8..b313086d546 100644 --- a/langtools/src/share/classes/com/sun/tools/javah/TypeSignature.java +++ b/langtools/src/share/classes/com/sun/tools/javah/TypeSignature.java @@ -121,7 +121,7 @@ public class TypeSignature { // Separates parameters. if (signature != null) { - if (signature.indexOf(",") != -1) { + if (signature.contains(",")) { st = new StringTokenizer(signature, ","); if (st != null) { while (st.hasMoreTokens()) { @@ -179,13 +179,13 @@ public class TypeSignature { if(paramsig != null){ - if(paramsig.indexOf("[]") != -1) { + if(paramsig.contains("[]")) { // Gets array dimension. int endindex = paramsig.indexOf("[]"); componentType = paramsig.substring(0, endindex); String dimensionString = paramsig.substring(endindex); if(dimensionString != null){ - while(dimensionString.indexOf("[]") != -1){ + while(dimensionString.contains("[]")){ paramJVMSig += "["; int beginindex = dimensionString.indexOf("]") + 1; if(beginindex < dimensionString.length()){ @@ -209,29 +209,32 @@ public class TypeSignature { String JVMSig = ""; if(componentType != null){ - if(componentType.equals("void")) JVMSig += SIG_VOID ; - else if(componentType.equals("boolean")) JVMSig += SIG_BOOLEAN ; - else if(componentType.equals("byte")) JVMSig += SIG_BYTE ; - else if(componentType.equals("char")) JVMSig += SIG_CHAR ; - else if(componentType.equals("short")) JVMSig += SIG_SHORT ; - else if(componentType.equals("int")) JVMSig += SIG_INT ; - else if(componentType.equals("long")) JVMSig += SIG_LONG ; - else if(componentType.equals("float")) JVMSig += SIG_FLOAT ; - else if(componentType.equals("double")) JVMSig += SIG_DOUBLE ; - else { - if(!componentType.equals("")){ - TypeElement classNameDoc = elems.getTypeElement(componentType); + switch (componentType) { + case "void": JVMSig += SIG_VOID; break; + case "boolean": JVMSig += SIG_BOOLEAN; break; + case "byte": JVMSig += SIG_BYTE; break; + case "char": JVMSig += SIG_CHAR; break; + case "short": JVMSig += SIG_SHORT; break; + case "int": JVMSig += SIG_INT; break; + case "long": JVMSig += SIG_LONG; break; + case "float": JVMSig += SIG_FLOAT; break; + case "double": JVMSig += SIG_DOUBLE; break; + default: + if (!componentType.equals("")) { + TypeElement classNameDoc = elems.getTypeElement(componentType); - if(classNameDoc == null){ - throw new SignatureException(componentType); - }else { - String classname = classNameDoc.getQualifiedName().toString(); - String newclassname = classname.replace('.', '/'); - JVMSig += "L"; - JVMSig += newclassname; - JVMSig += ";"; + if (classNameDoc == null) { + throw new SignatureException(componentType); + } + else { + String classname = classNameDoc.getQualifiedName().toString(); + String newclassname = classname.replace('.', '/'); + JVMSig += "L"; + JVMSig += newclassname; + JVMSig += ";"; + } } - } + break; } } return JVMSig; diff --git a/langtools/src/share/classes/com/sun/tools/javap/AnnotationWriter.java b/langtools/src/share/classes/com/sun/tools/javap/AnnotationWriter.java index 99aa17a668f..3cb8a022f3e 100644 --- a/langtools/src/share/classes/com/sun/tools/javap/AnnotationWriter.java +++ b/langtools/src/share/classes/com/sun/tools/javap/AnnotationWriter.java @@ -219,8 +219,7 @@ public class AnnotationWriter extends BasicWriter { Descriptor d = new Descriptor(index); print(d.getFieldType(constant_pool)); return; - } catch (ConstantPoolException ignore) { - } catch (InvalidDescriptor ignore) { + } catch (ConstantPoolException | InvalidDescriptor ignore) { } } diff --git a/langtools/src/share/classes/com/sun/tools/javap/JavapTask.java b/langtools/src/share/classes/com/sun/tools/javap/JavapTask.java index 0cafe023cca..a28432484fa 100644 --- a/langtools/src/share/classes/com/sun/tools/javap/JavapTask.java +++ b/langtools/src/share/classes/com/sun/tools/javap/JavapTask.java @@ -758,8 +758,7 @@ public class JavapTask implements DisassemblerTool.DisassemblerTask, Messages { } }; - } catch (URISyntaxException ignore) { - } catch (IOException ignore) { + } catch (URISyntaxException | IOException ignore) { } } diff --git a/langtools/src/share/classes/com/sun/tools/javap/StackMapWriter.java b/langtools/src/share/classes/com/sun/tools/javap/StackMapWriter.java index bed0485cb68..93732c14462 100644 --- a/langtools/src/share/classes/com/sun/tools/javap/StackMapWriter.java +++ b/langtools/src/share/classes/com/sun/tools/javap/StackMapWriter.java @@ -82,9 +82,7 @@ public class StackMapWriter extends InstructionDetailWriter { ConstantPool cp = classWriter.getClassFile().constant_pool; String argString = d.getParameterTypes(cp); args = argString.substring(1, argString.length() - 1).split("[, ]+"); - } catch (ConstantPoolException e) { - return; - } catch (InvalidDescriptor e) { + } catch (ConstantPoolException | InvalidDescriptor e) { return; } boolean isStatic = m.access_flags.is(AccessFlags.ACC_STATIC); diff --git a/langtools/src/share/classes/com/sun/tools/sjavac/Log.java b/langtools/src/share/classes/com/sun/tools/sjavac/Log.java index 99bd29f2524..4edd5d3720a 100644 --- a/langtools/src/share/classes/com/sun/tools/sjavac/Log.java +++ b/langtools/src/share/classes/com/sun/tools/sjavac/Log.java @@ -75,11 +75,14 @@ public class Log { throws ProblemException { out = o; err = e; - if (l.equals("warn")) level = WARN; - else if (l.equals("info")) level = INFO; - else if (l.equals("debug")) level = DEBUG; - else if (l.equals("trace")) level = TRACE; - else throw new ProblemException("No such log level \""+l+"\""); + switch (l) { + case "warn": level = WARN; break; + case "info": level = INFO; break; + case "debug": level = DEBUG; break; + case "trace": level = TRACE; break; + default: + throw new ProblemException("No such log level \"" + l + "\""); + } } static public boolean isTracing() { diff --git a/langtools/src/share/classes/com/sun/tools/sjavac/Main.java b/langtools/src/share/classes/com/sun/tools/sjavac/Main.java index 183ebb56e27..19cfae81bb3 100644 --- a/langtools/src/share/classes/com/sun/tools/sjavac/Main.java +++ b/langtools/src/share/classes/com/sun/tools/sjavac/Main.java @@ -749,8 +749,9 @@ public class Main { * Look for a specific switch, return true if found. */ public static boolean findBooleanOption(String[] args, String option) { - for (int i = 0; i Date: Fri, 6 Dec 2013 09:07:47 -0800 Subject: [PATCH 122/377] 8029504: Regression: TestDocRootLink test fails on Windows Reviewed-by: bpatel, jjg --- .../com/sun/tools/doclets/formats/html/HtmlDocletWriter.java | 2 +- .../test/com/sun/javadoc/testDocRootLink/TestDocRootLink.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java index ef9bb580839..61b61a3b77d 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java @@ -1363,7 +1363,7 @@ public class HtmlDocletWriter extends HtmlDocWriter { return new ContentBuilder(); } - String seetext = replaceDocRootDir(see.text()); + String seetext = replaceDocRootDir(Util.normalizeNewlines(see.text())); //Check if @see is an href or "string" if (seetext.startsWith("<") || seetext.startsWith("\"")) { diff --git a/langtools/test/com/sun/javadoc/testDocRootLink/TestDocRootLink.java b/langtools/test/com/sun/javadoc/testDocRootLink/TestDocRootLink.java index 3811eede9ec..0fa0f59041c 100644 --- a/langtools/test/com/sun/javadoc/testDocRootLink/TestDocRootLink.java +++ b/langtools/test/com/sun/javadoc/testDocRootLink/TestDocRootLink.java @@ -23,7 +23,7 @@ /* * @test - * @bug 6553182 8025416 + * @bug 6553182 8025416 8029504 * @summary This test verifies the -Xdocrootparent option. * @author Bhavesh Patel * @library ../lib/ From 5a005f200b20308b6a9b1d3544821689a912ca03 Mon Sep 17 00:00:00 2001 From: Athijegannathan Sundararajan Date: Mon, 9 Dec 2013 09:48:11 +0530 Subject: [PATCH 123/377] 8029612: the typeErrorThrower field in ScriptFunctionImpl cannot be static and common to all Globals Reviewed-by: attila, hannesw --- .../jdk/nashorn/internal/objects/Global.java | 17 +++++++++++++ .../objects/NativeStrictArguments.java | 2 +- .../internal/objects/ScriptFunctionImpl.java | 25 +++---------------- 3 files changed, 21 insertions(+), 23 deletions(-) diff --git a/nashorn/src/jdk/nashorn/internal/objects/Global.java b/nashorn/src/jdk/nashorn/internal/objects/Global.java index 0a09370aac9..db79f5f9c8d 100644 --- a/nashorn/src/jdk/nashorn/internal/objects/Global.java +++ b/nashorn/src/jdk/nashorn/internal/objects/Global.java @@ -44,6 +44,7 @@ import java.util.concurrent.Callable; import java.util.concurrent.ConcurrentHashMap; import jdk.internal.dynalink.linker.GuardedInvocation; import jdk.internal.dynalink.linker.LinkRequest; +import jdk.nashorn.internal.lookup.Lookup; import jdk.nashorn.internal.objects.annotations.Attribute; import jdk.nashorn.internal.objects.annotations.Property; import jdk.nashorn.internal.objects.annotations.ScriptClass; @@ -364,6 +365,11 @@ public final class Global extends ScriptObject implements GlobalObject, Scope { private ScriptObject builtinFloat32Array; private ScriptObject builtinFloat64Array; + /* + * ECMA section 13.2.3 The [[ThrowTypeError]] Function Object + */ + private ScriptFunction typeErrorThrower; + private PropertyMap accessorPropertyDescriptorMap; private PropertyMap arrayBufferViewMap; private PropertyMap dataPropertyDescriptorMap; @@ -1114,6 +1120,10 @@ public final class Global extends ScriptObject implements GlobalObject, Scope { return builtinArray; } + ScriptFunction getTypeErrorThrower() { + return typeErrorThrower; + } + /** * Called from compiled script code to test if builtin has been overridden * @@ -2000,6 +2010,13 @@ public final class Global extends ScriptObject implements GlobalObject, Scope { anon.set("constructor", builtinFunction, false); anon.deleteOwnProperty(anon.getMap().findProperty("prototype")); + // use "getter" so that [[ThrowTypeError]] function's arity is 0 - as specified in step 10 of section 13.2.3 + this.typeErrorThrower = new ScriptFunctionImpl("TypeErrorThrower", Lookup.TYPE_ERROR_THROWER_GETTER, null, null, false, false, false); + typeErrorThrower.setPrototype(UNDEFINED); + // Non-constructor built-in functions do not have "prototype" property + typeErrorThrower.deleteOwnProperty(typeErrorThrower.getMap().findProperty("prototype")); + typeErrorThrower.preventExtensions(); + // now initialize Object this.builtinObject = (ScriptFunction)initConstructor("Object"); final ScriptObject ObjectPrototype = getObjectPrototype(); diff --git a/nashorn/src/jdk/nashorn/internal/objects/NativeStrictArguments.java b/nashorn/src/jdk/nashorn/internal/objects/NativeStrictArguments.java index de6e4b51435..b81cc2afad4 100644 --- a/nashorn/src/jdk/nashorn/internal/objects/NativeStrictArguments.java +++ b/nashorn/src/jdk/nashorn/internal/objects/NativeStrictArguments.java @@ -76,7 +76,7 @@ public final class NativeStrictArguments extends ScriptObject { super(proto, map); setIsArguments(); - final ScriptFunction func = ScriptFunctionImpl.getTypeErrorThrower(); + final ScriptFunction func = Global.instance().getTypeErrorThrower(); // We have to fill user accessor functions late as these are stored // in this object rather than in the PropertyMap of this object. setUserAccessors("caller", func, func); diff --git a/nashorn/src/jdk/nashorn/internal/objects/ScriptFunctionImpl.java b/nashorn/src/jdk/nashorn/internal/objects/ScriptFunctionImpl.java index 638d18a2087..f0bea3a6e33 100644 --- a/nashorn/src/jdk/nashorn/internal/objects/ScriptFunctionImpl.java +++ b/nashorn/src/jdk/nashorn/internal/objects/ScriptFunctionImpl.java @@ -170,26 +170,6 @@ public class ScriptFunctionImpl extends ScriptFunction { boundfunctionmap$.setIsShared(); } - // function object representing TypeErrorThrower - private static ScriptFunction typeErrorThrower; - - /* - * ECMA section 13.2.3 The [[ThrowTypeError]] Function Object - */ - static synchronized ScriptFunction getTypeErrorThrower() { - if (typeErrorThrower == null) { - // use "getter" so that [[ThrowTypeError]] function's arity is 0 - as specified in step 10 of section 13.2.3 - final ScriptFunctionImpl func = new ScriptFunctionImpl("TypeErrorThrower", Lookup.TYPE_ERROR_THROWER_GETTER, null, null, false, false, false); - func.setPrototype(UNDEFINED); - // Non-constructor built-in functions do not have "prototype" property - func.deleteOwnProperty(func.getMap().findProperty("prototype")); - func.preventExtensions(); - typeErrorThrower = func; - } - - return typeErrorThrower; - } - private static PropertyMap createStrictModeMap(final PropertyMap map) { final int flags = Property.NOT_ENUMERABLE | Property.NOT_CONFIGURABLE; PropertyMap newMap = map; @@ -313,12 +293,13 @@ public class ScriptFunctionImpl extends ScriptFunction { // We have to fill user accessor functions late as these are stored // in this object rather than in the PropertyMap of this object. + final ScriptFunction errorThrower = global.getTypeErrorThrower(); if (findProperty("arguments", true) != null) { - setUserAccessors("arguments", getTypeErrorThrower(), getTypeErrorThrower()); + setUserAccessors("arguments", errorThrower, errorThrower); } if (findProperty("caller", true) != null) { - setUserAccessors("caller", getTypeErrorThrower(), getTypeErrorThrower()); + setUserAccessors("caller", errorThrower, errorThrower); } } } From 7f26a099d0091d1e023be830c29ec961f8a6234f Mon Sep 17 00:00:00 2001 From: Attila Szegedi Date: Mon, 9 Dec 2013 10:52:05 +0100 Subject: [PATCH 124/377] 8029467: Widening of booleans causes bad results Reviewed-by: jlaskey, lagergren --- .../jdk/nashorn/internal/codegen/Attr.java | 24 +++++++++++-- nashorn/test/script/basic/JDK-8029467.js | 34 +++++++++++++++++++ .../test/script/basic/JDK-8029467.js.EXPECTED | 4 +++ 3 files changed, 60 insertions(+), 2 deletions(-) create mode 100644 nashorn/test/script/basic/JDK-8029467.js create mode 100644 nashorn/test/script/basic/JDK-8029467.js.EXPECTED diff --git a/nashorn/src/jdk/nashorn/internal/codegen/Attr.java b/nashorn/src/jdk/nashorn/internal/codegen/Attr.java index f1ced8ada06..177cfef4e4b 100644 --- a/nashorn/src/jdk/nashorn/internal/codegen/Attr.java +++ b/nashorn/src/jdk/nashorn/internal/codegen/Attr.java @@ -766,7 +766,7 @@ final class Attr extends NodeOperatorVisitor { symbol.setType(Type.OBJECT); } - returnType = Type.widest(returnTypes.pop(), symbol.getSymbolType()); + returnType = widestReturnType(returnTypes.pop(), symbol.getSymbolType()); } else { returnType = Type.OBJECT; //undefined } @@ -1433,10 +1433,30 @@ final class Attr extends NodeOperatorVisitor { ensureTypeNotUnknown(trueExpr); ensureTypeNotUnknown(falseExpr); - final Type type = Type.widest(trueExpr.getType(), falseExpr.getType()); + final Type type = widestReturnType(trueExpr.getType(), falseExpr.getType()); return end(ensureSymbol(type, ternaryNode)); } + /** + * When doing widening for return types of a function or a ternary operator, it is not valid to widen a boolean to + * anything other than Object. Also, widening a numeric type to an object type must widen to Object proper and not + * any more specific subclass (e.g. widest of int/long/double and String is Object). + * @param t1 type 1 + * @param t2 type 2 + * @return wider of t1 and t2, except if one is boolean and the other is neither boolean nor unknown, or if one is + * numeric and the other is neither numeric nor unknown in which case {@code Type.OBJECT} is returned. + */ + private static Type widestReturnType(final Type t1, final Type t2) { + if (t1.isUnknown()) { + return t2; + } else if (t2.isUnknown()) { + return t1; + } else if (t1.isBoolean() != t2.isBoolean() || t1.isNumeric() != t2.isNumeric()) { + return Type.OBJECT; + } + return Type.widest(t1, t2); + } + private void initCompileConstant(final CompilerConstants cc, final Block block, final int flags) { final Class type = cc.type(); // Must not call this method for constants with no explicit types; use the one with (..., Type) signature instead. diff --git a/nashorn/test/script/basic/JDK-8029467.js b/nashorn/test/script/basic/JDK-8029467.js new file mode 100644 index 00000000000..ad7f2fde6bb --- /dev/null +++ b/nashorn/test/script/basic/JDK-8029467.js @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * 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. + */ + +/** + * JDK-8029467: Widening of booleans causes bad results + * + * @test + * @run + */ + +print((function (x) { return x ? true : 0 })(true)) +print((function (x) { if(x) { return true } else { return 0 } })(true)) +print(typeof (function (x) { return x ? 1 : "123" })(true) === "number") +print(typeof (function (x) { if(x) { return 1 } else { return "123" } })(true) === "number") diff --git a/nashorn/test/script/basic/JDK-8029467.js.EXPECTED b/nashorn/test/script/basic/JDK-8029467.js.EXPECTED new file mode 100644 index 00000000000..1140ff52e2b --- /dev/null +++ b/nashorn/test/script/basic/JDK-8029467.js.EXPECTED @@ -0,0 +1,4 @@ +true +true +true +true From c502f1025ed414ae568cc7c5bec8ce9368ffcd0d Mon Sep 17 00:00:00 2001 From: Marcus Lagergren Date: Wed, 11 Dec 2013 18:09:34 +0100 Subject: [PATCH 125/377] 8029780: "ant externals" broke our test harness with the latest version of the octane benchmarks Reviewed-by: attila, sundar --- nashorn/make/build-benchmark.xml | 47 ++++++++- .../basic/compile-octane-splitter.js.EXPECTED | 27 +++--- .../script/basic/compile-octane.js.EXPECTED | 27 +++--- nashorn/test/script/basic/run-octane.js | 96 +++++++++++-------- 4 files changed, 129 insertions(+), 68 deletions(-) diff --git a/nashorn/make/build-benchmark.xml b/nashorn/make/build-benchmark.xml index 8f2296b028e..ac87fc120f6 100644 --- a/nashorn/make/build-benchmark.xml +++ b/nashorn/make/build-benchmark.xml @@ -239,7 +239,7 @@ - + @@ -291,17 +291,56 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + octane-mandreel, octane-navier-stokes, octane-pdfjs, + octane-raytrace, octane-regexp, octane-richards, + octane-splay, octane-typescript"/> diff --git a/nashorn/test/script/basic/compile-octane-splitter.js.EXPECTED b/nashorn/test/script/basic/compile-octane-splitter.js.EXPECTED index 153524c70b4..9e4920dcfbf 100644 --- a/nashorn/test/script/basic/compile-octane-splitter.js.EXPECTED +++ b/nashorn/test/script/basic/compile-octane-splitter.js.EXPECTED @@ -1,13 +1,14 @@ -Compiled OK: box2d -Compiled OK: code-load -Compiled OK: crypto -Compiled OK: deltablue -Compiled OK: earley-boyer -Compiled OK: gbemu -Compiled OK: mandreel -Compiled OK: navier-stokes -Compiled OK: pdfjs -Compiled OK: raytrace -Compiled OK: regexp -Compiled OK: richards -Compiled OK: splay +[box2d] Compiled OK +[code-load] Compiled OK +[crypto] Compiled OK +[deltablue] Compiled OK +[earley-boyer] Compiled OK +[gbemu] Compiled OK +[mandreel] Compiled OK +[navier-stokes] Compiled OK +[pdfjs] Compiled OK +[raytrace] Compiled OK +[regexp] Compiled OK +[richards] Compiled OK +[splay] Compiled OK +[typescript] Compiled OK diff --git a/nashorn/test/script/basic/compile-octane.js.EXPECTED b/nashorn/test/script/basic/compile-octane.js.EXPECTED index 153524c70b4..9e4920dcfbf 100644 --- a/nashorn/test/script/basic/compile-octane.js.EXPECTED +++ b/nashorn/test/script/basic/compile-octane.js.EXPECTED @@ -1,13 +1,14 @@ -Compiled OK: box2d -Compiled OK: code-load -Compiled OK: crypto -Compiled OK: deltablue -Compiled OK: earley-boyer -Compiled OK: gbemu -Compiled OK: mandreel -Compiled OK: navier-stokes -Compiled OK: pdfjs -Compiled OK: raytrace -Compiled OK: regexp -Compiled OK: richards -Compiled OK: splay +[box2d] Compiled OK +[code-load] Compiled OK +[crypto] Compiled OK +[deltablue] Compiled OK +[earley-boyer] Compiled OK +[gbemu] Compiled OK +[mandreel] Compiled OK +[navier-stokes] Compiled OK +[pdfjs] Compiled OK +[raytrace] Compiled OK +[regexp] Compiled OK +[richards] Compiled OK +[splay] Compiled OK +[typescript] Compiled OK diff --git a/nashorn/test/script/basic/run-octane.js b/nashorn/test/script/basic/run-octane.js index b730040e4c5..840f07b743f 100644 --- a/nashorn/test/script/basic/run-octane.js +++ b/nashorn/test/script/basic/run-octane.js @@ -26,19 +26,22 @@ */ var tests = [ - {file:"box2d",suite:"Box2DBenchmark"}, - {file:"code-load",suite:"CodeLoad"}, - {file:"crypto",suite:"Crypto"}, - {file:"deltablue",suite:"DeltaBlue"}, - {file:"earley-boyer", suite:"EarleyBoyer"}, - {file:"gbemu", suite:"GameboyBenchmark"}, - {file:"mandreel", suite:"MandreelBenchmark"}, - {file:"navier-stokes", suite:"NavierStokes"}, - {file:"pdfjs", suite:"PdfJS"}, - {file:"raytrace", suite:"RayTrace"}, - {file:"regexp", suite:"RegExpSuite"}, - {file:"richards", suite:"Richards"}, - {file:"splay", suite:"Splay"} + {name:"box2d", files:["box2d.js"], suite:"Box2DBenchmark"}, + {name:"code-load", files:["code-load.js"], suite:"CodeLoad"}, + {name:"crypto", files:["crypto.js"], suite:"Crypto"}, + {name:"deltablue", files:["deltablue.js"], suite:"DeltaBlue"}, + {name:"earley-boyer", files:["earley-boyer.js"], suite:"EarleyBoyer"}, + {name:"gbemu", files:["gbemu-part1.js", "gbemu-part2.js"], suite:"GameboyBenchmark"}, + {name:"mandreel", files:["mandreel.js"], suite:"MandreelBenchmark"}, + {name:"navier-stokes", files:["navier-stokes.js"], suite:"NavierStokes"}, + {name:"pdfjs", files:["pdfjs.js"], suite:"PdfJS"}, + {name:"raytrace", files:["raytrace.js"], suite:"RayTrace"}, + {name:"regexp", files:["regexp.js"], suite:"RegExpSuite"}, + {name:"richards", files:["richards.js"], suite:"Richards"}, + {name:"splay", files:["splay.js"], suite:"Splay"}, + {name:"typescript", files:["typescript.js", "typescript-input.js", "typescript-compiler.js"], suite:"typescript"} + //zlib currently disabled - requires read + // {name:"zlib", files:["zlib.js", "zlib-data.js"], suite:"zlib"}, ]; var dir = (typeof(__DIR__) == 'undefined') ? "test/script/basic/" : __DIR__; @@ -58,26 +61,36 @@ function should_compile_only(name) { return (typeof compile_only !== 'undefined') } -function run_one_benchmark(arg, iters) { - var file_name; - var file = (arg.file + ".js").split('/'); +function load_bench(arg) { + + for (var idx = 0; idx < arg.files.length; idx++) { + var f = arg.files[idx]; + var file = f.split('/'); + var file_name = path + file[file.length - 1]; - file_name = path + file[file.length - 1]; - - var compile_and_return = should_compile_only(file_name); - if (compile_and_return) { - if (typeof compile_only === 'undefined') { //for a run, skip compile onlies, don't even compile them - return; + var compile_and_return = should_compile_only(file_name); + if (compile_and_return) { + if (typeof compile_only === 'undefined') { //for a run, skip compile onlies, don't even compile them + return true; + } } + + print_verbose(arg, "loading '" + arg.name + "' [" + f + "]..."); + load(file_name); } - - print_verbose("Loading... " + file_name); - load(file_name); - + if (compile_and_return) { - print_always("Compiled OK: " + arg.file); - return; + print_always(arg, "Compiled OK"); } + return !compile_and_return; + +} + +function run_one_benchmark(arg, iters) { + + if (!load_bench(arg)) { + return; + } var success = true; var current_name; @@ -95,9 +108,13 @@ function run_one_benchmark(arg, iters) { try { for (var x = 0; x < benchmarks.length ; x++) { + //do warmup run + //reset random number generator needed as of octane 9 before each run + BenchmarkSuite.ResetRNG(); benchmarks[x].Setup(); } - print_verbose("Running '" + arg.file + "' for " + iters + " iterations of no less than " + min_time + " seconds (" + runtime + ")"); + BenchmarkSuite.ResetRNG(); + print_verbose(arg, "running '" + arg.name + "' for " + iters + " iterations of no less than " + min_time + " seconds (" + runtime + ")"); var scores = []; @@ -112,6 +129,9 @@ function run_one_benchmark(arg, iters) { do { for (var i = 0; i < len; i++) { benchmarks[i].run(); + //important - no timing here like elapsed = new Date() - start, as in the + //original harness. This will make timing very non-deterministic. + //NOTHING else must live in this loop } ops += len; elapsed = new Date - start; @@ -120,7 +140,7 @@ function run_one_benchmark(arg, iters) { var score = ops / elapsed * 1000 * 60; scores.push(score); var name = it == 0 ? "warmup" : "iteration " + it; - print_verbose("[" + arg.file + "] " + name + " finished " + score.toFixed(0) + " ops/minute"); + print_verbose(arg, name + " finished " + score.toFixed(0) + " ops/minute"); } for (var x = 0; x < benchmarks.length ; x++) { @@ -140,20 +160,20 @@ function run_one_benchmark(arg, iters) { scores = [0]; } - var res = "[" + arg.file + "] " + mean_score.toFixed(0); + var res = mean_score.toFixed(0); if (verbose) { res += " ops/minute (" + min_score.toFixed(0) + "-" + max_score.toFixed(0) + "), warmup=" + scores[0].toFixed(0); } - print_always(res); + print_always(arg, res); } -function print_always(x) { - print(x); +function print_always(arg, x) { + print("[" + arg.name + "] " + x); } -function print_verbose(x) { +function print_verbose(arg, x) { if (verbose) { - print(x); + print_always(arg, x) } } @@ -209,7 +229,7 @@ for (var i = 0; i < args.length; i++) { } else { var found = false; for (j in tests) { - if (tests[j].file === arg) { + if (tests[j].name === arg) { tests_found.push(tests[j]); found = true; break; @@ -221,7 +241,7 @@ for (var i = 0; i < args.length; i++) { if (j != 0) { str += ", "; } - str += "'" + tests[j].file + "'"; + str += "'" + tests[j].name + "'"; } throw str; } From 73f4f12f6a2c908a9e93e536e2821217fa55de37 Mon Sep 17 00:00:00 2001 From: Joe Darcy Date: Fri, 13 Dec 2013 15:24:38 -0800 Subject: [PATCH 126/377] 8030082: Fix raw types lint warnings, etc. in various sun.security libraries Reviewed-by: chegar, mullan --- .../share/classes/sun/security/jca/ProviderConfig.java | 4 ++-- .../share/classes/sun/security/provider/PolicyFile.java | 8 ++++---- .../share/classes/sun/security/x509/CRLExtensions.java | 4 ++-- .../classes/sun/security/x509/CertificateExtensions.java | 4 ++-- jdk/src/share/classes/sun/security/x509/X509CertImpl.java | 3 +-- 5 files changed, 11 insertions(+), 12 deletions(-) diff --git a/jdk/src/share/classes/sun/security/jca/ProviderConfig.java b/jdk/src/share/classes/sun/security/jca/ProviderConfig.java index 62f8bddc640..d6c243b1834 100644 --- a/jdk/src/share/classes/sun/security/jca/ProviderConfig.java +++ b/jdk/src/share/classes/sun/security/jca/ProviderConfig.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -58,7 +58,7 @@ final class ProviderConfig { // parameters for the Provider(String) constructor, // use by doLoadProvider() - private final static Class[] CL_STRING = { String.class }; + private final static Class[] CL_STRING = { String.class }; // name of the provider class private final String className; diff --git a/jdk/src/share/classes/sun/security/provider/PolicyFile.java b/jdk/src/share/classes/sun/security/provider/PolicyFile.java index f92e1d5905c..ec3b54c2dcb 100644 --- a/jdk/src/share/classes/sun/security/provider/PolicyFile.java +++ b/jdk/src/share/classes/sun/security/provider/PolicyFile.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -285,9 +285,9 @@ public class PolicyFile extends java.security.Policy { // for use with the reflection API - private static final Class[] PARAMS0 = { }; - private static final Class[] PARAMS1 = { String.class }; - private static final Class[] PARAMS2 = { String.class, String.class }; + private static final Class[] PARAMS0 = { }; + private static final Class[] PARAMS1 = { String.class }; + private static final Class[] PARAMS2 = { String.class, String.class }; /** * Initializes the Policy object and reads the default policy diff --git a/jdk/src/share/classes/sun/security/x509/CRLExtensions.java b/jdk/src/share/classes/sun/security/x509/CRLExtensions.java index 5e7f42dee0c..628e1125add 100644 --- a/jdk/src/share/classes/sun/security/x509/CRLExtensions.java +++ b/jdk/src/share/classes/sun/security/x509/CRLExtensions.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -106,7 +106,7 @@ public class CRLExtensions { } } - private static final Class[] PARAMS = {Boolean.class, Object.class}; + private static final Class[] PARAMS = {Boolean.class, Object.class}; // Parse the encoded extension private void parseExtension(Extension ext) throws CRLException { diff --git a/jdk/src/share/classes/sun/security/x509/CertificateExtensions.java b/jdk/src/share/classes/sun/security/x509/CertificateExtensions.java index 75d5ae35b0e..8471be38ae1 100644 --- a/jdk/src/share/classes/sun/security/x509/CertificateExtensions.java +++ b/jdk/src/share/classes/sun/security/x509/CertificateExtensions.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -89,7 +89,7 @@ public class CertificateExtensions implements CertAttrSet { } } - private static Class[] PARAMS = {Boolean.class, Object.class}; + private static Class[] PARAMS = {Boolean.class, Object.class}; // Parse the encoded extension private void parseExtension(Extension ext) throws IOException { diff --git a/jdk/src/share/classes/sun/security/x509/X509CertImpl.java b/jdk/src/share/classes/sun/security/x509/X509CertImpl.java index b3f448b09fd..aa24360f46f 100644 --- a/jdk/src/share/classes/sun/security/x509/X509CertImpl.java +++ b/jdk/src/share/classes/sun/security/x509/X509CertImpl.java @@ -1115,8 +1115,7 @@ public class X509CertImpl extends X509Certificate implements DerEncoder { SubjectKeyIdentifierExtension ski = getSubjectKeyIdentifierExtension(); if (ski != null) { try { - return (KeyIdentifier)ski.get( - SubjectKeyIdentifierExtension.KEY_ID); + return ski.get(SubjectKeyIdentifierExtension.KEY_ID); } catch (IOException ioe) {} // not possible } return null; From 997e4bbc8b8f32eb7bc3e3e8e114454bb7c3fa12 Mon Sep 17 00:00:00 2001 From: Brian Burkhalter Date: Fri, 13 Dec 2013 16:15:58 -0800 Subject: [PATCH 127/377] 4891331: BigInteger a.multiply(a) should use squaring code Change multiply(BigInteger a) to return square() if a == this and the number of ints in the magnitude is over a threshold. Reviewed-by: darcy, shade --- .../share/classes/java/math/BigInteger.java | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/jdk/src/share/classes/java/math/BigInteger.java b/jdk/src/share/classes/java/math/BigInteger.java index 79291ee34d2..6fa5d4214f1 100644 --- a/jdk/src/share/classes/java/math/BigInteger.java +++ b/jdk/src/share/classes/java/math/BigInteger.java @@ -268,7 +268,15 @@ public class BigInteger extends Number implements Comparable { */ private static final int SCHOENHAGE_BASE_CONVERSION_THRESHOLD = 20; - //Constructors + /** + * The threshold value for using squaring code to perform multiplication + * of a {@code BigInteger} instance by itself. If the number of ints in + * the number are larger than this value, {@code multiply(this)} will + * return {@code square()}. + */ + private static final int MULTIPLY_SQUARE_THRESHOLD = 20; + + // Constructors /** * Translates a byte array containing the two's-complement binary @@ -1458,6 +1466,9 @@ public class BigInteger extends Number implements Comparable { /** * Returns a BigInteger whose value is {@code (this * val)}. * + * @implNote An implementation may offer better algorithmic + * performance when {@code val == this}. + * * @param val value to be multiplied by this BigInteger. * @return {@code this * val} */ @@ -1466,6 +1477,11 @@ public class BigInteger extends Number implements Comparable { return ZERO; int xlen = mag.length; + + if (val == this && xlen > MULTIPLY_SQUARE_THRESHOLD) { + return square(); + } + int ylen = val.mag.length; if ((xlen < KARATSUBA_THRESHOLD) || (ylen < KARATSUBA_THRESHOLD)) { From 91cc7f3c28eef4ef9b5ccd679fbed47095865fb6 Mon Sep 17 00:00:00 2001 From: Alan Bateman Date: Sat, 14 Dec 2013 09:27:12 +0000 Subject: [PATCH 128/377] 8027212: java/nio/channels/Selector/SelectAfterRead.java fails intermittently Reviewed-by: chegar, ewang --- .../nio/channels/Selector/ByteServer.java | 68 +++++++------- .../channels/Selector/ReadAfterConnect.java | 34 ++++--- .../channels/Selector/SelectAfterRead.java | 92 ++++++++++--------- .../nio/channels/Selector/SelectWrite.java | 43 ++++----- 4 files changed, 118 insertions(+), 119 deletions(-) diff --git a/jdk/test/java/nio/channels/Selector/ByteServer.java b/jdk/test/java/nio/channels/Selector/ByteServer.java index eefd1fb17a5..40d8adfb82c 100644 --- a/jdk/test/java/nio/channels/Selector/ByteServer.java +++ b/jdk/test/java/nio/channels/Selector/ByteServer.java @@ -22,52 +22,54 @@ */ /** - * - * Utility class for tests. A simple server, which waits for a connection, - * writes out n bytes and waits. + * Utility class for tests. A simple "in-thread" server to accept connections + * and write bytes. * @author kladko */ import java.net.Socket; import java.net.ServerSocket; +import java.net.SocketAddress; +import java.net.InetSocketAddress; +import java.io.IOException; +import java.io.Closeable; -public class ByteServer { +public class ByteServer implements Closeable { - public static final String LOCALHOST = "localhost"; - private int bytecount; - private Socket socket; - private ServerSocket serversocket; - private Thread serverthread; - volatile Exception savedException; + private final ServerSocket ss; + private Socket s; - public ByteServer(int bytecount) throws Exception{ - this.bytecount = bytecount; - serversocket = new ServerSocket(0); + ByteServer() throws IOException { + this.ss = new ServerSocket(0); } - public int port() { - return serversocket.getLocalPort(); + SocketAddress address() { + return new InetSocketAddress(ss.getInetAddress(), ss.getLocalPort()); } - public void start() { - serverthread = new Thread() { - public void run() { - try { - socket = serversocket.accept(); - socket.getOutputStream().write(new byte[bytecount]); - socket.getOutputStream().flush(); - } catch (Exception e) { - System.err.println("Exception in ByteServer: " + e); - System.exit(1); - } - } - }; - serverthread.start(); + void acceptConnection() throws IOException { + if (s != null) + throw new IllegalStateException("already connected"); + this.s = ss.accept(); } - public void exit() throws Exception { - serverthread.join(); - socket.close(); - serversocket.close(); + void closeConnection() throws IOException { + Socket s = this.s; + if (s != null) { + this.s = null; + s.close(); + } + } + + void write(int count) throws IOException { + if (s == null) + throw new IllegalStateException("no connection"); + s.getOutputStream().write(new byte[count]); + } + + public void close() throws IOException { + if (s != null) + s.close(); + ss.close(); } } diff --git a/jdk/test/java/nio/channels/Selector/ReadAfterConnect.java b/jdk/test/java/nio/channels/Selector/ReadAfterConnect.java index e5d0b091b82..93318fb6436 100644 --- a/jdk/test/java/nio/channels/Selector/ReadAfterConnect.java +++ b/jdk/test/java/nio/channels/Selector/ReadAfterConnect.java @@ -27,27 +27,25 @@ * @author kladko */ -import java.net.*; -import java.nio.*; -import java.nio.channels.*; +import java.nio.channels.Selector; +import java.nio.channels.SelectionKey; +import java.nio.channels.SocketChannel; public class ReadAfterConnect { - public static void main(String[] argv) throws Exception { - ByteServer server = new ByteServer(0); // server: accept connection and do nothing - server.start(); - InetSocketAddress isa = new InetSocketAddress( - InetAddress.getByName(ByteServer.LOCALHOST), server.port()); - Selector sel = Selector.open(); - SocketChannel sc = SocketChannel.open(); - sc.connect(isa); - sc.configureBlocking(false); - sc.register(sel, SelectionKey.OP_READ); - // Previously channel would get selected here, although there is nothing to read - if (sel.selectNow() != 0) - throw new Exception("Select returned nonzero value"); - sc.close(); - server.exit(); + try (ByteServer server = new ByteServer(); + SocketChannel sc = SocketChannel.open(server.address())) { + + server.acceptConnection(); + + try (Selector sel = Selector.open()) { + sc.configureBlocking(false); + sc.register(sel, SelectionKey.OP_READ); + // Previously channel would get selected here, although there is nothing to read + if (sel.selectNow() != 0) + throw new Exception("Select returned nonzero value"); + } + } } } diff --git a/jdk/test/java/nio/channels/Selector/SelectAfterRead.java b/jdk/test/java/nio/channels/Selector/SelectAfterRead.java index fccd9ddb56e..35631465217 100644 --- a/jdk/test/java/nio/channels/Selector/SelectAfterRead.java +++ b/jdk/test/java/nio/channels/Selector/SelectAfterRead.java @@ -28,60 +28,62 @@ * @author kladko */ -import java.net.*; -import java.nio.*; -import java.nio.channels.*; +import java.nio.ByteBuffer; +import java.nio.channels.Selector; +import java.nio.channels.SelectionKey; +import java.nio.channels.SocketChannel; public class SelectAfterRead { - final static int TIMEOUT = 1000; + private static final int TIMEOUT = 1000; public static void main(String[] argv) throws Exception { - InetAddress lh = InetAddress.getByName(ByteServer.LOCALHOST); // server: accept connection and write one byte - ByteServer server = new ByteServer(1); - server.start(); - Selector sel = Selector.open(); - SocketChannel sc = SocketChannel.open(); - sc.connect(new InetSocketAddress(lh, server.port())); - sc.read(ByteBuffer.allocate(1)); - sc.configureBlocking(false); - sc.register(sel, SelectionKey.OP_READ); - // previously on Windows select would select channel here, although there was - // nothing to read - if (sel.selectNow() != 0) - throw new Exception("Select returned nonzero value"); - sc.close(); - sel.close(); - server.exit(); + try (ByteServer server = new ByteServer(); + SocketChannel sc = SocketChannel.open(server.address())) { + + server.acceptConnection(); + server.write(1); + + try (Selector sel = Selector.open()) { + sc.read(ByteBuffer.allocate(1)); + sc.configureBlocking(false); + sc.register(sel, SelectionKey.OP_READ); + // previously on Windows select would select channel here, although there was + // nothing to read + if (sel.selectNow() != 0) + throw new Exception("Select returned nonzero value"); + } + } // Now we will test a two reads combination // server: accept connection and write two bytes - server = new ByteServer(2); - server.start(); - sc = SocketChannel.open(); - sc.connect(new InetSocketAddress(lh, server.port())); - sc.configureBlocking(false); - sel = Selector.open(); - sc.register(sel, SelectionKey.OP_READ); - if (sel.select(TIMEOUT) != 1) - throw new Exception("One selected key expected"); - sel.selectedKeys().clear(); - // previously on Windows a channel would get selected only once - if (sel.selectNow() != 1) - throw new Exception("One selected key expected"); - // Previously on Windows two consequent reads would cause select() - // to select a channel, although there was nothing remaining to - // read in the channel - if (sc.read(ByteBuffer.allocate(1)) != 1) - throw new Exception("One byte expected"); - if (sc.read(ByteBuffer.allocate(1)) != 1) - throw new Exception("One byte expected"); - if (sel.selectNow() != 0) - throw new Exception("Select returned nonzero value"); - sc.close(); - sel.close(); - server.exit(); + try (ByteServer server = new ByteServer(); + SocketChannel sc = SocketChannel.open(server.address())) { + + server.acceptConnection(); + server.write(2); + + try (Selector sel = Selector.open()) { + sc.configureBlocking(false); + sc.register(sel, SelectionKey.OP_READ); + if (sel.select(TIMEOUT) != 1) + throw new Exception("One selected key expected"); + sel.selectedKeys().clear(); + // previously on Windows a channel would get selected only once + if (sel.selectNow() != 1) + throw new Exception("One selected key expected"); + // Previously on Windows two consequent reads would cause select() + // to select a channel, although there was nothing remaining to + // read in the channel + if (sc.read(ByteBuffer.allocate(1)) != 1) + throw new Exception("One byte expected"); + if (sc.read(ByteBuffer.allocate(1)) != 1) + throw new Exception("One byte expected"); + if (sel.selectNow() != 0) + throw new Exception("Select returned nonzero value"); + } + } } } diff --git a/jdk/test/java/nio/channels/Selector/SelectWrite.java b/jdk/test/java/nio/channels/Selector/SelectWrite.java index 3c2d3d8870e..ab305edd174 100644 --- a/jdk/test/java/nio/channels/Selector/SelectWrite.java +++ b/jdk/test/java/nio/channels/Selector/SelectWrite.java @@ -22,36 +22,33 @@ */ /* @test - @bug 4645302 - @summary Socket with OP_WRITE would get selected only once - @author kladko + * @bug 4645302 + * @summary Socket with OP_WRITE would get selected only once + * @author kladko */ -import java.net.*; -import java.nio.*; -import java.nio.channels.*; - +import java.nio.channels.Selector; +import java.nio.channels.SelectionKey; +import java.nio.channels.SocketChannel; public class SelectWrite { public static void main(String[] argv) throws Exception { - ByteServer server = new ByteServer(0); - // server: accept connection and do nothing - server.start(); - InetSocketAddress isa = new InetSocketAddress( - InetAddress.getByName(ByteServer.LOCALHOST), server.port()); - Selector sel = Selector.open(); - SocketChannel sc = SocketChannel.open(); - sc.connect(isa); - sc.configureBlocking(false); - sc.register(sel, SelectionKey.OP_WRITE); - sel.select(); - sel.selectedKeys().clear(); - if (sel.select() == 0) { - throw new Exception("Select returned zero"); + try (ByteServer server = new ByteServer(); + SocketChannel sc = SocketChannel.open(server.address())) { + + server.acceptConnection(); + + try (Selector sel = Selector.open()) { + sc.configureBlocking(false); + sc.register(sel, SelectionKey.OP_WRITE); + sel.select(); + sel.selectedKeys().clear(); + if (sel.select() == 0) { + throw new Exception("Select returned zero"); + } + } } - sc.close(); - sel.close(); } } From f9b9d83582192203de5b0fe01a2425de3781b384 Mon Sep 17 00:00:00 2001 From: Dan Xu Date: Sat, 14 Dec 2013 16:37:49 -0800 Subject: [PATCH 129/377] 8022219: Intermittent test failures in java/util/zip/ZipFile Reviewed-by: alanb, chegar --- .../java/util/zip/ZipFile/ReadLongZipFileName.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/jdk/test/java/util/zip/ZipFile/ReadLongZipFileName.java b/jdk/test/java/util/zip/ZipFile/ReadLongZipFileName.java index 7b6aa64801a..217ce52dcd3 100644 --- a/jdk/test/java/util/zip/ZipFile/ReadLongZipFileName.java +++ b/jdk/test/java/util/zip/ZipFile/ReadLongZipFileName.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -24,6 +24,7 @@ /** * @test * @bug 6374379 + * @library ../../../../lib/testlibrary * @summary Verify that we can read zip file names > 255 chars long */ @@ -31,6 +32,7 @@ import java.io.*; import java.util.jar.*; import java.util.zip.*; import java.util.Stack; +import jdk.testlibrary.FileUtils; public class ReadLongZipFileName { private static String entryName = "testFile.txt";; @@ -101,7 +103,12 @@ public class ReadLongZipFileName { while (! directories.empty()) { File f = directories.pop(); - check(f.delete()); + try { + FileUtils.deleteFileWithRetry(f.toPath()); + } catch (IOException e) { + unexpected(e, "Fail to clean up directory, " + f); + break; + } } } From 4d74f5cae5e985b0a3e428f2292f7b2e0d07e46f Mon Sep 17 00:00:00 2001 From: Dan Xu Date: Sat, 14 Dec 2013 20:36:10 -0800 Subject: [PATCH 130/377] 8025437: Check DefaultProxySelector for JNI pending exception issues Reviewed-by: michaelm, chegar, alanb --- .../native/sun/net/spi/DefaultProxySelector.c | 134 +++++++++--------- 1 file changed, 67 insertions(+), 67 deletions(-) diff --git a/jdk/src/solaris/native/sun/net/spi/DefaultProxySelector.c b/jdk/src/solaris/native/sun/net/spi/DefaultProxySelector.c index 76b2e2dae42..e2ecd979072 100644 --- a/jdk/src/solaris/native/sun/net/spi/DefaultProxySelector.c +++ b/jdk/src/solaris/native/sun/net/spi/DefaultProxySelector.c @@ -38,6 +38,10 @@ #include #endif +#ifndef CHECK_NULL_RETURN +#define CHECK_NULL_RETURN(x, y) if ((x) == NULL) return y; +#endif + /** * These functions are used by the sun.net.spi.DefaultProxySelector class * to access some platform specific settings. @@ -114,18 +118,36 @@ static jclass isaddr_class; static jclass ptype_class; static jmethodID isaddr_createUnresolvedID; static jmethodID proxy_ctrID; -static jfieldID pr_no_proxyID; static jfieldID ptype_httpID; static jfieldID ptype_socksID; static void* gconf_client = NULL; - static int use_gproxyResolver = 0; static int use_gconf = 0; -#define CHECK_NULL(X) { if ((X) == NULL) fprintf (stderr,"JNI errror at line %d\n", __LINE__); } +static jobject createProxy(JNIEnv *env, jfieldID ptype_ID, + const char* phost, unsigned short pport) +{ + jobject jProxy = NULL; + jobject type_proxy = NULL; + type_proxy = (*env)->GetStaticObjectField(env, ptype_class, ptype_ID); + if (type_proxy) { + jstring jhost = NULL; + jhost = (*env)->NewStringUTF(env, phost); + if (jhost) { + jobject isa = NULL; + isa = (*env)->CallStaticObjectMethod(env, isaddr_class, + isaddr_createUnresolvedID, jhost, pport); + if (isa) { + jProxy = (*env)->NewObject(env, proxy_class, proxy_ctrID, + type_proxy, isa); + } + } + } + return jProxy; +} static int initGConf() { /** @@ -182,9 +204,8 @@ static jobject getProxyByGConf(JNIEnv *env, const char* cproto, int pport = 0; int use_proxy = 0; int use_same_proxy = 0; - jobject isa = NULL; jobject proxy = NULL; - jobject type_proxy = NULL; + jfieldID ptype_ID = ptype_httpID; // We only check manual proxy configurations mode = (*my_get_string_func)(gconf_client, "/system/proxy/mode", NULL); @@ -199,8 +220,6 @@ static jobject getProxyByGConf(JNIEnv *env, const char* cproto, phost = (*my_get_string_func)(gconf_client, "/system/http_proxy/host", NULL); pport = (*my_get_int_func)(gconf_client, "/system/http_proxy/port", NULL); use_proxy = (phost != NULL && pport != 0); - if (use_proxy) - type_proxy = (*env)->GetStaticObjectField(env, ptype_class, ptype_httpID); } if (!use_proxy) { @@ -214,8 +233,6 @@ static jobject getProxyByGConf(JNIEnv *env, const char* cproto, phost = (*my_get_string_func)(gconf_client, "/system/http_proxy/host", NULL); pport = (*my_get_int_func)(gconf_client, "/system/http_proxy/port", NULL); use_proxy = (phost != NULL && pport != 0); - if (use_proxy) - type_proxy = (*env)->GetStaticObjectField(env, ptype_class, ptype_httpID); } /** @@ -228,8 +245,6 @@ static jobject getProxyByGConf(JNIEnv *env, const char* cproto, phost = (*my_get_string_func)(gconf_client, "/system/proxy/secure_host", NULL); pport = (*my_get_int_func)(gconf_client, "/system/proxy/secure_port", NULL); use_proxy = (phost != NULL && pport != 0); - if (use_proxy) - type_proxy = (*env)->GetStaticObjectField(env, ptype_class, ptype_httpID); } /** @@ -242,8 +257,6 @@ static jobject getProxyByGConf(JNIEnv *env, const char* cproto, phost = (*my_get_string_func)(gconf_client, "/system/proxy/ftp_host", NULL); pport = (*my_get_int_func)(gconf_client, "/system/proxy/ftp_port", NULL); use_proxy = (phost != NULL && pport != 0); - if (use_proxy) - type_proxy = (*env)->GetStaticObjectField(env, ptype_class, ptype_httpID); } /** @@ -256,8 +269,6 @@ static jobject getProxyByGConf(JNIEnv *env, const char* cproto, phost = (*my_get_string_func)(gconf_client, "/system/proxy/gopher_host", NULL); pport = (*my_get_int_func)(gconf_client, "/system/proxy/gopher_port", NULL); use_proxy = (phost != NULL && pport != 0); - if (use_proxy) - type_proxy = (*env)->GetStaticObjectField(env, ptype_class, ptype_httpID); } /** @@ -271,7 +282,7 @@ static jobject getProxyByGConf(JNIEnv *env, const char* cproto, pport = (*my_get_int_func)(gconf_client, "/system/proxy/socks_port", NULL); use_proxy = (phost != NULL && pport != 0); if (use_proxy) - type_proxy = (*env)->GetStaticObjectField(env, ptype_class, ptype_socksID); + ptype_ID = ptype_socksID; } } } @@ -302,12 +313,8 @@ static jobject getProxyByGConf(JNIEnv *env, const char* cproto, s = strtok_r(NULL, ", ", tmpbuf); } } - if (use_proxy) { - CHECK_NULL(type_proxy); - jhost = (*env)->NewStringUTF(env, phost); - isa = (*env)->CallStaticObjectMethod(env, isaddr_class, isaddr_createUnresolvedID, jhost, pport); - proxy = (*env)->NewObject(env, proxy_class, proxy_ctrID, type_proxy, isa); - } + if (use_proxy) + proxy = createProxy(env, ptype_ID, phost, pport); } return proxy; @@ -375,7 +382,7 @@ static jobject getProxyByGProxyResolver(JNIEnv *env, const char* cproto, size_t hostLen = 0; char* uri = NULL; - jobject objProxy = NULL; + jobject jProxy = NULL; resolver = (*g_proxy_resolver_get_default)(); if (resolver == NULL) { @@ -407,7 +414,7 @@ static jobject getProxyByGProxyResolver(JNIEnv *env, const char* cproto, if (proxies) { if (!error) { int i; - for(i = 0; proxies[i] && !objProxy; i++) { + for(i = 0; proxies[i] && !jProxy; i++) { if (strcmp(proxies[i], "direct://")) { GSocketConnectable* conn = (*g_network_address_parse_uri)(proxies[i], 0, @@ -418,25 +425,11 @@ static jobject getProxyByGProxyResolver(JNIEnv *env, const char* cproto, phost = (*g_network_address_get_hostname)(conn); pport = (*g_network_address_get_port)(conn); if (phost && pport > 0) { - jobject type_proxy = NULL; - jstring jhost = NULL; - jobject isa = NULL; jfieldID ptype_ID = ptype_httpID; - if (!strncmp(proxies[i], "socks", 5)) { + if (!strncmp(proxies[i], "socks", 5)) ptype_ID = ptype_socksID; - } - type_proxy = (*env)->GetStaticObjectField(env, - ptype_class, ptype_ID); - CHECK_NULL(type_proxy); - jhost = (*env)->NewStringUTF(env, phost); - CHECK_NULL(jhost); - isa = (*env)->CallStaticObjectMethod(env, - isaddr_class, isaddr_createUnresolvedID, - jhost, pport); - CHECK_NULL(isa); - objProxy = (*env)->NewObject(env, proxy_class, - proxy_ctrID, type_proxy, isa); + jProxy = createProxy(env, ptype_ID, phost, pport); } } } @@ -445,33 +438,45 @@ static jobject getProxyByGProxyResolver(JNIEnv *env, const char* cproto, (*g_strfreev)(proxies); } - return objProxy; + return jProxy; } -static void initJavaClass(JNIEnv *env) { - jclass cls = NULL; - CHECK_NULL(cls = (*env)->FindClass(env,"java/net/Proxy")); - proxy_class = (*env)->NewGlobalRef(env, cls); - CHECK_NULL(cls = (*env)->FindClass(env,"java/net/Proxy$Type")); - ptype_class = (*env)->NewGlobalRef(env, cls); - CHECK_NULL(cls = (*env)->FindClass(env, "java/net/InetSocketAddress")); - isaddr_class = (*env)->NewGlobalRef(env, cls); +static int initJavaClass(JNIEnv *env) { + jclass proxy_cls = NULL; + jclass ptype_cls = NULL; + jclass isaddr_cls = NULL; + + // Proxy initialization + proxy_cls = (*env)->FindClass(env,"java/net/Proxy"); + CHECK_NULL_RETURN(proxy_cls, 0); + proxy_class = (*env)->NewGlobalRef(env, proxy_cls); + CHECK_NULL_RETURN(proxy_class, 0); proxy_ctrID = (*env)->GetMethodID(env, proxy_class, "", "(Ljava/net/Proxy$Type;Ljava/net/SocketAddress;)V"); - CHECK_NULL(proxy_ctrID); - pr_no_proxyID = (*env)->GetStaticFieldID(env, proxy_class, "NO_PROXY", - "Ljava/net/Proxy;"); - CHECK_NULL(pr_no_proxyID); + CHECK_NULL_RETURN(proxy_ctrID, 0); + + // Proxy$Type initialization + ptype_cls = (*env)->FindClass(env,"java/net/Proxy$Type"); + CHECK_NULL_RETURN(ptype_cls, 0); + ptype_class = (*env)->NewGlobalRef(env, ptype_cls); + CHECK_NULL_RETURN(ptype_class, 0); ptype_httpID = (*env)->GetStaticFieldID(env, ptype_class, "HTTP", - "Ljava/net/Proxy$Type;"); - CHECK_NULL(ptype_httpID); + "Ljava/net/Proxy$Type;"); + CHECK_NULL_RETURN(ptype_httpID, 0); ptype_socksID = (*env)->GetStaticFieldID(env, ptype_class, "SOCKS", - "Ljava/net/Proxy$Type;"); - CHECK_NULL(ptype_socksID); + "Ljava/net/Proxy$Type;"); + CHECK_NULL_RETURN(ptype_socksID, 0); + + // InetSocketAddress initialization + isaddr_cls = (*env)->FindClass(env, "java/net/InetSocketAddress"); + CHECK_NULL_RETURN(isaddr_cls, 0); + isaddr_class = (*env)->NewGlobalRef(env, isaddr_cls); + CHECK_NULL_RETURN(isaddr_class, 0); isaddr_createUnresolvedID = (*env)->GetStaticMethodID(env, isaddr_class, "createUnresolved", "(Ljava/lang/String;I)Ljava/net/InetSocketAddress;"); - CHECK_NULL(isaddr_createUnresolvedID); + + return isaddr_createUnresolvedID != NULL ? 1 : 0; } @@ -487,10 +492,10 @@ Java_sun_net_spi_DefaultProxySelector_init(JNIEnv *env, jclass clazz) { use_gconf = initGConf(); if (use_gproxyResolver || use_gconf) { - initJavaClass(env); - return JNI_TRUE; - } else - return JNI_FALSE; + if (initJavaClass(env)) + return JNI_TRUE; + } + return JNI_FALSE; } /* @@ -528,11 +533,6 @@ Java_sun_net_spi_DefaultProxySelector_getSystemProxy(JNIEnv *env, if (isProtoCopy == JNI_TRUE) (*env)->ReleaseStringUTFChars(env, proto, cproto); } - - if (proxy == NULL) { - CHECK_NULL(proxy = (*env)->GetStaticObjectField(env, proxy_class, - pr_no_proxyID)); - } return proxy; } From 00b823a27aea717f68ab0d5648afa5856adbcb7e Mon Sep 17 00:00:00 2001 From: Alan Bateman Date: Sun, 15 Dec 2013 08:11:41 +0000 Subject: [PATCH 131/377] 8029805: Remove LogManager addPropertyChangeListener and removePropertyChangeListener methods 8029806: Remove Packer/Unpacker addPropertyChangeLister and removePropertyListener methods Reviewed-by: dfuchs, tbell, mchung, ihse --- jdk/make/CreateJars.gmk | 27 +-- jdk/make/Tools.gmk | 4 - .../build/tools/classfile/RemoveMethods.java | 115 ---------- .../sun/java/util/jar/pack/PackerImpl.java | 18 -- .../com/sun/java/util/jar/pack/PropMap.java | 133 ------------ .../sun/java/util/jar/pack/UnpackerImpl.java | 19 -- .../share/classes/java/util/jar/Pack200.java | 99 --------- .../classes/java/util/logging/LogManager.java | 205 ------------------ jdk/test/TEST.groups | 2 - jdk/test/java/util/logging/Listeners.java | 135 ------------ .../java/util/logging/ListenersWithSM.java | 77 ------- jdk/test/java/util/logging/java.policy | 3 - jdk/test/tools/pack200/NoBeans.java | 49 ----- jdk/test/tools/pack200/Reflect.java | 47 ---- 14 files changed, 1 insertion(+), 932 deletions(-) delete mode 100644 jdk/make/src/classes/build/tools/classfile/RemoveMethods.java delete mode 100644 jdk/test/java/util/logging/Listeners.java delete mode 100644 jdk/test/java/util/logging/ListenersWithSM.java delete mode 100644 jdk/test/java/util/logging/java.policy delete mode 100644 jdk/test/tools/pack200/NoBeans.java delete mode 100644 jdk/test/tools/pack200/Reflect.java diff --git a/jdk/make/CreateJars.gmk b/jdk/make/CreateJars.gmk index 1c020634dae..181481cf413 100644 --- a/jdk/make/CreateJars.gmk +++ b/jdk/make/CreateJars.gmk @@ -298,29 +298,6 @@ $(PROFILE_VERSION_CLASS_TARGETS): $(PROFILE_VERSION_JAVA_TARGETS) @$(JAVAC) -d $(@D)/../../ $(@D)/$(VERSION_JAVA_FILE) -# Support for removing the addPropertyChangeListener and removePropertyChangeListener -# methods from classes that only go into the profile builds. -BEANLESS_CLASSES = $(IMAGES_OUTPUTDIR)/beanless - -# When there are $ characters in filenames we have some very subtle interactions between -# make expansion and shell expansion. In this particular case $< will contain a single $ while -# $@ will contain \$. So we have to pass $< in single-quotes to avoid shell expansion -$(BEANLESS_CLASSES)/%: $(JDK_OUTPUTDIR)/classes/% - $(MKDIR) -p $(@D) - $(TOOL_REMOVEMETHODS) '$<' $@ addPropertyChangeListener removePropertyChangeListener - -CLASSES_TO_DEBEAN = \ - java/util/logging/LogManager.class \ - java/util/jar/Pack200\$$Packer.class \ - java/util/jar/Pack200\$$Unpacker.class \ - com/sun/java/util/jar/pack/PackerImpl.class \ - com/sun/java/util/jar/pack/UnpackerImpl.class - -ifneq ($(PROFILE), ) - BEANLESS_CLASSES_TARGETS := $(addprefix $(BEANLESS_CLASSES)/, $(CLASSES_TO_DEBEAN)) -endif - - RT_JAR_CREATE_OPTIONS := c0fm RT_JAR_UPDATE_OPTIONS := u0f ifeq ($(COMPRESS_JARS), true) @@ -333,7 +310,7 @@ endif $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/rt.jar: \ CLASS_FILE = $(if $(PROFILE), $(strip $(foreach class, $(PROFILE_VERSION_CLASS_TARGETS), $(if $(findstring $(PROFILE), $(class)), $(class)))), NO_SUCH_FILE) # This is the real target -$(IMAGES_OUTPUTDIR)/lib$(PROFILE)/rt.jar: $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.rt.jar.contents $(RT_JAR_MANIFEST_FILE) $(PROFILE_VERSION_CLASS_TARGETS) $(BEANLESS_CLASSES_TARGETS) +$(IMAGES_OUTPUTDIR)/lib$(PROFILE)/rt.jar: $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.rt.jar.contents $(RT_JAR_MANIFEST_FILE) $(PROFILE_VERSION_CLASS_TARGETS) $(ECHO) Creating rt.jar $(PROFILE) Compressed=$(COMPRESS_JARS) $(MKDIR) -p $(@D) $(RM) $@ $@.tmp @@ -344,8 +321,6 @@ $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/rt.jar: $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the $(ECHO) Updating rt.jar $(PROFILE) && \ $(CD) $(patsubst %$(VERSION_CLASS_PATH), %, $(CLASS_FILE)) && \ $(JAR) $(RT_JAR_UPDATE_OPTIONS) $@.tmp $(VERSION_CLASS_PATH); \ - $(CD) $(BEANLESS_CLASSES) && \ - $(JAR) $(RT_JAR_UPDATE_OPTIONS) $@.tmp $(CLASSES_TO_DEBEAN); \ fi $(MV) $@.tmp $@ diff --git a/jdk/make/Tools.gmk b/jdk/make/Tools.gmk index aa61c1f8b9c..1c3b791f621 100644 --- a/jdk/make/Tools.gmk +++ b/jdk/make/Tools.gmk @@ -122,10 +122,6 @@ TOOL_OSX_TOBIN = $(JAVA) -Djava.awt.headless=true -cp $(JDK_OUTPUTDIR)/btclasses TOOL_CLDRCONVERTER = $(JAVA) -cp $(JDK_OUTPUTDIR)/btclasses \ build.tools.cldrconverter.CLDRConverter -TOOL_REMOVEMETHODS = $(JAVA) -Xbootclasspath/p:$(LANGTOOLS_OUTPUTDIR)/dist/bootstrap/lib/javac.jar \ - -cp $(JDK_OUTPUTDIR)/btclasses:$(JDK_OUTPUTDIR) \ - build.tools.classfile.RemoveMethods - TOOL_CHECKDEPS = $(JAVA) -Xbootclasspath/p:$(LANGTOOLS_OUTPUTDIR)/dist/bootstrap/lib/javac.jar \ -cp $(JDK_OUTPUTDIR)/btclasses:$(JDK_OUTPUTDIR) \ build.tools.deps.CheckDeps diff --git a/jdk/make/src/classes/build/tools/classfile/RemoveMethods.java b/jdk/make/src/classes/build/tools/classfile/RemoveMethods.java deleted file mode 100644 index fd2de66a523..00000000000 --- a/jdk/make/src/classes/build/tools/classfile/RemoveMethods.java +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package build.tools.classfile; - -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.io.InputStream; -import java.io.OutputStream; -import java.util.Set; -import java.util.HashSet; - -import com.sun.tools.classfile.AccessFlags; -import com.sun.tools.classfile.Attributes; -import com.sun.tools.classfile.ClassFile; -import com.sun.tools.classfile.ClassWriter; -import com.sun.tools.classfile.ConstantPool; -import com.sun.tools.classfile.Field; -import com.sun.tools.classfile.Method; - -public class RemoveMethods { - - public static void main(String[] args) throws Exception { - if (args.length < 2) { - System.err.println("Usage: java RemoveMethods classfile output [method...]"); - System.exit(-1); - } - - // class file to read - Path input = Paths.get(args[0]); - - // class file to write, if directory then use the name of the input - Path output = Paths.get(args[1]); - if (Files.isDirectory(output)) - output = output.resolve(input.getFileName()); - - // the methods to remove - Set methodsToRemove = new HashSet<>(); - int i = 2; - while (i < args.length) - methodsToRemove.add(args[i++]); - - // read class file - ClassFile cf; - try (InputStream in = Files.newInputStream(input)) { - cf = ClassFile.read(in); - } - - final int magic = cf.magic; - final int major_version = cf.major_version; - final int minor_version = cf.minor_version; - final ConstantPool cp = cf.constant_pool; - final AccessFlags access_flags = cf.access_flags; - final int this_class = cf.this_class; - final int super_class = cf.super_class; - final int[] interfaces = cf.interfaces; - final Field[] fields = cf.fields; - final Attributes class_attrs = cf.attributes; - - // remove the requested methods, no signature check at this time - Method[] methods = cf.methods; - i = 0; - while (i < methods.length) { - Method m = methods[i]; - String name = m.getName(cp); - if (methodsToRemove.contains(name)) { - int len = methods.length; - Method[] newMethods = new Method[len-1]; - if (i > 0) - System.arraycopy(methods, 0, newMethods, 0, i); - int after = methods.length - i - 1; - if (after > 0) - System.arraycopy(methods, i+1, newMethods, i, after); - methods = newMethods; - String paramTypes = m.descriptor.getParameterTypes(cp); - System.out.format("Removed method %s%s from %s%n", - name, paramTypes, cf.getName()); - continue; - } - i++; - } - - // TBD, prune constant pool of entries that are no longer referenced - - // re-write class file - cf = new ClassFile(magic, minor_version, major_version, cp, access_flags, - this_class, super_class, interfaces, fields, methods, class_attrs); - try (OutputStream out = Files.newOutputStream(output)) { - new ClassWriter().write(cf, out); - } - } -} diff --git a/jdk/src/share/classes/com/sun/java/util/jar/pack/PackerImpl.java b/jdk/src/share/classes/com/sun/java/util/jar/pack/PackerImpl.java index 309c68a8623..2a5a5177ff7 100644 --- a/jdk/src/share/classes/com/sun/java/util/jar/pack/PackerImpl.java +++ b/jdk/src/share/classes/com/sun/java/util/jar/pack/PackerImpl.java @@ -26,7 +26,6 @@ package com.sun.java.util.jar.pack; import com.sun.java.util.jar.pack.Attribute.Layout; -import java.beans.PropertyChangeListener; import java.io.BufferedInputStream; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; @@ -136,23 +135,6 @@ public class PackerImpl extends TLGlobals implements Pack200.Packer { in.close(); } } - /** - * Register a listener for changes to options. - * @param listener An object to be invoked when a property is changed. - */ - public void addPropertyChangeListener(PropertyChangeListener listener) { - props.addListener(listener); - } - - /** - * Remove a listener for the PropertyChange event. - * @param listener The PropertyChange listener to be removed. - */ - public void removePropertyChangeListener(PropertyChangeListener listener) { - props.removeListener(listener); - } - - // All the worker bees..... // The packer worker. diff --git a/jdk/src/share/classes/com/sun/java/util/jar/pack/PropMap.java b/jdk/src/share/classes/com/sun/java/util/jar/pack/PropMap.java index 24485040378..d5a08a805f5 100644 --- a/jdk/src/share/classes/com/sun/java/util/jar/pack/PropMap.java +++ b/jdk/src/share/classes/com/sun/java/util/jar/pack/PropMap.java @@ -40,9 +40,6 @@ import java.util.Set; import java.util.SortedMap; import java.util.TreeMap; import java.util.jar.Pack200; -import java.lang.reflect.Constructor; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; /** * Control block for publishing Pack200 options to the other classes. @@ -51,30 +48,9 @@ import java.lang.reflect.Method; final class PropMap implements SortedMap { private final TreeMap theMap = new TreeMap<>();; - // type is erased, elements are of type java.beans.PropertyChangeListener - private final List listenerList = new ArrayList<>(1); - - void addListener(Object listener) { - assert Beans.isPropertyChangeListener(listener); - listenerList.add(listener); - } - - void removeListener(Object listener) { - assert Beans.isPropertyChangeListener(listener); - listenerList.remove(listener); - } - // Override: public String put(String key, String value) { String oldValue = theMap.put(key, value); - if (value != oldValue && !listenerList.isEmpty()) { - assert Beans.isBeansPresent(); - // Post the property change event. - Object event = Beans.newPropertyChangeEvent(this, key, oldValue, value); - for (Object listener : listenerList) { - Beans.invokePropertyChange(listener, event); - } - } return oldValue; } @@ -341,113 +317,4 @@ final class PropMap implements SortedMap { public String lastKey() { return theMap.lastKey(); } - - /** - * A class that provides access to the java.beans.PropertyChangeListener - * and java.beans.PropertyChangeEvent without creating a static dependency - * on java.beans. This class can be removed once the addPropertyChangeListener - * and removePropertyChangeListener methods are removed from Packer and - * Unpacker. - */ - private static class Beans { - private static final Class propertyChangeListenerClass = - getClass("java.beans.PropertyChangeListener"); - - private static final Class propertyChangeEventClass = - getClass("java.beans.PropertyChangeEvent"); - - private static final Method propertyChangeMethod = - getMethod(propertyChangeListenerClass, - "propertyChange", - propertyChangeEventClass); - - private static final Constructor propertyEventCtor = - getConstructor(propertyChangeEventClass, - Object.class, - String.class, - Object.class, - Object.class); - - private static Class getClass(String name) { - try { - return Class.forName(name, true, Beans.class.getClassLoader()); - } catch (ClassNotFoundException e) { - return null; - } - } - private static Constructor getConstructor(Class c, Class... types) { - try { - return (c == null) ? null : c.getDeclaredConstructor(types); - } catch (NoSuchMethodException x) { - throw new AssertionError(x); - } - } - - private static Method getMethod(Class c, String name, Class... types) { - try { - return (c == null) ? null : c.getMethod(name, types); - } catch (NoSuchMethodException e) { - throw new AssertionError(e); - } - } - - /** - * Returns {@code true} if java.beans is present. - */ - static boolean isBeansPresent() { - return propertyChangeListenerClass != null && - propertyChangeEventClass != null; - } - - /** - * Returns {@code true} if the given object is a PropertyChangeListener - */ - static boolean isPropertyChangeListener(Object obj) { - if (propertyChangeListenerClass == null) { - return false; - } else { - return propertyChangeListenerClass.isInstance(obj); - } - } - - /** - * Returns a new PropertyChangeEvent with the given source, property - * name, old and new values. - */ - static Object newPropertyChangeEvent(Object source, String prop, - Object oldValue, Object newValue) - { - try { - return propertyEventCtor.newInstance(source, prop, oldValue, newValue); - } catch (InstantiationException | IllegalAccessException x) { - throw new AssertionError(x); - } catch (InvocationTargetException x) { - Throwable cause = x.getCause(); - if (cause instanceof Error) - throw (Error)cause; - if (cause instanceof RuntimeException) - throw (RuntimeException)cause; - throw new AssertionError(x); - } - } - - /** - * Invokes the given PropertyChangeListener's propertyChange method - * with the given event. - */ - static void invokePropertyChange(Object listener, Object ev) { - try { - propertyChangeMethod.invoke(listener, ev); - } catch (IllegalAccessException x) { - throw new AssertionError(x); - } catch (InvocationTargetException x) { - Throwable cause = x.getCause(); - if (cause instanceof Error) - throw (Error)cause; - if (cause instanceof RuntimeException) - throw (RuntimeException)cause; - throw new AssertionError(x); - } - } - } } diff --git a/jdk/src/share/classes/com/sun/java/util/jar/pack/UnpackerImpl.java b/jdk/src/share/classes/com/sun/java/util/jar/pack/UnpackerImpl.java index 9044d92b86f..d18e95555d7 100644 --- a/jdk/src/share/classes/com/sun/java/util/jar/pack/UnpackerImpl.java +++ b/jdk/src/share/classes/com/sun/java/util/jar/pack/UnpackerImpl.java @@ -25,7 +25,6 @@ package com.sun.java.util.jar.pack; -import java.beans.PropertyChangeListener; import java.io.BufferedInputStream; import java.io.ByteArrayOutputStream; import java.io.File; @@ -55,24 +54,6 @@ import java.util.zip.ZipEntry; public class UnpackerImpl extends TLGlobals implements Pack200.Unpacker { - - /** - * Register a listener for changes to options. - * @param listener An object to be invoked when a property is changed. - */ - public void addPropertyChangeListener(PropertyChangeListener listener) { - props.addListener(listener); - } - - - /** - * Remove a listener for the PropertyChange event. - * @param listener The PropertyChange listener to be removed. - */ - public void removePropertyChangeListener(PropertyChangeListener listener) { - props.removeListener(listener); - } - public UnpackerImpl() {} diff --git a/jdk/src/share/classes/java/util/jar/Pack200.java b/jdk/src/share/classes/java/util/jar/Pack200.java index 5422431292b..66d38a4512d 100644 --- a/jdk/src/share/classes/java/util/jar/Pack200.java +++ b/jdk/src/share/classes/java/util/jar/Pack200.java @@ -29,9 +29,6 @@ import java.io.InputStream; import java.io.OutputStream; import java.io.File; import java.io.IOException; -import java.beans.PropertyChangeListener; - - /** @@ -571,54 +568,6 @@ public abstract class Pack200 { * @exception IOException if an error is encountered. */ void pack(JarInputStream in, OutputStream out) throws IOException ; - - /** - * Registers a listener for PropertyChange events on the properties map. - * This is typically used by applications to update a progress bar. - * - *

The default implementation of this method does nothing and has - * no side-effects.

- * - *

WARNING: This method is omitted from the interface - * declaration in all subset Profiles of Java SE that do not include - * the {@code java.beans} package.

- - * @see #properties - * @see #PROGRESS - * @param listener An object to be invoked when a property is changed. - * @deprecated The dependency on {@code PropertyChangeListener} creates - * a significant impediment to future modularization of the - * Java platform. This method will be removed in a future - * release. - * Applications that need to monitor progress of the packer - * can poll the value of the {@link #PROGRESS PROGRESS} - * property instead. - */ - @Deprecated - default void addPropertyChangeListener(PropertyChangeListener listener) { - } - - /** - * Remove a listener for PropertyChange events, added by - * the {@link #addPropertyChangeListener}. - * - *

The default implementation of this method does nothing and has - * no side-effects.

- * - *

WARNING: This method is omitted from the interface - * declaration in all subset Profiles of Java SE that do not include - * the {@code java.beans} package.

- * - * @see #addPropertyChangeListener - * @param listener The PropertyChange listener to be removed. - * @deprecated The dependency on {@code PropertyChangeListener} creates - * a significant impediment to future modularization of the - * Java platform. This method will be removed in a future - * release. - */ - @Deprecated - default void removePropertyChangeListener(PropertyChangeListener listener) { - } } /** @@ -730,54 +679,6 @@ public abstract class Pack200 { * @exception IOException if an error is encountered. */ void unpack(File in, JarOutputStream out) throws IOException; - - /** - * Registers a listener for PropertyChange events on the properties map. - * This is typically used by applications to update a progress bar. - * - *

The default implementation of this method does nothing and has - * no side-effects.

- * - *

WARNING: This method is omitted from the interface - * declaration in all subset Profiles of Java SE that do not include - * the {@code java.beans} package.

- * - * @see #properties - * @see #PROGRESS - * @param listener An object to be invoked when a property is changed. - * @deprecated The dependency on {@code PropertyChangeListener} creates - * a significant impediment to future modularization of the - * Java platform. This method will be removed in a future - * release. - * Applications that need to monitor progress of the - * unpacker can poll the value of the {@link #PROGRESS - * PROGRESS} property instead. - */ - @Deprecated - default void addPropertyChangeListener(PropertyChangeListener listener) { - } - - /** - * Remove a listener for PropertyChange events, added by - * the {@link #addPropertyChangeListener}. - * - *

The default implementation of this method does nothing and has - * no side-effects.

- * - *

WARNING: This method is omitted from the interface - * declaration in all subset Profiles of Java SE that do not include - * the {@code java.beans} package.

- * - * @see #addPropertyChangeListener - * @param listener The PropertyChange listener to be removed. - * @deprecated The dependency on {@code PropertyChangeListener} creates - * a significant impediment to future modularization of the - * Java platform. This method will be removed in a future - * release. - */ - @Deprecated - default void removePropertyChangeListener(PropertyChangeListener listener) { - } } // Private stuff.... diff --git a/jdk/src/share/classes/java/util/logging/LogManager.java b/jdk/src/share/classes/java/util/logging/LogManager.java index 733eeefdb8b..793a313967b 100644 --- a/jdk/src/share/classes/java/util/logging/LogManager.java +++ b/jdk/src/share/classes/java/util/logging/LogManager.java @@ -31,10 +31,6 @@ import java.util.*; import java.security.*; import java.lang.ref.ReferenceQueue; import java.lang.ref.WeakReference; -import java.lang.reflect.Constructor; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.beans.PropertyChangeListener; import sun.misc.JavaAWTAccess; import sun.misc.SharedSecrets; @@ -156,10 +152,6 @@ public class LogManager { private volatile Properties props = new Properties(); private final static Level defaultLevel = Level.INFO; - // The map of the registered listeners. The map value is the registration - // count to allow for cases where the same listener is registered many times. - private final Map listenerMap = new HashMap<>(); - // LoggerContext for system loggers and user loggers private final LoggerContext systemContext = new SystemLoggerContext(); private final LoggerContext userContext = new LoggerContext(); @@ -390,85 +382,6 @@ public class LogManager { } } - /** - * Adds an event listener to be invoked when the logging - * properties are re-read. Adding multiple instances of - * the same event Listener results in multiple entries - * in the property event listener table. - * - *

WARNING: This method is omitted from this class in all subset - * Profiles of Java SE that do not include the {@code java.beans} package. - *

- * - * @param l event listener - * @exception SecurityException if a security manager exists and if - * the caller does not have LoggingPermission("control"). - * @exception NullPointerException if the PropertyChangeListener is null. - * @deprecated The dependency on {@code PropertyChangeListener} creates a - * significant impediment to future modularization of the Java - * platform. This method will be removed in a future release. - * The global {@code LogManager} can detect changes to the - * logging configuration by overridding the {@link - * #readConfiguration readConfiguration} method. - */ - @Deprecated - public void addPropertyChangeListener(PropertyChangeListener l) throws SecurityException { - PropertyChangeListener listener = Objects.requireNonNull(l); - checkPermission(); - synchronized (listenerMap) { - // increment the registration count if already registered - Integer value = listenerMap.get(listener); - value = (value == null) ? 1 : (value + 1); - listenerMap.put(listener, value); - } - } - - /** - * Removes an event listener for property change events. - * If the same listener instance has been added to the listener table - * through multiple invocations of addPropertyChangeListener, - * then an equivalent number of - * removePropertyChangeListener invocations are required to remove - * all instances of that listener from the listener table. - *

- * Returns silently if the given listener is not found. - * - *

WARNING: This method is omitted from this class in all subset - * Profiles of Java SE that do not include the {@code java.beans} package. - *

- * - * @param l event listener (can be null) - * @exception SecurityException if a security manager exists and if - * the caller does not have LoggingPermission("control"). - * @deprecated The dependency on {@code PropertyChangeListener} creates a - * significant impediment to future modularization of the Java - * platform. This method will be removed in a future release. - * The global {@code LogManager} can detect changes to the - * logging configuration by overridding the {@link - * #readConfiguration readConfiguration} method. - */ - @Deprecated - public void removePropertyChangeListener(PropertyChangeListener l) throws SecurityException { - checkPermission(); - if (l != null) { - PropertyChangeListener listener = l; - synchronized (listenerMap) { - Integer value = listenerMap.get(listener); - if (value != null) { - // remove from map if registration count is 1, otherwise - // just decrement its count - int i = value.intValue(); - if (i == 1) { - listenerMap.remove(listener); - } else { - assert i > 1; - listenerMap.put(listener, i - 1); - } - } - } - } - } - // LoggerContext maps from AppContext private WeakHashMap contextsMap = null; @@ -1404,27 +1317,6 @@ public class LogManager { // Set levels on any pre-existing loggers, based on the new properties. setLevelsOnExistingLoggers(); - // Notify any interested parties that our properties have changed. - // We first take a copy of the listener map so that we aren't holding any - // locks when calling the listeners. - Map listeners = null; - synchronized (listenerMap) { - if (!listenerMap.isEmpty()) - listeners = new HashMap<>(listenerMap); - } - if (listeners != null) { - assert Beans.isBeansPresent(); - Object ev = Beans.newPropertyChangeEvent(LogManager.class, null, null, null); - for (Map.Entry entry : listeners.entrySet()) { - Object listener = entry.getKey(); - int count = entry.getValue().intValue(); - for (int i = 0; i < count; i++) { - Beans.invokePropertyChange(listener, ev); - } - } - } - - // Note that we need to reinitialize global handles when // they are first referenced. synchronized (this) { @@ -1713,101 +1605,4 @@ public class LogManager { } return loggingMXBean; } - - /** - * A class that provides access to the java.beans.PropertyChangeListener - * and java.beans.PropertyChangeEvent without creating a static dependency - * on java.beans. This class can be removed once the addPropertyChangeListener - * and removePropertyChangeListener methods are removed. - */ - private static class Beans { - private static final Class propertyChangeListenerClass = - getClass("java.beans.PropertyChangeListener"); - - private static final Class propertyChangeEventClass = - getClass("java.beans.PropertyChangeEvent"); - - private static final Method propertyChangeMethod = - getMethod(propertyChangeListenerClass, - "propertyChange", - propertyChangeEventClass); - - private static final Constructor propertyEventCtor = - getConstructor(propertyChangeEventClass, - Object.class, - String.class, - Object.class, - Object.class); - - private static Class getClass(String name) { - try { - return Class.forName(name, true, Beans.class.getClassLoader()); - } catch (ClassNotFoundException e) { - return null; - } - } - private static Constructor getConstructor(Class c, Class... types) { - try { - return (c == null) ? null : c.getDeclaredConstructor(types); - } catch (NoSuchMethodException x) { - throw new AssertionError(x); - } - } - - private static Method getMethod(Class c, String name, Class... types) { - try { - return (c == null) ? null : c.getMethod(name, types); - } catch (NoSuchMethodException e) { - throw new AssertionError(e); - } - } - - /** - * Returns {@code true} if java.beans is present. - */ - static boolean isBeansPresent() { - return propertyChangeListenerClass != null && - propertyChangeEventClass != null; - } - - /** - * Returns a new PropertyChangeEvent with the given source, property - * name, old and new values. - */ - static Object newPropertyChangeEvent(Object source, String prop, - Object oldValue, Object newValue) - { - try { - return propertyEventCtor.newInstance(source, prop, oldValue, newValue); - } catch (InstantiationException | IllegalAccessException x) { - throw new AssertionError(x); - } catch (InvocationTargetException x) { - Throwable cause = x.getCause(); - if (cause instanceof Error) - throw (Error)cause; - if (cause instanceof RuntimeException) - throw (RuntimeException)cause; - throw new AssertionError(x); - } - } - - /** - * Invokes the given PropertyChangeListener's propertyChange method - * with the given event. - */ - static void invokePropertyChange(Object listener, Object ev) { - try { - propertyChangeMethod.invoke(listener, ev); - } catch (IllegalAccessException x) { - throw new AssertionError(x); - } catch (InvocationTargetException x) { - Throwable cause = x.getCause(); - if (cause instanceof Error) - throw (Error)cause; - if (cause instanceof RuntimeException) - throw (RuntimeException)cause; - throw new AssertionError(x); - } - } - } } diff --git a/jdk/test/TEST.groups b/jdk/test/TEST.groups index 77fae723f98..5a57b9beb38 100644 --- a/jdk/test/TEST.groups +++ b/jdk/test/TEST.groups @@ -357,8 +357,6 @@ needs_jre = \ java/security/Security/ClassLoaderDeadlock/ClassLoaderDeadlock.sh \ java/security/Security/ClassLoaderDeadlock/Deadlock.sh \ java/util/jar/Manifest/CreateManifest.java \ - java/util/logging/Listeners.java \ - java/util/logging/ListenersWithSM.java \ java/util/logging/TestMainAppContext.java \ java/util/ResourceBundle/Control/Bug6530694.java \ java/text/Bidi/BidiConformance.java \ diff --git a/jdk/test/java/util/logging/Listeners.java b/jdk/test/java/util/logging/Listeners.java deleted file mode 100644 index 86383ef065b..00000000000 --- a/jdk/test/java/util/logging/Listeners.java +++ /dev/null @@ -1,135 +0,0 @@ -/* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. - * 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 7192275 - * @summary Basic test of addPropertyListener/removePropertyListener methods - * @run main/othervm Listeners - */ - -import java.util.logging.LogManager; -import java.beans.PropertyChangeListener; -import java.beans.PropertyChangeEvent; - -public class Listeners { - - static void assertTrue(boolean result, String msg) { - if (!result) - throw new RuntimeException(msg); - } - - /** - * A {@code PropertyChangeListener} that counts the number of times that - * the {@code propertyChange} method is fired, and also checks that the - * event source is the expected (fixed) object. - */ - static class Listener implements PropertyChangeListener { - private final Object expectedSource; - private int fireCount; - - Listener(Object expectedSource) { - this.expectedSource = expectedSource; - } - - int fireCount() { - return fireCount; - } - - Listener reset() { - fireCount = 0; - return this; - } - - @Override - public void propertyChange(PropertyChangeEvent evt) { - assertTrue(evt.getSource() == expectedSource, "Unexpected source"); - fireCount++; - } - } - - /** - * Tests that the given listeners are invoked the expected number of - * times. - */ - static void test(Listener[] listeners, int... expected) throws Exception { - // reset counts - for (Listener listener : listeners) { - listener.reset(); - } - - // re-reading configuration causes events to be fired - LogManager.getLogManager().readConfiguration(); - - // check event listeners invoked as expected - for (int i = 0; i < expected.length; i++) { - assertTrue(listeners[i].fireCount() == expected[i], - "Unexpected event count"); - } - } - - @SuppressWarnings("deprecation") - public static void main(String[] args) throws Exception { - LogManager logman = LogManager.getLogManager(); - - Listener[] listeners = new Listener[2]; - Listener listener1 = listeners[0] = new Listener(LogManager.class); - Listener listener2 = listeners[1] = new Listener(LogManager.class); - - // add listeners - logman.addPropertyChangeListener(listener1); - test(listeners, 1, 0); - - logman.addPropertyChangeListener(listener1); - test(listeners, 2, 0); - - logman.addPropertyChangeListener(listener2); - test(listeners, 2, 1); - - // null handling to check for impact on the existing registrations - try { - logman.addPropertyChangeListener(null); - assertTrue(false, "NullPointerException expected"); - } catch (NullPointerException expected) { } - test(listeners, 2, 1); - - logman.removePropertyChangeListener(null); // no-op - test(listeners, 2, 1); - - // remove listeners - logman.removePropertyChangeListener(listener1); - test(listeners, 1, 1); - - logman.removePropertyChangeListener(listener1); - test(listeners, 0, 1); - - logman.removePropertyChangeListener(listener1); // no-op - test(listeners, 0, 1); - - logman.removePropertyChangeListener(listener2); - test(listeners, 0, 0); - - logman.removePropertyChangeListener(listener2); // no-op - test(listeners, 0, 0); - } -} diff --git a/jdk/test/java/util/logging/ListenersWithSM.java b/jdk/test/java/util/logging/ListenersWithSM.java deleted file mode 100644 index 49eba235dc6..00000000000 --- a/jdk/test/java/util/logging/ListenersWithSM.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. - * 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 7192275 - * @summary Basic test of addPropertyListener/removePropertyListener methods - * @run main/othervm ListenersWithSM grant - * @run main/othervm ListenersWithSM deny - */ - -import java.nio.file.Paths; -import java.util.logging.LogManager; -import java.beans.PropertyChangeListener; -import java.beans.PropertyChangeEvent; - -public class ListenersWithSM { - - @SuppressWarnings("deprecation") - public static void main(String[] args) throws Exception { - boolean granted = args[0].equals("grant"); - - // need to get reference to LogManager before setting SecurityManager - LogManager logman = LogManager.getLogManager(); - - // set policy and enable security manager - if (granted) { - String testSrc = System.getProperty("test.src"); - if (testSrc == null) - testSrc = "."; - System.setProperty("java.security.policy", - Paths.get(testSrc).resolve("java.policy").toString()); - } - System.setSecurityManager(new SecurityManager()); - - PropertyChangeListener listener = new PropertyChangeListener() { - @Override - public void propertyChange(PropertyChangeEvent evt) { - } - }; - - if (granted) { - // permission granted, no security exception expected - logman.addPropertyChangeListener(listener); - logman.removePropertyChangeListener(listener); - } else { - // denied - try { - logman.addPropertyChangeListener(listener); - throw new RuntimeException("SecurityException expected"); - } catch (SecurityException expected) { } - try { - logman.removePropertyChangeListener(listener); - throw new RuntimeException("SecurityException expected"); - } catch (SecurityException expected) { } - } - } -} diff --git a/jdk/test/java/util/logging/java.policy b/jdk/test/java/util/logging/java.policy deleted file mode 100644 index e41f260730e..00000000000 --- a/jdk/test/java/util/logging/java.policy +++ /dev/null @@ -1,3 +0,0 @@ -grant { - permission java.util.logging.LoggingPermission "control"; -}; diff --git a/jdk/test/tools/pack200/NoBeans.java b/jdk/test/tools/pack200/NoBeans.java deleted file mode 100644 index c900940e274..00000000000 --- a/jdk/test/tools/pack200/NoBeans.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. - * 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 8004931 - * @compile NoBeans.java - * @summary A compile-only test to ensure that implementations of Packer - * and Unpacker can be compiled without implementating the - * addPropertyChangeListener and removePropertyChangeListener methods. - */ - -import java.io.*; -import java.util.*; -import java.util.jar.*; - -public class NoBeans { - - static class MyPacker implements Pack200.Packer { - public SortedMap properties() { return null; } - public void pack(JarFile in, OutputStream out) { } - public void pack(JarInputStream in, OutputStream out) { } - } - - static class MyUnpacker implements Pack200.Unpacker { - public SortedMap properties() { return null; } - public void unpack(InputStream in, JarOutputStream out) { } - public void unpack(File in, JarOutputStream out) { } - } -} diff --git a/jdk/test/tools/pack200/Reflect.java b/jdk/test/tools/pack200/Reflect.java deleted file mode 100644 index 27287abab6d..00000000000 --- a/jdk/test/tools/pack200/Reflect.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. - * 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 - * @summary Invoke getDeclaredMethods on Packer and Unpacker to ensure - * that all types referenced in the method signatures is present. - */ - -import java.util.jar.Pack200; -import java.util.jar.Pack200.Packer; -import java.util.jar.Pack200.Unpacker; -import java.lang.reflect.Method; - -public class Reflect { - static void printMethods(Class c) { - System.out.println(c); - for (Method m: c.getDeclaredMethods()) { - System.out.println(" " + m); - } - } - public static void main(String[] args) { - printMethods(Pack200.Packer.class); - printMethods(Pack200.Unpacker.class); - printMethods(Pack200.newPacker().getClass()); - printMethods(Pack200.newUnpacker().getClass()); - } -} From 7c18844372736a3eac71f42cc64591adf7e3ea0d Mon Sep 17 00:00:00 2001 From: Zaiyao Liu Date: Sun, 15 Dec 2013 20:24:45 -0800 Subject: [PATCH 132/377] 8028562: Test SSLSocketSSLEngineTemplate.java intermittent failed with "Data length error" Test stabilization, read one more time in case of message fragment Reviewed-by: mullan, xuelei --- .../ssl/templates/SSLSocketSSLEngineTemplate.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/jdk/test/sun/security/ssl/templates/SSLSocketSSLEngineTemplate.java b/jdk/test/sun/security/ssl/templates/SSLSocketSSLEngineTemplate.java index 16696dbe414..d61a1e5345e 100644 --- a/jdk/test/sun/security/ssl/templates/SSLSocketSSLEngineTemplate.java +++ b/jdk/test/sun/security/ssl/templates/SSLSocketSSLEngineTemplate.java @@ -221,6 +221,9 @@ public class SSLSocketSSLEngineTemplate { try { boolean closed = false; + // will try to read one more time in case client message + // is fragmented to multiple pieces + boolean retry = true; InputStream is = socket.getInputStream(); OutputStream os = socket.getOutputStream(); @@ -295,8 +298,14 @@ public class SSLSocketSSLEngineTemplate { /* * A sanity check to ensure we got what was sent. */ - if (serverIn.remaining() != clientMsg.length) { - throw new Exception("Client: Data length error"); + if (serverIn.remaining() != clientMsg.length) { + if (retry && serverIn.remaining() < clientMsg.length) { + log("Need to read more from client"); + retry = false; + continue; + } else { + throw new Exception("Client: Data length error"); + } } for (int i = 0; i < clientMsg.length; i++) { From 3278b33e1aaafcd0d4a182e0e3956eef0cc220f8 Mon Sep 17 00:00:00 2001 From: Staffan Larsen Date: Mon, 16 Dec 2013 10:51:46 +0100 Subject: [PATCH 133/377] 8030036: Updates to ProblemList.txt after same-binaries run Reviewed-by: alanb --- jdk/test/ProblemList.txt | 9 --------- 1 file changed, 9 deletions(-) diff --git a/jdk/test/ProblemList.txt b/jdk/test/ProblemList.txt index 7c83f52f75c..e7c3ecd0f97 100644 --- a/jdk/test/ProblemList.txt +++ b/jdk/test/ProblemList.txt @@ -263,9 +263,6 @@ sun/security/krb5/auto/BadKdc4.java solaris-sparcv9 # jdk_tools -# 7132203 -sun/jvmstat/monitor/MonitoredVm/CR6672135.java generic-all - # 8028474 sun/jvmstat/monitor/MonitoredVm/MonitorVmStartTerminate.sh generic-all @@ -280,12 +277,6 @@ tools/launcher/FXLauncherTest.java linux-all # jdk_jdi -# Filed 6952105 -com/sun/jdi/SuspendThreadTest.java generic-all - -# Filed 6653793 -com/sun/jdi/RedefineCrossEvent.java generic-all - ############################################################################ # jdk_util From bf00fe4292fb9cfe15cf11d4830a03ca06a4af26 Mon Sep 17 00:00:00 2001 From: Staffan Larsen Date: Mon, 16 Dec 2013 11:04:59 +0100 Subject: [PATCH 134/377] 8028430: JDI: ReferenceType.visibleMethods() return wrong visible methods Reviewed-by: mchung --- .../com/sun/tools/jdi/ArrayTypeImpl.java | 4 +- .../com/sun/tools/jdi/ClassTypeImpl.java | 10 +- .../com/sun/tools/jdi/InterfaceTypeImpl.java | 9 +- .../com/sun/tools/jdi/ReferenceTypeImpl.java | 4 +- jdk/test/com/sun/jdi/VisibleMethods.java | 141 ++++++++++++++++++ 5 files changed, 160 insertions(+), 8 deletions(-) create mode 100644 jdk/test/com/sun/jdi/VisibleMethods.java diff --git a/jdk/src/share/classes/com/sun/tools/jdi/ArrayTypeImpl.java b/jdk/src/share/classes/com/sun/tools/jdi/ArrayTypeImpl.java index 4116c5e03b1..0c83e4d6686 100644 --- a/jdk/src/share/classes/com/sun/tools/jdi/ArrayTypeImpl.java +++ b/jdk/src/share/classes/com/sun/tools/jdi/ArrayTypeImpl.java @@ -31,6 +31,7 @@ import java.util.List; import java.util.ArrayList; import java.util.Iterator; import java.util.Map; +import java.util.Set; public class ArrayTypeImpl extends ReferenceTypeImpl implements ArrayType @@ -61,7 +62,8 @@ public class ArrayTypeImpl extends ReferenceTypeImpl return findType(componentSignature()); } - void addVisibleMethods(Map map) { + @Override + void addVisibleMethods(Map map, Set seenInterfaces) { // arrays don't have methods } diff --git a/jdk/src/share/classes/com/sun/tools/jdi/ClassTypeImpl.java b/jdk/src/share/classes/com/sun/tools/jdi/ClassTypeImpl.java index 2b2c0eecb70..16b46e6be4e 100644 --- a/jdk/src/share/classes/com/sun/tools/jdi/ClassTypeImpl.java +++ b/jdk/src/share/classes/com/sun/tools/jdi/ClassTypeImpl.java @@ -382,7 +382,8 @@ public class ClassTypeImpl extends ReferenceTypeImpl } } - void addVisibleMethods(Map methodMap) { + @Override + void addVisibleMethods(Map methodMap, Set seenInterfaces) { /* * Add methods from * parent types first, so that the methods in this class will @@ -392,12 +393,15 @@ public class ClassTypeImpl extends ReferenceTypeImpl Iterator iter = interfaces().iterator(); while (iter.hasNext()) { InterfaceTypeImpl interfaze = (InterfaceTypeImpl)iter.next(); - interfaze.addVisibleMethods(methodMap); + if (!seenInterfaces.contains(interfaze)) { + interfaze.addVisibleMethods(methodMap, seenInterfaces); + seenInterfaces.add(interfaze); + } } ClassTypeImpl clazz = (ClassTypeImpl)superclass(); if (clazz != null) { - clazz.addVisibleMethods(methodMap); + clazz.addVisibleMethods(methodMap, seenInterfaces); } addToMethodMap(methodMap, methods()); diff --git a/jdk/src/share/classes/com/sun/tools/jdi/InterfaceTypeImpl.java b/jdk/src/share/classes/com/sun/tools/jdi/InterfaceTypeImpl.java index 8fa7670127b..8e81c56ed88 100644 --- a/jdk/src/share/classes/com/sun/tools/jdi/InterfaceTypeImpl.java +++ b/jdk/src/share/classes/com/sun/tools/jdi/InterfaceTypeImpl.java @@ -32,6 +32,7 @@ import java.util.ArrayList; import java.util.Map; import java.util.Iterator; import java.util.Collections; +import java.util.Set; import java.lang.ref.SoftReference; public class InterfaceTypeImpl extends ReferenceTypeImpl @@ -80,7 +81,8 @@ public class InterfaceTypeImpl extends ReferenceTypeImpl return implementors; } - void addVisibleMethods(Map methodMap) { + @Override + void addVisibleMethods(Map methodMap, Set seenInterfaces) { /* * Add methods from * parent types first, so that the methods in this class will @@ -88,7 +90,10 @@ public class InterfaceTypeImpl extends ReferenceTypeImpl */ for (InterfaceType interfaze : superinterfaces()) { - ((InterfaceTypeImpl)interfaze).addVisibleMethods(methodMap); + if (!seenInterfaces.contains(interfaze)) { + ((InterfaceTypeImpl)interfaze).addVisibleMethods(methodMap, seenInterfaces); + seenInterfaces.add(interfaze); + } } addToMethodMap(methodMap, methods()); diff --git a/jdk/src/share/classes/com/sun/tools/jdi/ReferenceTypeImpl.java b/jdk/src/share/classes/com/sun/tools/jdi/ReferenceTypeImpl.java index 29da75da50d..be98d5e0f3e 100644 --- a/jdk/src/share/classes/com/sun/tools/jdi/ReferenceTypeImpl.java +++ b/jdk/src/share/classes/com/sun/tools/jdi/ReferenceTypeImpl.java @@ -511,7 +511,7 @@ implements ReferenceType { methodMap.put(method.name().concat(method.signature()), method); } - abstract void addVisibleMethods(Map methodMap); + abstract void addVisibleMethods(Map methodMap, Set seenInterfaces); public List visibleMethods() { /* @@ -520,7 +520,7 @@ implements ReferenceType { * concatenation of name and signature. */ Map map = new HashMap(); - addVisibleMethods(map); + addVisibleMethods(map, new HashSet()); /* * ... but the hash map destroys order. Methods should be diff --git a/jdk/test/com/sun/jdi/VisibleMethods.java b/jdk/test/com/sun/jdi/VisibleMethods.java new file mode 100644 index 00000000000..70f7f5abe40 --- /dev/null +++ b/jdk/test/com/sun/jdi/VisibleMethods.java @@ -0,0 +1,141 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * 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 + * @summary Test ReferenceType.visibleMethods + * @bug 8028430 + * + * @author Staffan Larsen + * + * @run build TestScaffold VMConnection TargetListener TargetAdapter + * @run compile -g VisibleMethods.java + * @run main VisibleMethods + */ +import com.sun.jdi.Method; +import com.sun.jdi.ReferenceType; +import com.sun.jdi.StackFrame; +import com.sun.jdi.StringReference; +import com.sun.jdi.ThreadReference; +import com.sun.jdi.event.BreakpointEvent; + +import java.util.Arrays; +import java.util.List; +import java.util.stream.Collectors; + +/********** target program **********/ + +interface Super { + public void m(Object o); // This method should not be visible in AC + public void m(String s); // This method should not be visible in AC +} + +interface One extends Super { + public void m(Object o); + public void m1(); // Either this method or Two.m1 should be visible in AC +} + +interface Two extends Super { + public void m(String s); + public void m1(); // Either this method or One.m1 should be visible in AC +} + +abstract class AC implements One, Two { +} + +class CC extends AC { + public void m(Object o) { + } + public void m(String s) { + } + public void m1() { + } + public static void main(String[] args) { + System.out.println("Goodbye from VisibleMethods!"); + } +} + +/********** test program **********/ + +public class VisibleMethods extends TestScaffold { + ReferenceType targetClass; + ThreadReference mainThread; + + VisibleMethods(String args[]) { + super(args); + } + + public static void main(String[] args) throws Exception { + new VisibleMethods(args).startTests(); + } + + /********** test core **********/ + + protected void runTests() + throws Exception + { + /* + * Run to String. + */ + startToMain("CC"); + + ReferenceType ac = findReferenceType("AC"); + List visible = ac.visibleMethods(). + stream(). + map(Method::toString). + collect(Collectors.toList()); + + System.out.println("visibleMethods(): " + visible); + + verifyContains(visible, 1, "Two.m(java.lang.String)"); + verifyContains(visible, 1, "One.m(java.lang.Object)"); + verifyContains(visible, 0, "Super.m(java.lang.Object)"); + verifyContains(visible, 0, "Super.m(java.lang.String)"); + verifyContains(visible, 1, "Two.m1()", "One.m1()"); + + /* + * resume the target listening for events + */ + listenUntilVMDisconnect(); + } + + private void verifyContains(List methods, int matches, + String... sigs) throws Exception { + if (countMatches(methods, sigs) != matches) { + throw new Exception("visibleMethods() should have contained " + + matches + " entry/entries from " + Arrays.toString(sigs)); + } + } + + private int countMatches(List list1, String[] list2) { + int count = 0; + for (String s1 : list1) { + for (String s2 : list2) { + if (s1.equals(s2)) { + count++; + } + } + } + return count; + } +} From 6c4e462b47983509cea416c001982559edf53b59 Mon Sep 17 00:00:00 2001 From: Staffan Larsen Date: Mon, 16 Dec 2013 11:09:52 +0100 Subject: [PATCH 135/377] 4660158: TTY: NumberFormatException while trying to set values by 'set' command Reviewed-by: alanb, sspitsyn --- .../com/sun/tools/example/debug/expr/Expr.jj | 12 +- .../example/debug/expr/ExpressionParser.java | 3478 +++++------------ .../debug/expr/ExpressionParserConstants.java | 129 +- .../expr/ExpressionParserTokenManager.java | 829 ++-- .../example/debug/expr/JavaCharStream.java | 642 +++ .../sun/tools/example/debug/expr/LValue.java | 99 +- .../example/debug/expr/ParseException.java | 90 +- .../sun/tools/example/debug/expr/Token.java | 98 +- .../example/debug/expr/TokenMgrError.java | 256 +- jdk/test/com/sun/jdi/JdbExprTest.sh | 158 + 10 files changed, 2536 insertions(+), 3255 deletions(-) create mode 100644 jdk/src/share/classes/com/sun/tools/example/debug/expr/JavaCharStream.java create mode 100644 jdk/test/com/sun/jdi/JdbExprTest.sh diff --git a/jdk/src/share/classes/com/sun/tools/example/debug/expr/Expr.jj b/jdk/src/share/classes/com/sun/tools/example/debug/expr/Expr.jj index ffe12e35d7f..ece3be3d693 100644 --- a/jdk/src/share/classes/com/sun/tools/example/debug/expr/Expr.jj +++ b/jdk/src/share/classes/com/sun/tools/example/debug/expr/Expr.jj @@ -539,10 +539,10 @@ void MultiplicativeExpression() : } void UnaryExpression() : -{} +{Token tok;} { - ( "+" | "-" ) UnaryExpression() - { throw new ParseException("operation not yet supported"); } + ( tok = "+" | tok = "-" ) UnaryExpression() + { push( LValue.operation(vm, tok, pop(), frameGetter) ); } | PreIncrementExpression() | @@ -566,10 +566,10 @@ void PreDecrementExpression() : } void UnaryExpressionNotPlusMinus() : -{} +{Token tok;} { - ( "~" | "!" ) UnaryExpression() - { throw new ParseException("operation not yet supported"); } + ( tok = "~" | tok = "!" ) UnaryExpression() + { push( LValue.operation(vm, tok, pop(), frameGetter) ); } | LOOKAHEAD( CastLookahead() ) CastExpression() diff --git a/jdk/src/share/classes/com/sun/tools/example/debug/expr/ExpressionParser.java b/jdk/src/share/classes/com/sun/tools/example/debug/expr/ExpressionParser.java index 5a566671491..5cf2229d301 100644 --- a/jdk/src/share/classes/com/sun/tools/example/debug/expr/ExpressionParser.java +++ b/jdk/src/share/classes/com/sun/tools/example/debug/expr/ExpressionParser.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,38 +23,28 @@ * questions. */ -/* - * This source code is provided to illustrate the usage of a given feature - * or technique and has been deliberately simplified. Additional steps - * required for a production-quality application, such as security checks, - * input validation and proper error handling, might not be present in - * this sample code. - */ - - /* Generated By:JavaCC: Do not edit this line. ExpressionParser.java */ package com.sun.tools.example.debug.expr; import com.sun.jdi.*; - import java.util.Stack; import java.util.List; import java.util.ArrayList; public class ExpressionParser implements ExpressionParserConstants { - Stack stack = new Stack(); + Stack stack = new Stack(); VirtualMachine vm = null; GetFrame frameGetter = null; private static GetFrame lastFrameGetter; private static LValue lastLValue; LValue peek() { - return stack.peek(); + return (LValue)stack.peek(); } LValue pop() { - return stack.pop(); + return (LValue)stack.pop(); } void push(LValue lval) { @@ -62,7 +52,7 @@ public class ExpressionParser implements ExpressionParserConstants { } public static Value getMassagedValue() throws ParseException { - return lastLValue.getMassagedValue(lastFrameGetter); + return lastLValue.getMassagedValue(lastFrameGetter); } public interface GetFrame { @@ -70,14 +60,17 @@ public class ExpressionParser implements ExpressionParserConstants { } public static Value evaluate(String expr, VirtualMachine vm, - GetFrame frameGetter) throws ParseException, InvocationException, - InvalidTypeException, ClassNotLoadedException, + GetFrame frameGetter) throws ParseException, + InvocationException, + InvalidTypeException, + ClassNotLoadedException, IncompatibleThreadStateException { // TODO StringBufferInputStream is deprecated. java.io.InputStream in = new java.io.StringBufferInputStream(expr); ExpressionParser parser = new ExpressionParser(in); parser.vm = vm; parser.frameGetter = frameGetter; + Value value = null; parser.Expression(); lastFrameGetter = frameGetter; lastLValue = parser.pop(); @@ -95,8 +88,8 @@ public class ExpressionParser implements ExpressionParserConstants { try { parser = new ExpressionParser(new java.io.FileInputStream(args[0])); } catch (java.io.FileNotFoundException e) { - System.out.println("Java Parser Version 1.0.2: File " + args[0] - + " not found."); + System.out.println("Java Parser Version 1.0.2: File " + + args[0] + " not found."); return; } } else { @@ -143,7 +136,8 @@ public class ExpressionParser implements ExpressionParserConstants { jj_consume_token(-1); throw new ParseException(); } - label_1: while (true) { + label_1: + while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case LBRACKET: ; @@ -194,7 +188,8 @@ public class ExpressionParser implements ExpressionParserConstants { StringBuffer sb = new StringBuffer(); jj_consume_token(IDENTIFIER); sb.append(token); - label_2: while (true) { + label_2: + while (true) { if (jj_2_1(2)) { ; } else { @@ -202,18 +197,16 @@ public class ExpressionParser implements ExpressionParserConstants { } jj_consume_token(DOT); jj_consume_token(IDENTIFIER); - sb.append('.'); - sb.append(token); - } - if (true) { - return sb.toString(); - } + sb.append('.'); sb.append(token); + } + {if (true) return sb.toString();} throw new Error("Missing return statement in function"); } final public void NameList() throws ParseException { Name(); - label_3: while (true) { + label_3: + while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case COMMA: ; @@ -267,9 +260,7 @@ public class ExpressionParser implements ExpressionParserConstants { PrimaryExpression(); AssignmentOperator(); Expression(); - LValue exprVal = pop(); - pop().setValue(exprVal); - push(exprVal); + LValue exprVal = pop(); pop().setValue(exprVal); push(exprVal); } final public void AssignmentOperator() throws ParseException { @@ -325,18 +316,13 @@ public class ExpressionParser implements ExpressionParserConstants { Expression(); jj_consume_token(COLON); ConditionalExpression(); - LValue falseBranch = pop(); - LValue trueBranch = pop(); + LValue falseBranch = pop(); LValue trueBranch = pop(); Value cond = pop().interiorGetValue(); if (cond instanceof BooleanValue) { - push(((BooleanValue) cond).booleanValue() ? trueBranch - : falseBranch); + push(((BooleanValue)cond).booleanValue()? + trueBranch : falseBranch); } else { - { - if (true) { - throw new ParseException("Condition must be boolean"); - } - } + {if (true) throw new ParseException("Condition must be boolean");} } break; default: @@ -347,7 +333,8 @@ public class ExpressionParser implements ExpressionParserConstants { final public void ConditionalOrExpression() throws ParseException { ConditionalAndExpression(); - label_4: while (true) { + label_4: + while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case SC_OR: ; @@ -358,17 +345,14 @@ public class ExpressionParser implements ExpressionParserConstants { } jj_consume_token(SC_OR); ConditionalAndExpression(); - { - if (true) { - throw new ParseException("operation not yet supported"); - } - } + {if (true) throw new ParseException("operation not yet supported");} } } final public void ConditionalAndExpression() throws ParseException { InclusiveOrExpression(); - label_5: while (true) { + label_5: + while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case SC_AND: ; @@ -379,17 +363,14 @@ public class ExpressionParser implements ExpressionParserConstants { } jj_consume_token(SC_AND); InclusiveOrExpression(); - { - if (true) { - throw new ParseException("operation not yet supported"); - } - } + {if (true) throw new ParseException("operation not yet supported");} } } final public void InclusiveOrExpression() throws ParseException { ExclusiveOrExpression(); - label_6: while (true) { + label_6: + while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BIT_OR: ; @@ -400,17 +381,14 @@ public class ExpressionParser implements ExpressionParserConstants { } jj_consume_token(BIT_OR); ExclusiveOrExpression(); - { - if (true) { - throw new ParseException("operation not yet supported"); - } - } + {if (true) throw new ParseException("operation not yet supported");} } } final public void ExclusiveOrExpression() throws ParseException { AndExpression(); - label_7: while (true) { + label_7: + while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case XOR: ; @@ -421,17 +399,14 @@ public class ExpressionParser implements ExpressionParserConstants { } jj_consume_token(XOR); AndExpression(); - { - if (true) { - throw new ParseException("operation not yet supported"); - } - } + {if (true) throw new ParseException("operation not yet supported");} } } final public void AndExpression() throws ParseException { EqualityExpression(); - label_8: while (true) { + label_8: + while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BIT_AND: ; @@ -442,18 +417,15 @@ public class ExpressionParser implements ExpressionParserConstants { } jj_consume_token(BIT_AND); EqualityExpression(); - { - if (true) { - throw new ParseException("operation not yet supported"); - } - } + {if (true) throw new ParseException("operation not yet supported");} } } final public void EqualityExpression() throws ParseException { Token tok; InstanceOfExpression(); - label_9: while (true) { + label_9: + while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case EQ: case NE: @@ -487,11 +459,7 @@ public class ExpressionParser implements ExpressionParserConstants { case INSTANCEOF: jj_consume_token(INSTANCEOF); Type(); - { - if (true) { - throw new ParseException("operation not yet supported"); - } - } + {if (true) throw new ParseException("operation not yet supported");} break; default: jj_la1[14] = jj_gen; @@ -502,7 +470,8 @@ public class ExpressionParser implements ExpressionParserConstants { final public void RelationalExpression() throws ParseException { Token tok; ShiftExpression(); - label_10: while (true) { + label_10: + while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case GT: case LT: @@ -540,7 +509,8 @@ public class ExpressionParser implements ExpressionParserConstants { final public void ShiftExpression() throws ParseException { AdditiveExpression(); - label_11: while (true) { + label_11: + while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case LSHIFT: case RSIGNEDSHIFT: @@ -567,18 +537,15 @@ public class ExpressionParser implements ExpressionParserConstants { throw new ParseException(); } AdditiveExpression(); - { - if (true) { - throw new ParseException("operation not yet supported"); - } - } + {if (true) throw new ParseException("operation not yet supported");} } } final public void AdditiveExpression() throws ParseException { Token tok; MultiplicativeExpression(); - label_12: while (true) { + label_12: + while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case PLUS: case MINUS: @@ -609,7 +576,8 @@ public class ExpressionParser implements ExpressionParserConstants { final public void MultiplicativeExpression() throws ParseException { Token tok; UnaryExpression(); - label_13: while (true) { + label_13: + while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case STAR: case SLASH: @@ -642,15 +610,16 @@ public class ExpressionParser implements ExpressionParserConstants { } final public void UnaryExpression() throws ParseException { + Token tok; switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case PLUS: case MINUS: switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case PLUS: - jj_consume_token(PLUS); + tok = jj_consume_token(PLUS); break; case MINUS: - jj_consume_token(MINUS); + tok = jj_consume_token(MINUS); break; default: jj_la1[23] = jj_gen; @@ -658,11 +627,7 @@ public class ExpressionParser implements ExpressionParserConstants { throw new ParseException(); } UnaryExpression(); - { - if (true) { - throw new ParseException("operation not yet supported"); - } - } + push( LValue.operation(vm, tok, pop(), frameGetter) ); break; case INCR: PreIncrementExpression(); @@ -696,33 +661,26 @@ public class ExpressionParser implements ExpressionParserConstants { final public void PreIncrementExpression() throws ParseException { jj_consume_token(INCR); PrimaryExpression(); - { - if (true) { - throw new ParseException("operation not yet supported"); - } - } + {if (true) throw new ParseException("operation not yet supported");} } final public void PreDecrementExpression() throws ParseException { jj_consume_token(DECR); PrimaryExpression(); - { - if (true) { - throw new ParseException("operation not yet supported"); - } - } + {if (true) throw new ParseException("operation not yet supported");} } final public void UnaryExpressionNotPlusMinus() throws ParseException { + Token tok; switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BANG: case TILDE: switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case TILDE: - jj_consume_token(TILDE); + tok = jj_consume_token(TILDE); break; case BANG: - jj_consume_token(BANG); + tok = jj_consume_token(BANG); break; default: jj_la1[25] = jj_gen; @@ -730,11 +688,7 @@ public class ExpressionParser implements ExpressionParserConstants { throw new ParseException(); } UnaryExpression(); - { - if (true) { - throw new ParseException("operation not yet supported"); - } - } + push( LValue.operation(vm, tok, pop(), frameGetter) ); break; default: jj_la1[26] = jj_gen; @@ -765,10 +719,8 @@ public class ExpressionParser implements ExpressionParserConstants { } } - // This production is to determine lookahead only. The LOOKAHEAD - // specifications - // below are not used, but they are there just to indicate that we know - // about +// This production is to determine lookahead only. The LOOKAHEAD specifications +// below are not used, but they are there just to indicate that we know about // this. final public void CastLookahead() throws ParseException { if (jj_2_4(2)) { @@ -841,11 +793,7 @@ public class ExpressionParser implements ExpressionParserConstants { break; case DECR: jj_consume_token(DECR); - { - if (true) { - throw new ParseException("operation not yet supported"); - } - } + {if (true) throw new ParseException("operation not yet supported");} break; default: jj_la1[30] = jj_gen; @@ -863,7 +811,8 @@ public class ExpressionParser implements ExpressionParserConstants { if (jj_2_6(2)) { jj_consume_token(LPAREN); PrimitiveType(); - label_14: while (true) { + label_14: + while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case LBRACKET: ; @@ -882,7 +831,8 @@ public class ExpressionParser implements ExpressionParserConstants { case LPAREN: jj_consume_token(LPAREN); Name(); - label_15: while (true) { + label_15: + while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case LBRACKET: ; @@ -907,7 +857,8 @@ public class ExpressionParser implements ExpressionParserConstants { final public void PrimaryExpression() throws ParseException { PrimaryPrefix(); - label_16: while (true) { + label_16: + while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case LPAREN: case LBRACKET: @@ -946,11 +897,7 @@ public class ExpressionParser implements ExpressionParserConstants { jj_consume_token(SUPER); jj_consume_token(DOT); jj_consume_token(IDENTIFIER); - { - if (true) { - throw new ParseException("operation not yet supported"); - } - } + {if (true) throw new ParseException("operation not yet supported");} break; case LPAREN: jj_consume_token(LPAREN); @@ -968,7 +915,7 @@ public class ExpressionParser implements ExpressionParserConstants { } final public void PrimarySuffix() throws ParseException { - List argList; + List argList; switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case LBRACKET: jj_consume_token(LBRACKET); @@ -1046,8 +993,8 @@ public class ExpressionParser implements ExpressionParserConstants { jj_consume_token(NULL); } - final public List Arguments() throws ParseException { - List argList = new ArrayList(); + final public List Arguments() throws ParseException { + List argList = new ArrayList(); jj_consume_token(LPAREN); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case FALSE: @@ -1075,18 +1022,15 @@ public class ExpressionParser implements ExpressionParserConstants { ; } jj_consume_token(RPAREN); - { - if (true) { - return argList; - } - } + {if (true) return argList;} throw new Error("Missing return statement in function"); } - final public void ArgumentList(List argList) throws ParseException { + final public void ArgumentList(List argList) throws ParseException { Expression(); argList.add(pop().interiorGetValue()); - label_17: while (true) { + label_17: + while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case COMMA: ; @@ -1102,8 +1046,7 @@ public class ExpressionParser implements ExpressionParserConstants { } final public void AllocationExpression() throws ParseException { - List argList; - String className; + List argList; String className; if (jj_2_7(2)) { jj_consume_token(NEW); PrimitiveType(); @@ -1120,11 +1063,7 @@ public class ExpressionParser implements ExpressionParserConstants { break; case LBRACKET: ArrayDimensions(); - { - if (true) { - throw new ParseException("operation not yet supported"); - } - } + {if (true) throw new ParseException("operation not yet supported");} break; default: jj_la1[42] = jj_gen; @@ -1141,11 +1080,12 @@ public class ExpressionParser implements ExpressionParserConstants { } /* - * The second LOOKAHEAD specification below is to parse to PrimarySuffix if - * there is an expression between the "[...]". + * The second LOOKAHEAD specification below is to parse to PrimarySuffix + * if there is an expression between the "[...]". */ final public void ArrayDimensions() throws ParseException { - label_18: while (true) { + label_18: + while (true) { jj_consume_token(LBRACKET); Expression(); jj_consume_token(RBRACKET); @@ -1155,7 +1095,8 @@ public class ExpressionParser implements ExpressionParserConstants { break label_18; } } - label_19: while (true) { + label_19: + while (true) { if (jj_2_9(2)) { ; } else { @@ -1166,2230 +1107,636 @@ public class ExpressionParser implements ExpressionParserConstants { } } - final private boolean jj_2_1(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - boolean retval = !jj_3_1(); - jj_save(0, xla); - return retval; + private boolean jj_2_1(int xla) { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return !jj_3_1(); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(0, xla); } } - final private boolean jj_2_2(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - boolean retval = !jj_3_2(); - jj_save(1, xla); - return retval; + private boolean jj_2_2(int xla) { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return !jj_3_2(); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(1, xla); } } - final private boolean jj_2_3(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - boolean retval = !jj_3_3(); - jj_save(2, xla); - return retval; + private boolean jj_2_3(int xla) { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return !jj_3_3(); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(2, xla); } } - final private boolean jj_2_4(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - boolean retval = !jj_3_4(); - jj_save(3, xla); - return retval; + private boolean jj_2_4(int xla) { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return !jj_3_4(); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(3, xla); } } - final private boolean jj_2_5(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - boolean retval = !jj_3_5(); - jj_save(4, xla); - return retval; + private boolean jj_2_5(int xla) { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return !jj_3_5(); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(4, xla); } } - final private boolean jj_2_6(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - boolean retval = !jj_3_6(); - jj_save(5, xla); - return retval; + private boolean jj_2_6(int xla) { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return !jj_3_6(); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(5, xla); } } - final private boolean jj_2_7(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - boolean retval = !jj_3_7(); - jj_save(6, xla); - return retval; + private boolean jj_2_7(int xla) { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return !jj_3_7(); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(6, xla); } } - final private boolean jj_2_8(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - boolean retval = !jj_3_8(); - jj_save(7, xla); - return retval; + private boolean jj_2_8(int xla) { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return !jj_3_8(); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(7, xla); } } - final private boolean jj_2_9(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - boolean retval = !jj_3_9(); - jj_save(8, xla); - return retval; + private boolean jj_2_9(int xla) { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return !jj_3_9(); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(8, xla); } } - final private boolean jj_3R_154() { - if (jj_scan_token(INCR)) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } + private boolean jj_3R_94() { + if (jj_scan_token(DECR)) return true; + if (jj_3R_20()) return true; return false; } - final private boolean jj_3R_151() { + private boolean jj_3R_86() { + if (jj_3R_24()) return true; + return false; + } + + private boolean jj_3R_93() { + if (jj_scan_token(INCR)) return true; + if (jj_3R_20()) return true; + return false; + } + + private boolean jj_3R_91() { + if (jj_3R_95()) return true; + return false; + } + + private boolean jj_3R_23() { Token xsp; xsp = jj_scanpos; - if (jj_3R_154()) { + if (jj_scan_token(10)) { jj_scanpos = xsp; - if (jj_3R_155()) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } + if (jj_scan_token(15)) { + jj_scanpos = xsp; + if (jj_scan_token(12)) { + jj_scanpos = xsp; + if (jj_scan_token(45)) { + jj_scanpos = xsp; + if (jj_scan_token(34)) { + jj_scanpos = xsp; + if (jj_scan_token(36)) { + jj_scanpos = xsp; + if (jj_scan_token(27)) { + jj_scanpos = xsp; + if (jj_scan_token(21)) return true; + } + } + } + } + } + } + } return false; } - final private boolean jj_3R_148() { + private boolean jj_3R_90() { + if (jj_3R_94()) return true; + return false; + } + + private boolean jj_3R_89() { + if (jj_3R_93()) return true; + return false; + } + + private boolean jj_3R_85() { + if (jj_3R_23()) return true; + return false; + } + + private boolean jj_3R_60() { + if (jj_3R_58()) return true; + return false; + } + + private boolean jj_3R_88() { Token xsp; xsp = jj_scanpos; - if (jj_3_6()) { + if (jj_scan_token(94)) { jj_scanpos = xsp; - if (jj_3R_150()) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } + if (jj_scan_token(95)) return true; + } + if (jj_3R_83()) return true; return false; } - final private boolean jj_3_6() { - if (jj_scan_token(LPAREN)) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - if (jj_3R_23()) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } + private boolean jj_3R_83() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_88()) { + jj_scanpos = xsp; + if (jj_3R_89()) { + jj_scanpos = xsp; + if (jj_3R_90()) { + jj_scanpos = xsp; + if (jj_3R_91()) return true; + } + } + } + return false; + } + + private boolean jj_3R_82() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_85()) { + jj_scanpos = xsp; + if (jj_3R_86()) return true; + } + while (true) { + xsp = jj_scanpos; + if (jj_3R_87()) { jj_scanpos = xsp; break; } + } + return false; + } + + private boolean jj_3R_59() { + if (jj_3R_55()) return true; + return false; + } + + private boolean jj_3R_96() { + Token xsp; + xsp = jj_scanpos; + if (jj_scan_token(96)) { + jj_scanpos = xsp; + if (jj_scan_token(97)) { + jj_scanpos = xsp; + if (jj_scan_token(101)) return true; + } + } + if (jj_3R_83()) return true; + return false; + } + + private boolean jj_3R_80() { + if (jj_3R_83()) return true; Token xsp; while (true) { xsp = jj_scanpos; - if (jj_3R_152()) { - jj_scanpos = xsp; - break; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - } - if (jj_scan_token(RPAREN)) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - if (jj_3R_115()) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } + if (jj_3R_96()) { jj_scanpos = xsp; break; } + } return false; } - final private boolean jj_3R_25() { + private boolean jj_3R_92() { Token xsp; xsp = jj_scanpos; - if (jj_3R_50()) { + if (jj_scan_token(94)) { jj_scanpos = xsp; - if (jj_3R_51()) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } + if (jj_scan_token(95)) return true; + } + if (jj_3R_80()) return true; return false; } - final private boolean jj_3R_50() { - if (jj_3R_67()) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } + private boolean jj_3_8() { + if (jj_scan_token(LBRACKET)) return true; + if (jj_3R_25()) return true; + if (jj_scan_token(RBRACKET)) return true; return false; } - final private boolean jj_3_5() { - if (jj_scan_token(LPAREN)) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - if (jj_3R_24()) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - if (jj_scan_token(LBRACKET)) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } + private boolean jj_3R_58() { + Token xsp; + if (jj_3_8()) return true; + while (true) { + xsp = jj_scanpos; + if (jj_3_8()) { jj_scanpos = xsp; break; } + } + while (true) { + xsp = jj_scanpos; + if (jj_3_9()) { jj_scanpos = xsp; break; } + } return false; } - final private boolean jj_3R_149() { - if (jj_3R_20()) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } + private boolean jj_3R_84() { Token xsp; xsp = jj_scanpos; - if (jj_3R_151()) { - jj_scanpos = xsp; - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } + if (jj_scan_token(102)) { + jj_scanpos = xsp; + if (jj_scan_token(103)) { + jj_scanpos = xsp; + if (jj_scan_token(104)) return true; + } + } + if (jj_3R_78()) return true; return false; } - final private boolean jj_3R_41() { - if (jj_scan_token(LPAREN)) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - if (jj_3R_24()) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - if (jj_scan_token(RPAREN)) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } + private boolean jj_3R_78() { + if (jj_3R_80()) return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_92()) { jj_scanpos = xsp; break; } + } + return false; + } + + private boolean jj_3R_54() { + if (jj_scan_token(NEW)) return true; + if (jj_3R_24()) return true; Token xsp; xsp = jj_scanpos; if (jj_3R_59()) { jj_scanpos = xsp; - if (jj_3R_60()) { - jj_scanpos = xsp; - if (jj_3R_61()) { - jj_scanpos = xsp; - if (jj_3R_62()) { - jj_scanpos = xsp; - if (jj_3R_63()) { - jj_scanpos = xsp; - if (jj_3R_64()) { - jj_scanpos = xsp; - if (jj_3R_65()) { - jj_scanpos = xsp; - if (jj_3R_66()) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - return false; - } - - final private boolean jj_3R_40() { - if (jj_scan_token(LPAREN)) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - if (jj_3R_24()) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - if (jj_scan_token(LBRACKET)) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - if (jj_scan_token(RBRACKET)) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - return false; - } - - final private boolean jj_3R_123() { - if (jj_scan_token(LBRACKET)) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - if (jj_scan_token(RBRACKET)) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - return false; - } - - final private boolean jj_3_1() { - if (jj_scan_token(DOT)) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - if (jj_scan_token(IDENTIFIER)) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - return false; - } - - final private boolean jj_3_4() { - if (jj_scan_token(LPAREN)) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - if (jj_3R_23()) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - return false; - } - - final private boolean jj_3R_22() { - Token xsp; - xsp = jj_scanpos; - if (jj_3_4()) { - jj_scanpos = xsp; - if (jj_3R_40()) { - jj_scanpos = xsp; - if (jj_3R_41()) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - return false; - } - - final private boolean jj_3_3() { - if (jj_3R_22()) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - return false; - } - - final private boolean jj_3R_24() { - if (jj_scan_token(IDENTIFIER)) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3_1()) { - jj_scanpos = xsp; - break; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } + if (jj_3R_60()) return true; } return false; } - final private boolean jj_3R_147() { - if (jj_scan_token(BANG)) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - return false; - } - - final private boolean jj_3R_142() { - if (jj_3R_149()) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - return false; - } - - final private boolean jj_3R_122() { - if (jj_3R_24()) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - return false; - } - - final private boolean jj_3R_49() { - if (jj_scan_token(DOUBLE)) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - return false; - } - - final private boolean jj_3R_141() { - if (jj_3R_148()) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - return false; - } - - final private boolean jj_3R_48() { - if (jj_scan_token(FLOAT)) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - return false; - } - - final private boolean jj_3R_146() { - if (jj_scan_token(TILDE)) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - return false; - } - - final private boolean jj_3R_47() { - if (jj_scan_token(LONG)) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - return false; - } - - final private boolean jj_3R_140() { + private boolean jj_3R_76() { + if (jj_3R_78()) return true; Token xsp; - xsp = jj_scanpos; - if (jj_3R_146()) { - jj_scanpos = xsp; - if (jj_3R_147()) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - if (jj_3R_115()) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - return false; - } - - final private boolean jj_3R_136() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_140()) { - jj_scanpos = xsp; - if (jj_3R_141()) { - jj_scanpos = xsp; - if (jj_3R_142()) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - return false; - } - - final private boolean jj_3R_46() { - if (jj_scan_token(INT)) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - return false; - } - - final private boolean jj_3R_145() { - if (jj_scan_token(REM)) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - return false; - } - - final private boolean jj_3R_45() { - if (jj_scan_token(SHORT)) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - return false; - } - - final private boolean jj_3R_44() { - if (jj_scan_token(BYTE)) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - return false; - } - - final private boolean jj_3R_135() { - if (jj_scan_token(DECR)) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - if (jj_3R_20()) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - return false; - } - - final private boolean jj_3R_43() { - if (jj_scan_token(CHAR)) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - return false; - } - - final private boolean jj_3R_23() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_42()) { - jj_scanpos = xsp; - if (jj_3R_43()) { - jj_scanpos = xsp; - if (jj_3R_44()) { - jj_scanpos = xsp; - if (jj_3R_45()) { - jj_scanpos = xsp; - if (jj_3R_46()) { - jj_scanpos = xsp; - if (jj_3R_47()) { - jj_scanpos = xsp; - if (jj_3R_48()) { - jj_scanpos = xsp; - if (jj_3R_49()) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - return false; - } - - final private boolean jj_3R_42() { - if (jj_scan_token(BOOLEAN)) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - return false; - } - - final private boolean jj_3_9() { - if (jj_scan_token(LBRACKET)) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - if (jj_scan_token(RBRACKET)) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - return false; - } - - final private boolean jj_3R_121() { - if (jj_3R_23()) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - return false; - } - - final private boolean jj_3R_144() { - if (jj_scan_token(SLASH)) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - return false; - } - - final private boolean jj_3R_134() { - if (jj_scan_token(INCR)) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - if (jj_3R_20()) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - return false; - } - - final private boolean jj_3R_114() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_121()) { - jj_scanpos = xsp; - if (jj_3R_122()) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } while (true) { xsp = jj_scanpos; - if (jj_3R_123()) { - jj_scanpos = xsp; - break; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } + if (jj_3R_84()) { jj_scanpos = xsp; break; } } return false; } - final private boolean jj_3R_120() { - if (jj_scan_token(GE)) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - return false; - } - - final private boolean jj_3R_133() { - if (jj_scan_token(MINUS)) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - return false; - } - - final private boolean jj_3R_127() { - if (jj_3R_136()) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - return false; - } - - final private boolean jj_3R_126() { - if (jj_3R_135()) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - return false; - } - - final private boolean jj_3R_139() { - if (jj_scan_token(MINUS)) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - return false; - } - - final private boolean jj_3R_125() { - if (jj_3R_134()) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - return false; - } - - final private boolean jj_3R_132() { - if (jj_scan_token(PLUS)) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - return false; - } - - final private boolean jj_3R_143() { - if (jj_scan_token(STAR)) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - return false; - } - - final private boolean jj_3R_124() { + private boolean jj_3R_81() { Token xsp; xsp = jj_scanpos; - if (jj_3R_132()) { + if (jj_scan_token(81)) { jj_scanpos = xsp; - if (jj_3R_133()) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - if (jj_3R_115()) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - return false; - } - - final private boolean jj_3R_115() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_124()) { + if (jj_scan_token(80)) { jj_scanpos = xsp; - if (jj_3R_125()) { + if (jj_scan_token(87)) { jj_scanpos = xsp; - if (jj_3R_126()) { - jj_scanpos = xsp; - if (jj_3R_127()) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - return false; - } - - final private boolean jj_3R_137() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_143()) { - jj_scanpos = xsp; - if (jj_3R_144()) { - jj_scanpos = xsp; - if (jj_3R_145()) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - if (jj_3R_115()) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - return false; - } - - final private boolean jj_3R_131() { - if (jj_scan_token(RUNSIGNEDSHIFT)) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - return false; - } - - final private boolean jj_3R_119() { - if (jj_scan_token(LE)) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - return false; - } - - final private boolean jj_3R_138() { - if (jj_scan_token(PLUS)) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - return false; - } - - final private boolean jj_3R_112() { - if (jj_3R_115()) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_137()) { - jj_scanpos = xsp; - break; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } + if (jj_scan_token(88)) return true; } - return false; - } - - final private boolean jj_3R_88() { - if (jj_3R_86()) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - return false; - } - - final private boolean jj_3R_130() { - if (jj_scan_token(RSIGNEDSHIFT)) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - return false; - } - - final private boolean jj_3R_128() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_138()) { - jj_scanpos = xsp; - if (jj_3R_139()) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - if (jj_3R_112()) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - return false; - } - - final private boolean jj_3R_87() { - if (jj_3R_82()) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - return false; - } - - final private boolean jj_3R_118() { - if (jj_scan_token(GT)) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - return false; - } - - final private boolean jj_3R_129() { - if (jj_scan_token(LSHIFT)) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - return false; - } - - final private boolean jj_3R_116() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_129()) { - jj_scanpos = xsp; - if (jj_3R_130()) { - jj_scanpos = xsp; - if (jj_3R_131()) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - if (jj_3R_108()) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - return false; - } - - final private boolean jj_3R_108() { - if (jj_3R_112()) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_128()) { - jj_scanpos = xsp; - break; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } } - return false; - } - - final private boolean jj_3_8() { - if (jj_scan_token(LBRACKET)) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - if (jj_3R_25()) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - if (jj_scan_token(RBRACKET)) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - return false; - } - - final private boolean jj_3R_86() { - Token xsp; - if (jj_3_8()) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - while (true) { - xsp = jj_scanpos; - if (jj_3_8()) { - jj_scanpos = xsp; - break; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - } - while (true) { - xsp = jj_scanpos; - if (jj_3_9()) { - jj_scanpos = xsp; - break; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } } + if (jj_3R_76()) return true; return false; } - final private boolean jj_3R_117() { - if (jj_scan_token(LT)) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - return false; - } - - final private boolean jj_3R_106() { - if (jj_3R_108()) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_116()) { - jj_scanpos = xsp; - break; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - } - return false; - } - - final private boolean jj_3R_113() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_117()) { - jj_scanpos = xsp; - if (jj_3R_118()) { - jj_scanpos = xsp; - if (jj_3R_119()) { - jj_scanpos = xsp; - if (jj_3R_120()) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - if (jj_3R_106()) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - return false; - } - - final private boolean jj_3R_111() { - if (jj_scan_token(NE)) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - return false; - } - - final private boolean jj_3R_109() { - if (jj_scan_token(INSTANCEOF)) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - if (jj_3R_114()) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - return false; - } - - final private boolean jj_3R_104() { - if (jj_3R_106()) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_113()) { - jj_scanpos = xsp; - break; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - } - return false; - } - - final private boolean jj_3R_81() { - if (jj_scan_token(NEW)) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - if (jj_3R_24()) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - Token xsp; - xsp = jj_scanpos; - if (jj_3R_87()) { - jj_scanpos = xsp; - if (jj_3R_88()) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - return false; - } - - final private boolean jj_3_7() { - if (jj_scan_token(NEW)) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - if (jj_3R_23()) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - if (jj_3R_86()) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - return false; - } - - final private boolean jj_3R_70() { + private boolean jj_3R_43() { Token xsp; xsp = jj_scanpos; if (jj_3_7()) { jj_scanpos = xsp; - if (jj_3R_81()) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - return false; - } - - final private boolean jj_3R_97() { - if (jj_scan_token(COMMA)) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - if (jj_3R_25()) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - return false; - } - - final private boolean jj_3R_39() { - if (jj_scan_token(ORASSIGN)) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - return false; - } - - final private boolean jj_3R_110() { - if (jj_scan_token(EQ)) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - return false; - } - - final private boolean jj_3R_102() { - if (jj_3R_104()) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - Token xsp; - xsp = jj_scanpos; - if (jj_3R_109()) { - jj_scanpos = xsp; - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - return false; - } - - final private boolean jj_3R_107() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_110()) { - jj_scanpos = xsp; - if (jj_3R_111()) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - if (jj_3R_102()) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - return false; - } - - final private boolean jj_3R_94() { - if (jj_3R_25()) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_97()) { - jj_scanpos = xsp; - break; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } + if (jj_3R_54()) return true; } return false; } - final private boolean jj_3R_89() { - if (jj_3R_94()) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } + private boolean jj_3_7() { + if (jj_scan_token(NEW)) return true; + if (jj_3R_23()) return true; + if (jj_3R_58()) return true; return false; } - final private boolean jj_3R_38() { - if (jj_scan_token(XORASSIGN)) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } + private boolean jj_3R_67() { + if (jj_scan_token(COMMA)) return true; + if (jj_3R_25()) return true; return false; } - final private boolean jj_3R_82() { - if (jj_scan_token(LPAREN)) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - Token xsp; - xsp = jj_scanpos; - if (jj_3R_89()) { - jj_scanpos = xsp; - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - if (jj_scan_token(RPAREN)) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - return false; - } - - final private boolean jj_3R_105() { - if (jj_scan_token(BIT_AND)) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - if (jj_3R_100()) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - return false; - } - - final private boolean jj_3R_100() { - if (jj_3R_102()) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } + private boolean jj_3R_64() { + if (jj_3R_25()) return true; Token xsp; while (true) { xsp = jj_scanpos; - if (jj_3R_107()) { - jj_scanpos = xsp; - break; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } + if (jj_3R_67()) { jj_scanpos = xsp; break; } } return false; } - final private boolean jj_3R_37() { - if (jj_scan_token(ANDASSIGN)) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } + private boolean jj_3R_61() { + if (jj_3R_64()) return true; return false; } - final private boolean jj_3R_85() { - if (jj_scan_token(NULL)) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } + private boolean jj_3R_79() { + if (jj_scan_token(INSTANCEOF)) return true; + if (jj_3R_82()) return true; return false; } - final private boolean jj_3R_103() { - if (jj_scan_token(XOR)) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - if (jj_3R_98()) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - return false; - } - - final private boolean jj_3R_98() { - if (jj_3R_100()) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } + private boolean jj_3R_74() { + if (jj_3R_76()) return true; Token xsp; while (true) { xsp = jj_scanpos; - if (jj_3R_105()) { - jj_scanpos = xsp; - break; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } + if (jj_3R_81()) { jj_scanpos = xsp; break; } } return false; } - final private boolean jj_3R_92() { - if (jj_scan_token(FALSE)) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - return false; - } - - final private boolean jj_3R_36() { - if (jj_scan_token(RUNSIGNEDSHIFTASSIGN)) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - return false; - } - - final private boolean jj_3R_91() { - if (jj_scan_token(TRUE)) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - return false; - } - - final private boolean jj_3R_84() { + private boolean jj_3R_55() { + if (jj_scan_token(LPAREN)) return true; Token xsp; xsp = jj_scanpos; - if (jj_3R_91()) { + if (jj_3R_61()) jj_scanpos = xsp; + if (jj_scan_token(RPAREN)) return true; + return false; + } + + private boolean jj_3R_72() { + if (jj_3R_74()) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_79()) jj_scanpos = xsp; + return false; + } + + private boolean jj_3R_77() { + Token xsp; + xsp = jj_scanpos; + if (jj_scan_token(86)) { jj_scanpos = xsp; - if (jj_3R_92()) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } + if (jj_scan_token(89)) return true; + } + if (jj_3R_72()) return true; return false; } - final private boolean jj_3R_101() { - if (jj_scan_token(BIT_OR)) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - if (jj_3R_95()) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } + private boolean jj_3R_75() { + if (jj_scan_token(BIT_AND)) return true; + if (jj_3R_70()) return true; return false; } - final private boolean jj_3R_95() { - if (jj_3R_98()) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } + private boolean jj_3R_70() { + if (jj_3R_72()) return true; Token xsp; while (true) { xsp = jj_scanpos; - if (jj_3R_103()) { - jj_scanpos = xsp; - break; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } + if (jj_3R_77()) { jj_scanpos = xsp; break; } } return false; } - final private boolean jj_3R_35() { - if (jj_scan_token(RSIGNEDSHIFTASSIGN)) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - return false; - } - - final private boolean jj_3R_80() { - if (jj_3R_85()) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - return false; - } - - final private boolean jj_3R_66() { - if (jj_3R_69()) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - return false; - } - - final private boolean jj_3R_79() { - if (jj_3R_84()) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - return false; - } - - final private boolean jj_3R_78() { - if (jj_scan_token(STRING_LITERAL)) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - return false; - } - - final private boolean jj_3R_99() { - if (jj_scan_token(SC_AND)) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - if (jj_3R_90()) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - return false; - } - - final private boolean jj_3R_90() { - if (jj_3R_95()) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } + private boolean jj_3R_57() { Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_101()) { - jj_scanpos = xsp; - break; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } + xsp = jj_scanpos; + if (jj_scan_token(54)) { + jj_scanpos = xsp; + if (jj_scan_token(24)) return true; } return false; } - final private boolean jj_3R_34() { - if (jj_scan_token(LSHIFTASSIGN)) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } + private boolean jj_3R_53() { + if (jj_scan_token(39)) return true; return false; } - final private boolean jj_3R_65() { - if (jj_scan_token(NEW)) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } + private boolean jj_3R_39() { + if (jj_3R_42()) return true; return false; } - final private boolean jj_3R_77() { - if (jj_scan_token(CHARACTER_LITERAL)) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - return false; - } - - final private boolean jj_3R_76() { - if (jj_scan_token(FLOATING_POINT_LITERAL)) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - return false; - } - - final private boolean jj_3R_33() { - if (jj_scan_token(MINUSASSIGN)) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - return false; - } - - final private boolean jj_3R_69() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_75()) { - jj_scanpos = xsp; - if (jj_3R_76()) { - jj_scanpos = xsp; - if (jj_3R_77()) { - jj_scanpos = xsp; - if (jj_3R_78()) { - jj_scanpos = xsp; - if (jj_3R_79()) { - jj_scanpos = xsp; - if (jj_3R_80()) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - return false; - } - - final private boolean jj_3R_75() { - if (jj_scan_token(INTEGER_LITERAL)) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - return false; - } - - final private boolean jj_3R_96() { - if (jj_scan_token(SC_OR)) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - if (jj_3R_83()) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - return false; - } - - final private boolean jj_3R_83() { - if (jj_3R_90()) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } + private boolean jj_3R_68() { + if (jj_3R_70()) return true; Token xsp; while (true) { xsp = jj_scanpos; - if (jj_3R_99()) { - jj_scanpos = xsp; - break; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } + if (jj_3R_75()) { jj_scanpos = xsp; break; } } return false; } - final private boolean jj_3R_64() { - if (jj_scan_token(SUPER)) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } + private boolean jj_3R_73() { + if (jj_scan_token(XOR)) return true; + if (jj_3R_68()) return true; return false; } - final private boolean jj_3R_32() { - if (jj_scan_token(PLUSASSIGN)) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } + private boolean jj_3R_52() { + if (jj_3R_57()) return true; return false; } - final private boolean jj_3R_73() { - if (jj_3R_82()) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } + private boolean jj_3R_51() { + if (jj_scan_token(STRING_LITERAL)) return true; return false; } - final private boolean jj_3R_72() { - if (jj_scan_token(DOT)) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - if (jj_scan_token(IDENTIFIER)) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } + private boolean jj_3R_50() { + if (jj_scan_token(CHARACTER_LITERAL)) return true; return false; } - final private boolean jj_3R_74() { - if (jj_3R_83()) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } + private boolean jj_3R_65() { + if (jj_3R_68()) return true; Token xsp; while (true) { xsp = jj_scanpos; - if (jj_3R_96()) { - jj_scanpos = xsp; - break; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } + if (jj_3R_73()) { jj_scanpos = xsp; break; } } return false; } - final private boolean jj_3R_63() { - if (jj_scan_token(THIS)) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } + private boolean jj_3R_71() { + if (jj_scan_token(BIT_OR)) return true; + if (jj_3R_65()) return true; return false; } - final private boolean jj_3R_31() { - if (jj_scan_token(REMASSIGN)) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } + private boolean jj_3R_49() { + if (jj_scan_token(FLOATING_POINT_LITERAL)) return true; return false; } - final private boolean jj_3R_58() { + private boolean jj_3R_42() { Token xsp; xsp = jj_scanpos; - if (jj_3R_71()) { + if (jj_3R_48()) { jj_scanpos = xsp; - if (jj_3R_72()) { + if (jj_3R_49()) { + jj_scanpos = xsp; + if (jj_3R_50()) { + jj_scanpos = xsp; + if (jj_3R_51()) { jj_scanpos = xsp; - if (jj_3R_73()) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - return false; - } - - final private boolean jj_3R_71() { - if (jj_scan_token(LBRACKET)) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - if (jj_3R_25()) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - if (jj_scan_token(RBRACKET)) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - return false; - } - - final private boolean jj_3R_93() { - if (jj_scan_token(HOOK)) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - if (jj_3R_25()) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - if (jj_scan_token(COLON)) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - if (jj_3R_68()) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - return false; - } - - final private boolean jj_3R_57() { - if (jj_3R_70()) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - return false; - } - - final private boolean jj_3R_30() { - if (jj_scan_token(SLASHASSIGN)) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - return false; - } - - final private boolean jj_3R_27() { - if (jj_3R_58()) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - return false; - } - - final private boolean jj_3R_56() { - if (jj_scan_token(LPAREN)) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - if (jj_3R_25()) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - if (jj_scan_token(RPAREN)) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - return false; - } - - final private boolean jj_3R_152() { - if (jj_scan_token(LBRACKET)) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - if (jj_scan_token(RBRACKET)) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - return false; - } - - final private boolean jj_3R_55() { - if (jj_scan_token(SUPER)) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - if (jj_scan_token(DOT)) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - if (jj_scan_token(IDENTIFIER)) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - return false; - } - - final private boolean jj_3R_29() { - if (jj_scan_token(STARASSIGN)) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - return false; - } - - final private boolean jj_3R_68() { - if (jj_3R_74()) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - Token xsp; - xsp = jj_scanpos; - if (jj_3R_93()) { - jj_scanpos = xsp; - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - return false; - } - - final private boolean jj_3R_54() { - if (jj_scan_token(THIS)) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - return false; - } - - final private boolean jj_3R_62() { - if (jj_scan_token(IDENTIFIER)) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - return false; - } - - final private boolean jj_3R_53() { - if (jj_3R_24()) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - return false; - } - - final private boolean jj_3R_153() { - if (jj_scan_token(LBRACKET)) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - if (jj_scan_token(RBRACKET)) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - return false; - } - - final private boolean jj_3R_26() { - Token xsp; - xsp = jj_scanpos; if (jj_3R_52()) { jj_scanpos = xsp; - if (jj_3R_53()) { - jj_scanpos = xsp; - if (jj_3R_54()) { - jj_scanpos = xsp; - if (jj_3R_55()) { - jj_scanpos = xsp; - if (jj_3R_56()) { - jj_scanpos = xsp; - if (jj_3R_57()) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } + if (jj_3R_53()) return true; + } + } + } + } + } return false; } - final private boolean jj_3R_52() { - if (jj_3R_69()) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } + private boolean jj_3R_48() { + if (jj_scan_token(INTEGER_LITERAL)) return true; return false; } - final private boolean jj_3R_21() { + private boolean jj_3R_62() { + if (jj_3R_65()) return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_71()) { jj_scanpos = xsp; break; } + } + return false; + } + + private boolean jj_3R_69() { + if (jj_scan_token(SC_AND)) return true; + if (jj_3R_62()) return true; + return false; + } + + private boolean jj_3R_46() { + if (jj_3R_55()) return true; + return false; + } + + private boolean jj_3R_45() { + if (jj_scan_token(DOT)) return true; + if (jj_scan_token(IDENTIFIER)) return true; + return false; + } + + private boolean jj_3R_56() { + if (jj_3R_62()) return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_69()) { jj_scanpos = xsp; break; } + } + return false; + } + + private boolean jj_3R_66() { + if (jj_scan_token(SC_OR)) return true; + if (jj_3R_56()) return true; + return false; + } + + private boolean jj_3R_44() { + if (jj_scan_token(LBRACKET)) return true; + if (jj_3R_25()) return true; + if (jj_scan_token(RBRACKET)) return true; + return false; + } + + private boolean jj_3R_38() { Token xsp; xsp = jj_scanpos; - if (jj_3R_28()) { + if (jj_3R_44()) { jj_scanpos = xsp; - if (jj_3R_29()) { - jj_scanpos = xsp; - if (jj_3R_30()) { - jj_scanpos = xsp; - if (jj_3R_31()) { + if (jj_3R_45()) { jj_scanpos = xsp; + if (jj_3R_46()) return true; + } + } + return false; + } + + private boolean jj_3R_37() { + if (jj_3R_43()) return true; + return false; + } + + private boolean jj_3R_27() { + if (jj_3R_38()) return true; + return false; + } + + private boolean jj_3R_36() { + if (jj_scan_token(LPAREN)) return true; + if (jj_3R_25()) return true; + if (jj_scan_token(RPAREN)) return true; + return false; + } + + private boolean jj_3R_47() { + if (jj_3R_56()) return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_66()) { jj_scanpos = xsp; break; } + } + return false; + } + + private boolean jj_3R_104() { + if (jj_scan_token(LBRACKET)) return true; + if (jj_scan_token(RBRACKET)) return true; + return false; + } + + private boolean jj_3R_35() { + if (jj_scan_token(SUPER)) return true; + if (jj_scan_token(DOT)) return true; + if (jj_scan_token(IDENTIFIER)) return true; + return false; + } + + private boolean jj_3R_34() { + if (jj_scan_token(THIS)) return true; + return false; + } + + private boolean jj_3R_63() { + if (jj_scan_token(HOOK)) return true; + if (jj_3R_25()) return true; + if (jj_scan_token(COLON)) return true; + if (jj_3R_41()) return true; + return false; + } + + private boolean jj_3R_33() { + if (jj_3R_24()) return true; + return false; + } + + private boolean jj_3R_105() { + if (jj_scan_token(LBRACKET)) return true; + if (jj_scan_token(RBRACKET)) return true; + return false; + } + + private boolean jj_3R_32() { + if (jj_3R_42()) return true; + return false; + } + + private boolean jj_3R_26() { + Token xsp; + xsp = jj_scanpos; if (jj_3R_32()) { jj_scanpos = xsp; if (jj_3R_33()) { @@ -3400,318 +1747,420 @@ public class ExpressionParser implements ExpressionParserConstants { jj_scanpos = xsp; if (jj_3R_36()) { jj_scanpos = xsp; - if (jj_3R_37()) { - jj_scanpos = xsp; - if (jj_3R_38()) { - jj_scanpos = xsp; - if (jj_3R_39()) { - return true; - } - if (jj_la == 0 - && jj_scanpos == jj_lastpos) { - return false; - } - } else if (jj_la == 0 - && jj_scanpos == jj_lastpos) { - return false; - } - } else if (jj_la == 0 - && jj_scanpos == jj_lastpos) { - return false; - } - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - return false; - } - - final private boolean jj_3R_28() { - if (jj_scan_token(ASSIGN)) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - return false; - } - - final private boolean jj_3R_61() { - if (jj_scan_token(LPAREN)) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - return false; - } - - final private boolean jj_3_2() { - if (jj_3R_20()) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - if (jj_3R_21()) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - return false; - } - - final private boolean jj_3R_20() { - if (jj_3R_26()) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_27()) { - jj_scanpos = xsp; - break; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } + if (jj_3R_37()) return true; + } + } + } + } } return false; } - final private boolean jj_3R_60() { - if (jj_scan_token(BANG)) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - return false; - } - - final private boolean jj_3R_155() { - if (jj_scan_token(DECR)) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - return false; - } - - final private boolean jj_3R_67() { - if (jj_3R_20()) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - if (jj_3R_21()) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - if (jj_3R_25()) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - return false; - } - - final private boolean jj_3R_150() { - if (jj_scan_token(LPAREN)) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - if (jj_3R_24()) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } + private boolean jj_3R_20() { + if (jj_3R_26()) return true; Token xsp; while (true) { xsp = jj_scanpos; - if (jj_3R_153()) { - jj_scanpos = xsp; - break; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - } - if (jj_scan_token(RPAREN)) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } - if (jj_3R_136()) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } + if (jj_3R_27()) { jj_scanpos = xsp; break; } + } return false; } - final private boolean jj_3R_59() { - if (jj_scan_token(TILDE)) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } + private boolean jj_3R_41() { + if (jj_3R_47()) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_63()) jj_scanpos = xsp; return false; } - final private boolean jj_3R_51() { - if (jj_3R_68()) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - return false; - } + private boolean jj_3R_106() { + if (jj_scan_token(DECR)) return true; return false; } + private boolean jj_3R_102() { + if (jj_scan_token(LPAREN)) return true; + if (jj_3R_24()) return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_105()) { jj_scanpos = xsp; break; } + } + if (jj_scan_token(RPAREN)) return true; + if (jj_3R_95()) return true; + return false; + } + + private boolean jj_3R_21() { + Token xsp; + xsp = jj_scanpos; + if (jj_scan_token(79)) { + jj_scanpos = xsp; + if (jj_scan_token(107)) { + jj_scanpos = xsp; + if (jj_scan_token(108)) { + jj_scanpos = xsp; + if (jj_scan_token(112)) { + jj_scanpos = xsp; + if (jj_scan_token(105)) { + jj_scanpos = xsp; + if (jj_scan_token(106)) { + jj_scanpos = xsp; + if (jj_scan_token(113)) { + jj_scanpos = xsp; + if (jj_scan_token(114)) { + jj_scanpos = xsp; + if (jj_scan_token(115)) { + jj_scanpos = xsp; + if (jj_scan_token(109)) { + jj_scanpos = xsp; + if (jj_scan_token(111)) { + jj_scanpos = xsp; + if (jj_scan_token(110)) return true; + } + } + } + } + } + } + } + } + } + } + } + return false; + } + + private boolean jj_3R_103() { + Token xsp; + xsp = jj_scanpos; + if (jj_scan_token(92)) { + jj_scanpos = xsp; + if (jj_3R_106()) return true; + } + return false; + } + + private boolean jj_3R_100() { + Token xsp; + xsp = jj_scanpos; + if (jj_3_6()) { + jj_scanpos = xsp; + if (jj_3R_102()) return true; + } + return false; + } + + private boolean jj_3_6() { + if (jj_scan_token(LPAREN)) return true; + if (jj_3R_23()) return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_104()) { jj_scanpos = xsp; break; } + } + if (jj_scan_token(RPAREN)) return true; + if (jj_3R_83()) return true; + return false; + } + + private boolean jj_3_2() { + if (jj_3R_20()) return true; + if (jj_3R_21()) return true; + return false; + } + + private boolean jj_3R_40() { + if (jj_3R_20()) return true; + if (jj_3R_21()) return true; + if (jj_3R_25()) return true; + return false; + } + + private boolean jj_3_5() { + if (jj_scan_token(LPAREN)) return true; + if (jj_3R_24()) return true; + if (jj_scan_token(LBRACKET)) return true; + return false; + } + + private boolean jj_3R_101() { + if (jj_3R_20()) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_103()) jj_scanpos = xsp; + return false; + } + + private boolean jj_3R_31() { + if (jj_3R_41()) return true; + return false; + } + + private boolean jj_3R_30() { + if (jj_3R_40()) return true; + return false; + } + + private boolean jj_3R_25() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_30()) { + jj_scanpos = xsp; + if (jj_3R_31()) return true; + } + return false; + } + + private boolean jj_3R_29() { + if (jj_scan_token(LPAREN)) return true; + if (jj_3R_24()) return true; + if (jj_scan_token(RPAREN)) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_scan_token(83)) { + jj_scanpos = xsp; + if (jj_scan_token(82)) { + jj_scanpos = xsp; + if (jj_scan_token(70)) { + jj_scanpos = xsp; + if (jj_scan_token(67)) { + jj_scanpos = xsp; + if (jj_scan_token(50)) { + jj_scanpos = xsp; + if (jj_scan_token(47)) { + jj_scanpos = xsp; + if (jj_scan_token(38)) { + jj_scanpos = xsp; + if (jj_3R_39()) return true; + } + } + } + } + } + } + } + return false; + } + + private boolean jj_3R_28() { + if (jj_scan_token(LPAREN)) return true; + if (jj_3R_24()) return true; + if (jj_scan_token(LBRACKET)) return true; + if (jj_scan_token(RBRACKET)) return true; + return false; + } + + private boolean jj_3_4() { + if (jj_scan_token(LPAREN)) return true; + if (jj_3R_23()) return true; + return false; + } + + private boolean jj_3R_22() { + Token xsp; + xsp = jj_scanpos; + if (jj_3_4()) { + jj_scanpos = xsp; + if (jj_3R_28()) { + jj_scanpos = xsp; + if (jj_3R_29()) return true; + } + } + return false; + } + + private boolean jj_3_3() { + if (jj_3R_22()) return true; + return false; + } + + private boolean jj_3R_99() { + if (jj_3R_101()) return true; + return false; + } + + private boolean jj_3R_87() { + if (jj_scan_token(LBRACKET)) return true; + if (jj_scan_token(RBRACKET)) return true; + return false; + } + + private boolean jj_3R_98() { + if (jj_3R_100()) return true; + return false; + } + + private boolean jj_3_1() { + if (jj_scan_token(DOT)) return true; + if (jj_scan_token(IDENTIFIER)) return true; + return false; + } + + private boolean jj_3_9() { + if (jj_scan_token(LBRACKET)) return true; + if (jj_scan_token(RBRACKET)) return true; + return false; + } + + private boolean jj_3R_97() { + Token xsp; + xsp = jj_scanpos; + if (jj_scan_token(83)) { + jj_scanpos = xsp; + if (jj_scan_token(82)) return true; + } + if (jj_3R_83()) return true; + return false; + } + + private boolean jj_3R_95() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_97()) { + jj_scanpos = xsp; + if (jj_3R_98()) { + jj_scanpos = xsp; + if (jj_3R_99()) return true; + } + } + return false; + } + + private boolean jj_3R_24() { + if (jj_scan_token(IDENTIFIER)) return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3_1()) { jj_scanpos = xsp; break; } + } + return false; + } + + /** Generated Token Manager. */ public ExpressionParserTokenManager token_source; - ASCII_UCodeESC_CharStream jj_input_stream; - public Token token, jj_nt; + JavaCharStream jj_input_stream; + /** Current token. */ + public Token token; + /** Next token. */ + public Token jj_nt; private int jj_ntk; private Token jj_scanpos, jj_lastpos; private int jj_la; - public boolean lookingAhead = false; private int jj_gen; final private int[] jj_la1 = new int[44]; - final private int[] jj_la1_0 = { 0x8209400, 0x0, 0x8209400, 0x0, 0x1000000, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x1000000, 0x0, 0x0, 0x1000000, 0x1000000, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1000000, 0x0, 0x1000000, - 0x1000000, 0x1000000, 0x0, 0x0, 0x0, }; - final private int[] jj_la1_1 = { 0x2014, 0x0, 0x2014, 0x0, 0x884480c0, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x884480c0, 0x0, 0x0, 0x884480c0, 0x884480c0, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x884480c0, 0x0, 0x88400080, 0x400000, - 0x884480c0, 0x0, 0x0, 0x40, }; - final private int[] jj_la1_2 = { 0x8, 0x400, 0x0, 0x2000, 0xf00c004e, - 0x8000, 0x100000, 0x4000000, 0x8000000, 0x0, 0x0, 0x0, 0x2400000, - 0x2400000, 0x0, 0x1830000, 0x1830000, 0x0, 0x0, 0xc0000000, - 0xc0000000, 0x0, 0x0, 0xc0000000, 0xf00c004e, 0xc0000, 0xc0000, 0x4e, - 0xc004e, 0x40, 0x30000000, 0x30000000, 0x400, 0x400, 0x40, 0x4440, - 0x4e, 0x4440, 0x6, 0x0, 0xf00c004e, 0x2000, 0x440, 0x0, }; - final private int[] jj_la1_3 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0xffe00, 0x0, 0x0, - 0x0, 0x8, 0x10, 0x4, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1c0, 0x1c0, 0x0, 0x0, - 0x23, 0x23, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, }; - final private JJExpressionParserCalls[] jj_2_rtns = new JJExpressionParserCalls[9]; + static private int[] jj_la1_0; + static private int[] jj_la1_1; + static private int[] jj_la1_2; + static private int[] jj_la1_3; + static { + jj_la1_init_0(); + jj_la1_init_1(); + jj_la1_init_2(); + jj_la1_init_3(); + } + private static void jj_la1_init_0() { + jj_la1_0 = new int[] {0x8209400,0x0,0x8209400,0x0,0x1000000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x1000000,0x0,0x0,0x1000000,0x1000000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x1000000,0x0,0x1000000,0x1000000,0x1000000,0x0,0x0,0x0,}; + } + private static void jj_la1_init_1() { + jj_la1_1 = new int[] {0x2014,0x0,0x2014,0x0,0x884480c0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x2,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x884480c0,0x0,0x0,0x884480c0,0x884480c0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x884480c0,0x0,0x88400080,0x400000,0x884480c0,0x0,0x0,0x40,}; + } + private static void jj_la1_init_2() { + jj_la1_2 = new int[] {0x8,0x400,0x0,0x2000,0xf00c004e,0x8000,0x100000,0x4000000,0x8000000,0x0,0x0,0x0,0x2400000,0x2400000,0x0,0x1830000,0x1830000,0x0,0x0,0xc0000000,0xc0000000,0x0,0x0,0xc0000000,0xf00c004e,0xc0000,0xc0000,0x4e,0xc004e,0x40,0x30000000,0x30000000,0x400,0x400,0x40,0x4440,0x4e,0x4440,0x6,0x0,0xf00c004e,0x2000,0x440,0x0,}; + } + private static void jj_la1_init_3() { + jj_la1_3 = new int[] {0x0,0x0,0x0,0x0,0x0,0xffe00,0x0,0x0,0x0,0x8,0x10,0x4,0x0,0x0,0x0,0x0,0x0,0x1c0,0x1c0,0x0,0x0,0x23,0x23,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,}; + } + final private JJCalls[] jj_2_rtns = new JJCalls[9]; private boolean jj_rescan = false; private int jj_gc = 0; + /** Constructor with InputStream. */ public ExpressionParser(java.io.InputStream stream) { - jj_input_stream = new ASCII_UCodeESC_CharStream(stream, 1, 1); + this(stream, null); + } + /** Constructor with InputStream and supplied encoding */ + public ExpressionParser(java.io.InputStream stream, String encoding) { + try { jj_input_stream = new JavaCharStream(stream, encoding, 1, 1); } catch(java.io.UnsupportedEncodingException e) { throw new RuntimeException(e); } token_source = new ExpressionParserTokenManager(jj_input_stream); token = new Token(); jj_ntk = -1; jj_gen = 0; - for (int i = 0; i < 44; i++) { - jj_la1[i] = -1; - } - for (int i = 0; i < jj_2_rtns.length; i++) { - jj_2_rtns[i] = new JJExpressionParserCalls(); - } + for (int i = 0; i < 44; i++) jj_la1[i] = -1; + for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); } + /** Reinitialise. */ public void ReInit(java.io.InputStream stream) { + ReInit(stream, null); + } + /** Reinitialise. */ + public void ReInit(java.io.InputStream stream, String encoding) { + try { jj_input_stream.ReInit(stream, encoding, 1, 1); } catch(java.io.UnsupportedEncodingException e) { throw new RuntimeException(e); } + token_source.ReInit(jj_input_stream); + token = new Token(); + jj_ntk = -1; + jj_gen = 0; + for (int i = 0; i < 44; i++) jj_la1[i] = -1; + for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); + } + + /** Constructor. */ + public ExpressionParser(java.io.Reader stream) { + jj_input_stream = new JavaCharStream(stream, 1, 1); + token_source = new ExpressionParserTokenManager(jj_input_stream); + token = new Token(); + jj_ntk = -1; + jj_gen = 0; + for (int i = 0; i < 44; i++) jj_la1[i] = -1; + for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); + } + + /** Reinitialise. */ + public void ReInit(java.io.Reader stream) { jj_input_stream.ReInit(stream, 1, 1); token_source.ReInit(jj_input_stream); token = new Token(); jj_ntk = -1; jj_gen = 0; - for (int i = 0; i < 44; i++) { - jj_la1[i] = -1; - } - for (int i = 0; i < jj_2_rtns.length; i++) { - jj_2_rtns[i] = new JJExpressionParserCalls(); - } + for (int i = 0; i < 44; i++) jj_la1[i] = -1; + for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); } + /** Constructor with generated Token Manager. */ public ExpressionParser(ExpressionParserTokenManager tm) { token_source = tm; token = new Token(); jj_ntk = -1; jj_gen = 0; - for (int i = 0; i < 44; i++) { - jj_la1[i] = -1; - } - for (int i = 0; i < jj_2_rtns.length; i++) { - jj_2_rtns[i] = new JJExpressionParserCalls(); - } + for (int i = 0; i < 44; i++) jj_la1[i] = -1; + for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); } + /** Reinitialise. */ public void ReInit(ExpressionParserTokenManager tm) { token_source = tm; token = new Token(); jj_ntk = -1; jj_gen = 0; - for (int i = 0; i < 44; i++) { - jj_la1[i] = -1; - } - for (int i = 0; i < jj_2_rtns.length; i++) { - jj_2_rtns[i] = new JJExpressionParserCalls(); - } + for (int i = 0; i < 44; i++) jj_la1[i] = -1; + for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); } - final private Token jj_consume_token(int kind) throws ParseException { + private Token jj_consume_token(int kind) throws ParseException { Token oldToken; - if ((oldToken = token).next != null) { - token = token.next; - } else { - token = token.next = token_source.getNextToken(); - } + if ((oldToken = token).next != null) token = token.next; + else token = token.next = token_source.getNextToken(); jj_ntk = -1; if (token.kind == kind) { jj_gen++; if (++jj_gc > 100) { jj_gc = 0; - for (JJExpressionParserCalls jj_2_rtn : jj_2_rtns) { - JJExpressionParserCalls c = jj_2_rtn; + for (int i = 0; i < jj_2_rtns.length; i++) { + JJCalls c = jj_2_rtns[i]; while (c != null) { - if (c.gen < jj_gen) { - c.first = null; - } + if (c.gen < jj_gen) c.first = null; c = c.next; } } @@ -3723,12 +2172,13 @@ public class ExpressionParser implements ExpressionParserConstants { throw generateParseException(); } - final private boolean jj_scan_token(int kind) { + static private final class LookaheadSuccess extends java.lang.Error { } + final private LookaheadSuccess jj_ls = new LookaheadSuccess(); + private boolean jj_scan_token(int kind) { if (jj_scanpos == jj_lastpos) { jj_la--; if (jj_scanpos.next == null) { - jj_lastpos = jj_scanpos = jj_scanpos.next = token_source - .getNextToken(); + jj_lastpos = jj_scanpos = jj_scanpos.next = token_source.getNextToken(); } else { jj_lastpos = jj_scanpos = jj_scanpos.next; } @@ -3736,60 +2186,50 @@ public class ExpressionParser implements ExpressionParserConstants { jj_scanpos = jj_scanpos.next; } if (jj_rescan) { - int i = 0; - Token tok = token; - while (tok != null && tok != jj_scanpos) { - i++; - tok = tok.next; - } - if (tok != null) { - jj_add_error_token(kind, i); - } + int i = 0; Token tok = token; + while (tok != null && tok != jj_scanpos) { i++; tok = tok.next; } + if (tok != null) jj_add_error_token(kind, i); } - return (jj_scanpos.kind != kind); + if (jj_scanpos.kind != kind) return true; + if (jj_la == 0 && jj_scanpos == jj_lastpos) throw jj_ls; + return false; } + +/** Get the next Token. */ final public Token getNextToken() { - if (token.next != null) { - token = token.next; - } else { - token = token.next = token_source.getNextToken(); - } + if (token.next != null) token = token.next; + else token = token.next = token_source.getNextToken(); jj_ntk = -1; jj_gen++; return token; } +/** Get the specific Token. */ final public Token getToken(int index) { - Token t = lookingAhead ? jj_scanpos : token; + Token t = token; for (int i = 0; i < index; i++) { - if (t.next != null) { - t = t.next; - } else { - t = t.next = token_source.getNextToken(); - } + if (t.next != null) t = t.next; + else t = t.next = token_source.getNextToken(); } return t; } - final private int jj_ntk() { - if ((jj_nt = token.next) == null) { + private int jj_ntk() { + if ((jj_nt=token.next) == null) return (jj_ntk = (token.next=token_source.getNextToken()).kind); - } else { + else return (jj_ntk = jj_nt.kind); } - } - private java.util.Vector jj_expentries = new java.util.Vector(); + private java.util.List jj_expentries = new java.util.ArrayList(); private int[] jj_expentry; private int jj_kind = -1; private int[] jj_lasttokens = new int[100]; private int jj_endpos; private void jj_add_error_token(int kind, int pos) { - if (pos >= 100) { - return; - } + if (pos >= 100) return; if (pos == jj_endpos + 1) { jj_lasttokens[jj_endpos++] = kind; } else if (jj_endpos != 0) { @@ -3797,38 +2237,26 @@ public class ExpressionParser implements ExpressionParserConstants { for (int i = 0; i < jj_endpos; i++) { jj_expentry[i] = jj_lasttokens[i]; } - boolean exists = false; - for (java.util.Enumeration enum_ = jj_expentries.elements(); enum_ - .hasMoreElements();) { - int[] oldentry = (enum_.nextElement()); + jj_entries_loop: for (java.util.Iterator it = jj_expentries.iterator(); it.hasNext();) { + int[] oldentry = (int[])(it.next()); if (oldentry.length == jj_expentry.length) { - exists = true; for (int i = 0; i < jj_expentry.length; i++) { if (oldentry[i] != jj_expentry[i]) { - exists = false; - break; + continue jj_entries_loop; } } - if (exists) { - break; - } - } - } - if (!exists) { - jj_expentries.addElement(jj_expentry); - } - if (pos != 0) { - jj_lasttokens[(jj_endpos = pos) - 1] = kind; - } + jj_expentries.add(jj_expentry); + break jj_entries_loop; + } + } + if (pos != 0) jj_lasttokens[(jj_endpos = pos) - 1] = kind; } } - final public ParseException generateParseException() { - jj_expentries.removeAllElements(); + /** Generate ParseException. */ + public ParseException generateParseException() { + jj_expentries.clear(); boolean[] la1tokens = new boolean[116]; - for (int i = 0; i < 116; i++) { - la1tokens[i] = false; - } if (jj_kind >= 0) { la1tokens[jj_kind] = true; jj_kind = -1; @@ -3855,7 +2283,7 @@ public class ExpressionParser implements ExpressionParserConstants { if (la1tokens[i]) { jj_expentry = new int[1]; jj_expentry[0] = i; - jj_expentries.addElement(jj_expentry); + jj_expentries.add(jj_expentry); } } jj_endpos = 0; @@ -3863,80 +2291,60 @@ public class ExpressionParser implements ExpressionParserConstants { jj_add_error_token(0, 0); int[][] exptokseq = new int[jj_expentries.size()][]; for (int i = 0; i < jj_expentries.size(); i++) { - exptokseq[i] = jj_expentries.elementAt(i); + exptokseq[i] = jj_expentries.get(i); } return new ParseException(token, exptokseq, tokenImage); } + /** Enable tracing. */ final public void enable_tracing() { } + /** Disable tracing. */ final public void disable_tracing() { } - final private void jj_rescan_token() { + private void jj_rescan_token() { jj_rescan = true; for (int i = 0; i < 9; i++) { - JJExpressionParserCalls p = jj_2_rtns[i]; + try { + JJCalls p = jj_2_rtns[i]; do { if (p.gen > jj_gen) { - jj_la = p.arg; - jj_lastpos = jj_scanpos = p.first; + jj_la = p.arg; jj_lastpos = jj_scanpos = p.first; switch (i) { - case 0: - jj_3_1(); - break; - case 1: - jj_3_2(); - break; - case 2: - jj_3_3(); - break; - case 3: - jj_3_4(); - break; - case 4: - jj_3_5(); - break; - case 5: - jj_3_6(); - break; - case 6: - jj_3_7(); - break; - case 7: - jj_3_8(); - break; - case 8: - jj_3_9(); - break; + case 0: jj_3_1(); break; + case 1: jj_3_2(); break; + case 2: jj_3_3(); break; + case 3: jj_3_4(); break; + case 4: jj_3_5(); break; + case 5: jj_3_6(); break; + case 6: jj_3_7(); break; + case 7: jj_3_8(); break; + case 8: jj_3_9(); break; } } p = p.next; } while (p != null); + } catch(LookaheadSuccess ls) { } } jj_rescan = false; } - final private void jj_save(int index, int xla) { - JJExpressionParserCalls p = jj_2_rtns[index]; + private void jj_save(int index, int xla) { + JJCalls p = jj_2_rtns[index]; while (p.gen > jj_gen) { - if (p.next == null) { - p = p.next = new JJExpressionParserCalls(); - break; - } + if (p.next == null) { p = p.next = new JJCalls(); break; } p = p.next; } - p.gen = jj_gen + xla - jj_la; - p.first = token; - p.arg = xla; + p.gen = jj_gen + xla - jj_la; p.first = token; p.arg = xla; + } + + static final class JJCalls { + int gen; + Token first; + int arg; + JJCalls next; } } - -final class JJExpressionParserCalls { - int gen; - Token first; - int arg; - JJExpressionParserCalls next; -} diff --git a/jdk/src/share/classes/com/sun/tools/example/debug/expr/ExpressionParserConstants.java b/jdk/src/share/classes/com/sun/tools/example/debug/expr/ExpressionParserConstants.java index fd46b36d8fb..c74d21fa75e 100644 --- a/jdk/src/share/classes/com/sun/tools/example/debug/expr/ExpressionParserConstants.java +++ b/jdk/src/share/classes/com/sun/tools/example/debug/expr/ExpressionParserConstants.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,134 +23,243 @@ * questions. */ -/* - * This source code is provided to illustrate the usage of a given feature - * or technique and has been deliberately simplified. Additional steps - * required for a production-quality application, such as security checks, - * input validation and proper error handling, might not be present in - * this sample code. - */ - - /* Generated By:JavaCC: Do not edit this line. ExpressionParserConstants.java */ package com.sun.tools.example.debug.expr; + +/** + * Token literal values and constants. + * Generated by org.javacc.parser.OtherFilesGen#start() + */ public interface ExpressionParserConstants { + /** End of File. */ int EOF = 0; + /** RegularExpression Id. */ int SINGLE_LINE_COMMENT = 6; + /** RegularExpression Id. */ int FORMAL_COMMENT = 7; + /** RegularExpression Id. */ int MULTI_LINE_COMMENT = 8; + /** RegularExpression Id. */ int ABSTRACT = 9; + /** RegularExpression Id. */ int BOOLEAN = 10; + /** RegularExpression Id. */ int BREAK = 11; + /** RegularExpression Id. */ int BYTE = 12; + /** RegularExpression Id. */ int CASE = 13; + /** RegularExpression Id. */ int CATCH = 14; + /** RegularExpression Id. */ int CHAR = 15; + /** RegularExpression Id. */ int CLASS = 16; + /** RegularExpression Id. */ int CONST = 17; + /** RegularExpression Id. */ int CONTINUE = 18; + /** RegularExpression Id. */ int _DEFAULT = 19; + /** RegularExpression Id. */ int DO = 20; + /** RegularExpression Id. */ int DOUBLE = 21; + /** RegularExpression Id. */ int ELSE = 22; + /** RegularExpression Id. */ int EXTENDS = 23; + /** RegularExpression Id. */ int FALSE = 24; + /** RegularExpression Id. */ int FINAL = 25; + /** RegularExpression Id. */ int FINALLY = 26; + /** RegularExpression Id. */ int FLOAT = 27; + /** RegularExpression Id. */ int FOR = 28; + /** RegularExpression Id. */ int GOTO = 29; + /** RegularExpression Id. */ int IF = 30; + /** RegularExpression Id. */ int IMPLEMENTS = 31; + /** RegularExpression Id. */ int IMPORT = 32; + /** RegularExpression Id. */ int INSTANCEOF = 33; + /** RegularExpression Id. */ int INT = 34; + /** RegularExpression Id. */ int INTERFACE = 35; + /** RegularExpression Id. */ int LONG = 36; + /** RegularExpression Id. */ int NATIVE = 37; + /** RegularExpression Id. */ int NEW = 38; + /** RegularExpression Id. */ int NULL = 39; + /** RegularExpression Id. */ int PACKAGE = 40; + /** RegularExpression Id. */ int PRIVATE = 41; + /** RegularExpression Id. */ int PROTECTED = 42; + /** RegularExpression Id. */ int PUBLIC = 43; + /** RegularExpression Id. */ int RETURN = 44; + /** RegularExpression Id. */ int SHORT = 45; + /** RegularExpression Id. */ int STATIC = 46; + /** RegularExpression Id. */ int SUPER = 47; + /** RegularExpression Id. */ int SWITCH = 48; + /** RegularExpression Id. */ int SYNCHRONIZED = 49; + /** RegularExpression Id. */ int THIS = 50; + /** RegularExpression Id. */ int THROW = 51; + /** RegularExpression Id. */ int THROWS = 52; + /** RegularExpression Id. */ int TRANSIENT = 53; + /** RegularExpression Id. */ int TRUE = 54; + /** RegularExpression Id. */ int TRY = 55; + /** RegularExpression Id. */ int VOID = 56; + /** RegularExpression Id. */ int VOLATILE = 57; + /** RegularExpression Id. */ int WHILE = 58; + /** RegularExpression Id. */ int INTEGER_LITERAL = 59; + /** RegularExpression Id. */ int DECIMAL_LITERAL = 60; + /** RegularExpression Id. */ int HEX_LITERAL = 61; + /** RegularExpression Id. */ int OCTAL_LITERAL = 62; + /** RegularExpression Id. */ int FLOATING_POINT_LITERAL = 63; + /** RegularExpression Id. */ int EXPONENT = 64; + /** RegularExpression Id. */ int CHARACTER_LITERAL = 65; + /** RegularExpression Id. */ int STRING_LITERAL = 66; + /** RegularExpression Id. */ int IDENTIFIER = 67; + /** RegularExpression Id. */ int LETTER = 68; + /** RegularExpression Id. */ int DIGIT = 69; + /** RegularExpression Id. */ int LPAREN = 70; + /** RegularExpression Id. */ int RPAREN = 71; + /** RegularExpression Id. */ int LBRACE = 72; + /** RegularExpression Id. */ int RBRACE = 73; + /** RegularExpression Id. */ int LBRACKET = 74; + /** RegularExpression Id. */ int RBRACKET = 75; + /** RegularExpression Id. */ int SEMICOLON = 76; + /** RegularExpression Id. */ int COMMA = 77; + /** RegularExpression Id. */ int DOT = 78; + /** RegularExpression Id. */ int ASSIGN = 79; + /** RegularExpression Id. */ int GT = 80; + /** RegularExpression Id. */ int LT = 81; + /** RegularExpression Id. */ int BANG = 82; + /** RegularExpression Id. */ int TILDE = 83; + /** RegularExpression Id. */ int HOOK = 84; + /** RegularExpression Id. */ int COLON = 85; + /** RegularExpression Id. */ int EQ = 86; + /** RegularExpression Id. */ int LE = 87; + /** RegularExpression Id. */ int GE = 88; + /** RegularExpression Id. */ int NE = 89; + /** RegularExpression Id. */ int SC_OR = 90; + /** RegularExpression Id. */ int SC_AND = 91; + /** RegularExpression Id. */ int INCR = 92; + /** RegularExpression Id. */ int DECR = 93; + /** RegularExpression Id. */ int PLUS = 94; + /** RegularExpression Id. */ int MINUS = 95; + /** RegularExpression Id. */ int STAR = 96; + /** RegularExpression Id. */ int SLASH = 97; + /** RegularExpression Id. */ int BIT_AND = 98; + /** RegularExpression Id. */ int BIT_OR = 99; + /** RegularExpression Id. */ int XOR = 100; + /** RegularExpression Id. */ int REM = 101; + /** RegularExpression Id. */ int LSHIFT = 102; + /** RegularExpression Id. */ int RSIGNEDSHIFT = 103; + /** RegularExpression Id. */ int RUNSIGNEDSHIFT = 104; + /** RegularExpression Id. */ int PLUSASSIGN = 105; + /** RegularExpression Id. */ int MINUSASSIGN = 106; + /** RegularExpression Id. */ int STARASSIGN = 107; + /** RegularExpression Id. */ int SLASHASSIGN = 108; + /** RegularExpression Id. */ int ANDASSIGN = 109; + /** RegularExpression Id. */ int ORASSIGN = 110; + /** RegularExpression Id. */ int XORASSIGN = 111; + /** RegularExpression Id. */ int REMASSIGN = 112; + /** RegularExpression Id. */ int LSHIFTASSIGN = 113; + /** RegularExpression Id. */ int RSIGNEDSHIFTASSIGN = 114; + /** RegularExpression Id. */ int RUNSIGNEDSHIFTASSIGN = 115; + /** Lexical state. */ int DEFAULT = 0; + /** Literal token values. */ String[] tokenImage = { "", "\" \"", diff --git a/jdk/src/share/classes/com/sun/tools/example/debug/expr/ExpressionParserTokenManager.java b/jdk/src/share/classes/com/sun/tools/example/debug/expr/ExpressionParserTokenManager.java index 7e1f57090df..b2f16f03e57 100644 --- a/jdk/src/share/classes/com/sun/tools/example/debug/expr/ExpressionParserTokenManager.java +++ b/jdk/src/share/classes/com/sun/tools/example/debug/expr/ExpressionParserTokenManager.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,38 +23,39 @@ * questions. */ -/* - * This source code is provided to illustrate the usage of a given feature - * or technique and has been deliberately simplified. Additional steps - * required for a production-quality application, such as security checks, - * input validation and proper error handling, might not be present in - * this sample code. - */ - - /* Generated By:JavaCC: Do not edit this line. ExpressionParserTokenManager.java */ package com.sun.tools.example.debug.expr; +import com.sun.jdi.*; +import java.util.Stack; +import java.util.List; +import java.util.ArrayList; +/** Token Manager. */ public class ExpressionParserTokenManager implements ExpressionParserConstants { + + /** Debug output. */ + public java.io.PrintStream debugStream = System.out; + /** Set debug output. */ + public void setDebugStream(java.io.PrintStream ds) { debugStream = ds; } private final int jjStopStringLiteralDfa_0(int pos, long active0, long active1) { switch (pos) { case 0: - if ((active1 & 0x4000L) != 0L) { + if ((active1 & 0x100200000000L) != 0L) + return 49; + if ((active1 & 0x4000L) != 0L) return 4; - } if ((active0 & 0x7fffffffffffe00L) != 0L) { jjmatchedKind = 67; return 28; } - if ((active1 & 0x100200000000L) != 0L) { - return 49; - } return -1; case 1: + if ((active0 & 0x40300000L) != 0L) + return 28; if ((active0 & 0x7ffffffbfcffe00L) != 0L) { if (jjmatchedPos != 1) @@ -64,11 +65,10 @@ private final int jjStopStringLiteralDfa_0(int pos, long active0, long active1) } return 28; } - if ((active0 & 0x40300000L) != 0L) { - return 28; - } return -1; case 2: + if ((active0 & 0x80004c10000000L) != 0L) + return 28; if ((active0 & 0x77fffb3afeffe00L) != 0L) { if (jjmatchedPos != 2) @@ -78,9 +78,6 @@ private final int jjStopStringLiteralDfa_0(int pos, long active0, long active1) } return 28; } - if ((active0 & 0x80004c10000000L) != 0L) { - return 28; - } return -1; case 3: if ((active0 & 0x63bff2b8faf4e00L) != 0L) @@ -89,11 +86,12 @@ private final int jjStopStringLiteralDfa_0(int pos, long active0, long active1) jjmatchedPos = 3; return 28; } - if ((active0 & 0x14400902040b000L) != 0L) { + if ((active0 & 0x14400902040b000L) != 0L) return 28; - } return -1; case 4: + if ((active0 & 0x418a0000f034800L) != 0L) + return 28; if ((active0 & 0x2235f2b80ac0600L) != 0L) { if (jjmatchedPos != 4) @@ -103,20 +101,16 @@ private final int jjStopStringLiteralDfa_0(int pos, long active0, long active1) } return 28; } - if ((active0 & 0x418a0000f034800L) != 0L) { - return 28; - } return -1; case 5: + if ((active0 & 0x11582100200000L) != 0L) + return 28; if ((active0 & 0x222070a848c0600L) != 0L) { jjmatchedKind = 67; jjmatchedPos = 5; return 28; } - if ((active0 & 0x11582100200000L) != 0L) { - return 28; - } return -1; case 6: if ((active0 & 0x222040a80040200L) != 0L) @@ -125,31 +119,28 @@ private final int jjStopStringLiteralDfa_0(int pos, long active0, long active1) jjmatchedPos = 6; return 28; } - if ((active0 & 0x30004880400L) != 0L) { + if ((active0 & 0x30004880400L) != 0L) return 28; - } return -1; case 7: + if ((active0 & 0x200000000040200L) != 0L) + return 28; if ((active0 & 0x22040a80000000L) != 0L) { jjmatchedKind = 67; jjmatchedPos = 7; return 28; } - if ((active0 & 0x200000000040200L) != 0L) { - return 28; - } return -1; case 8: + if ((active0 & 0x20040800000000L) != 0L) + return 28; if ((active0 & 0x2000280000000L) != 0L) { jjmatchedKind = 67; jjmatchedPos = 8; return 28; } - if ((active0 & 0x20040800000000L) != 0L) { - return 28; - } return -1; case 9: if ((active0 & 0x2000000000000L) != 0L) @@ -158,9 +149,8 @@ private final int jjStopStringLiteralDfa_0(int pos, long active0, long active1) jjmatchedPos = 9; return 28; } - if ((active0 & 0x280000000L) != 0L) { + if ((active0 & 0x280000000L) != 0L) return 28; - } return -1; case 10: if ((active0 & 0x2000000000000L) != 0L) @@ -178,21 +168,13 @@ private final int jjStartNfa_0(int pos, long active0, long active1) { return jjMoveNfa_0(jjStopStringLiteralDfa_0(pos, active0, active1), pos + 1); } -private final int jjStopAtPos(int pos, int kind) +private int jjStopAtPos(int pos, int kind) { jjmatchedKind = kind; jjmatchedPos = pos; return pos + 1; } -private final int jjStartNfaWithStates_0(int pos, int kind, int state) -{ - jjmatchedKind = kind; - jjmatchedPos = pos; - try { curChar = input_stream.readChar(); } - catch(java.io.IOException e) { return pos + 1; } - return jjMoveNfa_0(state, pos + 1); -} -private final int jjMoveStringLiteralDfa0_0() +private int jjMoveStringLiteralDfa0_0() { switch(curChar) { @@ -292,7 +274,7 @@ private final int jjMoveStringLiteralDfa0_0() return jjMoveNfa_0(0, 0); } } -private final int jjMoveStringLiteralDfa1_0(long active0, long active1) +private int jjMoveStringLiteralDfa1_0(long active0, long active1) { try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { @@ -302,19 +284,16 @@ private final int jjMoveStringLiteralDfa1_0(long active0, long active1) switch(curChar) { case 38: - if ((active1 & 0x8000000L) != 0L) { + if ((active1 & 0x8000000L) != 0L) return jjStopAtPos(1, 91); - } break; case 43: - if ((active1 & 0x10000000L) != 0L) { + if ((active1 & 0x10000000L) != 0L) return jjStopAtPos(1, 92); - } break; case 45: - if ((active1 & 0x20000000L) != 0L) { + if ((active1 & 0x20000000L) != 0L) return jjStopAtPos(1, 93); - } break; case 60: if ((active1 & 0x4000000000L) != 0L) @@ -324,31 +303,30 @@ private final int jjMoveStringLiteralDfa1_0(long active0, long active1) } return jjMoveStringLiteralDfa2_0(active0, 0L, active1, 0x2000000000000L); case 61: - if ((active1 & 0x400000L) != 0L) { + if ((active1 & 0x400000L) != 0L) return jjStopAtPos(1, 86); - } else if ((active1 & 0x800000L) != 0L) { + else if ((active1 & 0x800000L) != 0L) return jjStopAtPos(1, 87); - } else if ((active1 & 0x1000000L) != 0L) { + else if ((active1 & 0x1000000L) != 0L) return jjStopAtPos(1, 88); - } else if ((active1 & 0x2000000L) != 0L) { + else if ((active1 & 0x2000000L) != 0L) return jjStopAtPos(1, 89); - } else if ((active1 & 0x20000000000L) != 0L) { + else if ((active1 & 0x20000000000L) != 0L) return jjStopAtPos(1, 105); - } else if ((active1 & 0x40000000000L) != 0L) { + else if ((active1 & 0x40000000000L) != 0L) return jjStopAtPos(1, 106); - } else if ((active1 & 0x80000000000L) != 0L) { + else if ((active1 & 0x80000000000L) != 0L) return jjStopAtPos(1, 107); - } else if ((active1 & 0x100000000000L) != 0L) { + else if ((active1 & 0x100000000000L) != 0L) return jjStopAtPos(1, 108); - } else if ((active1 & 0x200000000000L) != 0L) { + else if ((active1 & 0x200000000000L) != 0L) return jjStopAtPos(1, 109); - } else if ((active1 & 0x400000000000L) != 0L) { + else if ((active1 & 0x400000000000L) != 0L) return jjStopAtPos(1, 110); - } else if ((active1 & 0x800000000000L) != 0L) { + else if ((active1 & 0x800000000000L) != 0L) return jjStopAtPos(1, 111); - } else if ((active1 & 0x1000000000000L) != 0L) { + else if ((active1 & 0x1000000000000L) != 0L) return jjStopAtPos(1, 112); - } break; case 62: if ((active1 & 0x8000000000L) != 0L) @@ -364,9 +342,8 @@ private final int jjMoveStringLiteralDfa1_0(long active0, long active1) case 101: return jjMoveStringLiteralDfa2_0(active0, 0x104000080000L, active1, 0L); case 102: - if ((active0 & 0x40000000L) != 0L) { + if ((active0 & 0x40000000L) != 0L) return jjStartNfaWithStates_0(1, 30, 28); - } break; case 104: return jjMoveStringLiteralDfa2_0(active0, 0x41c200000008000L, active1, 0L); @@ -398,20 +375,18 @@ private final int jjMoveStringLiteralDfa1_0(long active0, long active1) case 121: return jjMoveStringLiteralDfa2_0(active0, 0x2000000001000L, active1, 0L); case 124: - if ((active1 & 0x4000000L) != 0L) { + if ((active1 & 0x4000000L) != 0L) return jjStopAtPos(1, 90); - } break; default : break; } return jjStartNfa_0(0, active0, active1); } -private final int jjMoveStringLiteralDfa2_0(long old0, long active0, long old1, long active1) +private int jjMoveStringLiteralDfa2_0(long old0, long active0, long old1, long active1) { - if (((active0 &= old0) | (active1 &= old1)) == 0L) { + if (((active0 &= old0) | (active1 &= old1)) == 0L) return jjStartNfa_0(0, old0, old1); - } try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { jjStopStringLiteralDfa_0(1, active0, active1); @@ -420,11 +395,10 @@ private final int jjMoveStringLiteralDfa2_0(long old0, long active0, long old1, switch(curChar) { case 61: - if ((active1 & 0x2000000000000L) != 0L) { + if ((active1 & 0x2000000000000L) != 0L) return jjStopAtPos(2, 113); - } else if ((active1 & 0x4000000000000L) != 0L) { + else if ((active1 & 0x4000000000000L) != 0L) return jjStopAtPos(2, 114); - } break; case 62: if ((active1 & 0x10000000000L) != 0L) @@ -454,9 +428,8 @@ private final int jjMoveStringLiteralDfa2_0(long old0, long active0, long old1, case 112: return jjMoveStringLiteralDfa3_0(active0, 0x800180000000L, active1, 0L); case 114: - if ((active0 & 0x10000000L) != 0L) { + if ((active0 & 0x10000000L) != 0L) return jjStartNfaWithStates_0(2, 28, 28); - } return jjMoveStringLiteralDfa3_0(active0, 0x18000000000000L, active1, 0L); case 115: return jjMoveStringLiteralDfa3_0(active0, 0x200402200L, active1, 0L); @@ -470,25 +443,22 @@ private final int jjMoveStringLiteralDfa2_0(long old0, long active0, long old1, case 117: return jjMoveStringLiteralDfa3_0(active0, 0x40000000200000L, active1, 0L); case 119: - if ((active0 & 0x4000000000L) != 0L) { + if ((active0 & 0x4000000000L) != 0L) return jjStartNfaWithStates_0(2, 38, 28); - } break; case 121: - if ((active0 & 0x80000000000000L) != 0L) { + if ((active0 & 0x80000000000000L) != 0L) return jjStartNfaWithStates_0(2, 55, 28); - } break; default : break; } return jjStartNfa_0(1, active0, active1); } -private final int jjMoveStringLiteralDfa3_0(long old0, long active0, long old1, long active1) +private int jjMoveStringLiteralDfa3_0(long old0, long active0, long old1, long active1) { - if (((active0 &= old0) | (active1 &= old1)) == 0L) { + if (((active0 &= old0) | (active1 &= old1)) == 0L) return jjStartNfa_0(1, old0, old1); - } try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { jjStopStringLiteralDfa_0(2, active0, active1); @@ -497,9 +467,8 @@ private final int jjMoveStringLiteralDfa3_0(long old0, long active0, long old1, switch(curChar) { case 61: - if ((active1 & 0x8000000000000L) != 0L) { + if ((active1 & 0x8000000000000L) != 0L) return jjStopAtPos(3, 115); - } break; case 97: return jjMoveStringLiteralDfa4_0(active0, 0x20000000e080800L, active1, 0L); @@ -508,51 +477,44 @@ private final int jjMoveStringLiteralDfa3_0(long old0, long active0, long old1, case 99: return jjMoveStringLiteralDfa4_0(active0, 0x2000000004000L, active1, 0L); case 100: - if ((active0 & 0x100000000000000L) != 0L) { + if ((active0 & 0x100000000000000L) != 0L) return jjStartNfaWithStates_0(3, 56, 28); - } break; case 101: - if ((active0 & 0x1000L) != 0L) { + if ((active0 & 0x1000L) != 0L) return jjStartNfaWithStates_0(3, 12, 28); - } else if ((active0 & 0x2000L) != 0L) { + else if ((active0 & 0x2000L) != 0L) return jjStartNfaWithStates_0(3, 13, 28); - } else if ((active0 & 0x400000L) != 0L) { + else if ((active0 & 0x400000L) != 0L) return jjStartNfaWithStates_0(3, 22, 28); - } else if ((active0 & 0x40000000000000L) != 0L) { + else if ((active0 & 0x40000000000000L) != 0L) return jjStartNfaWithStates_0(3, 54, 28); - } return jjMoveStringLiteralDfa4_0(active0, 0x800800800000L, active1, 0L); case 103: - if ((active0 & 0x1000000000L) != 0L) { + if ((active0 & 0x1000000000L) != 0L) return jjStartNfaWithStates_0(3, 36, 28); - } break; case 105: return jjMoveStringLiteralDfa4_0(active0, 0x2000000000L, active1, 0L); case 107: return jjMoveStringLiteralDfa4_0(active0, 0x10000000000L, active1, 0L); case 108: - if ((active0 & 0x8000000000L) != 0L) { + if ((active0 & 0x8000000000L) != 0L) return jjStartNfaWithStates_0(3, 39, 28); - } return jjMoveStringLiteralDfa4_0(active0, 0x400080080000400L, active1, 0L); case 110: return jjMoveStringLiteralDfa4_0(active0, 0x20000000000000L, active1, 0L); case 111: - if ((active0 & 0x20000000L) != 0L) { + if ((active0 & 0x20000000L) != 0L) return jjStartNfaWithStates_0(3, 29, 28); - } return jjMoveStringLiteralDfa4_0(active0, 0x18000100000000L, active1, 0L); case 114: - if ((active0 & 0x8000L) != 0L) { + if ((active0 & 0x8000L) != 0L) return jjStartNfaWithStates_0(3, 15, 28); - } return jjMoveStringLiteralDfa4_0(active0, 0x200000000000L, active1, 0L); case 115: - if ((active0 & 0x4000000000000L) != 0L) { + if ((active0 & 0x4000000000000L) != 0L) return jjStartNfaWithStates_0(3, 50, 28); - } return jjMoveStringLiteralDfa4_0(active0, 0x1030000L, active1, 0L); case 116: return jjMoveStringLiteralDfa4_0(active0, 0x1440200040200L, active1, 0L); @@ -565,11 +527,10 @@ private final int jjMoveStringLiteralDfa3_0(long old0, long active0, long old1, } return jjStartNfa_0(2, active0, active1); } -private final int jjMoveStringLiteralDfa4_0(long old0, long active0, long old1, long active1) +private int jjMoveStringLiteralDfa4_0(long old0, long active0, long old1, long active1) { - if (((active0 &= old0) | (active1 &= old1)) == 0L) { + if (((active0 &= old0) | (active1 &= old1)) == 0L) return jjStartNfa_0(2, old0, old1); - } try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { jjStopStringLiteralDfa_0(3, active0, 0L); @@ -582,23 +543,20 @@ private final int jjMoveStringLiteralDfa4_0(long old0, long active0, long old1, case 99: return jjMoveStringLiteralDfa5_0(active0, 0x1000000000000L); case 101: - if ((active0 & 0x1000000L) != 0L) { + if ((active0 & 0x1000000L) != 0L) return jjStartNfaWithStates_0(4, 24, 28); - } else if ((active0 & 0x400000000000000L) != 0L) { + else if ((active0 & 0x400000000000000L) != 0L) return jjStartNfaWithStates_0(4, 58, 28); - } return jjMoveStringLiteralDfa5_0(active0, 0x40080000400L); case 104: - if ((active0 & 0x4000L) != 0L) { + if ((active0 & 0x4000L) != 0L) return jjStartNfaWithStates_0(4, 14, 28); - } return jjMoveStringLiteralDfa5_0(active0, 0x2000000000000L); case 105: return jjMoveStringLiteralDfa5_0(active0, 0x480000040000L); case 107: - if ((active0 & 0x800L) != 0L) { + if ((active0 & 0x800L) != 0L) return jjStartNfaWithStates_0(4, 11, 28); - } break; case 108: if ((active0 & 0x2000000L) != 0L) @@ -610,23 +568,20 @@ private final int jjMoveStringLiteralDfa4_0(long old0, long active0, long old1, case 110: return jjMoveStringLiteralDfa5_0(active0, 0x800000L); case 114: - if ((active0 & 0x800000000000L) != 0L) { + if ((active0 & 0x800000000000L) != 0L) return jjStartNfaWithStates_0(4, 47, 28); - } return jjMoveStringLiteralDfa5_0(active0, 0x100900000200L); case 115: - if ((active0 & 0x10000L) != 0L) { + if ((active0 & 0x10000L) != 0L) return jjStartNfaWithStates_0(4, 16, 28); - } return jjMoveStringLiteralDfa5_0(active0, 0x20000000000000L); case 116: - if ((active0 & 0x20000L) != 0L) { + if ((active0 & 0x20000L) != 0L) return jjStartNfaWithStates_0(4, 17, 28); - } else if ((active0 & 0x8000000L) != 0L) { + else if ((active0 & 0x8000000L) != 0L) return jjStartNfaWithStates_0(4, 27, 28); - } else if ((active0 & 0x200000000000L) != 0L) { + else if ((active0 & 0x200000000000L) != 0L) return jjStartNfaWithStates_0(4, 45, 28); - } return jjMoveStringLiteralDfa5_0(active0, 0x200000000000000L); case 117: return jjMoveStringLiteralDfa5_0(active0, 0x80000L); @@ -644,11 +599,10 @@ private final int jjMoveStringLiteralDfa4_0(long old0, long active0, long old1, } return jjStartNfa_0(3, active0, 0L); } -private final int jjMoveStringLiteralDfa5_0(long old0, long active0) +private int jjMoveStringLiteralDfa5_0(long old0, long active0) { - if (((active0 &= old0)) == 0L) { + if (((active0 &= old0)) == 0L) return jjStartNfa_0(3, old0, 0L); - } try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { jjStopStringLiteralDfa_0(4, active0, 0L); @@ -659,29 +613,26 @@ private final int jjMoveStringLiteralDfa5_0(long old0, long active0) case 97: return jjMoveStringLiteralDfa6_0(active0, 0x600L); case 99: - if ((active0 & 0x80000000000L) != 0L) { + if ((active0 & 0x80000000000L) != 0L) return jjStartNfaWithStates_0(5, 43, 28); - } else if ((active0 & 0x400000000000L) != 0L) { + else if ((active0 & 0x400000000000L) != 0L) return jjStartNfaWithStates_0(5, 46, 28); - } return jjMoveStringLiteralDfa6_0(active0, 0x40000000000L); case 100: return jjMoveStringLiteralDfa6_0(active0, 0x800000L); case 101: - if ((active0 & 0x200000L) != 0L) { + if ((active0 & 0x200000L) != 0L) return jjStartNfaWithStates_0(5, 21, 28); - } else if ((active0 & 0x2000000000L) != 0L) { + else if ((active0 & 0x2000000000L) != 0L) return jjStartNfaWithStates_0(5, 37, 28); - } break; case 102: return jjMoveStringLiteralDfa6_0(active0, 0x800000000L); case 103: return jjMoveStringLiteralDfa6_0(active0, 0x10000000000L); case 104: - if ((active0 & 0x1000000000000L) != 0L) { + if ((active0 & 0x1000000000000L) != 0L) return jjStartNfaWithStates_0(5, 48, 28); - } break; case 105: return jjMoveStringLiteralDfa6_0(active0, 0x220000000000000L); @@ -690,32 +641,28 @@ private final int jjMoveStringLiteralDfa5_0(long old0, long active0) case 109: return jjMoveStringLiteralDfa6_0(active0, 0x80000000L); case 110: - if ((active0 & 0x100000000000L) != 0L) { + if ((active0 & 0x100000000000L) != 0L) return jjStartNfaWithStates_0(5, 44, 28); - } return jjMoveStringLiteralDfa6_0(active0, 0x200040000L); case 114: return jjMoveStringLiteralDfa6_0(active0, 0x2000000000000L); case 115: - if ((active0 & 0x10000000000000L) != 0L) { + if ((active0 & 0x10000000000000L) != 0L) return jjStartNfaWithStates_0(5, 52, 28); - } break; case 116: - if ((active0 & 0x100000000L) != 0L) { + if ((active0 & 0x100000000L) != 0L) return jjStartNfaWithStates_0(5, 32, 28); - } return jjMoveStringLiteralDfa6_0(active0, 0x20000000000L); default : break; } return jjStartNfa_0(4, active0, 0L); } -private final int jjMoveStringLiteralDfa6_0(long old0, long active0) +private int jjMoveStringLiteralDfa6_0(long old0, long active0) { - if (((active0 &= old0)) == 0L) { + if (((active0 &= old0)) == 0L) return jjStartNfa_0(4, old0, 0L); - } try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { jjStopStringLiteralDfa_0(5, active0, 0L); @@ -728,48 +675,42 @@ private final int jjMoveStringLiteralDfa6_0(long old0, long active0) case 99: return jjMoveStringLiteralDfa7_0(active0, 0x200000200L); case 101: - if ((active0 & 0x10000000000L) != 0L) { + if ((active0 & 0x10000000000L) != 0L) return jjStartNfaWithStates_0(6, 40, 28); - } else if ((active0 & 0x20000000000L) != 0L) { + else if ((active0 & 0x20000000000L) != 0L) return jjStartNfaWithStates_0(6, 41, 28); - } return jjMoveStringLiteralDfa7_0(active0, 0x20000080000000L); case 108: return jjMoveStringLiteralDfa7_0(active0, 0x200000000000000L); case 110: - if ((active0 & 0x400L) != 0L) { + if ((active0 & 0x400L) != 0L) return jjStartNfaWithStates_0(6, 10, 28); - } break; case 111: return jjMoveStringLiteralDfa7_0(active0, 0x2000000000000L); case 115: - if ((active0 & 0x800000L) != 0L) { + if ((active0 & 0x800000L) != 0L) return jjStartNfaWithStates_0(6, 23, 28); - } break; case 116: - if ((active0 & 0x80000L) != 0L) { + if ((active0 & 0x80000L) != 0L) return jjStartNfaWithStates_0(6, 19, 28); - } return jjMoveStringLiteralDfa7_0(active0, 0x40000000000L); case 117: return jjMoveStringLiteralDfa7_0(active0, 0x40000L); case 121: - if ((active0 & 0x4000000L) != 0L) { + if ((active0 & 0x4000000L) != 0L) return jjStartNfaWithStates_0(6, 26, 28); - } break; default : break; } return jjStartNfa_0(5, active0, 0L); } -private final int jjMoveStringLiteralDfa7_0(long old0, long active0) +private int jjMoveStringLiteralDfa7_0(long old0, long active0) { - if (((active0 &= old0)) == 0L) { + if (((active0 &= old0)) == 0L) return jjStartNfa_0(5, old0, 0L); - } try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { jjStopStringLiteralDfa_0(6, active0, 0L); @@ -780,29 +721,26 @@ private final int jjMoveStringLiteralDfa7_0(long old0, long active0) case 99: return jjMoveStringLiteralDfa8_0(active0, 0x800000000L); case 101: - if ((active0 & 0x40000L) != 0L) { + if ((active0 & 0x40000L) != 0L) return jjStartNfaWithStates_0(7, 18, 28); - } else if ((active0 & 0x200000000000000L) != 0L) { + else if ((active0 & 0x200000000000000L) != 0L) return jjStartNfaWithStates_0(7, 57, 28); - } return jjMoveStringLiteralDfa8_0(active0, 0x40200000000L); case 110: return jjMoveStringLiteralDfa8_0(active0, 0x22000080000000L); case 116: - if ((active0 & 0x200L) != 0L) { + if ((active0 & 0x200L) != 0L) return jjStartNfaWithStates_0(7, 9, 28); - } break; default : break; } return jjStartNfa_0(6, active0, 0L); } -private final int jjMoveStringLiteralDfa8_0(long old0, long active0) +private int jjMoveStringLiteralDfa8_0(long old0, long active0) { - if (((active0 &= old0)) == 0L) { + if (((active0 &= old0)) == 0L) return jjStartNfa_0(6, old0, 0L); - } try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { jjStopStringLiteralDfa_0(7, active0, 0L); @@ -811,34 +749,30 @@ private final int jjMoveStringLiteralDfa8_0(long old0, long active0) switch(curChar) { case 100: - if ((active0 & 0x40000000000L) != 0L) { + if ((active0 & 0x40000000000L) != 0L) return jjStartNfaWithStates_0(8, 42, 28); - } break; case 101: - if ((active0 & 0x800000000L) != 0L) { + if ((active0 & 0x800000000L) != 0L) return jjStartNfaWithStates_0(8, 35, 28); - } break; case 105: return jjMoveStringLiteralDfa9_0(active0, 0x2000000000000L); case 111: return jjMoveStringLiteralDfa9_0(active0, 0x200000000L); case 116: - if ((active0 & 0x20000000000000L) != 0L) { + if ((active0 & 0x20000000000000L) != 0L) return jjStartNfaWithStates_0(8, 53, 28); - } return jjMoveStringLiteralDfa9_0(active0, 0x80000000L); default : break; } return jjStartNfa_0(7, active0, 0L); } -private final int jjMoveStringLiteralDfa9_0(long old0, long active0) +private int jjMoveStringLiteralDfa9_0(long old0, long active0) { - if (((active0 &= old0)) == 0L) { + if (((active0 &= old0)) == 0L) return jjStartNfa_0(7, old0, 0L); - } try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { jjStopStringLiteralDfa_0(8, active0, 0L); @@ -847,14 +781,12 @@ private final int jjMoveStringLiteralDfa9_0(long old0, long active0) switch(curChar) { case 102: - if ((active0 & 0x200000000L) != 0L) { + if ((active0 & 0x200000000L) != 0L) return jjStartNfaWithStates_0(9, 33, 28); - } break; case 115: - if ((active0 & 0x80000000L) != 0L) { + if ((active0 & 0x80000000L) != 0L) return jjStartNfaWithStates_0(9, 31, 28); - } break; case 122: return jjMoveStringLiteralDfa10_0(active0, 0x2000000000000L); @@ -863,11 +795,10 @@ private final int jjMoveStringLiteralDfa9_0(long old0, long active0) } return jjStartNfa_0(8, active0, 0L); } -private final int jjMoveStringLiteralDfa10_0(long old0, long active0) +private int jjMoveStringLiteralDfa10_0(long old0, long active0) { - if (((active0 &= old0)) == 0L) { + if (((active0 &= old0)) == 0L) return jjStartNfa_0(8, old0, 0L); - } try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { jjStopStringLiteralDfa_0(9, active0, 0L); @@ -882,11 +813,10 @@ private final int jjMoveStringLiteralDfa10_0(long old0, long active0) } return jjStartNfa_0(9, active0, 0L); } -private final int jjMoveStringLiteralDfa11_0(long old0, long active0) +private int jjMoveStringLiteralDfa11_0(long old0, long active0) { - if (((active0 &= old0)) == 0L) { + if (((active0 &= old0)) == 0L) return jjStartNfa_0(9, old0, 0L); - } try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { jjStopStringLiteralDfa_0(10, active0, 0L); @@ -895,44 +825,21 @@ private final int jjMoveStringLiteralDfa11_0(long old0, long active0) switch(curChar) { case 100: - if ((active0 & 0x2000000000000L) != 0L) { + if ((active0 & 0x2000000000000L) != 0L) return jjStartNfaWithStates_0(11, 49, 28); - } break; default : break; } return jjStartNfa_0(10, active0, 0L); } -private final void jjCheckNAdd(int state) +private int jjStartNfaWithStates_0(int pos, int kind, int state) { - if (jjrounds[state] != jjround) - { - jjstateSet[jjnewStateCnt++] = state; - jjrounds[state] = jjround; - } -} -private final void jjAddStates(int start, int end) -{ - do { - jjstateSet[jjnewStateCnt++] = jjnextStates[start]; - } while (start++ != end); -} -private final void jjCheckNAddTwoStates(int state1, int state2) -{ - jjCheckNAdd(state1); - jjCheckNAdd(state2); -} -private final void jjCheckNAddStates(int start, int end) -{ - do { - jjCheckNAdd(jjnextStates[start]); - } while (start++ != end); -} -private final void jjCheckNAddStates(int start) -{ - jjCheckNAdd(jjnextStates[start]); - jjCheckNAdd(jjnextStates[start + 1]); + jjmatchedKind = kind; + jjmatchedPos = pos; + try { curChar = input_stream.readChar(); } + catch(java.io.IOException e) { return pos + 1; } + return jjMoveNfa_0(state, pos + 1); } static final long[] jjbitVec0 = { 0xfffffffffffffffeL, 0xffffffffffffffffL, 0xffffffffffffffffL, 0xffffffffffffffffL @@ -958,7 +865,7 @@ static final long[] jjbitVec7 = { static final long[] jjbitVec8 = { 0x3fffffffffffL, 0x0L, 0x0L, 0x0L }; -private final int jjMoveNfa_0(int startState, int curPos) +private int jjMoveNfa_0(int startState, int curPos) { int startsAt = 0; jjnewStateCnt = 67; @@ -967,388 +874,312 @@ private final int jjMoveNfa_0(int startState, int curPos) int kind = 0x7fffffff; for (;;) { - if (++jjround == 0x7fffffff) { + if (++jjround == 0x7fffffff) ReInitRounds(); - } if (curChar < 64) { long l = 1L << curChar; - //MatchLoop do { switch(jjstateSet[--i]) { + case 49: + if (curChar == 42) + jjCheckNAddTwoStates(62, 63); + else if (curChar == 47) + jjCheckNAddStates(0, 2); + if (curChar == 42) + jjstateSet[jjnewStateCnt++] = 54; + break; case 0: - if ((0x3ff000000000000L & l) != 0L) { - jjCheckNAddStates(0, 6); - } else if (curChar == 47) { - jjAddStates(7, 9); - } else if (curChar == 36) + if ((0x3ff000000000000L & l) != 0L) + jjCheckNAddStates(3, 9); + else if (curChar == 47) + jjAddStates(10, 12); + else if (curChar == 36) { - if (kind > 67) { + if (kind > 67) kind = 67; - } jjCheckNAdd(28); } - else if (curChar == 34) { - jjCheckNAddStates(10, 12); - } else if (curChar == 39) { - jjAddStates(13, 14); - } else if (curChar == 46) { + else if (curChar == 34) + jjCheckNAddStates(13, 15); + else if (curChar == 39) + jjAddStates(16, 17); + else if (curChar == 46) jjCheckNAdd(4); - } if ((0x3fe000000000000L & l) != 0L) { - if (kind > 59) { + if (kind > 59) kind = 59; - } jjCheckNAddTwoStates(1, 2); } else if (curChar == 48) { - if (kind > 59) { + if (kind > 59) kind = 59; - } - jjCheckNAddStates(15, 17); - } - break; - case 49: - if (curChar == 42) { - jjCheckNAddTwoStates(62, 63); - } else if (curChar == 47) { jjCheckNAddStates(18, 20); } - if (curChar == 42) { - jjstateSet[jjnewStateCnt++] = 54; - } break; case 1: - if ((0x3ff000000000000L & l) == 0L) { + if ((0x3ff000000000000L & l) == 0L) break; - } - if (kind > 59) { + if (kind > 59) kind = 59; - } jjCheckNAddTwoStates(1, 2); break; case 3: - if (curChar == 46) { + if (curChar == 46) jjCheckNAdd(4); - } break; case 4: - if ((0x3ff000000000000L & l) == 0L) { + if ((0x3ff000000000000L & l) == 0L) break; - } - if (kind > 63) { + if (kind > 63) kind = 63; - } jjCheckNAddStates(21, 23); break; case 6: - if ((0x280000000000L & l) != 0L) { + if ((0x280000000000L & l) != 0L) jjCheckNAdd(7); - } break; case 7: - if ((0x3ff000000000000L & l) == 0L) { + if ((0x3ff000000000000L & l) == 0L) break; - } - if (kind > 63) { + if (kind > 63) kind = 63; - } jjCheckNAddTwoStates(7, 8); break; case 9: - if (curChar == 39) { - jjAddStates(13, 14); - } + if (curChar == 39) + jjAddStates(16, 17); break; case 10: - if ((0xffffff7fffffdbffL & l) != 0L) { + if ((0xffffff7fffffdbffL & l) != 0L) jjCheckNAdd(11); - } break; case 11: - if (curChar == 39 && kind > 65) { + if (curChar == 39 && kind > 65) kind = 65; - } break; case 13: - if ((0x8400000000L & l) != 0L) { + if ((0x8400000000L & l) != 0L) jjCheckNAdd(11); - } break; case 14: - if ((0xff000000000000L & l) != 0L) { + if ((0xff000000000000L & l) != 0L) jjCheckNAddTwoStates(15, 11); - } break; case 15: - if ((0xff000000000000L & l) != 0L) { + if ((0xff000000000000L & l) != 0L) jjCheckNAdd(11); - } break; case 16: - if ((0xf000000000000L & l) != 0L) { + if ((0xf000000000000L & l) != 0L) jjstateSet[jjnewStateCnt++] = 17; - } break; case 17: - if ((0xff000000000000L & l) != 0L) { + if ((0xff000000000000L & l) != 0L) jjCheckNAdd(15); - } break; case 18: - if (curChar == 34) { - jjCheckNAddStates(10, 12); - } + if (curChar == 34) + jjCheckNAddStates(13, 15); break; case 19: - if ((0xfffffffbffffdbffL & l) != 0L) { - jjCheckNAddStates(10, 12); - } + if ((0xfffffffbffffdbffL & l) != 0L) + jjCheckNAddStates(13, 15); break; case 21: - if ((0x8400000000L & l) != 0L) { - jjCheckNAddStates(10, 12); - } + if ((0x8400000000L & l) != 0L) + jjCheckNAddStates(13, 15); break; case 22: - if (curChar == 34 && kind > 66) { + if (curChar == 34 && kind > 66) kind = 66; - } break; case 23: - if ((0xff000000000000L & l) != 0L) { + if ((0xff000000000000L & l) != 0L) jjCheckNAddStates(24, 27); - } break; case 24: - if ((0xff000000000000L & l) != 0L) { - jjCheckNAddStates(10, 12); - } + if ((0xff000000000000L & l) != 0L) + jjCheckNAddStates(13, 15); break; case 25: - if ((0xf000000000000L & l) != 0L) { + if ((0xf000000000000L & l) != 0L) jjstateSet[jjnewStateCnt++] = 26; - } break; case 26: - if ((0xff000000000000L & l) != 0L) { + if ((0xff000000000000L & l) != 0L) jjCheckNAdd(24); - } break; case 27: - if (curChar != 36) { + if (curChar != 36) break; - } - if (kind > 67) { + if (kind > 67) kind = 67; - } jjCheckNAdd(28); break; case 28: - if ((0x3ff001000000000L & l) == 0L) { + if ((0x3ff001000000000L & l) == 0L) break; - } - if (kind > 67) { + if (kind > 67) kind = 67; - } jjCheckNAdd(28); break; case 29: - if ((0x3ff000000000000L & l) != 0L) { - jjCheckNAddStates(0, 6); - } + if ((0x3ff000000000000L & l) != 0L) + jjCheckNAddStates(3, 9); break; case 30: - if ((0x3ff000000000000L & l) != 0L) { + if ((0x3ff000000000000L & l) != 0L) jjCheckNAddTwoStates(30, 31); - } break; case 31: - if (curChar != 46) { + if (curChar != 46) break; - } - if (kind > 63) { + if (kind > 63) kind = 63; - } jjCheckNAddStates(28, 30); break; case 32: - if ((0x3ff000000000000L & l) == 0L) { + if ((0x3ff000000000000L & l) == 0L) break; - } - if (kind > 63) { + if (kind > 63) kind = 63; - } jjCheckNAddStates(28, 30); break; case 34: - if ((0x280000000000L & l) != 0L) { + if ((0x280000000000L & l) != 0L) jjCheckNAdd(35); - } break; case 35: - if ((0x3ff000000000000L & l) == 0L) { + if ((0x3ff000000000000L & l) == 0L) break; - } - if (kind > 63) { + if (kind > 63) kind = 63; - } jjCheckNAddTwoStates(35, 8); break; case 36: - if ((0x3ff000000000000L & l) != 0L) { + if ((0x3ff000000000000L & l) != 0L) jjCheckNAddTwoStates(36, 37); - } break; case 38: - if ((0x280000000000L & l) != 0L) { + if ((0x280000000000L & l) != 0L) jjCheckNAdd(39); - } break; case 39: - if ((0x3ff000000000000L & l) == 0L) { + if ((0x3ff000000000000L & l) == 0L) break; - } - if (kind > 63) { + if (kind > 63) kind = 63; - } jjCheckNAddTwoStates(39, 8); break; case 40: - if ((0x3ff000000000000L & l) != 0L) { + if ((0x3ff000000000000L & l) != 0L) jjCheckNAddStates(31, 33); - } break; case 42: - if ((0x280000000000L & l) != 0L) { + if ((0x280000000000L & l) != 0L) jjCheckNAdd(43); - } break; case 43: - if ((0x3ff000000000000L & l) != 0L) { + if ((0x3ff000000000000L & l) != 0L) jjCheckNAddTwoStates(43, 8); - } break; case 44: - if (curChar != 48) { + if (curChar != 48) break; - } - if (kind > 59) { + if (kind > 59) kind = 59; - } - jjCheckNAddStates(15, 17); + jjCheckNAddStates(18, 20); break; case 46: - if ((0x3ff000000000000L & l) == 0L) { + if ((0x3ff000000000000L & l) == 0L) break; - } - if (kind > 59) { + if (kind > 59) kind = 59; - } jjCheckNAddTwoStates(46, 2); break; case 47: - if ((0xff000000000000L & l) == 0L) { + if ((0xff000000000000L & l) == 0L) break; - } - if (kind > 59) { + if (kind > 59) kind = 59; - } jjCheckNAddTwoStates(47, 2); break; case 48: - if (curChar == 47) { - jjAddStates(7, 9); - } + if (curChar == 47) + jjAddStates(10, 12); break; case 50: - if ((0xffffffffffffdbffL & l) != 0L) { - jjCheckNAddStates(18, 20); - } + if ((0xffffffffffffdbffL & l) != 0L) + jjCheckNAddStates(0, 2); break; case 51: - if ((0x2400L & l) != 0L && kind > 6) { + if ((0x2400L & l) != 0L && kind > 6) kind = 6; - } break; case 52: - if (curChar == 10 && kind > 6) { + if (curChar == 10 && kind > 6) kind = 6; - } break; case 53: - if (curChar == 13) { + if (curChar == 13) jjstateSet[jjnewStateCnt++] = 52; - } break; case 54: - if (curChar == 42) { + if (curChar == 42) jjCheckNAddTwoStates(55, 56); - } break; case 55: - if ((0xfffffbffffffffffL & l) != 0L) { + if ((0xfffffbffffffffffL & l) != 0L) jjCheckNAddTwoStates(55, 56); - } break; case 56: - if (curChar == 42) { + if (curChar == 42) jjCheckNAddStates(34, 36); - } break; case 57: - if ((0xffff7bffffffffffL & l) != 0L) { + if ((0xffff7bffffffffffL & l) != 0L) jjCheckNAddTwoStates(58, 56); - } break; case 58: - if ((0xfffffbffffffffffL & l) != 0L) { + if ((0xfffffbffffffffffL & l) != 0L) jjCheckNAddTwoStates(58, 56); - } break; case 59: - if (curChar == 47 && kind > 7) { + if (curChar == 47 && kind > 7) kind = 7; - } break; case 60: - if (curChar == 42) { + if (curChar == 42) jjstateSet[jjnewStateCnt++] = 54; - } break; case 61: - if (curChar == 42) { + if (curChar == 42) jjCheckNAddTwoStates(62, 63); - } break; case 62: - if ((0xfffffbffffffffffL & l) != 0L) { + if ((0xfffffbffffffffffL & l) != 0L) jjCheckNAddTwoStates(62, 63); - } break; case 63: - if (curChar == 42) { + if (curChar == 42) jjCheckNAddStates(37, 39); - } break; case 64: - if ((0xffff7bffffffffffL & l) != 0L) { + if ((0xffff7bffffffffffL & l) != 0L) jjCheckNAddTwoStates(65, 63); - } break; case 65: - if ((0xfffffbffffffffffL & l) != 0L) { + if ((0xfffffbffffffffffL & l) != 0L) jjCheckNAddTwoStates(65, 63); - } break; case 66: - if (curChar == 47 && kind > 8) { + if (curChar == 47 && kind > 8) kind = 8; - } break; default : break; } @@ -1357,97 +1188,79 @@ private final int jjMoveNfa_0(int startState, int curPos) else if (curChar < 128) { long l = 1L << (curChar & 077); - //MatchLoop do { switch(jjstateSet[--i]) { case 0: case 28: - if ((0x7fffffe87fffffeL & l) == 0L) { + if ((0x7fffffe87fffffeL & l) == 0L) break; - } - if (kind > 67) { + if (kind > 67) kind = 67; - } jjCheckNAdd(28); break; case 2: - if ((0x100000001000L & l) != 0L && kind > 59) { + if ((0x100000001000L & l) != 0L && kind > 59) kind = 59; - } break; case 5: - if ((0x2000000020L & l) != 0L) { + if ((0x2000000020L & l) != 0L) jjAddStates(40, 41); - } break; case 8: - if ((0x5000000050L & l) != 0L && kind > 63) { + if ((0x5000000050L & l) != 0L && kind > 63) kind = 63; - } break; case 10: - if ((0xffffffffefffffffL & l) != 0L) { + if ((0xffffffffefffffffL & l) != 0L) jjCheckNAdd(11); - } break; case 12: - if (curChar == 92) { + if (curChar == 92) jjAddStates(42, 44); - } break; case 13: - if ((0x14404410000000L & l) != 0L) { + if ((0x14404410000000L & l) != 0L) jjCheckNAdd(11); - } break; case 19: - if ((0xffffffffefffffffL & l) != 0L) { - jjCheckNAddStates(10, 12); - } + if ((0xffffffffefffffffL & l) != 0L) + jjCheckNAddStates(13, 15); break; case 20: - if (curChar == 92) { + if (curChar == 92) jjAddStates(45, 47); - } break; case 21: - if ((0x14404410000000L & l) != 0L) { - jjCheckNAddStates(10, 12); - } + if ((0x14404410000000L & l) != 0L) + jjCheckNAddStates(13, 15); break; case 33: - if ((0x2000000020L & l) != 0L) { + if ((0x2000000020L & l) != 0L) jjAddStates(48, 49); - } break; case 37: - if ((0x2000000020L & l) != 0L) { + if ((0x2000000020L & l) != 0L) jjAddStates(50, 51); - } break; case 41: - if ((0x2000000020L & l) != 0L) { + if ((0x2000000020L & l) != 0L) jjAddStates(52, 53); - } break; case 45: - if ((0x100000001000000L & l) != 0L) { + if ((0x100000001000000L & l) != 0L) jjCheckNAdd(46); - } break; case 46: - if ((0x7e0000007eL & l) == 0L) { + if ((0x7e0000007eL & l) == 0L) break; - } - if (kind > 59) { + if (kind > 59) kind = 59; - } jjCheckNAddTwoStates(46, 2); break; case 50: - jjAddStates(18, 20); + jjAddStates(0, 2); break; case 55: jjCheckNAddTwoStates(55, 56); @@ -1474,57 +1287,47 @@ private final int jjMoveNfa_0(int startState, int curPos) long l1 = 1L << (hiByte & 077); int i2 = (curChar & 0xff) >> 6; long l2 = 1L << (curChar & 077); - //MatchLoop do { switch(jjstateSet[--i]) { case 0: case 28: - if (!jjCanMove_1(hiByte, i1, i2, l1, l2)) { + if (!jjCanMove_1(hiByte, i1, i2, l1, l2)) break; - } - if (kind > 67) { + if (kind > 67) kind = 67; - } jjCheckNAdd(28); break; case 10: - if (jjCanMove_0(hiByte, i1, i2, l1, l2)) { + if (jjCanMove_0(hiByte, i1, i2, l1, l2)) jjstateSet[jjnewStateCnt++] = 11; - } break; case 19: - if (jjCanMove_0(hiByte, i1, i2, l1, l2)) { - jjAddStates(10, 12); - } + if (jjCanMove_0(hiByte, i1, i2, l1, l2)) + jjAddStates(13, 15); break; case 50: - if (jjCanMove_0(hiByte, i1, i2, l1, l2)) { - jjAddStates(18, 20); - } + if (jjCanMove_0(hiByte, i1, i2, l1, l2)) + jjAddStates(0, 2); break; case 55: - if (jjCanMove_0(hiByte, i1, i2, l1, l2)) { + if (jjCanMove_0(hiByte, i1, i2, l1, l2)) jjCheckNAddTwoStates(55, 56); - } break; case 57: case 58: - if (jjCanMove_0(hiByte, i1, i2, l1, l2)) { + if (jjCanMove_0(hiByte, i1, i2, l1, l2)) jjCheckNAddTwoStates(58, 56); - } break; case 62: - if (jjCanMove_0(hiByte, i1, i2, l1, l2)) { + if (jjCanMove_0(hiByte, i1, i2, l1, l2)) jjCheckNAddTwoStates(62, 63); - } break; case 64: case 65: - if (jjCanMove_0(hiByte, i1, i2, l1, l2)) { + if (jjCanMove_0(hiByte, i1, i2, l1, l2)) jjCheckNAddTwoStates(65, 63); - } break; default : break; } @@ -1537,16 +1340,15 @@ private final int jjMoveNfa_0(int startState, int curPos) kind = 0x7fffffff; } ++curPos; - if ((i = jjnewStateCnt) == (startsAt = 67 - (jjnewStateCnt = startsAt))) { + if ((i = jjnewStateCnt) == (startsAt = 67 - (jjnewStateCnt = startsAt))) return curPos; - } try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { return curPos; } } } static final int[] jjnextStates = { - 30, 31, 36, 37, 40, 41, 8, 49, 60, 61, 19, 20, 22, 10, 12, 45, - 47, 2, 50, 51, 53, 4, 5, 8, 19, 20, 24, 22, 32, 33, 8, 40, + 50, 51, 53, 30, 31, 36, 37, 40, 41, 8, 49, 60, 61, 19, 20, 22, + 10, 12, 45, 47, 2, 4, 5, 8, 19, 20, 24, 22, 32, 33, 8, 40, 41, 8, 56, 57, 59, 63, 64, 66, 6, 7, 13, 14, 16, 21, 23, 25, 34, 35, 38, 39, 42, 43, }; @@ -1557,9 +1359,8 @@ private static final boolean jjCanMove_0(int hiByte, int i1, int i2, long l1, lo case 0: return ((jjbitVec2[i2] & l2) != 0L); default : - if ((jjbitVec0[i1] & l1) != 0L) { + if ((jjbitVec0[i1] & l1) != 0L) return true; - } return false; } } @@ -1578,12 +1379,13 @@ private static final boolean jjCanMove_1(int hiByte, int i1, int i2, long l1, lo case 61: return ((jjbitVec8[i2] & l2) != 0L); default : - if ((jjbitVec3[i1] & l1) != 0L) { + if ((jjbitVec3[i1] & l1) != 0L) return true; - } return false; } } + +/** Token literal values. */ public static final String[] jjstrLiteralImages = { "", null, null, null, null, null, null, null, null, "\141\142\163\164\162\141\143\164", "\142\157\157\154\145\141\156", "\142\162\145\141\153", "\142\171\164\145", @@ -1606,6 +1408,8 @@ public static final String[] jjstrLiteralImages = { "\46\46", "\53\53", "\55\55", "\53", "\55", "\52", "\57", "\46", "\174", "\136", "\45", "\74\74", "\76\76", "\76\76\76", "\53\75", "\55\75", "\52\75", "\57\75", "\46\75", "\174\75", "\136\75", "\45\75", "\74\74\75", "\76\76\75", "\76\76\76\75", }; + +/** Lexer state names. */ public static final String[] lexStateNames = { "DEFAULT", }; @@ -1618,61 +1422,76 @@ static final long[] jjtoSkip = { static final long[] jjtoSpecial = { 0x1c0L, 0x0L, }; -private ASCII_UCodeESC_CharStream input_stream; +protected JavaCharStream input_stream; private final int[] jjrounds = new int[67]; private final int[] jjstateSet = new int[134]; protected char curChar; -public ExpressionParserTokenManager(ASCII_UCodeESC_CharStream stream) -{ - if (ASCII_UCodeESC_CharStream.staticFlag) { +/** Constructor. */ +public ExpressionParserTokenManager(JavaCharStream stream){ + if (JavaCharStream.staticFlag) throw new Error("ERROR: Cannot use a static CharStream class with a non-static lexical analyzer."); - } input_stream = stream; } -public ExpressionParserTokenManager(ASCII_UCodeESC_CharStream stream, int lexState) -{ + +/** Constructor. */ +public ExpressionParserTokenManager(JavaCharStream stream, int lexState){ this(stream); SwitchTo(lexState); } -public void ReInit(ASCII_UCodeESC_CharStream stream) + +/** Reinitialise parser. */ +public void ReInit(JavaCharStream stream) { jjmatchedPos = jjnewStateCnt = 0; curLexState = defaultLexState; input_stream = stream; ReInitRounds(); } -private final void ReInitRounds() +private void ReInitRounds() { int i; jjround = 0x80000001; - for (i = 67; i-- > 0;) { + for (i = 67; i-- > 0;) jjrounds[i] = 0x80000000; } -} -public void ReInit(ASCII_UCodeESC_CharStream stream, int lexState) + +/** Reinitialise parser. */ +public void ReInit(JavaCharStream stream, int lexState) { ReInit(stream); SwitchTo(lexState); } + +/** Switch to specified lex state. */ public void SwitchTo(int lexState) { - if (lexState >= 1 || lexState < 0) { + if (lexState >= 1 || lexState < 0) throw new TokenMgrError("Error: Ignoring invalid lexical state : " + lexState + ". State unchanged.", TokenMgrError.INVALID_LEXICAL_STATE); - } else { + else curLexState = lexState; } -} -private final Token jjFillToken() +protected Token jjFillToken() { - Token t = Token.newToken(jjmatchedKind); - t.kind = jjmatchedKind; + final Token t; + final String curTokenImage; + final int beginLine; + final int endLine; + final int beginColumn; + final int endColumn; String im = jjstrLiteralImages[jjmatchedKind]; - t.image = (im == null) ? input_stream.GetImage() : im; - t.beginLine = input_stream.getBeginLine(); - t.beginColumn = input_stream.getBeginColumn(); - t.endLine = input_stream.getEndLine(); - t.endColumn = input_stream.getEndColumn(); + curTokenImage = (im == null) ? input_stream.GetImage() : im; + beginLine = input_stream.getBeginLine(); + beginColumn = input_stream.getBeginColumn(); + endLine = input_stream.getEndLine(); + endColumn = input_stream.getEndColumn(); + t = Token.newToken(jjmatchedKind, curTokenImage); + + t.beginLine = beginLine; + t.endLine = endLine; + t.beginColumn = beginColumn; + t.endColumn = endColumn; + return t; } @@ -1683,7 +1502,8 @@ int jjround; int jjmatchedPos; int jjmatchedKind; -public final Token getNextToken() +/** Get the next Token. */ +public Token getNextToken() { Token specialToken = null; Token matchedToken; @@ -1704,20 +1524,18 @@ public final Token getNextToken() return matchedToken; } - try { - while (curChar <= 32 && (0x100003600L & (1L << curChar)) != 0L) { + try { input_stream.backup(0); + while (curChar <= 32 && (0x100003600L & (1L << curChar)) != 0L) curChar = input_stream.BeginToken(); } - } catch (java.io.IOException e1) { continue EOFLoop; } jjmatchedKind = 0x7fffffff; jjmatchedPos = 0; curPos = jjMoveStringLiteralDfa0_0(); if (jjmatchedKind != 0x7fffffff) { - if (jjmatchedPos + 1 < curPos) { + if (jjmatchedPos + 1 < curPos) input_stream.backup(curPos - jjmatchedPos - 1); - } if ((jjtoToken[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L) { matchedToken = jjFillToken(); @@ -1729,9 +1547,9 @@ public final Token getNextToken() if ((jjtoSpecial[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L) { matchedToken = jjFillToken(); - if (specialToken == null) { + if (specialToken == null) specialToken = matchedToken; - } else + else { matchedToken.specialToken = specialToken; specialToken = (specialToken.next = matchedToken); @@ -1751,9 +1569,9 @@ public final Token getNextToken() if (curChar == '\n' || curChar == '\r') { error_line++; error_column = 0; - } else { - error_column++; } + else + error_column++; } if (!EOFSeen) { input_stream.backup(1); @@ -1763,4 +1581,31 @@ public final Token getNextToken() } } +private void jjCheckNAdd(int state) +{ + if (jjrounds[state] != jjround) + { + jjstateSet[jjnewStateCnt++] = state; + jjrounds[state] = jjround; + } +} +private void jjAddStates(int start, int end) +{ + do { + jjstateSet[jjnewStateCnt++] = jjnextStates[start]; + } while (start++ != end); +} +private void jjCheckNAddTwoStates(int state1, int state2) +{ + jjCheckNAdd(state1); + jjCheckNAdd(state2); +} + +private void jjCheckNAddStates(int start, int end) +{ + do { + jjCheckNAdd(jjnextStates[start]); + } while (start++ != end); +} + } diff --git a/jdk/src/share/classes/com/sun/tools/example/debug/expr/JavaCharStream.java b/jdk/src/share/classes/com/sun/tools/example/debug/expr/JavaCharStream.java new file mode 100644 index 00000000000..cc4581f1a2a --- /dev/null +++ b/jdk/src/share/classes/com/sun/tools/example/debug/expr/JavaCharStream.java @@ -0,0 +1,642 @@ +/* + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * 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. + */ + +/* Generated By:JavaCC: Do not edit this line. JavaCharStream.java Version 5.0 */ +/* JavaCCOptions:STATIC=false,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */ +package com.sun.tools.example.debug.expr; + +/** + * An implementation of interface CharStream, where the stream is assumed to + * contain only ASCII characters (with java-like unicode escape processing). + */ + +public +class JavaCharStream +{ + /** Whether parser is static. */ + public static final boolean staticFlag = false; + + static final int hexval(char c) throws java.io.IOException { + switch(c) + { + case '0' : + return 0; + case '1' : + return 1; + case '2' : + return 2; + case '3' : + return 3; + case '4' : + return 4; + case '5' : + return 5; + case '6' : + return 6; + case '7' : + return 7; + case '8' : + return 8; + case '9' : + return 9; + + case 'a' : + case 'A' : + return 10; + case 'b' : + case 'B' : + return 11; + case 'c' : + case 'C' : + return 12; + case 'd' : + case 'D' : + return 13; + case 'e' : + case 'E' : + return 14; + case 'f' : + case 'F' : + return 15; + } + + throw new java.io.IOException(); // Should never come here + } + +/** Position in buffer. */ + public int bufpos = -1; + int bufsize; + int available; + int tokenBegin; + protected int bufline[]; + protected int bufcolumn[]; + + protected int column = 0; + protected int line = 1; + + protected boolean prevCharIsCR = false; + protected boolean prevCharIsLF = false; + + protected java.io.Reader inputStream; + + protected char[] nextCharBuf; + protected char[] buffer; + protected int maxNextCharInd = 0; + protected int nextCharInd = -1; + protected int inBuf = 0; + protected int tabSize = 8; + + protected void setTabSize(int i) { tabSize = i; } + protected int getTabSize(int i) { return tabSize; } + + protected void ExpandBuff(boolean wrapAround) + { + char[] newbuffer = new char[bufsize + 2048]; + int newbufline[] = new int[bufsize + 2048]; + int newbufcolumn[] = new int[bufsize + 2048]; + + try + { + if (wrapAround) + { + System.arraycopy(buffer, tokenBegin, newbuffer, 0, bufsize - tokenBegin); + System.arraycopy(buffer, 0, newbuffer, bufsize - tokenBegin, bufpos); + buffer = newbuffer; + + System.arraycopy(bufline, tokenBegin, newbufline, 0, bufsize - tokenBegin); + System.arraycopy(bufline, 0, newbufline, bufsize - tokenBegin, bufpos); + bufline = newbufline; + + System.arraycopy(bufcolumn, tokenBegin, newbufcolumn, 0, bufsize - tokenBegin); + System.arraycopy(bufcolumn, 0, newbufcolumn, bufsize - tokenBegin, bufpos); + bufcolumn = newbufcolumn; + + bufpos += (bufsize - tokenBegin); + } + else + { + System.arraycopy(buffer, tokenBegin, newbuffer, 0, bufsize - tokenBegin); + buffer = newbuffer; + + System.arraycopy(bufline, tokenBegin, newbufline, 0, bufsize - tokenBegin); + bufline = newbufline; + + System.arraycopy(bufcolumn, tokenBegin, newbufcolumn, 0, bufsize - tokenBegin); + bufcolumn = newbufcolumn; + + bufpos -= tokenBegin; + } + } + catch (Throwable t) + { + throw new Error(t.getMessage()); + } + + available = (bufsize += 2048); + tokenBegin = 0; + } + + protected void FillBuff() throws java.io.IOException + { + int i; + if (maxNextCharInd == 4096) + maxNextCharInd = nextCharInd = 0; + + try { + if ((i = inputStream.read(nextCharBuf, maxNextCharInd, + 4096 - maxNextCharInd)) == -1) + { + inputStream.close(); + throw new java.io.IOException(); + } + else + maxNextCharInd += i; + return; + } + catch(java.io.IOException e) { + if (bufpos != 0) + { + --bufpos; + backup(0); + } + else + { + bufline[bufpos] = line; + bufcolumn[bufpos] = column; + } + throw e; + } + } + + protected char ReadByte() throws java.io.IOException + { + if (++nextCharInd >= maxNextCharInd) + FillBuff(); + + return nextCharBuf[nextCharInd]; + } + +/** @return starting character for token. */ + public char BeginToken() throws java.io.IOException + { + if (inBuf > 0) + { + --inBuf; + + if (++bufpos == bufsize) + bufpos = 0; + + tokenBegin = bufpos; + return buffer[bufpos]; + } + + tokenBegin = 0; + bufpos = -1; + + return readChar(); + } + + protected void AdjustBuffSize() + { + if (available == bufsize) + { + if (tokenBegin > 2048) + { + bufpos = 0; + available = tokenBegin; + } + else + ExpandBuff(false); + } + else if (available > tokenBegin) + available = bufsize; + else if ((tokenBegin - available) < 2048) + ExpandBuff(true); + else + available = tokenBegin; + } + + protected void UpdateLineColumn(char c) + { + column++; + + if (prevCharIsLF) + { + prevCharIsLF = false; + line += (column = 1); + } + else if (prevCharIsCR) + { + prevCharIsCR = false; + if (c == '\n') + { + prevCharIsLF = true; + } + else + line += (column = 1); + } + + switch (c) + { + case '\r' : + prevCharIsCR = true; + break; + case '\n' : + prevCharIsLF = true; + break; + case '\t' : + column--; + column += (tabSize - (column % tabSize)); + break; + default : + break; + } + + bufline[bufpos] = line; + bufcolumn[bufpos] = column; + } + +/** Read a character. */ + public char readChar() throws java.io.IOException + { + if (inBuf > 0) + { + --inBuf; + + if (++bufpos == bufsize) + bufpos = 0; + + return buffer[bufpos]; + } + + char c; + + if (++bufpos == available) + AdjustBuffSize(); + + if ((buffer[bufpos] = c = ReadByte()) == '\\') + { + UpdateLineColumn(c); + + int backSlashCnt = 1; + + for (;;) // Read all the backslashes + { + if (++bufpos == available) + AdjustBuffSize(); + + try + { + if ((buffer[bufpos] = c = ReadByte()) != '\\') + { + UpdateLineColumn(c); + // found a non-backslash char. + if ((c == 'u') && ((backSlashCnt & 1) == 1)) + { + if (--bufpos < 0) + bufpos = bufsize - 1; + + break; + } + + backup(backSlashCnt); + return '\\'; + } + } + catch(java.io.IOException e) + { + // We are returning one backslash so we should only backup (count-1) + if (backSlashCnt > 1) + backup(backSlashCnt-1); + + return '\\'; + } + + UpdateLineColumn(c); + backSlashCnt++; + } + + // Here, we have seen an odd number of backslash's followed by a 'u' + try + { + while ((c = ReadByte()) == 'u') + ++column; + + buffer[bufpos] = c = (char)(hexval(c) << 12 | + hexval(ReadByte()) << 8 | + hexval(ReadByte()) << 4 | + hexval(ReadByte())); + + column += 4; + } + catch(java.io.IOException e) + { + throw new Error("Invalid escape character at line " + line + + " column " + column + "."); + } + + if (backSlashCnt == 1) + return c; + else + { + backup(backSlashCnt - 1); + return '\\'; + } + } + else + { + UpdateLineColumn(c); + return c; + } + } + + @Deprecated + /** + * @deprecated + * @see #getEndColumn + */ + public int getColumn() { + return bufcolumn[bufpos]; + } + + @Deprecated + /** + * @deprecated + * @see #getEndLine + */ + public int getLine() { + return bufline[bufpos]; + } + +/** Get end column. */ + public int getEndColumn() { + return bufcolumn[bufpos]; + } + +/** Get end line. */ + public int getEndLine() { + return bufline[bufpos]; + } + +/** @return column of token start */ + public int getBeginColumn() { + return bufcolumn[tokenBegin]; + } + +/** @return line number of token start */ + public int getBeginLine() { + return bufline[tokenBegin]; + } + +/** Retreat. */ + public void backup(int amount) { + + inBuf += amount; + if ((bufpos -= amount) < 0) + bufpos += bufsize; + } + +/** Constructor. */ + public JavaCharStream(java.io.Reader dstream, + int startline, int startcolumn, int buffersize) + { + inputStream = dstream; + line = startline; + column = startcolumn - 1; + + available = bufsize = buffersize; + buffer = new char[buffersize]; + bufline = new int[buffersize]; + bufcolumn = new int[buffersize]; + nextCharBuf = new char[4096]; + } + +/** Constructor. */ + public JavaCharStream(java.io.Reader dstream, + int startline, int startcolumn) + { + this(dstream, startline, startcolumn, 4096); + } + +/** Constructor. */ + public JavaCharStream(java.io.Reader dstream) + { + this(dstream, 1, 1, 4096); + } +/** Reinitialise. */ + public void ReInit(java.io.Reader dstream, + int startline, int startcolumn, int buffersize) + { + inputStream = dstream; + line = startline; + column = startcolumn - 1; + + if (buffer == null || buffersize != buffer.length) + { + available = bufsize = buffersize; + buffer = new char[buffersize]; + bufline = new int[buffersize]; + bufcolumn = new int[buffersize]; + nextCharBuf = new char[4096]; + } + prevCharIsLF = prevCharIsCR = false; + tokenBegin = inBuf = maxNextCharInd = 0; + nextCharInd = bufpos = -1; + } + +/** Reinitialise. */ + public void ReInit(java.io.Reader dstream, + int startline, int startcolumn) + { + ReInit(dstream, startline, startcolumn, 4096); + } + +/** Reinitialise. */ + public void ReInit(java.io.Reader dstream) + { + ReInit(dstream, 1, 1, 4096); + } +/** Constructor. */ + public JavaCharStream(java.io.InputStream dstream, String encoding, int startline, + int startcolumn, int buffersize) throws java.io.UnsupportedEncodingException + { + this(encoding == null ? new java.io.InputStreamReader(dstream) : new java.io.InputStreamReader(dstream, encoding), startline, startcolumn, buffersize); + } + +/** Constructor. */ + public JavaCharStream(java.io.InputStream dstream, int startline, + int startcolumn, int buffersize) + { + this(new java.io.InputStreamReader(dstream), startline, startcolumn, 4096); + } + +/** Constructor. */ + public JavaCharStream(java.io.InputStream dstream, String encoding, int startline, + int startcolumn) throws java.io.UnsupportedEncodingException + { + this(dstream, encoding, startline, startcolumn, 4096); + } + +/** Constructor. */ + public JavaCharStream(java.io.InputStream dstream, int startline, + int startcolumn) + { + this(dstream, startline, startcolumn, 4096); + } + +/** Constructor. */ + public JavaCharStream(java.io.InputStream dstream, String encoding) throws java.io.UnsupportedEncodingException + { + this(dstream, encoding, 1, 1, 4096); + } + +/** Constructor. */ + public JavaCharStream(java.io.InputStream dstream) + { + this(dstream, 1, 1, 4096); + } + +/** Reinitialise. */ + public void ReInit(java.io.InputStream dstream, String encoding, int startline, + int startcolumn, int buffersize) throws java.io.UnsupportedEncodingException + { + ReInit(encoding == null ? new java.io.InputStreamReader(dstream) : new java.io.InputStreamReader(dstream, encoding), startline, startcolumn, buffersize); + } + +/** Reinitialise. */ + public void ReInit(java.io.InputStream dstream, int startline, + int startcolumn, int buffersize) + { + ReInit(new java.io.InputStreamReader(dstream), startline, startcolumn, buffersize); + } +/** Reinitialise. */ + public void ReInit(java.io.InputStream dstream, String encoding, int startline, + int startcolumn) throws java.io.UnsupportedEncodingException + { + ReInit(dstream, encoding, startline, startcolumn, 4096); + } +/** Reinitialise. */ + public void ReInit(java.io.InputStream dstream, int startline, + int startcolumn) + { + ReInit(dstream, startline, startcolumn, 4096); + } +/** Reinitialise. */ + public void ReInit(java.io.InputStream dstream, String encoding) throws java.io.UnsupportedEncodingException + { + ReInit(dstream, encoding, 1, 1, 4096); + } + +/** Reinitialise. */ + public void ReInit(java.io.InputStream dstream) + { + ReInit(dstream, 1, 1, 4096); + } + + /** @return token image as String */ + public String GetImage() + { + if (bufpos >= tokenBegin) + return new String(buffer, tokenBegin, bufpos - tokenBegin + 1); + else + return new String(buffer, tokenBegin, bufsize - tokenBegin) + + new String(buffer, 0, bufpos + 1); + } + + /** @return suffix */ + public char[] GetSuffix(int len) + { + char[] ret = new char[len]; + + if ((bufpos + 1) >= len) + System.arraycopy(buffer, bufpos - len + 1, ret, 0, len); + else + { + System.arraycopy(buffer, bufsize - (len - bufpos - 1), ret, 0, + len - bufpos - 1); + System.arraycopy(buffer, 0, ret, len - bufpos - 1, bufpos + 1); + } + + return ret; + } + + /** Set buffers back to null when finished. */ + public void Done() + { + nextCharBuf = null; + buffer = null; + bufline = null; + bufcolumn = null; + } + + /** + * Method to adjust line and column numbers for the start of a token. + */ + public void adjustBeginLineColumn(int newLine, int newCol) + { + int start = tokenBegin; + int len; + + if (bufpos >= tokenBegin) + { + len = bufpos - tokenBegin + inBuf + 1; + } + else + { + len = bufsize - tokenBegin + bufpos + 1 + inBuf; + } + + int i = 0, j = 0, k = 0; + int nextColDiff = 0, columnDiff = 0; + + while (i < len && bufline[j = start % bufsize] == bufline[k = ++start % bufsize]) + { + bufline[j] = newLine; + nextColDiff = columnDiff + bufcolumn[k] - bufcolumn[j]; + bufcolumn[j] = newCol + columnDiff; + columnDiff = nextColDiff; + i++; + } + + if (i < len) + { + bufline[j] = newLine++; + bufcolumn[j] = newCol + columnDiff; + + while (i++ < len) + { + if (bufline[j = start % bufsize] != bufline[++start % bufsize]) + bufline[j] = newLine++; + else + bufline[j] = newLine; + } + } + + line = bufline[j]; + column = bufcolumn[j]; + } + +} +/* JavaCC - OriginalChecksum=17a580b005f6229e8445521923427bab (do not edit this line) */ diff --git a/jdk/src/share/classes/com/sun/tools/example/debug/expr/LValue.java b/jdk/src/share/classes/com/sun/tools/example/debug/expr/LValue.java index 97794c567e4..e7f5f95bfc8 100644 --- a/jdk/src/share/classes/com/sun/tools/example/debug/expr/LValue.java +++ b/jdk/src/share/classes/com/sun/tools/example/debug/expr/LValue.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -740,7 +740,30 @@ abstract class LValue { } static LValue makeInteger(VirtualMachine vm, Token token) { - return make(vm, Integer.parseInt(token.image)); + String image = token.image; + + // Here we have to deal with the fact that an INTEGER_LITERAL + // can be DECIMAL_LITERAL, HEX_LITERAL or OCTAL_LITERAL. All of these + // can have an optional "L" or "l" at the end signifying that it is + // a long value. Otherwise, we treat values that are in range for an + // int as int and anything else as long. + + if (image.endsWith("L") || image.endsWith("l")) { + // This is a long without doubt - drop the final "Ll" and decode + image = image.substring(0, image.length() - 1); + return make(vm, Long.decode(image)); + } + + long longValue = Long.decode(image); + int intValue = (int) longValue; + if (intValue == longValue) { + // the value fits in an integer, lets return it as an integer + return make(vm, intValue); + } + else { + // otherwise treat it as a long + return make(vm, longValue); + } } static LValue makeShort(VirtualMachine vm, Token token) { @@ -1062,4 +1085,76 @@ abstract class LValue { return make(vm, res); } } + + static LValue operation(VirtualMachine vm, Token token, LValue rightL, + ExpressionParser.GetFrame frameGetter) + throws ParseException { + String op = token.image; + Value right = rightL.interiorGetValue(); + if (right instanceof ObjectReference) { + throw new ParseException("Invalid operation '" + op + + "' on an Object"); + } + if (right instanceof BooleanValue) { + if (op.equals("!")) { + boolean rr = ((BooleanValue) right).value(); + return make(vm, !rr); + } + throw new ParseException("Invalid operation '" + op + + "' on a Boolean"); + } + // from here on, we know it is a integer kind of type + PrimitiveValue primRight = (PrimitiveValue) right; + if (primRight instanceof DoubleValue) { + double rr = primRight.doubleValue(); + double res; + if (op.equals("+")) { + res = rr; + } else if (op.equals("-")) { + res = -rr; + } else { + throw new ParseException("Unknown operation: " + op); + } + return make(vm, res); + } + if (primRight instanceof FloatValue) { + float rr = primRight.floatValue(); + float res; + if (op.equals("+")) { + res = rr; + } else if (op.equals("-")) { + res = -rr; + } else { + throw new ParseException("Unknown operation: " + op); + } + return make(vm, res); + } + if (primRight instanceof LongValue) { + long rr = primRight.longValue(); + long res; + if (op.equals("+")) { + res = rr; + } else if (op.equals("-")) { + res = -rr; + } else if (op.equals("~")) { + res = ~rr; + } else { + throw new ParseException("Unknown operation: " + op); + } + return make(vm, res); + } else { + int rr = primRight.intValue(); + int res; + if (op.equals("+")) { + res = rr; + } else if (op.equals("-")) { + res = -rr; + } else if (op.equals("~")) { + res = ~rr; + } else { + throw new ParseException("Unknown operation: " + op); + } + return make(vm, res); + } + } } diff --git a/jdk/src/share/classes/com/sun/tools/example/debug/expr/ParseException.java b/jdk/src/share/classes/com/sun/tools/example/debug/expr/ParseException.java index 795b40c0011..6df5e4bafc6 100644 --- a/jdk/src/share/classes/com/sun/tools/example/debug/expr/ParseException.java +++ b/jdk/src/share/classes/com/sun/tools/example/debug/expr/ParseException.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,16 +23,8 @@ * questions. */ -/* - * This source code is provided to illustrate the usage of a given feature - * or technique and has been deliberately simplified. Additional steps - * required for a production-quality application, such as security checks, - * input validation and proper error handling, might not be present in - * this sample code. - */ - - -/* Generated By:JavaCC: Do not edit this line. ParseException.java Version 0.7pre6 */ +/* Generated By:JavaCC: Do not edit this line. ParseException.java Version 5.0 */ +/* JavaCCOptions:KEEP_LINE_COL=null */ package com.sun.tools.example.debug.expr; /** @@ -46,27 +38,25 @@ package com.sun.tools.example.debug.expr; */ public class ParseException extends Exception { - private static final long serialVersionUID = 7978489144303647901L; + /** + * The version identifier for this Serializable class. + * Increment only if the serialized form of the + * class changes. + */ + private static final long serialVersionUID = 1L; /** * This constructor is used by the method "generateParseException" * in the generated parser. Calling this constructor generates * a new object of this type with the fields "currentToken", - * "expectedTokenSequences", and "tokenImage" set. The boolean - * flag "specialConstructor" is also set to true to indicate that - * this constructor was used to create this object. - * This constructor calls its super class with the empty string - * to force the "toString" method of parent class "Throwable" to - * print the error message in the form: - * ParseException: + * "expectedTokenSequences", and "tokenImage" set. */ public ParseException(Token currentTokenVal, int[][] expectedTokenSequencesVal, String[] tokenImageVal ) { - super(""); - specialConstructor = true; + super(initialise(currentTokenVal, expectedTokenSequencesVal, tokenImageVal)); currentToken = currentTokenVal; expectedTokenSequences = expectedTokenSequencesVal; tokenImage = tokenImageVal; @@ -84,20 +74,13 @@ public class ParseException extends Exception { public ParseException() { super(); - specialConstructor = false; } + /** Constructor with message. */ public ParseException(String message) { super(message); - specialConstructor = false; } - /** - * This variable determines which constructor was used to create - * this object and thereby affects the semantics of the - * "getMessage" method (see below). - */ - protected boolean specialConstructor; /** * This is the last token that has been consumed successfully. If @@ -121,54 +104,52 @@ public class ParseException extends Exception { public String[] tokenImage; /** - * This method has the standard behavior when this object has been - * created using the standard constructors. Otherwise, it uses - * "currentToken" and "expectedTokenSequences" to generate a parse + * It uses "currentToken" and "expectedTokenSequences" to generate a parse * error message and returns it. If this object has been created * due to a parse error, and you do not catch it (it gets thrown - * from the parser), then this method is called during the printing - * of the final stack trace, and hence the correct error message + * from the parser) the correct error message * gets displayed. */ - @Override - public String getMessage() { - if (!specialConstructor) { - return super.getMessage(); - } - String expected = ""; + private static String initialise(Token currentToken, + int[][] expectedTokenSequences, + String[] tokenImage) { + String eol = System.getProperty("line.separator", "\n"); + StringBuffer expected = new StringBuffer(); int maxSize = 0; - for (int[] expectedTokenSequence : expectedTokenSequences) { - if (maxSize < expectedTokenSequence.length) { - maxSize = expectedTokenSequence.length; + for (int i = 0; i < expectedTokenSequences.length; i++) { + if (maxSize < expectedTokenSequences[i].length) { + maxSize = expectedTokenSequences[i].length; } - for (int j = 0; j < expectedTokenSequence.length; j++) { - expected += tokenImage[expectedTokenSequence[j]] + " "; + for (int j = 0; j < expectedTokenSequences[i].length; j++) { + expected.append(tokenImage[expectedTokenSequences[i][j]]).append(' '); } - if (expectedTokenSequence[expectedTokenSequence.length - 1] != 0) { - expected += "..."; + if (expectedTokenSequences[i][expectedTokenSequences[i].length - 1] != 0) { + expected.append("..."); } - expected += eol + " "; + expected.append(eol).append(" "); } String retval = "Encountered \""; Token tok = currentToken.next; for (int i = 0; i < maxSize; i++) { - if (i != 0) { - retval += " "; - } + if (i != 0) retval += " "; if (tok.kind == 0) { retval += tokenImage[0]; break; } + retval += " " + tokenImage[tok.kind]; + retval += " \""; retval += add_escapes(tok.image); + retval += " \""; tok = tok.next; } - retval += "\" at line " + currentToken.next.beginLine + ", column " + currentToken.next.beginColumn + "." + eol; + retval += "\" at line " + currentToken.next.beginLine + ", column " + currentToken.next.beginColumn; + retval += "." + eol; if (expectedTokenSequences.length == 1) { retval += "Was expecting:" + eol + " "; } else { retval += "Was expecting one of:" + eol + " "; } - retval += expected; + retval += expected.toString(); return retval; } @@ -182,7 +163,7 @@ public class ParseException extends Exception { * when these raw version cannot be used as part of an ASCII * string literal. */ - protected String add_escapes(String str) { + static String add_escapes(String str) { StringBuffer retval = new StringBuffer(); char ch; for (int i = 0; i < str.length(); i++) { @@ -228,3 +209,4 @@ public class ParseException extends Exception { } } +/* JavaCC - OriginalChecksum=3c9f049ed2bb6ade635c5bf58a386169 (do not edit this line) */ diff --git a/jdk/src/share/classes/com/sun/tools/example/debug/expr/Token.java b/jdk/src/share/classes/com/sun/tools/example/debug/expr/Token.java index a1c17bf3f3f..3bfd69506f8 100644 --- a/jdk/src/share/classes/com/sun/tools/example/debug/expr/Token.java +++ b/jdk/src/share/classes/com/sun/tools/example/debug/expr/Token.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,23 +23,22 @@ * questions. */ -/* - * This source code is provided to illustrate the usage of a given feature - * or technique and has been deliberately simplified. Additional steps - * required for a production-quality application, such as security checks, - * input validation and proper error handling, might not be present in - * this sample code. - */ - - -/* Generated By:JavaCC: Do not edit this line. Token.java Version 0.7pre3 */ +/* Generated By:JavaCC: Do not edit this line. Token.java Version 5.0 */ +/* JavaCCOptions:TOKEN_EXTENDS=,KEEP_LINE_COL=null,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */ package com.sun.tools.example.debug.expr; /** * Describes the input token stream. */ -public class Token { +public class Token implements java.io.Serializable { + + /** + * The version identifier for this Serializable class. + * Increment only if the serialized form of the + * class changes. + */ + private static final long serialVersionUID = 1L; /** * An integer that describes the kind of this token. This numbering @@ -48,12 +47,14 @@ public class Token { */ public int kind; - /** - * beginLine and beginColumn describe the position of the first character - * of this token; endLine and endColumn describe the position of the - * last character of this token. - */ - public int beginLine, beginColumn, endLine, endColumn; + /** The line number of the first character of this Token. */ + public int beginLine; + /** The column number of the first character of this Token. */ + public int beginColumn; + /** The line number of the last character of this Token. */ + public int endLine; + /** The column number of the last character of this Token. */ + public int endColumn; /** * The string image of the token. @@ -84,13 +85,46 @@ public class Token { */ public Token specialToken; + /** + * An optional attribute value of the Token. + * Tokens which are not used as syntactic sugar will often contain + * meaningful values that will be used later on by the compiler or + * interpreter. This attribute value is often different from the image. + * Any subclass of Token that actually wants to return a non-null value can + * override this method as appropriate. + */ + public Object getValue() { + return null; + } + + /** + * No-argument constructor + */ + public Token() {} + + /** + * Constructs a new token for the specified Image. + */ + public Token(int kind) + { + this(kind, null); + } + + /** + * Constructs a new token for the specified Image and Kind. + */ + public Token(int kind, String image) + { + this.kind = kind; + this.image = image; + } + /** * Returns the image. */ - @Override - public final String toString() + public String toString() { - return image; + return image; } /** @@ -98,19 +132,25 @@ public class Token { * can create and return subclass objects based on the value of ofKind. * Simply add the cases to the switch for all those special cases. * For example, if you have a subclass of Token called IDToken that - * you want to create if ofKind is ID, simlpy add something like : + * you want to create if ofKind is ID, simply add something like : * - * case MyParserConstants.ID : return new IDToken(); + * case MyParserConstants.ID : return new IDToken(ofKind, image); * * to the following switch statement. Then you can cast matchedToken - * variable to the appropriate type and use it in your lexical actions. + * variable to the appropriate type and use sit in your lexical actions. */ - public static final Token newToken(int ofKind) + public static Token newToken(int ofKind, String image) { - switch(ofKind) - { - default : return new Token(); - } + switch(ofKind) + { + default : return new Token(ofKind, image); + } + } + + public static Token newToken(int ofKind) + { + return newToken(ofKind, null); } } +/* JavaCC - OriginalChecksum=1f1783cae2d4cc94bc225889842dfa8b (do not edit this line) */ diff --git a/jdk/src/share/classes/com/sun/tools/example/debug/expr/TokenMgrError.java b/jdk/src/share/classes/com/sun/tools/example/debug/expr/TokenMgrError.java index 1ab2a5be894..5bc49c343a6 100644 --- a/jdk/src/share/classes/com/sun/tools/example/debug/expr/TokenMgrError.java +++ b/jdk/src/share/classes/com/sun/tools/example/debug/expr/TokenMgrError.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,148 +23,150 @@ * questions. */ -/* - * This source code is provided to illustrate the usage of a given feature - * or technique and has been deliberately simplified. Additional steps - * required for a production-quality application, such as security checks, - * input validation and proper error handling, might not be present in - * this sample code. - */ - - -/* Generated By:JavaCC: Do not edit this line. TokenMgrError.java Version 0.7pre2 */ +/* Generated By:JavaCC: Do not edit this line. TokenMgrError.java Version 5.0 */ +/* JavaCCOptions: */ package com.sun.tools.example.debug.expr; +/** Token Manager Error. */ public class TokenMgrError extends Error { - /* - * Ordinals for various reasons why an Error of this type can be thrown. - */ - private static final long serialVersionUID = -6236440836177601522L; + /** + * The version identifier for this Serializable class. + * Increment only if the serialized form of the + * class changes. + */ + private static final long serialVersionUID = 1L; - /** - * Lexical error occurred. - */ - static final int LEXICAL_ERROR = 0; + /* + * Ordinals for various reasons why an Error of this type can be thrown. + */ - /** - * An attempt wass made to create a second instance of a static token manager. - */ - static final int STATIC_LEXER_ERROR = 1; + /** + * Lexical error occurred. + */ + static final int LEXICAL_ERROR = 0; - /** - * Tried to change to an invalid lexical state. - */ - static final int INVALID_LEXICAL_STATE = 2; + /** + * An attempt was made to create a second instance of a static token manager. + */ + static final int STATIC_LEXER_ERROR = 1; - /** - * Detected (and bailed out of) an infinite loop in the token manager. - */ - static final int LOOP_DETECTED = 3; + /** + * Tried to change to an invalid lexical state. + */ + static final int INVALID_LEXICAL_STATE = 2; - /** - * Indicates the reason why the exception is thrown. It will have - * one of the above 4 values. - */ - int errorCode; + /** + * Detected (and bailed out of) an infinite loop in the token manager. + */ + static final int LOOP_DETECTED = 3; - /** - * Replaces unprintable characters by their espaced (or unicode escaped) - * equivalents in the given string - */ - protected static final String addEscapes(String str) { - StringBuffer retval = new StringBuffer(); - char ch; - for (int i = 0; i < str.length(); i++) { - switch (str.charAt(i)) - { - case 0 : - continue; - case '\b': - retval.append("\\b"); - continue; - case '\t': - retval.append("\\t"); - continue; - case '\n': - retval.append("\\n"); - continue; - case '\f': - retval.append("\\f"); - continue; - case '\r': - retval.append("\\r"); - continue; - case '\"': - retval.append("\\\""); - continue; - case '\'': - retval.append("\\\'"); - continue; - case '\\': - retval.append("\\\\"); - continue; - default: - if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) { - String s = "0000" + Integer.toString(ch, 16); - retval.append("\\u" + s.substring(s.length() - 4, s.length())); - } else { - retval.append(ch); - } - continue; - } + /** + * Indicates the reason why the exception is thrown. It will have + * one of the above 4 values. + */ + int errorCode; + + /** + * Replaces unprintable characters by their escaped (or unicode escaped) + * equivalents in the given string + */ + protected static final String addEscapes(String str) { + StringBuffer retval = new StringBuffer(); + char ch; + for (int i = 0; i < str.length(); i++) { + switch (str.charAt(i)) + { + case 0 : + continue; + case '\b': + retval.append("\\b"); + continue; + case '\t': + retval.append("\\t"); + continue; + case '\n': + retval.append("\\n"); + continue; + case '\f': + retval.append("\\f"); + continue; + case '\r': + retval.append("\\r"); + continue; + case '\"': + retval.append("\\\""); + continue; + case '\'': + retval.append("\\\'"); + continue; + case '\\': + retval.append("\\\\"); + continue; + default: + if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) { + String s = "0000" + Integer.toString(ch, 16); + retval.append("\\u" + s.substring(s.length() - 4, s.length())); + } else { + retval.append(ch); + } + continue; } - return retval.toString(); - } + } + return retval.toString(); + } - /** - * Returns a detailed message for the Error when it is thrown by the - * token manager to indicate a lexical error. - * Parameters : - * EOFSeen : indicates if EOF caused the lexicl error - * curLexState : lexical state in which this error occurred - * errorLine : line number when the error occurred - * errorColumn : column number when the error occurred - * errorAfter : prefix that was seen before this error occurred - * curchar : the offending character - * Note: You can customize the lexical error message by modifying this method. - */ - private static final String LexicalError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, char curChar) { - return("Lexical error at line " + - errorLine + ", column " + - errorColumn + ". Encountered: " + - (EOFSeen ? " " : ("\"" + addEscapes(String.valueOf(curChar)) + "\"") + " (" + (int)curChar + "), ") + - "after : \"" + addEscapes(errorAfter) + "\""); - } + /** + * Returns a detailed message for the Error when it is thrown by the + * token manager to indicate a lexical error. + * Parameters : + * EOFSeen : indicates if EOF caused the lexical error + * curLexState : lexical state in which this error occurred + * errorLine : line number when the error occurred + * errorColumn : column number when the error occurred + * errorAfter : prefix that was seen before this error occurred + * curchar : the offending character + * Note: You can customize the lexical error message by modifying this method. + */ + protected static String LexicalError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, char curChar) { + return("Lexical error at line " + + errorLine + ", column " + + errorColumn + ". Encountered: " + + (EOFSeen ? " " : ("\"" + addEscapes(String.valueOf(curChar)) + "\"") + " (" + (int)curChar + "), ") + + "after : \"" + addEscapes(errorAfter) + "\""); + } - /** - * You can also modify the body of this method to customize your error messages. - * For example, cases like LOOP_DETECTED and INVALID_LEXICAL_STATE are not - * of end-users concern, so you can return something like : - * - * "Internal Error : Please file a bug report .... " - * - * from this method for such cases in the release version of your parser. - */ - @Override - public String getMessage() { - return super.getMessage(); - } + /** + * You can also modify the body of this method to customize your error messages. + * For example, cases like LOOP_DETECTED and INVALID_LEXICAL_STATE are not + * of end-users concern, so you can return something like : + * + * "Internal Error : Please file a bug report .... " + * + * from this method for such cases in the release version of your parser. + */ + public String getMessage() { + return super.getMessage(); + } - /* - * Constructors of various flavors follow. - */ + /* + * Constructors of various flavors follow. + */ - public TokenMgrError() { - } + /** No arg constructor. */ + public TokenMgrError() { + } - public TokenMgrError(String message, int reason) { - super(message); - errorCode = reason; - } + /** Constructor with message and reason. */ + public TokenMgrError(String message, int reason) { + super(message); + errorCode = reason; + } - public TokenMgrError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, char curChar, int reason) { - this(LexicalError(EOFSeen, lexState, errorLine, errorColumn, errorAfter, curChar), reason); - } + /** Full Constructor. */ + public TokenMgrError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, char curChar, int reason) { + this(LexicalError(EOFSeen, lexState, errorLine, errorColumn, errorAfter, curChar), reason); + } } +/* JavaCC - OriginalChecksum=9b5d040f247411cad7f77688386c48e7 (do not edit this line) */ diff --git a/jdk/test/com/sun/jdi/JdbExprTest.sh b/jdk/test/com/sun/jdi/JdbExprTest.sh new file mode 100644 index 00000000000..e60b51b7acb --- /dev/null +++ b/jdk/test/com/sun/jdi/JdbExprTest.sh @@ -0,0 +1,158 @@ +#!/bin/sh + +# +# Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# 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 4660158 +# @author Staffan Larsen +# @run shell JdbExprTest.sh + +# These are variables that can be set to control execution + +#pkg=untitled7 +classname=JdbExprTest +compileOptions=-g +#java="java_g" +#set -x + +createJavaFile() +{ + cat < $classname.java.1 +import java.util.*; +import java.net.URLClassLoader; +import java.net.URL; + +class $classname { + + static long aLong; + static int anInt; + static boolean aBoolean; + + public static void bkpt() { + int i = 0; //@1 breakpoint + } + + public static void main(String[] args) { + bkpt(); + } +} +EOF +} + + +# drive jdb by sending cmds to it and examining its output +dojdbCmds() +{ + setBkpts @1 + runToBkpt @1 + + cmd print java.lang.Long.MAX_VALUE + jdbFailIfNotPresent " \= 9223372036854775807" 3 + + cmd print java.lang.Long.MIN_VALUE + jdbFailIfNotPresent " \= \-9223372036854775808" 3 + + cmd print 9223372036854775807L + jdbFailIfNotPresent "9223372036854775807L = 9223372036854775807" 3 + cmd print 9223372036854775807 + jdbFailIfNotPresent "9223372036854775807 = 9223372036854775807" 3 + + cmd print -9223372036854775807L + jdbFailIfNotPresent "\-9223372036854775807L = \-9223372036854775807" 3 + cmd print -9223372036854775807 + jdbFailIfNotPresent "\-9223372036854775807 = \-9223372036854775807" 3 + + cmd print -1 + jdbFailIfNotPresent "\-1 = \-1" 3 + cmd print 1L + jdbFailIfNotPresent "1L = 1" 3 + cmd print -1L + jdbFailIfNotPresent "\-1L = \-1" 3 + cmd print 0x1 + jdbFailIfNotPresent "0x1 = 1" 3 + + cmd set $classname.aLong = 9223372036854775807L + cmd print $classname.aLong + jdbFailIfNotPresent "$classname.aLong = 9223372036854775807" 3 + + cmd set $classname.anInt = java.lang.Integer.MAX_VALUE + 1 + cmd print $classname.anInt + jdbFailIfNotPresent "$classname.anInt = \-2147483648" 3 + + cmd set $classname.aLong = java.lang.Integer.MAX_VALUE + 1L + cmd print $classname.aLong + jdbFailIfNotPresent "$classname.aLong = 2147483648" 3 + + cmd set $classname.anInt = 0x80000000 + jdbFailIfNotPresent "Can\'t convert 2147483648 to int" 3 + cmd set $classname.anInt = 0x8000000000000000L + jdbFailIfNotPresent "java.lang.NumberFormatException: For input string: \"8000000000000000\"" 3 + + cmd set $classname.anInt = 0x7fffffff + jdbFailIfNotPresent "0x7fffffff = 2147483647" 3 + cmd set $classname.aLong = 0x7fffffffffffffff + jdbFailIfNotPresent "0x7fffffffffffffff = 9223372036854775807" 3 + + cmd print 3.1415 + jdbFailIfNotPresent "3.1415 = 3.1415" 3 + cmd print -3.1415 + jdbFailIfNotPresent "\-3.1415 = \-3.1415" 3 + cmd print 011 + jdbFailIfNotPresent "011 = 9" 3 + + cmd set $classname.aBoolean = false + jdbFailIfNotPresent "JdbExprTest.aBoolean = false = false" 3 + cmd print $classname.aBoolean + jdbFailIfNotPresent "JdbExprTest.aBoolean = false" 3 + cmd print !$classname.aBoolean + jdbFailIfNotPresent "JdbExprTest.aBoolean = true" 3 + + cmd print ~1 + jdbFailIfNotPresent "~1 = -2" 3 + + cmd quit +} + + +mysetup() +{ + if [ -z "$TESTSRC" ] ; then + TESTSRC=. + fi + + for ii in . $TESTSRC $TESTSRC/.. ; do + if [ -r "$ii/ShellScaffold.sh" ] ; then + . $ii/ShellScaffold.sh + break + fi + done +} + +# You could replace this next line with the contents +# of ShellScaffold.sh and this script will run just the same. +mysetup + +runit +jdbFailIfNotPresent "Breakpoint hit" +pass From 4799040e87ad97963e8d089d4338d429b1f7b0d1 Mon Sep 17 00:00:00 2001 From: Staffan Larsen Date: Mon, 16 Dec 2013 15:38:31 +0100 Subject: [PATCH 136/377] 8030204: com/sun/jdi/JdbExprTest.sh: Required output "Can\\'t convert 2147483648 to int" not found Reviewed-by: alanb --- jdk/test/com/sun/jdi/JdbExprTest.sh | 116 ++++++++++++++-------------- 1 file changed, 58 insertions(+), 58 deletions(-) diff --git a/jdk/test/com/sun/jdi/JdbExprTest.sh b/jdk/test/com/sun/jdi/JdbExprTest.sh index e60b51b7acb..9645714dc08 100644 --- a/jdk/test/com/sun/jdi/JdbExprTest.sh +++ b/jdk/test/com/sun/jdi/JdbExprTest.sh @@ -45,9 +45,9 @@ import java.net.URL; class $classname { - static long aLong; - static int anInt; - static boolean aBoolean; + static long aLong; + static int anInt; + static boolean aBoolean; public static void bkpt() { int i = 0; //@1 breakpoint @@ -67,70 +67,70 @@ dojdbCmds() setBkpts @1 runToBkpt @1 - cmd print java.lang.Long.MAX_VALUE - jdbFailIfNotPresent " \= 9223372036854775807" 3 + cmd print java.lang.Long.MAX_VALUE + jdbFailIfNotPresent " \= 9223372036854775807" 3 - cmd print java.lang.Long.MIN_VALUE - jdbFailIfNotPresent " \= \-9223372036854775808" 3 - - cmd print 9223372036854775807L - jdbFailIfNotPresent "9223372036854775807L = 9223372036854775807" 3 - cmd print 9223372036854775807 - jdbFailIfNotPresent "9223372036854775807 = 9223372036854775807" 3 + cmd print java.lang.Long.MIN_VALUE + jdbFailIfNotPresent " \= \-9223372036854775808" 3 + + cmd print 9223372036854775807L + jdbFailIfNotPresent "9223372036854775807L = 9223372036854775807" 3 + cmd print 9223372036854775807 + jdbFailIfNotPresent "9223372036854775807 = 9223372036854775807" 3 - cmd print -9223372036854775807L - jdbFailIfNotPresent "\-9223372036854775807L = \-9223372036854775807" 3 - cmd print -9223372036854775807 - jdbFailIfNotPresent "\-9223372036854775807 = \-9223372036854775807" 3 - - cmd print -1 - jdbFailIfNotPresent "\-1 = \-1" 3 - cmd print 1L - jdbFailIfNotPresent "1L = 1" 3 - cmd print -1L - jdbFailIfNotPresent "\-1L = \-1" 3 - cmd print 0x1 - jdbFailIfNotPresent "0x1 = 1" 3 - - cmd set $classname.aLong = 9223372036854775807L - cmd print $classname.aLong - jdbFailIfNotPresent "$classname.aLong = 9223372036854775807" 3 + cmd print -9223372036854775807L + jdbFailIfNotPresent "\-9223372036854775807L = \-9223372036854775807" 3 + cmd print -9223372036854775807 + jdbFailIfNotPresent "\-9223372036854775807 = \-9223372036854775807" 3 + + cmd print -1 + jdbFailIfNotPresent "\-1 = \-1" 3 + cmd print 1L + jdbFailIfNotPresent "1L = 1" 3 + cmd print -1L + jdbFailIfNotPresent "\-1L = \-1" 3 + cmd print 0x1 + jdbFailIfNotPresent "0x1 = 1" 3 + + cmd set $classname.aLong = 9223372036854775807L + cmd print $classname.aLong + jdbFailIfNotPresent "$classname.aLong = 9223372036854775807" 3 - cmd set $classname.anInt = java.lang.Integer.MAX_VALUE + 1 - cmd print $classname.anInt - jdbFailIfNotPresent "$classname.anInt = \-2147483648" 3 + cmd set $classname.anInt = java.lang.Integer.MAX_VALUE + 1 + cmd print $classname.anInt + jdbFailIfNotPresent "$classname.anInt = \-2147483648" 3 - cmd set $classname.aLong = java.lang.Integer.MAX_VALUE + 1L - cmd print $classname.aLong - jdbFailIfNotPresent "$classname.aLong = 2147483648" 3 + cmd set $classname.aLong = java.lang.Integer.MAX_VALUE + 1L + cmd print $classname.aLong + jdbFailIfNotPresent "$classname.aLong = 2147483648" 3 - cmd set $classname.anInt = 0x80000000 - jdbFailIfNotPresent "Can\'t convert 2147483648 to int" 3 - cmd set $classname.anInt = 0x8000000000000000L - jdbFailIfNotPresent "java.lang.NumberFormatException: For input string: \"8000000000000000\"" 3 + cmd set $classname.anInt = 0x80000000 + jdbFailIfNotPresent "InvalidTypeException: .* convert 2147483648 to int" 3 + cmd set $classname.anInt = 0x8000000000000000L + jdbFailIfNotPresent "java.lang.NumberFormatException: For input string: \"8000000000000000\"" 3 - cmd set $classname.anInt = 0x7fffffff - jdbFailIfNotPresent "0x7fffffff = 2147483647" 3 - cmd set $classname.aLong = 0x7fffffffffffffff - jdbFailIfNotPresent "0x7fffffffffffffff = 9223372036854775807" 3 + cmd set $classname.anInt = 0x7fffffff + jdbFailIfNotPresent "0x7fffffff = 2147483647" 3 + cmd set $classname.aLong = 0x7fffffffffffffff + jdbFailIfNotPresent "0x7fffffffffffffff = 9223372036854775807" 3 - cmd print 3.1415 - jdbFailIfNotPresent "3.1415 = 3.1415" 3 - cmd print -3.1415 - jdbFailIfNotPresent "\-3.1415 = \-3.1415" 3 - cmd print 011 - jdbFailIfNotPresent "011 = 9" 3 + cmd print 3.1415 + jdbFailIfNotPresent "3.1415 = 3.1415" 3 + cmd print -3.1415 + jdbFailIfNotPresent "\-3.1415 = \-3.1415" 3 + cmd print 011 + jdbFailIfNotPresent "011 = 9" 3 - cmd set $classname.aBoolean = false - jdbFailIfNotPresent "JdbExprTest.aBoolean = false = false" 3 - cmd print $classname.aBoolean - jdbFailIfNotPresent "JdbExprTest.aBoolean = false" 3 - cmd print !$classname.aBoolean - jdbFailIfNotPresent "JdbExprTest.aBoolean = true" 3 + cmd set $classname.aBoolean = false + jdbFailIfNotPresent "JdbExprTest.aBoolean = false = false" 3 + cmd print $classname.aBoolean + jdbFailIfNotPresent "JdbExprTest.aBoolean = false" 3 + cmd print !$classname.aBoolean + jdbFailIfNotPresent "JdbExprTest.aBoolean = true" 3 - cmd print ~1 - jdbFailIfNotPresent "~1 = -2" 3 - + cmd print ~1 + jdbFailIfNotPresent "~1 = -2" 3 + cmd quit } From 76a5534d5bfa5af4224e0408d0788195a3d69f68 Mon Sep 17 00:00:00 2001 From: Alan Bateman Date: Mon, 16 Dec 2013 15:05:26 +0000 Subject: [PATCH 137/377] 8029904: Remove com.sun.security.auth.callback.DialogCallbackHandler Reviewed-by: mullan --- jdk/make/profile-rtjar-includes.txt | 14 +- .../auth/callback/DialogCallbackHandler.java | 319 ------------------ .../DialogCallbackHandler/Default.java | 61 ---- .../security/sasl/digest/NoQuoteParams.java | 2 - .../sun/security/pkcs11/Provider/Login.java | 2 - 5 files changed, 2 insertions(+), 396 deletions(-) delete mode 100644 jdk/src/share/classes/com/sun/security/auth/callback/DialogCallbackHandler.java delete mode 100644 jdk/test/com/sun/security/auth/callback/DialogCallbackHandler/Default.java diff --git a/jdk/make/profile-rtjar-includes.txt b/jdk/make/profile-rtjar-includes.txt index 3f0934cf428..231b1583ae0 100644 --- a/jdk/make/profile-rtjar-includes.txt +++ b/jdk/make/profile-rtjar-includes.txt @@ -26,8 +26,8 @@ # Included or excluded types must take one of two forms # - *.class to indicate all classes; or else # - a full single type name e.g. -# com/sun/security/auth/callback/DialogCallbackHandler$$1.class -# You can not use arbitrary wildcards like DialogCallbackHandler*.class. +# javax/management/remote/rmi/_RMIServer_Stub.class +# You can not use arbitrary wildcards like _RMI*.class. # # Notes: # - Nested types must use $$ in place of $ as $ is the make meta-character @@ -149,11 +149,6 @@ PROFILE_3_RTJAR_INCLUDE_PACKAGES := \ PROFILE_3_RTJAR_INCLUDE_TYPES := PROFILE_3_RTJAR_EXCLUDE_TYPES := \ - com/sun/security/auth/callback/DialogCallbackHandler$$1.class \ - com/sun/security/auth/callback/DialogCallbackHandler$$2.class \ - com/sun/security/auth/callback/DialogCallbackHandler$$Action.class \ - com/sun/security/auth/callback/DialogCallbackHandler$$ConfirmationInfo.class \ - com/sun/security/auth/callback/DialogCallbackHandler.class \ javax/management/remote/rmi/_RMIConnectionImpl_Tie.class \ javax/management/remote/rmi/_RMIConnection_Stub.class \ javax/management/remote/rmi/_RMIServerImpl_Tie.class \ @@ -225,11 +220,6 @@ FULL_JRE_RTJAR_INCLUDE_PACKAGES := \ sun/tools/jar FULL_JRE_RTJAR_INCLUDE_TYPES := \ - com/sun/security/auth/callback/DialogCallbackHandler$$1.class \ - com/sun/security/auth/callback/DialogCallbackHandler$$2.class \ - com/sun/security/auth/callback/DialogCallbackHandler$$Action.class \ - com/sun/security/auth/callback/DialogCallbackHandler$$ConfirmationInfo.class \ - com/sun/security/auth/callback/DialogCallbackHandler.class \ javax/annotation/*.class \ javax/management/remote/rmi/_RMIConnectionImpl_Tie.class \ javax/management/remote/rmi/_RMIConnection_Stub.class \ diff --git a/jdk/src/share/classes/com/sun/security/auth/callback/DialogCallbackHandler.java b/jdk/src/share/classes/com/sun/security/auth/callback/DialogCallbackHandler.java deleted file mode 100644 index a68ad5db678..00000000000 --- a/jdk/src/share/classes/com/sun/security/auth/callback/DialogCallbackHandler.java +++ /dev/null @@ -1,319 +0,0 @@ -/* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.security.auth.callback; - -/* JAAS imports */ -import javax.security.auth.callback.Callback; -import javax.security.auth.callback.CallbackHandler; -import javax.security.auth.callback.ConfirmationCallback; -import javax.security.auth.callback.NameCallback; -import javax.security.auth.callback.PasswordCallback; -import javax.security.auth.callback.TextOutputCallback; -import javax.security.auth.callback.UnsupportedCallbackException; - -/* Java imports */ -import java.awt.Component; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; -import javax.swing.Box; -import javax.swing.JLabel; -import javax.swing.JOptionPane; -import javax.swing.JPasswordField; -import javax.swing.JTextField; - -/** - *

- * Uses a Swing dialog window to query the user for answers to - * authentication questions. - * This can be used by a JAAS application to instantiate a - * CallbackHandler - * @see javax.security.auth.callback - * @deprecated This class will be removed in a future release. - */ -@jdk.Exported(false) -@Deprecated -public class DialogCallbackHandler implements CallbackHandler { - - /* -- Fields -- */ - - /* The parent window, or null if using the default parent */ - private Component parentComponent; - private static final int JPasswordFieldLen = 8 ; - private static final int JTextFieldLen = 8 ; - - /* -- Methods -- */ - - /** - * Creates a callback dialog with the default parent window. - */ - public DialogCallbackHandler() { } - - /** - * Creates a callback dialog and specify the parent window. - * - * @param parentComponent the parent window -- specify null - * for the default parent - */ - public DialogCallbackHandler(Component parentComponent) { - this.parentComponent = parentComponent; - } - - /* - * An interface for recording actions to carry out if the user - * clicks OK for the dialog. - */ - private static interface Action { - void perform(); - } - - /** - * Handles the specified set of callbacks. - * - * @param callbacks the callbacks to handle - * @throws UnsupportedCallbackException if the callback is not an - * instance of NameCallback or PasswordCallback - */ - - public void handle(Callback[] callbacks) - throws UnsupportedCallbackException - { - /* Collect messages to display in the dialog */ - final List messages = new ArrayList<>(3); - - /* Collection actions to perform if the user clicks OK */ - final List okActions = new ArrayList<>(2); - - ConfirmationInfo confirmation = new ConfirmationInfo(); - - for (int i = 0; i < callbacks.length; i++) { - if (callbacks[i] instanceof TextOutputCallback) { - TextOutputCallback tc = (TextOutputCallback) callbacks[i]; - - switch (tc.getMessageType()) { - case TextOutputCallback.INFORMATION: - confirmation.messageType = JOptionPane.INFORMATION_MESSAGE; - break; - case TextOutputCallback.WARNING: - confirmation.messageType = JOptionPane.WARNING_MESSAGE; - break; - case TextOutputCallback.ERROR: - confirmation.messageType = JOptionPane.ERROR_MESSAGE; - break; - default: - throw new UnsupportedCallbackException( - callbacks[i], "Unrecognized message type"); - } - - messages.add(tc.getMessage()); - - } else if (callbacks[i] instanceof NameCallback) { - final NameCallback nc = (NameCallback) callbacks[i]; - - JLabel prompt = new JLabel(nc.getPrompt()); - - final JTextField name = new JTextField(JTextFieldLen); - String defaultName = nc.getDefaultName(); - if (defaultName != null) { - name.setText(defaultName); - } - - /* - * Put the prompt and name in a horizontal box, - * and add that to the set of messages. - */ - Box namePanel = Box.createHorizontalBox(); - namePanel.add(prompt); - namePanel.add(name); - messages.add(namePanel); - - /* Store the name back into the callback if OK */ - okActions.add(new Action() { - public void perform() { - nc.setName(name.getText()); - } - }); - - } else if (callbacks[i] instanceof PasswordCallback) { - final PasswordCallback pc = (PasswordCallback) callbacks[i]; - - JLabel prompt = new JLabel(pc.getPrompt()); - - final JPasswordField password = - new JPasswordField(JPasswordFieldLen); - if (!pc.isEchoOn()) { - password.setEchoChar('*'); - } - - Box passwordPanel = Box.createHorizontalBox(); - passwordPanel.add(prompt); - passwordPanel.add(password); - messages.add(passwordPanel); - - okActions.add(new Action() { - public void perform() { - pc.setPassword(password.getPassword()); - } - }); - - } else if (callbacks[i] instanceof ConfirmationCallback) { - ConfirmationCallback cc = (ConfirmationCallback)callbacks[i]; - - confirmation.setCallback(cc); - if (cc.getPrompt() != null) { - messages.add(cc.getPrompt()); - } - - } else { - throw new UnsupportedCallbackException( - callbacks[i], "Unrecognized Callback"); - } - } - - /* Display the dialog */ - int result = JOptionPane.showOptionDialog( - parentComponent, - messages.toArray(), - "Confirmation", /* title */ - confirmation.optionType, - confirmation.messageType, - null, /* icon */ - confirmation.options, /* options */ - confirmation.initialValue); /* initialValue */ - - /* Perform the OK actions */ - if (result == JOptionPane.OK_OPTION - || result == JOptionPane.YES_OPTION) - { - Iterator iterator = okActions.iterator(); - while (iterator.hasNext()) { - iterator.next().perform(); - } - } - confirmation.handleResult(result); - } - - /* - * Provides assistance with translating between JAAS and Swing - * confirmation dialogs. - */ - private static class ConfirmationInfo { - - private int[] translations; - - int optionType = JOptionPane.OK_CANCEL_OPTION; - Object[] options = null; - Object initialValue = null; - - int messageType = JOptionPane.QUESTION_MESSAGE; - - private ConfirmationCallback callback; - - /* Set the confirmation callback handler */ - void setCallback(ConfirmationCallback callback) - throws UnsupportedCallbackException - { - this.callback = callback; - - int confirmationOptionType = callback.getOptionType(); - switch (confirmationOptionType) { - case ConfirmationCallback.YES_NO_OPTION: - optionType = JOptionPane.YES_NO_OPTION; - translations = new int[] { - JOptionPane.YES_OPTION, ConfirmationCallback.YES, - JOptionPane.NO_OPTION, ConfirmationCallback.NO, - JOptionPane.CLOSED_OPTION, ConfirmationCallback.NO - }; - break; - case ConfirmationCallback.YES_NO_CANCEL_OPTION: - optionType = JOptionPane.YES_NO_CANCEL_OPTION; - translations = new int[] { - JOptionPane.YES_OPTION, ConfirmationCallback.YES, - JOptionPane.NO_OPTION, ConfirmationCallback.NO, - JOptionPane.CANCEL_OPTION, ConfirmationCallback.CANCEL, - JOptionPane.CLOSED_OPTION, ConfirmationCallback.CANCEL - }; - break; - case ConfirmationCallback.OK_CANCEL_OPTION: - optionType = JOptionPane.OK_CANCEL_OPTION; - translations = new int[] { - JOptionPane.OK_OPTION, ConfirmationCallback.OK, - JOptionPane.CANCEL_OPTION, ConfirmationCallback.CANCEL, - JOptionPane.CLOSED_OPTION, ConfirmationCallback.CANCEL - }; - break; - case ConfirmationCallback.UNSPECIFIED_OPTION: - options = callback.getOptions(); - /* - * There's no way to know if the default option means - * to cancel the login, but there isn't a better way - * to guess this. - */ - translations = new int[] { - JOptionPane.CLOSED_OPTION, callback.getDefaultOption() - }; - break; - default: - throw new UnsupportedCallbackException( - callback, - "Unrecognized option type: " + confirmationOptionType); - } - - int confirmationMessageType = callback.getMessageType(); - switch (confirmationMessageType) { - case ConfirmationCallback.WARNING: - messageType = JOptionPane.WARNING_MESSAGE; - break; - case ConfirmationCallback.ERROR: - messageType = JOptionPane.ERROR_MESSAGE; - break; - case ConfirmationCallback.INFORMATION: - messageType = JOptionPane.INFORMATION_MESSAGE; - break; - default: - throw new UnsupportedCallbackException( - callback, - "Unrecognized message type: " + confirmationMessageType); - } - } - - - /* Process the result returned by the Swing dialog */ - void handleResult(int result) { - if (callback == null) { - return; - } - - for (int i = 0; i < translations.length; i += 2) { - if (translations[i] == result) { - result = translations[i + 1]; - break; - } - } - callback.setSelectedIndex(result); - } - } -} diff --git a/jdk/test/com/sun/security/auth/callback/DialogCallbackHandler/Default.java b/jdk/test/com/sun/security/auth/callback/DialogCallbackHandler/Default.java deleted file mode 100644 index 89eed615d2a..00000000000 --- a/jdk/test/com/sun/security/auth/callback/DialogCallbackHandler/Default.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved. - * 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 4470717 - * @summary fix default handling and other misc - * - * @ignore run these by hand - */ - -import com.sun.security.auth.callback.DialogCallbackHandler; -import javax.security.auth.callback.*; - -public class Default { - public static void main(String args[]) throws Exception { - DialogCallbackHandler h = new DialogCallbackHandler(); - TextOutputCallback toc = new TextOutputCallback - (TextOutputCallback.INFORMATION, - "hello"); - TextOutputCallback toc2 = new TextOutputCallback - (TextOutputCallback.INFORMATION, - "world"); - ConfirmationCallback cc = new ConfirmationCallback - ("Correct?", - ConfirmationCallback.INFORMATION, - ConfirmationCallback.YES_NO_OPTION, - ConfirmationCallback.NO); - - Callback[] callbacks = { toc, toc2, cc }; - h.handle(callbacks); - - if (cc.getSelectedIndex() == ConfirmationCallback.YES) { - System.out.println("yes"); - } else { - System.out.println("no"); - } - - System.exit(0); - } -} diff --git a/jdk/test/com/sun/security/sasl/digest/NoQuoteParams.java b/jdk/test/com/sun/security/sasl/digest/NoQuoteParams.java index f8e40204f24..11184674a9c 100644 --- a/jdk/test/com/sun/security/sasl/digest/NoQuoteParams.java +++ b/jdk/test/com/sun/security/sasl/digest/NoQuoteParams.java @@ -43,8 +43,6 @@ import javax.security.sasl.SaslClient; import javax.security.sasl.SaslException; import javax.security.sasl.SaslServer; import javax.security.auth.callback.CallbackHandler; -import com.sun.security.auth.callback.DialogCallbackHandler; -import com.sun.security.auth.callback.TextCallbackHandler; /* * According to RFC 2831, DIGEST-MD5 servers must generate challenge strings diff --git a/jdk/test/sun/security/pkcs11/Provider/Login.java b/jdk/test/sun/security/pkcs11/Provider/Login.java index fcba180b436..282c19b5367 100644 --- a/jdk/test/sun/security/pkcs11/Provider/Login.java +++ b/jdk/test/sun/security/pkcs11/Provider/Login.java @@ -87,8 +87,6 @@ public class Login extends PKCS11Test { password = new char[] { 't', 'e', 's', 't', '1', '2' }; Security.setProperty("auth.login.defaultCallbackHandler", ""); - ap.setCallbackHandler - (new com.sun.security.auth.callback.DialogCallbackHandler()); ap.setCallbackHandler(new PasswordCallbackHandler()); ap.login(new Subject(), null); System.out.println("test " + testnum++ + " passed"); From aee59cb1010215831f7ae66d4277dc1425d2197c Mon Sep 17 00:00:00 2001 From: Alan Bateman Date: Mon, 16 Dec 2013 19:52:55 +0000 Subject: [PATCH 138/377] 6706208: (cs) CharsetProvider permission check cleanup Reviewed-by: chegar, mchung --- .../java/nio/channels/spi/SelectorProvider.java | 12 +++++++++--- .../java/nio/charset/spi/CharsetProvider.java | 12 +++++++++--- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/jdk/src/share/classes/java/nio/channels/spi/SelectorProvider.java b/jdk/src/share/classes/java/nio/channels/spi/SelectorProvider.java index 8d74b43cf64..e90ff3de3c2 100644 --- a/jdk/src/share/classes/java/nio/channels/spi/SelectorProvider.java +++ b/jdk/src/share/classes/java/nio/channels/spi/SelectorProvider.java @@ -71,6 +71,14 @@ public abstract class SelectorProvider { private static final Object lock = new Object(); private static SelectorProvider provider = null; + private static Void checkPermission() { + SecurityManager sm = System.getSecurityManager(); + if (sm != null) + sm.checkPermission(new RuntimePermission("selectorProvider")); + return null; + } + private SelectorProvider(Void ignore) { } + /** * Initializes a new instance of this class. * @@ -79,9 +87,7 @@ public abstract class SelectorProvider { * {@link RuntimePermission}("selectorProvider") */ protected SelectorProvider() { - SecurityManager sm = System.getSecurityManager(); - if (sm != null) - sm.checkPermission(new RuntimePermission("selectorProvider")); + this(checkPermission()); } private static boolean loadProviderFromProperty() { diff --git a/jdk/src/share/classes/java/nio/charset/spi/CharsetProvider.java b/jdk/src/share/classes/java/nio/charset/spi/CharsetProvider.java index 1e31d75fe31..829ba454443 100644 --- a/jdk/src/share/classes/java/nio/charset/spi/CharsetProvider.java +++ b/jdk/src/share/classes/java/nio/charset/spi/CharsetProvider.java @@ -71,6 +71,14 @@ import java.util.Iterator; public abstract class CharsetProvider { + private static Void checkPermission() { + SecurityManager sm = System.getSecurityManager(); + if (sm != null) + sm.checkPermission(new RuntimePermission("charsetProvider")); + return null; + } + private CharsetProvider(Void ignore) { } + /** * Initializes a new charset provider. * @@ -79,9 +87,7 @@ public abstract class CharsetProvider { * {@link RuntimePermission}("charsetProvider") */ protected CharsetProvider() { - SecurityManager sm = System.getSecurityManager(); - if (sm != null) - sm.checkPermission(new RuntimePermission("charsetProvider")); + this(checkPermission()); } /** From 1e845ac91f472847e7c8068385d2db632f0000cb Mon Sep 17 00:00:00 2001 From: Mike Duigou Date: Fri, 13 Dec 2013 13:35:35 -0800 Subject: [PATCH 139/377] 8030016: HashMap.computeIfAbsent generates spurious access event Reviewed-by: psandoz, bchristi --- jdk/src/share/classes/java/util/HashMap.java | 6 +-- .../ComputeIfAbsentAccessOrder.java | 47 +++++++++++++++++++ jdk/test/java/util/Map/Defaults.java | 30 +++++++++++- 3 files changed, 78 insertions(+), 5 deletions(-) create mode 100644 jdk/test/java/util/LinkedHashMap/ComputeIfAbsentAccessOrder.java diff --git a/jdk/src/share/classes/java/util/HashMap.java b/jdk/src/share/classes/java/util/HashMap.java index 1183952eb06..2bb38f31be7 100644 --- a/jdk/src/share/classes/java/util/HashMap.java +++ b/jdk/src/share/classes/java/util/HashMap.java @@ -1116,13 +1116,13 @@ public class HashMap extends AbstractMap } } V v = mappingFunction.apply(key); - if (old != null) { + if (v == null) { + return null; + } else if (old != null) { old.value = v; afterNodeAccess(old); return v; } - else if (v == null) - return null; else if (t != null) t.putTreeVal(this, tab, hash, key, v); else { diff --git a/jdk/test/java/util/LinkedHashMap/ComputeIfAbsentAccessOrder.java b/jdk/test/java/util/LinkedHashMap/ComputeIfAbsentAccessOrder.java new file mode 100644 index 00000000000..532f2f78512 --- /dev/null +++ b/jdk/test/java/util/LinkedHashMap/ComputeIfAbsentAccessOrder.java @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * 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 8030016 + * @summary computeIfAbsent would generate spurious access + */ + +import java.util.*; + +public class ComputeIfAbsentAccessOrder { + public static void main(String args[]) throws Throwable { + LinkedHashMap map = new LinkedHashMap<>(2, 0.75f, true); + map.put("first", null); + map.put("second", null); + + map.computeIfAbsent("first", l -> null); // should do nothing + + String key = map.keySet().stream() + .findFirst() + .orElseThrow(() -> new RuntimeException("no value")); + if(!"first".equals(key)) { + throw new RuntimeException("not expected value " + "first" + "!=" + key); + } + } +} diff --git a/jdk/test/java/util/Map/Defaults.java b/jdk/test/java/util/Map/Defaults.java index 46a49a63a51..ed8d2992cec 100644 --- a/jdk/test/java/util/Map/Defaults.java +++ b/jdk/test/java/util/Map/Defaults.java @@ -80,18 +80,22 @@ public class Defaults { @Test(dataProvider = "Map rw=true keys=withNull values=withNull") public void testPutIfAbsentNulls(String description, Map map) { + // null -> null assertTrue(map.containsKey(null), "null key absent"); assertNull(map.get(null), "value not null"); assertNull(map.putIfAbsent(null, EXTRA_VALUE), "previous not null"); + // null -> EXTRA_VALUE assertTrue(map.containsKey(null), "null key absent"); assertSame(map.get(null), EXTRA_VALUE, "unexpected value"); assertSame(map.putIfAbsent(null, null), EXTRA_VALUE, "previous not expected value"); assertTrue(map.containsKey(null), "null key absent"); assertSame(map.get(null), EXTRA_VALUE, "unexpected value"); assertSame(map.remove(null), EXTRA_VALUE, "removed unexpected value"); + // null -> assertFalse(map.containsKey(null), description + ": key present after remove"); assertNull(map.putIfAbsent(null, null), "previous not null"); + // null -> null assertTrue(map.containsKey(null), "null key absent"); assertNull(map.get(null), "value not null"); assertNull(map.putIfAbsent(null, EXTRA_VALUE), "previous not null"); @@ -100,15 +104,19 @@ public class Defaults { @Test(dataProvider = "Map rw=true keys=all values=all") public void testPutIfAbsent(String description, Map map) { + // 1 -> 1 assertTrue(map.containsKey(KEYS[1])); Object expected = map.get(KEYS[1]); assertTrue(null == expected || expected == VALUES[1]); assertSame(map.putIfAbsent(KEYS[1], EXTRA_VALUE), expected); assertSame(map.get(KEYS[1]), expected); + // EXTRA_KEY -> assertFalse(map.containsKey(EXTRA_KEY)); assertSame(map.putIfAbsent(EXTRA_KEY, EXTRA_VALUE), null); assertSame(map.get(EXTRA_KEY), EXTRA_VALUE); + assertSame(map.putIfAbsent(EXTRA_KEY, VALUES[2]), EXTRA_VALUE); + assertSame(map.get(EXTRA_KEY), EXTRA_VALUE); } @Test(dataProvider = "Map rw=all keys=all values=all") @@ -268,14 +276,28 @@ public class Defaults { @Test(dataProvider = "Map rw=true keys=withNull values=withNull") public void testComputeIfAbsentNulls(String description, Map map) { + // null -> null assertTrue(map.containsKey(null), "null key absent"); assertNull(map.get(null), "value not null"); - assertSame(map.computeIfAbsent(null, (k) -> EXTRA_VALUE), EXTRA_VALUE, description); - assertSame(map.get(null), EXTRA_VALUE, description); + assertSame(map.computeIfAbsent(null, (k) -> null), null, "not expected result"); + assertTrue(map.containsKey(null), "null key absent"); + assertNull(map.get(null), "value not null"); + assertSame(map.computeIfAbsent(null, (k) -> EXTRA_VALUE), EXTRA_VALUE, "not mapped to result"); + // null -> EXTRA_VALUE + assertTrue(map.containsKey(null), "null key absent"); + assertSame(map.get(null), EXTRA_VALUE, "not expected value"); + assertSame(map.remove(null), EXTRA_VALUE, "removed unexpected value"); + // null -> + assertFalse(map.containsKey(null), "null key present"); + assertSame(map.computeIfAbsent(null, (k) -> EXTRA_VALUE), EXTRA_VALUE, "not mapped to result"); + // null -> EXTRA_VALUE + assertTrue(map.containsKey(null), "null key absent"); + assertSame(map.get(null), EXTRA_VALUE, "not expected value"); } @Test(dataProvider = "Map rw=true keys=all values=all") public void testComputeIfAbsent(String description, Map map) { + // 1 -> 1 assertTrue(map.containsKey(KEYS[1])); Object expected = map.get(KEYS[1]); assertTrue(null == expected || expected == VALUES[1], description + String.valueOf(expected)); @@ -283,8 +305,12 @@ public class Defaults { assertSame(map.computeIfAbsent(KEYS[1], (k) -> EXTRA_VALUE), expected, description); assertSame(map.get(KEYS[1]), expected, description); + // EXTRA_KEY -> + assertFalse(map.containsKey(EXTRA_KEY)); + assertNull(map.computeIfAbsent(EXTRA_KEY, (k) -> null)); assertFalse(map.containsKey(EXTRA_KEY)); assertSame(map.computeIfAbsent(EXTRA_KEY, (k) -> EXTRA_VALUE), EXTRA_VALUE); + // EXTRA_KEY -> EXTRA_VALUE assertSame(map.get(EXTRA_KEY), EXTRA_VALUE); } From 5b90fb7e5e93b04391831303df78660d55e94a7b Mon Sep 17 00:00:00 2001 From: Mike Duigou Date: Fri, 13 Dec 2013 13:34:55 -0800 Subject: [PATCH 140/377] 8029055: Map.merge implementations should refuse null value param Reviewed-by: briangoetz, dl --- jdk/src/share/classes/java/util/HashMap.java | 2 + jdk/src/share/classes/java/util/Map.java | 61 ++++++++----------- .../java/util/concurrent/ConcurrentMap.java | 8 +-- jdk/test/java/util/Map/Defaults.java | 27 -------- 4 files changed, 31 insertions(+), 67 deletions(-) diff --git a/jdk/src/share/classes/java/util/HashMap.java b/jdk/src/share/classes/java/util/HashMap.java index 2bb38f31be7..ac3f635e432 100644 --- a/jdk/src/share/classes/java/util/HashMap.java +++ b/jdk/src/share/classes/java/util/HashMap.java @@ -1212,6 +1212,8 @@ public class HashMap extends AbstractMap @Override public V merge(K key, V value, BiFunction remappingFunction) { + if (value == null) + throw new NullPointerException(); if (remappingFunction == null) throw new NullPointerException(); int hash = hash(key); diff --git a/jdk/src/share/classes/java/util/Map.java b/jdk/src/share/classes/java/util/Map.java index 5c3f954c2a0..de8bbce01a2 100644 --- a/jdk/src/share/classes/java/util/Map.java +++ b/jdk/src/share/classes/java/util/Map.java @@ -600,7 +600,7 @@ public interface Map { * @implSpec * The default implementation is equivalent to, for this {@code map}: *
 {@code
-     * for ((Map.Entry entry : map.entrySet())
+     * for (Map.Entry entry : map.entrySet())
      *     action.accept(entry.getKey(), entry.getValue());
      * }
* @@ -640,7 +640,7 @@ public interface Map { * @implSpec *

The default implementation is equivalent to, for this {@code map}: *

 {@code
-     * for ((Map.Entry entry : map.entrySet())
+     * for (Map.Entry entry : map.entrySet())
      *     entry.setValue(function.apply(entry.getKey(), entry.getValue()));
      * }
* @@ -1110,8 +1110,8 @@ public interface Map { /** * If the specified key is not already associated with a value or is - * associated with null, associates it with the given value. - * Otherwise, replaces the value with the results of the given + * associated with null, associates it with the given non-null value. + * Otherwise, replaces the associated value with the results of the given * remapping function, or removes if the result is {@code null}. This * method may be of use when combining multiple mapped values for a key. * For example, to either create or append a {@code String msg} to a @@ -1121,15 +1121,14 @@ public interface Map { * map.merge(key, msg, String::concat) * } * - *

If the function returns {@code null}, the mapping is removed (or - * remains absent if initially absent). If the function itself throws an - * (unchecked) exception, the exception is rethrown, and the current mapping - * is left unchanged. + *

If the function returns {@code null} the mapping is removed. If the + * function itself throws an (unchecked) exception, the exception is + * rethrown, and the current mapping is left unchanged. * * @implSpec - * The default implementation is equivalent to performing the - * following steps for this {@code map}, then returning the - * current value or {@code null} if absent: + * The default implementation is equivalent to performing the following + * steps for this {@code map}, then returning the current value or + * {@code null} if absent: * *

 {@code
      * V oldValue = map.get(key);
@@ -1137,8 +1136,6 @@ public interface Map {
      *              remappingFunction.apply(oldValue, value);
      * if (newValue == null)
      *     map.remove(key);
-     * else if (oldValue == null)
-     *     map.remove(key);
      * else
      *     map.put(key, newValue);
      * }
@@ -1151,42 +1148,36 @@ public interface Map { * whether the function is applied once atomically only if the value is not * present. * - * @param key key with which the specified value is to be associated - * @param value the value to use if absent + * @param key key with which the resulting value is to be associated + * @param value the non-null value to be merged with the existing value + * associated with the key or, if no existing value or a null value + * is associated with the key, to be associated with the key * @param remappingFunction the function to recompute a value if present - * @return the new value associated with the specified key, or null if none + * @return the new value associated with the specified key, or null if no + * value is associated with the key * @throws UnsupportedOperationException if the {@code put} operation * is not supported by this map * (optional) * @throws ClassCastException if the class of the specified key or value * prevents it from being stored in this map * (optional) - * @throws NullPointerException if the specified key is null and - * this map does not support null keys, or the remappingFunction - * is null + * @throws NullPointerException if the specified key is null and this map + * does not support null keys or the value or remappingFunction is + * null * @since 1.8 */ default V merge(K key, V value, BiFunction remappingFunction) { Objects.requireNonNull(remappingFunction); + Objects.requireNonNull(value); V oldValue = get(key); - if (oldValue != null) { - V newValue = remappingFunction.apply(oldValue, value); - if (newValue != null) { - put(key, newValue); - return newValue; - } else { - remove(key); - return null; - } + V newValue = (oldValue == null) ? value : + remappingFunction.apply(oldValue, value); + if(newValue == null) { + remove(key); } else { - if (value == null) { - remove(key); - return null; - } else { - put(key, value); - return value; - } + put(key, newValue); } + return newValue; } } diff --git a/jdk/src/share/classes/java/util/concurrent/ConcurrentMap.java b/jdk/src/share/classes/java/util/concurrent/ConcurrentMap.java index 3cb1fe7ea8f..61cda84d934 100644 --- a/jdk/src/share/classes/java/util/concurrent/ConcurrentMap.java +++ b/jdk/src/share/classes/java/util/concurrent/ConcurrentMap.java @@ -463,9 +463,9 @@ public interface ConcurrentMap extends Map { * {@inheritDoc} * * @implSpec - * The default implementation is equivalent to performing the - * following steps for this {@code map}, then returning the - * current value or {@code null} if absent: + * The default implementation is equivalent to performing the following + * steps for this {@code map}, then returning the current value or + * {@code null} if absent: * *
 {@code
      * V oldValue = map.get(key);
@@ -473,8 +473,6 @@ public interface ConcurrentMap extends Map {
      *              remappingFunction.apply(oldValue, value);
      * if (newValue == null)
      *     map.remove(key);
-     * else if (oldValue == null)
-     *     map.remove(key);
      * else
      *     map.put(key, newValue);
      * }
diff --git a/jdk/test/java/util/Map/Defaults.java b/jdk/test/java/util/Map/Defaults.java index ed8d2992cec..9211ad6d06e 100644 --- a/jdk/test/java/util/Map/Defaults.java +++ b/jdk/test/java/util/Map/Defaults.java @@ -767,7 +767,6 @@ public class Defaults { Collection cases = new ArrayList<>(); cases.addAll(makeMergeTestCases()); - cases.addAll(makeMergeNullValueTestCases()); return cases.iterator(); } @@ -790,32 +789,6 @@ public class Defaults { return cases; } - static Collection makeMergeNullValueTestCases() { - Collection cases = new ArrayList<>(); - - for( Object[] mapParams : makeAllRWMapsWithNulls() ) { - cases.add(new Object[] { mapParams[0], mapParams[1], Merging.Value.OLDVALUE, Merging.Value.NULL, Merging.Merger.NULL, Merging.Value.ABSENT, Merging.Value.NULL }); - } - - for( Object[] mapParams : makeAllRWMapsWithNulls() ) { - cases.add(new Object[] { mapParams[0], mapParams[1], Merging.Value.OLDVALUE, Merging.Value.NULL, Merging.Merger.RESULT, Merging.Value.RESULT, Merging.Value.RESULT }); - } - - for( Object[] mapParams : makeAllRWMapsWithNulls() ) { - cases.add(new Object[] { mapParams[0], mapParams[1], Merging.Value.ABSENT, Merging.Value.NULL, Merging.Merger.UNUSED, Merging.Value.ABSENT, Merging.Value.NULL }); - } - - for( Object[] mapParams : makeAllRWMapsWithNulls() ) { - cases.add(new Object[] { mapParams[0], mapParams[1], Merging.Value.NULL, Merging.Value.NULL, Merging.Merger.UNUSED, Merging.Value.ABSENT, Merging.Value.NULL }); - } - - for( Object[] mapParams : makeAllRWMapsWithNulls() ) { - cases.add(new Object[] { mapParams[0], mapParams[1], Merging.Value.NULL, Merging.Value.NEWVALUE, Merging.Merger.UNUSED, Merging.Value.NEWVALUE, Merging.Value.NEWVALUE }); - } - - return cases; - } - public interface Thrower { public void run() throws T; From d2642b91359e0555f2b5bc64e94ae551205b07f6 Mon Sep 17 00:00:00 2001 From: Staffan Larsen Date: Tue, 17 Dec 2013 08:07:02 +0100 Subject: [PATCH 141/377] 6605915: jinfo -flag functionality doesn't work with core files Reviewed-by: mchung, jbachorik --- jdk/src/share/classes/sun/tools/jinfo/JInfo.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/jdk/src/share/classes/sun/tools/jinfo/JInfo.java b/jdk/src/share/classes/sun/tools/jinfo/JInfo.java index 07f13b76a30..e8bcce85c54 100644 --- a/jdk/src/share/classes/sun/tools/jinfo/JInfo.java +++ b/jdk/src/share/classes/sun/tools/jinfo/JInfo.java @@ -196,15 +196,17 @@ public class JInfo { if (usageSA) { System.err.println(" jinfo [option] "); System.err.println(" (to connect to running process)"); - System.err.println(" jinfo [option] "); + System.err.println(" jinfo [option] "); System.err.println(" (to connect to a core file)"); System.err.println(" jinfo [option] [server_id@]"); System.err.println(" (to connect to remote debug server)"); System.err.println(""); System.err.println("where