--- a/.hgtags Thu Sep 17 16:53:42 2015 +0200
+++ b/.hgtags Fri Sep 25 12:04:35 2015 -0700
@@ -324,3 +324,4 @@
3966bd3b8167419aa05c6718a4af1cf54b1e3c58 jdk9-b79
3c9f5bd909ae7187f24622ee4b69f8a5756a9271 jdk9-b80
2050b3a0aadcb0e024bf798197421d58e54ec8bf jdk9-b81
+6521875cb63e1d0121b30af56ebbc36db078c4c6 jdk9-b82
--- a/.hgtags-top-repo Thu Sep 17 16:53:42 2015 +0200
+++ b/.hgtags-top-repo Fri Sep 25 12:04:35 2015 -0700
@@ -324,3 +324,4 @@
ba08a9f79b9849716bae1f39f71333d47f604012 jdk9-b79
f7c5ae2933c0b8510a420d1713a955e4ffc7ad0b jdk9-b80
b8afcf91331d78626a583ec1b63164468d6f4181 jdk9-b81
+42b56d1f418523ecb61a49d7493302c80c8009cc jdk9-b82
--- a/common/autoconf/generated-configure.sh Thu Sep 17 16:53:42 2015 +0200
+++ b/common/autoconf/generated-configure.sh Fri Sep 25 12:04:35 2015 -0700
@@ -841,7 +841,6 @@
JDK_MAJOR_VERSION
USER_RELEASE_SUFFIX
COMPRESS_JARS
-RMICONNECTOR_IIOP
UNLIMITED_CRYPTO
CACERTS_FILE
TEST_IN_BUILD
@@ -1060,7 +1059,6 @@
enable_hotspot_test_in_build
with_cacerts_file
enable_unlimited_crypto
-enable_rmiconnector_iiop
with_milestone
with_update_version
with_user_release_suffix
@@ -1848,9 +1846,6 @@
run the Queens test after Hotspot build [disabled]
--enable-unlimited-crypto
Enable unlimited crypto policy [disabled]
- --enable-rmiconnector-iiop
- enable the JMX RMIConnector iiop transport
- [disabled]
--disable-warnings-as-errors
do not consider native warnings to be an error
[enabled]
@@ -3951,7 +3946,7 @@
#
-# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@@ -20100,22 +20095,6 @@
###############################################################################
#
- # --enable-rmiconnector-iiop
- #
- # Check whether --enable-rmiconnector-iiop was given.
-if test "${enable_rmiconnector_iiop+set}" = set; then :
- enableval=$enable_rmiconnector_iiop;
-fi
-
- if test "x$enable_rmiconnector_iiop" = "xyes"; then
- RMICONNECTOR_IIOP=true
- else
- RMICONNECTOR_IIOP=false
- fi
-
-
- ###############################################################################
- #
# Compress jars
#
COMPRESS_JARS=false
--- a/common/autoconf/jdk-options.m4 Thu Sep 17 16:53:42 2015 +0200
+++ b/common/autoconf/jdk-options.m4 Fri Sep 25 12:04:35 2015 -0700
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@@ -455,19 +455,6 @@
###############################################################################
#
- # --enable-rmiconnector-iiop
- #
- AC_ARG_ENABLE(rmiconnector-iiop, [AS_HELP_STRING([--enable-rmiconnector-iiop],
- [enable the JMX RMIConnector iiop transport @<:@disabled@:>@])])
- if test "x$enable_rmiconnector_iiop" = "xyes"; then
- RMICONNECTOR_IIOP=true
- else
- RMICONNECTOR_IIOP=false
- fi
- AC_SUBST(RMICONNECTOR_IIOP)
-
- ###############################################################################
- #
# Compress jars
#
COMPRESS_JARS=false
--- a/common/autoconf/spec.gmk.in Thu Sep 17 16:53:42 2015 +0200
+++ b/common/autoconf/spec.gmk.in Fri Sep 25 12:04:35 2015 -0700
@@ -262,9 +262,6 @@
# Enable unlimited crypto policy
UNLIMITED_CRYPTO=@UNLIMITED_CRYPTO@
-# Enable RMIConnector IIOP transport
-RMICONNECTOR_IIOP=@RMICONNECTOR_IIOP@
-
GCOV_ENABLED=@GCOV_ENABLED@
# Necessary additional compiler flags to compile X11
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/common/bin/blessed-modifier-order.sh Fri Sep 25 12:04:35 2015 -0700
@@ -0,0 +1,60 @@
+#!/bin/bash
+#
+# Copyright 2015 Google, Inc. All Rights Reserved.
+# 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.
+
+usage() {
+ (
+ echo "$0 DIR ..."
+ echo "Modifies in place all the java source files found"
+ echo "in the given directories so that all java language modifiers"
+ echo "are in the canonical order given by Modifier#toString()."
+ echo "Tries to get it right even within javadoc comments,"
+ echo "and even if the list of modifiers spans 2 lines."
+ echo
+ echo "See:"
+ echo "https://docs.oracle.com/javase/8/docs/api/java/lang/reflect/Modifier.html#toString-int-"
+ echo
+ echo "Example:"
+ echo "$0 jdk/src/java.base jdk/test/java/{util,io,lang}"
+ ) >&2
+ exit 1
+}
+
+set -eu
+declare -ar dirs=("$@")
+[[ "${#dirs[@]}" > 0 ]] || usage
+for dir in "${dirs[@]}"; do [[ -d "$dir" ]] || usage; done
+
+declare -ar modifiers=(
+ public protected private
+ abstract static final transient
+ volatile synchronized native strictfp
+)
+declare -r SAVE_IFS="$IFS"
+for ((i = 3; i < "${#modifiers[@]}"; i++)); do
+ IFS='|'; x="${modifiers[*]:0:i}" y="${modifiers[*]:i}"; IFS="$SAVE_IFS"
+ if [[ -n "$x" && -n "$y" ]]; then
+ find "${dirs[@]}" -name '*.java' -type f -print0 | \
+ xargs -0 perl -0777 -p -i -e \
+ "do {} while s/^([A-Za-z@* ]*)\b($y)(\s|(?:\s|\n\s+\*)*\s)($x)\b/\1\4\3\2/mg"
+ fi
+done
--- a/corba/.hgtags Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/.hgtags Fri Sep 25 12:04:35 2015 -0700
@@ -324,3 +324,4 @@
4ab250b8fac66ef8cd15ee78c40f0c651c96e16a jdk9-b79
821a0373ef2d1642a9824facb938b901ad010413 jdk9-b80
45c35b7f5b40d5af0085e4a7b3a4d6e3e0347c35 jdk9-b81
+c20d8ebddaa6fb09cc81d3edf3d1d05f4232700a jdk9-b82
--- a/corba/src/java.corba/share/classes/com/sun/corba/se/impl/ior/ByteBuffer.java Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/com/sun/corba/se/impl/ior/ByteBuffer.java Fri Sep 25 12:04:35 2015 -0700
@@ -37,9 +37,9 @@
protected byte elementData[];
/**
- * The number of valid components in this <tt>ByteBuffer</tt> object.
- * Components <tt>elementData[0]</tt> through
- * <tt>elementData[elementCount-1]</tt> are the actual items.
+ * The number of valid components in this {@code ByteBuffer} object.
+ * Components {@code elementData[0]} through
+ * {@code elementData[elementCount-1]} are the actual items.
*
* @serial
*/
@@ -88,7 +88,7 @@
/**
* Constructs an empty ByteBuffer so that its internal data array
- * has size <tt>10</tt> and its standard capacity increment is
+ * has size {@code 10} and its standard capacity increment is
* zero.
*/
public ByteBuffer() {
@@ -99,7 +99,7 @@
* Trims the capacity of this ByteBuffer to be the ByteBuffer's current
* size. If the capacity of this cector is larger than its current
* size, then the capacity is changed to equal the size by replacing
- * its internal data array, kept in the field <tt>elementData</tt>,
+ * its internal data array, kept in the field {@code elementData},
* with a smaller one. An application can use this operation to
* minimize the storage of a ByteBuffer.
*/
@@ -138,7 +138,7 @@
* Returns the current capacity of this ByteBuffer.
*
* @return the current capacity (the length of its internal
- * data arary, kept in the field <tt>elementData</tt>
+ * data arary, kept in the field {@code elementData}
* of this ByteBuffer.
*/
public int capacity() {
@@ -157,9 +157,9 @@
/**
* Tests if this ByteBuffer has no components.
*
- * @return <code>true</code> if and only if this ByteBuffer has
+ * @return {@code true} if and only if this ByteBuffer has
* no components, that is, its size is zero;
- * <code>false</code> otherwise.
+ * {@code false} otherwise.
*/
public boolean isEmpty() {
return elementCount == 0;
--- a/corba/src/java.corba/share/classes/com/sun/corba/se/impl/javax/rmi/CORBA/Util.java Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/com/sun/corba/se/impl/javax/rmi/CORBA/Util.java Fri Sep 25 12:04:35 2015 -0700
@@ -438,11 +438,11 @@
}
/**
- * Writes a java.lang.Object as a CORBA Object. If <code>obj</code> is
+ * Writes a java.lang.Object as a CORBA Object. If {@code obj} is
* an exported RMI-IIOP server object, the tie is found
- * and wired to <code>obj</code>, then written to <code>out.write_Object(org.omg.CORBA.Object)</code>.
- * If <code>obj</code> is a CORBA Object, it is written to
- * <code>out.write_Object(org.omg.CORBA.Object)</code>.
+ * and wired to {@code obj}, then written to {@code out.write_Object(org.omg.CORBA.Object)}.
+ * If {@code obj} is a CORBA Object, it is written to
+ * {@code out.write_Object(org.omg.CORBA.Object)}.
* @param out the stream in which to write the object.
* @param obj the object to write.
*/
@@ -457,10 +457,10 @@
/**
* Writes a java.lang.Object as either a value or a CORBA Object.
- * If <code>obj</code> is a value object or a stub object, it is written to
- * <code>out.write_abstract_interface(java.lang.Object)</code>. If <code>obj</code> is an exported
- * RMI-IIOP server object, the tie is found and wired to <code>obj</code>,
- * then written to <code>out.write_abstract_interface(java.lang.Object)</code>.
+ * If {@code obj} is a value object or a stub object, it is written to
+ * {@code out.write_abstract_interface(java.lang.Object)}. If {@code obj} is an exported
+ * RMI-IIOP server object, the tie is found and wired to {@code obj},
+ * then written to {@code out.write_abstract_interface(java.lang.Object)}.
* @param out the stream in which to write the object.
* @param obj the object to write.
*/
@@ -595,7 +595,7 @@
* the class might be found. May be null.
* @param loader a class whose ClassLoader may be used to
* load the class if all other methods fail.
- * @return the <code>Class</code> object representing the loaded class.
+ * @return the {@code Class} object representing the loaded class.
* @exception ClassNotFoundException if class cannot be loaded.
*/
public Class loadClass( String className, String remoteCodebase,
@@ -605,20 +605,20 @@
}
/**
- * The <tt>isLocal</tt> method has the same semantics as the
+ * The {@code isLocal} method has the same semantics as the
* ObjectImpl._is_local method, except that it can throw a RemoteException.
* (no it doesn't but the spec says it should.)
*
- * The <tt>_is_local()</tt> method is provided so that stubs may determine
+ * The {@code _is_local()} method is provided so that stubs may determine
* if a particular object is implemented by a local servant and hence local
* invocation APIs may be used.
*
* @param stub the stub to test.
*
- * @return The <tt>_is_local()</tt> method returns true if
+ * @return The {@code _is_local()} method returns true if
* the servant incarnating the object is located in the same process as
- * the stub and they both share the same ORB instance. The <tt>_is_local()</tt>
- * method returns false otherwise. The default behavior of <tt>_is_local()</tt> is
+ * the stub and they both share the same ORB instance. The {@code _is_local()}
+ * method returns false otherwise. The default behavior of {@code _is_local()} is
* to return false.
*
* @throws RemoteException The Java to IDL specification does to
--- a/corba/src/java.corba/share/classes/com/sun/corba/se/impl/presentation/rmi/JNDIStateFactoryImpl.java Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/com/sun/corba/se/impl/presentation/rmi/JNDIStateFactoryImpl.java Fri Sep 25 12:04:35 2015 -0700
@@ -93,7 +93,7 @@
* @param name Ignored
* @param ctx The non-null CNCtx whose ORB to use.
* @param env Ignored
- * @return The CORBA object for <tt>orig</tt> or null.
+ * @return The CORBA object for {@code orig} or null.
* @exception ConfigurationException If the CORBA object cannot be obtained
* due to configuration problems
* @exception NamingException If some other problem prevented a CORBA
--- a/corba/src/java.corba/share/classes/com/sun/corba/se/spi/legacy/connection/ORBSocketFactory.java Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/com/sun/corba/se/spi/legacy/connection/ORBSocketFactory.java Fri Sep 25 12:04:35 2015 -0700
@@ -165,7 +165,7 @@
* If number is 0 then use an emphemeral port for the listener of
* the associated type. <p>
*
- * If number is greater then 0 use that port number. <p>
+ * If number is greater than 0 use that port number. <p>
*
* An ORB creates a listener socket for each type
* specified by the user by calling
--- a/corba/src/java.corba/share/classes/javax/rmi/CORBA/Util.java Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/javax/rmi/CORBA/Util.java Fri Sep 25 12:04:35 2015 -0700
@@ -108,12 +108,12 @@
}
/**
- * Writes a java.lang.Object as a CORBA Object. If <code>obj</code> is
+ * Writes a java.lang.Object as a CORBA Object. If {@code obj} is
* an exported RMI-IIOP server object, the tie is found
- * and wired to <code>obj</code>, then written to
-<code>out.write_Object(org.omg.CORBA.Object)</code>.
- * If <code>obj</code> is a CORBA Object, it is written to
- * <code>out.write_Object(org.omg.CORBA.Object)</code>.
+ * and wired to {@code obj}, then written to
+ * {@code out.write_Object(org.omg.CORBA.Object)}.
+ * If {@code obj} is a CORBA Object, it is written to
+ * {@code out.write_Object(org.omg.CORBA.Object)}.
* @param out the stream in which to write the object.
* @param obj the object to write.
*/
@@ -128,12 +128,11 @@
/**
* Writes a java.lang.Object as either a value or a CORBA Object.
- * If <code>obj</code> is a value object or a stub object, it is written to
- * <code>out.write_abstract_interface(java.lang.Object)</code>. If <code>obj</code>
-is
-an exported
- * RMI-IIOP server object, the tie is found and wired to <code>obj</code>,
- * then written to <code>out.write_abstract_interface(java.lang.Object)</code>.
+ * If {@code obj} is a value object or a stub object, it is written to
+ * {@code out.write_abstract_interface(java.lang.Object)}.
+ * If {@code obj} is an exported
+ * RMI-IIOP server object, the tie is found and wired to {@code obj},
+ * then written to {@code out.write_abstract_interface(java.lang.Object)}.
* @param out the stream in which to write the object.
* @param obj the object to write.
*/
@@ -161,8 +160,8 @@
}
/**
- * Removes the associated tie from an internal table and calls {@link
-Tie#deactivate}
+ * Removes the associated tie from an internal table
+ * and calls {@link Tie#deactivate}
* to deactivate the object.
* @param target the object to unexport.
*/
@@ -219,27 +218,27 @@
* <P>The spec for this method is the "Java to IDL language
* mapping", ptc/00-01-06.
* <P>In Java SE Platform, this method works as follows:
- * <UL><LI>Find the first non-null <tt>ClassLoader</tt> on the
+ * <UL><LI>Find the first non-null {@code ClassLoader} on the
* call stack and attempt to load the class using this
- * <tt>ClassLoader</tt>.
- * <LI>If the first step fails, and if <tt>remoteCodebase</tt>
+ * {@code ClassLoader}.
+ * <LI>If the first step fails, and if {@code remoteCodebase}
* is non-null and
- * <tt>useCodebaseOnly</tt> is false, then call
- * <tt>java.rmi.server.RMIClassLoader.loadClass(remoteCodebase, className)</tt>.
- * <LI>If <tt>remoteCodebase</tt> is null or <tt>useCodebaseOnly</tt>
- * is true, then call <tt>java.rmi.server.RMIClassLoader.loadClass(className)</tt>.
+ * {@code useCodebaseOnly} is false, then call
+ * {@code java.rmi.server.RMIClassLoader.loadClass(remoteCodebase, className)}.
+ * <LI>If {@code remoteCodebase} is null or {@code useCodebaseOnly}
+ * is true, then call {@code java.rmi.server.RMIClassLoader.loadClass(className)}.
* <LI>If a class was not successfully loaded by step 1, 2, or 3,
- * and <tt>loader</tt> is non-null, then call <tt>loader.loadClass(className)</tt>.
+ * and {@code loader} is non-null, then call {@code loader.loadClass(className)}.
* <LI>If a class was successfully loaded by step 1, 2, 3, or 4, then
- * return the loaded class, else throw <tt>ClassNotFoundException</tt>.
+ * return the loaded class, else throw {@code ClassNotFoundException}.
* </UL>
*
* @param className the name of the class.
* @param remoteCodebase a space-separated list of URLs at which
* the class might be found. May be null.
- * @param loader a <tt>ClassLoader</tt> that may be used to
+ * @param loader a {@code ClassLoader} that may be used to
* load the class if all other methods fail.
- * @return the <code>Class</code> object representing the loaded class.
+ * @return the {@code Class} object representing the loaded class.
* @exception ClassNotFoundException if class cannot be loaded.
*/
public static Class loadClass(String className,
@@ -254,24 +253,24 @@
/**
- * The <tt>isLocal</tt> method has the same semantics as the
- * <tt>ObjectImpl._is_local</tt>
- * method, except that it can throw a <tt>RemoteException</tt>.
+ * The {@code isLocal} method has the same semantics as the
+ * {@code ObjectImpl._is_local}
+ * method, except that it can throw a {@code RemoteException}.
*
- * The <tt>_is_local()</tt> method is provided so that stubs may determine if a
+ * The {@code _is_local()} method is provided so that stubs may determine if a
* particular object is implemented by a local servant and hence local
* invocation APIs may be used.
*
* @param stub the stub to test.
*
- * @return The <tt>_is_local()</tt> method returns true if
+ * @return The {@code _is_local()} method returns true if
* the servant incarnating the object is located in the same process as
- * the stub and they both share the same ORB instance. The <tt>_is_local()</tt>
- * method returns false otherwise. The default behavior of <tt>_is_local()</tt> is
+ * the stub and they both share the same ORB instance. The {@code _is_local()}
+ * method returns false otherwise. The default behavior of {@code _is_local()} is
* to return false.
*
* @throws RemoteException The Java to IDL specification does not
- * specify the conditions that cause a <tt>RemoteException</tt> to be thrown.
+ * specify the conditions that cause a {@code RemoteException} to be thrown.
*/
public static boolean isLocal(Stub stub) throws RemoteException {
--- a/corba/src/java.corba/share/classes/org/omg/CORBA/AnyHolder.java Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/org/omg/CORBA/AnyHolder.java Fri Sep 25 12:04:35 2015 -0700
@@ -30,52 +30,52 @@
import org.omg.CORBA.portable.OutputStream;
/**
- * The Holder for <tt>Any</tt>. For more information on
+ * The Holder for {@code Any}. For more information on
* Holder files, see <a href="doc-files/generatedfiles.html#holder">
* "Generated Files: Holder Files"</a>.<P>
- * A Holder class for <code>Any</code> objects
+ * A Holder class for {@code Any} objects
* that is used to store "out" and "inout" parameters in IDL methods.
- * If an IDL method signature has an IDL <code>any</code> as an "out"
+ * If an IDL method signature has an IDL {@code any} as an "out"
* or "inout" parameter, the programmer must pass an instance of
- * <code>AnyHolder</code> as the corresponding
+ * {@code AnyHolder} as the corresponding
* parameter in the method invocation; for "inout" parameters, the programmer
* must also fill the "in" value to be sent to the server.
* Before the method invocation returns, the ORB will fill in the
* value corresponding to the "out" value returned from the server.
* <P>
- * If <code>myAnyHolder</code> is an instance of <code>AnyHolder</code>,
- * the value stored in its <code>value</code> field can be accessed with
- * <code>myAnyHolder.value</code>.
+ * If {@code myAnyHolder} is an instance of {@code AnyHolder},
+ * the value stored in its {@code value} field can be accessed with
+ * {@code myAnyHolder.value}.
*
* @since JDK1.2
*/
public final class AnyHolder implements Streamable {
/**
- * The <code>Any</code> value held by this <code>AnyHolder</code> object.
+ * The {@code Any} value held by this {@code AnyHolder} object.
*/
public Any value;
/**
- * Constructs a new <code>AnyHolder</code> object with its
- * <code>value</code> field initialized to <code>null</code>.
+ * Constructs a new {@code AnyHolder} object with its
+ * {@code value} field initialized to {@code null}.
*/
public AnyHolder() {
}
/**
- * Constructs a new <code>AnyHolder</code> object for the given
- * <code>Any</code> object.
- * @param initial the <code>Any</code> object with which to initialize
- * the <code>value</code> field of the new
- * <code>AnyHolder</code> object
+ * Constructs a new {@code AnyHolder} object for the given
+ * {@code Any} object.
+ * @param initial the {@code Any} object with which to initialize
+ * the {@code value} field of the new
+ * {@code AnyHolder} object
*/
public AnyHolder(Any initial) {
value = initial;
}
/**
- * Reads from <code>input</code> and initalizes the value in the Holder
+ * Reads from {@code input} and initalizes the value in the Holder
* with the unmarshalled data.
*
* @param input the InputStream containing CDR formatted data from the wire.
@@ -85,8 +85,8 @@
}
/**
- * Marshals to <code>output</code> the value in
- * this <code>AnyHolder</code> object.
+ * Marshals to {@code output} the value in
+ * this {@code AnyHolder} object.
*
* @param output the OutputStream which will contain the CDR formatted data.
*/
@@ -95,11 +95,11 @@
}
/**
- * Returns the <code>TypeCode</code> object corresponding to the value
- * held in this <code>AnyHolder</code> object.
+ * Returns the {@code TypeCode} object corresponding to the value
+ * held in this {@code AnyHolder} object.
*
* @return the TypeCode of the value held in
- * this <code>AnyHolder</code> object
+ * this {@code AnyHolder} object
*/
public TypeCode _type() {
return ORB.init().get_primitive_tc(TCKind.tk_any);
--- a/corba/src/java.corba/share/classes/org/omg/CORBA/AnySeqHelper.java Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/org/omg/CORBA/AnySeqHelper.java Fri Sep 25 12:04:35 2015 -0700
@@ -26,26 +26,26 @@
/**
-* The Helper for <tt>AnySeq</tt>. For more information on
-* Helper files, see <a href="doc-files/generatedfiles.html#helper">
-* "Generated Files: Helper Files"</a>.<P>
-* org/omg/CORBA/AnySeqHelper.java
-* Generated by the IDL-to-Java compiler (portable), version "3.0"
-* from streams.idl
-* 13 May 1999 22:41:36 o'clock GMT+00:00
-*
-* The class definition has been modified to conform to the following
-* OMG specifications :
-* <ul>
-* <li> ORB core as defined by CORBA 2.3.1
-* (<a href="http://www.omg.org/cgi-bin/doc?formal/99-10-07">formal/99-10-07</a>)
-* </li>
-*
-* <li> IDL/Java Language Mapping as defined in
-* <a href="http://www.omg.org/cgi-bin/doc?ptc/00-01-08">ptc/00-01-08</a>
-* </li>
-* </ul>
-*/
+ * The Helper for {@code AnySeq}. For more information on
+ * Helper files, see <a href="doc-files/generatedfiles.html#helper">
+ * "Generated Files: Helper Files"</a>.<P>
+ * org/omg/CORBA/AnySeqHelper.java
+ * Generated by the IDL-to-Java compiler (portable), version "3.0"
+ * from streams.idl
+ * 13 May 1999 22:41:36 o'clock GMT+00:00
+ *
+ * The class definition has been modified to conform to the following
+ * OMG specifications :
+ * <ul>
+ * <li> ORB core as defined by CORBA 2.3.1
+ * (<a href="http://www.omg.org/cgi-bin/doc?formal/99-10-07">formal/99-10-07</a>)
+ * </li>
+ *
+ * <li> IDL/Java Language Mapping as defined in
+ * <a href="http://www.omg.org/cgi-bin/doc?ptc/00-01-08">ptc/00-01-08</a>
+ * </li>
+ * </ul>
+ */
public abstract class AnySeqHelper
{
--- a/corba/src/java.corba/share/classes/org/omg/CORBA/AnySeqHolder.java Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/org/omg/CORBA/AnySeqHolder.java Fri Sep 25 12:04:35 2015 -0700
@@ -26,14 +26,14 @@
/**
-* The Holder for <tt>AnySeq</tt>. For more information on
-* Holder files, see <a href="doc-files/generatedfiles.html#holder">
-* "Generated Files: Holder Files"</a>.<P>
-* org/omg/CORBA/AnySeqHolder.java
-* Generated by the IDL-to-Java compiler (portable), version "3.0"
-* from streams.idl
-* 13 May 1999 22:41:36 o'clock GMT+00:00
-*/
+ * The Holder for {@code AnySeq}. For more information on
+ * Holder files, see <a href="doc-files/generatedfiles.html#holder">
+ * "Generated Files: Holder Files"</a>.<P>
+ * org/omg/CORBA/AnySeqHolder.java
+ * Generated by the IDL-to-Java compiler (portable), version "3.0"
+ * from streams.idl
+ * 13 May 1999 22:41:36 o'clock GMT+00:00
+ */
public final class AnySeqHolder implements org.omg.CORBA.portable.Streamable
{
--- a/corba/src/java.corba/share/classes/org/omg/CORBA/BAD_POLICY.java Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/org/omg/CORBA/BAD_POLICY.java Fri Sep 25 12:04:35 2015 -0700
@@ -25,8 +25,8 @@
package org.omg.CORBA;
/**
- * A <tt>PolicyErrorCode</tt> which would be filled in
- * the <tt>PolicyError</tt> exception.
+ * A {@code PolicyErrorCode} which would be filled in
+ * the {@code PolicyError} exception.
*
* @author rip-dev
*/
--- a/corba/src/java.corba/share/classes/org/omg/CORBA/BAD_POLICY_TYPE.java Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/org/omg/CORBA/BAD_POLICY_TYPE.java Fri Sep 25 12:04:35 2015 -0700
@@ -26,8 +26,8 @@
package org.omg.CORBA;
/**
- * A <tt>PolicyErrorCode</tt> which would be filled in
- * the <tt>PolicyError</tt> exception.
+ * A {@code PolicyErrorCode} which would be filled in
+ * the {@code PolicyError} exception.
*
* @author rip-dev
*/
--- a/corba/src/java.corba/share/classes/org/omg/CORBA/BAD_TYPECODE.java Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/org/omg/CORBA/BAD_TYPECODE.java Fri Sep 25 12:04:35 2015 -0700
@@ -27,7 +27,7 @@
/**
* Exception thrown when the ORB has encountered a malformed type code
- * (for example, a type code with an invalid <tt>TCKind</tt> value).<P>
+ * (for example, a type code with an invalid {@code TCKind} value).<P>
* It contains a minor code, which gives more detailed information about
* what caused the exception, and a completion status. It may also contain
* a string describing the exception.
@@ -40,7 +40,7 @@
public final class BAD_TYPECODE extends SystemException {
/**
- * Constructs a <code>BAD_TYPECODE</code> exception with a default
+ * Constructs a {@code BAD_TYPECODE} exception with a default
* minor code of 0 and a completion state of COMPLETED_NO.
*/
public BAD_TYPECODE() {
@@ -48,7 +48,7 @@
}
/**
- * Constructs a <code>BAD_TYPECODE</code> exception with the specified detail,
+ * Constructs a {@code BAD_TYPECODE} exception with the specified detail,
* a minor code of 0, and a completion state of COMPLETED_NO.
*
* @param s the String containing a detail message
@@ -58,10 +58,10 @@
}
/**
- * Constructs a <code>BAD_TYPECODE</code> exception with the specified
+ * Constructs a {@code BAD_TYPECODE} exception with the specified
* minor code and completion status.
* @param minor the minor code
- * @param completed an instance of <code>CompletionStatus</code> indicating
+ * @param completed an instance of {@code CompletionStatus} indicating
* the completion status
*/
public BAD_TYPECODE(int minor, CompletionStatus completed) {
@@ -69,12 +69,12 @@
}
/**
- * Constructs a <code>BAD_TYPECODE</code> exception with the specified detail
+ * Constructs a {@code BAD_TYPECODE} exception with the specified detail
* message, minor code, and completion status.
* A detail message is a String that describes this particular exception.
* @param s the String containing a detail message
* @param minor the minor code
- * @param completed an instance of <code>CompletionStatus</code> indicating
+ * @param completed an instance of {@code CompletionStatus} indicating
* the completion status
*/
public BAD_TYPECODE(String s, int minor, CompletionStatus completed) {
--- a/corba/src/java.corba/share/classes/org/omg/CORBA/BooleanHolder.java Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/org/omg/CORBA/BooleanHolder.java Fri Sep 25 12:04:35 2015 -0700
@@ -30,56 +30,56 @@
/**
- * The Holder for <tt>Boolean</tt>. For more information on
+ * The Holder for {@code Boolean}. For more information on
* Holder files, see <a href="doc-files/generatedfiles.html#holder">
* "Generated Files: Holder Files"</a>.<P>
- * A Holder class for a <code>boolean</code>
+ * A Holder class for a {@code boolean}
* that is used to store "out" and "inout" parameters in IDL methods.
- * If an IDL method signature has an IDL <code>boolean</code> as an "out"
+ * If an IDL method signature has an IDL {@code boolean} as an "out"
* or "inout" parameter, the programmer must pass an instance of
- * <code>BooleanHolder</code> as the corresponding
+ * {@code BooleanHolder} as the corresponding
* parameter in the method invocation; for "inout" parameters, the programmer
* must also fill the "in" value to be sent to the server.
* Before the method invocation returns, the ORB will fill in the
* value corresponding to the "out" value returned from the server.
* <P>
- * If <code>myBooleanHolder</code> is an instance of <code>BooleanHolder</code>,
- * the value stored in its <code>value</code> field can be accessed with
- * <code>myBooleanHolder.value</code>.
+ * If {@code myBooleanHolder} is an instance of {@code BooleanHolder},
+ * the value stored in its {@code value} field can be accessed with
+ * {@code myBooleanHolder.value}.
*
* @since JDK1.2
*/
public final class BooleanHolder implements Streamable {
/**
- * The <code>boolean</code> value held by this <code>BooleanHolder</code>
+ * The {@code boolean} value held by this {@code BooleanHolder}
* object.
*/
public boolean value;
/**
- * Constructs a new <code>BooleanHolder</code> object with its
- * <code>value</code> field initialized to <code>false</code>.
+ * Constructs a new {@code BooleanHolder} object with its
+ * {@code value} field initialized to {@code false}.
*/
public BooleanHolder() {
}
/**
- * Constructs a new <code>BooleanHolder</code> object with its
- * <code>value</code> field initialized with the given <code>boolean</code>.
- * @param initial the <code>boolean</code> with which to initialize
- * the <code>value</code> field of the newly-created
- * <code>BooleanHolder</code> object
+ * Constructs a new {@code BooleanHolder} object with its
+ * {@code value} field initialized with the given {@code boolean}.
+ * @param initial the {@code boolean} with which to initialize
+ * the {@code value} field of the newly-created
+ * {@code BooleanHolder} object
*/
public BooleanHolder(boolean initial) {
value = initial;
}
/**
- * Reads unmarshalled data from <code>input</code> and assigns it to this
- * <code>BooleanHolder</code> object's <code>value</code> field.
+ * Reads unmarshalled data from {@code input} and assigns it to this
+ * {@code BooleanHolder} object's {@code value} field.
*
- * @param input the <code>InputStream</code> object containing
+ * @param input the {@code InputStream} object containing
* CDR formatted data from the wire
*/
public void _read(InputStream input) {
@@ -87,8 +87,8 @@
}
/**
- * Marshals the value in this <code>BooleanHolder</code> object's
- * <code>value</code> field to the output stream <code>output</code>.
+ * Marshals the value in this {@code BooleanHolder} object's
+ * {@code value} field to the output stream {@code output}.
*
* @param output the OutputStream which will contain the CDR formatted data
*/
@@ -97,11 +97,11 @@
}
/**
- * Retrieves the <code>TypeCode</code> object that corresponds to the
- * value held in this <code>BooleanHolder</code> object.
+ * Retrieves the {@code TypeCode} object that corresponds to the
+ * value held in this {@code BooleanHolder} object.
*
- * @return the <code>TypeCode</code> for the value held
- * in this <code>BooleanHolder</code> object
+ * @return the {@code TypeCode} for the value held
+ * in this {@code BooleanHolder} object
*/
public TypeCode _type() {
return ORB.init().get_primitive_tc(TCKind.tk_boolean);
--- a/corba/src/java.corba/share/classes/org/omg/CORBA/BooleanSeqHelper.java Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/org/omg/CORBA/BooleanSeqHelper.java Fri Sep 25 12:04:35 2015 -0700
@@ -26,26 +26,26 @@
/**
-* The Helper for <tt>BooleanSeq</tt>. For more information on
-* Helper files, see <a href="doc-files/generatedfiles.html#helper">
-* "Generated Files: Helper Files"</a>.<P>
-* org/omg/CORBA/BooleanSeqHelper.java
-* Generated by the IDL-to-Java compiler (portable), version "3.0"
-* from streams.idl
-* 13 May 1999 22:41:36 o'clock GMT+00:00
-*
-* The class definition has been modified to conform to the following
-* OMG specifications :
-* <ul>
-* <li> ORB core as defined by CORBA 2.3.1
-* (<a href="http://www.omg.org/cgi-bin/doc?formal/99-10-07">formal/99-10-07</a>)
-* </li>
-*
-* <li> IDL/Java Language Mapping as defined in
-* <a href="http://www.omg.org/cgi-bin/doc?ptc/00-01-08">ptc/00-01-08</a>
-* </li>
-* </ul>
-*/
+ * The Helper for {@code BooleanSeq}. For more information on
+ * Helper files, see <a href="doc-files/generatedfiles.html#helper">
+ * "Generated Files: Helper Files"</a>.<P>
+ * org/omg/CORBA/BooleanSeqHelper.java
+ * Generated by the IDL-to-Java compiler (portable), version "3.0"
+ * from streams.idl
+ * 13 May 1999 22:41:36 o'clock GMT+00:00
+ *
+ * The class definition has been modified to conform to the following
+ * OMG specifications :
+ * <ul>
+ * <li> ORB core as defined by CORBA 2.3.1
+ * (<a href="http://www.omg.org/cgi-bin/doc?formal/99-10-07">formal/99-10-07</a>)
+ * </li>
+ *
+ * <li> IDL/Java Language Mapping as defined in
+ * <a href="http://www.omg.org/cgi-bin/doc?ptc/00-01-08">ptc/00-01-08</a>
+ * </li>
+ * </ul>
+ */
public abstract class BooleanSeqHelper
{
--- a/corba/src/java.corba/share/classes/org/omg/CORBA/BooleanSeqHolder.java Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/org/omg/CORBA/BooleanSeqHolder.java Fri Sep 25 12:04:35 2015 -0700
@@ -26,14 +26,14 @@
/**
-* The Holder for <tt>BooleanSeq</tt>. For more information on
-* Holder files, see <a href="doc-files/generatedfiles.html#holder">
-* "Generated Files: Holder Files"</a>.<P>
-* org/omg/CORBA/BooleanSeqHolder.java
-* Generated by the IDL-to-Java compiler (portable), version "3.0"
-* from streams.idl
-* 13 May 1999 22:41:36 o'clock GMT+00:00
-*/
+ * The Holder for {@code BooleanSeq}. For more information on
+ * Holder files, see <a href="doc-files/generatedfiles.html#holder">
+ * "Generated Files: Holder Files"</a>.<P>
+ * org/omg/CORBA/BooleanSeqHolder.java
+ * Generated by the IDL-to-Java compiler (portable), version "3.0"
+ * from streams.idl
+ * 13 May 1999 22:41:36 o'clock GMT+00:00
+ */
public final class BooleanSeqHolder implements org.omg.CORBA.portable.Streamable
{
--- a/corba/src/java.corba/share/classes/org/omg/CORBA/ByteHolder.java Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/org/omg/CORBA/ByteHolder.java Fri Sep 25 12:04:35 2015 -0700
@@ -31,54 +31,54 @@
import org.omg.CORBA.portable.OutputStream;
/**
- * The Holder for <tt>Byte</tt>. For more information on
+ * The Holder for {@code Byte}. For more information on
* Holder files, see <a href="doc-files/generatedfiles.html#holder">
* "Generated Files: Holder Files"</a>.<P>
- * A Holder class for a <code>byte</code>
+ * A Holder class for a {@code byte}
* that is used to store "out" and "inout" parameters in IDL methods.
- * If an IDL method signature has an IDL <code>octet</code> as an "out"
+ * If an IDL method signature has an IDL {@code octet} as an "out"
* or "inout" parameter, the programmer must pass an instance of
- * <code>ByteHolder</code> as the corresponding
+ * {@code ByteHolder} as the corresponding
* parameter in the method invocation; for "inout" parameters, the programmer
* must also fill the "in" value to be sent to the server.
* Before the method invocation returns, the ORB will fill in the
* value corresponding to the "out" value returned from the server.
* <P>
- * If <code>myByteHolder</code> is an instance of <code>ByteHolder</code>,
- * the value stored in its <code>value</code> field can be accessed with
- * <code>myByteHolder.value</code>.
+ * If {@code myByteHolder} is an instance of {@code ByteHolder},
+ * the value stored in its {@code value} field can be accessed with
+ * {@code myByteHolder.value}.
*
* @since JDK1.2
*/
public final class ByteHolder implements Streamable {
/**
- * The <code>byte</code> value held by this <code>ByteHolder</code>
+ * The {@code byte} value held by this {@code ByteHolder}
* object.
*/
public byte value;
/**
- * Constructs a new <code>ByteHolder</code> object with its
- * <code>value</code> field initialized to 0.
+ * Constructs a new {@code ByteHolder} object with its
+ * {@code value} field initialized to 0.
*/
public ByteHolder() {
}
/**
- * Constructs a new <code>ByteHolder</code> object for the given
- * <code>byte</code>.
- * @param initial the <code>byte</code> with which to initialize
- * the <code>value</code> field of the new
- * <code>ByteHolder</code> object
+ * Constructs a new {@code ByteHolder} object for the given
+ * {@code byte}.
+ * @param initial the {@code byte} with which to initialize
+ * the {@code value} field of the new
+ * {@code ByteHolder} object
*/
public ByteHolder(byte initial) {
value = initial;
}
/**
- * Reads from <code>input</code> and initalizes the value in
- * this <code>ByteHolder</code> object
+ * Reads from {@code input} and initalizes the value in
+ * this {@code ByteHolder} object
* with the unmarshalled data.
*
* @param input the InputStream containing CDR formatted data from the wire.
@@ -88,8 +88,8 @@
}
/**
- * Marshals to <code>output</code> the value in
- * this <code>ByteHolder</code> object.
+ * Marshals to {@code output} the value in
+ * this {@code ByteHolder} object.
*
* @param output the OutputStream which will contain the CDR formatted data.
*/
@@ -99,10 +99,10 @@
/**
* Returns the TypeCode corresponding to the value held in
- * this <code>ByteHolder</code> object.
+ * this {@code ByteHolder} object.
*
- * @return the TypeCode of the value held in
- * this <code>ByteHolder</code> object
+ * @return the TypeCode of the value held in
+ * this {@code ByteHolder} object
*/
public org.omg.CORBA.TypeCode _type() {
return ORB.init().get_primitive_tc(TCKind.tk_octet);
--- a/corba/src/java.corba/share/classes/org/omg/CORBA/CharHolder.java Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/org/omg/CORBA/CharHolder.java Fri Sep 25 12:04:35 2015 -0700
@@ -31,54 +31,54 @@
import org.omg.CORBA.portable.OutputStream;
/**
- * The Holder for <tt>Char</tt>. For more information on
+ * The Holder for {@code Char}. For more information on
* Holder files, see <a href="doc-files/generatedfiles.html#holder">
* "Generated Files: Holder Files"</a>.<P>
- * A Holder class for a <code>char</code>
+ * A Holder class for a {@code char}
* that is used to store "out" and "inout" parameters in IDL methods.
- * If an IDL method signature has an IDL <code>char</code> as an "out"
+ * If an IDL method signature has an IDL {@code char} as an "out"
* or "inout" parameter, the programmer must pass an instance of
- * <code>CharHolder</code> as the corresponding
+ * {@code CharHolder} as the corresponding
* parameter in the method invocation; for "inout" parameters, the programmer
* must also fill the "in" value to be sent to the server.
* Before the method invocation returns, the ORB will fill in the
* value corresponding to the "out" value returned from the server.
* <P>
- * If <code>myCharHolder</code> is an instance of <code>CharHolder</code>,
- * the value stored in its <code>value</code> field can be accessed with
- * <code>myCharHolder.value</code>.
+ * If {@code myCharHolder} is an instance of {@code CharHolder},
+ * the value stored in its {@code value} field can be accessed with
+ * {@code myCharHolder.value}.
*
* @since JDK1.2
*/
public final class CharHolder implements Streamable {
/**
- * The <code>char</code> value held by this <code>CharHolder</code>
+ * The {@code char} value held by this {@code CharHolder}
* object.
*/
public char value;
/**
- * Constructs a new <code>CharHolder</code> object with its
- * <code>value</code> field initialized to <code>0</code>.
+ * Constructs a new {@code CharHolder} object with its
+ * {@code value} field initialized to {@code 0}.
*/
public CharHolder() {
}
/**
- * Constructs a new <code>CharHolder</code> object for the given
- * <code>char</code>.
- * @param initial the <code>char</code> with which to initialize
- * the <code>value</code> field of the new
- * <code>CharHolder</code> object
+ * Constructs a new {@code CharHolder} object for the given
+ * {@code char}.
+ * @param initial the {@code char} with which to initialize
+ * the {@code value} field of the new
+ * {@code CharHolder} object
*/
public CharHolder(char initial) {
value = initial;
}
/**
- * Reads from <code>input</code> and initalizes the value in
- * this <code>CharHolder</code> object
+ * Reads from {@code input} and initalizes the value in
+ * this {@code CharHolder} object
* with the unmarshalled data.
*
* @param input the InputStream containing CDR formatted data from the wire
@@ -88,8 +88,8 @@
}
/**
- * Marshals to <code>output</code> the value in
- * this <code>CharHolder</code> object.
+ * Marshals to {@code output} the value in
+ * this {@code CharHolder} object.
*
* @param output the OutputStream which will contain the CDR formatted data
*/
@@ -98,12 +98,12 @@
}
/**
- * Returns the <code>TypeCode</code> object corresponding
+ * Returns the {@code TypeCode} object corresponding
* to the value held in
- * this <code>CharHolder</code> object.
+ * this {@code CharHolder} object.
*
* @return the TypeCode of the value held in
- * this <code>CharHolder</code> object
+ * this {@code CharHolder} object
*/
public org.omg.CORBA.TypeCode _type() {
return ORB.init().get_primitive_tc(TCKind.tk_char);
--- a/corba/src/java.corba/share/classes/org/omg/CORBA/CharSeqHelper.java Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/org/omg/CORBA/CharSeqHelper.java Fri Sep 25 12:04:35 2015 -0700
@@ -26,26 +26,26 @@
/**
-* The Helper for <tt>CharSeq</tt>. For more information on
-* Helper files, see <a href="doc-files/generatedfiles.html#helper">
-* "Generated Files: Helper Files"</a>.<P>
-* org/omg/CORBA/CharSeqHelper.java
-* Generated by the IDL-to-Java compiler (portable), version "3.0"
-* from streams.idl
-* 13 May 1999 22:41:36 o'clock GMT+00:00
-*
-* The class definition has been modified to conform to the following
-* OMG specifications :
-* <ul>
-* <li> ORB core as defined by CORBA 2.3.1
-* (<a href="http://www.omg.org/cgi-bin/doc?formal/99-10-07">formal/99-10-07</a>)
-* </li>
-*
-* <li> IDL/Java Language Mapping as defined in
-* <a href="http://www.omg.org/cgi-bin/doc?ptc/00-01-08">ptc/00-01-08</a>
-* </li>
-* </ul>
-*/
+ * The Helper for {@code CharSeq}. For more information on
+ * Helper files, see <a href="doc-files/generatedfiles.html#helper">
+ * "Generated Files: Helper Files"</a>.<P>
+ * org/omg/CORBA/CharSeqHelper.java
+ * Generated by the IDL-to-Java compiler (portable), version "3.0"
+ * from streams.idl
+ * 13 May 1999 22:41:36 o'clock GMT+00:00
+ *
+ * The class definition has been modified to conform to the following
+ * OMG specifications :
+ * <ul>
+ * <li> ORB core as defined by CORBA 2.3.1
+ * (<a href="http://www.omg.org/cgi-bin/doc?formal/99-10-07">formal/99-10-07</a>)
+ * </li>
+ *
+ * <li> IDL/Java Language Mapping as defined in
+ * <a href="http://www.omg.org/cgi-bin/doc?ptc/00-01-08">ptc/00-01-08</a>
+ * </li>
+ * </ul>
+ */
public abstract class CharSeqHelper
{
--- a/corba/src/java.corba/share/classes/org/omg/CORBA/CharSeqHolder.java Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/org/omg/CORBA/CharSeqHolder.java Fri Sep 25 12:04:35 2015 -0700
@@ -26,14 +26,14 @@
/**
-* The Holder for <tt>CharSeq</tt>. For more information on
-* Holder files, see <a href="doc-files/generatedfiles.html#holder">
-* "Generated Files: Holder Files"</a>.<P>
-* org/omg/CORBA/CharSeqHolder.java
-* Generated by the IDL-to-Java compiler (portable), version "3.0"
-* from streams.idl
-* 13 May 1999 22:41:36 o'clock GMT+00:00
-*/
+ * The Holder for {@code CharSeq}. For more information on
+ * Holder files, see <a href="doc-files/generatedfiles.html#holder">
+ * "Generated Files: Holder Files"</a>.<P>
+ * org/omg/CORBA/CharSeqHolder.java
+ * Generated by the IDL-to-Java compiler (portable), version "3.0"
+ * from streams.idl
+ * 13 May 1999 22:41:36 o'clock GMT+00:00
+ */
public final class CharSeqHolder implements org.omg.CORBA.portable.Streamable
{
--- a/corba/src/java.corba/share/classes/org/omg/CORBA/CompletionStatusHelper.java Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/org/omg/CORBA/CompletionStatusHelper.java Fri Sep 25 12:04:35 2015 -0700
@@ -26,13 +26,13 @@
/**
-* The Helper for <tt>CompletionStatus</tt>. For more information on
-* Helper files, see <a href="doc-files/generatedfiles.html#helper">
-* "Generated Files: Helper Files"</a>.<P>
-* org/omg/CORBA/CompletionStatusHelper.java
-* Generated by the IDL-to-Java compiler (portable), version "3.0"
-* 03 June 1999 11:52:03 o'clock GMT+00:00
-*/
+ * The Helper for {@code CompletionStatus}. For more information on
+ * Helper files, see <a href="doc-files/generatedfiles.html#helper">
+ * "Generated Files: Helper Files"</a>.<P>
+ * org/omg/CORBA/CompletionStatusHelper.java
+ * Generated by the IDL-to-Java compiler (portable), version "3.0"
+ * 03 June 1999 11:52:03 o'clock GMT+00:00
+ */
abstract public class CompletionStatusHelper
{
--- a/corba/src/java.corba/share/classes/org/omg/CORBA/Current.java Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/org/omg/CORBA/Current.java Fri Sep 25 12:04:35 2015 -0700
@@ -26,16 +26,16 @@
/**
-* Interfaces derived from the <tt>Current</tt> interface enable ORB and CORBA
+* Interfaces derived from the {@code Current} interface enable ORB and CORBA
* services to provide access to information (context) associated with
* the thread of execution in which they are running. This information
* is accessed in a structured manner using interfaces derived from the
-* <tt>Current</tt> interface defined in the CORBA module.
+* {@code Current} interface defined in the CORBA module.
*
* <P>Each ORB or CORBA service that needs its own context derives an
-* interface from the CORBA module's <tt>Current</tt>. Users of the
-* service can obtain an instance of the appropriate <tt>Current</tt>
-* interface by invoking <tt>ORB::resolve_initial_references</tt>.<P>
+* interface from the CORBA module's {@code Current}. Users of the
+* service can obtain an instance of the appropriate {@code Current}
+* interface by invoking {@code ORB::resolve_initial_references}.<P>
*
* org/omg/CORBA/Current.java
* Generated by the IDL-to-Java compiler (portable), version "3.0"
--- a/corba/src/java.corba/share/classes/org/omg/CORBA/CurrentHelper.java Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/org/omg/CORBA/CurrentHelper.java Fri Sep 25 12:04:35 2015 -0700
@@ -26,14 +26,14 @@
/**
-* The Helper for <tt>Current</tt>. For more information on
-* Helper files, see <a href="doc-files/generatedfiles.html#helper">
-* "Generated Files: Helper Files"</a>.<P>
-* org/omg/CORBA/CurrentHelper.java
-* Generated by the IDL-to-Java compiler (portable), version "3.0"
-* from ../../../../../src/share/classes/org/omg/PortableServer/corba.idl
-* Saturday, July 17, 1999 12:26:21 AM PDT
-*/
+ * The Helper for {@code Current}. For more information on
+ * Helper files, see <a href="doc-files/generatedfiles.html#helper">
+ * "Generated Files: Helper Files"</a>.<P>
+ * org/omg/CORBA/CurrentHelper.java
+ * Generated by the IDL-to-Java compiler (portable), version "3.0"
+ * from ../../../../../src/share/classes/org/omg/PortableServer/corba.idl
+ * Saturday, July 17, 1999 12:26:21 AM PDT
+ */
abstract public class CurrentHelper
{
--- a/corba/src/java.corba/share/classes/org/omg/CORBA/CurrentHolder.java Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/org/omg/CORBA/CurrentHolder.java Fri Sep 25 12:04:35 2015 -0700
@@ -25,14 +25,14 @@
package org.omg.CORBA;
/**
-* The Holder for <tt>Current</tt>. For more information on
-* Holder files, see <a href="doc-files/generatedfiles.html#holder">
-* "Generated Files: Holder Files"</a>.<P>
-* org/omg/CORBA/CurrentHolder.java
-* Generated by the IDL-to-Java compiler (portable), version "3.0"
-* from ../../../../../src/share/classes/org/omg/PortableServer/corba.idl
-* Saturday, July 17, 1999 12:26:21 AM PDT
-*/
+ * The Holder for {@code Current}. For more information on
+ * Holder files, see <a href="doc-files/generatedfiles.html#holder">
+ * "Generated Files: Holder Files"</a>.<P>
+ * org/omg/CORBA/CurrentHolder.java
+ * Generated by the IDL-to-Java compiler (portable), version "3.0"
+ * from ../../../../../src/share/classes/org/omg/PortableServer/corba.idl
+ * Saturday, July 17, 1999 12:26:21 AM PDT
+ */
public final class CurrentHolder implements org.omg.CORBA.portable.Streamable
{
--- a/corba/src/java.corba/share/classes/org/omg/CORBA/CurrentOperations.java Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/org/omg/CORBA/CurrentOperations.java Fri Sep 25 12:04:35 2015 -0700
@@ -26,15 +26,15 @@
/**
-* The interface for <tt>Current</tt>. For more information on
-* Operations interfaces, see <a href="doc-files/generatedfiles.html">
-* "Generated Files"</a>.
-*
-* org/omg/CORBA/CurrentOperations.java
-* Generated by the IDL-to-Java compiler (portable), version "3.0"
-* from ../../../../../src/share/classes/org/omg/PortableServer/corba.idl
-* Saturday, July 17, 1999 12:26:21 AM PDT.
-*/
+ * The interface for {@code Current}. For more information on
+ * Operations interfaces, see <a href="doc-files/generatedfiles.html">
+ * "Generated Files"</a>.
+ *
+ * org/omg/CORBA/CurrentOperations.java
+ * Generated by the IDL-to-Java compiler (portable), version "3.0"
+ * from ../../../../../src/share/classes/org/omg/PortableServer/corba.idl
+ * Saturday, July 17, 1999 12:26:21 AM PDT.
+ */
public interface CurrentOperations
{
--- a/corba/src/java.corba/share/classes/org/omg/CORBA/CustomMarshal.java Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/org/omg/CORBA/CustomMarshal.java Fri Sep 25 12:04:35 2015 -0700
@@ -34,7 +34,7 @@
* as a custom value type's implicit base class, although the custom
* valuetype does not actually inherit it in IDL. The implementer
* of a custom value type shall provide an implementation of the
- * <tt>CustomMarshal</tt> operations. The manner in which this is done is
+ * {@code CustomMarshal} operations. The manner in which this is done is
* specified in the IDL to Java langauge mapping. Each custom
* marshaled value type shall have its own implementation.
* @see DataInputStream
--- a/corba/src/java.corba/share/classes/org/omg/CORBA/DefinitionKindHelper.java Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/org/omg/CORBA/DefinitionKindHelper.java Fri Sep 25 12:04:35 2015 -0700
@@ -26,14 +26,14 @@
/**
-* The Helper for <tt>DefinitionKind</tt>. For more information on
-* Helper files, see <a href="doc-files/generatedfiles.html#helper">
-* "Generated Files: Helper Files"</a>.<P>
-* org/omg/CORBA/DefinitionKindHelper.java
-* Generated by the IDL-to-Java compiler (portable), version "3.0"
-* from ir.idl
-* 03 June 1999 11:33:43 o'clock GMT+00:00
-*/
+ * The Helper for {@code DefinitionKind}. For more information on
+ * Helper files, see <a href="doc-files/generatedfiles.html#helper">
+ * "Generated Files: Helper Files"</a>.<P>
+ * org/omg/CORBA/DefinitionKindHelper.java
+ * Generated by the IDL-to-Java compiler (portable), version "3.0"
+ * from ir.idl
+ * 03 June 1999 11:33:43 o'clock GMT+00:00
+ */
abstract public class DefinitionKindHelper
{
--- a/corba/src/java.corba/share/classes/org/omg/CORBA/DomainManager.java Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/org/omg/CORBA/DomainManager.java Fri Sep 25 12:04:35 2015 -0700
@@ -25,11 +25,12 @@
package org.omg.CORBA;
-/** Provides mechanisms for establishing and navigating relationships to
+/**
+ * Provides mechanisms for establishing and navigating relationships to
* superior and subordinate domains, as well as for creating and accessing
- * policies. The <tt>DomainManager</tt> has associated with it the policy
- * objects for a
- * particular domain. The domain manager also records the membership of
+ * policies. The {@code DomainManager} has associated with it the policy
+ * objects for a particular domain.
+ * The domain manager also records the membership of
* the domain and provides the means to add and remove members. The domain
* manager is itself a member of a domain, possibly the domain it manages.
* The domain manager provides mechanisms for establishing and navigating
--- a/corba/src/java.corba/share/classes/org/omg/CORBA/DomainManagerOperations.java Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/org/omg/CORBA/DomainManagerOperations.java Fri Sep 25 12:04:35 2015 -0700
@@ -26,9 +26,9 @@
package org.omg.CORBA;
/**
- * Provides the <tt>DomainManager</tt> with the means to access policies.
+ * Provides the {@code DomainManager} with the means to access policies.
* <P>
- * The <tt>DomainManager</tt> has associated with it the policy objects for a
+ * The {@code DomainManager} has associated with it the policy objects for a
* particular domain. The domain manager also records the membership of
* the domain and provides the means to add and remove members. The domain
* manager is itself a member of a domain, possibly the domain it manages.
@@ -39,11 +39,12 @@
public interface DomainManagerOperations
{
- /** This returns the policy of the specified type for objects in
+ /**
+ * This returns the policy of the specified type for objects in
* this domain. The types of policies available are domain specific.
* See the CORBA specification for a list of standard ORB policies.
*
- *@param policy_type Type of policy to request
+ * @param policy_type Type of policy to request
*/
public org.omg.CORBA.Policy get_domain_policy(int policy_type);
}
--- a/corba/src/java.corba/share/classes/org/omg/CORBA/DoubleHolder.java Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/org/omg/CORBA/DoubleHolder.java Fri Sep 25 12:04:35 2015 -0700
@@ -30,47 +30,47 @@
import org.omg.CORBA.portable.OutputStream;
/**
- * The Holder for <tt>Double</tt>. For more information on
+ * The Holder for {@code Double}. For more information on
* Holder files, see <a href="doc-files/generatedfiles.html#holder">
* "Generated Files: Holder Files"</a>.<P>
- * A Holder class for a <code>double</code>
+ * A Holder class for a {@code double}
* that is used to store "out" and "inout" parameters in IDL methods.
- * If an IDL method signature has an IDL <code>double</code> as an "out"
+ * If an IDL method signature has an IDL {@code double} as an "out"
* or "inout" parameter, the programmer must pass an instance of
- * <code>DoubleHolder</code> as the corresponding
+ * {@code DoubleHolder} as the corresponding
* parameter in the method invocation; for "inout" parameters, the programmer
* must also fill the "in" value to be sent to the server.
* Before the method invocation returns, the ORB will fill in the
* value corresponding to the "out" value returned from the server.
* <P>
- * If <code>myDoubleHolder</code> is an instance of <code>DoubleHolder</code>,
- * the value stored in its <code>value</code> field can be accessed with
- * <code>myDoubleHolder.value</code>.
+ * If {@code myDoubleHolder} is an instance of {@code DoubleHolder},
+ * the value stored in its {@code value} field can be accessed with
+ * {@code myDoubleHolder.value}.
*
* @since JDK1.2
*/
public final class DoubleHolder implements Streamable {
/**
- * The <code>double</code> value held by this <code>DoubleHolder</code>
+ * The {@code double} value held by this {@code DoubleHolder}
* object.
*/
public double value;
/**
- * Constructs a new <code>DoubleHolder</code> object with its
- * <code>value</code> field initialized to 0.0.
+ * Constructs a new {@code DoubleHolder} object with its
+ * {@code value} field initialized to 0.0.
*/
public DoubleHolder() {
}
/**
- * Constructs a new <code>DoubleHolder</code> object for the given
- * <code>double</code>.
- * @param initial the <code>double</code> with which to initialize
- * the <code>value</code> field of the new
- * <code>DoubleHolder</code> object
+ * Constructs a new {@code DoubleHolder} object for the given
+ * {@code double}.
+ * @param initial the {@code double} with which to initialize
+ * the {@code value} field of the new
+ * {@code DoubleHolder} object
*/
public DoubleHolder(double initial) {
value = initial;
@@ -80,7 +80,7 @@
* Read a double value from the input stream and store it in the
* value member.
*
- * @param input the <code>InputStream</code> to read from.
+ * @param input the {@code InputStream} to read from.
*/
public void _read(InputStream input) {
value = input.read_double();
@@ -88,18 +88,18 @@
/**
* Write the double value stored in this holder to an
- * <code>OutputStream</code>.
+ * {@code OutputStream}.
*
- * @param output the <code>OutputStream</code> to write into.
+ * @param output the {@code OutputStream} to write into.
*/
public void _write(OutputStream output) {
output.write_double(value);
}
/**
- * Return the <code>TypeCode</code> of this holder object.
+ * Return the {@code TypeCode} of this holder object.
*
- * @return the <code>TypeCode</code> object.
+ * @return the {@code TypeCode} object.
*/
public org.omg.CORBA.TypeCode _type() {
return ORB.init().get_primitive_tc(TCKind.tk_double);
--- a/corba/src/java.corba/share/classes/org/omg/CORBA/DoubleSeqHelper.java Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/org/omg/CORBA/DoubleSeqHelper.java Fri Sep 25 12:04:35 2015 -0700
@@ -26,26 +26,26 @@
/**
-* The Helper for <tt>DoubleSeq</tt>. For more information on
-* Helper files, see <a href="doc-files/generatedfiles.html#helper">
-* "Generated Files: Helper Files"</a>.<P>
-* org/omg/CORBA/DoubleSeqHelper.java
-* Generated by the IDL-to-Java compiler (portable), version "3.0"
-* from streams.idl
-* 13 May 1999 22:41:37 o'clock GMT+00:00
-*
-* The class definition has been modified to conform to the following
-* OMG specifications :
-* <ul>
-* <li> ORB core as defined by CORBA 2.3.1
-* (<a href="http://www.omg.org/cgi-bin/doc?formal/99-10-07">formal/99-10-07</a>)
-* </li>
-*
-* <li> IDL/Java Language Mapping as defined in
-* <a href="http://www.omg.org/cgi-bin/doc?ptc/00-01-08">ptc/00-01-08</a>
-* </li>
-* </ul>
-*/
+ * The Helper for {@code DoubleSeq}. For more information on
+ * Helper files, see <a href="doc-files/generatedfiles.html#helper">
+ * "Generated Files: Helper Files"</a>.<P>
+ * org/omg/CORBA/DoubleSeqHelper.java
+ * Generated by the IDL-to-Java compiler (portable), version "3.0"
+ * from streams.idl
+ * 13 May 1999 22:41:37 o'clock GMT+00:00
+ *
+ * The class definition has been modified to conform to the following
+ * OMG specifications :
+ * <ul>
+ * <li> ORB core as defined by CORBA 2.3.1
+ * (<a href="http://www.omg.org/cgi-bin/doc?formal/99-10-07">formal/99-10-07</a>)
+ * </li>
+ *
+ * <li> IDL/Java Language Mapping as defined in
+ * <a href="http://www.omg.org/cgi-bin/doc?ptc/00-01-08">ptc/00-01-08</a>
+ * </li>
+ * </ul>
+ */
public abstract class DoubleSeqHelper
{
--- a/corba/src/java.corba/share/classes/org/omg/CORBA/DoubleSeqHolder.java Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/org/omg/CORBA/DoubleSeqHolder.java Fri Sep 25 12:04:35 2015 -0700
@@ -26,14 +26,14 @@
/**
-* The Holder for <tt>DoubleSeq</tt>. For more information on
-* Holder files, see <a href="doc-files/generatedfiles.html#holder">
-* "Generated Files: Holder Files"</a>.<P>
-* org/omg/CORBA/DoubleSeqHolder.java
-* Generated by the IDL-to-Java compiler (portable), version "3.0"
-* from streams.idl
-* 13 May 1999 22:41:37 o'clock GMT+00:00
-*/
+ * The Holder for {@code DoubleSeq}. For more information on
+ * Holder files, see <a href="doc-files/generatedfiles.html#holder">
+ * "Generated Files: Holder Files"</a>.<P>
+ * org/omg/CORBA/DoubleSeqHolder.java
+ * Generated by the IDL-to-Java compiler (portable), version "3.0"
+ * from streams.idl
+ * 13 May 1999 22:41:37 o'clock GMT+00:00
+ */
public final class DoubleSeqHolder implements org.omg.CORBA.portable.Streamable
{
--- a/corba/src/java.corba/share/classes/org/omg/CORBA/DynAny.java Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/org/omg/CORBA/DynAny.java Fri Sep 25 12:04:35 2015 -0700
@@ -27,367 +27,368 @@
package org.omg.CORBA;
-/** Enables <tt>org.omg.CORBA.Any</tt> values to be dynamically
+/**
+ * Enables {@code org.omg.CORBA.Any} values to be dynamically
* interpreted (traversed) and
- * constructed. A <tt>DynAny</tt> object is associated with a data value
- * which may correspond to a copy of the value inserted into an <tt>Any</tt>.
- * The <tt>DynAny</tt> APIs enable traversal of the data value associated with an
- * Any at runtime and extraction of the primitive constituents of the
- * data value.
+ * constructed. A {@code DynAny} object is associated with a data value
+ * which may correspond to a copy of the value inserted into an {@code Any}.
+ * The {@code DynAny} APIs enable traversal of the data value associated with an
+ * Any at runtime and extraction of the primitive constituents of the
+ * data value.
* @deprecated Use the new <a href="../DynamicAny/DynAny.html">DynAny</a> instead
*/
@Deprecated
public interface DynAny extends org.omg.CORBA.Object
{
/**
- * Returns the <code>TypeCode</code> of the object inserted into
- * this <code>DynAny</code>.
+ * Returns the {@code TypeCode} of the object inserted into
+ * this {@code DynAny}.
*
- * @return the <code>TypeCode</code> object.
+ * @return the {@code TypeCode} object.
*/
public org.omg.CORBA.TypeCode type() ;
/**
* Copy the contents from one Dynamic Any into another.
*
- * @param dyn_any the <code>DynAny</code> object whose contents
- * are assigned to this <code>DynAny</code>.
+ * @param dyn_any the {@code DynAny} object whose contents
+ * are assigned to this {@code DynAny}.
* @throws org.omg.CORBA.DynAnyPackage.Invalid if the source
- * <code>DynAny</code> is invalid
+ * {@code DynAny} is invalid
*/
public void assign(org.omg.CORBA.DynAny dyn_any)
throws org.omg.CORBA.DynAnyPackage.Invalid;
/**
- * Make a <code>DynAny</code> object from an <code>Any</code>
+ * Make a {@code DynAny} object from an {@code Any}
* object.
*
- * @param value the <code>Any</code> object.
+ * @param value the {@code Any} object.
* @throws org.omg.CORBA.DynAnyPackage.Invalid if the source
- * <code>Any</code> object is empty or bad
+ * {@code Any} object is empty or bad
*/
public void from_any(org.omg.CORBA.Any value)
throws org.omg.CORBA.DynAnyPackage.Invalid;
/**
- * Convert a <code>DynAny</code> object to an <code>Any</code>
+ * Convert a {@code DynAny} object to an {@code Any}
* object.
*
- * @return the <code>Any</code> object.
+ * @return the {@code Any} object.
* @throws org.omg.CORBA.DynAnyPackage.Invalid if this
- * <code>DynAny</code> is empty or bad.
+ * {@code DynAny} is empty or bad.
* created or does not contain a meaningful value
*/
public org.omg.CORBA.Any to_any()
throws org.omg.CORBA.DynAnyPackage.Invalid;
/**
- * Destroys this <code>DynAny</code> object and frees any resources
+ * Destroys this {@code DynAny} object and frees any resources
* used to represent the data value associated with it. This method
- * also destroys all <code>DynAny</code> objects obtained from it.
+ * also destroys all {@code DynAny} objects obtained from it.
* <p>
- * Destruction of <code>DynAny</code> objects should be handled with
+ * Destruction of {@code DynAny} objects should be handled with
* care, taking into account issues dealing with the representation of
- * data values associated with <code>DynAny</code> objects. A programmer
- * who wants to destroy a <code>DynAny</code> object but still be able
+ * data values associated with {@code DynAny} objects. A programmer
+ * who wants to destroy a {@code DynAny} object but still be able
* to manipulate some component of the data value associated with it,
- * should first create a <code>DynAny</code> object for the component
- * and then make a copy of the created <code>DynAny</code> object.
+ * should first create a {@code DynAny} object for the component
+ * and then make a copy of the created {@code DynAny} object.
*/
public void destroy() ;
/**
- * Clones this <code>DynAny</code> object.
+ * Clones this {@code DynAny} object.
*
- * @return a copy of this <code>DynAny</code> object
+ * @return a copy of this {@code DynAny} object
*/
public org.omg.CORBA.DynAny copy() ;
/**
- * Inserts the given <code>boolean</code> as the value for this
- * <code>DynAny</code> object.
+ * Inserts the given {@code boolean} as the value for this
+ * {@code DynAny} object.
*
- * <p> If this method is called on a constructed <code>DynAny</code>
+ * <p> If this method is called on a constructed {@code DynAny}
* object, it initializes the next component of the constructed data
- * value associated with this <code>DynAny</code> object.
+ * value associated with this {@code DynAny} object.
*
- * @param value the <code>boolean</code> to insert into this
- * <code>DynAny</code> object
+ * @param value the {@code boolean} to insert into this
+ * {@code DynAny} object
* @throws org.omg.CORBA.DynAnyPackage.InvalidValue
* if the value inserted is not consistent with the type
- * of the accessed component in this <code>DynAny</code> object
+ * of the accessed component in this {@code DynAny} object
*/
public void insert_boolean(boolean value)
throws org.omg.CORBA.DynAnyPackage.InvalidValue;
/**
- * Inserts the given <code>byte</code> as the value for this
- * <code>DynAny</code> object.
+ * Inserts the given {@code byte} as the value for this
+ * {@code DynAny} object.
*
- * <p> If this method is called on a constructed <code>DynAny</code>
+ * <p> If this method is called on a constructed {@code DynAny}
* object, it initializes the next component of the constructed data
- * value associated with this <code>DynAny</code> object.
+ * value associated with this {@code DynAny} object.
*
- * @param value the <code>byte</code> to insert into this
- * <code>DynAny</code> object
+ * @param value the {@code byte} to insert into this
+ * {@code DynAny} object
* @throws org.omg.CORBA.DynAnyPackage.InvalidValue
* if the value inserted is not consistent with the type
- * of the accessed component in this <code>DynAny</code> object
+ * of the accessed component in this {@code DynAny} object
*/
public void insert_octet(byte value)
throws org.omg.CORBA.DynAnyPackage.InvalidValue;
/**
- * Inserts the given <code>char</code> as the value for this
- * <code>DynAny</code> object.
+ * Inserts the given {@code char} as the value for this
+ * {@code DynAny} object.
*
- * <p> If this method is called on a constructed <code>DynAny</code>
+ * <p> If this method is called on a constructed {@code DynAny}
* object, it initializes the next component of the constructed data
- * value associated with this <code>DynAny</code> object.
+ * value associated with this {@code DynAny} object.
*
- * @param value the <code>char</code> to insert into this
- * <code>DynAny</code> object
+ * @param value the {@code char} to insert into this
+ * {@code DynAny} object
* @throws org.omg.CORBA.DynAnyPackage.InvalidValue
* if the value inserted is not consistent with the type
- * of the accessed component in this <code>DynAny</code> object
+ * of the accessed component in this {@code DynAny} object
*/
public void insert_char(char value)
throws org.omg.CORBA.DynAnyPackage.InvalidValue;
/**
- * Inserts the given <code>short</code> as the value for this
- * <code>DynAny</code> object.
+ * Inserts the given {@code short} as the value for this
+ * {@code DynAny} object.
*
- * <p> If this method is called on a constructed <code>DynAny</code>
+ * <p> If this method is called on a constructed {@code DynAny}
* object, it initializes the next component of the constructed data
- * value associated with this <code>DynAny</code> object.
+ * value associated with this {@code DynAny} object.
*
- * @param value the <code>short</code> to insert into this
- * <code>DynAny</code> object
+ * @param value the {@code short} to insert into this
+ * {@code DynAny} object
* @throws org.omg.CORBA.DynAnyPackage.InvalidValue
* if the value inserted is not consistent with the type
- * of the accessed component in this <code>DynAny</code> object
+ * of the accessed component in this {@code DynAny} object
*/
public void insert_short(short value)
throws org.omg.CORBA.DynAnyPackage.InvalidValue;
/**
- * Inserts the given <code>short</code> as the value for this
- * <code>DynAny</code> object.
+ * Inserts the given {@code short} as the value for this
+ * {@code DynAny} object.
*
- * <p> If this method is called on a constructed <code>DynAny</code>
+ * <p> If this method is called on a constructed {@code DynAny}
* object, it initializes the next component of the constructed data
- * value associated with this <code>DynAny</code> object.
+ * value associated with this {@code DynAny} object.
*
- * @param value the <code>short</code> to insert into this
- * <code>DynAny</code> object
+ * @param value the {@code short} to insert into this
+ * {@code DynAny} object
* @throws org.omg.CORBA.DynAnyPackage.InvalidValue
* if the value inserted is not consistent with the type
- * of the accessed component in this <code>DynAny</code> object
+ * of the accessed component in this {@code DynAny} object
*/
public void insert_ushort(short value)
throws org.omg.CORBA.DynAnyPackage.InvalidValue;
/**
- * Inserts the given <code>int</code> as the value for this
- * <code>DynAny</code> object.
+ * Inserts the given {@code int} as the value for this
+ * {@code DynAny} object.
*
- * <p> If this method is called on a constructed <code>DynAny</code>
+ * <p> If this method is called on a constructed {@code DynAny}
* object, it initializes the next component of the constructed data
- * value associated with this <code>DynAny</code> object.
+ * value associated with this {@code DynAny} object.
*
- * @param value the <code>int</code> to insert into this
- * <code>DynAny</code> object
+ * @param value the {@code int} to insert into this
+ * {@code DynAny} object
* @throws org.omg.CORBA.DynAnyPackage.InvalidValue
* if the value inserted is not consistent with the type
- * of the accessed component in this <code>DynAny</code> object
+ * of the accessed component in this {@code DynAny} object
*/
public void insert_long(int value)
throws org.omg.CORBA.DynAnyPackage.InvalidValue;
/**
- * Inserts the given <code>int</code> as the value for this
- * <code>DynAny</code> object.
+ * Inserts the given {@code int} as the value for this
+ * {@code DynAny} object.
*
- * <p> If this method is called on a constructed <code>DynAny</code>
+ * <p> If this method is called on a constructed {@code DynAny}
* object, it initializes the next component of the constructed data
- * value associated with this <code>DynAny</code> object.
+ * value associated with this {@code DynAny} object.
*
- * @param value the <code>int</code> to insert into this
- * <code>DynAny</code> object
+ * @param value the {@code int} to insert into this
+ * {@code DynAny} object
* @throws org.omg.CORBA.DynAnyPackage.InvalidValue
* if the value inserted is not consistent with the type
- * of the accessed component in this <code>DynAny</code> object
+ * of the accessed component in this {@code DynAny} object
*/
public void insert_ulong(int value)
throws org.omg.CORBA.DynAnyPackage.InvalidValue;
/**
- * Inserts the given <code>float</code> as the value for this
- * <code>DynAny</code> object.
+ * Inserts the given {@code float} as the value for this
+ * {@code DynAny} object.
*
- * <p> If this method is called on a constructed <code>DynAny</code>
+ * <p> If this method is called on a constructed {@code DynAny}
* object, it initializes the next component of the constructed data
- * value associated with this <code>DynAny</code> object.
+ * value associated with this {@code DynAny} object.
*
- * @param value the <code>float</code> to insert into this
- * <code>DynAny</code> object
+ * @param value the {@code float} to insert into this
+ * {@code DynAny} object
* @throws org.omg.CORBA.DynAnyPackage.InvalidValue
* if the value inserted is not consistent with the type
- * of the accessed component in this <code>DynAny</code> object
+ * of the accessed component in this {@code DynAny} object
*/
public void insert_float(float value)
throws org.omg.CORBA.DynAnyPackage.InvalidValue;
/**
- * Inserts the given <code>double</code> as the value for this
- * <code>DynAny</code> object.
+ * Inserts the given {@code double} as the value for this
+ * {@code DynAny} object.
*
- * <p> If this method is called on a constructed <code>DynAny</code>
+ * <p> If this method is called on a constructed {@code DynAny}
* object, it initializes the next component of the constructed data
- * value associated with this <code>DynAny</code> object.
+ * value associated with this {@code DynAny} object.
*
- * @param value the <code>double</code> to insert into this
- * <code>DynAny</code> object
+ * @param value the {@code double} to insert into this
+ * {@code DynAny} object
* @throws org.omg.CORBA.DynAnyPackage.InvalidValue
* if the value inserted is not consistent with the type
- * of the accessed component in this <code>DynAny</code> object
+ * of the accessed component in this {@code DynAny} object
*/
public void insert_double(double value)
throws org.omg.CORBA.DynAnyPackage.InvalidValue;
/**
- * Inserts the given <code>String</code> object as the value for this
- * <code>DynAny</code> object.
+ * Inserts the given {@code String} object as the value for this
+ * {@code DynAny} object.
*
- * <p> If this method is called on a constructed <code>DynAny</code>
+ * <p> If this method is called on a constructed {@code DynAny}
* object, it initializes the next component of the constructed data
- * value associated with this <code>DynAny</code> object.
+ * value associated with this {@code DynAny} object.
*
- * @param value the <code>String</code> to insert into this
- * <code>DynAny</code> object
+ * @param value the {@code String} to insert into this
+ * {@code DynAny} object
* @throws org.omg.CORBA.DynAnyPackage.InvalidValue
* if the value inserted is not consistent with the type
- * of the accessed component in this <code>DynAny</code> object
+ * of the accessed component in this {@code DynAny} object
*/
public void insert_string(String value)
throws org.omg.CORBA.DynAnyPackage.InvalidValue;
/**
- * Inserts the given <code>org.omg.CORBA.Object</code> as the value for this
- * <code>DynAny</code> object.
+ * Inserts the given {@code org.omg.CORBA.Object} as the value for this
+ * {@code DynAny} object.
*
- * <p> If this method is called on a constructed <code>DynAny</code>
+ * <p> If this method is called on a constructed {@code DynAny}
* object, it initializes the next component of the constructed data
- * value associated with this <code>DynAny</code> object.
+ * value associated with this {@code DynAny} object.
*
- * @param value the <code>org.omg.CORBA.Object</code> to insert into this
- * <code>DynAny</code> object
+ * @param value the {@code org.omg.CORBA.Object} to insert into this
+ * {@code DynAny} object
* @throws org.omg.CORBA.DynAnyPackage.InvalidValue
* if the value inserted is not consistent with the type
- * of the accessed component in this <code>DynAny</code> object
+ * of the accessed component in this {@code DynAny} object
*/
public void insert_reference(org.omg.CORBA.Object value)
throws org.omg.CORBA.DynAnyPackage.InvalidValue;
/**
- * Inserts the given <code>org.omg.CORBA.TypeCode</code> as the value for this
- * <code>DynAny</code> object.
+ * Inserts the given {@code org.omg.CORBA.TypeCode} as the value for this
+ * {@code DynAny} object.
*
- * <p> If this method is called on a constructed <code>DynAny</code>
+ * <p> If this method is called on a constructed {@code DynAny}
* object, it initializes the next component of the constructed data
- * value associated with this <code>DynAny</code> object.
+ * value associated with this {@code DynAny} object.
*
- * @param value the <code>org.omg.CORBA.TypeCode</code> to insert into this
- * <code>DynAny</code> object
+ * @param value the {@code org.omg.CORBA.TypeCode} to insert into this
+ * {@code DynAny} object
* @throws org.omg.CORBA.DynAnyPackage.InvalidValue
* if the value inserted is not consistent with the type
- * of the accessed component in this <code>DynAny</code> object
+ * of the accessed component in this {@code DynAny} object
*/
public void insert_typecode(org.omg.CORBA.TypeCode value)
throws org.omg.CORBA.DynAnyPackage.InvalidValue;
/**
- * Inserts the given <code>long</code> as the value for this
- * <code>DynAny</code> object.
+ * Inserts the given {@code long} as the value for this
+ * {@code DynAny} object.
*
- * <p> If this method is called on a constructed <code>DynAny</code>
+ * <p> If this method is called on a constructed {@code DynAny}
* object, it initializes the next component of the constructed data
- * value associated with this <code>DynAny</code> object.
+ * value associated with this {@code DynAny} object.
*
- * @param value the <code>long</code> to insert into this
- * <code>DynAny</code> object
+ * @param value the {@code long} to insert into this
+ * {@code DynAny} object
* @throws org.omg.CORBA.DynAnyPackage.InvalidValue
* if the value inserted is not consistent with the type
- * of the accessed component in this <code>DynAny</code> object
+ * of the accessed component in this {@code DynAny} object
*/
public void insert_longlong(long value)
throws org.omg.CORBA.DynAnyPackage.InvalidValue;
/**
- * Inserts the given <code>long</code> as the value for this
- * <code>DynAny</code> object.
+ * Inserts the given {@code long} as the value for this
+ * {@code DynAny} object.
*
- * <p> If this method is called on a constructed <code>DynAny</code>
+ * <p> If this method is called on a constructed {@code DynAny}
* object, it initializes the next component of the constructed data
- * value associated with this <code>DynAny</code> object.
+ * value associated with this {@code DynAny} object.
*
- * @param value the <code>long</code> to insert into this
- * <code>DynAny</code> object
+ * @param value the {@code long} to insert into this
+ * {@code DynAny} object
* @throws org.omg.CORBA.DynAnyPackage.InvalidValue
* if the value inserted is not consistent with the type
- * of the accessed component in this <code>DynAny</code> object
+ * of the accessed component in this {@code DynAny} object
*/
public void insert_ulonglong(long value)
throws org.omg.CORBA.DynAnyPackage.InvalidValue;
/**
- * Inserts the given <code>char</code> as the value for this
- * <code>DynAny</code> object.
+ * Inserts the given {@code char} as the value for this
+ * {@code DynAny} object.
*
- * <p> If this method is called on a constructed <code>DynAny</code>
+ * <p> If this method is called on a constructed {@code DynAny}
* object, it initializes the next component of the constructed data
- * value associated with this <code>DynAny</code> object.
+ * value associated with this {@code DynAny} object.
*
- * @param value the <code>char</code> to insert into this
- * <code>DynAny</code> object
+ * @param value the {@code char} to insert into this
+ * {@code DynAny} object
* @throws org.omg.CORBA.DynAnyPackage.InvalidValue
* if the value inserted is not consistent with the type
- * of the accessed component in this <code>DynAny</code> object
+ * of the accessed component in this {@code DynAny} object
*/
public void insert_wchar(char value)
throws org.omg.CORBA.DynAnyPackage.InvalidValue;
/**
- * Inserts the given <code>String</code> as the value for this
- * <code>DynAny</code> object.
+ * Inserts the given {@code String} as the value for this
+ * {@code DynAny} object.
*
- * <p> If this method is called on a constructed <code>DynAny</code>
+ * <p> If this method is called on a constructed {@code DynAny}
* object, it initializes the next component of the constructed data
- * value associated with this <code>DynAny</code> object.
+ * value associated with this {@code DynAny} object.
*
- * @param value the <code>String</code> to insert into this
- * <code>DynAny</code> object
+ * @param value the {@code String} to insert into this
+ * {@code DynAny} object
* @throws org.omg.CORBA.DynAnyPackage.InvalidValue
* if the value inserted is not consistent with the type
- * of the accessed component in this <code>DynAny</code> object
+ * of the accessed component in this {@code DynAny} object
*/
public void insert_wstring(String value)
throws org.omg.CORBA.DynAnyPackage.InvalidValue;
/**
- * Inserts the given <code>org.omg.CORBA.Any</code> object as the value for this
- * <code>DynAny</code> object.
+ * Inserts the given {@code org.omg.CORBA.Any} object as the value for this
+ * {@code DynAny} object.
*
- * <p> If this method is called on a constructed <code>DynAny</code>
+ * <p> If this method is called on a constructed {@code DynAny}
* object, it initializes the next component of the constructed data
- * value associated with this <code>DynAny</code> object.
+ * value associated with this {@code DynAny} object.
*
- * @param value the <code>org.omg.CORBA.Any</code> object to insert into this
- * <code>DynAny</code> object
+ * @param value the {@code org.omg.CORBA.Any} object to insert into this
+ * {@code DynAny} object
* @throws org.omg.CORBA.DynAnyPackage.InvalidValue
* if the value inserted is not consistent with the type
- * of the accessed component in this <code>DynAny</code> object
+ * of the accessed component in this {@code DynAny} object
*/
public void insert_any(org.omg.CORBA.Any value)
throws org.omg.CORBA.DynAnyPackage.InvalidValue;
@@ -395,32 +396,32 @@
// orbos 98-01-18: Objects By Value -- begin
/**
- * Inserts the given <code>java.io.Serializable</code> object as the value for this
- * <code>DynAny</code> object.
+ * Inserts the given {@code java.io.Serializable} object as the value for this
+ * {@code DynAny} object.
*
- * <p> If this method is called on a constructed <code>DynAny</code>
+ * <p> If this method is called on a constructed {@code DynAny}
* object, it initializes the next component of the constructed data
- * value associated with this <code>DynAny</code> object.
+ * value associated with this {@code DynAny} object.
*
- * @param value the <code>java.io.Serializable</code> object to insert into this
- * <code>DynAny</code> object
+ * @param value the {@code java.io.Serializable} object to insert into this
+ * {@code DynAny} object
* @throws org.omg.CORBA.DynAnyPackage.InvalidValue
* if the value inserted is not consistent with the type
- * of the accessed component in this <code>DynAny</code> object
+ * of the accessed component in this {@code DynAny} object
*/
public void insert_val(java.io.Serializable value)
throws org.omg.CORBA.DynAnyPackage.InvalidValue;
/**
- * Retrieves the <code>java.io.Serializable</code> object contained
- * in this <code>DynAny</code> object.
+ * Retrieves the {@code java.io.Serializable} object contained
+ * in this {@code DynAny} object.
*
- * @return the <code>java.io.Serializable</code> object that is the
- * value for this <code>DynAny</code> object
+ * @return the {@code java.io.Serializable} object that is the
+ * value for this {@code DynAny} object
* @throws org.omg.CORBA.DynAnyPackage.TypeMismatch
* if the type code of the accessed component in this
- * <code>DynAny</code> object is not equivalent to
- * the type code for a <code>java.io.Serializable</code> object
+ * {@code DynAny} object is not equivalent to
+ * the type code for a {@code java.io.Serializable} object
*/
public java.io.Serializable get_val()
throws org.omg.CORBA.DynAnyPackage.TypeMismatch;
@@ -428,284 +429,284 @@
// orbos 98-01-18: Objects By Value -- end
/**
- * Retrieves the <code>boolean</code> contained
- * in this <code>DynAny</code> object.
+ * Retrieves the {@code boolean} contained
+ * in this {@code DynAny} object.
*
- * @return the <code>boolean</code> that is the
- * value for this <code>DynAny</code> object
+ * @return the {@code boolean} that is the
+ * value for this {@code DynAny} object
* @throws org.omg.CORBA.DynAnyPackage.TypeMismatch
* if the type code of the accessed component in this
- * <code>DynAny</code> object is not equivalent to
- * the type code for a <code>boolean</code>
+ * {@code DynAny} object is not equivalent to
+ * the type code for a {@code boolean}
*/
public boolean get_boolean()
throws org.omg.CORBA.DynAnyPackage.TypeMismatch;
/**
- * Retrieves the <code>byte</code> contained
- * in this <code>DynAny</code> object.
+ * Retrieves the {@code byte} contained
+ * in this {@code DynAny} object.
*
- * @return the <code>byte</code> that is the
- * value for this <code>DynAny</code> object
+ * @return the {@code byte} that is the
+ * value for this {@code DynAny} object
* @throws org.omg.CORBA.DynAnyPackage.TypeMismatch
* if the type code of the accessed component in this
- * <code>DynAny</code> object is not equivalent to
- * the type code for a <code>byte</code>
+ * {@code DynAny} object is not equivalent to
+ * the type code for a {@code byte}
*/
public byte get_octet()
throws org.omg.CORBA.DynAnyPackage.TypeMismatch;
/**
- * Retrieves the <code>char</code> contained
- * in this <code>DynAny</code> object.
+ * Retrieves the {@code char} contained
+ * in this {@code DynAny} object.
*
- * @return the <code>char</code> that is the
- * value for this <code>DynAny</code> object
+ * @return the {@code char} that is the
+ * value for this {@code DynAny} object
* @throws org.omg.CORBA.DynAnyPackage.TypeMismatch
* if the type code of the accessed component in this
- * <code>DynAny</code> object is not equivalent to
- * the type code for a <code>char</code>
+ * {@code DynAny} object is not equivalent to
+ * the type code for a {@code char}
*/
public char get_char()
throws org.omg.CORBA.DynAnyPackage.TypeMismatch;
/**
- * Retrieves the <code>short</code> contained
- * in this <code>DynAny</code> object.
+ * Retrieves the {@code short} contained
+ * in this {@code DynAny} object.
*
- * @return the <code>short</code> that is the
- * value for this <code>DynAny</code> object
+ * @return the {@code short} that is the
+ * value for this {@code DynAny} object
* @throws org.omg.CORBA.DynAnyPackage.TypeMismatch
* if the type code of the accessed component in this
- * <code>DynAny</code> object is not equivalent to
- * the type code for a <code>short</code>
+ * {@code DynAny} object is not equivalent to
+ * the type code for a {@code short}
*/
public short get_short()
throws org.omg.CORBA.DynAnyPackage.TypeMismatch;
/**
- * Retrieves the <code>short</code> contained
- * in this <code>DynAny</code> object.
+ * Retrieves the {@code short} contained
+ * in this {@code DynAny} object.
*
- * @return the <code>short</code> that is the
- * value for this <code>DynAny</code> object
+ * @return the {@code short} that is the
+ * value for this {@code DynAny} object
* @throws org.omg.CORBA.DynAnyPackage.TypeMismatch
* if the type code of the accessed component in this
- * <code>DynAny</code> object is not equivalent to
- * the type code for a <code>short</code>
+ * {@code DynAny} object is not equivalent to
+ * the type code for a {@code short}
*/
public short get_ushort()
throws org.omg.CORBA.DynAnyPackage.TypeMismatch;
/**
- * Retrieves the <code>int</code> contained
- * in this <code>DynAny</code> object.
+ * Retrieves the {@code int} contained
+ * in this {@code DynAny} object.
*
- * @return the <code>int</code> that is the
- * value for this <code>DynAny</code> object
+ * @return the {@code int} that is the
+ * value for this {@code DynAny} object
* @throws org.omg.CORBA.DynAnyPackage.TypeMismatch
* if the type code of the accessed component in this
- * <code>DynAny</code> object is not equivalent to
- * the type code for a <code>int</code>
+ * {@code DynAny} object is not equivalent to
+ * the type code for a {@code int}
*/
public int get_long()
throws org.omg.CORBA.DynAnyPackage.TypeMismatch;
/**
- * Retrieves the <code>int</code> contained
- * in this <code>DynAny</code> object.
+ * Retrieves the {@code int} contained
+ * in this {@code DynAny} object.
*
- * @return the <code>int</code> that is the
- * value for this <code>DynAny</code> object
+ * @return the {@code int} that is the
+ * value for this {@code DynAny} object
* @throws org.omg.CORBA.DynAnyPackage.TypeMismatch
* if the type code of the accessed component in this
- * <code>DynAny</code> object is not equivalent to
- * the type code for a <code>int</code>
+ * {@code DynAny} object is not equivalent to
+ * the type code for a {@code int}
*/
public int get_ulong()
throws org.omg.CORBA.DynAnyPackage.TypeMismatch;
/**
- * Retrieves the <code>float</code> contained
- * in this <code>DynAny</code> object.
+ * Retrieves the {@code float} contained
+ * in this {@code DynAny} object.
*
- * @return the <code>float</code> that is the
- * value for this <code>DynAny</code> object
+ * @return the {@code float} that is the
+ * value for this {@code DynAny} object
* @throws org.omg.CORBA.DynAnyPackage.TypeMismatch
* if the type code of the accessed component in this
- * <code>DynAny</code> object is not equivalent to
- * the type code for a <code>float</code>
+ * {@code DynAny} object is not equivalent to
+ * the type code for a {@code float}
*/
public float get_float()
throws org.omg.CORBA.DynAnyPackage.TypeMismatch;
/**
- * Retrieves the <code>double</code> contained
- * in this <code>DynAny</code> object.
+ * Retrieves the {@code double} contained
+ * in this {@code DynAny} object.
*
- * @return the <code>double</code> that is the
- * value for this <code>DynAny</code> object
+ * @return the {@code double} that is the
+ * value for this {@code DynAny} object
* @throws org.omg.CORBA.DynAnyPackage.TypeMismatch
* if the type code of the accessed component in this
- * <code>DynAny</code> object is not equivalent to
- * the type code for a <code>double</code>
+ * {@code DynAny} object is not equivalent to
+ * the type code for a {@code double}
*/
public double get_double()
throws org.omg.CORBA.DynAnyPackage.TypeMismatch;
/**
- * Retrieves the <code>String</code> contained
- * in this <code>DynAny</code> object.
+ * Retrieves the {@code String} contained
+ * in this {@code DynAny} object.
*
- * @return the <code>String</code> that is the
- * value for this <code>DynAny</code> object
+ * @return the {@code String} that is the
+ * value for this {@code DynAny} object
* @throws org.omg.CORBA.DynAnyPackage.TypeMismatch
* if the type code of the accessed component in this
- * <code>DynAny</code> object is not equivalent to
- * the type code for a <code>String</code>
+ * {@code DynAny} object is not equivalent to
+ * the type code for a {@code String}
*/
public String get_string()
throws org.omg.CORBA.DynAnyPackage.TypeMismatch;
/**
- * Retrieves the <code>org.omg.CORBA.Other</code> contained
- * in this <code>DynAny</code> object.
+ * Retrieves the {@code org.omg.CORBA.Other} contained
+ * in this {@code DynAny} object.
*
- * @return the <code>org.omg.CORBA.Other</code> that is the
- * value for this <code>DynAny</code> object
+ * @return the {@code org.omg.CORBA.Other} that is the
+ * value for this {@code DynAny} object
* @throws org.omg.CORBA.DynAnyPackage.TypeMismatch
* if the type code of the accessed component in this
- * <code>DynAny</code> object is not equivalent to
- * the type code for an <code>org.omg.CORBA.Other</code>
+ * {@code DynAny} object is not equivalent to
+ * the type code for an {@code org.omg.CORBA.Other}
*/
public org.omg.CORBA.Object get_reference()
throws org.omg.CORBA.DynAnyPackage.TypeMismatch;
/**
- * Retrieves the <code>org.omg.CORBA.TypeCode</code> contained
- * in this <code>DynAny</code> object.
+ * Retrieves the {@code org.omg.CORBA.TypeCode} contained
+ * in this {@code DynAny} object.
*
- * @return the <code>org.omg.CORBA.TypeCode</code> that is the
- * value for this <code>DynAny</code> object
+ * @return the {@code org.omg.CORBA.TypeCode} that is the
+ * value for this {@code DynAny} object
* @throws org.omg.CORBA.DynAnyPackage.TypeMismatch
* if the type code of the accessed component in this
- * <code>DynAny</code> object is not equivalent to
- * the type code for a <code>org.omg.CORBA.TypeCode</code>
+ * {@code DynAny} object is not equivalent to
+ * the type code for a {@code org.omg.CORBA.TypeCode}
*/
public org.omg.CORBA.TypeCode get_typecode()
throws org.omg.CORBA.DynAnyPackage.TypeMismatch;
/**
- * Retrieves the <code>long</code> contained
- * in this <code>DynAny</code> object.
+ * Retrieves the {@code long} contained
+ * in this {@code DynAny} object.
*
- * @return the <code>long</code> that is the
- * value for this <code>DynAny</code> object
+ * @return the {@code long} that is the
+ * value for this {@code DynAny} object
* @throws org.omg.CORBA.DynAnyPackage.TypeMismatch
* if the type code of the accessed component in this
- * <code>DynAny</code> object is not equivalent to
- * the type code for a <code>long</code>
+ * {@code DynAny} object is not equivalent to
+ * the type code for a {@code long}
*/
public long get_longlong()
throws org.omg.CORBA.DynAnyPackage.TypeMismatch;
/**
- * Retrieves the <code>long</code> contained
- * in this <code>DynAny</code> object.
+ * Retrieves the {@code long} contained
+ * in this {@code DynAny} object.
*
- * @return the <code>long</code> that is the
- * value for this <code>DynAny</code> object
+ * @return the {@code long} that is the
+ * value for this {@code DynAny} object
* @throws org.omg.CORBA.DynAnyPackage.TypeMismatch
* if the type code of the accessed component in this
- * <code>DynAny</code> object is not equivalent to
- * the type code for a <code>long</code>
+ * {@code DynAny} object is not equivalent to
+ * the type code for a {@code long}
*/
public long get_ulonglong()
throws org.omg.CORBA.DynAnyPackage.TypeMismatch;
/**
- * Retrieves the <code>char</code> contained
- * in this <code>DynAny</code> object.
+ * Retrieves the {@code char} contained
+ * in this {@code DynAny} object.
*
- * @return the <code>char</code> that is the
- * value for this <code>DynAny</code> object
+ * @return the {@code char} that is the
+ * value for this {@code DynAny} object
* @throws org.omg.CORBA.DynAnyPackage.TypeMismatch
* if the type code of the accessed component in this
- * <code>DynAny</code> object is not equivalent to
- * the type code for a <code>char</code>
+ * {@code DynAny} object is not equivalent to
+ * the type code for a {@code char}
*/
public char get_wchar()
throws org.omg.CORBA.DynAnyPackage.TypeMismatch;
/**
- * Retrieves the <code>String</code> contained
- * in this <code>DynAny</code> object.
+ * Retrieves the {@code String} contained
+ * in this {@code DynAny} object.
*
- * @return the <code>String</code> that is the
- * value for this <code>DynAny</code> object
+ * @return the {@code String} that is the
+ * value for this {@code DynAny} object
* @throws org.omg.CORBA.DynAnyPackage.TypeMismatch
* if the type code of the accessed component in this
- * <code>DynAny</code> object is not equivalent to
- * the type code for a <code>String</code>
+ * {@code DynAny} object is not equivalent to
+ * the type code for a {@code String}
*/
public String get_wstring()
throws org.omg.CORBA.DynAnyPackage.TypeMismatch;
/**
- * Retrieves the <code>org.omg.CORBA.Any</code> contained
- * in this <code>DynAny</code> object.
+ * Retrieves the {@code org.omg.CORBA.Any} contained
+ * in this {@code DynAny} object.
*
- * @return the <code>org.omg.CORBA.Any</code> that is the
- * value for this <code>DynAny</code> object
+ * @return the {@code org.omg.CORBA.Any} that is the
+ * value for this {@code DynAny} object
* @throws org.omg.CORBA.DynAnyPackage.TypeMismatch
* if the type code of the accessed component in this
- * <code>DynAny</code> object is not equivalent to
- * the type code for an <code>org.omg.CORBA.Any</code>
+ * {@code DynAny} object is not equivalent to
+ * the type code for an {@code org.omg.CORBA.Any}
*/
public org.omg.CORBA.Any get_any()
throws org.omg.CORBA.DynAnyPackage.TypeMismatch;
/**
- * Returns a <code>DynAny</code> object reference that can
+ * Returns a {@code DynAny} object reference that can
* be used to get/set the value of the component currently accessed.
- * The appropriate <code>insert</code> method
- * can be called on the resulting <code>DynAny</code> object
+ * The appropriate {@code insert} method
+ * can be called on the resulting {@code DynAny} object
* to initialize the component.
- * The appropriate <code>get</code> method
- * can be called on the resulting <code>DynAny</code> object
+ * The appropriate {@code get} method
+ * can be called on the resulting {@code DynAny} object
* to extract the value of the component.
*
- * @return a <code>DynAny</code> object reference that can be
+ * @return a {@code DynAny} object reference that can be
* used to retrieve or set the value of the component currently
* accessed
*/
public org.omg.CORBA.DynAny current_component() ;
/**
- * Moves to the next component of this <code>DynAny</code> object.
+ * Moves to the next component of this {@code DynAny} object.
* This method is used for iterating through the components of
* a constructed type, effectively moving a pointer from one
* component to the next. The pointer starts out on the first
- * component when a <code>DynAny</code> object is created.
+ * component when a {@code DynAny} object is created.
*
- * @return <code>true</code> if the pointer points to a component;
- * <code>false</code> if there are no more components or this
- * <code>DynAny</code> is associated with a basic type rather than
+ * @return {@code true} if the pointer points to a component;
+ * {@code false} if there are no more components or this
+ * {@code DynAny} is associated with a basic type rather than
* a constructed type
*/
public boolean next() ;
@@ -714,12 +715,12 @@
* Moves the internal pointer to the given index. Logically, this method
* sets a new offset for this pointer.
*
- * @param index an <code>int</code> indicating the position to which
+ * @param index an {@code int} indicating the position to which
* the pointer should move. The first position is 0.
- * @return <code>true</code> if the pointer points to a component;
- * <code>false</code> if there is no component at the designated
- * index. If this <code>DynAny</code> object is associated with a
- * basic type, this method returns <code>false</code> for any index
+ * @return {@code true} if the pointer points to a component;
+ * {@code false} if there is no component at the designated
+ * index. If this {@code DynAny} object is associated with a
+ * basic type, this method returns {@code false} for any index
* other than 0.
*/
public boolean seek(int index) ;
--- a/corba/src/java.corba/share/classes/org/omg/CORBA/DynArray.java Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/org/omg/CORBA/DynArray.java Fri Sep 25 12:04:35 2015 -0700
@@ -27,8 +27,9 @@
package org.omg.CORBA;
-/** Represents a <tt>DynAny</tt> object associated
- * with an array.
+/**
+ * Represents a {@code DynAny} object associated with an array.
+ *
* @deprecated Use the new <a href="../DynamicAny/DynArray.html">DynArray</a> instead
*/
@Deprecated
--- a/corba/src/java.corba/share/classes/org/omg/CORBA/DynEnum.java Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/org/omg/CORBA/DynEnum.java Fri Sep 25 12:04:35 2015 -0700
@@ -26,8 +26,9 @@
package org.omg.CORBA;
-/** Represents a <tt>DynAny</tt> object associated
- * with an IDL enum.
+/**
+ * Represents a {@code DynAny} object associated with an IDL enum.
+ *
* @deprecated Use the new <a href="../DynamicAny/DynEnum.html">DynEnum</a> instead
*/
@Deprecated
@@ -35,14 +36,14 @@
{
/**
* Return the value of the IDL enum stored in this
- * <code>DynEnum</code> as a string.
+ * {@code DynEnum} as a string.
*
* @return the stringified value.
*/
public String value_as_string();
/**
- * Set a particular enum in this <code>DynEnum</code>.
+ * Set a particular enum in this {@code DynEnum}.
*
* @param arg the string corresponding to the value.
*/
--- a/corba/src/java.corba/share/classes/org/omg/CORBA/FieldNameHelper.java Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/org/omg/CORBA/FieldNameHelper.java Fri Sep 25 12:04:35 2015 -0700
@@ -26,13 +26,13 @@
/**
-* The Helper for <tt>FieldName</tt>. For more information on
-* Helper files, see <a href="doc-files/generatedfiles.html#helper">
-* "Generated Files: Helper Files"</a>.<P>
-* org/omg/CORBA/FieldNameHelper.java
-* Generated by the IDL-to-Java compiler (portable), version "3.0"
-* 03 June 1999 11:52:03 o'clock GMT+00:00
-*/
+ * The Helper for {@code FieldName}. For more information on
+ * Helper files, see <a href="doc-files/generatedfiles.html#helper">
+ * "Generated Files: Helper Files"</a>.<P>
+ * org/omg/CORBA/FieldNameHelper.java
+ * Generated by the IDL-to-Java compiler (portable), version "3.0"
+ * 03 June 1999 11:52:03 o'clock GMT+00:00
+ */
abstract public class FieldNameHelper
{
--- a/corba/src/java.corba/share/classes/org/omg/CORBA/FixedHolder.java Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/org/omg/CORBA/FixedHolder.java Fri Sep 25 12:04:35 2015 -0700
@@ -31,7 +31,7 @@
/**
- * The Holder for <tt>Fixed</tt>. For more information on
+ * The Holder for {@code Fixed}. For more information on
* Holder files, see <a href="doc-files/generatedfiles.html#holder">
* "Generated Files: Holder Files"</a>.<P>
* FixedHolder is a container class for values of IDL type "fixed",
@@ -69,7 +69,7 @@
* Read a fixed point value from the input stream and store it in
* the value member.
*
- * @param input the <code>InputStream</code> to read from.
+ * @param input the {@code InputStream} to read from.
*/
public void _read(InputStream input) {
value = input.read_fixed();
@@ -77,9 +77,9 @@
/**
* Write the fixed point value stored in this holder to an
- * <code>OutputStream</code>.
+ * {@code OutputStream}.
*
- * @param output the <code>OutputStream</code> to write into.
+ * @param output the {@code OutputStream} to write into.
*/
public void _write(OutputStream output) {
output.write_fixed(value);
@@ -87,9 +87,9 @@
/**
- * Return the <code>TypeCode</code> of this holder object.
+ * Return the {@code TypeCode} of this holder object.
*
- * @return the <code>TypeCode</code> object.
+ * @return the {@code TypeCode} object.
*/
public org.omg.CORBA.TypeCode _type() {
return ORB.init().get_primitive_tc(TCKind.tk_fixed);
--- a/corba/src/java.corba/share/classes/org/omg/CORBA/FloatHolder.java Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/org/omg/CORBA/FloatHolder.java Fri Sep 25 12:04:35 2015 -0700
@@ -31,45 +31,45 @@
/**
- * The Holder for <tt>Float</tt>. For more information on
+ * The Holder for {@code Float}. For more information on
* Holder files, see <a href="doc-files/generatedfiles.html#holder">
* "Generated Files: Holder Files"</a>.<P>
- * A Holder class for a <code>float</code>
+ * A Holder class for a {@code float}
* that is used to store "out" and "inout" parameters in IDL methods.
- * If an IDL method signature has an IDL <code>float</code> as an "out"
+ * If an IDL method signature has an IDL {@code float} as an "out"
* or "inout" parameter, the programmer must pass an instance of
- * <code>FloatHolder</code> as the corresponding
+ * {@code FloatHolder} as the corresponding
* parameter in the method invocation; for "inout" parameters, the programmer
* must also fill the "in" value to be sent to the server.
* Before the method invocation returns, the ORB will fill in the
* value corresponding to the "out" value returned from the server.
* <P>
- * If <code>myFloatHolder</code> is an instance of <code>FloatHolder</code>,
- * the value stored in its <code>value</code> field can be accessed with
- * <code>myFloatHolder.value</code>.
+ * If {@code myFloatHolder} is an instance of {@code FloatHolder},
+ * the value stored in its {@code value} field can be accessed with
+ * {@code myFloatHolder.value}.
*
* @since JDK1.2
*/
public final class FloatHolder implements Streamable {
/**
- * The <code>float</code> value held by this <code>FloatHolder</code>
+ * The {@code float} value held by this {@code FloatHolder}
* object.
*/
public float value;
/**
- * Constructs a new <code>FloatHolder</code> object with its
- * <code>value</code> field initialized to 0.0.
+ * Constructs a new {@code FloatHolder} object with its
+ * {@code value} field initialized to 0.0.
*/
public FloatHolder() {
}
/**
- * Constructs a new <code>FloatHolder</code> object for the given
- * <code>float</code>.
- * @param initial the <code>float</code> with which to initialize
- * the <code>value</code> field of the new
- * <code>FloatHolder</code> object
+ * Constructs a new {@code FloatHolder} object for the given
+ * {@code float}.
+ * @param initial the {@code float} with which to initialize
+ * the {@code value} field of the new
+ * {@code FloatHolder} object
*/
public FloatHolder(float initial) {
value = initial;
@@ -79,7 +79,7 @@
* Read a float from an input stream and initialize the value
* member with the float value.
*
- * @param input the <code>InputStream</code> to read from.
+ * @param input the {@code InputStream} to read from.
*/
public void _read(InputStream input) {
value = input.read_float();
@@ -88,16 +88,16 @@
/**
* Write the float value into an output stream.
*
- * @param output the <code>OutputStream</code> to write into.
+ * @param output the {@code OutputStream} to write into.
*/
public void _write(OutputStream output) {
output.write_float(value);
}
/**
- * Return the <code>TypeCode</code> of this Streamable.
+ * Return the {@code TypeCode} of this Streamable.
*
- * @return the <code>TypeCode</code> object.
+ * @return the {@code TypeCode} object.
*/
public org.omg.CORBA.TypeCode _type() {
return ORB.init().get_primitive_tc(TCKind.tk_float);
--- a/corba/src/java.corba/share/classes/org/omg/CORBA/FloatSeqHelper.java Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/org/omg/CORBA/FloatSeqHelper.java Fri Sep 25 12:04:35 2015 -0700
@@ -26,26 +26,26 @@
/**
-* The Helper for <tt>FloatSeq</tt>. For more information on
-* Helper files, see <a href="doc-files/generatedfiles.html#helper">
-* "Generated Files: Helper Files"</a>.<P>
-* org/omg/CORBA/FloatSeqHelper.java
-* Generated by the IDL-to-Java compiler (portable), version "3.0"
-* from streams.idl
-* 13 May 1999 22:41:37 o'clock GMT+00:00
-*
-* The class definition has been modified to conform to the following
-* OMG specifications :
-* <ul>
-* <li> ORB core as defined by CORBA 2.3.1
-* (<a href="http://www.omg.org/cgi-bin/doc?formal/99-10-07">formal/99-10-07</a>)
-* </li>
-*
-* <li> IDL/Java Language Mapping as defined in
-* <a href="http://www.omg.org/cgi-bin/doc?ptc/00-01-08">ptc/00-01-08</a>
-* </li>
-* </ul>
-*/
+ * The Helper for {@code FloatSeq}. For more information on
+ * Helper files, see <a href="doc-files/generatedfiles.html#helper">
+ * "Generated Files: Helper Files"</a>.<P>
+ * org/omg/CORBA/FloatSeqHelper.java
+ * Generated by the IDL-to-Java compiler (portable), version "3.0"
+ * from streams.idl
+ * 13 May 1999 22:41:37 o'clock GMT+00:00
+ *
+ * The class definition has been modified to conform to the following
+ * OMG specifications :
+ * <ul>
+ * <li> ORB core as defined by CORBA 2.3.1
+ * (<a href="http://www.omg.org/cgi-bin/doc?formal/99-10-07">formal/99-10-07</a>)
+ * </li>
+ *
+ * <li> IDL/Java Language Mapping as defined in
+ * <a href="http://www.omg.org/cgi-bin/doc?ptc/00-01-08">ptc/00-01-08</a>
+ * </li>
+ * </ul>
+ */
public abstract class FloatSeqHelper
{
--- a/corba/src/java.corba/share/classes/org/omg/CORBA/FloatSeqHolder.java Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/org/omg/CORBA/FloatSeqHolder.java Fri Sep 25 12:04:35 2015 -0700
@@ -26,14 +26,14 @@
/**
-* The Holder for <tt>FloatSeq</tt>. For more information on
-* Holder files, see <a href="doc-files/generatedfiles.html#holder">
-* "Generated Files: Holder Files"</a>.<P>
-* org/omg/CORBA/FloatSeqHolder.java
-* Generated by the IDL-to-Java compiler (portable), version "3.0"
-* from streams.idl
-* 13 May 1999 22:41:37 o'clock GMT+00:00
-*/
+ * The Holder for {@code FloatSeq}. For more information on
+ * Holder files, see <a href="doc-files/generatedfiles.html#holder">
+ * "Generated Files: Holder Files"</a>.<P>
+ * org/omg/CORBA/FloatSeqHolder.java
+ * Generated by the IDL-to-Java compiler (portable), version "3.0"
+ * from streams.idl
+ * 13 May 1999 22:41:37 o'clock GMT+00:00
+ */
public final class FloatSeqHolder implements org.omg.CORBA.portable.Streamable
{
--- a/corba/src/java.corba/share/classes/org/omg/CORBA/IDLTypeHelper.java Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/org/omg/CORBA/IDLTypeHelper.java Fri Sep 25 12:04:35 2015 -0700
@@ -26,14 +26,14 @@
/**
-* The Helper for <tt>IDLType</tt>. For more information on
-* Helper files, see <a href="doc-files/generatedfiles.html#helper">
-* "Generated Files: Helper Files"</a>.<P>
-* org/omg/CORBA/IDLTypeHelper.java
-* Generated by the IDL-to-Java compiler (portable), version "3.0"
-* from ir.idl
-* 03 June 1999 11:33:44 o'clock GMT+00:00
-*/
+ * The Helper for {@code IDLType}. For more information on
+ * Helper files, see <a href="doc-files/generatedfiles.html#helper">
+ * "Generated Files: Helper Files"</a>.<P>
+ * org/omg/CORBA/IDLTypeHelper.java
+ * Generated by the IDL-to-Java compiler (portable), version "3.0"
+ * from ir.idl
+ * 03 June 1999 11:33:44 o'clock GMT+00:00
+ */
abstract public class IDLTypeHelper
{
--- a/corba/src/java.corba/share/classes/org/omg/CORBA/IDLTypeOperations.java Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/org/omg/CORBA/IDLTypeOperations.java Fri Sep 25 12:04:35 2015 -0700
@@ -25,10 +25,10 @@
package org.omg.CORBA;
/**
-* The interface for <tt>IDLType</tt>. For more information on
-* Operations interfaces, see <a href="doc-files/generatedfiles.html#operations">
-* "Generated Files: Operations files"</a>.
-*/
+ * The interface for {@code IDLType}. For more information on
+ * Operations interfaces, see <a href="doc-files/generatedfiles.html#operations">
+ * "Generated Files: Operations files"</a>.
+ */
/*
tempout/org/omg/CORBA/IDLTypeOperations.java
@@ -51,8 +51,8 @@
{
/**
* The type attribute describes the type defined by an object
- * derived from <code>IDLType</code>.
- * @return the <code>TypeCode</code> defined by this object.
+ * derived from {@code IDLType}.
+ * @return the {@code TypeCode} defined by this object.
*/
org.omg.CORBA.TypeCode type ();
} // interface IDLTypeOperations
--- a/corba/src/java.corba/share/classes/org/omg/CORBA/INV_OBJREF.java Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/org/omg/CORBA/INV_OBJREF.java Fri Sep 25 12:04:35 2015 -0700
@@ -32,7 +32,7 @@
* exception is raised by ORB::string_to_object if the passed
* string does not decode correctly. An ORB may choose to detect
* calls via nil references (but is not obliged to do detect them).
- * <tt>INV_OBJREF</tt> is used to indicate this.<P>
+ * {@code INV_OBJREF} is used to indicate this.<P>
* It contains a minor code, which gives more detailed information about
* what caused the exception, and a completion status. It may also contain
* a string describing the exception.
@@ -47,7 +47,7 @@
public final class INV_OBJREF extends SystemException {
/**
- * Constructs an <code>INV_OBJREF</code> exception with a default
+ * Constructs an {@code INV_OBJREF} exception with a default
* minor code of 0 and a completion state of COMPLETED_NO.
*/
public INV_OBJREF() {
@@ -55,7 +55,7 @@
}
/**
- * Constructs an <code>INV_OBJREF</code> exception with the specified detail
+ * Constructs an {@code INV_OBJREF} exception with the specified detail
* message, a minor code of 0, and a completion state of COMPLETED_NO.
* @param s the String containing a detail message
*/
@@ -64,10 +64,10 @@
}
/**
- * Constructs an <code>INV_OBJREF</code> exception with the specified
+ * Constructs an {@code INV_OBJREF} exception with the specified
* minor code and completion status.
* @param minor the minor code
- * @param completed a <code>CompletionStatus</code> instance indicating
+ * @param completed a {@code CompletionStatus} instance indicating
* the completion status
*/
public INV_OBJREF(int minor, CompletionStatus completed) {
@@ -75,12 +75,12 @@
}
/**
- * Constructs an <code>INV_OBJREF</code> exception with the specified detail
+ * Constructs an {@code INV_OBJREF} exception with the specified detail
* message, minor code, and completion status.
* A detail message is a String that describes this particular exception.
* @param s the String containing a detail message
* @param minor the minor code
- * @param completed a <code>CompletionStatus</code> instance indicating
+ * @param completed a {@code CompletionStatus} instance indicating
* the completion status
*/
public INV_OBJREF(String s, int minor, CompletionStatus completed) {
--- a/corba/src/java.corba/share/classes/org/omg/CORBA/INV_POLICY.java Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/org/omg/CORBA/INV_POLICY.java Fri Sep 25 12:04:35 2015 -0700
@@ -28,7 +28,7 @@
/**
* Standard exception thrown
* when an invocation cannot be made because of an incompatibility between
- * <tt>Policy</tt> overrides that apply to the particular invocation.
+ * {@code Policy} overrides that apply to the particular invocation.
* It contains a minor code, which gives more detailed information about
* what caused the exception, and a completion status. It may also contain
* a string describing the exception.
@@ -39,7 +39,7 @@
public final class INV_POLICY extends SystemException {
/**
- * Constructs a <code>INV_POLICY</code> exception with a default minor code
+ * Constructs a {@code INV_POLICY} exception with a default minor code
* of 0, a completion state of CompletionStatus.COMPLETED_NO,
* and a null description.
*/
@@ -48,7 +48,7 @@
}
/**
- * Constructs a <code>INV_POLICY</code> exception with the
+ * Constructs a {@code INV_POLICY} exception with the
* specified description message,
* a minor code of 0, and a completion state of COMPLETED_NO.
* @param s the String containing a detail message
@@ -58,7 +58,7 @@
}
/**
- * Constructs a <code>INV_POLICY</code> exception with the specified
+ * Constructs a {@code INV_POLICY} exception with the specified
* minor code and completion status.
* @param minor the minor code
* @param completed the completion status
@@ -68,7 +68,7 @@
}
/**
- * Constructs a <code>INV_POLICY</code> exception with the
+ * Constructs a {@code INV_POLICY} exception with the
* specified description message, minor code, and completion status.
* @param s the String containing a description message
* @param minor the minor code
--- a/corba/src/java.corba/share/classes/org/omg/CORBA/IRObjectOperations.java Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/org/omg/CORBA/IRObjectOperations.java Fri Sep 25 12:04:35 2015 -0700
@@ -26,10 +26,10 @@
/**
-* The interface for <tt>IRObject</tt>. For more information on
-* Operations interfaces, see <a href="doc-files/generatedfiles.html#operations">
-* "Generated Files: Operations files"</a>.
-*/
+ * The interface for {@code IRObject}. For more information on
+ * Operations interfaces, see <a href="doc-files/generatedfiles.html#operations">
+ * "Generated Files: Operations files"</a>.
+ */
/*
tempout/org/omg/CORBA/IRObjectOperations.java
@@ -39,7 +39,7 @@
*/
/**
- * This is the Operations interface for the mapping from <tt>IRObject</tt>.
+ * This is the Operations interface for the mapping from {@code IRObject}.
* Several interfaces are used as base interfaces for objects in
* the Interface Repository (IR). These base interfaces are not instantiable.
* A common set of operations is used to locate objects within the
@@ -59,8 +59,8 @@
// read interface
/**
- * Returns the <code>DefinitionKind</code> corresponding to this Interface Repository object.
- * @return the <code>DefinitionKind</code> corresponding to this Interface Repository object.
+ * Returns the {@code DefinitionKind} corresponding to this Interface Repository object.
+ * @return the {@code DefinitionKind} corresponding to this Interface Repository object.
*/
org.omg.CORBA.DefinitionKind def_kind ();
@@ -70,13 +70,13 @@
* this method is applied to all its contents. If the object contains an IDLType
* attribute for an anonymous type, that IDLType is destroyed.
* If the object is currently contained in some other object, it is removed.
- * If the method is invoked on a <code>Repository</code> or on a <code>PrimitiveDef</code>
- * then the <code>BAD_INV_ORDER</code> exception is raised with minor value 2.
+ * If the method is invoked on a {@code Repository} or on a {@code PrimitiveDef}
+ * then the {@code BAD_INV_ORDER} exception is raised with minor value 2.
* An attempt to destroy an object that would leave the repository in an
- * incoherent state causes <code>BAD_INV_ORDER</code> exception to be raised
+ * incoherent state causes {@code BAD_INV_ORDER} exception to be raised
* with the minor code 1.
* @exception BAD_INV_ORDER if this method is invoked on a repository or
- * <code>PrimitiveDef</code>, or if an attempt to destroy an
+ * {@code PrimitiveDef}, or if an attempt to destroy an
* object would leave the repository in an incoherent state
*/
void destroy ();
--- a/corba/src/java.corba/share/classes/org/omg/CORBA/IdentifierHelper.java Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/org/omg/CORBA/IdentifierHelper.java Fri Sep 25 12:04:35 2015 -0700
@@ -26,14 +26,14 @@
/**
-* The Helper for <tt>Identifier</tt>. For more information on
-* Helper files, see <a href="doc-files/generatedfiles.html#helper">
-* "Generated Files: Helper Files"</a>.<P>
-* org/omg/CORBA/IdentifierHelper.java
-* Generated by the IDL-to-Java compiler (portable), version "3.0"
-* from ir.idl
-* 03 June 1999 11:33:42 o'clock GMT+00:00
-*/
+ * The Helper for {@code Identifier}. For more information on
+ * Helper files, see <a href="doc-files/generatedfiles.html#helper">
+ * "Generated Files: Helper Files"</a>.<P>
+ * org/omg/CORBA/IdentifierHelper.java
+ * Generated by the IDL-to-Java compiler (portable), version "3.0"
+ * from ir.idl
+ * 03 June 1999 11:33:42 o'clock GMT+00:00
+ */
abstract public class IdentifierHelper
{
--- a/corba/src/java.corba/share/classes/org/omg/CORBA/IntHolder.java Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/org/omg/CORBA/IntHolder.java Fri Sep 25 12:04:35 2015 -0700
@@ -30,57 +30,57 @@
import org.omg.CORBA.portable.OutputStream;
/**
- * The Holder for <tt>Int</tt>. For more information on
+ * The Holder for {@code Int}. For more information on
* Holder files, see <a href="doc-files/generatedfiles.html#holder">
* "Generated Files: Holder Files"</a>.<P>
- * A Holder class for an <code>int</code>
+ * A Holder class for an {@code int}
* that is used to store "out" and "inout" parameters in IDL methods.
- * If an IDL method signature has an IDL <code>long</code> as an "out"
+ * If an IDL method signature has an IDL {@code long} as an "out"
* or "inout" parameter, the programmer must pass an instance of
- * <code>IntHolder</code> as the corresponding
+ * {@code IntHolder} as the corresponding
* parameter in the method invocation; for "inout" parameters, the programmer
* must also fill the "in" value to be sent to the server.
* Before the method invocation returns, the ORB will fill in the
* value corresponding to the "out" value returned from the server.
* <P>
- * If <code>myIntHolder</code> is an instance of <code>IntHolder</code>,
- * the value stored in its <code>value</code> field can be accessed with
- * <code>myIntHolder.value</code>.
+ * If {@code myIntHolder} is an instance of {@code IntHolder},
+ * the value stored in its {@code value} field can be accessed with
+ * {@code myIntHolder.value}.
*
* @since JDK1.2
*/
public final class IntHolder implements Streamable {
/**
- * The <code>int</code> value held by this <code>IntHolder</code>
- * object in its <code>value</code> field.
+ * The {@code int} value held by this {@code IntHolder}
+ * object in its {@code value} field.
*/
public int value;
/**
- * Constructs a new <code>IntHolder</code> object with its
- * <code>value</code> field initialized to <code>0</code>.
+ * Constructs a new {@code IntHolder} object with its
+ * {@code value} field initialized to {@code 0}.
*/
public IntHolder() {
}
/**
- * Constructs a new <code>IntHolder</code> object with its
- * <code>value</code> field initialized to the given
- * <code>int</code>.
- * @param initial the <code>int</code> with which to initialize
- * the <code>value</code> field of the newly-created
- * <code>IntHolder</code> object
+ * Constructs a new {@code IntHolder} object with its
+ * {@code value} field initialized to the given
+ * {@code int}.
+ * @param initial the {@code int} with which to initialize
+ * the {@code value} field of the newly-created
+ * {@code IntHolder} object
*/
public IntHolder(int initial) {
value = initial;
}
/**
- * Reads unmarshalled data from <code>input</code> and assigns it to
- * the <code>value</code> field in this <code>IntHolder</code> object.
+ * Reads unmarshalled data from {@code input} and assigns it to
+ * the {@code value} field in this {@code IntHolder} object.
*
- * @param input the <code>InputStream</code> object containing CDR
+ * @param input the {@code InputStream} object containing CDR
* formatted data from the wire
*/
public void _read(InputStream input) {
@@ -88,10 +88,10 @@
}
/**
- * Marshals the value in this <code>IntHolder</code> object's
- * <code>value</code> field to the output stream <code>output</code>.
+ * Marshals the value in this {@code IntHolder} object's
+ * {@code value} field to the output stream {@code output}.
*
- * @param output the <code>OutputStream</code> object that will contain
+ * @param output the {@code OutputStream} object that will contain
* the CDR formatted data
*/
public void _write(OutputStream output) {
@@ -99,11 +99,11 @@
}
/**
- * Retrieves the <code>TypeCode</code> object that corresponds
- * to the value held in this <code>IntHolder</code> object's
- * <code>value</code> field.
+ * Retrieves the {@code TypeCode} object that corresponds
+ * to the value held in this {@code IntHolder} object's
+ * {@code value} field.
*
- * @return the type code for the value held in this <code>IntHolder</code>
+ * @return the type code for the value held in this {@code IntHolder}
* object
*/
public org.omg.CORBA.TypeCode _type() {
--- a/corba/src/java.corba/share/classes/org/omg/CORBA/LocalObject.java Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/org/omg/CORBA/LocalObject.java Fri Sep 25 12:04:35 2015 -0700
@@ -30,26 +30,26 @@
/**
* Used as a base class for implementation of a local IDL interface in the
* Java language mapping. It is a class which implements all the operations
- * in the <tt>org.omg.CORBA.Object</tt> interface.
+ * in the {@code org.omg.CORBA.Object} interface.
* <P>Local interfaces are implemented by using CORBA::LocalObject
- * to provide implementations of <code>Object</code> pseudo
- * operations and any other ORB-specific support mechanisms that are
- * appropriate for such objects. Object implementation techniques are
- * inherently language-mapping specific. Therefore, the
- * <code>LocalObject</code> type is not defined in IDL, but is specified
- * in each language mapping.
- * <P>Methods that do not apply to local objects throw
- * an <code>org.omg.CORBA.NO_IMPLEMENT</code> exception with the message,
- * "This is a locally contrained object." Attempting to use a
- * <TT>LocalObject</TT> to create a DII request results in NO_IMPLEMENT
- * system exception. Attempting to marshal or stringify a
- * <TT>LocalObject</TT> results in a MARSHAL system exception. Narrowing
- * and widening references to <TT>LocalObjects</TT> must work as for regular
- * object references.
- * <P><code>LocalObject</code> is to be used as the base class of locally
- * constrained objects, such as those in the PortableServer module.
- * The specification here is based on the CORBA Components
- * Volume I - orbos/99-07-01
+ * to provide implementations of {@code Object} pseudo
+ * operations and any other ORB-specific support mechanisms that are
+ * appropriate for such objects. Object implementation techniques are
+ * inherently language-mapping specific. Therefore, the
+ * {@code LocalObject} type is not defined in IDL, but is specified
+ * in each language mapping.
+ * <P>Methods that do not apply to local objects throw
+ * an {@code org.omg.CORBA.NO_IMPLEMENT} exception with the message,
+ * "This is a locally contrained object." Attempting to use a
+ * {@code LocalObject} to create a DII request results in NO_IMPLEMENT
+ * system exception. Attempting to marshal or stringify a
+ * {@code LocalObject} results in a MARSHAL system exception. Narrowing
+ * and widening references to {@code LocalObjects} must work as for regular
+ * object references.
+ * <P>{@code LocalObject} is to be used as the base class of locally
+ * constrained objects, such as those in the PortableServer module.
+ * The specification here is based on the CORBA Components
+ * Volume I - orbos/99-07-01
*
* @see <a href="package-summary.html#unimpl"><code>CORBA</code> package
* comments for unimplemented features</a>
@@ -60,7 +60,7 @@
private static String reason = "This is a locally constrained object.";
/**
- * Constructs a default <code>LocalObject</code> instance.
+ * Constructs a default {@code LocalObject} instance.
*/
public LocalObject() {}
@@ -75,9 +75,9 @@
* <P>Default implementation of the org.omg.CORBA.Object method.
*
* @param that the object reference with which to check for equivalence
- * @return <code>true</code> if this object reference is known to be
+ * @return {@code true} if this object reference is known to be
* equivalent to the given object reference.
- * Note that <code>false</code> indicates only that the two
+ * Note that {@code false} indicates only that the two
* object references are distinct, not necessarily that
* they reference distinct objects.
*/
@@ -86,11 +86,11 @@
}
/**
- * Always returns <code>false</code>.
+ * Always returns {@code false}.
* This method is the default implementation of the
- * <code>org.omg.CORBA.Object</code> method.
+ * {@code org.omg.CORBA.Object} method.
*
- * @return <code>false</code>
+ * @return {@code false}
*/
public boolean _non_existent() {
return false;
@@ -100,9 +100,9 @@
* Returns a hash value that is consistent for the
* lifetime of the object, using the given number as the maximum.
* This method is the default implementation of the
- * <code>org.omg.CORBA.Object</code> method.
+ * {@code org.omg.CORBA.Object} method.
*
- * @param maximum an <code>int</code> identifying maximum value of
+ * @param maximum an {@code int} identifying maximum value of
* the hashcode
* @return this instance's hashcode
*/
@@ -111,13 +111,13 @@
}
/**
- * Throws an <code>org.omg.CORBA.NO_IMPLEMENT</code> exception with
+ * Throws an {@code org.omg.CORBA.NO_IMPLEMENT} exception with
* the message "This is a locally constrained object." This method
* does not apply to local objects and is therefore not implemented.
* This method is the default implementation of the
- * <code>org.omg.CORBA.Object</code> method.
+ * {@code org.omg.CORBA.Object} method.
*
- * @param repository_id a <code>String</code>
+ * @param repository_id a {@code String}
* @return NO_IMPLEMENT because this is a locally constrained object
* and this method does not apply to local objects
* @exception NO_IMPLEMENT because this is a locally constrained object
@@ -130,12 +130,12 @@
}
/**
- * Throws an <code>org.omg.CORBA.NO_IMPLEMENT</code> exception with
+ * Throws an {@code org.omg.CORBA.NO_IMPLEMENT} exception with
* the message "This is a locally constrained object."
* This method is the default implementation of the
- * <code>org.omg.CORBA.Object</code> method.
+ * {@code org.omg.CORBA.Object} method.
*
- * @return a duplicate of this <code>LocalObject</code> instance.
+ * @return a duplicate of this {@code LocalObject} instance.
* @exception NO_IMPLEMENT
* @see <a href="package-summary.html#unimpl"><code>CORBA</code> package
* comments for unimplemented features</a>
@@ -145,10 +145,10 @@
}
/**
- * Throws an <code>org.omg.CORBA.NO_IMPLEMENT</code> exception with
+ * Throws an {@code org.omg.CORBA.NO_IMPLEMENT} exception with
* the message "This is a locally constrained object."
* This method is the default implementation of the
- * <code>org.omg.CORBA.Object</code> method.
+ * {@code org.omg.CORBA.Object} method.
*
* @exception NO_IMPLEMENT
* @see <a href="package-summary.html#unimpl"><code>CORBA</code> package
@@ -159,14 +159,14 @@
}
/**
- * Throws an <code>org.omg.CORBA.NO_IMPLEMENT</code> exception with
+ * Throws an {@code org.omg.CORBA.NO_IMPLEMENT} exception with
* the message "This is a locally constrained object."
* This method is the default implementation of the
- * <code>org.omg.CORBA.Object</code> method.
+ * {@code org.omg.CORBA.Object} method.
*
- * @param operation a <code>String</code> giving the name of an operation
+ * @param operation a {@code String} giving the name of an operation
* to be performed by the request that is returned
- * @return a <code>Request</code> object with the given operation
+ * @return a {@code Request} object with the given operation
* @exception NO_IMPLEMENT
* @see <a href="package-summary.html#unimpl"><code>CORBA</code> package
* comments for unimplemented features</a>
@@ -176,20 +176,20 @@
}
/**
- * Throws an <code>org.omg.CORBA.NO_IMPLEMENT</code> exception with
+ * Throws an {@code org.omg.CORBA.NO_IMPLEMENT} exception with
* the message "This is a locally constrained object."
* This method is the default implementation of the
- * <code>org.omg.CORBA.Object</code> method.
+ * {@code org.omg.CORBA.Object} method.
*
- * @param ctx a <code>Context</code> object containing
+ * @param ctx a {@code Context} object containing
* a list of properties
- * @param operation the <code>String</code> representing the name of the
+ * @param operation the {@code String} representing the name of the
* method to be invoked
- * @param arg_list an <code>NVList</code> containing the actual arguments
+ * @param arg_list an {@code NVList} containing the actual arguments
* to the method being invoked
- * @param result a <code>NamedValue</code> object to serve as a
+ * @param result a {@code NamedValue} object to serve as a
* container for the method's return value
- * @return a new <code>Request</code> object initialized with the given
+ * @return a new {@code Request} object initialized with the given
* arguments
* @exception NO_IMPLEMENT
* @see <a href="package-summary.html#unimpl"><code>CORBA</code> package
@@ -203,25 +203,25 @@
}
/**
- * Throws an <code>org.omg.CORBA.NO_IMPLEMENT</code> exception with
+ * Throws an {@code org.omg.CORBA.NO_IMPLEMENT} exception with
* the message "This is a locally constrained object."
* This method is the default implementation of the
- * <code>org.omg.CORBA.Object</code> method.
+ * {@code org.omg.CORBA.Object} method.
*
- * @param ctx a <code>Context</code> object containing
+ * @param ctx a {@code Context} object containing
* a list of properties
* @param operation the name of the method to be invoked
- * @param arg_list an <code>NVList</code> containing the actual arguments
+ * @param arg_list an {@code NVList} containing the actual arguments
* to the method being invoked
- * @param result a <code>NamedValue</code> object to serve as a
+ * @param result a {@code NamedValue} object to serve as a
* container for the method's return value
- * @param exceptions an <code>ExceptionList</code> object containing a
+ * @param exceptions an {@code ExceptionList} object containing a
* list of possible exceptions the method can throw
- * @param contexts a <code>ContextList</code> object containing a list of
+ * @param contexts a {@code ContextList} object containing a list of
* context strings that need to be resolved and sent
* with the
- * <code>Request</code> instance
- * @return the new <code>Request</code> object initialized with the given
+ * {@code Request} instance
+ * @return the new {@code Request} object initialized with the given
* arguments
* @exception NO_IMPLEMENT
* @see <a href="package-summary.html#unimpl"><code>CORBA</code> package
@@ -237,11 +237,11 @@
}
/**
- * Throws an <code>org.omg.CORBA.NO_IMPLEMENT</code> exception with
+ * Throws an {@code org.omg.CORBA.NO_IMPLEMENT} exception with
* the message "This is a locally constrained object." This method
* does not apply to local objects and is therefore not implemented.
* This method is the default implementation of the
- * <code>org.omg.CORBA.Object</code> method.
+ * {@code org.omg.CORBA.Object} method.
*
* @return NO_IMPLEMENT because this is a locally constrained object
* and this method does not apply to local objects
@@ -256,10 +256,10 @@
}
/**
- * Throws an <code>org.omg.CORBA.NO_IMPLEMENT</code> exception with
+ * Throws an {@code org.omg.CORBA.NO_IMPLEMENT} exception with
* the message "This is a locally constrained object."
* This method is the default implementation of the
- * <code>org.omg.CORBA.Object</code> method.
+ * {@code org.omg.CORBA.Object} method.
*
* @exception NO_IMPLEMENT
* @see <a href="package-summary.html#unimpl"><code>CORBA</code> package
@@ -278,12 +278,12 @@
}
/**
- * Throws an <code>org.omg.CORBA.NO_IMPLEMENT</code> exception with
+ * Throws an {@code org.omg.CORBA.NO_IMPLEMENT} exception with
* the message "This is a locally constrained object."
* This method is the default implementation of the
- * <code>org.omg.CORBA.Object</code> method.
+ * {@code org.omg.CORBA.Object} method.
* @return the ORB instance that created the Delegate contained in this
- * <code>ObjectImpl</code>
+ * {@code ObjectImpl}
* @exception NO_IMPLEMENT
* @see <a href="package-summary.html#unimpl"><code>CORBA</code> package
* comments for unimplemented features</a>
@@ -293,13 +293,13 @@
}
/**
- * Throws an <code>org.omg.CORBA.NO_IMPLEMENT</code> exception with
+ * Throws an {@code org.omg.CORBA.NO_IMPLEMENT} exception with
* the message "This is a locally constrained object." This method
* does not apply to local objects and is therefore not implemented.
* This method is the default implementation of the
- * <code>org.omg.CORBA.Object</code> method.
+ * {@code org.omg.CORBA.Object} method.
*
- * @param policy_type an <code>int</code>
+ * @param policy_type an {@code int}
* @return NO_IMPLEMENT because this is a locally constrained object
* and this method does not apply to local objects
* @exception NO_IMPLEMENT because this is a locally constrained object
@@ -313,11 +313,11 @@
/**
- * Throws an <code>org.omg.CORBA.NO_IMPLEMENT</code> exception with
+ * Throws an {@code org.omg.CORBA.NO_IMPLEMENT} exception with
* the message "This is a locally constrained object." This method
* does not apply to local objects and is therefore not implemented.
* This method is the default implementation of the
- * <code>org.omg.CORBA.Object</code> method.
+ * {@code org.omg.CORBA.Object} method.
*
* @exception NO_IMPLEMENT
* @see <a href="package-summary.html#unimpl"><code>CORBA</code> package
@@ -328,11 +328,11 @@
}
/**
- * Throws an <code>org.omg.CORBA.NO_IMPLEMENT</code> exception with
+ * Throws an {@code org.omg.CORBA.NO_IMPLEMENT} exception with
* the message "This is a locally constrained object." This method
* does not apply to local objects and is therefore not implemented.
* This method is the default implementation of the
- * <code>org.omg.CORBA.Object</code> method.
+ * {@code org.omg.CORBA.Object} method.
*
* @param policies an array
* @param set_add a flag
@@ -351,13 +351,13 @@
/**
- * Throws an <code>org.omg.CORBA.NO_IMPLEMENT</code> exception with
+ * Throws an {@code org.omg.CORBA.NO_IMPLEMENT} exception with
* the message "This is a locally constrained object."
* This method is the default implementation of the
- * <code>org.omg.CORBA.Object</code> method.<P>
- * Returns <code>true</code> for this <code>LocalObject</code> instance.
+ * {@code org.omg.CORBA.Object} method.<P>
+ * Returns {@code true} for this {@code LocalObject} instance.
*
- * @return <code>true</code> always
+ * @return {@code true} always
* @exception NO_IMPLEMENT
* @see <a href="package-summary.html#unimpl"><code>CORBA</code> package
* comments for unimplemented features</a>
@@ -367,12 +367,12 @@
}
/**
- * Throws an <code>org.omg.CORBA.NO_IMPLEMENT</code> exception with
+ * Throws an {@code org.omg.CORBA.NO_IMPLEMENT} exception with
* the message "This is a locally constrained object."
* This method is the default implementation of the
- * <code>org.omg.CORBA.Object</code> method.
+ * {@code org.omg.CORBA.Object} method.
*
- * @param operation a <code>String</code> indicating which operation
+ * @param operation a {@code String} indicating which operation
* to preinvoke
* @param expectedType the class of the type of operation mentioned above
* @return NO_IMPLEMENT because this is a locally constrained object
@@ -388,10 +388,10 @@
}
/**
- * Throws an <code>org.omg.CORBA.NO_IMPLEMENT</code> exception with
+ * Throws an {@code org.omg.CORBA.NO_IMPLEMENT} exception with
* the message "This is a locally constrained object."
* This method is the default implementation of the
- * <code>org.omg.CORBA.Object</code> method.
+ * {@code org.omg.CORBA.Object} method.
*
* @param servant the servant object on which to post-invoke
* @exception NO_IMPLEMENT
@@ -408,17 +408,17 @@
*/
/**
- * Throws an <code>org.omg.CORBA.NO_IMPLEMENT</code> exception with
+ * Throws an {@code org.omg.CORBA.NO_IMPLEMENT} exception with
* the message "This is a locally constrained object."
* This method is the default implementation of the
- * <code>org.omg.CORBA.Object</code> method.
+ * {@code org.omg.CORBA.Object} method.
* <P>Called by a stub to obtain an OutputStream for
* marshaling arguments. The stub must supply the operation name,
* and indicate if a response is expected (i.e is this a oneway call).
*
* @param operation the name of the operation being requested
- * @param responseExpected <code>true</code> if a response is expected,
- * <code>false</code> if it is a one-way call
+ * @param responseExpected {@code true} if a response is expected,
+ * {@code false} if it is a one-way call
* @return NO_IMPLEMENT because this is a locally constrained object
* and this method does not apply to local objects
* @exception NO_IMPLEMENT because this is a locally constrained object
@@ -432,32 +432,32 @@
}
/**
- * Throws an <code>org.omg.CORBA.NO_IMPLEMENT</code> exception with
+ * Throws an {@code org.omg.CORBA.NO_IMPLEMENT} exception with
* the message "This is a locally constrained object."
* This method is the default implementation of the
- * <code>org.omg.CORBA.Object</code> method.
+ * {@code org.omg.CORBA.Object} method.
* <P>Called to invoke an operation. The stub provides an
- * <code>OutputStream</code> that was previously returned by a
- * <code>_request()</code>
- * call. <code>_invoke</code> returns an <code>InputStream</code> which
+ * {@code OutputStream} that was previously returned by a
+ * {@code _request()}
+ * call. {@code _invoke} returns an {@code InputStream} which
* contains the
- * marshaled reply. If an exception occurs, <code>_invoke</code> may throw an
- * <code>ApplicationException</code> object which contains an
- * <code>InputStream</code> from
+ * marshaled reply. If an exception occurs, {@code _invoke} may throw an
+ * {@code ApplicationException} object which contains an
+ * {@code InputStream} from
* which the user exception state may be unmarshaled.
*
- * @param output the <code>OutputStream</code> to invoke
+ * @param output the {@code OutputStream} to invoke
* @return NO_IMPLEMENT because this is a locally constrained object
* and this method does not apply to local objects
* @throws ApplicationException If an exception occurs,
- * <code>_invoke</code> may throw an
- * <code>ApplicationException</code> object which contains
- * an <code>InputStream</code> from
+ * {@code _invoke} may throw an
+ * {@code ApplicationException} object which contains
+ * an {@code InputStream} from
* which the user exception state may be unmarshaled.
* @throws RemarshalException If an exception occurs,
- * <code>_invoke</code> may throw an
- * <code>ApplicationException</code> object which contains
- * an <code>InputStream</code> from
+ * {@code _invoke} may throw an
+ * {@code ApplicationException} object which contains
+ * an {@code InputStream} from
* which the user exception state may be unmarshaled.
* @exception NO_IMPLEMENT because this is a locally constrained object
* and this method does not apply to local objects
@@ -471,17 +471,17 @@
}
/**
- * Throws an <code>org.omg.CORBA.NO_IMPLEMENT</code> exception with
+ * Throws an {@code org.omg.CORBA.NO_IMPLEMENT} exception with
* the message "This is a locally constrained object."
* This method is the default implementation of the
- * <code>org.omg.CORBA.Object</code> method.
+ * {@code org.omg.CORBA.Object} method.
* <P>May optionally be called by a stub to release a
* reply stream back to the ORB when the unmarshaling has
- * completed. The stub passes the <code>InputStream</code> returned by
- * <code>_invoke()</code> or
- * <code>ApplicationException.getInputStream()</code>.
+ * completed. The stub passes the {@code InputStream} returned by
+ * {@code _invoke()} or
+ * {@code ApplicationException.getInputStream()}.
* A null
- * value may also be passed to <code>_releaseReply</code>, in which case the
+ * value may also be passed to {@code _releaseReply}, in which case the
* method is a no-op.
*
* @param input the reply stream back to the ORB or null
@@ -494,11 +494,11 @@
}
/**
- * Throws an <code>org.omg.CORBA.NO_IMPLEMENT</code> exception with
+ * Throws an {@code org.omg.CORBA.NO_IMPLEMENT} exception with
* the message "This is a locally constrained object." This method
* does not apply to local objects and is therefore not implemented.
* This method is the default implementation of the
- * <code>org.omg.CORBA.Object</code> method.
+ * {@code org.omg.CORBA.Object} method.
*
* @return NO_IMPLEMENT because this is a locally constrained object
* and this method does not apply to local objects
--- a/corba/src/java.corba/share/classes/org/omg/CORBA/LongHolder.java Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/org/omg/CORBA/LongHolder.java Fri Sep 25 12:04:35 2015 -0700
@@ -30,54 +30,54 @@
import org.omg.CORBA.portable.OutputStream;
/**
- * The Holder for <tt>Long</tt>. For more information on
+ * The Holder for {@code Long}. For more information on
* Holder files, see <a href="doc-files/generatedfiles.html#holder">
* "Generated Files: Holder Files"</a>.<P>
- * A Holder class for a <code>long</code>
+ * A Holder class for a {@code long}
* that is used to store "out" and "inout" parameters in IDL methods.
- * If an IDL method signature has an IDL <code>long long</code> as an "out"
+ * If an IDL method signature has an IDL {@code long long} as an "out"
* or "inout" parameter, the programmer must pass an instance of
- * <code>LongHolder</code> as the corresponding
+ * {@code LongHolder} as the corresponding
* parameter in the method invocation; for "inout" parameters, the programmer
* must also fill the "in" value to be sent to the server.
* Before the method invocation returns, the ORB will fill in the
* value corresponding to the "out" value returned from the server.
* <P>
- * If <code>myLongHolder</code> is an instance of <code>LongHolder</code>,
- * the value stored in its <code>value</code> field can be accessed with
- * <code>myLongHolder.value</code>.
+ * If {@code myLongHolder} is an instance of {@code LongHolder},
+ * the value stored in its {@code value} field can be accessed with
+ * {@code myLongHolder.value}.
*
* @since JDK1.2
*/
public final class LongHolder implements Streamable {
/**
- * The <code>long</code> value held by this <code>LongHolder</code>
+ * The {@code long} value held by this {@code LongHolder}
* object.
*/
public long value;
/**
- * Constructs a new <code>LongHolder</code> object with its
- * <code>value</code> field initialized to <code>0</code>.
+ * Constructs a new {@code LongHolder} object with its
+ * {@code value} field initialized to {@code 0}.
*/
public LongHolder() {
}
/**
- * Constructs a new <code>LongHolder</code> object with its
- * <code>value</code> field initialized to the given
- * <code>long</code>.
- * @param initial the <code>long</code> with which to initialize
- * the <code>value</code> field of the newly-created
- * <code>LongHolder</code> object
+ * Constructs a new {@code LongHolder} object with its
+ * {@code value} field initialized to the given
+ * {@code long}.
+ * @param initial the {@code long} with which to initialize
+ * the {@code value} field of the newly-created
+ * {@code LongHolder} object
*/
public LongHolder(long initial) {
value = initial;
}
/**
- * Reads from <code>input</code> and initalizes the value in the Holder
+ * Reads from {@code input} and initalizes the value in the Holder
* with the unmarshalled data.
*
* @param input the InputStream containing CDR formatted data from the wire
@@ -87,7 +87,7 @@
}
/**
- * Marshals to <code>output</code> the value in the Holder.
+ * Marshals to {@code output} the value in the Holder.
*
* @param output the OutputStream which will contain the CDR formatted data
*/
@@ -96,7 +96,7 @@
}
/**
- * Returns the <code>TypeCode</code> object
+ * Returns the {@code TypeCode} object
* corresponding to the value held in the Holder.
*
* @return the TypeCode of the value held in the holder
--- a/corba/src/java.corba/share/classes/org/omg/CORBA/LongLongSeqHelper.java Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/org/omg/CORBA/LongLongSeqHelper.java Fri Sep 25 12:04:35 2015 -0700
@@ -26,26 +26,26 @@
/**
-* The Helper for <tt>LongLongSeq</tt>. For more information on
-* Helper files, see <a href="doc-files/generatedfiles.html#helper">
-* "Generated Files: Helper Files"</a>.<P>
-* org/omg/CORBA/LongLongSeqHelper.java
-* Generated by the IDL-to-Java compiler (portable), version "3.0"
-* from streams.idl
-* 13 May 1999 22:41:37 o'clock GMT+00:00
-*
-* The class definition has been modified to conform to the following
-* OMG specifications :
-* <ul>
-* <li> ORB core as defined by CORBA 2.3.1
-* (<a href="http://www.omg.org/cgi-bin/doc?formal/99-10-07">formal/99-10-07</a>)
-* </li>
-*
-* <li> IDL/Java Language Mapping as defined in
-* <a href="http://www.omg.org/cgi-bin/doc?ptc/00-01-08">ptc/00-01-08</a>
-* </li>
-* </ul>
-*/
+ * The Helper for {@code LongLongSeq}. For more information on
+ * Helper files, see <a href="doc-files/generatedfiles.html#helper">
+ * "Generated Files: Helper Files"</a>.<P>
+ * org/omg/CORBA/LongLongSeqHelper.java
+ * Generated by the IDL-to-Java compiler (portable), version "3.0"
+ * from streams.idl
+ * 13 May 1999 22:41:37 o'clock GMT+00:00
+ *
+ * The class definition has been modified to conform to the following
+ * OMG specifications :
+ * <ul>
+ * <li> ORB core as defined by CORBA 2.3.1
+ * (<a href="http://www.omg.org/cgi-bin/doc?formal/99-10-07">formal/99-10-07</a>)
+ * </li>
+ *
+ * <li> IDL/Java Language Mapping as defined in
+ * <a href="http://www.omg.org/cgi-bin/doc?ptc/00-01-08">ptc/00-01-08</a>
+ * </li>
+ * </ul>
+ */
public abstract class LongLongSeqHelper
{
--- a/corba/src/java.corba/share/classes/org/omg/CORBA/LongLongSeqHolder.java Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/org/omg/CORBA/LongLongSeqHolder.java Fri Sep 25 12:04:35 2015 -0700
@@ -26,14 +26,14 @@
/**
-* The Holder for <tt>LongLongSeq</tt>. For more information on
-* Holder files, see <a href="doc-files/generatedfiles.html#holder">
-* "Generated Files: Holder Files"</a>.<P>
-* org/omg/CORBA/LongLongSeqHolder.java
-* Generated by the IDL-to-Java compiler (portable), version "3.0"
-* from streams.idl
-* 13 May 1999 22:41:36 o'clock GMT+00:00
-*/
+ * The Holder for {@code LongLongSeq}. For more information on
+ * Holder files, see <a href="doc-files/generatedfiles.html#holder">
+ * "Generated Files: Holder Files"</a>.<P>
+ * org/omg/CORBA/LongLongSeqHolder.java
+ * Generated by the IDL-to-Java compiler (portable), version "3.0"
+ * from streams.idl
+ * 13 May 1999 22:41:36 o'clock GMT+00:00
+ */
public final class LongLongSeqHolder implements org.omg.CORBA.portable.Streamable
{
--- a/corba/src/java.corba/share/classes/org/omg/CORBA/LongSeqHelper.java Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/org/omg/CORBA/LongSeqHelper.java Fri Sep 25 12:04:35 2015 -0700
@@ -26,26 +26,26 @@
/**
-* The Helper for <tt>LongSeqHelper</tt>. For more information on
-* Helper files, see <a href="doc-files/generatedfiles.html#helper">
-* "Generated Files: Helper Files"</a>.<P>
-* org/omg/CORBA/LongSeqHelper.java
-* Generated by the IDL-to-Java compiler (portable), version "3.0"
-* from streams.idl
-* 13 May 1999 22:41:36 o'clock GMT+00:00
-*
-* The class definition has been modified to conform to the following
-* OMG specifications :
-* <ul>
-* <li> ORB core as defined by CORBA 2.3.1
-* (<a href="http://www.omg.org/cgi-bin/doc?formal/99-10-07">formal/99-10-07</a>)
-* </li>
-*
-* <li> IDL/Java Language Mapping as defined in
-* <a href="http://www.omg.org/cgi-bin/doc?ptc/00-01-08">ptc/00-01-08</a>
-* </li>
-* </ul>
-*/
+ * The Helper for {@code LongSeqHelper}. For more information on
+ * Helper files, see <a href="doc-files/generatedfiles.html#helper">
+ * "Generated Files: Helper Files"</a>.<P>
+ * org/omg/CORBA/LongSeqHelper.java
+ * Generated by the IDL-to-Java compiler (portable), version "3.0"
+ * from streams.idl
+ * 13 May 1999 22:41:36 o'clock GMT+00:00
+ *
+ * The class definition has been modified to conform to the following
+ * OMG specifications :
+ * <ul>
+ * <li> ORB core as defined by CORBA 2.3.1
+ * (<a href="http://www.omg.org/cgi-bin/doc?formal/99-10-07">formal/99-10-07</a>)
+ * </li>
+ *
+ * <li> IDL/Java Language Mapping as defined in
+ * <a href="http://www.omg.org/cgi-bin/doc?ptc/00-01-08">ptc/00-01-08</a>
+ * </li>
+ * </ul>
+ */
public abstract class LongSeqHelper
{
--- a/corba/src/java.corba/share/classes/org/omg/CORBA/LongSeqHolder.java Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/org/omg/CORBA/LongSeqHolder.java Fri Sep 25 12:04:35 2015 -0700
@@ -26,14 +26,14 @@
/**
-* The Holder for <tt>LongSeq</tt>. For more information on
-* Holder files, see <a href="doc-files/generatedfiles.html#holder">
-* "Generated Files: Holder Files"</a>.<P>
-* org/omg/CORBA/LongSeqHolder.java
-* Generated by the IDL-to-Java compiler (portable), version "3.0"
-* from streams.idl
-* 13 May 1999 22:41:36 o'clock GMT+00:00
-*/
+ * The Holder for {@code LongSeq}. For more information on
+ * Holder files, see <a href="doc-files/generatedfiles.html#holder">
+ * "Generated Files: Holder Files"</a>.<P>
+ * org/omg/CORBA/LongSeqHolder.java
+ * Generated by the IDL-to-Java compiler (portable), version "3.0"
+ * from streams.idl
+ * 13 May 1999 22:41:36 o'clock GMT+00:00
+ */
public final class LongSeqHolder implements org.omg.CORBA.portable.Streamable
{
--- a/corba/src/java.corba/share/classes/org/omg/CORBA/MARSHAL.java Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/org/omg/CORBA/MARSHAL.java Fri Sep 25 12:04:35 2015 -0700
@@ -31,7 +31,7 @@
* or server-side run time. For example, if a reply from the server
* indicates that the message contains 1000 bytes, but the actual
* message is shorter or longer than 1000 bytes, the ORB raises
- * this exception. <tt>MARSHAL</tt> can also be caused by using
+ * this exception. {@code MARSHAL} can also be caused by using
* the DII or DSI incorrectly, for example, if the type of the
* actual parameters sent does not agree with IDL signature of an
* operation.<P>
@@ -47,7 +47,7 @@
public final class MARSHAL extends SystemException {
/**
- * Constructs a <code>MARSHAL</code> exception with a default minor code
+ * Constructs a {@code MARSHAL} exception with a default minor code
* of 0, a completion state of CompletionStatus.COMPLETED_NO,
* and a null description.
*/
@@ -56,7 +56,7 @@
}
/**
- * Constructs a <code>MARSHAL</code> exception with the specified description message,
+ * Constructs a {@code MARSHAL} exception with the specified description message,
* a minor code of 0, and a completion state of COMPLETED_NO.
* @param s the String containing a description of the exception
*/
@@ -65,7 +65,7 @@
}
/**
- * Constructs a <code>MARSHAL</code> exception with the specified
+ * Constructs a {@code MARSHAL} exception with the specified
* minor code and completion status.
* @param minor the minor code
* @param completed the completion status
@@ -75,7 +75,7 @@
}
/**
- * Constructs a <code>MARSHAL</code> exception with the specified description
+ * Constructs a {@code MARSHAL} exception with the specified description
* message, minor code, and completion status.
* @param s the String containing a description message
* @param minor the minor code
--- a/corba/src/java.corba/share/classes/org/omg/CORBA/NO_IMPLEMENT.java Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/org/omg/CORBA/NO_IMPLEMENT.java Fri Sep 25 12:04:35 2015 -0700
@@ -28,7 +28,7 @@
/**
* This exception indicates that even though the operation that
* was invoked exists (it has an IDL definition), no implementation
- * for that operation exists. <tt>NO_IMPLEMENT</tt> can, for
+ * for that operation exists. {@code NO_IMPLEMENT} can, for
* example, be raised by an ORB if a client asks for an object's
* type definition from the interface repository, but no interface
* repository is provided by the ORB.<P>
@@ -44,7 +44,7 @@
public final class NO_IMPLEMENT extends SystemException {
/**
- * Constructs a <code>NO_IMPLEMENT</code> exception with a default minor code
+ * Constructs a {@code NO_IMPLEMENT} exception with a default minor code
* of 0, a completion state of CompletionStatus.COMPLETED_NO,
* and a null description.
*/
@@ -53,7 +53,7 @@
}
/**
- * Constructs a <code>NO_IMPLEMENT</code> exception with the specified description message,
+ * Constructs a {@code NO_IMPLEMENT} exception with the specified description message,
* a minor code of 0, and a completion state of COMPLETED_NO.
* @param s the String containing a description of the exception
*/
@@ -62,10 +62,10 @@
}
/**
- * Constructs a <code>NO_IMPLEMENT</code> exception with the specified
+ * Constructs a {@code NO_IMPLEMENT} exception with the specified
* minor code and completion status.
- * @param minor an <code>int</code> specifying the minor code
- * @param completed a <code>CompletionStatus</code> instance indicating
+ * @param minor an {@code int} specifying the minor code
+ * @param completed a {@code CompletionStatus} instance indicating
* the completion status
*/
public NO_IMPLEMENT(int minor, CompletionStatus completed) {
@@ -73,11 +73,11 @@
}
/**
- * Constructs a <code>NO_IMPLEMENT</code> exception with the specified description
+ * Constructs a {@code NO_IMPLEMENT} exception with the specified description
* message, minor code, and completion status.
* @param s the String containing a description message
- * @param minor an <code>int</code> specifying the minor code
- * @param completed a <code>CompletionStatus</code> instance indicating
+ * @param minor an {@code int} specifying the minor code
+ * @param completed a {@code CompletionStatus} instance indicating
* the completion status
*/
public NO_IMPLEMENT(String s, int minor, CompletionStatus completed) {
--- a/corba/src/java.corba/share/classes/org/omg/CORBA/NameValuePair.java Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/org/omg/CORBA/NameValuePair.java Fri Sep 25 12:04:35 2015 -0700
@@ -28,33 +28,33 @@
/**
* Associates a name with a value that is an
- * attribute of an IDL struct, and is used in the <tt>DynStruct</tt> APIs.
+ * attribute of an IDL struct, and is used in the {@code DynStruct} APIs.
*/
public final class NameValuePair implements org.omg.CORBA.portable.IDLEntity {
/**
- * The name to be associated with a value by this <code>NameValuePair</code> object.
+ * The name to be associated with a value by this {@code NameValuePair} object.
*/
public String id;
/**
- * The value to be associated with a name by this <code>NameValuePair</code> object.
+ * The value to be associated with a name by this {@code NameValuePair} object.
*/
public org.omg.CORBA.Any value;
/**
- * Constructs an empty <code>NameValuePair</code> object.
+ * Constructs an empty {@code NameValuePair} object.
* To associate a name with a value after using this constructor, the fields
* of this object have to be accessed individually.
*/
public NameValuePair() { }
/**
- * Constructs a <code>NameValuePair</code> object that associates
- * the given name with the given <code>org.omg.CORBA.Any</code> object.
- * @param __id the name to be associated with the given <code>Any</code> object
- * @param __value the <code>Any</code> object to be associated with the given name
+ * Constructs a {@code NameValuePair} object that associates
+ * the given name with the given {@code org.omg.CORBA.Any} object.
+ * @param __id the name to be associated with the given {@code Any} object
+ * @param __value the {@code Any} object to be associated with the given name
*/
public NameValuePair(String __id, org.omg.CORBA.Any __value) {
id = __id;
--- a/corba/src/java.corba/share/classes/org/omg/CORBA/NameValuePairHelper.java Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/org/omg/CORBA/NameValuePairHelper.java Fri Sep 25 12:04:35 2015 -0700
@@ -26,13 +26,13 @@
/**
-* The Helper for <tt>NameValuePair</tt>. For more information on
-* Helper files, see <a href="doc-files/generatedfiles.html#helper">
-* "Generated Files: Helper Files"</a>.<P>
-* org/omg/CORBA/NameValuePairHelper.java
-* Generated by the IDL-to-Java compiler (portable), version "3.0"
-* 03 June 1999 11:52:03 o'clock GMT+00:00
-*/
+ * The Helper for {@code NameValuePair}. For more information on
+ * Helper files, see <a href="doc-files/generatedfiles.html#helper">
+ * "Generated Files: Helper Files"</a>.<P>
+ * org/omg/CORBA/NameValuePairHelper.java
+ * Generated by the IDL-to-Java compiler (portable), version "3.0"
+ * 03 June 1999 11:52:03 o'clock GMT+00:00
+ */
abstract public class NameValuePairHelper
{
--- a/corba/src/java.corba/share/classes/org/omg/CORBA/ORB.java Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/org/omg/CORBA/ORB.java Fri Sep 25 12:04:35 2015 -0700
@@ -40,7 +40,7 @@
/**
* A class providing APIs for the CORBA Object Request Broker
- * features. The <code>ORB</code> class also provides
+ * features. The {@code ORB} class also provides
* "pluggable ORB implementation" APIs that allow another vendor's ORB
* implementation to be used.
* <P>
@@ -49,12 +49,12 @@
* objects servicing requests (servers).
* <P>
*
- * The <code>ORB</code> class, which
+ * The {@code ORB} class, which
* encapsulates generic CORBA functionality, does the following:
* (Note that items 5 and 6, which include most of the methods in
- * the class <code>ORB</code>, are typically used with the <code>Dynamic Invocation
- * Interface</code> (DII) and the <code>Dynamic Skeleton Interface</code>
- * (DSI).
+ * the class {@code ORB}, are typically used with the
+ * {@code Dynamic Invocation Interface} (DII) and
+ * the {@code Dynamic Skeleton Interface} (DSI).
* These interfaces may be used by a developer directly, but
* most commonly they are used by the ORB internally and are
* not seen by the general programmer.)
@@ -62,29 +62,29 @@
* <li> initializes the ORB implementation by supplying values for
* predefined properties and environmental parameters
* <li> obtains initial object references to services such as
- * the NameService using the method <code>resolve_initial_references</code>
+ * the NameService using the method {@code resolve_initial_references}
* <li> converts object references to strings and back
* <li> connects the ORB to a servant (an instance of a CORBA object
* implementation) and disconnects the ORB from a servant
* <li> creates objects such as
* <ul>
- * <li><code>TypeCode</code>
- * <li><code>Any</code>
- * <li><code>NamedValue</code>
- * <li><code>Context</code>
- * <li><code>Environment</code>
- * <li>lists (such as <code>NVList</code>) containing these objects
+ * <li>{@code TypeCode}
+ * <li>{@code Any}
+ * <li>{@code NamedValue}
+ * <li>{@code Context}
+ * <li>{@code Environment}
+ * <li>lists (such as {@code NVList}) containing these objects
* </ul>
* <li> sends multiple messages in the DII
* </OL>
*
* <P>
- * The <code>ORB</code> class can be used to obtain references to objects
+ * The {@code ORB} class can be used to obtain references to objects
* implemented anywhere on the network.
* <P>
* An application or applet gains access to the CORBA environment
- * by initializing itself into an <code>ORB</code> using one of
- * three <code>init</code> methods. Two of the three methods use the properties
+ * by initializing itself into an {@code ORB} using one of
+ * three {@code init} methods. Two of the three methods use the properties
* (associations of a name with a value) shown in the
* table below.<BR>
* <TABLE BORDER=1 SUMMARY="Standard Java CORBA Properties">
@@ -93,10 +93,10 @@
* <TR><TD>org.omg.CORBA.ORBClass</TD>
* <TD>class name of an ORB implementation</TD></TR>
* <TR><TD>org.omg.CORBA.ORBSingletonClass</TD>
- * <TD>class name of the ORB returned by <code>init()</code></TD></TR>
+ * <TD>class name of the ORB returned by {@code init()}</TD></TR>
* </TABLE>
* <P>
- * These properties allow a different vendor's <code>ORB</code>
+ * These properties allow a different vendor's {@code ORB}
* implementation to be "plugged in."
* <P>
* When an ORB instance is being created, the class name of the ORB
@@ -122,12 +122,12 @@
* <P>
* Note that Java IDL provides a default implementation for the
* fully-functional ORB and for the Singleton ORB. When the method
- * <code>init</code> is given no parameters, the default Singleton
- * ORB is returned. When the method <code>init</code> is given parameters
+ * {@code init} is given no parameters, the default Singleton
+ * ORB is returned. When the method {@code init} is given parameters
* but no ORB class is specified, the Java IDL ORB implementation
* is returned.
* <P>
- * The following code fragment creates an <code>ORB</code> object
+ * The following code fragment creates an {@code ORB} object
* initialized with the default ORB Singleton.
* This ORB has a
* restricted implementation to prevent malicious applets from doing
@@ -138,9 +138,9 @@
* ORB orb = ORB.init();
* </PRE>
* <P>
- * The following code fragment creates an <code>ORB</code> object
- * for an application. The parameter <code>args</code>
- * represents the arguments supplied to the application's <code>main</code>
+ * The following code fragment creates an {@code ORB} object
+ * for an application. The parameter {@code args}
+ * represents the arguments supplied to the application's {@code main}
* method. Since the property specifies the ORB class to be
* "SomeORBImplementation", the new ORB will be initialized with
* that ORB implementation. If p had been null,
@@ -153,7 +153,7 @@
* ORB orb = ORB.init(args, p);
* </PRE>
* <P>
- * The following code fragment creates an <code>ORB</code> object
+ * The following code fragment creates an {@code ORB} object
* for the applet supplied as the first parameter. If the given
* applet does not specify an ORB class, the new ORB will be
* initialized with the default Java IDL implementation.
@@ -271,27 +271,27 @@
}
/**
- * Returns the <code>ORB</code> singleton object. This method always returns the
+ * Returns the {@code ORB} singleton object. This method always returns the
* same ORB instance, which is an instance of the class described by the
- * <code>org.omg.CORBA.ORBSingletonClass</code> system property.
+ * {@code org.omg.CORBA.ORBSingletonClass} system property.
* <P>
- * This no-argument version of the method <code>init</code> is used primarily
- * as a factory for <code>TypeCode</code> objects, which are used by
- * <code>Helper</code> classes to implement the method <code>type</code>.
- * It is also used to create <code>Any</code> objects that are used to
- * describe <code>union</code> labels (as part of creating a <code>
- * TypeCode</code> object for a <code>union</code>).
+ * This no-argument version of the method {@code init} is used primarily
+ * as a factory for {@code TypeCode} objects, which are used by
+ * {@code Helper} classes to implement the method {@code type}.
+ * It is also used to create {@code Any} objects that are used to
+ * describe {@code union} labels (as part of creating a
+ * {@code TypeCode} object for a {@code union}).
* <P>
* This method is not intended to be used by applets, and in the event
* that it is called in an applet environment, the ORB it returns
* is restricted so that it can be used only as a factory for
- * <code>TypeCode</code> objects. Any <code>TypeCode</code> objects
+ * {@code TypeCode} objects. Any {@code TypeCode} objects
* it produces can be safely shared among untrusted applets.
* <P>
* If an ORB is created using this method from an applet,
* a system exception will be thrown if
* methods other than those for
- * creating <code>TypeCode</code> objects are invoked.
+ * creating {@code TypeCode} objects are invoked.
*
* @return the singleton ORB
*
@@ -350,13 +350,13 @@
}
/**
- * Creates a new <code>ORB</code> instance for a standalone
+ * Creates a new {@code ORB} instance for a standalone
* application. This method may be called from applications
- * only and returns a new fully functional <code>ORB</code> object
+ * only and returns a new fully functional {@code ORB} object
* each time it is called.
- * @param args command-line arguments for the application's <code>main</code>
- * method; may be <code>null</code>
- * @param props application-specific properties; may be <code>null</code>
+ * @param args command-line arguments for the application's {@code main}
+ * method; may be {@code null}
+ * @param props application-specific properties; may be {@code null}
* @return the newly-created ORB instance
*
* @implNote
@@ -394,11 +394,11 @@
/**
- * Creates a new <code>ORB</code> instance for an applet. This
+ * Creates a new {@code ORB} instance for an applet. This
* method may be called from applets only and returns a new
- * fully-functional <code>ORB</code> object each time it is called.
- * @param app the applet; may be <code>null</code>
- * @param props applet-specific properties; may be <code>null</code>
+ * fully-functional {@code ORB} object each time it is called.
+ * @param app the applet; may be {@code null}
+ * @param props applet-specific properties; may be {@code null}
* @return the newly-created ORB instance
*
* @implNote
@@ -430,11 +430,11 @@
* Allows the ORB implementation to be initialized with the given
* parameters and properties. This method, used in applications only,
* is implemented by subclass ORB implementations and called
- * by the appropriate <code>init</code> method to pass in its parameters.
+ * by the appropriate {@code init} method to pass in its parameters.
*
- * @param args command-line arguments for the application's <code>main</code>
- * method; may be <code>null</code>
- * @param props application-specific properties; may be <code>null</code>
+ * @param args command-line arguments for the application's {@code main}
+ * method; may be {@code null}
+ * @param props application-specific properties; may be {@code null}
*/
abstract protected void set_parameters(String[] args, Properties props);
@@ -442,10 +442,10 @@
* Allows the ORB implementation to be initialized with the given
* applet and parameters. This method, used in applets only,
* is implemented by subclass ORB implementations and called
- * by the appropriate <code>init</code> method to pass in its parameters.
+ * by the appropriate {@code init} method to pass in its parameters.
*
- * @param app the applet; may be <code>null</code>
- * @param props applet-specific properties; may be <code>null</code>
+ * @param app the applet; may be {@code null}
+ * @param props applet-specific properties; may be {@code null}
*/
abstract protected void set_parameters(Applet app, Properties props);
@@ -453,17 +453,17 @@
* Connects the given servant object (a Java object that is
* an instance of the server implementation class)
* to the ORB. The servant class must
- * extend the <code>ImplBase</code> class corresponding to the interface that is
+ * extend the {@code ImplBase} class corresponding to the interface that is
* supported by the server. The servant must thus be a CORBA object
- * reference, and inherit from <code>org.omg.CORBA.Object</code>.
+ * reference, and inherit from {@code org.omg.CORBA.Object}.
* Servants created by the user can start receiving remote invocations
- * after the method <code>connect</code> has been called. A servant may also be
+ * after the method {@code connect} has been called. A servant may also be
* automatically and implicitly connected to the ORB if it is passed as
* an IDL parameter in an IDL method invocation on a non-local object,
* that is, if the servant object has to be marshalled and sent outside of the
* process address space.
* <P>
- * Calling the method <code>connect</code> has no effect
+ * Calling the method {@code connect} has no effect
* when the servant object is already connected to the ORB.
* <P>
* Deprecated by the OMG in favor of the Portable Object Adapter APIs.
@@ -477,17 +477,17 @@
/**
* Destroys the ORB so that its resources can be reclaimed.
* Any operation invoked on a destroyed ORB reference will throw the
- * <code>OBJECT_NOT_EXIST</code> exception.
- * Once an ORB has been destroyed, another call to <code>init</code>
+ * {@code OBJECT_NOT_EXIST} exception.
+ * Once an ORB has been destroyed, another call to {@code init}
* with the same ORBid will return a reference to a newly constructed ORB.<p>
- * If <code>destroy</code> is called on an ORB that has not been shut down,
+ * If {@code destroy} is called on an ORB that has not been shut down,
* it will start the shut down process and block until the ORB has shut down
* before it destroys the ORB.<br>
- * If an application calls <code>destroy</code> in a thread that is currently servicing
- * an invocation, the <code>BAD_INV_ORDER</code> system exception will be thrown
+ * If an application calls {@code destroy} in a thread that is currently servicing
+ * an invocation, the {@code BAD_INV_ORDER} system exception will be thrown
* with the OMG minor code 3, since blocking would result in a deadlock.<p>
* For maximum portability and to avoid resource leaks, an application should
- * always call <code>shutdown</code> and <code>destroy</code>
+ * always call {@code shutdown} and {@code destroy}
* on all ORB instances before exiting.
*
* @throws org.omg.CORBA.BAD_INV_ORDER if the current thread is servicing an invocation
@@ -500,14 +500,14 @@
* Disconnects the given servant object from the ORB. After this method returns,
* the ORB will reject incoming remote requests for the disconnected
* servant and will send the exception
- * <code>org.omg.CORBA.OBJECT_NOT_EXIST</code> back to the
+ * {@code org.omg.CORBA.OBJECT_NOT_EXIST} back to the
* remote client. Thus the object appears to be destroyed from the
* point of view of remote clients. Note, however, that local requests issued
* using the servant directly do not
* pass through the ORB; hence, they will continue to be processed by the
* servant.
* <P>
- * Calling the method <code>disconnect</code> has no effect
+ * Calling the method {@code disconnect} has no effect
* if the servant is not connected to the ORB.
* <P>
* Deprecated by the OMG in favor of the Portable Object Adapter APIs.
@@ -535,7 +535,7 @@
* Returns a list of the initially available CORBA object references,
* such as "NameService" and "InterfaceRepository".
*
- * @return an array of <code>String</code> objects that represent
+ * @return an array of {@code String} objects that represent
* the object references for CORBA services
* that are initially available with this ORB
*/
@@ -559,8 +559,8 @@
* strings generated by a different ORB to be converted back into an object
* reference.
* <P>
- * The resulting <code>String</code> object may be stored or communicated
- * in any way that a <code>String</code> object can be manipulated.
+ * The resulting {@code String} object may be stored or communicated
+ * in any way that a {@code String} object can be manipulated.
*
* @param obj the object reference to stringify
* @return the string representing the object reference
@@ -568,43 +568,43 @@
abstract public String object_to_string(org.omg.CORBA.Object obj);
/**
- * Converts a string produced by the method <code>object_to_string</code>
+ * Converts a string produced by the method {@code object_to_string}
* back to a CORBA object reference.
*
* @param str the string to be converted back to an object reference. It must
* be the result of converting an object reference to a string using the
- * method <code>object_to_string</code>.
+ * method {@code object_to_string}.
* @return the object reference
*/
abstract public org.omg.CORBA.Object string_to_object(String str);
/**
- * Allocates an <code>NVList</code> with (probably) enough
- * space for the specified number of <code>NamedValue</code> objects.
+ * Allocates an {@code NVList} with (probably) enough
+ * space for the specified number of {@code NamedValue} objects.
* Note that the specified size is only a hint to help with
* storage allocation and does not imply the maximum size of the list.
*
- * @param count suggested number of <code>NamedValue</code> objects for
+ * @param count suggested number of {@code NamedValue} objects for
* which to allocate space
- * @return the newly-created <code>NVList</code>
+ * @return the newly-created {@code NVList}
*
* @see NVList
*/
abstract public NVList create_list(int count);
/**
- * Creates an <code>NVList</code> initialized with argument
+ * Creates an {@code NVList} initialized with argument
* descriptions for the operation described in the given
- * <code>OperationDef</code> object. This <code>OperationDef</code> object
+ * {@code OperationDef} object. This {@code OperationDef} object
* is obtained from an Interface Repository. The arguments in the
- * returned <code>NVList</code> object are in the same order as in the
+ * returned {@code NVList} object are in the same order as in the
* original IDL operation definition, which makes it possible for the list
* to be used in dynamic invocation requests.
*
- * @param oper the <code>OperationDef</code> object to use to create the list
- * @return a newly-created <code>NVList</code> object containing
+ * @param oper the {@code OperationDef} object to use to create the list
+ * @return a newly-created {@code NVList} object containing
* descriptions of the arguments to the method described in the given
- * <code>OperationDef</code> object
+ * {@code OperationDef} object
*
* @see NVList
*/
@@ -657,63 +657,63 @@
/**
- * Creates a <code>NamedValue</code> object
+ * Creates a {@code NamedValue} object
* using the given name, value, and argument mode flags.
* <P>
- * A <code>NamedValue</code> object serves as (1) a parameter or return
+ * A {@code NamedValue} object serves as (1) a parameter or return
* value or (2) a context property.
* It may be used by itself or
- * as an element in an <code>NVList</code> object.
+ * as an element in an {@code NVList} object.
*
- * @param s the name of the <code>NamedValue</code> object
- * @param any the <code>Any</code> value to be inserted into the
- * <code>NamedValue</code> object
- * @param flags the argument mode flags for the <code>NamedValue</code>: one of
- * <code>ARG_IN.value</code>, <code>ARG_OUT.value</code>,
- * or <code>ARG_INOUT.value</code>.
+ * @param s the name of the {@code NamedValue} object
+ * @param any the {@code Any} value to be inserted into the
+ * {@code NamedValue} object
+ * @param flags the argument mode flags for the {@code NamedValue}: one of
+ * {@code ARG_IN.value}, {@code ARG_OUT.value},
+ * or {@code ARG_INOUT.value}.
*
- * @return the newly-created <code>NamedValue</code> object
+ * @return the newly-created {@code NamedValue} object
* @see NamedValue
*/
abstract public NamedValue create_named_value(String s, Any any, int flags);
/**
- * Creates an empty <code>ExceptionList</code> object.
+ * Creates an empty {@code ExceptionList} object.
*
- * @return the newly-created <code>ExceptionList</code> object
+ * @return the newly-created {@code ExceptionList} object
*/
abstract public ExceptionList create_exception_list();
/**
- * Creates an empty <code>ContextList</code> object.
+ * Creates an empty {@code ContextList} object.
*
- * @return the newly-created <code>ContextList</code> object
+ * @return the newly-created {@code ContextList} object
* @see ContextList
* @see Context
*/
abstract public ContextList create_context_list();
/**
- * Gets the default <code>Context</code> object.
+ * Gets the default {@code Context} object.
*
- * @return the default <code>Context</code> object
+ * @return the default {@code Context} object
* @see Context
*/
abstract public Context get_default_context();
/**
- * Creates an <code>Environment</code> object.
+ * Creates an {@code Environment} object.
*
- * @return the newly-created <code>Environment</code> object
+ * @return the newly-created {@code Environment} object
* @see Environment
*/
abstract public Environment create_environment();
/**
- * Creates a new <code>org.omg.CORBA.portable.OutputStream</code> into which
+ * Creates a new {@code org.omg.CORBA.portable.OutputStream} into which
* IDL method parameters can be marshalled during method invocation.
- * @return the newly-created
- * <code>org.omg.CORBA.portable.OutputStream</code> object
+ * @return the newly-created
+ * {@code org.omg.CORBA.portable.OutputStream} object
*/
abstract public org.omg.CORBA.portable.OutputStream create_output_stream();
@@ -722,31 +722,31 @@
* any responses. Note that oneway invocations are not guaranteed to
* reach the server.
*
- * @param req an array of request objects
+ * @param req an array of request objects
*/
abstract public void send_multiple_requests_oneway(Request[] req);
/**
* Sends multiple dynamic (DII) requests asynchronously.
*
- * @param req an array of <code>Request</code> objects
+ * @param req an array of {@code Request} objects
*/
abstract public void send_multiple_requests_deferred(Request[] req);
/**
* Finds out if any of the deferred (asynchronous) invocations have
* a response yet.
- * @return <code>true</code> if there is a response available;
- * <code> false</code> otherwise
+ * @return {@code true} if there is a response available;
+ * {@code false} otherwise
*/
abstract public boolean poll_next_response();
/**
- * Gets the next <code>Request</code> instance for which a response
+ * Gets the next {@code Request} instance for which a response
* has been received.
*
- * @return the next <code>Request</code> object ready with a response
- * @exception WrongTransaction if the method <code>get_next_response</code>
+ * @return the next {@code Request} object ready with a response
+ * @exception WrongTransaction if the method {@code get_next_response}
* is called from a transaction scope different
* from the one from which the original request was sent. See the
* OMG Transaction Service specification for details.
@@ -754,150 +754,150 @@
abstract public Request get_next_response() throws WrongTransaction;
/**
- * Retrieves the <code>TypeCode</code> object that represents
+ * Retrieves the {@code TypeCode} object that represents
* the given primitive IDL type.
*
- * @param tcKind the <code>TCKind</code> instance corresponding to the
+ * @param tcKind the {@code TCKind} instance corresponding to the
* desired primitive type
- * @return the requested <code>TypeCode</code> object
+ * @return the requested {@code TypeCode} object
*/
abstract public TypeCode get_primitive_tc(TCKind tcKind);
/**
- * Creates a <code>TypeCode</code> object representing an IDL <code>struct</code>.
- * The <code>TypeCode</code> object is initialized with the given id,
+ * Creates a {@code TypeCode} object representing an IDL {@code struct}.
+ * The {@code TypeCode} object is initialized with the given id,
* name, and members.
*
- * @param id the repository id for the <code>struct</code>
- * @param name the name of the <code>struct</code>
- * @param members an array describing the members of the <code>struct</code>
- * @return a newly-created <code>TypeCode</code> object describing
- * an IDL <code>struct</code>
+ * @param id the repository id for the {@code struct}
+ * @param name the name of the {@code struct}
+ * @param members an array describing the members of the {@code struct}
+ * @return a newly-created {@code TypeCode} object describing
+ * an IDL {@code struct}
*/
abstract public TypeCode create_struct_tc(String id, String name,
StructMember[] members);
/**
- * Creates a <code>TypeCode</code> object representing an IDL <code>union</code>.
- * The <code>TypeCode</code> object is initialized with the given id,
+ * Creates a {@code TypeCode} object representing an IDL {@code union}.
+ * The {@code TypeCode} object is initialized with the given id,
* name, discriminator type, and members.
*
- * @param id the repository id of the <code>union</code>
- * @param name the name of the <code>union</code>
- * @param discriminator_type the type of the <code>union</code> discriminator
- * @param members an array describing the members of the <code>union</code>
- * @return a newly-created <code>TypeCode</code> object describing
- * an IDL <code>union</code>
+ * @param id the repository id of the {@code union}
+ * @param name the name of the {@code union}
+ * @param discriminator_type the type of the {@code union} discriminator
+ * @param members an array describing the members of the {@code union}
+ * @return a newly-created {@code TypeCode} object describing
+ * an IDL {@code union}
*/
abstract public TypeCode create_union_tc(String id, String name,
TypeCode discriminator_type,
UnionMember[] members);
/**
- * Creates a <code>TypeCode</code> object representing an IDL <code>enum</code>.
- * The <code>TypeCode</code> object is initialized with the given id,
+ * Creates a {@code TypeCode} object representing an IDL {@code enum}.
+ * The {@code TypeCode} object is initialized with the given id,
* name, and members.
*
- * @param id the repository id for the <code>enum</code>
- * @param name the name for the <code>enum</code>
- * @param members an array describing the members of the <code>enum</code>
- * @return a newly-created <code>TypeCode</code> object describing
- * an IDL <code>enum</code>
+ * @param id the repository id for the {@code enum}
+ * @param name the name for the {@code enum}
+ * @param members an array describing the members of the {@code enum}
+ * @return a newly-created {@code TypeCode} object describing
+ * an IDL {@code enum}
*/
abstract public TypeCode create_enum_tc(String id, String name, String[] members);
/**
- * Creates a <code>TypeCode</code> object representing an IDL <code>alias</code>
- * (<code>typedef</code>).
- * The <code>TypeCode</code> object is initialized with the given id,
+ * Creates a {@code TypeCode} object representing an IDL {@code alias}
+ * ({@code typedef}).
+ * The {@code TypeCode} object is initialized with the given id,
* name, and original type.
*
* @param id the repository id for the alias
* @param name the name for the alias
* @param original_type
- * the <code>TypeCode</code> object describing the original type
- * for which this is an alias
- * @return a newly-created <code>TypeCode</code> object describing
- * an IDL <code>alias</code>
+ * the {@code TypeCode} object describing the original type
+ * for which this is an alias
+ * @return a newly-created {@code TypeCode} object describing
+ * an IDL {@code alias}
*/
abstract public TypeCode create_alias_tc(String id, String name,
TypeCode original_type);
/**
- * Creates a <code>TypeCode</code> object representing an IDL <code>exception</code>.
- * The <code>TypeCode</code> object is initialized with the given id,
+ * Creates a {@code TypeCode} object representing an IDL {@code exception}.
+ * The {@code TypeCode} object is initialized with the given id,
* name, and members.
*
- * @param id the repository id for the <code>exception</code>
- * @param name the name for the <code>exception</code>
- * @param members an array describing the members of the <code>exception</code>
- * @return a newly-created <code>TypeCode</code> object describing
- * an IDL <code>exception</code>
+ * @param id the repository id for the {@code exception}
+ * @param name the name for the {@code exception}
+ * @param members an array describing the members of the {@code exception}
+ * @return a newly-created {@code TypeCode} object describing
+ * an IDL {@code exception}
*/
abstract public TypeCode create_exception_tc(String id, String name,
StructMember[] members);
/**
- * Creates a <code>TypeCode</code> object representing an IDL <code>interface</code>.
- * The <code>TypeCode</code> object is initialized with the given id
+ * Creates a {@code TypeCode} object representing an IDL {@code interface}.
+ * The {@code TypeCode} object is initialized with the given id
* and name.
*
- * @param id the repository id for the interface
- * @param name the name for the interface
- * @return a newly-created <code>TypeCode</code> object describing
- * an IDL <code>interface</code>
+ * @param id the repository id for the interface
+ * @param name the name for the interface
+ * @return a newly-created {@code TypeCode} object describing
+ * an IDL {@code interface}
*/
abstract public TypeCode create_interface_tc(String id, String name);
/**
- * Creates a <code>TypeCode</code> object representing a bounded IDL
- * <code>string</code>.
- * The <code>TypeCode</code> object is initialized with the given bound,
+ * Creates a {@code TypeCode} object representing a bounded IDL
+ * {@code string}.
+ * The {@code TypeCode} object is initialized with the given bound,
* which represents the maximum length of the string. Zero indicates
* that the string described by this type code is unbounded.
*
- * @param bound the bound for the <code>string</code>; cannot be negative
- * @return a newly-created <code>TypeCode</code> object describing
- * a bounded IDL <code>string</code>
+ * @param bound the bound for the {@code string}; cannot be negative
+ * @return a newly-created {@code TypeCode} object describing
+ * a bounded IDL {@code string}
* @exception BAD_PARAM if bound is a negative value
*/
abstract public TypeCode create_string_tc(int bound);
/**
- * Creates a <code>TypeCode</code> object representing a bounded IDL
- * <code>wstring</code> (wide string).
- * The <code>TypeCode</code> object is initialized with the given bound,
+ * Creates a {@code TypeCode} object representing a bounded IDL
+ * {@code wstring} (wide string).
+ * The {@code TypeCode} object is initialized with the given bound,
* which represents the maximum length of the wide string. Zero indicates
* that the string described by this type code is unbounded.
*
- * @param bound the bound for the <code>wstring</code>; cannot be negative
- * @return a newly-created <code>TypeCode</code> object describing
- * a bounded IDL <code>wstring</code>
+ * @param bound the bound for the {@code wstring}; cannot be negative
+ * @return a newly-created {@code TypeCode} object describing
+ * a bounded IDL {@code wstring}
* @exception BAD_PARAM if bound is a negative value
*/
abstract public TypeCode create_wstring_tc(int bound);
/**
- * Creates a <code>TypeCode</code> object representing an IDL <code>sequence</code>.
- * The <code>TypeCode</code> object is initialized with the given bound and
+ * Creates a {@code TypeCode} object representing an IDL {@code sequence}.
+ * The {@code TypeCode} object is initialized with the given bound and
* element type.
*
- * @param bound the bound for the <code>sequence</code>, 0 if unbounded
- * @param element_type
- * the <code>TypeCode</code> object describing the elements
- * contained in the <code>sequence</code>
- * @return a newly-created <code>TypeCode</code> object describing
- * an IDL <code>sequence</code>
+ * @param bound the bound for the {@code sequence}, 0 if unbounded
+ * @param element_type the {@code TypeCode} object describing
+ * the elements contained in the {@code sequence}
+ *
+ * @return a newly-created {@code TypeCode} object describing
+ * an IDL {@code sequence}
*/
abstract public TypeCode create_sequence_tc(int bound, TypeCode element_type);
/**
- * Creates a <code>TypeCode</code> object representing a
- * a recursive IDL <code>sequence</code>.
+ * Creates a {@code TypeCode} object representing a
+ * a recursive IDL {@code sequence}.
* <P>
- * For the IDL <code>struct</code> Node in following code fragment,
+ * For the IDL {@code struct} Node in following code fragment,
* the offset parameter for creating its sequence would be 1:
* <PRE>
* Struct Node {
@@ -907,10 +907,10 @@
* </PRE>
*
* @param bound the bound for the sequence, 0 if unbounded
- * @param offset the index to the enclosing <code>TypeCode</code> object
+ * @param offset the index to the enclosing {@code TypeCode} object
* that describes the elements of this sequence
- * @return a newly-created <code>TypeCode</code> object describing
- * a recursive sequence
+ * @return a newly-created {@code TypeCode} object describing
+ * a recursive sequence
* @deprecated Use a combination of create_recursive_tc and create_sequence_tc instead
* @see #create_recursive_tc(String) create_recursive_tc
* @see #create_sequence_tc(int, TypeCode) create_sequence_tc
@@ -919,20 +919,20 @@
abstract public TypeCode create_recursive_sequence_tc(int bound, int offset);
/**
- * Creates a <code>TypeCode</code> object representing an IDL <code>array</code>.
- * The <code>TypeCode</code> object is initialized with the given length and
+ * Creates a {@code TypeCode} object representing an IDL {@code array}.
+ * The {@code TypeCode} object is initialized with the given length and
* element type.
*
- * @param length the length of the <code>array</code>
- * @param element_type a <code>TypeCode</code> object describing the type
- * of element contained in the <code>array</code>
- * @return a newly-created <code>TypeCode</code> object describing
- * an IDL <code>array</code>
+ * @param length the length of the {@code array}
+ * @param element_type a {@code TypeCode} object describing the type
+ * of element contained in the {@code array}
+ * @return a newly-created {@code TypeCode} object describing
+ * an IDL {@code array}
*/
abstract public TypeCode create_array_tc(int length, TypeCode element_type);
/**
- * Create a <code>TypeCode</code> object for an IDL native type.
+ * Create a {@code TypeCode} object for an IDL native type.
*
* @param id the logical id for the native type.
* @param name the name of the native type.
@@ -945,7 +945,7 @@
}
/**
- * Create a <code>TypeCode</code> object for an IDL abstract interface.
+ * Create a {@code TypeCode} object for an IDL abstract interface.
*
* @param id the logical id for the abstract interface type.
* @param name the name of the abstract interface type.
@@ -960,7 +960,7 @@
/**
- * Create a <code>TypeCode</code> object for an IDL fixed type.
+ * Create a {@code TypeCode} object for an IDL fixed type.
*
* @param digits specifies the total number of decimal digits in the number
* and must be from 1 to 31 inclusive.
@@ -977,7 +977,7 @@
/**
- * Create a <code>TypeCode</code> object for an IDL value type.
+ * Create a {@code TypeCode} object for an IDL value type.
* The concrete_base parameter is the TypeCode for the immediate
* concrete valuetype base of the valuetype for which the TypeCode
* is being created.
@@ -987,7 +987,7 @@
* @param name the name of the value type.
* @param type_modifier one of the value type modifier constants:
* VM_NONE, VM_CUSTOM, VM_ABSTRACT or VM_TRUNCATABLE
- * @param concrete_base a <code>TypeCode</code> object
+ * @param concrete_base a {@code TypeCode} object
* describing the concrete valuetype base
* @param members an array containing the members of the value type
* @return the requested TypeCode
@@ -1002,14 +1002,14 @@
}
/**
- * Create a recursive <code>TypeCode</code> object which
+ * Create a recursive {@code TypeCode} object which
* serves as a placeholder for a concrete TypeCode during the process of creating
* TypeCodes which contain recursion. The id parameter specifies the repository id of
* the type for which the recursive TypeCode is serving as a placeholder. Once the
* recursive TypeCode has been properly embedded in the enclosing TypeCode which
* corresponds to the specified repository id, it will function as a normal TypeCode.
* Invoking operations on the recursive TypeCode before it has been embedded in the
- * enclosing TypeCode will result in a <code>BAD_TYPECODE</code> exception.
+ * enclosing TypeCode will result in a {@code BAD_TYPECODE} exception.
* <P>
* For example, the following IDL type declaration contains recursion:
* <PRE>
@@ -1046,7 +1046,7 @@
}
/**
- * Creates a <code>TypeCode</code> object for an IDL value box.
+ * Creates a {@code TypeCode} object for an IDL value box.
*
* @param id the logical id for the value type
* @param name the name of the value type
@@ -1064,11 +1064,11 @@
// orbos 98-01-18: Objects By Value -- end
/**
- * Creates an IDL <code>Any</code> object initialized to
- * contain a <code>Typecode</code> object whose <code>kind</code> field
- * is set to <code>TCKind.tc_null</code>.
+ * Creates an IDL {@code Any} object initialized to
+ * contain a {@code Typecode} object whose {@code kind} field
+ * is set to {@code TCKind.tc_null}.
*
- * @return a newly-created <code>Any</code> object
+ * @return a newly-created {@code Any} object
*/
abstract public Any create_any();
@@ -1076,15 +1076,15 @@
/**
- * Retrieves a <code>Current</code> object.
- * The <code>Current</code> interface is used to manage thread-specific
+ * Retrieves a {@code Current} object.
+ * The {@code Current} interface is used to manage thread-specific
* information for use by services such as transactions and security.
*
* @see <a href="package-summary.html#unimpl"><code>CORBA</code> package
* comments for unimplemented features</a>
*
- * @return a newly-created <code>Current</code> object
- * @deprecated use <code>resolve_initial_references</code>.
+ * @return a newly-created {@code Current} object
+ * @deprecated use {@code resolve_initial_references}.
*/
@Deprecated
public org.omg.CORBA.Current get_current()
@@ -1095,7 +1095,7 @@
/**
* This operation blocks the current thread until the ORB has
* completed the shutdown process, initiated when some thread calls
- * <code>shutdown</code>. It may be used by multiple threads which
+ * {@code shutdown}. It may be used by multiple threads which
* get all notified when the ORB shuts down.
*
*/
@@ -1107,29 +1107,29 @@
/**
* Instructs the ORB to shut down, which causes all
* object adapters to shut down, in preparation for destruction.<br>
- * If the <code>wait_for_completion</code> parameter
+ * If the {@code wait_for_completion} parameter
* is true, this operation blocks until all ORB processing (including
* processing of currently executing requests, object deactivation,
* and other object adapter operations) has completed.
* If an application does this in a thread that is currently servicing
- * an invocation, the <code>BAD_INV_ORDER</code> system exception
+ * an invocation, the {@code BAD_INV_ORDER} system exception
* will be thrown with the OMG minor code 3,
* since blocking would result in a deadlock.<br>
- * If the <code>wait_for_completion</code> parameter is <code>FALSE</code>,
+ * If the {@code wait_for_completion} parameter is {@code FALSE},
* then shutdown may not have completed upon return.<p>
* While the ORB is in the process of shutting down, the ORB operates as normal,
* servicing incoming and outgoing requests until all requests have been completed.
* Once an ORB has shutdown, only object reference management operations
* may be invoked on the ORB or any object reference obtained from it.
- * An application may also invoke the <code>destroy</code> operation on the ORB itself.
- * Invoking any other operation will throw the <code>BAD_INV_ORDER</code>
+ * An application may also invoke the {@code destroy} operation on the ORB itself.
+ * Invoking any other operation will throw the {@code BAD_INV_ORDER}
* system exception with the OMG minor code 4.<p>
- * The <code>ORB.run</code> method will return after
- * <code>shutdown</code> has been called.
+ * The {@code ORB.run} method will return after
+ * {@code shutdown} has been called.
*
- * @param wait_for_completion <code>true</code> if the call
+ * @param wait_for_completion {@code true} if the call
* should block until the shutdown is complete;
- * <code>false</code> if it should return immediately
+ * {@code false} if it should return immediately
* @throws org.omg.CORBA.BAD_INV_ORDER if the current thread is servicing
* an invocation
*/
@@ -1139,12 +1139,12 @@
}
/**
- * Returns <code>true</code> if the ORB needs the main thread to
- * perform some work, and <code>false</code> if the ORB does not
+ * Returns {@code true} if the ORB needs the main thread to
+ * perform some work, and {@code false} if the ORB does not
* need the main thread.
*
- * @return <code>true</code> if there is work pending, meaning that the ORB
- * needs the main thread to perform some work; <code>false</code>
+ * @return {@code true} if there is work pending, meaning that the ORB
+ * needs the main thread to perform some work; {@code false}
* if there is no work pending and thus the ORB does not need the
* main thread
*
@@ -1157,7 +1157,7 @@
/**
* Performs an implementation-dependent unit of work if called
* by the main thread. Otherwise it does nothing.
- * The methods <code>work_pending</code> and <code>perform_work</code>
+ * The methods {@code work_pending} and {@code perform_work}
* can be used in
* conjunction to implement a simple polling loop that multiplexes
* the main thread among the ORB and other activities.
@@ -1172,23 +1172,23 @@
* Used to obtain information about CORBA facilities and services
* that are supported by this ORB. The service type for which
* information is being requested is passed in as the in
- * parameter <tt>service_type</tt>, the values defined by
+ * parameter {@code service_type}, the values defined by
* constants in the CORBA module. If service information is
* available for that type, that is returned in the out parameter
- * <tt>service_info</tt>, and the operation returns the
- * value <tt>true</tt>. If no information for the requested
- * services type is available, the operation returns <tt>false</tt>
+ * {@code service_info}, and the operation returns the
+ * value {@code true}. If no information for the requested
+ * services type is available, the operation returns {@code false}
* (i.e., the service is not supported by this ORB).
*
- * @param service_type a <code>short</code> indicating the
+ * @param service_type a {@code short} indicating the
* service type for which information is being requested
- * @param service_info a <code>ServiceInformationHolder</code> object
- * that will hold the <code>ServiceInformation</code> object
+ * @param service_info a {@code ServiceInformationHolder} object
+ * that will hold the {@code ServiceInformation} object
* produced by this method
- * @return <code>true</code> if service information is available
- * for the <tt>service_type</tt>;
- * <tt>false</tt> if no information for the
- * requested services type is available
+ * @return {@code true} if service information is available
+ * for the {@code service_type};
+ * {@code false} if no information for the
+ * requested services type is available
* @see <a href="package-summary.html#unimpl"><code>CORBA</code> package
* comments for unimplemented features</a>
*/
@@ -1201,13 +1201,13 @@
// orbos 98-01-18: Objects By Value -- begin
/**
- * Creates a new <code>DynAny</code> object from the given
- * <code>Any</code> object.
+ * Creates a new {@code DynAny} object from the given
+ * {@code Any} object.
*
- * @param value the <code>Any</code> object from which to create a new
- * <code>DynAny</code> object
- * @return the new <code>DynAny</code> object created from the given
- * <code>Any</code> object
+ * @param value the {@code Any} object from which to create a new
+ * {@code DynAny} object
+ * @return the new {@code DynAny} object created from the given
+ * {@code Any} object
* @see <a href="package-summary.html#unimpl"><code>CORBA</code> package
* comments for unimplemented features</a>
* @deprecated Use the new <a href="../DynamicAny/DynAnyFactory.html">DynAnyFactory</a> API instead
@@ -1219,15 +1219,15 @@
}
/**
- * Creates a basic <code>DynAny</code> object from the given
- * <code>TypeCode</code> object.
+ * Creates a basic {@code DynAny} object from the given
+ * {@code TypeCode} object.
*
- * @param type the <code>TypeCode</code> object from which to create a new
- * <code>DynAny</code> object
- * @return the new <code>DynAny</code> object created from the given
- * <code>TypeCode</code> object
+ * @param type the {@code TypeCode} object from which to create a new
+ * {@code DynAny} object
+ * @return the new {@code DynAny} object created from the given
+ * {@code TypeCode} object
* @throws org.omg.CORBA.ORBPackage.InconsistentTypeCode if the given
- * <code>TypeCode</code> object is not consistent with the operation.
+ * {@code TypeCode} object is not consistent with the operation.
* @see <a href="package-summary.html#unimpl"><code>CORBA</code> package
* comments for unimplemented features</a>
* @deprecated Use the new <a href="../DynamicAny/DynAnyFactory.html">DynAnyFactory</a> API instead
@@ -1239,15 +1239,15 @@
}
/**
- * Creates a new <code>DynStruct</code> object from the given
- * <code>TypeCode</code> object.
+ * Creates a new {@code DynStruct} object from the given
+ * {@code TypeCode} object.
*
- * @param type the <code>TypeCode</code> object from which to create a new
- * <code>DynStruct</code> object
- * @return the new <code>DynStruct</code> object created from the given
- * <code>TypeCode</code> object
+ * @param type the {@code TypeCode} object from which to create a new
+ * {@code DynStruct} object
+ * @return the new {@code DynStruct} object created from the given
+ * {@code TypeCode} object
* @throws org.omg.CORBA.ORBPackage.InconsistentTypeCode if the given
- * <code>TypeCode</code> object is not consistent with the operation.
+ * {@code TypeCode} object is not consistent with the operation.
* @see <a href="package-summary.html#unimpl"><code>CORBA</code> package
* comments for unimplemented features</a>
* @deprecated Use the new <a href="../DynamicAny/DynAnyFactory.html">DynAnyFactory</a> API instead
@@ -1259,15 +1259,15 @@
}
/**
- * Creates a new <code>DynSequence</code> object from the given
- * <code>TypeCode</code> object.
+ * Creates a new {@code DynSequence} object from the given
+ * {@code TypeCode} object.
*
- * @param type the <code>TypeCode</code> object from which to create a new
- * <code>DynSequence</code> object
- * @return the new <code>DynSequence</code> object created from the given
- * <code>TypeCode</code> object
+ * @param type the {@code TypeCode} object from which to create a new
+ * {@code DynSequence} object
+ * @return the new {@code DynSequence} object created from the given
+ * {@code TypeCode} object
* @throws org.omg.CORBA.ORBPackage.InconsistentTypeCode if the given
- * <code>TypeCode</code> object is not consistent with the operation.
+ * {@code TypeCode} object is not consistent with the operation.
* @see <a href="package-summary.html#unimpl"><code>CORBA</code> package
* comments for unimplemented features</a>
* @deprecated Use the new <a href="../DynamicAny/DynAnyFactory.html">DynAnyFactory</a> API instead
@@ -1280,15 +1280,15 @@
/**
- * Creates a new <code>DynArray</code> object from the given
- * <code>TypeCode</code> object.
+ * Creates a new {@code DynArray} object from the given
+ * {@code TypeCode} object.
*
- * @param type the <code>TypeCode</code> object from which to create a new
- * <code>DynArray</code> object
- * @return the new <code>DynArray</code> object created from the given
- * <code>TypeCode</code> object
+ * @param type the {@code TypeCode} object from which to create a new
+ * {@code DynArray} object
+ * @return the new {@code DynArray} object created from the given
+ * {@code TypeCode} object
* @throws org.omg.CORBA.ORBPackage.InconsistentTypeCode if the given
- * <code>TypeCode</code> object is not consistent with the operation.
+ * {@code TypeCode} object is not consistent with the operation.
* @see <a href="package-summary.html#unimpl"><code>CORBA</code> package
* comments for unimplemented features</a>
* @deprecated Use the new <a href="../DynamicAny/DynAnyFactory.html">DynAnyFactory</a> API instead
@@ -1300,15 +1300,15 @@
}
/**
- * Creates a new <code>DynUnion</code> object from the given
- * <code>TypeCode</code> object.
+ * Creates a new {@code DynUnion} object from the given
+ * {@code TypeCode} object.
*
- * @param type the <code>TypeCode</code> object from which to create a new
- * <code>DynUnion</code> object
- * @return the new <code>DynUnion</code> object created from the given
- * <code>TypeCode</code> object
+ * @param type the {@code TypeCode} object from which to create a new
+ * {@code DynUnion} object
+ * @return the new {@code DynUnion} object created from the given
+ * {@code TypeCode} object
* @throws org.omg.CORBA.ORBPackage.InconsistentTypeCode if the given
- * <code>TypeCode</code> object is not consistent with the operation.
+ * {@code TypeCode} object is not consistent with the operation.
* @see <a href="package-summary.html#unimpl"><code>CORBA</code> package
* comments for unimplemented features</a>
* @deprecated Use the new <a href="../DynamicAny/DynAnyFactory.html">DynAnyFactory</a> API instead
@@ -1320,15 +1320,15 @@
}
/**
- * Creates a new <code>DynEnum</code> object from the given
- * <code>TypeCode</code> object.
+ * Creates a new {@code DynEnum} object from the given
+ * {@code TypeCode} object.
*
- * @param type the <code>TypeCode</code> object from which to create a new
- * <code>DynEnum</code> object
- * @return the new <code>DynEnum</code> object created from the given
- * <code>TypeCode</code> object
+ * @param type the {@code TypeCode} object from which to create a new
+ * {@code DynEnum} object
+ * @return the new {@code DynEnum} object created from the given
+ * {@code TypeCode} object
* @throws org.omg.CORBA.ORBPackage.InconsistentTypeCode if the given
- * <code>TypeCode</code> object is not consistent with the operation.
+ * {@code TypeCode} object is not consistent with the operation.
* @see <a href="package-summary.html#unimpl"><code>CORBA</code> package
* comments for unimplemented features</a>
* @deprecated Use the new <a href="../DynamicAny/DynAnyFactory.html">DynAnyFactory</a> API instead
@@ -1342,19 +1342,19 @@
/**
* Can be invoked to create new instances of policy objects
* of a specific type with specified initial state. If
- * <tt>create_policy</tt> fails to instantiate a new Policy
+ * {@code create_policy} fails to instantiate a new Policy
* object due to its inability to interpret the requested type
- * and content of the policy, it raises the <tt>PolicyError</tt>
+ * and content of the policy, it raises the {@code PolicyError}
* exception with the appropriate reason.
- * @param type the <tt>PolicyType</tt> of the policy object to
+ * @param type the {@code PolicyType} of the policy object to
* be created
* @param val the value that will be used to set the initial
- * state of the <tt>Policy</tt> object that is created
- * @return Reference to a newly created <tt>Policy</tt> object
- * of type specified by the <tt>type</tt> parameter and
- * initialized to a state specified by the <tt>val</tt>
+ * state of the {@code Policy} object that is created
+ * @return Reference to a newly created {@code Policy} object
+ * of type specified by the {@code type} parameter and
+ * initialized to a state specified by the {@code val}
* parameter
- * @throws <tt>org.omg.CORBA.PolicyError</tt> when the requested
+ * @throws org.omg.CORBA.PolicyError when the requested
* policy is not supported or a requested initial state
* for the policy is not supported.
*/
--- a/corba/src/java.corba/share/classes/org/omg/CORBA/ObjectHelper.java Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/org/omg/CORBA/ObjectHelper.java Fri Sep 25 12:04:35 2015 -0700
@@ -24,10 +24,10 @@
*/
/**
-* The Helper for <tt>Object</tt>. For more information on
-* Helper files, see <a href="doc-files/generatedfiles.html#helper">
-* "Generated Files: Helper Files"</a>.<P>
-*/
+ * The Helper for {@code Object}. For more information on
+ * Helper files, see <a href="doc-files/generatedfiles.html#helper">
+ * "Generated Files: Helper Files"</a>.<P>
+ */
/*
* Licensed Materials - Property of IBM
--- a/corba/src/java.corba/share/classes/org/omg/CORBA/ObjectHolder.java Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/org/omg/CORBA/ObjectHolder.java Fri Sep 25 12:04:35 2015 -0700
@@ -31,55 +31,55 @@
/**
- * The Holder for <tt>Object</tt>. For more information on
+ * The Holder for {@code Object}. For more information on
* Holder files, see <a href="doc-files/generatedfiles.html#holder">
* "Generated Files: Holder Files"</a>.<P>
* A Holder class for a CORBA object reference (a value of type
- * <code>org.omg.CORBA.Object</code>). It is usually
+ * {@code org.omg.CORBA.Object}). It is usually
* used to store "out" and "inout" parameters in IDL methods.
* If an IDL method signature has a CORBA Object reference as an "out"
* or "inout" parameter, the programmer must pass an instance of
- * <code>ObjectHolder</code> as the corresponding
+ * {@code ObjectHolder} as the corresponding
* parameter in the method invocation; for "inout" parameters, the programmer
* must also fill the "in" value to be sent to the server.
* Before the method invocation returns, the ORB will fill in the
* value corresponding to the "out" value returned from the server.
* <P>
- * If <code>myObjectHolder</code> is an instance of <code>ObjectHolder</code>,
- * the value stored in its <code>value</code> field can be accessed with
- * <code>myObjectHolder.value</code>.
+ * If {@code myObjectHolder} is an instance of {@code ObjectHolder},
+ * the value stored in its {@code value} field can be accessed with
+ * {@code myObjectHolder.value}.
*
* @since JDK1.2
*/
public final class ObjectHolder implements Streamable {
/**
- * The <code>Object</code> value held by this <code>ObjectHolder</code>
+ * The {@code Object} value held by this {@code ObjectHolder}
* object.
*/
public Object value;
/**
- * Constructs a new <code>ObjectHolder</code> object with its
- * <code>value</code> field initialized to <code>null</code>.
+ * Constructs a new {@code ObjectHolder} object with its
+ * {@code value} field initialized to {@code null}.
*/
public ObjectHolder() {
}
/**
- * Constructs a new <code>ObjectHolder</code> object with its
- * <code>value</code> field initialized to the given
- * <code>Object</code>.
- * @param initial the <code>Object</code> with which to initialize
- * the <code>value</code> field of the newly-created
- * <code>ObjectHolder</code> object
+ * Constructs a new {@code ObjectHolder} object with its
+ * {@code value} field initialized to the given
+ * {@code Object}.
+ * @param initial the {@code Object} with which to initialize
+ * the {@code value} field of the newly-created
+ * {@code ObjectHolder} object
*/
public ObjectHolder(Object initial) {
value = initial;
}
/**
- * Reads from <code>input</code> and initalizes the value in
- * this <code>ObjectHolder</code> object
+ * Reads from {@code input} and initalizes the value in
+ * this {@code ObjectHolder} object
* with the unmarshalled data.
*
* @param input the InputStream containing CDR formatted data from the wire.
@@ -89,8 +89,8 @@
}
/**
- * Marshals to <code>output</code> the value in
- * this <code>ObjectHolder</code> object.
+ * Marshals to {@code output} the value in
+ * this {@code ObjectHolder} object.
*
* @param output the OutputStream which will contain the CDR formatted data.
*/
@@ -100,10 +100,10 @@
/**
* Returns the TypeCode corresponding to the value held in
- * this <code>ObjectHolder</code> object
+ * this {@code ObjectHolder} object
*
* @return the TypeCode of the value held in
- * this <code>ObjectHolder</code> object
+ * this {@code ObjectHolder} object
*/
public org.omg.CORBA.TypeCode _type() {
return org.omg.CORBA.ORB.init().get_primitive_tc(TCKind.tk_objref);
--- a/corba/src/java.corba/share/classes/org/omg/CORBA/OctetSeqHelper.java Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/org/omg/CORBA/OctetSeqHelper.java Fri Sep 25 12:04:35 2015 -0700
@@ -26,26 +26,26 @@
/**
-* The Helper for <tt>OctetSeq</tt>. For more information on
-* Helper files, see <a href="doc-files/generatedfiles.html#helper">
-* "Generated Files: Helper Files"</a>.<P>
-* org/omg/CORBA/OctetSeqHelper.java
-* Generated by the IDL-to-Java compiler (portable), version "3.0"
-* from streams.idl
-* 13 May 1999 22:41:36 o'clock GMT+00:00
-*
-* The class definition has been modified to conform to the following
-* OMG specifications :
-* <ul>
-* <li> ORB core as defined by CORBA 2.3.1
-* (<a href="http://www.omg.org/cgi-bin/doc?formal/99-10-07">formal/99-10-07</a>)
-* </li>
-*
-* <li> IDL/Java Language Mapping as defined in
-* <a href="http://www.omg.org/cgi-bin/doc?ptc/00-01-08">ptc/00-01-08</a>
-* </li>
-* </ul>
-*/
+ * The Helper for {@code OctetSeq}. For more information on
+ * Helper files, see <a href="doc-files/generatedfiles.html#helper">
+ * "Generated Files: Helper Files"</a>.<P>
+ * org/omg/CORBA/OctetSeqHelper.java
+ * Generated by the IDL-to-Java compiler (portable), version "3.0"
+ * from streams.idl
+ * 13 May 1999 22:41:36 o'clock GMT+00:00
+ *
+ * The class definition has been modified to conform to the following
+ * OMG specifications :
+ * <ul>
+ * <li> ORB core as defined by CORBA 2.3.1
+ * (<a href="http://www.omg.org/cgi-bin/doc?formal/99-10-07">formal/99-10-07</a>)
+ * </li>
+ *
+ * <li> IDL/Java Language Mapping as defined in
+ * <a href="http://www.omg.org/cgi-bin/doc?ptc/00-01-08">ptc/00-01-08</a>
+ * </li>
+ * </ul>
+ */
public abstract class OctetSeqHelper
{
--- a/corba/src/java.corba/share/classes/org/omg/CORBA/OctetSeqHolder.java Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/org/omg/CORBA/OctetSeqHolder.java Fri Sep 25 12:04:35 2015 -0700
@@ -26,14 +26,14 @@
/**
-* The Holder for <tt>OctetSeq</tt>. For more information on
-* Holder files, see <a href="doc-files/generatedfiles.html#holder">
-* "Generated Files: Holder Files"</a>.<P>
-* org/omg/CORBA/OctetSeqHolder.java
-* Generated by the IDL-to-Java compiler (portable), version "3.0"
-* from streams.idl
-* 13 May 1999 22:41:36 o'clock GMT+00:00
-*/
+ * The Holder for {@code OctetSeq}. For more information on
+ * Holder files, see <a href="doc-files/generatedfiles.html#holder">
+ * "Generated Files: Holder Files"</a>.<P>
+ * org/omg/CORBA/OctetSeqHolder.java
+ * Generated by the IDL-to-Java compiler (portable), version "3.0"
+ * from streams.idl
+ * 13 May 1999 22:41:36 o'clock GMT+00:00
+ */
public final class OctetSeqHolder implements org.omg.CORBA.portable.Streamable
{
--- a/corba/src/java.corba/share/classes/org/omg/CORBA/Policy.java Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/org/omg/CORBA/Policy.java Fri Sep 25 12:04:35 2015 -0700
@@ -26,21 +26,21 @@
/**
-* Interfaces derived from the <tt>Policy</tt> interface allow an
-* ORB or CORBA service access to certain choices that affect
-* its operation. This information is accessed in a structured
-* manner using interfaces derived from the <tt>Policy</tt>
-* interface defined in the CORBA module. A CORBA service does not
-* have to use this method of accessing operating options, but
-* may choose to do so. The Security Service in particular uses
-* this technique for associating Security Policy with objects
-* in the system.
-* An interface generated by the IDL-to-Java compiler.
-* org/omg/CORBA/Policy.java
-* Generated by the IDL-to-Java compiler (portable), version "3.0"
-* from ../../../../../src/share/classes/org/omg/PortableServer/corba.idl
-* Saturday, July 17, 1999 12:26:20 AM PDT
-*/
+ * Interfaces derived from the {@code Policy} interface allow an
+ * ORB or CORBA service access to certain choices that affect
+ * its operation. This information is accessed in a structured
+ * manner using interfaces derived from the {@code Policy}
+ * interface defined in the CORBA module. A CORBA service does not
+ * have to use this method of accessing operating options, but
+ * may choose to do so. The Security Service in particular uses
+ * this technique for associating Security Policy with objects
+ * in the system.
+ * An interface generated by the IDL-to-Java compiler.
+ * org/omg/CORBA/Policy.java
+ * Generated by the IDL-to-Java compiler (portable), version "3.0"
+ * from ../../../../../src/share/classes/org/omg/PortableServer/corba.idl
+ * Saturday, July 17, 1999 12:26:20 AM PDT
+ */
public interface Policy extends PolicyOperations, org.omg.CORBA.Object, org.omg.CORBA.portable.IDLEntity
{
--- a/corba/src/java.corba/share/classes/org/omg/CORBA/PolicyHelper.java Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/org/omg/CORBA/PolicyHelper.java Fri Sep 25 12:04:35 2015 -0700
@@ -26,14 +26,14 @@
/**
-* The Helper for <tt>Policy</tt>. For more information on
-* Helper files, see <a href="doc-files/generatedfiles.html#helper">
-* "Generated Files: Helper Files"</a>.<P>
-* org/omg/CORBA/PolicyHelper.java
-* Generated by the IDL-to-Java compiler (portable), version "3.0"
-* from ../../../../../src/share/classes/org/omg/PortableServer/corba.idl
-* Saturday, July 17, 1999 12:26:20 AM PDT
-*/
+ * The Helper for {@code Policy}. For more information on
+ * Helper files, see <a href="doc-files/generatedfiles.html#helper">
+ * "Generated Files: Helper Files"</a>.<P>
+ * org/omg/CORBA/PolicyHelper.java
+ * Generated by the IDL-to-Java compiler (portable), version "3.0"
+ * from ../../../../../src/share/classes/org/omg/PortableServer/corba.idl
+ * Saturday, July 17, 1999 12:26:20 AM PDT
+ */
abstract public class PolicyHelper
{
--- a/corba/src/java.corba/share/classes/org/omg/CORBA/PolicyHolder.java Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/org/omg/CORBA/PolicyHolder.java Fri Sep 25 12:04:35 2015 -0700
@@ -25,14 +25,14 @@
package org.omg.CORBA;
/**
-* The Holder for <tt>Policy</tt>. For more information on
-* Holder files, see <a href="doc-files/generatedfiles.html#holder">
-* "Generated Files: Holder Files"</a>.<P>
-* org/omg/CORBA/PolicyHolder.java
-* Generated by the IDL-to-Java compiler (portable), version "3.0"
-* from ../../../../../src/share/classes/org/omg/PortableServer/corba.idl
-* Saturday, July 17, 1999 12:26:20 AM PDT
-*/
+ * The Holder for {@code Policy}. For more information on
+ * Holder files, see <a href="doc-files/generatedfiles.html#holder">
+ * "Generated Files: Holder Files"</a>.<P>
+ * org/omg/CORBA/PolicyHolder.java
+ * Generated by the IDL-to-Java compiler (portable), version "3.0"
+ * from ../../../../../src/share/classes/org/omg/PortableServer/corba.idl
+ * Saturday, July 17, 1999 12:26:20 AM PDT
+ */
public final class PolicyHolder implements org.omg.CORBA.portable.Streamable
{
--- a/corba/src/java.corba/share/classes/org/omg/CORBA/PolicyListHelper.java Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/org/omg/CORBA/PolicyListHelper.java Fri Sep 25 12:04:35 2015 -0700
@@ -26,14 +26,14 @@
/**
-* The Helper for <tt>PolicyList</tt>. For more information on
-* Helper files, see <a href="doc-files/generatedfiles.html#helper">
-* "Generated Files: Helper Files"</a>.<P>
-* org/omg/CORBA/PolicyListHelper.java
-* Generated by the IDL-to-Java compiler (portable), version "3.0"
-* from ../../../../../src/share/classes/org/omg/PortableServer/corba.idl
-* Saturday, July 17, 1999 12:26:21 AM PDT
-*/
+ * The Helper for {@code PolicyList}. For more information on
+ * Helper files, see <a href="doc-files/generatedfiles.html#helper">
+ * "Generated Files: Helper Files"</a>.<P>
+ * org/omg/CORBA/PolicyListHelper.java
+ * Generated by the IDL-to-Java compiler (portable), version "3.0"
+ * from ../../../../../src/share/classes/org/omg/PortableServer/corba.idl
+ * Saturday, July 17, 1999 12:26:21 AM PDT
+ */
abstract public class PolicyListHelper
{
--- a/corba/src/java.corba/share/classes/org/omg/CORBA/PolicyListHolder.java Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/org/omg/CORBA/PolicyListHolder.java Fri Sep 25 12:04:35 2015 -0700
@@ -26,14 +26,14 @@
/**
-* The Holder for <tt>PolicyList</tt>. For more information on
-* Holder files, see <a href="doc-files/generatedfiles.html#holder">
-* "Generated Files: Holder Files"</a>.<P>
-* org/omg/CORBA/PolicyListHolder.java
-* Generated by the IDL-to-Java compiler (portable), version "3.0"
-* from ../../../../../src/share/classes/org/omg/PortableServer/corba.idl
-* Saturday, July 17, 1999 12:26:21 AM PDT
-*/
+ * The Holder for {@code PolicyList}. For more information on
+ * Holder files, see <a href="doc-files/generatedfiles.html#holder">
+ * "Generated Files: Holder Files"</a>.<P>
+ * org/omg/CORBA/PolicyListHolder.java
+ * Generated by the IDL-to-Java compiler (portable), version "3.0"
+ * from ../../../../../src/share/classes/org/omg/PortableServer/corba.idl
+ * Saturday, July 17, 1999 12:26:21 AM PDT
+ */
public final class PolicyListHolder implements org.omg.CORBA.portable.Streamable
{
--- a/corba/src/java.corba/share/classes/org/omg/CORBA/PolicyOperations.java Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/org/omg/CORBA/PolicyOperations.java Fri Sep 25 12:04:35 2015 -0700
@@ -26,18 +26,18 @@
/**
-* The interface for <tt>Policy</tt>. For more information on
-* Operations interfaces, see <a href="doc-files/generatedfiles.html#operations">
-* "Generated Files: Operations files"</a>.
-*<P>
-* org/omg/CORBA/PolicyOperations.java
-* Generated by the IDL-to-Java compiler (portable), version "3.0"
-* from ../../../../../src/share/classes/org/omg/PortableServer/corba.idl
-* Saturday, July 17, 1999 12:26:20 AM PDT
-*/
+ * The interface for {@code Policy}. For more information on
+ * Operations interfaces, see <a href="doc-files/generatedfiles.html#operations">
+ * "Generated Files: Operations files"</a>.
+ * <P>
+ * org/omg/CORBA/PolicyOperations.java
+ * Generated by the IDL-to-Java compiler (portable), version "3.0"
+ * from ../../../../../src/share/classes/org/omg/PortableServer/corba.idl
+ * Saturday, July 17, 1999 12:26:20 AM PDT
+ */
/**
- * Provides the operations for a <code>Policy</code> object.
+ * Provides the operations for a {@code Policy} object.
*/
public interface PolicyOperations
{
@@ -57,16 +57,16 @@
int policy_type ();
/**
- * Returns a copy of the <code>Policy</code> object. The copy does not retain
+ * Returns a copy of the {@code Policy} object. The copy does not retain
* any relationships that the policy had with any domain or object.
*
- * @return a copy of the <code>Policy</code> object
+ * @return a copy of the {@code Policy} object
*/
org.omg.CORBA.Policy copy ();
/**
- * Destroys the <code>Policy</code> object. It is the responsibility of
- * the <code>Policy</code> object to determine whether it can be destroyed.
+ * Destroys the {@code Policy} object. It is the responsibility of
+ * the {@code Policy} object to determine whether it can be destroyed.
*/
void destroy ();
} // interface PolicyOperations
--- a/corba/src/java.corba/share/classes/org/omg/CORBA/PolicyTypeHelper.java Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/org/omg/CORBA/PolicyTypeHelper.java Fri Sep 25 12:04:35 2015 -0700
@@ -26,14 +26,14 @@
/**
-* The Helper for <tt>PolicyType</tt>. For more information on
-* Helper files, see <a href="doc-files/generatedfiles.html#helper">
-* "Generated Files: Helper Files"</a>.<P>
-* org/omg/CORBA/PolicyTypeHelper.java
-* Generated by the IDL-to-Java compiler (portable), version "3.0"
-* from ../../../../../src/share/classes/org/omg/PortableServer/corba.idl
-* Saturday, July 17, 1999 12:26:20 AM PDT
-*/
+ * The Helper for {@code PolicyType}. For more information on
+ * Helper files, see <a href="doc-files/generatedfiles.html#helper">
+ * "Generated Files: Helper Files"</a>.<P>
+ * org/omg/CORBA/PolicyTypeHelper.java
+ * Generated by the IDL-to-Java compiler (portable), version "3.0"
+ * from ../../../../../src/share/classes/org/omg/PortableServer/corba.idl
+ * Saturday, July 17, 1999 12:26:20 AM PDT
+ */
// basic Policy definition
--- a/corba/src/java.corba/share/classes/org/omg/CORBA/PrincipalHolder.java Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/org/omg/CORBA/PrincipalHolder.java Fri Sep 25 12:04:35 2015 -0700
@@ -31,22 +31,22 @@
/**
- * The Holder for <tt>Principal</tt>. For more information on
+ * The Holder for {@code Principal}. For more information on
* Holder files, see <a href="doc-files/generatedfiles.html#holder">
* "Generated Files: Holder Files"</a>.<P>
- * A container class for values of type <code>Principal</code>
+ * A container class for values of type {@code Principal}
* that is used to store "out" and "inout" parameters in IDL methods.
- * If an IDL method signature has an IDL <code>Principal</code> as an "out"
+ * If an IDL method signature has an IDL {@code Principal} as an "out"
* or "inout" parameter, the programmer must pass an instance of
- * <code>PrincipalHolder</code> as the corresponding
+ * {@code PrincipalHolder} as the corresponding
* parameter in the method invocation; for "inout" parameters, the programmer
* must also fill the "in" value to be sent to the server.
* Before the method invocation returns, the ORB will fill in the
* value corresponding to the "out" value returned from the server.
* <P>
- * If <code>myPrincipalHolder</code> is an instance of <code>PrincipalHolder</code>,
- * the value stored in its <code>value</code> field can be accessed with
- * <code>myPrincipalHolder.value</code>.
+ * If {@code myPrincipalHolder} is an instance of {@code PrincipalHolder},
+ * the value stored in its {@code value} field can be accessed with
+ * {@code myPrincipalHolder.value}.
*
* @since JDK1.2
* @deprecated Deprecated by CORBA 2.2.
@@ -54,25 +54,25 @@
@Deprecated
public final class PrincipalHolder implements Streamable {
/**
- * The <code>Principal</code> value held by this <code>PrincipalHolder</code>
+ * The {@code Principal} value held by this {@code PrincipalHolder}
* object.
*/
public Principal value;
/**
- * Constructs a new <code>PrincipalHolder</code> object with its
- * <code>value</code> field initialized to <code>null</code>.
+ * Constructs a new {@code PrincipalHolder} object with its
+ * {@code value} field initialized to {@code null}.
*/
public PrincipalHolder() {
}
/**
- * Constructs a new <code>PrincipalHolder</code> object with its
- * <code>value</code> field initialized to the given
- * <code>Principal</code> object.
- * @param initial the <code>Principal</code> with which to initialize
- * the <code>value</code> field of the newly-created
- * <code>PrincipalHolder</code> object
+ * Constructs a new {@code PrincipalHolder} object with its
+ * {@code value} field initialized to the given
+ * {@code Principal} object.
+ * @param initial the {@code Principal} with which to initialize
+ * the {@code value} field of the newly-created
+ * {@code PrincipalHolder} object
*/
public PrincipalHolder(Principal initial) {
value = initial;
--- a/corba/src/java.corba/share/classes/org/omg/CORBA/RepositoryIdHelper.java Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/org/omg/CORBA/RepositoryIdHelper.java Fri Sep 25 12:04:35 2015 -0700
@@ -26,15 +26,15 @@
/**
-* The Helper for <tt>RepositoryId</tt>. For more information on
-* Helper files, see <a href="doc-files/generatedfiles.html#helper">
-* "Generated Files: Helper Files"</a>.<P>
-
-* org/omg/CORBA/RepositoryIdHelper.java
-* Generated by the IDL-to-Java compiler (portable), version "3.0"
-* from ir.idl
-* 03 June 1999 11:33:43 o'clock GMT+00:00
-*/
+ * The Helper for {@code RepositoryId}. For more information on
+ * Helper files, see <a href="doc-files/generatedfiles.html#helper">
+ * "Generated Files: Helper Files"</a>.<P>
+ *
+ * org/omg/CORBA/RepositoryIdHelper.java
+ * Generated by the IDL-to-Java compiler (portable), version "3.0"
+ * from ir.idl
+ * 03 June 1999 11:33:43 o'clock GMT+00:00
+ */
abstract public class RepositoryIdHelper
{
--- a/corba/src/java.corba/share/classes/org/omg/CORBA/ServiceDetailHelper.java Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/org/omg/CORBA/ServiceDetailHelper.java Fri Sep 25 12:04:35 2015 -0700
@@ -24,10 +24,10 @@
*/
/**
- * The Helper for <tt>ServiceDetail</tt>. For more information on
- * Helper files, see <a href="doc-files/generatedfiles.html#helper">
- * "Generated Files: Helper Files"</a>.<P>
- */
+ * The Helper for {@code ServiceDetail}. For more information on
+ * Helper files, see <a href="doc-files/generatedfiles.html#helper">
+ * "Generated Files: Helper Files"</a>.<P>
+ */
package org.omg.CORBA;
--- a/corba/src/java.corba/share/classes/org/omg/CORBA/ServiceInformation.java Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/org/omg/CORBA/ServiceInformation.java Fri Sep 25 12:04:35 2015 -0700
@@ -26,9 +26,10 @@
package org.omg.CORBA;
-/** An IDL struct in the CORBA module that
+/**
+ * An IDL struct in the CORBA module that
* stores information about a CORBA service available in the
- * ORB implementation and is obtained from the <tt>ORB.get_service_information</tt>
+ * ORB implementation and is obtained from the {@code ORB.get_service_information}
* method.
*/
public final class ServiceInformation implements org.omg.CORBA.portable.IDLEntity
--- a/corba/src/java.corba/share/classes/org/omg/CORBA/ServiceInformationHelper.java Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/org/omg/CORBA/ServiceInformationHelper.java Fri Sep 25 12:04:35 2015 -0700
@@ -24,10 +24,10 @@
*/
/**
- * The Helper for <tt>ServiceInformation</tt>. For more information on
-* Helper files, see <a href="doc-files/generatedfiles.html#helper">
-* "Generated Files: Helper Files"</a>.<P>
-*/
+ * The Helper for {@code ServiceInformation}. For more information on
+ * Helper files, see <a href="doc-files/generatedfiles.html#helper">
+ * "Generated Files: Helper Files"</a>.<P>
+ */
package org.omg.CORBA;
--- a/corba/src/java.corba/share/classes/org/omg/CORBA/ServiceInformationHolder.java Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/org/omg/CORBA/ServiceInformationHolder.java Fri Sep 25 12:04:35 2015 -0700
@@ -26,48 +26,48 @@
package org.omg.CORBA;
/**
- * The Holder for <tt>ServiceInformation</tt>. For more information on
+ * The Holder for {@code ServiceInformation}. For more information on
* Holder files, see <a href="doc-files/generatedfiles.html#holder">
* "Generated Files: Holder Files"</a>.<P>
- * A Holder class for a <code>ServiceInformation</code> object
+ * A Holder class for a {@code ServiceInformation} object
* that is used to store "out" and "inout" parameters in IDL methods.
- * If an IDL method signature has an IDL <code>xxx</code> as an "out"
+ * If an IDL method signature has an IDL {@code xxx} as an "out"
* or "inout" parameter, the programmer must pass an instance of
- * <code>ServiceInformationHolder</code> as the corresponding
+ * {@code ServiceInformationHolder} as the corresponding
* parameter in the method invocation; for "inout" parameters, the programmer
* must also fill the "in" value to be sent to the server.
* Before the method invocation returns, the ORB will fill in the
* value corresponding to the "out" value returned from the server.
* <P>
- * If <code>myServiceInformationHolder</code> is an instance of <code>ServiceInformationHolder</code>,
- * the value stored in its <code>value</code> field can be accessed with
- * <code>myServiceInformationHolder.value</code>.
+ * If {@code myServiceInformationHolder} is an instance of {@code ServiceInformationHolder},
+ * the value stored in its {@code value} field can be accessed with
+ * {@code myServiceInformationHolder.value}.
*/
public final class ServiceInformationHolder
implements org.omg.CORBA.portable.Streamable {
/**
- * The <code>ServiceInformation</code> value held by this
- * <code>ServiceInformationHolder</code> object in its <code>value</code> field.
+ * The {@code ServiceInformation} value held by this
+ * {@code ServiceInformationHolder} object in its {@code value} field.
*/
public ServiceInformation value;
/**
- * Constructs a new <code>ServiceInformationHolder</code> object with its
- * <code>value</code> field initialized to null.
+ * Constructs a new {@code ServiceInformationHolder} object with its
+ * {@code value} field initialized to null.
*/
public ServiceInformationHolder() {
this(null);
}
/**
- * Constructs a new <code>ServiceInformationHolder</code> object with its
- * <code>value</code> field initialized to the given
- * <code>ServiceInformation</code> object.
+ * Constructs a new {@code ServiceInformationHolder} object with its
+ * {@code value} field initialized to the given
+ * {@code ServiceInformation} object.
*
- * @param arg the <code>ServiceInformation</code> object with which to initialize
- * the <code>value</code> field of the newly-created
- * <code>ServiceInformationHolder</code> object
+ * @param arg the {@code ServiceInformation} object with which to initialize
+ * the {@code value} field of the newly-created
+ * {@code ServiceInformationHolder} object
*/
public ServiceInformationHolder(org.omg.CORBA.ServiceInformation arg) {
value = arg;
@@ -75,10 +75,10 @@
/**
- * Marshals the value in this <code>ServiceInformationHolder</code> object's
- * <code>value</code> field to the output stream <code>out</code>.
+ * Marshals the value in this {@code ServiceInformationHolder} object's
+ * {@code value} field to the output stream {@code out}.
*
- * @param out the <code>OutputStream</code> object that will contain
+ * @param out the {@code OutputStream} object that will contain
* the CDR formatted data
*/
public void _write(org.omg.CORBA.portable.OutputStream out) {
@@ -86,10 +86,10 @@
}
/**
- * Reads unmarshalled data from the input stream <code>in</code> and assigns it to
- * the <code>value</code> field in this <code>ServiceInformationHolder</code> object.
+ * Reads unmarshalled data from the input stream {@code in} and assigns it to
+ * the {@code value} field in this {@code ServiceInformationHolder} object.
*
- * @param in the <code>InputStream</code> object containing CDR
+ * @param in the {@code InputStream} object containing CDR
* formatted data from the wire
*/
public void _read(org.omg.CORBA.portable.InputStream in) {
@@ -97,11 +97,11 @@
}
/**
- * Retrieves the <code>TypeCode</code> object that corresponds
- * to the value held in this <code>ServiceInformationHolder</code> object's
- * <code>value</code> field.
+ * Retrieves the {@code TypeCode} object that corresponds
+ * to the value held in this {@code ServiceInformationHolder} object's
+ * {@code value} field.
*
- * @return the type code for the value held in this <code>ServiceInformationHolder</code>
+ * @return the type code for the value held in this {@code ServiceInformationHolder}
* object
*/
public org.omg.CORBA.TypeCode _type() {
--- a/corba/src/java.corba/share/classes/org/omg/CORBA/SetOverrideTypeHelper.java Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/org/omg/CORBA/SetOverrideTypeHelper.java Fri Sep 25 12:04:35 2015 -0700
@@ -26,7 +26,7 @@
/**
-* The Helper for <tt>SetOverrideType</tt>. For more information on
+* The Helper for {@code SetOverrideType}. For more information on
* Helper files, see <a href="doc-files/generatedfiles.html#helper">
* "Generated Files: Helper Files"</a>.<P>
* org/omg/CORBA/SetOverrideTypeHelper.java
--- a/corba/src/java.corba/share/classes/org/omg/CORBA/ShortHolder.java Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/org/omg/CORBA/ShortHolder.java Fri Sep 25 12:04:35 2015 -0700
@@ -30,55 +30,55 @@
import org.omg.CORBA.portable.OutputStream;
/**
- * The Holder for <tt>Short</tt>. For more information on
+ * The Holder for {@code Short}. For more information on
* Holder files, see <a href="doc-files/generatedfiles.html#holder">
* "Generated Files: Holder Files"</a>.
- * <P>A Holder class for a <code>short</code>
+ * <P>A Holder class for a {@code short}
* that is used to store "out" and "inout" parameters in IDL operations.
- * If an IDL operation signature has an IDL <code>short</code> as an "out"
+ * If an IDL operation signature has an IDL {@code short} as an "out"
* or "inout" parameter, the programmer must pass an instance of
- * <code>ShortHolder</code> as the corresponding
+ * {@code ShortHolder} as the corresponding
* parameter in the method invocation; for "inout" parameters, the programmer
* must also fill the "in" value to be sent to the server.
* Before the method invocation returns, the ORB will fill in the
* value corresponding to the "out" value returned from the server.
* <P>
- * If <code>myShortHolder</code> is an instance of <code>ShortHolder</code>,
- * the value stored in its <code>value</code> field can be accessed with
- * <code>myShortHolder.value</code>.
+ * If {@code myShortHolder} is an instance of {@code ShortHolder},
+ * the value stored in its {@code value} field can be accessed with
+ * {@code myShortHolder.value}.
*
* @since JDK1.2
*/
public final class ShortHolder implements Streamable {
/**
- * The <code>short</code> value held by this <code>ShortHolder</code>
+ * The {@code short} value held by this {@code ShortHolder}
* object.
*/
public short value;
/**
- * Constructs a new <code>ShortHolder</code> object with its
- * <code>value</code> field initialized to <code>0</code>.
+ * Constructs a new {@code ShortHolder} object with its
+ * {@code value} field initialized to {@code 0}.
*/
public ShortHolder() {
}
/**
- * Constructs a new <code>ShortHolder</code> object with its
- * <code>value</code> field initialized to the given
- * <code>short</code>.
- * @param initial the <code>short</code> with which to initialize
- * the <code>value</code> field of the newly-created
- * <code>ShortHolder</code> object
+ * Constructs a new {@code ShortHolder} object with its
+ * {@code value} field initialized to the given
+ * {@code short}.
+ * @param initial the {@code short} with which to initialize
+ * the {@code value} field of the newly-created
+ * {@code ShortHolder} object
*/
public ShortHolder(short initial) {
value = initial;
}
/**
- * Reads from <code>input</code> and initalizes the value in
- * this <code>ShortHolder</code> object
+ * Reads from {@code input} and initalizes the value in
+ * this {@code ShortHolder} object
* with the unmarshalled data.
*
* @param input the InputStream containing CDR formatted data from the wire.
@@ -88,8 +88,8 @@
}
/**
- * Marshals to <code>output</code> the value in
- * this <code>ShortHolder</code> object.
+ * Marshals to {@code output} the value in
+ * this {@code ShortHolder} object.
*
* @param output the OutputStream which will contain the CDR formatted data.
*/
@@ -99,10 +99,10 @@
/**
* Returns the TypeCode corresponding to the value held in
- * this <code>ShortHolder</code> object.
+ * this {@code ShortHolder} object.
*
* @return the TypeCode of the value held in
- * this <code>ShortHolder</code> object
+ * this {@code ShortHolder} object
*/
public org.omg.CORBA.TypeCode _type() {
return ORB.init().get_primitive_tc(TCKind.tk_short);
--- a/corba/src/java.corba/share/classes/org/omg/CORBA/ShortSeqHelper.java Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/org/omg/CORBA/ShortSeqHelper.java Fri Sep 25 12:04:35 2015 -0700
@@ -26,7 +26,7 @@
/**
-* The Helper for <tt>ShortSeqHelper</tt>. For more information on
+* The Helper for {@code ShortSeqHelper}. For more information on
* Helper files, see <a href="doc-files/generatedfiles.html#helper">
* "Generated Files: Helper Files"</a>.<P>
* org/omg/CORBA/ShortSeqHelper.java
--- a/corba/src/java.corba/share/classes/org/omg/CORBA/ShortSeqHolder.java Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/org/omg/CORBA/ShortSeqHolder.java Fri Sep 25 12:04:35 2015 -0700
@@ -26,7 +26,7 @@
/**
-* The Holder for <tt>ShortSeq</tt>. For more information on
+* The Holder for {@code ShortSeq}. For more information on
* Holder files, see <a href="doc-files/generatedfiles.html#holder">
* "Generated Files: Holder Files"</a>.<P>
* org/omg/CORBA/ShortSeqHolder.java
--- a/corba/src/java.corba/share/classes/org/omg/CORBA/StringHolder.java Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/org/omg/CORBA/StringHolder.java Fri Sep 25 12:04:35 2015 -0700
@@ -30,55 +30,55 @@
import org.omg.CORBA.portable.OutputStream;
/**
- * The Holder for <tt>String</tt>. For more information on
+ * The Holder for {@code String}. For more information on
* Holder files, see <a href="doc-files/generatedfiles.html#holder">
* "Generated Files: Holder Files"</a>.<P>
- * A Holder class for a <code>String</code>
+ * A Holder class for a {@code String}
* that is used to store "out" and "inout" parameters in IDL operations.
- * If an IDL operation signature has an IDL <code>string</code> as an "out"
+ * If an IDL operation signature has an IDL {@code string} as an "out"
* or "inout" parameter, the programmer must pass an instance of
- * <code>StringHolder</code> as the corresponding
+ * {@code StringHolder} as the corresponding
* parameter in the method invocation; for "inout" parameters, the programmer
* must also fill the "in" value to be sent to the server.
* Before the method invocation returns, the ORB will fill in the
* value corresponding to the "out" value returned from the server.
* <P>
- * If <code>myStringHolder</code> is an instance of <code>StringHolder</code>,
- * the value stored in its <code>value</code> field can be accessed with
- * <code>myStringHolder.value</code>.
+ * If {@code myStringHolder} is an instance of {@code StringHolder},
+ * the value stored in its {@code value} field can be accessed with
+ * {@code myStringHolder.value}.
*
* @since JDK1.2
*/
public final class StringHolder implements Streamable {
/**
- * The <code>String</code> value held by this <code>StringHolder</code>
+ * The {@code String} value held by this {@code StringHolder}
* object.
*/
public String value;
/**
- * Constructs a new <code>StringHolder</code> object with its
- * <code>value</code> field initialized to <code>null</code>.
+ * Constructs a new {@code StringHolder} object with its
+ * {@code value} field initialized to {@code null}.
*/
public StringHolder() {
}
/**
- * Constructs a new <code>StringHolder</code> object with its
- * <code>value</code> field initialized to the given
- * <code>String</code>.
- * @param initial the <code>String</code> with which to initialize
- * the <code>value</code> field of the newly-created
- * <code>StringHolder</code> object
+ * Constructs a new {@code StringHolder} object with its
+ * {@code value} field initialized to the given
+ * {@code String}.
+ * @param initial the {@code String} with which to initialize
+ * the {@code value} field of the newly-created
+ * {@code StringHolder} object
*/
public StringHolder(String initial) {
value = initial;
}
/**
- * Reads the unmarshalled data from <code>input</code> and assigns it to
- * the <code>value</code> field of this <code>StringHolder</code> object.
+ * Reads the unmarshalled data from {@code input} and assigns it to
+ * the {@code value} field of this {@code StringHolder} object.
*
* @param input the InputStream containing CDR formatted data from the wire.
*/
@@ -87,8 +87,8 @@
}
/**
- * Marshals the value held by this <code>StringHolder</code> object
- * to the output stream <code>output</code>.
+ * Marshals the value held by this {@code StringHolder} object
+ * to the output stream {@code output}.
*
* @param output the OutputStream which will contain the CDR formatted data.
*/
@@ -97,10 +97,10 @@
}
/**
- * Retrieves the <code>TypeCode</code> object that corresponds to
- * the value held in this <code>StringHolder</code> object.
+ * Retrieves the {@code TypeCode} object that corresponds to
+ * the value held in this {@code StringHolder} object.
*
- * @return the type code of the value held in this <code>StringHolder</code>
+ * @return the type code of the value held in this {@code StringHolder}
* object
*/
public org.omg.CORBA.TypeCode _type() {
--- a/corba/src/java.corba/share/classes/org/omg/CORBA/StringValueHelper.java Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/org/omg/CORBA/StringValueHelper.java Fri Sep 25 12:04:35 2015 -0700
@@ -32,7 +32,7 @@
package org.omg.CORBA;
/**
-* The Helper for <tt>StringValue</tt>. For more information on
+* The Helper for {@code StringValue}. For more information on
* Helper files, see <a href="doc-files/generatedfiles.html#helper">
* "Generated Files: Helper Files"</a>.<P>
* org/omg/CORBA/StringValueHelper.java
--- a/corba/src/java.corba/share/classes/org/omg/CORBA/StructMemberHelper.java Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/org/omg/CORBA/StructMemberHelper.java Fri Sep 25 12:04:35 2015 -0700
@@ -26,7 +26,7 @@
/**
-* The Helper for <tt>StructMember</tt>. For more information on
+* The Helper for {@code StructMember}. For more information on
* Helper files, see <a href="doc-files/generatedfiles.html#helper">
* "Generated Files: Helper Files"</a>.<P>
* org/omg/CORBA/StructMemberHelper.java
--- a/corba/src/java.corba/share/classes/org/omg/CORBA/TypeCodeHolder.java Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/org/omg/CORBA/TypeCodeHolder.java Fri Sep 25 12:04:35 2015 -0700
@@ -30,55 +30,55 @@
import org.omg.CORBA.portable.OutputStream;
/**
- * The Holder for <tt>TypeCode</tt>. For more information on
+ * The Holder for {@code TypeCode}. For more information on
* Holder files, see <a href="doc-files/generatedfiles.html#holder">
* "Generated Files: Holder Files"</a>.<P>
- * A Holder class for a <code>TypeCode</code> object
+ * A Holder class for a {@code TypeCode} object
* that is used to store "out" and "inout" parameters in IDL operations.
- * If an IDL operation signature has an IDL <code>TypeCode</code> as an "out"
+ * If an IDL operation signature has an IDL {@code TypeCode} as an "out"
* or "inout" parameter, the programmer must pass an instance of
- * <code>TypeCodeHolder</code> as the corresponding
+ * {@code TypeCodeHolder} as the corresponding
* parameter in the method invocation; for "inout" parameters, the programmer
* must also fill the "in" value to be sent to the server.
* Before the method invocation returns, the ORB will fill in the
* value corresponding to the "out" value returned from the server.
* <P>
- * If <code>myTypeCodeHolder</code> is an instance of <code>TypeCodeHolder</code>,
- * the value stored in its <code>value</code> field can be accessed with
- * <code>myTypeCodeHolder.value</code>.
+ * If {@code myTypeCodeHolder} is an instance of {@code TypeCodeHolder},
+ * the value stored in its {@code value} field can be accessed with
+ * {@code myTypeCodeHolder.value}.
*
* @since JDK1.2
*/
public final class TypeCodeHolder implements Streamable {
/**
- * The <code>TypeCode</code> value held by
- * this <code>TypeCodeHolder</code> object.
+ * The {@code TypeCode} value held by
+ * this {@code TypeCodeHolder} object.
*/
public TypeCode value;
/**
- * Constructs a new <code>TypeCodeHolder</code> object with its
- * <code>value</code> field initialized to <code>null</code>.
+ * Constructs a new {@code TypeCodeHolder} object with its
+ * {@code value} field initialized to {@code null}.
*/
public TypeCodeHolder() {
}
/**
- * Constructs a new <code>TypeCodeHolder</code> object with its
- * <code>value</code> field initialized to the given
- * <code>TypeCode</code> object.
- * @param initial the <code>TypeCode</code> object with which to initialize
- * the <code>value</code> field of the newly-created
- * <code>TypeCodeHolder</code> object
+ * Constructs a new {@code TypeCodeHolder} object with its
+ * {@code value} field initialized to the given
+ * {@code TypeCode} object.
+ * @param initial the {@code TypeCode} object with which to initialize
+ * the {@code value} field of the newly-created
+ * {@code TypeCodeHolder} object
*/
public TypeCodeHolder(TypeCode initial) {
value = initial;
}
/**
- * Reads from <code>input</code> and initalizes the value in
- * this <code>TypeCodeHolder</code> object
+ * Reads from {@code input} and initalizes the value in
+ * this {@code TypeCodeHolder} object
* with the unmarshalled data.
*
* @param input the InputStream containing CDR formatted data from the wire
@@ -88,8 +88,8 @@
}
/**
- * Marshals to <code>output</code> the value in
- * this <code>TypeCodeHolder</code> object.
+ * Marshals to {@code output} the value in
+ * this {@code TypeCodeHolder} object.
*
* @param output the OutputStream which will contain the CDR formatted data
*/
@@ -99,10 +99,10 @@
/**
* Returns the TypeCode corresponding to the value held in
- * this <code>TypeCodeHolder</code> object.
+ * this {@code TypeCodeHolder} object.
*
* @return the TypeCode of the value held in
- * this <code>TypeCodeHolder</code> object
+ * this {@code TypeCodeHolder} object
*/
public org.omg.CORBA.TypeCode _type() {
return ORB.init().get_primitive_tc(TCKind.tk_TypeCode);
--- a/corba/src/java.corba/share/classes/org/omg/CORBA/ULongLongSeqHelper.java Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/org/omg/CORBA/ULongLongSeqHelper.java Fri Sep 25 12:04:35 2015 -0700
@@ -26,7 +26,7 @@
/**
-* The Helper for <tt>ULongLongSeq</tt>. For more information on
+* The Helper for {@code ULongLongSeq}. For more information on
* Helper files, see <a href="doc-files/generatedfiles.html#helper">
* "Generated Files: Helper Files"</a>.<P>
* org/omg/CORBA/ULongLongSeqHelper.java
--- a/corba/src/java.corba/share/classes/org/omg/CORBA/ULongLongSeqHolder.java Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/org/omg/CORBA/ULongLongSeqHolder.java Fri Sep 25 12:04:35 2015 -0700
@@ -26,7 +26,7 @@
/**
-* The Holder for <tt>ULongLongSeq</tt>. For more information on
+* The Holder for {@code ULongLongSeq}. For more information on
* Holder files, see <a href="doc-files/generatedfiles.html#holder">
* "Generated Files: Holder Files"</a>.<P>
* org/omg/CORBA/ULongLongSeqHolder.java
--- a/corba/src/java.corba/share/classes/org/omg/CORBA/ULongSeqHelper.java Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/org/omg/CORBA/ULongSeqHelper.java Fri Sep 25 12:04:35 2015 -0700
@@ -26,7 +26,7 @@
/**
-* The Helper for <tt>ULongSeq</tt>. For more information on
+* The Helper for {@code ULongSeq}. For more information on
* Helper files, see <a href="doc-files/generatedfiles.html#helper">
* "Generated Files: Helper Files"</a>.<P>
* org/omg/CORBA/ULongSeqHelper.java
--- a/corba/src/java.corba/share/classes/org/omg/CORBA/ULongSeqHolder.java Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/org/omg/CORBA/ULongSeqHolder.java Fri Sep 25 12:04:35 2015 -0700
@@ -26,7 +26,7 @@
/**
-* The Holder for <tt>ULongSeq</tt>. For more information on
+* The Holder for {@code ULongSeq}. For more information on
* Holder files, see <a href="doc-files/generatedfiles.html#holder">
* "Generated Files: Holder Files"</a>.<P>
* org/omg/CORBA/ULongSeqHolder.java
--- a/corba/src/java.corba/share/classes/org/omg/CORBA/UNSUPPORTED_POLICY.java Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/org/omg/CORBA/UNSUPPORTED_POLICY.java Fri Sep 25 12:04:35 2015 -0700
@@ -26,8 +26,8 @@
package org.omg.CORBA;
/**
- * One of the <tt>PolicyErrorCode</tt>s which would be filled if
- * the requested <tt>Policy</tt> is understood to be valid by the
+ * One of the {@code PolicyErrorCode}s which would be filled if
+ * the requested {@code Policy} is understood to be valid by the
* ORB, but is not currently supported.
*
* @author rip-dev
--- a/corba/src/java.corba/share/classes/org/omg/CORBA/UNSUPPORTED_POLICY_VALUE.java Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/org/omg/CORBA/UNSUPPORTED_POLICY_VALUE.java Fri Sep 25 12:04:35 2015 -0700
@@ -26,8 +26,8 @@
package org.omg.CORBA;
/**
- * A <tt>PolicyErrorCode</tt> which would be filled if the value
- * requested for the <tt>Policy</tt> is of a
+ * A {@code PolicyErrorCode} which would be filled if the value
+ * requested for the {@code Policy} is of a
* valid type and within the valid range for that type, but this valid value
* is not currently supported.
*
--- a/corba/src/java.corba/share/classes/org/omg/CORBA/UShortSeqHelper.java Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/org/omg/CORBA/UShortSeqHelper.java Fri Sep 25 12:04:35 2015 -0700
@@ -26,7 +26,7 @@
/**
-* The Helper for <tt>UShortSeq</tt>. For more information on
+* The Helper for {@code UShortSeq}. For more information on
* Helper files, see <a href="doc-files/generatedfiles.html#helper">
* "Generated Files: Helper Files"</a>.<P>
* org/omg/CORBA/UShortSeqHelper.java
--- a/corba/src/java.corba/share/classes/org/omg/CORBA/UShortSeqHolder.java Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/org/omg/CORBA/UShortSeqHolder.java Fri Sep 25 12:04:35 2015 -0700
@@ -26,7 +26,7 @@
/**
-* The Holder for <tt>UShortSeq</tt>. For more information on
+* The Holder for {@code UShortSeq}. For more information on
* Holder files, see <a href="doc-files/generatedfiles.html#holder">
* "Generated Files: Holder Files"</a>.<P>
* org/omg/CORBA/UShortSeqHolder.java
--- a/corba/src/java.corba/share/classes/org/omg/CORBA/UnionMemberHelper.java Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/org/omg/CORBA/UnionMemberHelper.java Fri Sep 25 12:04:35 2015 -0700
@@ -26,7 +26,7 @@
/**
-* The Helper for <tt>UnionMember</tt>. For more information on
+* The Helper for {@code UnionMember}. For more information on
* Helper files, see <a href="doc-files/generatedfiles.html#helper">
* "Generated Files: Helper Files"</a>.<P>
* org/omg/CORBA/UnionMemberHelper.java
--- a/corba/src/java.corba/share/classes/org/omg/CORBA/UnknownUserExceptionHelper.java Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/org/omg/CORBA/UnknownUserExceptionHelper.java Fri Sep 25 12:04:35 2015 -0700
@@ -26,7 +26,7 @@
/**
-* The Helper for <tt>UnknownUserException</tt>. For more information on
+* The Helper for {@code UnknownUserException}. For more information on
* Helper files, see <a href="doc-files/generatedfiles.html#helper">
* "Generated Files: Helper Files"</a>.<P>
* org/omg/CORBA/UnknownUserExceptionHelper.java
--- a/corba/src/java.corba/share/classes/org/omg/CORBA/UnknownUserExceptionHolder.java Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/org/omg/CORBA/UnknownUserExceptionHolder.java Fri Sep 25 12:04:35 2015 -0700
@@ -25,7 +25,7 @@
package org.omg.CORBA;
/**
-* The Holder for <tt>UnknownUserException</tt>. For more information on
+* The Holder for {@code UnknownUserException}. For more information on
* Holder files, see <a href="doc-files/generatedfiles.html#holder">
* "Generated Files: Holder Files"</a>.<P>
* org/omg/CORBA/UnknownUserExceptionHolder.java
--- a/corba/src/java.corba/share/classes/org/omg/CORBA/ValueBaseHelper.java Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/org/omg/CORBA/ValueBaseHelper.java Fri Sep 25 12:04:35 2015 -0700
@@ -24,7 +24,7 @@
*/
/**
- * The Helper for <tt>ValueBase</tt>. For more information on
+ * The Helper for {@code ValueBase}. For more information on
* Helper files, see <a href="doc-files/generatedfiles.html#helper">
* "Generated Files: Helper Files"</a>.<P>
*/
--- a/corba/src/java.corba/share/classes/org/omg/CORBA/ValueBaseHolder.java Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/org/omg/CORBA/ValueBaseHolder.java Fri Sep 25 12:04:35 2015 -0700
@@ -30,53 +30,53 @@
import org.omg.CORBA.portable.OutputStream;
/**
- * The Holder for <tt>ValueBase</tt>. For more information on
+ * The Holder for {@code ValueBase}. For more information on
* Holder files, see <a href="doc-files/generatedfiles.html#holder">
* "Generated Files: Holder Files"</a>.<P>
- * A Holder class for a <code>java.io.Serializable</code>
+ * A Holder class for a {@code java.io.Serializable}
* that is used to store "out" and "inout" parameters in IDL methods.
- * If an IDL method signature has an IDL <code>ValueBase</code> as an "out"
+ * If an IDL method signature has an IDL {@code ValueBase} as an "out"
* or "inout" parameter, the programmer must pass an instance of
- * <code>ValueBaseHolder</code> as the corresponding
+ * {@code ValueBaseHolder} as the corresponding
* parameter in the method invocation; for "inout" parameters, the programmer
* must also fill the "in" value to be sent to the server.
* Before the method invocation returns, the ORB will fill in the
* value corresponding to the "out" value returned from the server.
* <P>
- * If <code>myValueBaseHolder</code> is an instance of <code>ValueBaseHolder</code>,
- * the value stored in its <code>value</code> field can be accessed with
- * <code>myValueBaseHolder.value</code>.
+ * If {@code myValueBaseHolder} is an instance of {@code ValueBaseHolder},
+ * the value stored in its {@code value} field can be accessed with
+ * {@code myValueBaseHolder.value}.
*
*/
public final class ValueBaseHolder implements Streamable {
/**
- * The <code>java.io.Serializable</code> value held by this
- * <code>ValueBaseHolder</code> object.
+ * The {@code java.io.Serializable} value held by this
+ * {@code ValueBaseHolder} object.
*/
public java.io.Serializable value;
/**
- * Constructs a new <code>ValueBaseHolder</code> object with its
- * <code>value</code> field initialized to <code>0</code>.
+ * Constructs a new {@code ValueBaseHolder} object with its
+ * {@code value} field initialized to {@code 0}.
*/
public ValueBaseHolder() {
}
/**
- * Constructs a new <code>ValueBaseHolder</code> object with its
- * <code>value</code> field initialized to the given
- * <code>java.io.Serializable</code>.
- * @param initial the <code>java.io.Serializable</code> with which to initialize
- * the <code>value</code> field of the newly-created
- * <code>ValueBaseHolder</code> object
+ * Constructs a new {@code ValueBaseHolder} object with its
+ * {@code value} field initialized to the given
+ * {@code java.io.Serializable}.
+ * @param initial the {@code java.io.Serializable} with which to initialize
+ * the {@code value} field of the newly-created
+ * {@code ValueBaseHolder} object
*/
public ValueBaseHolder(java.io.Serializable initial) {
value = initial;
}
/**
- * Reads from <code>input</code> and initalizes the value in the Holder
+ * Reads from {@code input} and initalizes the value in the Holder
* with the unmarshalled data.
*
* @param input the InputStream containing CDR formatted data from the wire
@@ -86,7 +86,7 @@
}
/**
- * Marshals to <code>output</code> the value in the Holder.
+ * Marshals to {@code output} the value in the Holder.
*
* @param output the OutputStream which will contain the CDR formatted data
*/
@@ -95,7 +95,7 @@
}
/**
- * Returns the <code>TypeCode</code> object
+ * Returns the {@code TypeCode} object
* corresponding to the value held in the Holder.
*
* @return the TypeCode of the value held in the holder
--- a/corba/src/java.corba/share/classes/org/omg/CORBA/ValueMemberHelper.java Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/org/omg/CORBA/ValueMemberHelper.java Fri Sep 25 12:04:35 2015 -0700
@@ -26,7 +26,7 @@
/**
-* The Helper for <tt>ValueMember</tt>. For more information on
+* The Helper for {@code ValueMember}. For more information on
* Helper files, see <a href="doc-files/generatedfiles.html#helper">
* "Generated Files: Helper Files"</a>.<P>
* org/omg/CORBA/ValueMemberHelper.java
--- a/corba/src/java.corba/share/classes/org/omg/CORBA/VersionSpecHelper.java Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/org/omg/CORBA/VersionSpecHelper.java Fri Sep 25 12:04:35 2015 -0700
@@ -26,7 +26,7 @@
/**
-* The Helper for <tt>VersionSpec</tt>. For more information on
+* The Helper for {@code VersionSpec}. For more information on
* Helper files, see <a href="doc-files/generatedfiles.html#helper">
* "Generated Files: Helper Files"</a>.<P>
* org/omg/CORBA/VersionSpecHelper.java
--- a/corba/src/java.corba/share/classes/org/omg/CORBA/VisibilityHelper.java Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/org/omg/CORBA/VisibilityHelper.java Fri Sep 25 12:04:35 2015 -0700
@@ -26,7 +26,7 @@
/**
-* The Helper for <tt>Visibility</tt>. For more information on
+* The Helper for {@code Visibility}. For more information on
* Helper files, see <a href="doc-files/generatedfiles.html#helper">
* "Generated Files: Helper Files"</a>.<P>
* org/omg/CORBA/VisibilityHelper.java
--- a/corba/src/java.corba/share/classes/org/omg/CORBA/WCharSeqHelper.java Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/org/omg/CORBA/WCharSeqHelper.java Fri Sep 25 12:04:35 2015 -0700
@@ -26,7 +26,7 @@
/**
-* The Helper for <tt>WCharSeq</tt>. For more information on
+* The Helper for {@code WCharSeq}. For more information on
* Helper files, see <a href="doc-files/generatedfiles.html#helper">
* "Generated Files: Helper Files"</a>.<P>
* org/omg/CORBA/WCharSeqHelper.java
--- a/corba/src/java.corba/share/classes/org/omg/CORBA/WCharSeqHolder.java Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/org/omg/CORBA/WCharSeqHolder.java Fri Sep 25 12:04:35 2015 -0700
@@ -26,7 +26,7 @@
/**
-* The Holder for <tt>WCharSeq</tt>. For more information on
+* The Holder for {@code WCharSeq}. For more information on
* Holder files, see <a href="doc-files/generatedfiles.html#holder">
* "Generated Files: Holder Files"</a>.<P>
* org/omg/CORBA/WCharSeqHolder.java
--- a/corba/src/java.corba/share/classes/org/omg/CORBA/WStringValueHelper.java Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/org/omg/CORBA/WStringValueHelper.java Fri Sep 25 12:04:35 2015 -0700
@@ -24,7 +24,7 @@
*/
/**
-* The Helper for <tt>WStringValue</tt>. For more information on
+* The Helper for {@code WStringValue}. For more information on
* Helper files, see <a href="doc-files/generatedfiles.html#helper">
* "Generated Files: Helper Files"</a>.<P>
*/
--- a/corba/src/java.corba/share/classes/org/omg/CORBA/WrongTransactionHelper.java Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/org/omg/CORBA/WrongTransactionHelper.java Fri Sep 25 12:04:35 2015 -0700
@@ -25,7 +25,7 @@
package org.omg.CORBA;
/**
-* The Helper for <tt>WrongTransaction</tt>. For more information on
+* The Helper for {@code WrongTransaction}. For more information on
* Helper files, see <a href="doc-files/generatedfiles.html#helper">
* "Generated Files: Helper Files"</a>.<P>
* org/omg/CORBA/WrongTransactionHelper.java
--- a/corba/src/java.corba/share/classes/org/omg/CORBA/WrongTransactionHolder.java Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/org/omg/CORBA/WrongTransactionHolder.java Fri Sep 25 12:04:35 2015 -0700
@@ -25,7 +25,7 @@
package org.omg.CORBA;
/**
-* The Holder for <tt>WrongTransaction</tt>. For more information on
+* The Holder for {@code WrongTransaction}. For more information on
* Holder files, see <a href="doc-files/generatedfiles.html#holder">
* "Generated Files: Holder Files"</a>.<P>
* org/omg/CORBA/WrongTransactionHolder.java
--- a/corba/src/java.corba/share/classes/org/omg/CORBA/_IDLTypeStub.java Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/org/omg/CORBA/_IDLTypeStub.java Fri Sep 25 12:04:35 2015 -0700
@@ -26,7 +26,7 @@
/**
-* The Stub for <tt>IDLType</tt>. For more information on
+* The Stub for {@code IDLType}. For more information on
* Stub files, see <a href="doc-files/generatedfiles.html#stub">
* "Generated Files: Stubs"</a>.<P>
* org/omg/CORBA/_IDLTypeStub.java
@@ -38,9 +38,9 @@
public class _IDLTypeStub extends org.omg.CORBA.portable.ObjectImpl implements org.omg.CORBA.IDLType
{
/**
- * Constructs a default <code>_IDLTypeStub</code> object.
+ * Constructs a default {@code _IDLTypeStub} object.
* NOTE: If the default constructor is used, the
- * object is useless until the method <code>_set_delegate</code>
+ * object is useless until the method {@code _set_delegate}
* has been called.
*/
// NOTE: This constructor is not required according to the spec. Only JCK expects it now.
@@ -50,8 +50,8 @@
}
/**
- * Constructs an <code>_IDLTypeStub</code> object initialized
- * with the given <code>Delegate</code> object.
+ * Constructs an {@code _IDLTypeStub} object initialized
+ * with the given {@code Delegate} object.
*
* @param delegate a Delegate object
*/
--- a/corba/src/java.corba/share/classes/org/omg/CORBA/_PolicyStub.java Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/org/omg/CORBA/_PolicyStub.java Fri Sep 25 12:04:35 2015 -0700
@@ -26,7 +26,7 @@
/**
-* The Stub for <tt>Policy</tt>. For more information on
+* The Stub for {@code Policy}. For more information on
* Stub files, see <a href="doc-files/generatedfiles.html#stub">
* "Generated Files: Stubs"</a>.<P>
* org/omg/CORBA/_PolicyStub.java
@@ -47,8 +47,8 @@
super ();
}
- /** Constructs a <code>_PolicyStub</code> object initialized
- * with the given <code>Delegate</code> object.
+ /** Constructs a {@code _PolicyStub} object initialized
+ * with the given {@code Delegate} object.
*
* @param delegate a Delegate Object
*/
--- a/corba/src/java.corba/share/classes/org/omg/CORBA/doc-files/compliance.html Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/org/omg/CORBA/doc-files/compliance.html Fri Sep 25 12:04:35 2015 -0700
@@ -50,16 +50,16 @@
<li>
CORBA 2.3.1 chapters 1-3 and 6-9</li>
-<li>Revised IDL to Java language mapping, section 1.21.8.2, the <tt>orb.properties</tt>
+<li>Revised IDL to Java language mapping, section 1.21.8.2, the <code>orb.properties</code>
file.</li>
<li>
CORBA 2.3.1 chapter 4 with the following replacements from the Portable
Interceptors specification:
<ul>
- <li>section 4.2.3.5 <TT>destroy</TT></li>
- <li>section 4.5.2 <TT>CodeFactory</TT> and <TT>PICurrent</TT> are required</li>
- <li>Section 4.5.3.4 as updated for <TT>register_initial_reference</TT></li>
+ <li>section 4.2.3.5 <code>destroy</code></li>
+ <li>section 4.5.2 <code>CodeFactory</code> and <code>PICurrent</code> are required</li>
+ <li>Section 4.5.3.4 as updated for <code>register_initial_reference</code></li>
</ul>
</li>
@@ -68,13 +68,13 @@
specification:
<ul>
<li>
- 5.5.2 <TT>StringSeq</TT> and <TT>WStringSeq</TT> are required.
- This adds the following classes to <TT>org.omg.CORBA</TT>:
+ 5.5.2 <code>StringSeq</code> and <code>WStringSeq</code> are required.
+ This adds the following classes to <code>org.omg.CORBA</code>:
<ul>
- <li><TT>StringSeqHolder</TT></li>
- <li><TT>StringSeqHelper</TT></li>
- <li><TT>WStringSeqHolder</TT></li>
- <li><TT>WStringSeqHelper</TT></li>
+ <li><code>StringSeqHolder</code></li>
+ <li><code>StringSeqHelper</code></li>
+ <li><code>WStringSeqHolder</code></li>
+ <li><code>WStringSeqHelper</code></li>
</ul>
</li>
</ul>
@@ -84,14 +84,15 @@
CORBA 2.3.1 sections 10.6.1 and 10.6.2 are supported for repository IDs.</li>
<li>
-CORBA 2.3.1 section 10.7 for <TT>TypeCode</TT> APIs.</li>
+CORBA 2.3.1 section 10.7 for <code>TypeCode</code> APIs.</li>
<li>
-CORBA 2.3.1 chapter 11, Portable Object Adapter (POA), with the following updates from the Portable Interceptors specification:
+CORBA 2.3.1 chapter 11, Portable Object Adapter (POA),
+with the following updates from the Portable Interceptors specification:
<ul>
<li>Section 11.3.7 POAs must preserve all policies</li>
<li>Section 11.3.8.2 again states that POAs must preserve all policies</li>
- <li>Section 11.3.8.26 <tt>POA::id</tt> is required.</li>
+ <li>Section 11.3.8.26 <code>POA::id</code> is required.</li>
</ul>
</li>
@@ -104,18 +105,21 @@
All of the Interoperable Naming Service is supported.</li>
<li>
-Portable Interceptors section 13.8 (the new <TT>Coder</TT>/<TT>Decoder</TT> interfaces)
+Portable Interceptors section 13.8 (the new
+<code>Coder</code>/<code>Decoder</code> interfaces)
and all of chapter 21 (the interceptor specification).</li>
-<li>Section 1.21.8 of the Revised IDL to Java Language Mapping Specification (ptc/00-11-03)
-has been changed from the version in the IDL to Java Language Mapping Specification (ptc/00-01-08).</li>
+<li>Section 1.21.8 of the Revised IDL to Java Language
+Mapping Specification (ptc/00-11-03)
+has been changed from the version in the
+IDL to Java Language Mapping Specification (ptc/00-01-08).</li>
</ul>
<h2>
Tools</h2>
<ul>
-<li>The IDL to Java compiler (<TT>idlj</TT>) complies with:
+<li>The IDL to Java compiler (<code>idlj</code>) complies with:
<ul>
<li>CORBA 2.3.1 chapter 3 (IDL definition)</li>
<li>CORBA 2.3.1 chapters 5 and 6 (semantics of Value types)</li>
@@ -125,12 +129,12 @@
</ul>
</li>
-<li>The Java to IDL compiler (the IIOP backend for <tt>rmic</tt>) complies with:
+<li>The Java to IDL compiler (the IIOP backend for <code>rmic</code>) complies with:
<ul>
<li>CORBA 2.3.1 chapters 5 and 6 (value types)</li>
<li>The Java to IDL language mapping. Note that this implicitly references
section 1.21 of the IDL to Java language mapping</li>
- <li>IDL generated by the <tt>-idl</tt> flag complies with CORBA 2.3.1 chapter 3.</li>
+ <li>IDL generated by the <code>-idl</code> flag complies with CORBA 2.3.1 chapter 3.</li>
</ul>
</li>
</ul>
--- a/corba/src/java.corba/share/classes/org/omg/CORBA/doc-files/generatedfiles.html Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/org/omg/CORBA/doc-files/generatedfiles.html Fri Sep 25 12:04:35 2015 -0700
@@ -9,7 +9,8 @@
<H1>IDL-to-Java Generated Files</H1>
<P>The files that are generated by the IDL-to-Java compiler, in accordance with
-the <em><a href="http://www.omg.org/cgi-bin/doc?ptc/00-01-08">IDL-to-Java Language Mapping Specification</a></em>,
+the <em><a href="http://www.omg.org/cgi-bin/doc?ptc/00-01-08">
+IDL-to-Java Language Mapping Specification</a></em>,
which is implemented in Java<sup><font size="-2">TM</font></sup> SE 6
according the <a href="compliance.html">compliance</a> document.
@@ -18,23 +19,25 @@
and identifiers with no change. Because of the nature of the Java language,
a single IDL construct may be mapped to several (differently named) Java constructs.
The additional names are constructed by appending a descriptive suffix.
-For example, the IDL interface <tt>foo</tt> is mapped to the Java
-interfaces <tt>foo</tt> and <tt>fooOperations</tt>, and additional
-Java classes <tt>fooHelper</tt>, <tt>fooHolder</tt>, <tt>fooPOA</tt>,
-and optionally <tt>fooPOATie</tt>.
+For example, the IDL interface <code>foo</code> is mapped to the Java
+interfaces <code>foo</code> and <code>fooOperations</code>, and additional
+Java classes <code>fooHelper</code>, <code>fooHolder</code>, <code>fooPOA</code>,
+and optionally <code>fooPOATie</code>.
<P>The mapping in effect reserves the use of several names for its own purposes. These are:
<UL>
-<LI>The Java class <a href="#helper"><tt><type>Helper</tt></a>, where <tt><type></tt> is the name of an IDL defined type.
-<LI>The Java class <a href="#holder"><tt><type>Holder</tt></a>, where <tt><type></tt>
-is the name of an IDL defined type (with certain exceptions such as <tt>typedef</tt> aliases).
-<LI>The Java classes <tt><basicJavaType>Holder</tt>, where <tt><basicJavaType></tt>
+<LI>The Java class <a href="#helper"><code><type>Helper</code></a>,
+where <code><type></code> is the name of an IDL defined type.
+<LI>The Java class <a href="#holder"><code><type>Holder</code></a>,
+where <code><type></code>
+is the name of an IDL defined type (with certain exceptions such as <code>typedef</code> aliases).
+<LI>The Java classes <code><basicJavaType>Holder</code>, where <code><basicJavaType></code>
is one of the Java primitive datatypes that is used by one of the IDL basic datatypes.
-<LI>The Java classes <a href="#operations"><tt><interface>Operations</tt></a>, <tt><interface>POA</tt>,
-and <tt><interface>POATie</tt>, where <tt><interface></tt> is the name of an IDL interface type.
-<LI>The nested scope Java package name <tt><interface>Package</tt>, where <tt><interface></tt>
+<LI>The Java classes <a href="#operations"><code><interface>Operations</code></a>, <code><interface>POA</code>,
+and <code><interface>POATie</code>, where <code><interface></code> is the name of an IDL interface type.
+<LI>The nested scope Java package name <code><interface>Package</code>, where <code><interface></code>
is the name of an IDL interface.
</UL>
@@ -42,50 +45,55 @@
<H2><a name="helper">Helper Files</a></H2>
<P>Helper files supply several static methods needed to manipulate the type.
-These include <tt>Any</tt> insert and extract operations for the type,
+These include <code>Any</code> insert and extract operations for the type,
getting the repository id, getting the typecode, and reading
and writing the type from and to a stream.
<P>The helper class for a mapped IDL interface or abstract interface also
-include narrow operation(s). The static narrow method allows an <tt>org.omg.CORBA.Object</tt>
+include narrow operation(s). The static narrow method allows an <code>org.omg.CORBA.Object</code>
to be narrowed to the object reference of a more specific type.
-The IDL exception <tt>CORBA::BAD_PARAM</tt> is thrown if the narrow fails because
+The IDL exception <code>CORBA::BAD_PARAM</code> is thrown if the narrow fails because
the object reference does not support the requested type. A different system exception
-is raised to indicate other kinds of errors. Trying to narrow a null will always succeed with a return value of null.
+is raised to indicate other kinds of errors. Trying to narrow
+a null will always succeed with a return value of null.
<H2><a name="holder">Holder Files</a></H2>
<P>Support for out and inout parameter passing modes requires the use of additional holder classes.
-These classes are available for all of the basic IDL datatypes in the <tt>org.omg.CORBA</tt> package
+These classes are available for all of the basic IDL datatypes in the <code>org.omg.CORBA</code> package
and are generated for all named user defined IDL types except those defined by typedefs.
(Note that in this context user defined includes types that are defined in OMG specifications
such as those for the Interface Repository, and other OMG services.)
<P>Each holder class has a constructor from an instance, a default constructor, and has
-a public instance member, <tt>value</tt> which is the typed value. The default constructor
+a public instance member, <code>value</code> which is the typed value. The default constructor
sets the value field to the default value for the type as defined by the Java language:
false for boolean, 0 for numeric and char types, null for strings, null for object references.
<P>To support portable stubs and skeletons, holder classes also implement
-the <tt>org.omg.CORBA.portable.Streamable</tt> interface.
+the <code>org.omg.CORBA.portable.Streamable</code> interface.
<H2><a name="operations">Operations Files</a></H2>
<P>A non abstract IDL interface is mapped to two public Java interfaces:
a <em>signature</em> interface and an <em>operations</em> interface.
-The signature interface, which extends <tt>IDLEntity</tt>, has the same
-name as the IDL interface name and is used as the signature type in method declarations
+The signature interface, which extends <code>IDLEntity</code>, has the same
+name as the IDL interface name and is used
+as the signature type in method declarations
when interfaces of the specified type are used in other interfaces.
-The operations interface has the same name as the IDL interface with the suffix <tt>Operations</tt>
+The operations interface has the same name as the IDL interface
+with the suffix <code>Operations</code>
appended to the end and is used in the server-side mapping and as a mechanism
for providing optimized calls for collocated client and servers.
<P>The Java operations interface contains the mapped operation signatures.
The Java signature interface extends the operations interface,
-the (mapped) base <tt>org.omg.CORBA.Object</tt>, as well as <tt>org.omg.portable.IDLEntity</tt>.
+the (mapped) base <code>org.omg.CORBA.Object</code>,
+as well as <code>org.omg.portable.IDLEntity</code>.
Methods can be invoked on the signature interface. Interface inheritance
-expressed in IDL is reflected in both the Java signature interface and operations interface hierarchies.
+expressed in IDL is reflected in both the Java signature
+interface and operations interface hierarchies.
<H2><a name="stub">Stubs</a></H2>
@@ -96,11 +104,13 @@
for programmers to predict once they are familiar with OMG IDL and the language mapping
for the particular programming language. The stubs make calls on the rest of the ORB
using interfaces that are private to, and presumably optimized for, the particular ORB Core.
-If more than one ORB is available, there may be different stubs corresponding to the different ORBs.
-In this case, it is necessary for the ORB and language mapping to cooperate to associate
+If more than one ORB is available, there may be different stubs
+corresponding to the different ORBs. In this case, it is necessary for
+the ORB and language mapping to cooperate to associate
the correct stubs with the particular object reference.
-<P>Object-oriented programming languages, such as Java, C++, and Smalltalk, do not require stub interfaces.
+<P>Object-oriented programming languages, such as Java,
+C++, and Smalltalk, do not require stub interfaces.
<BR><BR>
--- a/corba/src/java.corba/share/classes/org/omg/CORBA/package.html Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/org/omg/CORBA/package.html Fri Sep 25 12:04:35 2015 -0700
@@ -34,27 +34,27 @@
<BODY BGCOLOR="#FFFFFF">
Provides the mapping of the OMG CORBA APIs to the Java<SUP><FONT
SIZE=-2>TM</FONT></SUP>
-programming language, including the class <TT>ORB</TT>, which is implemented
+programming language, including the class <code>ORB</code>, which is implemented
so that a programmer can use it as a fully-functional Object Request Broker
(ORB).
-<P>For a precise list of supported sections of official CORBA specifications with which
-the Java[TM] Platform, Standard Edition 6 complies, see <A
-HREF="doc-files/compliance.html"><em>Official Specifications for CORBA support in
+<P>For a precise list of supported sections of official CORBA specifications with which
+the Java[TM] Platform, Standard Edition 6 complies, see <A
+HREF="doc-files/compliance.html"><em>Official Specifications for CORBA support in
Java[TM] SE 6</em></A>.
<H1>General Information</H1>
-The information in this section is information relevant to someone who
+The information in this section is information relevant to someone who
compiles Interface Definition Language (IDL) files and uses the
ORB to write clients and servers.
-<P>The classes and interfaces described in this section can be put into
-four groups: <tt>ORB classes</tt>, Exceptions, <tt>Helper</tt> classes,
-and <tt>Holder</tt> classes.
+<P>The classes and interfaces described in this section can be put into
+four groups: <code>ORB classes</code>, Exceptions, <code>Helper</code> classes,
+and <code>Holder</code> classes.
<H2>
-The <tt>ORB</tt> Class</H2>
+The <code>ORB</code> Class</H2>
<P>An ORB handles (or brokers) method invocations between a client and
the method's implementation on a server. Because the client and server
@@ -63,92 +63,91 @@
deal of work behind the scenes to accomplish this communication.
<P>Most of what an ORB does is completely transparent to the user, and a major
-portion of the <TT>CORBA</TT> package consists of classes used by the ORB
+portion of the <code>CORBA</code> package consists of classes used by the ORB
behind the scenes. The result is that most programmers will use only a
small part of this package directly. In fact, most programmers will use
-only a few methods from the <TT>ORB</TT> class, some exceptions, and
+only a few methods from the <code>ORB</code> class, some exceptions, and
occasionally,
-a holder class.
+a holder class.
<H3>
-<TT>ORB</TT> Methods</H3>
+<code>ORB</code> Methods</H3>
-<P>Before an application can enter the CORBA environment, it must first:
+<P>Before an application can enter the CORBA environment, it must first:
<UL>
<LI>Be initialized into the ORB and possibly the object adapter (POA) environments.
-<LI>Get references to ORB object (for use in future ORB operations)
-and perhaps other objects (including the root POA or some Object Adapter objects).
+<LI>Get references to ORB object (for use in future ORB operations)
+and perhaps other objects (including the root POA or some Object Adapter objects).
</UL>
<P>The following operations are provided to initialize applications and obtain
the appropriate object references:
<UL>
<LI>Operations providing access to the ORB, which are discussed in this
section.
- <LI>Operations providing access to Object Adapters, Interface Repository,
- Naming Service, and other Object Services. These operations are described
+ <LI>Operations providing access to Object Adapters, Interface Repository,
+ Naming Service, and other Object Services. These operations are described
in <a href="#adv"><em>Other Classes</em></a>.
</UL>
<P>
-When an application requires a CORBA environment it needs a mechanism to
-get an ORB object reference and possibly an OA object reference
-(such as the root POA). This serves two purposes. First, it initializes
-an application into the ORB and OA environments. Second, it returns the
-ORB object reference and the OA object reference to the application
-for use in future ORB and OA operations.
+When an application requires a CORBA environment it needs a mechanism to
+get an ORB object reference and possibly an OA object reference
+(such as the root POA). This serves two purposes. First, it initializes
+an application into the ORB and OA environments. Second, it returns the
+ORB object reference and the OA object reference to the application
+for use in future ORB and OA operations.
-<P>In order to obtain an ORB object reference, applications call
-the <tt>ORB.init</tt> operation. The parameters to the call can comprise an
+<P>In order to obtain an ORB object reference, applications call
+the <code>ORB.init</code> operation. The parameters to the call can comprise an
identifier for the ORB for which the object reference is required,
- and an arg_list, which is used to allow environment-specific data to be
- passed into the call.
+ and an arg_list, which is used to allow environment-specific data to be
+ passed into the call.
-<P>These are the <TT>ORB</TT> methods
+<P>These are the <code>ORB</code> methods
that provide access to the ORB:
<UL>
<LI>
-<TT><b>init</b>()</TT>
+<code><b>init</b>()</code>
<LI>
-<TT><b>init</b>(String [] args, Properties props)</TT>
+<code><b>init</b>(String [] args, Properties props)</code>
<LI>
-<TT><b>init</b>(Applet app, Properties props)</TT>
+<code><b>init</b>(Applet app, Properties props)</code>
</UL>
-<P>Using the <tt>init()</tt> method without parameters initiates
+<P>Using the <code>init()</code> method without parameters initiates
a singleton ORB, which can only
-give typecode creation <tt>any</tt>s needed in code generated
-in Helper classes by <tt>idlj</tt>.
+give typecode creation <code>any</code>s needed in code generated
+in Helper classes by <code>idlj</code>.
-<P>Applications require a portable means by which to obtain their
-initial object references. References are required for the root
-POA, POA Current, Interface Repository, and various Object Services
+<P>Applications require a portable means by which to obtain their
+initial object references. References are required for the root
+POA, POA Current, Interface Repository, and various Object Services
instances. The functionality required by the application is similar
- to that provided by the Naming Service. However, the OMG does not
- want to mandate that the Naming Service be made available to all
- applications in order that they may be portably initialized.
- Consequently, the operations shown in this section provide a
- simplified, local version of the Naming Service that applications
- can use to obtain a small, defined set of object references which
- are essential to its operation. Because only a small well-defined
+ to that provided by the Naming Service. However, the OMG does not
+ want to mandate that the Naming Service be made available to all
+ applications in order that they may be portably initialized.
+ Consequently, the operations shown in this section provide a
+ simplified, local version of the Naming Service that applications
+ can use to obtain a small, defined set of object references which
+ are essential to its operation. Because only a small well-defined
set of objects are expected with this mechanism, the naming context
can be flattened to be a single-level name space. This simplification
results in only two operations being defined to achieve the functionality
required.
-<P>Initial references are obtained via two operations provided in
-the ORB object interface, providing facilities to list and
+<P>Initial references are obtained via two operations provided in
+the ORB object interface, providing facilities to list and
resolve initial object references. These are:
<UL>
<LI>
-<TT><b>resolve_initial_references</b>(String name)</TT>
+<code><b>resolve_initial_references</b>(String name)</code>
<LI>
-<TT><b>list_initial_services</b>()</TT>
+<code><b>list_initial_services</b>()</code>
<LI>
-<TT><b>register_initial_reference</b>(String id,
-org.omg.CORBA.Object obj)</TT>
+<code><b>register_initial_reference</b>(String id, org.omg.CORBA.Object obj)</code>
</UL>
-<P>An example that uses some of these methods is <A
+<P>An example that uses some of these methods is <A
HREF="{@docRoot}/../technotes/guides/idl/GShome.html">
<em>Getting Started with Java IDL</em></A>.
@@ -156,7 +155,7 @@
Exceptions</H2>
Exceptions in Java IDL are similar to those in any code written in the
Java programming language. If a method is defined to throw an exception,
-then any code using that method must have a <TT>try</TT>/<TT>catch</TT>
+then any code using that method must have a <code>try</code>/<code>catch</code>
block and handle that exception when it is thrown.
<P>The documentation on <A
@@ -165,10 +164,10 @@
system exceptions and user-defined exceptions.
<P>The following is a list of the system exceptions (which are unchecked
-exceptions inheriting through <TT><a href="SystemException.html">
-org.omg.CORBA.SystemException</a></TT> from
-<TT>java.lang.RuntimeException</TT>) that are defined in the package
-<TT>org.omg.CORBA</TT>:
+exceptions inheriting through <code><a href="SystemException.html">
+org.omg.CORBA.SystemException</a></code> from
+<code>java.lang.RuntimeException</code>) that are defined in the package
+<code>org.omg.CORBA</code>:
<PRE><code>
BAD_CONTEXT
BAD_INV_ORDER
@@ -203,7 +202,7 @@
</code></PRE>
<P>
The following is a list of user-defined exceptions defined in the package
-<TT>org.omg.CORBA</TT>.
+<code>org.omg.CORBA</code>.
<PRE><code>
Bounds
UnknownUserException
@@ -212,37 +211,37 @@
</code></PRE>
<H2>Subpackages</H2>
-There are some packages inside the <TT>CORBA</TT> package with
+There are some packages inside the <code>CORBA</code> package with
"Package" as part of their names. These packages are generally quite small
because all they do is provide exceptions or classes for use by interfaces
-and classes in the <TT>CORBA</TT> package.
+and classes in the <code>CORBA</code> package.
-<P>For example, the package <TT><a href="TypeCodePackage/package-summary.html">
-org.omg.CORBA.TypeCodePackage</a></TT> contains
-two exceptions thrown by methods in the class <TT>TypeCode</TT>. These
+<P>For example, the package <code><a href="TypeCodePackage/package-summary.html">
+org.omg.CORBA.TypeCodePackage</a></code> contains
+two exceptions thrown by methods in the class <code>TypeCode</code>. These
exceptions are:
<UL>
<LI>
-<TT>BadKind</TT>
+<code>BadKind</code>
<LI>
-<TT>Bounds</TT>
+<code>Bounds</code>
</UL>
-The package <TT><a href="ORBPackage/package-summary.html">
-org.omg.CORBA.ORBPackage</a></TT> contains two exceptions:
+The package <code><a href="ORBPackage/package-summary.html">
+org.omg.CORBA.ORBPackage</a></code> contains two exceptions:
<UL>
<LI>
-<TT>InvalidName</TT>
+<code>InvalidName</code>
<LI>
-<TT>InconsistentTypeCode</TT>
+<code>InconsistentTypeCode</code>
</UL>
-<P>Another package that is a subpackage of <tt>CORBA</tt> is the <tt>
-<a href="portable/package-summary.html">portable</a></tt> package. It
-provides a set of ORB APIs that makes it
+<P>Another package that is a subpackage of <code>CORBA</code> is the
+<code><a href="portable/package-summary.html">portable</a></code>
+package. It provides a set of ORB APIs that makes it
possible for code generated by one vendor's IDL compiler to run
-on another vendor's ORB.
+on another vendor's ORB.
@@ -251,47 +250,49 @@
Holder classes</H2>
-<P>Support for out and inout parameter passing modes requires the use of
-additional <em><a href="doc-files/generatedfiles.html#holder">holder
-classes</a></em>. Because the Java programming language does not support out or
+<P>Support for out and inout parameter passing modes requires the use of
+additional <em><a href="doc-files/generatedfiles.html#holder">holder
+classes</a></em>. Because the Java programming language does not support out or
inout parameters, holder classes are needed as a means of passing a parameter
-that can be modified. To support portable stubs and skeletons, holder classes also implement
- the <tt><a href="portable/Streamable.html">org.omg.CORBA.portable.Streamable</a>
- </tt> interface.
+that can be modified. To support portable stubs and skeletons,
+holder classes also implement the
+<code><a href="portable/Streamable.html">org.omg.CORBA.portable.Streamable</a></code>
+interface.
<P>Holder classes are named by appending "Holder" to the name of the type.
The name of the type refers to its name in the Java programming language. For
- example, a holder class for the interface named <tt>Account</tt> in the Java programming
- language would be named <tt>AccountHolder</tt>.
+ example, a holder class for the interface named <code>Account</code>
+ in the Java programming
+ language would be named <code>AccountHolder</code>.
<P>Holder classes are available for all of the basic IDL
- datatypes in the <tt>org.omg.CORBA</tt> package. So, for example,
- there are already-defined classes for <tt>LongHolder</tt>, <tt>ShortHolder</tt>,
- <tt>FloatHolder</tt>, and so on. Classes are also generated for
- all named user-defined IDL types except those defined by <tt>typedefs</tt>.
- (Note that in this context user defined includes types that are
+ datatypes in the <code>org.omg.CORBA</code> package. So, for example,
+ there are already-defined classes for <code>LongHolder</code>, <code>ShortHolder</code>,
+ <code>FloatHolder</code>, and so on. Classes are also generated for
+ all named user-defined IDL types except those defined by <code>typedefs</code>.
+ (Note that in this context user defined includes types that are
defined in OMG specifications such as those for the Interface
- Repository, and other OMG services.)
+ Repository, and other OMG services.)
<P>Each holder class has:
<UL>
<LI>a constructor from an instance
<LI>a default constructor
-<LI>a public instance member, <tt>value</tt> which is the typed value.
-<LI>a method for reading an input stream and assigning the contents to the
-type's <tt>value</tt> field
-<LI>a method for writing the value of the <tt>value</tt> field to an output stream
+<LI>a public instance member, <code>value</code> which is the typed value.
+<LI>a method for reading an input stream and assigning the contents to the
+type's <code>value</code> field
+<LI>a method for writing the value of the <code>value</code> field to an output stream
<LI>a method for getting the typecode of the type
</UL>
-<P>The default constructor sets the value field to the default value for the
-type as defined by the Java language:
+<P>The default constructor sets the value field to the default value for the
+type as defined by the Java language:
<UL>
-<LI><tt>false</tt> for boolean
-<LI><tt>0</tt> for numeric and char types
-<LI><tt>null</tt> for strings and object references
+<LI><code>false</code> for boolean
+<LI><code>0</code> for numeric and char types
+<LI><code>null</code> for strings and object references
</UL>
@@ -301,7 +302,7 @@
were mapped to the Java programming language, the following holder class
would be generated:
<PRE>
-public final class AccountHolder implements
+public final class AccountHolder implements
org.omg.CORBA.portable.Streamable
{
// field that holds an Account object
@@ -342,53 +343,52 @@
<P>For more information on Holder classes, see Chapter 1.4, <em>Mapping for
Basic Types</em> in the <a href="http://www.omg.org/cgi-bin/doc?ptc/00-01-08">
<em>OMG IDL to Java Language Mapping</em></a>. The Holder classes defined
-in the package <TT>org.omg.CORBA</TT> are:
-<PRE>
- <TT>AnyHolder
-</TT> <TT>AnySeqHolder
-</TT> <TT>BooleanHolder
-</TT> <TT>BooleanSeqHolder
-</TT> <TT>ByteHolder
-</TT> <TT>CharHolder
-</TT> <TT>CharSeqHolder
-</TT> <TT>CurrentHolder
-</TT> <TT>DoubleHolder
-</TT> <TT>DoubleSeqHolder
-</TT> <TT>FixedHolder
-</TT> <TT>FloatHolder
-</TT> <TT>FloatSeqHolder
-</TT> <TT>IntHolder
-</TT> <TT>LongHolder
-</TT> <TT>LongLongSeqHolder
-</TT> <TT>LongSeqHolder
-</TT> <TT>ObjectHolder
-</TT> <TT>OctetSeqHolder
-</TT> <TT>ParameterModeHolder
-</TT> <TT>PolicyErrorHolder
-</TT> <TT>PolicyListHolder
-</TT> <TT>PrincipalHolder
-</TT> <TT>ServiceInformationHolder
-</TT> <TT>ShortHolder
-</TT> <TT>ShortSeqHolder
-</TT> <TT>StringHolder
-</TT> <TT>StringSeqHolder
-</TT> <TT>TypeCodeHolder
-</TT> <TT>ULongLongSeqHolder
-</TT> <TT>ULongSeqHolder
-</TT> <TT>UnknownUserExceptionHolder
-</TT> <TT>UShortSeqHolder
-</TT> <TT>ValueBaseHolder
-</TT> <TT>WCharSeqHolder
-</TT> <TT>WrongTransactionHolder
-</TT> <TT>WStringSeqHolder</TT>
-
-</PRE>
+in the package <code>org.omg.CORBA</code> are:
+<PRE><code>
+ AnyHolder
+ AnySeqHolder
+ BooleanHolder
+ BooleanSeqHolder
+ ByteHolder
+ CharHolder
+ CharSeqHolder
+ CurrentHolder
+ DoubleHolder
+ DoubleSeqHolder
+ FixedHolder
+ FloatHolder
+ FloatSeqHolder
+ IntHolder
+ LongHolder
+ LongLongSeqHolder
+ LongSeqHolder
+ ObjectHolder
+ OctetSeqHolder
+ ParameterModeHolder
+ PolicyErrorHolder
+ PolicyListHolder
+ PrincipalHolder
+ ServiceInformationHolder
+ ShortHolder
+ ShortSeqHolder
+ StringHolder
+ StringSeqHolder
+ TypeCodeHolder
+ ULongLongSeqHolder
+ ULongSeqHolder
+ UnknownUserExceptionHolder
+ UShortSeqHolder
+ ValueBaseHolder
+ WCharSeqHolder
+ WrongTransactionHolder
+ WStringSeqHolder
+</code></PRE>
<h2>Helper Classes </h2>
<P>Helper files supply several static methods needed to manipulate the type.
These include:
<UL>
- <LI><tt>Any</tt> insert and extract operations for the type
+ <LI><code>Any</code> insert and extract operations for the type
<LI>getting the repository id
<LI>getting the typecode
<LI>reading and writing the type from and to a stream
@@ -397,25 +397,26 @@
</UL>
<P>The helper class for a mapped IDL interface or abstract interface
- also include narrow operation(s). The static narrow method allows
- an <tt>org.omg.CORBA.Object</tt> to be narrowed to the object reference
- of a more specific type. The IDL exception <tt>CORBA.BAD_PARAM</tt>
- is thrown if the narrow fails because the object reference does not
- support the requested type. A different system exception is raised
- to indicate other kinds of errors. Trying to narrow a <tt>null</tt> will always
- succeed with a return value of <tt>null</tt>. Generally, the only helper method an application programmer uses is
+also include narrow operation(s). The static narrow method allows
+an <code>org.omg.CORBA.Object</code> to be narrowed to the object reference
+of a more specific type. The IDL exception <code>CORBA.BAD_PARAM</code>
+is thrown if the narrow fails because the object reference does not
+support the requested type. A different system exception is raised
+to indicate other kinds of errors. Trying to narrow a <code>null</code> will always
+succeed with a return value of <code>null</code>.
+Generally, the only helper method an application programmer uses is
the <code>narrow</code> method. The other methods are normally used behind
the scenes and are transparent to the programmer.
<P>Helper classes
fall into two broad categories, <a href="#value">helpers for value types</a> and
-<a href="#basic">helpers for non value types</a>. Because all of the helper
+<a href="#basic">helpers for non value types</a>. Because all of the helper
classes in one category
-provide the same methods, one generic explanation of each
+provide the same methods, one generic explanation of each
category of helper classes is presented here.
<P>
-When OMG IDL is mapped to the Java programming language,
+When OMG IDL is mapped to the Java programming language,
a "helper" class is generated for each user-defined type.
This generated class will have the name of the user-defined type with
the suffix <code>Helper</code> appended. For example, if the
@@ -423,7 +424,7 @@
<code>idlj</code> compiler will automatically generate a class named
<code>AccountHelper</code>. The <code>AccountHelper</code> class
will contain the static methods needed for manipulating instances of the type,
-in this case, <code>Account</code> objects.
+in this case, <code>Account</code> objects.
<a name="narrow"></a>
@@ -442,14 +443,12 @@
not determines which <code>narrow</code> method its helper class will provide.
The helper class for an interface
that is not abstract will have a <code>narrow</code> method that takes a CORBA
-object, whereas the <code>narrow</code> method for an interface that is abstract
-will
-take an object in the Java programming language. The helper class for a
+object, whereas the <code>narrow</code> method for an interface that is abstract
+will take an object in the Java programming language. The helper class for a
non-abstract interface that has at least one abstract base interface will provide
both versions of the <code>narrow</code> method.
-<P>The <A HREF="{@docRoot}/../technotes/guides/idl/jidlExample.html"><em>Hello World</em></A>
-tutorial uses a <tt>narrow</tt> method that looks
-like this:
+<P>The <A HREF="{@docRoot}/../technotes/guides/idl/jidlExample.html"><em>Hello World</em></A>
+tutorial uses a <code>narrow</code> method that looks like this:
<PRE>
// create and initialize the ORB
ORB orb = ORB.init(args, null);
@@ -469,7 +468,7 @@
<a name="basic"></a>
<h3>Example of a Basic Helper Class</h3>
A basic helper class, for purposes of this explanation, is one with
-the methods that are provided by every helper class, plus a <code>narrow</code>
+the methods that are provided by every helper class, plus a <code>narrow</code>
method if the type defined in OMG IDL maps to an interface in the Java
programming language. Types that are not value types will have a basic
helper class generated for them.
@@ -626,57 +625,56 @@
}
</pre>
-<P>The Helper classes defined in the package <TT>org.omg.CORBA</TT> are:
+<P>The Helper classes defined in the package <code>org.omg.CORBA</code> are:
<PRE><code>
- <TT>AnySeqHelper
-</TT> <TT>BooleanSeqHelper
-</TT> <TT>CharSeqHelper
-</TT> <TT>CompletionStatusHelper
-</TT> <TT>CurrentHelper
-</TT> <TT>DefinitionKindHelper
-</TT> <TT>DoubleSeqHelper
-</TT> <TT>FieldNameHelper
-</TT> <TT>FloatSeqHelper
-</TT> <TT>IdentifierHelper
-</TT> <TT>IDLTypeHelper
-</TT> <TT>LongLongSeqHelper
-</TT> <TT>LongSeqHelper
-</TT> <TT>NameValuePairHelper
-</TT> <TT>ObjectHelper
-</TT> <TT>OctetSeqHelper
-</TT> <TT>ParameterModeHelper
-</TT> <TT>PolicyErrorCodeHelper
-</TT> <TT>PolicyErrorHelper
-</TT> <TT>PolicyHelper
-</TT> <TT>PolicyListHelper
-</TT> <TT>PolicyTypeHelper
-</TT> <TT>RepositoryIdHelper
-</TT> <TT>ServiceDetailHelper
-</TT> <TT>ServiceInformationHelper
-</TT> <TT>SetOverrideTypeHelper
-</TT> <TT>ShortSeqHelper
-</TT> <TT>StringSeqHelper
-</TT> <TT>StringValueHelper
-</TT> <TT>StructMemberHelper
-</TT> <TT>ULongLongSeqHelper
-</TT> <TT>ULongSeqHelper
-</TT> <TT>UnionMemberHelper
-</TT> <TT>UnknownUserExceptionHelper
-</TT> <TT>UShortSeqHelper
-</TT> <TT>ValueBaseHelper
-</TT> <TT>ValueMemberHelper
-</TT> <TT>VersionSpecHelper
-</TT> <TT>VisibilityHelper
-</TT> <TT>WCharSeqHelper
-</TT> <TT>WrongTransactionHelper
-</TT> <TT>WStringSeqHelper
-</TT> <TT>WStringValueHelper</TT>
-
+ AnySeqHelper
+ BooleanSeqHelper
+ CharSeqHelper
+ CompletionStatusHelper
+ CurrentHelper
+ DefinitionKindHelper
+ DoubleSeqHelper
+ FieldNameHelper
+ FloatSeqHelper
+ IdentifierHelper
+ IDLTypeHelper
+ LongLongSeqHelper
+ LongSeqHelper
+ NameValuePairHelper
+ ObjectHelper
+ OctetSeqHelper
+ ParameterModeHelper
+ PolicyErrorCodeHelper
+ PolicyErrorHelper
+ PolicyHelper
+ PolicyListHelper
+ PolicyTypeHelper
+ RepositoryIdHelper
+ ServiceDetailHelper
+ ServiceInformationHelper
+ SetOverrideTypeHelper
+ ShortSeqHelper
+ StringSeqHelper
+ StringValueHelper
+ StructMemberHelper
+ ULongLongSeqHelper
+ ULongSeqHelper
+ UnionMemberHelper
+ UnknownUserExceptionHelper
+ UShortSeqHelper
+ ValueBaseHelper
+ ValueMemberHelper
+ VersionSpecHelper
+ VisibilityHelper
+ WCharSeqHelper
+ WrongTransactionHelper
+ WStringSeqHelper
+ WStringValueHelper
</code></PRE>
<a name="adv"></a>
<H1>
Other Classes</H1>
-The other classes and interfaces in the <TT>CORBA</TT> package, which are
+The other classes and interfaces in the <code>CORBA</code> package, which are
used behind the scenes, can be put into four groups. Three of the groups
are used with requests in some capacity, and the fourth group, concerning
the Interface Repository, is a category by itself.
@@ -686,38 +684,38 @@
information used in request operations.
<UL>
<LI>
-<TT>TCKind</TT> -- indicates the kind (datatype) for a <TT>TypeCode</TT>
+<code>TCKind</code> -- indicates the kind (datatype) for a <code>TypeCode</code>
object
<LI>
-<TT>TypeCode</TT> -- indicates a datatype and possibly other information
+<code>TypeCode</code> -- indicates a datatype and possibly other information
<LI>
-<TT>Any</TT> -- contains a value and its typecode
+<code>Any</code> -- contains a value and its typecode
<LI>
-<TT>NamedValue</TT> -- contains a name, an <TT>Any</TT> object, and an
-argument mode flag. <TT>NamedValue</TT> objects contain information about
+<code>NamedValue</code> -- contains a name, an <code>Any</code> object, and an
+argument mode flag. <code>NamedValue</code> objects contain information about
method arguments, method return values, or a context.
<LI>
-<TT>ContextList</TT> -- a list of strings that describe the contexts that
+<code>ContextList</code> -- a list of strings that describe the contexts that
need to be resolved and sent with an invocation
<LI>
-<TT>ExceptionList</TT> -- a list of <TT>TypeCode</TT>s for exceptions that
+<code>ExceptionList</code> -- a list of <code>TypeCode</code>s for exceptions that
may be thrown by a method
<LI>
-<TT>Environment</TT> -- a container for the exception thrown during a method
+<code>Environment</code> -- a container for the exception thrown during a method
invocation
<LI>
-<TT>Context</TT> -- a list of <TT>NamedValue</TT> objects used to pass
+<code>Context</code> -- a list of <code>NamedValue</code> objects used to pass
auxiliary information from client to server
<LI>
-<TT>NVList</TT> -- a list of <TT>NamedValue</TT> objects, used to pass
+<code>NVList</code> -- a list of <code>NamedValue</code> objects, used to pass
arguments or get results
</UL>
@@ -726,23 +724,23 @@
The second group of classes deals with requests:
<UL>
<LI>
-<TT>Object</TT> -- the base class for all CORBA object references
+<code>Object</code> -- the base class for all CORBA object references
<LI>
-<TT>Request</TT> -- the main class in the DII, which contains methods for
+<code>Request</code> -- the main class in the DII, which contains methods for
adding arguments to the request, for accessing information about the method
being invoked (the method name, its arguments, exceptions it throws, and
so on), and for making invocations on the request
<LI>
-<TT>DynamicImplementation</TT> -- the base class for server implementations
-using the DSI. It has the method <TT>invoke</TT>, which is used by an
+<code>DynamicImplementation</code> -- the base class for server implementations
+using the DSI. It has the method <code>invoke</code>, which is used by an
implementation
-of this class to determine the state of a <TT>ServerRequest</TT> object
+of this class to determine the state of a <code>ServerRequest</code> object
and to set its result or exception
<LI>
-<TT>ServerRequest</TT> -- captures the explicit state of a request for
+<code>ServerRequest</code> -- captures the explicit state of a request for
the Dynamic Skeleton Interface
</UL>
@@ -750,82 +748,82 @@
Interfaces That Serve as Constants</H2>
The third group contains interfaces that serve as constants. The IDL-to-Java
mapping mandates that IDL enums are mapped to a Java class with the enumerated
-values represented as public static final fields in that class (e.g.
+values represented as public static final fields in that class (e.g.
DefinitionKind).
On the other hand IDL constants defined outside of an IDL interface are
mapped to a Java interface for each constant.
-<P>This is why several interfaces in the <TT>org.omg.CORBA</TT> package
-consist of a single field, <TT>value</TT>, which is a <TT>short</TT>. This
+<P>This is why several interfaces in the <code>org.omg.CORBA</code> package
+consist of a single field, <code>value</code>, which is a <code>short</code>. This
field is a constant used for such things as an error code or value modifier.
-For example, the <TT>value</TT> field of the interface <TT>BAD_POLICY</TT>
-is one of the possible reasons for the exception <TT>PolicyError</TT> to
-be thrown. To specify this error code, you would use <TT>BAD_POLICY.value</TT>.
+For example, the <code>value</code> field of the interface <code>BAD_POLICY</code>
+is one of the possible reasons for the exception <code>PolicyError</code> to
+be thrown. To specify this error code, you would use <code>BAD_POLICY.value</code>.
-<P>The exception <TT>PolicyError</TT> uses the <TT>value</TT> field of
+<P>The exception <code>PolicyError</code> uses the <code>value</code> field of
the following interfaces as its possible error codes.
<UL>
<LI>
-<TT>BAD_POLICY</TT>
+<code>BAD_POLICY</code>
<LI>
-<TT>BAD_POLICY_TYPE</TT>
+<code>BAD_POLICY_TYPE</code>
<LI>
-<TT>BAD_POLICY_VALUE</TT>
+<code>BAD_POLICY_VALUE</code>
<LI>
-<TT>UNSUPPORTED_POLICY</TT>
+<code>UNSUPPORTED_POLICY</code>
<LI>
-<TT>UNSUPPORTED_POLICY_VALUE</TT>
+<code>UNSUPPORTED_POLICY_VALUE</code>
</UL>
-The method <TT>TypeCode.type_modifier</TT> returns the <TT>value</TT> field
-of one of the following interfaces. The <TT>VM</TT> in the names of these
+The method <code>TypeCode.type_modifier</code> returns the <code>value</code> field
+of one of the following interfaces. The <code>VM</code> in the names of these
interfaces stands for "value modifier."
<UL>
<LI>
-<TT>VM_NONE</TT>
+<code>VM_NONE</code>
<LI>
-<TT>VM_ABSTRACT</TT>
+<code>VM_ABSTRACT</code>
<LI>
-<TT>VM_CUSTOM</TT>
+<code>VM_CUSTOM</code>
<LI>
-<TT>VM_TRUNCATABLE</TT>
+<code>VM_TRUNCATABLE</code>
</UL>
The following constants are returned by a <code>ValueMember</code> object's
access method to denote the visibility of the <code>ValueMember</code> object.
<UL>
<LI>
-<TT>PRIVATE_MEMBER</TT>
+<code>PRIVATE_MEMBER</code>
<LI>
-<TT>PUBLIC_MEMBER</TT>
+<code>PUBLIC_MEMBER</code>
</UL>
-These flags, used in <TT>NamedValue</TT> objects or as parameters to methods,
+These flags, used in <code>NamedValue</code> objects or as parameters to methods,
are defined in the following interfaces:
<UL>
<LI>
-<TT>ARG_IN</TT>
+<code>ARG_IN</code>
<LI>
-<TT>ARG_INOUT</TT>
+<code>ARG_INOUT</code>
<LI>
-<TT>ARG_OUT</TT>
+<code>ARG_OUT</code>
<LI>
-<TT>CTX_RESTRICT_SCOPE</TT>
+<code>CTX_RESTRICT_SCOPE</code>
</UL>
<H2>
Interface Repository Interfaces and Classes</H2>
A fourth group contains the Interface Repository interfaces and classes,
-which are generated by the <TT>idlj</TT> compiler from the OMG IDL
-interface <TT>ir.idl</TT>. The purpose of the Interface Repository is to
+which are generated by the <code>idlj</code> compiler from the OMG IDL
+interface <code>ir.idl</code>. The purpose of the Interface Repository is to
identify the interfaces stored in it so that they can be accessed by an
ORB. Each module, type, interface, attribute, operation, parameter, exception,
constant, and so on is described completely by the Interface Repository
@@ -874,7 +872,7 @@
<H1>
CORBA Features Not Implemented in Java IDL</H1>
-<P>Some of the API included in <TT>org.omg</TT> subpackages is provided for
+<P>Some of the API included in <code>org.omg</code> subpackages is provided for
conformance with the current OMG CORBA specification but is not implemented
in Sun's release of the JDK<SUP><FONT SIZE=-2>TM</FONT></SUP>. This enables
other JDK licensees to provide implementations of this API in standard
@@ -883,21 +881,21 @@
<P><A NAME="NO_IMPLEMENT"></A>
<h2>Features That Throw NO_IMPLEMENT</h2>
-<P>Some of the API included in <TT>org.omg</TT> subpackages throw
-<tt>NO_IMPLEMENT</tt> exceptions for various reasons. Among these reasons
+<P>Some of the API included in <code>org.omg</code> subpackages throw
+<code>NO_IMPLEMENT</code> exceptions for various reasons. Among these reasons
are:
<UL>
- <LI>In some cases, for example <tt>LocalObject</tt>, the complete
- implementation according to the specification indicates that
- these API should throw <tt>NO_IMPLEMENT</tt>.
+ <LI>In some cases, for example <code>LocalObject</code>, the complete
+ implementation according to the specification indicates that
+ these API should throw <code>NO_IMPLEMENT</code>.
- <LI>In most cases, for example methods in <tt>ORB.java</tt>,
- methods that throw
- <tt>NO_IMPLEMENT</tt> are actually implemented in subclasses
+ <LI>In most cases, for example methods in <code>ORB.java</code>,
+ methods that throw
+ <code>NO_IMPLEMENT</code> are actually implemented in subclasses
elsewhere in the ORB code.
- <LI>In some cases, for example <tt>_get_interface_def()</tt>
- and <tt>_get_interface</tt>, API are really not yet implemented.
+ <LI>In some cases, for example <code>_get_interface_def()</code>
+ and <code>_get_interface</code>, API are really not yet implemented.
</UL>
@@ -912,65 +910,67 @@
operation of Java IDL.
<LI>
-Java IDL does not support <TT>long double</TT>.
+Java IDL does not support <code>long double</code>.
<LI>
-Policies (<TT><a href="Policy.html">org.omg.CORBA.Policy</a></TT>) and methods for getting them are not implemented.
+Policies (<code><a href="Policy.html">org.omg.CORBA.Policy</a></code>)
+and methods for getting them are not implemented.
<LI>
-Domain managers (<TT><a href="DomainManager.html">org.omg.CORBA.DomainManager</a></TT>) and methods for
+Domain managers (<code><a href="DomainManager.html">org.omg.CORBA.DomainManager</a></code>) and methods for
getting them are not implemented.
<LI>
-Service Information <TT><a href="ServiceInformation.html">org.omg.CORBA.ServiceInformation</a></TT> and ORB method <TT>public boolean get_service_information(short service_type,
-ServiceInformationHolder
-service_info)</TT> are not implemented.
+Service Information <code><a href="ServiceInformation.html">org.omg.CORBA.ServiceInformation</a></code>
+and ORB method
+<code>public boolean get_service_information(short service_type, ServiceInformationHolder service_info)</code>
+are not implemented.
-<LI>ORB methods for supporting single-threading (<tt>perform_work</tt>, <tt>work_pending</tt>) are not implemented.
+<LI>ORB methods for supporting single-threading
+(<code>perform_work</code>, <code>work_pending</code>) are not implemented.
<LI>IDL contexts.
</UL>
<HR>
<H2>
-Specific List of Unimplemented Features in Package <TT>org.omg.CORBA</TT></H2>
+Specific List of Unimplemented Features in Package <code>org.omg.CORBA</code></H2>
<H3>
-Unimplemented Methods in package <TT>org.omg.CORBA</TT>:</H3>
+Unimplemented Methods in package <code>org.omg.CORBA</code>:</H3>
<UL>
<LI>
-<TT>ORB</TT>
+<code>ORB</code>
<UL>
<LI>
-<TT>public org.omg.CORBA.Policy create_policy(int type, org.omg.CORBA.Any
-val)</TT>
+<code>public org.omg.CORBA.Policy create_policy(int type, org.omg.CORBA.Any val)</code>
<LI>
-<TT>public void perform_work()</TT>
+<code>public void perform_work()</code>
<LI>
-<TT>public boolean work_pending()</TT>
+<code>public boolean work_pending()</code>
<LI>
-<TT>public org.omg.CORBA.Current get_current()</TT>
+<code>public org.omg.CORBA.Current get_current()</code>
<LI>
-<TT>create_operation_list</TT>
+<code>create_operation_list</code>
<LI>
-<TT>get_default_context</TT>
+<code>get_default_context</code>
<LI>
-<TT>get_service_information</TT>
+<code>get_service_information</code>
<LI>
-obsolete <TT>DynAnys</TT> (deprecated in favor of <tt>DynamicAny</tt> package)
+obsolete <code>DynAnys</code> (deprecated in favor of <code>DynamicAny</code> package)
</UL>
--- a/corba/src/java.corba/share/classes/org/omg/CosNaming/NamingContextExtPackage/package.html Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/org/omg/CosNaming/NamingContextExtPackage/package.html Fri Sep 25 12:04:35 2015 -0700
@@ -30,20 +30,20 @@
</head>
<body bgcolor="white">
-<P>This package contains the following classes, which are used in
-<tt>org.omg.CosNaming.NamingContextExt</tt>:
+<P>This package contains the following classes, which are used in
+<code>org.omg.CosNaming.NamingContextExt</code>:
<UL>
- <LI><tt>AddressHelper</tt>
- <LI><tt>StringNameHelper</tt>
- <LI><tt>URLStringHelper</tt>
- <LI><tt>InvalidAddress</tt>
+ <LI><code>AddressHelper</code>
+ <LI><code>StringNameHelper</code>
+ <LI><code>URLStringHelper</code>
+ <LI><code>InvalidAddress</code>
</UL>
<H3>Package Specification</H3>
-<P>For a precise list of supported sections of official specifications with which
-the Java[tm] Platform, Standard Edition 6 ORB complies, see <A
-HREF="../../CORBA/doc-files/compliance.html">Official Specifications for CORBA
+<P>For a precise list of supported sections of official specifications with which
+the Java[tm] Platform, Standard Edition 6 ORB complies, see <A
+HREF="../../CORBA/doc-files/compliance.html">Official Specifications for CORBA
support in Java[tm] SE 6</A>.
@since 1.4
--- a/corba/src/java.corba/share/classes/org/omg/CosNaming/NamingContextPackage/package.html Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/org/omg/CosNaming/NamingContextPackage/package.html Fri Sep 25 12:04:35 2015 -0700
@@ -30,23 +30,23 @@
</head>
<body bgcolor="white">
-<P>This package contains Exception classes for the <tt>org.omg.CosNaming</tt>
+<P>This package contains Exception classes for the <code>org.omg.CosNaming</code>
package. The list of exception classes are:
<UL>
- <LI><tt>AlreadyBound</tt>
- <LI><tt>CannotProceed</tt>
- <LI><tt>InvalidName</tt>
- <LI><tt>NotEmpty</tt>
- <LI><tt>NotFound</tt>
- <LI><tt>NotFoundReason</tt>
+ <LI><code>AlreadyBound</code>
+ <LI><code>CannotProceed</code>
+ <LI><code>InvalidName</code>
+ <LI><code>NotEmpty</code>
+ <LI><code>NotFound</code>
+ <LI><code>NotFoundReason</code>
</UL>
<H3>Package Specification</H3>
-<P>For a precise list of supported sections of official specifications with which
-the Java[tm] Platform, Standard Edition 6 ORB complies, see <A
-HREF="../../CORBA/doc-files/compliance.html">Official Specifications for CORBA
+<P>For a precise list of supported sections of official specifications with which
+the Java[tm] Platform, Standard Edition 6 ORB complies, see <A
+HREF="../../CORBA/doc-files/compliance.html">Official Specifications for CORBA
support in Java SE 6</A>.
@since 1.4
--- a/corba/src/java.corba/share/classes/org/omg/CosNaming/nameservice.idl Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/org/omg/CosNaming/nameservice.idl Fri Sep 25 12:04:35 2015 -0700
@@ -99,8 +99,8 @@
* The BindingIterator interface allows a client to iterate through
* the bindings using the next_one or next_n operations.
*
- * The bindings iterator is obtained by using the <tt>list</tt>
- * method on the <tt>NamingContext</tt>.
+ * The bindings iterator is obtained by using the <code>list</code>
+ * method on the <code>NamingContext</code>.
* @see org.omg.CosNaming.NamingContext#list
*/
interface BindingIterator
@@ -412,7 +412,7 @@
* contains a set of name bindings in which each name is unique and is
* part of Interoperable Naming Service.
* Different names can be bound to an object in the same or different
- * contexts at the same time. Using <tt>NamingContextExt</tt>, you can use
+ * contexts at the same time. Using <code>NamingContextExt</code>, you can use
* URL-based names to bind and resolve.
*
* See <a href="http://www.omg.org/technology/documents/formal/naming_service.htm">
--- a/corba/src/java.corba/share/classes/org/omg/CosNaming/package.html Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/org/omg/CosNaming/package.html Fri Sep 25 12:04:35 2015 -0700
@@ -35,25 +35,25 @@
<P>
- The package and all its classes and interfaces
+ The package and all its classes and interfaces
were generated by running the tool <code>idlj</code> on the file
<code>nameservice.idl</code>, which is a module written in OMG IDL.
<H3>Package Specification</H3>
-<P>For a precise list of supported sections of official specifications with which
-the Java[tm] Platform, Standard Edition 6, ORB complies, see <A
-HREF="../CORBA/doc-files/compliance.html">Official Specifications for CORBA
+<P>For a precise list of supported sections of official specifications with which
+the Java[tm] Platform, Standard Edition 6, ORB complies, see <A
+HREF="../CORBA/doc-files/compliance.html">Official Specifications for CORBA
support in Java[tm] SE 6</A>.
<H2>Interfaces</H2>
- The package <tt>org.omg.CosNaming</tt> contains two public interfaces
- and several auxiliary classes.
+ The package <code>org.omg.CosNaming</code> contains two public interfaces
+ and several auxiliary classes.
<P>
The interfaces are:
<UL>
- <LI><TT>NamingContext</TT>
- <LI><TT>BindingIterator</TT>
+ <LI><code>NamingContext</code>
+ <LI><code>BindingIterator</code>
</UL>
<P>
These two interfaces provide the means to bind/unbind names and object
@@ -68,7 +68,7 @@
the idlj compiler creates Java classes that can be thought of
as auxiliary classes.
Comments for the generated auxiliary classes
- used by the interfaces <code>NamingContext</code> and
+ used by the interfaces <code>NamingContext</code> and
<code>BindingIterator</code> are included here.
<H3>Classes Used by <code>NamingContext</code> and
@@ -78,7 +78,7 @@
generated for each of the classes listed here, are discussed below.)
<UL>
- <LI><code>public final class <B>NameComponent</B></code> --
+ <LI><code>public final class <B>NameComponent</B></code> --
a building block for names. (Names are bound to object references
in a naming context.)
<P>A name is an array of one or more <code>NameComponent</code> objects.
@@ -99,7 +99,7 @@
rather than a file extension or some other syntactic convention.
Examples of the value of the <code>kind</code> field include the strings
<code>"c_source"</code>, <code>"object_code"</code>,
- <code>"executable"</code>,
+ <code>"executable"</code>,
<code>"postscript"</code>, and <code>""</code>. It is not unusual
for the <code>kind</code> field to be the empty string.
</OL>
@@ -110,7 +110,7 @@
This is similar to a path name, in which the last name is the
file name, and all names before it are directory names.
- <LI><code>public final class <B>Binding</B></code> --
+ <LI><code>public final class <B>Binding</B></code> --
an object that associates a name with an object reference or a
naming context.
A <code>Binding</code> object has two fields:
@@ -142,9 +142,9 @@
<code>Binding</code> or used as parameters or return values. These
<code>BindingType</code> objects are:
<UL>
- <LI><code>public static final BindingType <B>nobject</B></code> --
+ <LI><code>public static final BindingType <B>nobject</B></code> --
to indicate that the binding is with an object reference
- <LI><code>public static final BindingType <B>ncontext</B></code> --
+ <LI><code>public static final BindingType <B>ncontext</B></code> --
to indicate that the binding is with a naming context
</UL>
<P>
@@ -159,7 +159,7 @@
If the method <code>from_int</code> is supplied with anything other
than <code>_nobject</code>
or <code>_ncontext</code>, it will throw
- the exception <code>org.omg.CORBA.BAD_PARAM</code>.
+ the exception <code>org.omg.CORBA.BAD_PARAM</code>.
<P>Usage is as follows:
<PRE>
BindingType btObject = from_int(_nobject);
@@ -189,7 +189,7 @@
An instance of a holder class can be passed to a
Java method as a parameter, and
a value can be assigned to its <code>value</code> field. This allows
- it to perform the function of an OUT or INOUT parameter.
+ it to perform the function of an OUT or INOUT parameter.
<P>The following holder classes are generated for the package
<code>org.omg.CosNaming</code>:
<UL>
@@ -202,17 +202,17 @@
<LI><code>NameHolder</code>
</UL>
<P>
- Note that in the <code>org.omg.CORBA</code> package,
+ Note that in the <code>org.omg.CORBA</code> package,
there is a holder class for each of the basic Java types:
- <code>IntHolder</code>, <code>ShortHolder</code>,
+ <code>IntHolder</code>, <code>ShortHolder</code>,
<code>StringHolder</code>, and so on.
<P>
Note also that there is a <code>NameHolder</code> class even though
there is no <code>Name</code> class; similarly, there is a
<code>BindingListHolder</code> class even though there is no
<code>BindingList</code> class. This is true because in the OMG IDL
- interface, <code>Name</code> and <code>BindingList</code> are
- <code>typedef</code>s. There is no mapping from an IDL
+ interface, <code>Name</code> and <code>BindingList</code> are
+ <code>typedef</code>s. There is no mapping from an IDL
<code>typedef</code> to a Java construct, but holder classes
are generated if the <code>typedef</code> is for a sequence or
an array. As mapped to the
@@ -245,7 +245,7 @@
<H3>Helper Classes</H3>
Helper classes, which are generated for all user-defined types
in an OMG IDL interface, supply static methods needed to manipulate
- those types.
+ those types.
<P>
There is only one method in a helper class that an
application programmer uses: the
@@ -282,7 +282,7 @@
Sun's implementation of the <code>CosNaming</code> package complies
with the OMG <code>COSNaming</code> specification. In other words,
the APIs in Sun's naming service are implemented according to the
-guidelines for a naming service provided by OMG. Therefore, if a
+guidelines for a naming service provided by OMG. Therefore, if a
third-party vendor has implemented a naming service that is OMG
compliant, it is possible to switch between Sun's implementation of
<code>CosNaming</code> and the third-party vendor's implementation.
@@ -292,18 +292,17 @@
<h3>Instructions for Using a Third Party's Naming Service</h3>
Although we encourage using an ORB and ORB services that are both
-from one vendor, it is possible to plug in a third party's
+from one vendor, it is possible to plug in a third party's
<code>COSNaming</code> implementation with Sun's RMI-IIOP ORB.
Here are the steps to follow:
<OL>
<LI>Create a properties file for the Bootstrap server and give it
- two entries. For example, you could call this properties file
+ two entries. For example, you could call this properties file
<code>/tmp/services</code> and put the following in it:
- <code>NameService, <Stringified IOR of the Root Naming
-Context></code>.
+ <code>NameService, <Stringified IOR of the Root Naming Context></code>.
<P>
This associates <code>NameService</code> with the Root Naming
- Context of the <code>CosNaming</code> implementation that you
+ Context of the <code>CosNaming</code> implementation that you
want to use.
<LI>Start the standalone Bootstrap server using the following command:
<pre>
@@ -318,7 +317,7 @@
specifying a port number is optional.
</OL>
<P>
-Now when an application calls the method
+Now when an application calls the method
<code>org.omg.CORBA.ORB.resolve_initial_references</code>, CORBA
processes will contact the Bootstrap Server to get the Root Naming
Context.
@@ -326,13 +325,13 @@
<h2>Package Specification</h2>
<ul>
- <li>Interoperable Naming Service (<a
+ <li>Interoperable Naming Service (<a
href="http://www.omg.org/cgi-bin/doc?ptc/00-08-07">ptc/00-08-07</a>)
</ul>
<h2>Related Documentation</h2>
-For an overview and examples of how to use the
+For an overview and examples of how to use the
<code>CosNaming</code> API, please see:
<ul>
<li><a href="../../../../technotes/guides/idl/tnameserv.html">
--- a/corba/src/java.corba/share/classes/org/omg/Dynamic/package.html Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/org/omg/Dynamic/package.html Fri Sep 25 12:04:35 2015 -0700
@@ -31,7 +31,7 @@
</head>
<body bgcolor="white">
-<P>This package contains the <tt>Dynamic</tt> module specified in the OMG Portable
+<P>This package contains the <code>Dynamic</code> module specified in the OMG Portable
Interceptor specification,
<a href="http://www.omg.org/cgi-bin/doc?ptc/2000-08-06">
ptc/2000-08-06</a>, section 21.9. Please
@@ -40,10 +40,10 @@
<H3>Package Specification</H3>
-
-<P>For a precise list of supported sections of official specifications with which
-the Java[tm] Platform, Standard Edition 6 ORB complies, see <A
-HREF="../CORBA/doc-files/compliance.html">Official Specifications for CORBA
+
+<P>For a precise list of supported sections of official specifications with which
+the Java[tm] Platform, Standard Edition 6 ORB complies, see <A
+HREF="../CORBA/doc-files/compliance.html">Official Specifications for CORBA
support in Java[tm] SE 6</A>.
@since 1.4
--- a/corba/src/java.corba/share/classes/org/omg/DynamicAny/DynAnyFactoryPackage/package.html Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/org/omg/DynamicAny/DynAnyFactoryPackage/package.html Fri Sep 25 12:04:35 2015 -0700
@@ -33,9 +33,9 @@
<body bgcolor="white">
<P>
-This package contains classes and exceptions from the <tt>DynAnyFactory</tt>
+This package contains classes and exceptions from the <code>DynAnyFactory</code>
interface of the
-<tt>DynamicAny</tt> module
+<code>DynamicAny</code> module
specified in the OMG <em>The Common Object Request Broker: Architecture and
Specification</em>,
<a href="http://www.omg.org/cgi-bin/doc?formal/99-10-07">
@@ -43,10 +43,10 @@
refer to that OMG specification for further details.
<H3>Package Specification</H3>
-
-<P>For a precise list of supported sections of official specifications with which
-the Java[tm] Platform, Standard Edition 6 ORB complies, see <A
-HREF="../../CORBA/doc-files/compliance.html">Official Specifications for CORBA
+
+<P>For a precise list of supported sections of official specifications with which
+the Java[tm] Platform, Standard Edition 6 ORB complies, see <A
+HREF="../../CORBA/doc-files/compliance.html">Official Specifications for CORBA
support in Java SE 6</A>.
@since 1.4
--- a/corba/src/java.corba/share/classes/org/omg/DynamicAny/DynAnyPackage/package.html Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/org/omg/DynamicAny/DynAnyPackage/package.html Fri Sep 25 12:04:35 2015 -0700
@@ -30,8 +30,8 @@
</head>
<body bgcolor="white">
-<P>This package contains classes and exceptions from the <tt>DynAny</tt>
- interface of the <tt>DynamicAny</tt> module
+<P>This package contains classes and exceptions from the <code>DynAny</code>
+ interface of the <code>DynamicAny</code> module
specified in the OMG <em>The Common Object Request Broker: Architecture and
Specification</em>,
<a href="http://www.omg.org/cgi-bin/doc?formal/99-10-07">
@@ -42,9 +42,9 @@
<H3>Package Specification</H3>
-<P>For a precise list of supported sections of official specifications with which
-the Java[tm] Platform, Standard Edition 6 ORB complies, see <A
-HREF="../../CORBA/doc-files/compliance.html">Official Specifications for CORBA
+<P>For a precise list of supported sections of official specifications with which
+the Java[tm] Platform, Standard Edition 6 ORB complies, see <A
+HREF="../../CORBA/doc-files/compliance.html">Official Specifications for CORBA
support in Java[tm] SE 6</A>.
@since 1.4
--- a/corba/src/java.corba/share/classes/org/omg/DynamicAny/package.html Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/org/omg/DynamicAny/package.html Fri Sep 25 12:04:35 2015 -0700
@@ -48,15 +48,15 @@
helpful for writing generic clients (bridges, browsers, debuggers, user interface tools).
<P><code>Any</code> values can be dynamically interpreted (traversed) and constructed through
-<tt>DynAny</tt> objects. A <tt>DynAny</tt> object is associated with a data
-value which corresponds to a copy of the value inserted into an <tt>Any</tt>. A
-<tt>DynAny</tt> object may be viewed as an ordered collection of component
-<tt>DynAny</tt>s. For <tt>DynAny</tt>s representing a basic type, such as <code>long</code>,
+<code>DynAny</code> objects. A <code>DynAny</code> object is associated with a data
+value which corresponds to a copy of the value inserted into an <code>Any</code>. A
+<code>DynAny</code> object may be viewed as an ordered collection of component
+<code>DynAny</code>s. For <code>DynAny</code>s representing a basic type, such as <code>long</code>,
or a type without components, such as an empty exception, the ordered collection of
components is empty.
-<P>Each <tt>DynAny</tt> object maintains the notion of a current position into its collection
-of component <tt>DynAny</tt>s. The current position is identified by an index value that runs
+<P>Each <code>DynAny</code> object maintains the notion of a current position into its collection
+of component <code>DynAny</code>s. The current position is identified by an index value that runs
from 0 to n-1, where <em>n</em> is the number of components. The special index value -1
indicates a current position that points nowhere.
For values that cannot have a current position (such as an empty exception),
--- a/corba/src/java.corba/share/classes/org/omg/IOP/package.html Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/org/omg/IOP/package.html Fri Sep 25 12:04:35 2015 -0700
@@ -30,14 +30,14 @@
</head>
<body bgcolor="white">
-<P>This package contains the <TT>IOP</tt> module specified in the OMG document
+<P>This package contains the <code>IOP</code> module specified in the OMG document
<em>The Common
Object Request Broker: Architecture and Specification</em>,
<a href="http://www.omg.org/cgi-bin/doc?formal/99-10-07">
formal/99-10-07</a>, section 13.6. Please
refer to that OMG specification for further details.
-<P>Please note that we do not provide all parts of the <tt>IOP</tt> module from
+<P>Please note that we do not provide all parts of the <code>IOP</code> module from
the specification. We only provide those parts that are referenced as
return values or parameter types in public APIs, most notably,
Portable Interceptors.
@@ -47,10 +47,10 @@
<H3>Package Specification</H3>
-
-<P>For a precise list of supported sections of official specifications with which
-the Java[tm] Platform, Standard Edition 6 ORB complies, see <A
-HREF="../CORBA/doc-files/compliance.html">Official Specifications for CORBA
+
+<P>For a precise list of supported sections of official specifications with which
+the Java[tm] Platform, Standard Edition 6 ORB complies, see <A
+HREF="../CORBA/doc-files/compliance.html">Official Specifications for CORBA
support in Java[tm] SE 6</A>.
@since 1.4
--- a/corba/src/java.corba/share/classes/org/omg/Messaging/package.html Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/org/omg/Messaging/package.html Fri Sep 25 12:04:35 2015 -0700
@@ -30,22 +30,22 @@
</head>
<body bgcolor="white">
-<P>This package contains the <tt>Messaging</tt> module specified in the OMG CORBA
+<P>This package contains the <code>Messaging</code> module specified in the OMG CORBA
Messaging specification,
<a href="http://www.omg.org/cgi-bin/doc?formal/99-10-07">
formal/99-10-07</a>. Please refer to that OMG
specification for further details.
-<P>Please note that we do not provide all parts of the <tt>Messaging</tt> module from
+<P>Please note that we do not provide all parts of the <code>Messaging</code> module from
the specification. We only provide those parts that are referenced as
return values or parameter types in public APIs, most notably,
Portable Interceptors.
<H3>Package Specification</H3>
-
-<P>For a precise list of supported sections of official specifications with which
-the Java[tm] Platform, Standard Edition 6 ORB complies, see <A
-HREF="../CORBA/doc-files/compliance.html">Official Specifications for CORBA
+
+<P>For a precise list of supported sections of official specifications with which
+the Java[tm] Platform, Standard Edition 6 ORB complies, see <A
+HREF="../CORBA/doc-files/compliance.html">Official Specifications for CORBA
support in Java[tm] SE 6</A>.
@since 1.4
--- a/corba/src/java.corba/share/classes/org/omg/PortableInterceptor/ORBInitInfoPackage/package.html Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/org/omg/PortableInterceptor/ORBInitInfoPackage/package.html Fri Sep 25 12:04:35 2015 -0700
@@ -30,19 +30,19 @@
</head>
<body bgcolor="white">
-<P>This package contains the exceptions and typedefs from the <tt>ORBInitInfo</tt>
-local interface of the <tt>PortableInterceptor</tt> module specified in the OMG
+<P>This package contains the exceptions and typedefs from the <code>ORBInitInfo</code>
+local interface of the <code>PortableInterceptor</code> module specified in the OMG
Portable Interceptor specification,
<a href="http://www.omg.org/cgi-bin/doc?ptc/2000-08-06">
ptc/2000-08-06</a>, section 21.7.2. Please
refer to that OMG specification for further details.
-
+
<H3>Package Specification</H3>
-
-<P>For a precise list of supported sections of official specifications with which
-the Java[tm] Platform, Standard Edition 6 ORB complies, see <A
-HREF="../../CORBA/doc-files/compliance.html">Official Specifications for CORBA
+
+<P>For a precise list of supported sections of official specifications with which
+the Java[tm] Platform, Standard Edition 6 ORB complies, see <A
+HREF="../../CORBA/doc-files/compliance.html">Official Specifications for CORBA
support in Java SE 6</A>.
@since 1.4
--- a/corba/src/java.corba/share/classes/org/omg/PortableServer/POAPackage/package.html Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/org/omg/PortableServer/POAPackage/package.html Fri Sep 25 12:04:35 2015 -0700
@@ -45,25 +45,34 @@
-<P>Given an interface <tt>My</tt> defined in <tt>My.idl</tt>, the file <tt>MyPOA.java</tt> is generated by the <tt>idlj</tt> compiler. You must provide the implementation for <tt>My</tt> and it must inherit from <tt>MyPOA</tt>.
+<P>Given an interface <code>My</code> defined in <code>My.idl</code>, the file <code>MyPOA.java</code>
+is generated by the <code>idlj</code> compiler. You must provide
+the implementation for <code>My</code> and it must inherit from <code>MyPOA</code>.
-<P><TT>MyPOA.java</TT> is a stream-based skeleton that extends <tt>org.omg.PortableServer.Servant</tt> and implements the <tt>InvokeHandler</tt> interface and the operations interface associated with the IDL interface the skeleton implements.
+<P><code>MyPOA.java</code> is a stream-based skeleton that extends
+<code>org.omg.PortableServer.Servant</code> and implements the <code>InvokeHandler</code>
+interface and the operations interface associated with the IDL interface the skeleton implements.
-<P>The <TT>PortableServer</TT> module for the Portable Object Adapter (POA) defines the native <tt>Servant</tt> type. In the Java programming language, the <tt>Servant</tt> type is mapped to the Java <TT>org.omg.PortableServer.Servant</TT> class. It serves as the base class for all POA servant implementations and provides a number of methods that may
-be invoked by the application programmer, as well as methods which are invoked by the POA itself and may be overridden by the user to control aspects of servant behavior.
-
+<P>The <code>PortableServer</code> module for the Portable Object Adapter (POA)
+defines the native <code>Servant</code> type. In the Java programming language,
+the <code>Servant</code> type is mapped to the Java <code>org.omg.PortableServer.Servant</code> class.
+It serves as the base class for all POA servant implementations
+and provides a number of methods that may be invoked by the application programmer,
+as well as methods which are invoked by the POA itself
+and may be overridden by the user to control aspects of servant behavior.
-<P>All Mapping corresponds to the Chapter 11 of
+
+<P>All Mapping corresponds to the Chapter 11 of
CORBA V2.3.1 specified by OMG document formal/99-10-07.pdf.
- The exception to this is the <code>id</code> attribute, which is added in ptc/00-08-06,
+ The exception to this is the <code>id</code> attribute, which is added in ptc/00-08-06,
section 11.3.8.26.
<H3>Package Specification</H3>
-<P>For a precise list of supported sections of official specifications with which
-the Java[tm] Platform, Standard Edition 6, ORB complies, see <A
-HREF="../../CORBA/doc-files/compliance.html">Official Specifications for CORBA
+<P>For a precise list of supported sections of official specifications with which
+the Java[tm] Platform, Standard Edition 6, ORB complies, see <A
+HREF="../../CORBA/doc-files/compliance.html">Official Specifications for CORBA
support in Java[tm] SE 6</A>.
@since 1.4
--- a/corba/src/java.corba/share/classes/org/omg/PortableServer/ServantLocatorPackage/package.html Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/org/omg/PortableServer/ServantLocatorPackage/package.html Fri Sep 25 12:04:35 2015 -0700
@@ -33,15 +33,15 @@
<body bgcolor="white">
Provides classes and interfaces for locating the servant.
-<P>This package supplies a <TT>CookieHolder</TT> class for passing
-the <TT>Cookie</TT> type as an <code>out</code> parameter. The <code>CookieHolder</code> class
+<P>This package supplies a <code>CookieHolder</code> class for passing
+the <code>Cookie</code> type as an <code>out</code> parameter. The <code>CookieHolder</code> class
follows exactly the same pattern as the other holder classes for basic types.
-
+
<H2>Package Specification</H2>
-
-<P>For a precise list of supported sections of official OMG specifications with which
-the Java[tm] Platform, Standard Edition 6 complies, see <A
-HREF="../../CORBA/doc-files/compliance.html">Official Specifications for CORBA
+
+<P>For a precise list of supported sections of official OMG specifications with which
+the Java[tm] Platform, Standard Edition 6 complies, see <A
+HREF="../../CORBA/doc-files/compliance.html">Official Specifications for CORBA
support in Java[tm] SE 6</A>.
@since 1.4
--- a/corba/src/java.corba/share/classes/org/omg/PortableServer/package.html Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/org/omg/PortableServer/package.html Fri Sep 25 12:04:35 2015 -0700
@@ -2,7 +2,7 @@
<html>
<head>
<!--
-
+
Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -34,46 +34,46 @@
Provides classes and interfaces for making the server side of your applications
portable across multivendor ORBs.
-<P>In Java, Portable Object Adaptor (POA)-based Dynamic Skeleton Interface (DSI)
-servants inherit from the standard <TT>DynamicImplementation</TT> class, which
-inherits from the <TT>Servant</TT> class. The native <TT>Servant</TT> type is
-defined by the <TT>PortableServer</TT> module for the POA. In Java, the
- <TT>Servant</TT> type is mapped to the Java
- <TT>org.omg.PortableServer.Servant</TT> class.
- It serves as the base class for all POA servant
- implementations and provides a number of methods that may
- be invoked by the application programmer, as well as methods
- which are invoked by the POA itself and may be overridden by
- the user to control aspects of servant behavior.
+<P>In Java, Portable Object Adaptor (POA)-based Dynamic Skeleton Interface (DSI)
+servants inherit from the standard <code>DynamicImplementation</code> class, which
+inherits from the <code>Servant</code> class. The native <code>Servant</code> type is
+defined by the <code>PortableServer</code> module for the POA. In Java, the
+ <code>Servant</code> type is mapped to the Java
+ <code>org.omg.PortableServer.Servant</code> class.
+ It serves as the base class for all POA servant
+ implementations and provides a number of methods that may
+ be invoked by the application programmer, as well as methods
+ which are invoked by the POA itself and may be overridden by
+ the user to control aspects of servant behavior.
<H2>Package Specification</H2>
-<P>For a precise list of supported sections of official OMG specifications with which
-the Java[tm] Platform, Standard Edition 6 complies, see <A
-HREF="../CORBA/doc-files/compliance.html">Official Specifications for CORBA
+<P>For a precise list of supported sections of official OMG specifications with which
+the Java[tm] Platform, Standard Edition 6 complies, see <A
+HREF="../CORBA/doc-files/compliance.html">Official Specifications for CORBA
support in Java[tm] SE 6</A>.
<H2>POA-related Interfaces</H2>
-<P>The <TT>PortableServer</TT> module defines the following POA-related interfaces:
+<P>The <code>PortableServer</code> module defines the following POA-related interfaces:
<UL>
- <LI><TT>POA</TT>
- <LI><TT>POAManager</TT>
- <LI><TT>ServantManager</TT>
- <LI><TT>ServantActivator</TT>
- <LI><TT>ServantLocator</TT>
- <LI><TT>AdapterActivator</TT>
- <LI><TT>ThreadPolicy</TT>
- <LI><TT>LifespanPolicy</TT>
- <LI><TT>IdUniquenessPolicy</TT>
- <LI><TT>IdAssignmentPolicy</TT>
- <LI><TT>ImplicitActivationPolicy</TT>
- <LI><TT>ServantRetentionPolicy</TT>
- <LI><TT>RequestProcessingPolicy</TT>
- <LI><TT>Current</TT>
+ <LI><code>POA</code>
+ <LI><code>POAManager</code>
+ <LI><code>ServantManager</code>
+ <LI><code>ServantActivator</code>
+ <LI><code>ServantLocator</code>
+ <LI><code>AdapterActivator</code>
+ <LI><code>ThreadPolicy</code>
+ <LI><code>LifespanPolicy</code>
+ <LI><code>IdUniquenessPolicy</code>
+ <LI><code>IdAssignmentPolicy</code>
+ <LI><code>ImplicitActivationPolicy</code>
+ <LI><code>ServantRetentionPolicy</code>
+ <LI><code>RequestProcessingPolicy</code>
+ <LI><code>Current</code>
</UL>
-<P>In addition, the POA defines the <TT>Servant</TT> native type.
+<P>In addition, the POA defines the <code>Servant</code> native type.
<H3>Operations classes</H3>
@@ -87,10 +87,10 @@
Classes ending in the suffix <code>PolicyValue</code> provide the values used
for the <code>create_POA</code> call, which sets the policy for the POA. See
-the <a href="#sampleserver">sample code</a> below for a demonstration.
+the <a href="#sampleserver">sample code</a> below for a demonstration.
<code>PolicyValue</code> files include the following:
<UL>
-<LI><code>IdAssignmentPolicyValue</code>
+<LI><code>IdAssignmentPolicyValue</code>
<LI><code>IdUniquenessPolicyValue</code>
<LI><code>ImplicitActivationPolicyValue</code>
<LI><code>LifespanPolicyValue</code>
@@ -101,10 +101,10 @@
<H3>Helper Classes</H3>
-<P>Helper classes, which are generated for all user-defined types in an OMG IDL
+<P>Helper classes, which are generated for all user-defined types in an OMG IDL
interface, supply static methods needed to manipulate those types.
-There is only one method in a helper class that an application programmer uses:
-the <code>narrow</code> method. Only Java interfaces mapped from IDL interfaces
+There is only one method in a helper class that an application programmer uses:
+the <code>narrow</code> method. Only Java interfaces mapped from IDL interfaces
will have a helper class that includes a <code>narrow</code> method, so in
the <code>PortableServer</code> package, only the following classes have a <code>narrow</code> method:
<UL>
@@ -119,7 +119,7 @@
<H3>Exceptions</H3>
-<P>The <code>ForwardRequest</code> exception indicates to the ORB
+<P>The <code>ForwardRequest</code> exception indicates to the ORB
that it is responsible for delivering the current request and
subsequent <code>ForwardRequest</code> requests to the object denoted in the
<code>forward_reference</code> member of the exception.
@@ -132,7 +132,7 @@
The interfaces of interest to application programmers are the following:
<ul>
<LI><code>AdapterActivator</code>
- <P>Adapter activators are associated with POAs.
+ <P>Adapter activators are associated with POAs.
An adapter activator supplies a POA with the ability to create child POAs on demand,
as a side-effect of receiving a request that names the child POA (or one of its children),
or when <code>find_POA</code> is called with an activate parameter value of <code>TRUE</code>.
@@ -148,10 +148,10 @@
</ul>
-<H2>Package <TT>org.omg.PortableServer.ServantLocatorPackage</TT></H2>
+<H2>Package <code>org.omg.PortableServer.ServantLocatorPackage</code></H2>
-<P>This package supplies a <TT>CookieHolder</TT> class for passing
-the <TT>Cookie</TT> type as an <code>out</code> parameter. The <code>CookieHolder</code> class
+<P>This package supplies a <code>CookieHolder</code> class for passing
+the <code>Cookie</code> type as an <code>out</code> parameter. The <code>CookieHolder</code> class
follows exactly the same pattern as the other holder classes for basic types.
<H2>Related Documentation</H2>
--- a/corba/src/java.corba/share/classes/org/omg/PortableServer/portable/package.html Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/org/omg/PortableServer/portable/package.html Fri Sep 25 12:04:35 2015 -0700
@@ -31,15 +31,15 @@
</head>
<body bgcolor="white">
-Provides classes and interfaces for making the server side of your applications
+Provides classes and interfaces for making the server side of your applications
portable across multivendor ORBs.
-<P>The <tt>portable</tt> package contains interfaces and classes
- that are designed for and intended to be used by an ORB
-implementor. It exposes the publicly defined APIs that
+<P>The <code>portable</code> package contains interfaces and classes
+ that are designed for and intended to be used by an ORB
+implementor. It exposes the publicly defined APIs that
are used to connect stubs and skeletons to the ORB.
- The <tt>Delegate</tt> interface provides the ORB-vendor-specific
- implementation of <tt>PortableServer::Servant</TT>.
+ The <code>Delegate</code> interface provides the ORB-vendor-specific
+ implementation of <code>PortableServer::Servant</code>.
This package conforms CORBA Specification V2.3.1, ptc/00-01-08.
@since 1.4
--- a/corba/src/java.corba/share/classes/org/omg/stub/java/rmi/package.html Thu Sep 17 16:53:42 2015 +0200
+++ b/corba/src/java.corba/share/classes/org/omg/stub/java/rmi/package.html Fri Sep 25 12:04:35 2015 -0700
@@ -30,8 +30,8 @@
-->
</head>
<body bgcolor="white">
- Contains RMI-IIOP Stubs for the Remote types that occur in the
- <tt>java.rmi</tt> package.
+ Contains RMI-IIOP Stubs for the Remote types that occur in the
+ <code>java.rmi</code> package.
@since 1.3
<br>
--- a/hotspot/.hgtags Thu Sep 17 16:53:42 2015 +0200
+++ b/hotspot/.hgtags Fri Sep 25 12:04:35 2015 -0700
@@ -484,3 +484,4 @@
e9e63d93bbfe2c6c23447e2c1f5cc71c98671cba jdk9-b79
8e8377739c06b99b9011c003c77e0bef84c91e09 jdk9-b80
4142c190cd5ca4fb70ec367b4f97ef936272d8ef jdk9-b81
+1c453a12be3036d482abef1dd470f8aff536b6b9 jdk9-b82
--- a/hotspot/make/aix/makefiles/mapfile-vers-debug Thu Sep 17 16:53:42 2015 +0200
+++ b/hotspot/make/aix/makefiles/mapfile-vers-debug Fri Sep 25 12:04:35 2015 -0700
@@ -26,169 +26,6 @@
SUNWprivate_1.1 {
global:
- # JNI
- JNI_CreateJavaVM;
- JNI_GetCreatedJavaVMs;
- JNI_GetDefaultJavaVMInitArgs;
-
- # JVM
- JVM_ActiveProcessorCount;
- JVM_ArrayCopy;
- JVM_AssertionStatusDirectives;
- JVM_ClassDepth;
- JVM_ClassLoaderDepth;
- JVM_Clone;
- JVM_ConstantPoolGetClassAt;
- JVM_ConstantPoolGetClassAtIfLoaded;
- JVM_ConstantPoolGetDoubleAt;
- JVM_ConstantPoolGetFieldAt;
- JVM_ConstantPoolGetFieldAtIfLoaded;
- JVM_ConstantPoolGetFloatAt;
- JVM_ConstantPoolGetIntAt;
- JVM_ConstantPoolGetLongAt;
- JVM_ConstantPoolGetMethodAt;
- JVM_ConstantPoolGetMethodAtIfLoaded;
- JVM_ConstantPoolGetMemberRefInfoAt;
- JVM_ConstantPoolGetSize;
- JVM_ConstantPoolGetStringAt;
- JVM_ConstantPoolGetUTF8At;
- JVM_CountStackFrames;
- JVM_CurrentClassLoader;
- JVM_CurrentLoadedClass;
- JVM_CurrentThread;
- JVM_CurrentTimeMillis;
- JVM_DefineClass;
- JVM_DefineClassWithSource;
- JVM_DefineClassWithSourceCond;
- JVM_DesiredAssertionStatus;
- JVM_DoPrivileged;
- JVM_DumpAllStacks;
- JVM_DumpThreads;
- JVM_FillInStackTrace;
- JVM_FindClassFromCaller;
- JVM_FindClassFromClass;
- JVM_FindClassFromBootLoader;
- JVM_FindLibraryEntry;
- JVM_FindLoadedClass;
- JVM_FindPrimitiveClass;
- JVM_FindSignal;
- JVM_FreeMemory;
- JVM_GC;
- JVM_GetAllThreads;
- JVM_GetArrayElement;
- JVM_GetArrayLength;
- JVM_GetCPClassNameUTF;
- JVM_GetCPFieldClassNameUTF;
- JVM_GetCPFieldModifiers;
- JVM_GetCPFieldNameUTF;
- JVM_GetCPFieldSignatureUTF;
- JVM_GetCPMethodClassNameUTF;
- JVM_GetCPMethodModifiers;
- JVM_GetCPMethodNameUTF;
- JVM_GetCPMethodSignatureUTF;
- JVM_GetCallerClass;
- JVM_GetClassAccessFlags;
- JVM_GetClassAnnotations;
- JVM_GetClassCPEntriesCount;
- JVM_GetClassCPTypes;
- JVM_GetClassConstantPool;
- JVM_GetClassContext;
- JVM_GetClassDeclaredConstructors;
- JVM_GetClassDeclaredFields;
- JVM_GetClassDeclaredMethods;
- JVM_GetClassFieldsCount;
- JVM_GetClassInterfaces;
- JVM_GetClassMethodsCount;
- JVM_GetClassModifiers;
- JVM_GetClassName;
- JVM_GetClassNameUTF;
- JVM_GetClassSignature;
- JVM_GetClassSigners;
- JVM_GetClassTypeAnnotations;
- JVM_GetDeclaredClasses;
- JVM_GetDeclaringClass;
- JVM_GetSimpleBinaryName;
- JVM_GetEnclosingMethodInfo;
- JVM_GetFieldIxModifiers;
- JVM_GetFieldTypeAnnotations;
- JVM_GetInheritedAccessControlContext;
- JVM_GetInterfaceVersion;
- JVM_GetManagement;
- JVM_GetMethodIxArgsSize;
- JVM_GetMethodIxByteCode;
- JVM_GetMethodIxByteCodeLength;
- JVM_GetMethodIxExceptionIndexes;
- JVM_GetMethodIxExceptionTableEntry;
- JVM_GetMethodIxExceptionTableLength;
- JVM_GetMethodIxExceptionsCount;
- JVM_GetMethodIxLocalsCount;
- JVM_GetMethodIxMaxStack;
- JVM_GetMethodIxModifiers;
- JVM_GetMethodIxNameUTF;
- JVM_GetMethodIxSignatureUTF;
- JVM_GetMethodParameters;
- JVM_GetMethodTypeAnnotations;
- JVM_GetNanoTimeAdjustment;
- JVM_GetPrimitiveArrayElement;
- JVM_GetProtectionDomain;
- JVM_GetStackAccessControlContext;
- JVM_GetStackTraceDepth;
- JVM_GetStackTraceElement;
- JVM_GetSystemPackage;
- JVM_GetSystemPackages;
- JVM_GetTemporaryDirectory;
- JVM_GetVersionInfo;
- JVM_Halt;
- JVM_HoldsLock;
- JVM_IHashCode;
- JVM_InitAgentProperties;
- JVM_InitProperties;
- JVM_InternString;
- JVM_Interrupt;
- JVM_InvokeMethod;
- JVM_IsArrayClass;
- JVM_IsConstructorIx;
- JVM_IsInterface;
- JVM_IsInterrupted;
- JVM_IsPrimitiveClass;
- JVM_IsSameClassPackage;
- JVM_IsSupportedJNIVersion;
- JVM_IsThreadAlive;
- JVM_IsVMGeneratedMethodIx;
- JVM_LatestUserDefinedLoader;
- JVM_LoadLibrary;
- JVM_MaxObjectInspectionAge;
- JVM_MaxMemory;
- JVM_MonitorNotify;
- JVM_MonitorNotifyAll;
- JVM_MonitorWait;
- JVM_NanoTime;
- JVM_NativePath;
- JVM_NewArray;
- JVM_NewInstanceFromConstructor;
- JVM_NewMultiArray;
- JVM_RaiseSignal;
- JVM_RawMonitorCreate;
- JVM_RawMonitorDestroy;
- JVM_RawMonitorEnter;
- JVM_RawMonitorExit;
- JVM_RegisterSignal;
- JVM_ReleaseUTF;
- JVM_ResumeThread;
- JVM_SetArrayElement;
- JVM_SetClassSigners;
- JVM_SetNativeThreadName;
- JVM_SetPrimitiveArrayElement;
- JVM_SetProtectionDomain;
- JVM_SetThreadPriority;
- JVM_Sleep;
- JVM_StartThread;
- JVM_StopThread;
- JVM_SuspendThread;
- JVM_SupportsCX8;
- JVM_TotalMemory;
- JVM_UnloadLibrary;
- JVM_Yield;
JVM_handle_linux_signal;
# debug JVM
--- a/hotspot/make/aix/makefiles/mapfile-vers-product Thu Sep 17 16:53:42 2015 +0200
+++ b/hotspot/make/aix/makefiles/mapfile-vers-product Fri Sep 25 12:04:35 2015 -0700
@@ -26,167 +26,6 @@
SUNWprivate_1.1 {
global:
- # JNI
- JNI_CreateJavaVM;
- JNI_GetCreatedJavaVMs;
- JNI_GetDefaultJavaVMInitArgs;
-
- # JVM
- JVM_ActiveProcessorCount;
- JVM_ArrayCopy;
- JVM_AssertionStatusDirectives;
- JVM_ClassDepth;
- JVM_ClassLoaderDepth;
- JVM_Clone;
- JVM_ConstantPoolGetClassAt;
- JVM_ConstantPoolGetClassAtIfLoaded;
- JVM_ConstantPoolGetDoubleAt;
- JVM_ConstantPoolGetFieldAt;
- JVM_ConstantPoolGetFieldAtIfLoaded;
- JVM_ConstantPoolGetFloatAt;
- JVM_ConstantPoolGetIntAt;
- JVM_ConstantPoolGetLongAt;
- JVM_ConstantPoolGetMethodAt;
- JVM_ConstantPoolGetMethodAtIfLoaded;
- JVM_ConstantPoolGetMemberRefInfoAt;
- JVM_ConstantPoolGetSize;
- JVM_ConstantPoolGetStringAt;
- JVM_ConstantPoolGetUTF8At;
- JVM_CountStackFrames;
- JVM_CurrentClassLoader;
- JVM_CurrentLoadedClass;
- JVM_CurrentThread;
- JVM_CurrentTimeMillis;
- JVM_DefineClass;
- JVM_DefineClassWithSource;
- JVM_DefineClassWithSourceCond;
- JVM_DesiredAssertionStatus;
- JVM_DoPrivileged;
- JVM_DumpAllStacks;
- JVM_DumpThreads;
- JVM_FillInStackTrace;
- JVM_FindClassFromCaller;
- JVM_FindClassFromClass;
- JVM_FindClassFromBootLoader;
- JVM_FindLibraryEntry;
- JVM_FindLoadedClass;
- JVM_FindPrimitiveClass;
- JVM_FindSignal;
- JVM_FreeMemory;
- JVM_GC;
- JVM_GetAllThreads;
- JVM_GetArrayElement;
- JVM_GetArrayLength;
- JVM_GetCPClassNameUTF;
- JVM_GetCPFieldClassNameUTF;
- JVM_GetCPFieldModifiers;
- JVM_GetCPFieldNameUTF;
- JVM_GetCPFieldSignatureUTF;
- JVM_GetCPMethodClassNameUTF;
- JVM_GetCPMethodModifiers;
- JVM_GetCPMethodNameUTF;
- JVM_GetCPMethodSignatureUTF;
- JVM_GetCallerClass;
- JVM_GetClassAccessFlags;
- JVM_GetClassAnnotations;
- JVM_GetClassCPEntriesCount;
- JVM_GetClassCPTypes;
- JVM_GetClassConstantPool;
- JVM_GetClassContext;
- JVM_GetClassDeclaredConstructors;
- JVM_GetClassDeclaredFields;
- JVM_GetClassDeclaredMethods;
- JVM_GetClassFieldsCount;
- JVM_GetClassInterfaces;
- JVM_GetClassMethodsCount;
- JVM_GetClassModifiers;
- JVM_GetClassName;
- JVM_GetClassNameUTF;
- JVM_GetClassSignature;
- JVM_GetClassSigners;
- JVM_GetClassTypeAnnotations;
- JVM_GetDeclaredClasses;
- JVM_GetDeclaringClass;
- JVM_GetSimpleBinaryName;
- JVM_GetEnclosingMethodInfo;
- JVM_GetFieldIxModifiers;
- JVM_GetInheritedAccessControlContext;
- JVM_GetInterfaceVersion;
- JVM_GetManagement;
- JVM_GetMethodIxArgsSize;
- JVM_GetMethodIxByteCode;
- JVM_GetMethodIxByteCodeLength;
- JVM_GetMethodIxExceptionIndexes;
- JVM_GetMethodIxExceptionTableEntry;
- JVM_GetMethodIxExceptionTableLength;
- JVM_GetMethodIxExceptionsCount;
- JVM_GetMethodIxLocalsCount;
- JVM_GetMethodIxMaxStack;
- JVM_GetMethodIxModifiers;
- JVM_GetMethodIxNameUTF;
- JVM_GetMethodIxSignatureUTF;
- JVM_GetMethodParameters;
- JVM_GetNanoTimeAdjustment;
- JVM_GetPrimitiveArrayElement;
- JVM_GetProtectionDomain;
- JVM_GetStackAccessControlContext;
- JVM_GetStackTraceDepth;
- JVM_GetStackTraceElement;
- JVM_GetSystemPackage;
- JVM_GetSystemPackages;
- JVM_GetTemporaryDirectory;
- JVM_GetVersionInfo;
- JVM_Halt;
- JVM_HoldsLock;
- JVM_IHashCode;
- JVM_InitAgentProperties;
- JVM_InitProperties;
- JVM_InternString;
- JVM_Interrupt;
- JVM_InvokeMethod;
- JVM_IsArrayClass;
- JVM_IsConstructorIx;
- JVM_IsInterface;
- JVM_IsInterrupted;
- JVM_IsPrimitiveClass;
- JVM_IsSameClassPackage;
- JVM_IsSupportedJNIVersion;
- JVM_IsThreadAlive;
- JVM_IsVMGeneratedMethodIx;
- JVM_LatestUserDefinedLoader;
- JVM_LoadLibrary;
- JVM_MaxObjectInspectionAge;
- JVM_MaxMemory;
- JVM_MonitorNotify;
- JVM_MonitorNotifyAll;
- JVM_MonitorWait;
- JVM_NanoTime;
- JVM_NativePath;
- JVM_NewArray;
- JVM_NewInstanceFromConstructor;
- JVM_NewMultiArray;
- JVM_RaiseSignal;
- JVM_RawMonitorCreate;
- JVM_RawMonitorDestroy;
- JVM_RawMonitorEnter;
- JVM_RawMonitorExit;
- JVM_RegisterSignal;
- JVM_ReleaseUTF;
- JVM_ResumeThread;
- JVM_SetArrayElement;
- JVM_SetClassSigners;
- JVM_SetNativeThreadName;
- JVM_SetPrimitiveArrayElement;
- JVM_SetProtectionDomain;
- JVM_SetThreadPriority;
- JVM_Sleep;
- JVM_StartThread;
- JVM_StopThread;
- JVM_SuspendThread;
- JVM_SupportsCX8;
- JVM_TotalMemory;
- JVM_UnloadLibrary;
- JVM_Yield;
JVM_handle_linux_signal;
# miscellaneous functions
--- a/hotspot/make/aix/makefiles/vm.make Thu Sep 17 16:53:42 2015 +0200
+++ b/hotspot/make/aix/makefiles/vm.make Fri Sep 25 12:04:35 2015 -0700
@@ -220,10 +220,12 @@
vm_version.o: $(filter-out vm_version.o,$(JVM_OBJ_FILES))
-mapfile : $(MAPFILE) vm.def
+MAPFILE_SHARE := $(GAMMADIR)/make/share/makefiles/mapfile-vers
+
+mapfile : $(MAPFILE) $(MAPFILE_SHARE) vm.def
rm -f $@
awk '{ if ($$0 ~ "INSERT VTABLE SYMBOLS HERE") \
- { system ("cat vm.def"); } \
+ { system ("cat ${MAPFILE_SHARE} vm.def"); } \
else \
{ print $$0 } \
}' > $@ < $(MAPFILE)
--- a/hotspot/make/bsd/makefiles/mapfile-vers-darwin-debug Thu Sep 17 16:53:42 2015 +0200
+++ b/hotspot/make/bsd/makefiles/mapfile-vers-darwin-debug Fri Sep 25 12:04:35 2015 -0700
@@ -24,171 +24,9 @@
# Only used for OSX/Darwin builds
# Define public interface.
- # _JNI
- _JNI_CreateJavaVM
- _JNI_GetCreatedJavaVMs
- _JNI_GetDefaultJavaVMInitArgs
-
- # _JVM
- _JVM_ActiveProcessorCount
- _JVM_ArrayCopy
- _JVM_AssertionStatusDirectives
- _JVM_ClassDepth
- _JVM_ClassLoaderDepth
- _JVM_Clone
- _JVM_ConstantPoolGetClassAt
- _JVM_ConstantPoolGetClassAtIfLoaded
- _JVM_ConstantPoolGetDoubleAt
- _JVM_ConstantPoolGetFieldAt
- _JVM_ConstantPoolGetFieldAtIfLoaded
- _JVM_ConstantPoolGetFloatAt
- _JVM_ConstantPoolGetIntAt
- _JVM_ConstantPoolGetLongAt
- _JVM_ConstantPoolGetMethodAt
- _JVM_ConstantPoolGetMethodAtIfLoaded
- _JVM_ConstantPoolGetMemberRefInfoAt
- _JVM_ConstantPoolGetSize
- _JVM_ConstantPoolGetStringAt
- _JVM_ConstantPoolGetUTF8At
- _JVM_CountStackFrames
- _JVM_CurrentClassLoader
- _JVM_CurrentLoadedClass
- _JVM_CurrentThread
- _JVM_CurrentTimeMillis
- _JVM_DefineClass
- _JVM_DefineClassWithSource
- _JVM_DefineClassWithSourceCond
- _JVM_DesiredAssertionStatus
- _JVM_DoPrivileged
- _JVM_DumpAllStacks
- _JVM_DumpThreads
- _JVM_FillInStackTrace
- _JVM_FindClassFromCaller
- _JVM_FindClassFromClass
- _JVM_FindClassFromBootLoader
- _JVM_FindLibraryEntry
- _JVM_FindLoadedClass
- _JVM_FindPrimitiveClass
- _JVM_FindSignal
- _JVM_FreeMemory
- _JVM_GC
- _JVM_GetAllThreads
- _JVM_GetArrayElement
- _JVM_GetArrayLength
- _JVM_GetCPClassNameUTF
- _JVM_GetCPFieldClassNameUTF
- _JVM_GetCPFieldModifiers
- _JVM_GetCPFieldNameUTF
- _JVM_GetCPFieldSignatureUTF
- _JVM_GetCPMethodClassNameUTF
- _JVM_GetCPMethodModifiers
- _JVM_GetCPMethodNameUTF
- _JVM_GetCPMethodSignatureUTF
- _JVM_GetCallerClass
- _JVM_GetClassAccessFlags
- _JVM_GetClassAnnotations
- _JVM_GetClassCPEntriesCount
- _JVM_GetClassCPTypes
- _JVM_GetClassConstantPool
- _JVM_GetClassContext
- _JVM_GetClassDeclaredConstructors
- _JVM_GetClassDeclaredFields
- _JVM_GetClassDeclaredMethods
- _JVM_GetClassFieldsCount
- _JVM_GetClassInterfaces
- _JVM_GetClassMethodsCount
- _JVM_GetClassModifiers
- _JVM_GetClassName
- _JVM_GetClassNameUTF
- _JVM_GetClassSignature
- _JVM_GetClassSigners
- _JVM_GetClassTypeAnnotations
- _JVM_GetDeclaredClasses
- _JVM_GetDeclaringClass
- _JVM_GetSimpleBinaryName
- _JVM_GetEnclosingMethodInfo
- _JVM_GetFieldIxModifiers
- _JVM_GetFieldTypeAnnotations
- _JVM_GetInheritedAccessControlContext
- _JVM_GetInterfaceVersion
- _JVM_GetManagement
- _JVM_GetMethodIxArgsSize
- _JVM_GetMethodIxByteCode
- _JVM_GetMethodIxByteCodeLength
- _JVM_GetMethodIxExceptionIndexes
- _JVM_GetMethodIxExceptionTableEntry
- _JVM_GetMethodIxExceptionTableLength
- _JVM_GetMethodIxExceptionsCount
- _JVM_GetMethodIxLocalsCount
- _JVM_GetMethodIxMaxStack
- _JVM_GetMethodIxModifiers
- _JVM_GetMethodIxNameUTF
- _JVM_GetMethodIxSignatureUTF
- _JVM_GetMethodParameters
- _JVM_GetMethodTypeAnnotations
- _JVM_GetNanoTimeAdjustment
- _JVM_GetPrimitiveArrayElement
- _JVM_GetProtectionDomain
- _JVM_GetStackAccessControlContext
- _JVM_GetStackTraceDepth
- _JVM_GetStackTraceElement
- _JVM_GetSystemPackage
- _JVM_GetSystemPackages
- _JVM_GetTemporaryDirectory
- _JVM_GetVersionInfo
- _JVM_Halt
- _JVM_HoldsLock
- _JVM_IHashCode
- _JVM_InitAgentProperties
- _JVM_InitProperties
- _JVM_InternString
- _JVM_Interrupt
- _JVM_InvokeMethod
- _JVM_IsArrayClass
- _JVM_IsConstructorIx
- _JVM_IsInterface
- _JVM_IsInterrupted
- _JVM_IsPrimitiveClass
- _JVM_IsSameClassPackage
- _JVM_IsSupportedJNIVersion
- _JVM_IsThreadAlive
- _JVM_IsVMGeneratedMethodIx
- _JVM_LatestUserDefinedLoader
- _JVM_LoadLibrary
- _JVM_MaxObjectInspectionAge
- _JVM_MaxMemory
- _JVM_MonitorNotify
- _JVM_MonitorNotifyAll
- _JVM_MonitorWait
- _JVM_NanoTime
- _JVM_NativePath
- _JVM_NewArray
- _JVM_NewInstanceFromConstructor
- _JVM_NewMultiArray
- _JVM_RaiseSignal
- _JVM_RawMonitorCreate
- _JVM_RawMonitorDestroy
- _JVM_RawMonitorEnter
- _JVM_RawMonitorExit
- _JVM_RegisterSignal
- _JVM_ReleaseUTF
- _JVM_ResumeThread
- _JVM_SetArrayElement
- _JVM_SetClassSigners
- _JVM_SetNativeThreadName
- _JVM_SetPrimitiveArrayElement
- _JVM_SetThreadPriority
- _JVM_Sleep
- _JVM_StartThread
- _JVM_StopThread
- _JVM_SuspendThread
- _JVM_SupportsCX8
- _JVM_TotalMemory
- _JVM_UnloadLibrary
- _JVM_Yield
_JVM_handle_bsd_signal
- # miscellaneous functions
+ # miscellaneous functions
_jio_fprintf
_jio_printf
_jio_snprintf
--- a/hotspot/make/bsd/makefiles/mapfile-vers-darwin-product Thu Sep 17 16:53:42 2015 +0200
+++ b/hotspot/make/bsd/makefiles/mapfile-vers-darwin-product Fri Sep 25 12:04:35 2015 -0700
@@ -24,168 +24,6 @@
# Only used for OSX/Darwin builds
# Define public interface.
- # _JNI
- _JNI_CreateJavaVM
- _JNI_GetCreatedJavaVMs
- _JNI_GetDefaultJavaVMInitArgs
-
- # _JVM
- _JVM_ActiveProcessorCount
- _JVM_ArrayCopy
- _JVM_AssertionStatusDirectives
- _JVM_ClassDepth
- _JVM_ClassLoaderDepth
- _JVM_Clone
- _JVM_ConstantPoolGetClassAt
- _JVM_ConstantPoolGetClassAtIfLoaded
- _JVM_ConstantPoolGetDoubleAt
- _JVM_ConstantPoolGetFieldAt
- _JVM_ConstantPoolGetFieldAtIfLoaded
- _JVM_ConstantPoolGetFloatAt
- _JVM_ConstantPoolGetIntAt
- _JVM_ConstantPoolGetLongAt
- _JVM_ConstantPoolGetMethodAt
- _JVM_ConstantPoolGetMethodAtIfLoaded
- _JVM_ConstantPoolGetMemberRefInfoAt
- _JVM_ConstantPoolGetSize
- _JVM_ConstantPoolGetStringAt
- _JVM_ConstantPoolGetUTF8At
- _JVM_CountStackFrames
- _JVM_CurrentClassLoader
- _JVM_CurrentLoadedClass
- _JVM_CurrentThread
- _JVM_CurrentTimeMillis
- _JVM_DefineClass
- _JVM_DefineClassWithSource
- _JVM_DefineClassWithSourceCond
- _JVM_DesiredAssertionStatus
- _JVM_DoPrivileged
- _JVM_DumpAllStacks
- _JVM_DumpThreads
- _JVM_FillInStackTrace
- _JVM_FindClassFromCaller
- _JVM_FindClassFromClass
- _JVM_FindClassFromBootLoader
- _JVM_FindLibraryEntry
- _JVM_FindLoadedClass
- _JVM_FindPrimitiveClass
- _JVM_FindSignal
- _JVM_FreeMemory
- _JVM_GC
- _JVM_GetAllThreads
- _JVM_GetArrayElement
- _JVM_GetArrayLength
- _JVM_GetCPClassNameUTF
- _JVM_GetCPFieldClassNameUTF
- _JVM_GetCPFieldModifiers
- _JVM_GetCPFieldNameUTF
- _JVM_GetCPFieldSignatureUTF
- _JVM_GetCPMethodClassNameUTF
- _JVM_GetCPMethodModifiers
- _JVM_GetCPMethodNameUTF
- _JVM_GetCPMethodSignatureUTF
- _JVM_GetCallerClass
- _JVM_GetClassAccessFlags
- _JVM_GetClassAnnotations
- _JVM_GetClassCPEntriesCount
- _JVM_GetClassCPTypes
- _JVM_GetClassConstantPool
- _JVM_GetClassContext
- _JVM_GetClassDeclaredConstructors
- _JVM_GetClassDeclaredFields
- _JVM_GetClassDeclaredMethods
- _JVM_GetClassFieldsCount
- _JVM_GetClassInterfaces
- _JVM_GetClassMethodsCount
- _JVM_GetClassModifiers
- _JVM_GetClassName
- _JVM_GetClassNameUTF
- _JVM_GetClassSignature
- _JVM_GetClassSigners
- _JVM_GetClassTypeAnnotations
- _JVM_GetDeclaredClasses
- _JVM_GetDeclaringClass
- _JVM_GetSimpleBinaryName
- _JVM_GetEnclosingMethodInfo
- _JVM_GetFieldIxModifiers
- _JVM_GetFieldTypeAnnotations
- _JVM_GetInheritedAccessControlContext
- _JVM_GetInterfaceVersion
- _JVM_GetManagement
- _JVM_GetMethodIxArgsSize
- _JVM_GetMethodIxByteCode
- _JVM_GetMethodIxByteCodeLength
- _JVM_GetMethodIxExceptionIndexes
- _JVM_GetMethodIxExceptionTableEntry
- _JVM_GetMethodIxExceptionTableLength
- _JVM_GetMethodIxExceptionsCount
- _JVM_GetMethodIxLocalsCount
- _JVM_GetMethodIxMaxStack
- _JVM_GetMethodIxModifiers
- _JVM_GetMethodIxNameUTF
- _JVM_GetMethodIxSignatureUTF
- _JVM_GetMethodParameters
- _JVM_GetMethodTypeAnnotations
- _JVM_GetNanoTimeAdjustment
- _JVM_GetPrimitiveArrayElement
- _JVM_GetProtectionDomain
- _JVM_GetStackAccessControlContext
- _JVM_GetStackTraceDepth
- _JVM_GetStackTraceElement
- _JVM_GetSystemPackage
- _JVM_GetSystemPackages
- _JVM_GetTemporaryDirectory
- _JVM_GetVersionInfo
- _JVM_Halt
- _JVM_HoldsLock
- _JVM_IHashCode
- _JVM_InitAgentProperties
- _JVM_InitProperties
- _JVM_InternString
- _JVM_Interrupt
- _JVM_InvokeMethod
- _JVM_IsArrayClass
- _JVM_IsConstructorIx
- _JVM_IsInterface
- _JVM_IsInterrupted
- _JVM_IsPrimitiveClass
- _JVM_IsSameClassPackage
- _JVM_IsSupportedJNIVersion
- _JVM_IsThreadAlive
- _JVM_IsVMGeneratedMethodIx
- _JVM_LatestUserDefinedLoader
- _JVM_LoadLibrary
- _JVM_MaxObjectInspectionAge
- _JVM_MaxMemory
- _JVM_MonitorNotify
- _JVM_MonitorNotifyAll
- _JVM_MonitorWait
- _JVM_NanoTime
- _JVM_NativePath
- _JVM_NewArray
- _JVM_NewInstanceFromConstructor
- _JVM_NewMultiArray
- _JVM_RaiseSignal
- _JVM_RawMonitorCreate
- _JVM_RawMonitorDestroy
- _JVM_RawMonitorEnter
- _JVM_RawMonitorExit
- _JVM_RegisterSignal
- _JVM_ReleaseUTF
- _JVM_ResumeThread
- _JVM_SetArrayElement
- _JVM_SetClassSigners
- _JVM_SetNativeThreadName
- _JVM_SetPrimitiveArrayElement
- _JVM_SetThreadPriority
- _JVM_Sleep
- _JVM_StartThread
- _JVM_StopThread
- _JVM_SuspendThread
- _JVM_SupportsCX8
- _JVM_TotalMemory
- _JVM_UnloadLibrary
- _JVM_Yield
_JVM_handle_bsd_signal
# miscellaneous functions
--- a/hotspot/make/bsd/makefiles/mapfile-vers-debug Thu Sep 17 16:53:42 2015 +0200
+++ b/hotspot/make/bsd/makefiles/mapfile-vers-debug Fri Sep 25 12:04:35 2015 -0700
@@ -26,168 +26,6 @@
SUNWprivate_1.1 {
global:
- # JNI
- JNI_CreateJavaVM;
- JNI_GetCreatedJavaVMs;
- JNI_GetDefaultJavaVMInitArgs;
-
- # JVM
- JVM_ActiveProcessorCount;
- JVM_ArrayCopy;
- JVM_AssertionStatusDirectives;
- JVM_ClassDepth;
- JVM_ClassLoaderDepth;
- JVM_Clone;
- JVM_ConstantPoolGetClassAt;
- JVM_ConstantPoolGetClassAtIfLoaded;
- JVM_ConstantPoolGetDoubleAt;
- JVM_ConstantPoolGetFieldAt;
- JVM_ConstantPoolGetFieldAtIfLoaded;
- JVM_ConstantPoolGetFloatAt;
- JVM_ConstantPoolGetIntAt;
- JVM_ConstantPoolGetLongAt;
- JVM_ConstantPoolGetMethodAt;
- JVM_ConstantPoolGetMethodAtIfLoaded;
- JVM_ConstantPoolGetMemberRefInfoAt;
- JVM_ConstantPoolGetSize;
- JVM_ConstantPoolGetStringAt;
- JVM_ConstantPoolGetUTF8At;
- JVM_CountStackFrames;
- JVM_CurrentClassLoader;
- JVM_CurrentLoadedClass;
- JVM_CurrentThread;
- JVM_CurrentTimeMillis;
- JVM_DefineClass;
- JVM_DefineClassWithSource;
- JVM_DefineClassWithSourceCond;
- JVM_DesiredAssertionStatus;
- JVM_DoPrivileged;
- JVM_DumpAllStacks;
- JVM_DumpThreads;
- JVM_FillInStackTrace;
- JVM_FindClassFromCaller;
- JVM_FindClassFromClass;
- JVM_FindClassFromBootLoader;
- JVM_FindLibraryEntry;
- JVM_FindLoadedClass;
- JVM_FindPrimitiveClass;
- JVM_FindSignal;
- JVM_FreeMemory;
- JVM_GC;
- JVM_GetAllThreads;
- JVM_GetArrayElement;
- JVM_GetArrayLength;
- JVM_GetCPClassNameUTF;
- JVM_GetCPFieldClassNameUTF;
- JVM_GetCPFieldModifiers;
- JVM_GetCPFieldNameUTF;
- JVM_GetCPFieldSignatureUTF;
- JVM_GetCPMethodClassNameUTF;
- JVM_GetCPMethodModifiers;
- JVM_GetCPMethodNameUTF;
- JVM_GetCPMethodSignatureUTF;
- JVM_GetCallerClass;
- JVM_GetClassAccessFlags;
- JVM_GetClassAnnotations;
- JVM_GetClassCPEntriesCount;
- JVM_GetClassCPTypes;
- JVM_GetClassConstantPool;
- JVM_GetClassContext;
- JVM_GetClassDeclaredConstructors;
- JVM_GetClassDeclaredFields;
- JVM_GetClassDeclaredMethods;
- JVM_GetClassFieldsCount;
- JVM_GetClassInterfaces;
- JVM_GetClassMethodsCount;
- JVM_GetClassModifiers;
- JVM_GetClassName;
- JVM_GetClassNameUTF;
- JVM_GetClassSignature;
- JVM_GetClassSigners;
- JVM_GetClassTypeAnnotations;
- JVM_GetDeclaredClasses;
- JVM_GetDeclaringClass;
- JVM_GetSimpleBinaryName;
- JVM_GetEnclosingMethodInfo;
- JVM_GetFieldIxModifiers;
- JVM_GetFieldTypeAnnotations;
- JVM_GetInheritedAccessControlContext;
- JVM_GetInterfaceVersion;
- JVM_GetManagement;
- JVM_GetMethodIxArgsSize;
- JVM_GetMethodIxByteCode;
- JVM_GetMethodIxByteCodeLength;
- JVM_GetMethodIxExceptionIndexes;
- JVM_GetMethodIxExceptionTableEntry;
- JVM_GetMethodIxExceptionTableLength;
- JVM_GetMethodIxExceptionsCount;
- JVM_GetMethodIxLocalsCount;
- JVM_GetMethodIxMaxStack;
- JVM_GetMethodIxModifiers;
- JVM_GetMethodIxNameUTF;
- JVM_GetMethodIxSignatureUTF;
- JVM_GetMethodParameters;
- JVM_GetMethodTypeAnnotations;
- JVM_GetNanoTimeAdjustment;
- JVM_GetPrimitiveArrayElement;
- JVM_GetProtectionDomain;
- JVM_GetStackAccessControlContext;
- JVM_GetStackTraceDepth;
- JVM_GetStackTraceElement;
- JVM_GetSystemPackage;
- JVM_GetSystemPackages;
- JVM_GetTemporaryDirectory;
- JVM_GetVersionInfo;
- JVM_Halt;
- JVM_HoldsLock;
- JVM_IHashCode;
- JVM_InitAgentProperties;
- JVM_InitProperties;
- JVM_InternString;
- JVM_Interrupt;
- JVM_InvokeMethod;
- JVM_IsArrayClass;
- JVM_IsConstructorIx;
- JVM_IsInterface;
- JVM_IsInterrupted;
- JVM_IsPrimitiveClass;
- JVM_IsSameClassPackage;
- JVM_IsSupportedJNIVersion;
- JVM_IsThreadAlive;
- JVM_IsVMGeneratedMethodIx;
- JVM_LatestUserDefinedLoader;
- JVM_LoadLibrary;
- JVM_MaxObjectInspectionAge;
- JVM_MaxMemory;
- JVM_MonitorNotify;
- JVM_MonitorNotifyAll;
- JVM_MonitorWait;
- JVM_NanoTime;
- JVM_NativePath;
- JVM_NewArray;
- JVM_NewInstanceFromConstructor;
- JVM_NewMultiArray;
- JVM_RaiseSignal;
- JVM_RawMonitorCreate;
- JVM_RawMonitorDestroy;
- JVM_RawMonitorEnter;
- JVM_RawMonitorExit;
- JVM_RegisterSignal;
- JVM_ReleaseUTF;
- JVM_ResumeThread;
- JVM_SetArrayElement;
- JVM_SetClassSigners;
- JVM_SetNativeThreadName;
- JVM_SetPrimitiveArrayElement;
- JVM_SetThreadPriority;
- JVM_Sleep;
- JVM_StartThread;
- JVM_StopThread;
- JVM_SuspendThread;
- JVM_SupportsCX8;
- JVM_TotalMemory;
- JVM_UnloadLibrary;
- JVM_Yield;
JVM_handle_linux_signal;
# miscellaneous functions
--- a/hotspot/make/bsd/makefiles/mapfile-vers-product Thu Sep 17 16:53:42 2015 +0200
+++ b/hotspot/make/bsd/makefiles/mapfile-vers-product Fri Sep 25 12:04:35 2015 -0700
@@ -26,168 +26,6 @@
SUNWprivate_1.1 {
global:
- # JNI
- JNI_CreateJavaVM;
- JNI_GetCreatedJavaVMs;
- JNI_GetDefaultJavaVMInitArgs;
-
- # JVM
- JVM_ActiveProcessorCount;
- JVM_ArrayCopy;
- JVM_AssertionStatusDirectives;
- JVM_ClassDepth;
- JVM_ClassLoaderDepth;
- JVM_Clone;
- JVM_ConstantPoolGetClassAt;
- JVM_ConstantPoolGetClassAtIfLoaded;
- JVM_ConstantPoolGetDoubleAt;
- JVM_ConstantPoolGetFieldAt;
- JVM_ConstantPoolGetFieldAtIfLoaded;
- JVM_ConstantPoolGetFloatAt;
- JVM_ConstantPoolGetIntAt;
- JVM_ConstantPoolGetLongAt;
- JVM_ConstantPoolGetMethodAt;
- JVM_ConstantPoolGetMethodAtIfLoaded;
- JVM_ConstantPoolGetMemberRefInfoAt;
- JVM_ConstantPoolGetSize;
- JVM_ConstantPoolGetStringAt;
- JVM_ConstantPoolGetUTF8At;
- JVM_CountStackFrames;
- JVM_CurrentClassLoader;
- JVM_CurrentLoadedClass;
- JVM_CurrentThread;
- JVM_CurrentTimeMillis;
- JVM_DefineClass;
- JVM_DefineClassWithSource;
- JVM_DefineClassWithSourceCond;
- JVM_DesiredAssertionStatus;
- JVM_DoPrivileged;
- JVM_DumpAllStacks;
- JVM_DumpThreads;
- JVM_FillInStackTrace;
- JVM_FindClassFromCaller;
- JVM_FindClassFromClass;
- JVM_FindClassFromBootLoader;
- JVM_FindLibraryEntry;
- JVM_FindLoadedClass;
- JVM_FindPrimitiveClass;
- JVM_FindSignal;
- JVM_FreeMemory;
- JVM_GC;
- JVM_GetAllThreads;
- JVM_GetArrayElement;
- JVM_GetArrayLength;
- JVM_GetCPClassNameUTF;
- JVM_GetCPFieldClassNameUTF;
- JVM_GetCPFieldModifiers;
- JVM_GetCPFieldNameUTF;
- JVM_GetCPFieldSignatureUTF;
- JVM_GetCPMethodClassNameUTF;
- JVM_GetCPMethodModifiers;
- JVM_GetCPMethodNameUTF;
- JVM_GetCPMethodSignatureUTF;
- JVM_GetCallerClass;
- JVM_GetClassAccessFlags;
- JVM_GetClassAnnotations;
- JVM_GetClassCPEntriesCount;
- JVM_GetClassCPTypes;
- JVM_GetClassConstantPool;
- JVM_GetClassContext;
- JVM_GetClassDeclaredConstructors;
- JVM_GetClassDeclaredFields;
- JVM_GetClassDeclaredMethods;
- JVM_GetClassFieldsCount;
- JVM_GetClassInterfaces;
- JVM_GetClassMethodsCount;
- JVM_GetClassModifiers;
- JVM_GetClassName;
- JVM_GetClassNameUTF;
- JVM_GetClassSignature;
- JVM_GetClassSigners;
- JVM_GetClassTypeAnnotations;
- JVM_GetDeclaredClasses;
- JVM_GetDeclaringClass;
- JVM_GetSimpleBinaryName;
- JVM_GetEnclosingMethodInfo;
- JVM_GetFieldIxModifiers;
- JVM_GetFieldTypeAnnotations;
- JVM_GetInheritedAccessControlContext;
- JVM_GetInterfaceVersion;
- JVM_GetManagement;
- JVM_GetMethodIxArgsSize;
- JVM_GetMethodIxByteCode;
- JVM_GetMethodIxByteCodeLength;
- JVM_GetMethodIxExceptionIndexes;
- JVM_GetMethodIxExceptionTableEntry;
- JVM_GetMethodIxExceptionTableLength;
- JVM_GetMethodIxExceptionsCount;
- JVM_GetMethodIxLocalsCount;
- JVM_GetMethodIxMaxStack;
- JVM_GetMethodIxModifiers;
- JVM_GetMethodIxNameUTF;
- JVM_GetMethodIxSignatureUTF;
- JVM_GetMethodParameters;
- JVM_GetMethodTypeAnnotations;
- JVM_GetNanoTimeAdjustment;
- JVM_GetPrimitiveArrayElement;
- JVM_GetProtectionDomain;
- JVM_GetStackAccessControlContext;
- JVM_GetStackTraceDepth;
- JVM_GetStackTraceElement;
- JVM_GetSystemPackage;
- JVM_GetSystemPackages;
- JVM_GetTemporaryDirectory;
- JVM_GetVersionInfo;
- JVM_Halt;
- JVM_HoldsLock;
- JVM_IHashCode;
- JVM_InitAgentProperties;
- JVM_InitProperties;
- JVM_InternString;
- JVM_Interrupt;
- JVM_InvokeMethod;
- JVM_IsArrayClass;
- JVM_IsConstructorIx;
- JVM_IsInterface;
- JVM_IsInterrupted;
- JVM_IsPrimitiveClass;
- JVM_IsSameClassPackage;
- JVM_IsSupportedJNIVersion;
- JVM_IsThreadAlive;
- JVM_IsVMGeneratedMethodIx;
- JVM_LatestUserDefinedLoader;
- JVM_LoadLibrary;
- JVM_MaxObjectInspectionAge;
- JVM_MaxMemory;
- JVM_MonitorNotify;
- JVM_MonitorNotifyAll;
- JVM_MonitorWait;
- JVM_NanoTime;
- JVM_NativePath;
- JVM_NewArray;
- JVM_NewInstanceFromConstructor;
- JVM_NewMultiArray;
- JVM_RaiseSignal;
- JVM_RawMonitorCreate;
- JVM_RawMonitorDestroy;
- JVM_RawMonitorEnter;
- JVM_RawMonitorExit;
- JVM_RegisterSignal;
- JVM_ReleaseUTF;
- JVM_ResumeThread;
- JVM_SetArrayElement;
- JVM_SetClassSigners;
- JVM_SetNativeThreadName;
- JVM_SetPrimitiveArrayElement;
- JVM_SetThreadPriority;
- JVM_Sleep;
- JVM_StartThread;
- JVM_StopThread;
- JVM_SuspendThread;
- JVM_SupportsCX8;
- JVM_TotalMemory;
- JVM_UnloadLibrary;
- JVM_Yield;
JVM_handle_linux_signal;
# miscellaneous functions
--- a/hotspot/make/bsd/makefiles/vm.make Thu Sep 17 16:53:42 2015 +0200
+++ b/hotspot/make/bsd/makefiles/vm.make Fri Sep 25 12:04:35 2015 -0700
@@ -234,10 +234,29 @@
vm_version.o: $(filter-out vm_version.o,$(JVM_OBJ_FILES))
-mapfile : $(MAPFILE) vm.def mapfile_ext
+MAPFILE_SHARE := $(GAMMADIR)/make/share/makefiles/mapfile-vers
+
+MAPFILE_EXT_SRC := $(HS_ALT_MAKE)/share/makefiles/mapfile-ext
+ifneq ("$(wildcard $(MAPFILE_EXT_SRC))","")
+MAPFILE_EXT := $(MAPFILE_EXT_SRC)
+endif
+
+# For Darwin: add _ prefix and remove trailing ;
+mapfile_extra: $(MAPFILE_SHARE) $(MAPFILE_EXT)
+ rm -f $@
+ifeq ($(OS_VENDOR), Darwin)
+ cat $(MAPFILE_SHARE) $(MAPFILE_EXT) | \
+ sed -e 's/#.*//g' -e 's/[ ]*//g' -e 's/;//g' | \
+ awk '{ if ($$0 ~ ".") { print "\t\t_" $$0 } }' \
+ > $@
+else
+ cat $(MAPFILE_SHARE) $(MAPFILE_EXT) > $@
+endif
+
+mapfile : $(MAPFILE) mapfile_extra vm.def
rm -f $@
awk '{ if ($$0 ~ "INSERT VTABLE SYMBOLS HERE") \
- { system ("cat mapfile_ext"); system ("cat vm.def"); } \
+ { system ("cat mapfile_extra vm.def"); } \
else \
{ print $$0 } \
}' > $@ < $(MAPFILE)
--- a/hotspot/make/linux/makefiles/mapfile-vers-debug Thu Sep 17 16:53:42 2015 +0200
+++ b/hotspot/make/linux/makefiles/mapfile-vers-debug Fri Sep 25 12:04:35 2015 -0700
@@ -26,168 +26,6 @@
SUNWprivate_1.1 {
global:
- # JNI
- JNI_CreateJavaVM;
- JNI_GetCreatedJavaVMs;
- JNI_GetDefaultJavaVMInitArgs;
-
- # JVM
- JVM_ActiveProcessorCount;
- JVM_ArrayCopy;
- JVM_AssertionStatusDirectives;
- JVM_ClassDepth;
- JVM_ClassLoaderDepth;
- JVM_Clone;
- JVM_ConstantPoolGetClassAt;
- JVM_ConstantPoolGetClassAtIfLoaded;
- JVM_ConstantPoolGetDoubleAt;
- JVM_ConstantPoolGetFieldAt;
- JVM_ConstantPoolGetFieldAtIfLoaded;
- JVM_ConstantPoolGetFloatAt;
- JVM_ConstantPoolGetIntAt;
- JVM_ConstantPoolGetLongAt;
- JVM_ConstantPoolGetMethodAt;
- JVM_ConstantPoolGetMethodAtIfLoaded;
- JVM_ConstantPoolGetMemberRefInfoAt;
- JVM_ConstantPoolGetSize;
- JVM_ConstantPoolGetStringAt;
- JVM_ConstantPoolGetUTF8At;
- JVM_CountStackFrames;
- JVM_CurrentClassLoader;
- JVM_CurrentLoadedClass;
- JVM_CurrentThread;
- JVM_CurrentTimeMillis;
- JVM_DefineClass;
- JVM_DefineClassWithSource;
- JVM_DefineClassWithSourceCond;
- JVM_DesiredAssertionStatus;
- JVM_DoPrivileged;
- JVM_DumpAllStacks;
- JVM_DumpThreads;
- JVM_FillInStackTrace;
- JVM_FindClassFromCaller;
- JVM_FindClassFromClass;
- JVM_FindClassFromBootLoader;
- JVM_FindLibraryEntry;
- JVM_FindLoadedClass;
- JVM_FindPrimitiveClass;
- JVM_FindSignal;
- JVM_FreeMemory;
- JVM_GC;
- JVM_GetAllThreads;
- JVM_GetArrayElement;
- JVM_GetArrayLength;
- JVM_GetCPClassNameUTF;
- JVM_GetCPFieldClassNameUTF;
- JVM_GetCPFieldModifiers;
- JVM_GetCPFieldNameUTF;
- JVM_GetCPFieldSignatureUTF;
- JVM_GetCPMethodClassNameUTF;
- JVM_GetCPMethodModifiers;
- JVM_GetCPMethodNameUTF;
- JVM_GetCPMethodSignatureUTF;
- JVM_GetCallerClass;
- JVM_GetClassAccessFlags;
- JVM_GetClassAnnotations;
- JVM_GetClassCPEntriesCount;
- JVM_GetClassCPTypes;
- JVM_GetClassConstantPool;
- JVM_GetClassContext;
- JVM_GetClassDeclaredConstructors;
- JVM_GetClassDeclaredFields;
- JVM_GetClassDeclaredMethods;
- JVM_GetClassFieldsCount;
- JVM_GetClassInterfaces;
- JVM_GetClassMethodsCount;
- JVM_GetClassModifiers;
- JVM_GetClassName;
- JVM_GetClassNameUTF;
- JVM_GetClassSignature;
- JVM_GetClassSigners;
- JVM_GetClassTypeAnnotations;
- JVM_GetDeclaredClasses;
- JVM_GetDeclaringClass;
- JVM_GetSimpleBinaryName;
- JVM_GetEnclosingMethodInfo;
- JVM_GetFieldIxModifiers;
- JVM_GetFieldTypeAnnotations;
- JVM_GetInheritedAccessControlContext;
- JVM_GetInterfaceVersion;
- JVM_GetManagement;
- JVM_GetMethodIxArgsSize;
- JVM_GetMethodIxByteCode;
- JVM_GetMethodIxByteCodeLength;
- JVM_GetMethodIxExceptionIndexes;
- JVM_GetMethodIxExceptionTableEntry;
- JVM_GetMethodIxExceptionTableLength;
- JVM_GetMethodIxExceptionsCount;
- JVM_GetMethodIxLocalsCount;
- JVM_GetMethodIxMaxStack;
- JVM_GetMethodIxModifiers;
- JVM_GetMethodIxNameUTF;
- JVM_GetMethodIxSignatureUTF;
- JVM_GetMethodParameters;
- JVM_GetMethodTypeAnnotations;
- JVM_GetNanoTimeAdjustment;
- JVM_GetPrimitiveArrayElement;
- JVM_GetProtectionDomain;
- JVM_GetStackAccessControlContext;
- JVM_GetStackTraceDepth;
- JVM_GetStackTraceElement;
- JVM_GetSystemPackage;
- JVM_GetSystemPackages;
- JVM_GetTemporaryDirectory;
- JVM_GetVersionInfo;
- JVM_Halt;
- JVM_HoldsLock;
- JVM_IHashCode;
- JVM_InitAgentProperties;
- JVM_InitProperties;
- JVM_InternString;
- JVM_Interrupt;
- JVM_InvokeMethod;
- JVM_IsArrayClass;
- JVM_IsConstructorIx;
- JVM_IsInterface;
- JVM_IsInterrupted;
- JVM_IsPrimitiveClass;
- JVM_IsSameClassPackage;
- JVM_IsSupportedJNIVersion;
- JVM_IsThreadAlive;
- JVM_IsVMGeneratedMethodIx;
- JVM_LatestUserDefinedLoader;
- JVM_LoadLibrary;
- JVM_MaxObjectInspectionAge;
- JVM_MaxMemory;
- JVM_MonitorNotify;
- JVM_MonitorNotifyAll;
- JVM_MonitorWait;
- JVM_NanoTime;
- JVM_NativePath;
- JVM_NewArray;
- JVM_NewInstanceFromConstructor;
- JVM_NewMultiArray;
- JVM_RaiseSignal;
- JVM_RawMonitorCreate;
- JVM_RawMonitorDestroy;
- JVM_RawMonitorEnter;
- JVM_RawMonitorExit;
- JVM_RegisterSignal;
- JVM_ReleaseUTF;
- JVM_ResumeThread;
- JVM_SetArrayElement;
- JVM_SetClassSigners;
- JVM_SetNativeThreadName;
- JVM_SetPrimitiveArrayElement;
- JVM_SetThreadPriority;
- JVM_Sleep;
- JVM_StartThread;
- JVM_StopThread;
- JVM_SuspendThread;
- JVM_SupportsCX8;
- JVM_TotalMemory;
- JVM_UnloadLibrary;
- JVM_Yield;
JVM_handle_linux_signal;
# miscellaneous functions
--- a/hotspot/make/linux/makefiles/mapfile-vers-product Thu Sep 17 16:53:42 2015 +0200
+++ b/hotspot/make/linux/makefiles/mapfile-vers-product Fri Sep 25 12:04:35 2015 -0700
@@ -26,168 +26,6 @@
SUNWprivate_1.1 {
global:
- # JNI
- JNI_CreateJavaVM;
- JNI_GetCreatedJavaVMs;
- JNI_GetDefaultJavaVMInitArgs;
-
- # JVM
- JVM_ActiveProcessorCount;
- JVM_ArrayCopy;
- JVM_AssertionStatusDirectives;
- JVM_ClassDepth;
- JVM_ClassLoaderDepth;
- JVM_Clone;
- JVM_ConstantPoolGetClassAt;
- JVM_ConstantPoolGetClassAtIfLoaded;
- JVM_ConstantPoolGetDoubleAt;
- JVM_ConstantPoolGetFieldAt;
- JVM_ConstantPoolGetFieldAtIfLoaded;
- JVM_ConstantPoolGetFloatAt;
- JVM_ConstantPoolGetIntAt;
- JVM_ConstantPoolGetLongAt;
- JVM_ConstantPoolGetMethodAt;
- JVM_ConstantPoolGetMethodAtIfLoaded;
- JVM_ConstantPoolGetMemberRefInfoAt;
- JVM_ConstantPoolGetSize;
- JVM_ConstantPoolGetStringAt;
- JVM_ConstantPoolGetUTF8At;
- JVM_CountStackFrames;
- JVM_CurrentClassLoader;
- JVM_CurrentLoadedClass;
- JVM_CurrentThread;
- JVM_CurrentTimeMillis;
- JVM_DefineClass;
- JVM_DefineClassWithSource;
- JVM_DefineClassWithSourceCond;
- JVM_DesiredAssertionStatus;
- JVM_DoPrivileged;
- JVM_DumpAllStacks;
- JVM_DumpThreads;
- JVM_FillInStackTrace;
- JVM_FindClassFromCaller;
- JVM_FindClassFromClass;
- JVM_FindClassFromBootLoader;
- JVM_FindLibraryEntry;
- JVM_FindLoadedClass;
- JVM_FindPrimitiveClass;
- JVM_FindSignal;
- JVM_FreeMemory;
- JVM_GC;
- JVM_GetAllThreads;
- JVM_GetArrayElement;
- JVM_GetArrayLength;
- JVM_GetCPClassNameUTF;
- JVM_GetCPFieldClassNameUTF;
- JVM_GetCPFieldModifiers;
- JVM_GetCPFieldNameUTF;
- JVM_GetCPFieldSignatureUTF;
- JVM_GetCPMethodClassNameUTF;
- JVM_GetCPMethodModifiers;
- JVM_GetCPMethodNameUTF;
- JVM_GetCPMethodSignatureUTF;
- JVM_GetCallerClass;
- JVM_GetClassAccessFlags;
- JVM_GetClassAnnotations;
- JVM_GetClassCPEntriesCount;
- JVM_GetClassCPTypes;
- JVM_GetClassConstantPool;
- JVM_GetClassContext;
- JVM_GetClassDeclaredConstructors;
- JVM_GetClassDeclaredFields;
- JVM_GetClassDeclaredMethods;
- JVM_GetClassFieldsCount;
- JVM_GetClassInterfaces;
- JVM_GetClassMethodsCount;
- JVM_GetClassModifiers;
- JVM_GetClassName;
- JVM_GetClassNameUTF;
- JVM_GetClassSignature;
- JVM_GetClassSigners;
- JVM_GetClassTypeAnnotations;
- JVM_GetDeclaredClasses;
- JVM_GetDeclaringClass;
- JVM_GetSimpleBinaryName;
- JVM_GetEnclosingMethodInfo;
- JVM_GetFieldIxModifiers;
- JVM_GetFieldTypeAnnotations;
- JVM_GetInheritedAccessControlContext;
- JVM_GetInterfaceVersion;
- JVM_GetManagement;
- JVM_GetMethodIxArgsSize;
- JVM_GetMethodIxByteCode;
- JVM_GetMethodIxByteCodeLength;
- JVM_GetMethodIxExceptionIndexes;
- JVM_GetMethodIxExceptionTableEntry;
- JVM_GetMethodIxExceptionTableLength;
- JVM_GetMethodIxExceptionsCount;
- JVM_GetMethodIxLocalsCount;
- JVM_GetMethodIxMaxStack;
- JVM_GetMethodIxModifiers;
- JVM_GetMethodIxNameUTF;
- JVM_GetMethodIxSignatureUTF;
- JVM_GetMethodParameters;
- JVM_GetMethodTypeAnnotations;
- JVM_GetNanoTimeAdjustment;
- JVM_GetPrimitiveArrayElement;
- JVM_GetProtectionDomain;
- JVM_GetStackAccessControlContext;
- JVM_GetStackTraceDepth;
- JVM_GetStackTraceElement;
- JVM_GetSystemPackage;
- JVM_GetSystemPackages;
- JVM_GetTemporaryDirectory;
- JVM_GetVersionInfo;
- JVM_Halt;
- JVM_HoldsLock;
- JVM_IHashCode;
- JVM_InitAgentProperties;
- JVM_InitProperties;
- JVM_InternString;
- JVM_Interrupt;
- JVM_InvokeMethod;
- JVM_IsArrayClass;
- JVM_IsConstructorIx;
- JVM_IsInterface;
- JVM_IsInterrupted;
- JVM_IsPrimitiveClass;
- JVM_IsSameClassPackage;
- JVM_IsSupportedJNIVersion;
- JVM_IsThreadAlive;
- JVM_IsVMGeneratedMethodIx;
- JVM_LatestUserDefinedLoader;
- JVM_LoadLibrary;
- JVM_MaxObjectInspectionAge;
- JVM_MaxMemory;
- JVM_MonitorNotify;
- JVM_MonitorNotifyAll;
- JVM_MonitorWait;
- JVM_NanoTime;
- JVM_NativePath;
- JVM_NewArray;
- JVM_NewInstanceFromConstructor;
- JVM_NewMultiArray;
- JVM_RaiseSignal;
- JVM_RawMonitorCreate;
- JVM_RawMonitorDestroy;
- JVM_RawMonitorEnter;
- JVM_RawMonitorExit;
- JVM_RegisterSignal;
- JVM_ReleaseUTF;
- JVM_ResumeThread;
- JVM_SetArrayElement;
- JVM_SetClassSigners;
- JVM_SetNativeThreadName;
- JVM_SetPrimitiveArrayElement;
- JVM_SetThreadPriority;
- JVM_Sleep;
- JVM_StartThread;
- JVM_StopThread;
- JVM_SuspendThread;
- JVM_SupportsCX8;
- JVM_TotalMemory;
- JVM_UnloadLibrary;
- JVM_Yield;
JVM_handle_linux_signal;
# miscellaneous functions
--- a/hotspot/make/linux/makefiles/vm.make Thu Sep 17 16:53:42 2015 +0200
+++ b/hotspot/make/linux/makefiles/vm.make Fri Sep 25 12:04:35 2015 -0700
@@ -232,10 +232,17 @@
vm_version.o: $(filter-out vm_version.o,$(JVM_OBJ_FILES))
-mapfile : $(MAPFILE) vm.def mapfile_ext
+MAPFILE_SHARE := $(GAMMADIR)/make/share/makefiles/mapfile-vers
+
+MAPFILE_EXT_SRC := $(HS_ALT_MAKE)/share/makefiles/mapfile-ext
+ifneq ("$(wildcard $(MAPFILE_EXT_SRC))","")
+MAPFILE_EXT := $(MAPFILE_EXT_SRC)
+endif
+
+mapfile : $(MAPFILE) $(MAPFILE_SHARE) vm.def $(MAPFILE_EXT)
rm -f $@
awk '{ if ($$0 ~ "INSERT VTABLE SYMBOLS HERE") \
- { system ("cat mapfile_ext"); system ("cat vm.def"); } \
+ { system ("cat ${MAPFILE_SHARE} $(MAPFILE_EXT) vm.def"); } \
else \
{ print $$0 } \
}' > $@ < $(MAPFILE)
@@ -259,13 +266,6 @@
cat $(VM_DEF_EXT) >> $@
endif
-mapfile_ext:
- rm -f $@
- touch $@
- if [ -f $(HS_ALT_MAKE)/linux/makefiles/mapfile-ext ]; then \
- cat $(HS_ALT_MAKE)/linux/makefiles/mapfile-ext > $@; \
- fi
-
ifeq ($(JVM_VARIANT_ZEROSHARK), true)
STATIC_CXX = false
else
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/make/share/makefiles/mapfile-vers Fri Sep 25 12:04:35 2015 -0700
@@ -0,0 +1,162 @@
+ # JNI
+ JNI_CreateJavaVM;
+ JNI_GetCreatedJavaVMs;
+ JNI_GetDefaultJavaVMInitArgs;
+
+ # JVM
+ JVM_ActiveProcessorCount;
+ JVM_ArrayCopy;
+ JVM_AssertionStatusDirectives;
+ JVM_ClassDepth;
+ JVM_ClassLoaderDepth;
+ JVM_Clone;
+ JVM_ConstantPoolGetClassAt;
+ JVM_ConstantPoolGetClassAtIfLoaded;
+ JVM_ConstantPoolGetDoubleAt;
+ JVM_ConstantPoolGetFieldAt;
+ JVM_ConstantPoolGetFieldAtIfLoaded;
+ JVM_ConstantPoolGetFloatAt;
+ JVM_ConstantPoolGetIntAt;
+ JVM_ConstantPoolGetLongAt;
+ JVM_ConstantPoolGetMethodAt;
+ JVM_ConstantPoolGetMethodAtIfLoaded;
+ JVM_ConstantPoolGetMemberRefInfoAt;
+ JVM_ConstantPoolGetSize;
+ JVM_ConstantPoolGetStringAt;
+ JVM_ConstantPoolGetUTF8At;
+ JVM_CountStackFrames;
+ JVM_CurrentClassLoader;
+ JVM_CurrentLoadedClass;
+ JVM_CurrentThread;
+ JVM_CurrentTimeMillis;
+ JVM_DefineClass;
+ JVM_DefineClassWithSource;
+ JVM_DefineClassWithSourceCond;
+ JVM_DesiredAssertionStatus;
+ JVM_DoPrivileged;
+ JVM_DumpAllStacks;
+ JVM_DumpThreads;
+ JVM_FillInStackTrace;
+ JVM_FindClassFromCaller;
+ JVM_FindClassFromClass;
+ JVM_FindClassFromBootLoader;
+ JVM_FindLibraryEntry;
+ JVM_FindLoadedClass;
+ JVM_FindPrimitiveClass;
+ JVM_FindSignal;
+ JVM_FreeMemory;
+ JVM_GC;
+ JVM_GetAllThreads;
+ JVM_GetArrayElement;
+ JVM_GetArrayLength;
+ JVM_GetCPClassNameUTF;
+ JVM_GetCPFieldClassNameUTF;
+ JVM_GetCPFieldModifiers;
+ JVM_GetCPFieldNameUTF;
+ JVM_GetCPFieldSignatureUTF;
+ JVM_GetCPMethodClassNameUTF;
+ JVM_GetCPMethodModifiers;
+ JVM_GetCPMethodNameUTF;
+ JVM_GetCPMethodSignatureUTF;
+ JVM_GetCallerClass;
+ JVM_GetClassAccessFlags;
+ JVM_GetClassAnnotations;
+ JVM_GetClassCPEntriesCount;
+ JVM_GetClassCPTypes;
+ JVM_GetClassConstantPool;
+ JVM_GetClassContext;
+ JVM_GetClassDeclaredConstructors;
+ JVM_GetClassDeclaredFields;
+ JVM_GetClassDeclaredMethods;
+ JVM_GetClassFieldsCount;
+ JVM_GetClassInterfaces;
+ JVM_GetClassMethodsCount;
+ JVM_GetClassModifiers;
+ JVM_GetClassName;
+ JVM_GetClassNameUTF;
+ JVM_GetClassSignature;
+ JVM_GetClassSigners;
+ JVM_GetClassTypeAnnotations;
+ JVM_GetDeclaredClasses;
+ JVM_GetDeclaringClass;
+ JVM_GetSimpleBinaryName;
+ JVM_GetEnclosingMethodInfo;
+ JVM_GetFieldIxModifiers;
+ JVM_GetFieldTypeAnnotations;
+ JVM_GetInheritedAccessControlContext;
+ JVM_GetInterfaceVersion;
+ JVM_GetManagement;
+ JVM_GetMethodIxArgsSize;
+ JVM_GetMethodIxByteCode;
+ JVM_GetMethodIxByteCodeLength;
+ JVM_GetMethodIxExceptionIndexes;
+ JVM_GetMethodIxExceptionTableEntry;
+ JVM_GetMethodIxExceptionTableLength;
+ JVM_GetMethodIxExceptionsCount;
+ JVM_GetMethodIxLocalsCount;
+ JVM_GetMethodIxMaxStack;
+ JVM_GetMethodIxModifiers;
+ JVM_GetMethodIxNameUTF;
+ JVM_GetMethodIxSignatureUTF;
+ JVM_GetMethodParameters;
+ JVM_GetMethodTypeAnnotations;
+ JVM_GetNanoTimeAdjustment;
+ JVM_GetPrimitiveArrayElement;
+ JVM_GetProtectionDomain;
+ JVM_GetStackAccessControlContext;
+ JVM_GetStackTraceDepth;
+ JVM_GetStackTraceElement;
+ JVM_GetSystemPackage;
+ JVM_GetSystemPackages;
+ JVM_GetTemporaryDirectory;
+ JVM_GetVersionInfo;
+ JVM_Halt;
+ JVM_HoldsLock;
+ JVM_IHashCode;
+ JVM_InitAgentProperties;
+ JVM_InitProperties;
+ JVM_InternString;
+ JVM_Interrupt;
+ JVM_InvokeMethod;
+ JVM_IsArrayClass;
+ JVM_IsConstructorIx;
+ JVM_IsInterface;
+ JVM_IsInterrupted;
+ JVM_IsPrimitiveClass;
+ JVM_IsSameClassPackage;
+ JVM_IsSupportedJNIVersion;
+ JVM_IsThreadAlive;
+ JVM_IsVMGeneratedMethodIx;
+ JVM_LatestUserDefinedLoader;
+ JVM_LoadLibrary;
+ JVM_MaxObjectInspectionAge;
+ JVM_MaxMemory;
+ JVM_MonitorNotify;
+ JVM_MonitorNotifyAll;
+ JVM_MonitorWait;
+ JVM_NanoTime;
+ JVM_NativePath;
+ JVM_NewArray;
+ JVM_NewInstanceFromConstructor;
+ JVM_NewMultiArray;
+ JVM_RaiseSignal;
+ JVM_RawMonitorCreate;
+ JVM_RawMonitorDestroy;
+ JVM_RawMonitorEnter;
+ JVM_RawMonitorExit;
+ JVM_RegisterSignal;
+ JVM_ReleaseUTF;
+ JVM_ResumeThread;
+ JVM_SetArrayElement;
+ JVM_SetClassSigners;
+ JVM_SetNativeThreadName;
+ JVM_SetPrimitiveArrayElement;
+ JVM_SetThreadPriority;
+ JVM_Sleep;
+ JVM_StartThread;
+ JVM_StopThread;
+ JVM_SuspendThread;
+ JVM_SupportsCX8;
+ JVM_TotalMemory;
+ JVM_UnloadLibrary;
+ JVM_Yield;
--- a/hotspot/make/solaris/makefiles/mapfile-vers Thu Sep 17 16:53:42 2015 +0200
+++ b/hotspot/make/solaris/makefiles/mapfile-vers Fri Sep 25 12:04:35 2015 -0700
@@ -26,168 +26,6 @@
SUNWprivate_1.1 {
global:
- # JNI
- JNI_CreateJavaVM;
- JNI_GetCreatedJavaVMs;
- JNI_GetDefaultJavaVMInitArgs;
-
- # JVM
- JVM_ActiveProcessorCount;
- JVM_ArrayCopy;
- JVM_AssertionStatusDirectives;
- JVM_ClassDepth;
- JVM_ClassLoaderDepth;
- JVM_Clone;
- JVM_ConstantPoolGetClassAt;
- JVM_ConstantPoolGetClassAtIfLoaded;
- JVM_ConstantPoolGetDoubleAt;
- JVM_ConstantPoolGetFieldAt;
- JVM_ConstantPoolGetFieldAtIfLoaded;
- JVM_ConstantPoolGetFloatAt;
- JVM_ConstantPoolGetIntAt;
- JVM_ConstantPoolGetLongAt;
- JVM_ConstantPoolGetMethodAt;
- JVM_ConstantPoolGetMethodAtIfLoaded;
- JVM_ConstantPoolGetMemberRefInfoAt;
- JVM_ConstantPoolGetSize;
- JVM_ConstantPoolGetStringAt;
- JVM_ConstantPoolGetUTF8At;
- JVM_CountStackFrames;
- JVM_CurrentClassLoader;
- JVM_CurrentLoadedClass;
- JVM_CurrentThread;
- JVM_CurrentTimeMillis;
- JVM_DefineClass;
- JVM_DefineClassWithSource;
- JVM_DefineClassWithSourceCond;
- JVM_DesiredAssertionStatus;
- JVM_DoPrivileged;
- JVM_DumpAllStacks;
- JVM_DumpThreads;
- JVM_FillInStackTrace;
- JVM_FindClassFromCaller;
- JVM_FindClassFromClass;
- JVM_FindClassFromBootLoader;
- JVM_FindLibraryEntry;
- JVM_FindLoadedClass;
- JVM_FindPrimitiveClass;
- JVM_FindSignal;
- JVM_FreeMemory;
- JVM_GC;
- JVM_GetAllThreads;
- JVM_GetArrayElement;
- JVM_GetArrayLength;
- JVM_GetCPClassNameUTF;
- JVM_GetCPFieldClassNameUTF;
- JVM_GetCPFieldModifiers;
- JVM_GetCPFieldNameUTF;
- JVM_GetCPFieldSignatureUTF;
- JVM_GetCPMethodClassNameUTF;
- JVM_GetCPMethodModifiers;
- JVM_GetCPMethodNameUTF;
- JVM_GetCPMethodSignatureUTF;
- JVM_GetCallerClass;
- JVM_GetClassAccessFlags;
- JVM_GetClassAnnotations;
- JVM_GetClassCPEntriesCount;
- JVM_GetClassCPTypes;
- JVM_GetClassConstantPool;
- JVM_GetClassContext;
- JVM_GetClassDeclaredConstructors;
- JVM_GetClassDeclaredFields;
- JVM_GetClassDeclaredMethods;
- JVM_GetClassFieldsCount;
- JVM_GetClassInterfaces;
- JVM_GetClassMethodsCount;
- JVM_GetClassModifiers;
- JVM_GetClassName;
- JVM_GetClassNameUTF;
- JVM_GetClassSignature;
- JVM_GetClassSigners;
- JVM_GetClassTypeAnnotations;
- JVM_GetDeclaredClasses;
- JVM_GetDeclaringClass;
- JVM_GetSimpleBinaryName;
- JVM_GetEnclosingMethodInfo;
- JVM_GetFieldIxModifiers;
- JVM_GetFieldTypeAnnotations;
- JVM_GetInheritedAccessControlContext;
- JVM_GetInterfaceVersion;
- JVM_GetManagement;
- JVM_GetMethodIxArgsSize;
- JVM_GetMethodIxByteCode;
- JVM_GetMethodIxByteCodeLength;
- JVM_GetMethodIxExceptionIndexes;
- JVM_GetMethodIxExceptionTableEntry;
- JVM_GetMethodIxExceptionTableLength;
- JVM_GetMethodIxExceptionsCount;
- JVM_GetMethodIxLocalsCount;
- JVM_GetMethodIxMaxStack;
- JVM_GetMethodIxModifiers;
- JVM_GetMethodIxNameUTF;
- JVM_GetMethodIxSignatureUTF;
- JVM_GetMethodParameters;
- JVM_GetMethodTypeAnnotations;
- JVM_GetNanoTimeAdjustment;
- JVM_GetPrimitiveArrayElement;
- JVM_GetProtectionDomain;
- JVM_GetStackAccessControlContext;
- JVM_GetStackTraceDepth;
- JVM_GetStackTraceElement;
- JVM_GetSystemPackage;
- JVM_GetSystemPackages;
- JVM_GetTemporaryDirectory;
- JVM_GetVersionInfo;
- JVM_Halt;
- JVM_HoldsLock;
- JVM_IHashCode;
- JVM_InitAgentProperties;
- JVM_InitProperties;
- JVM_InternString;
- JVM_Interrupt;
- JVM_InvokeMethod;
- JVM_IsArrayClass;
- JVM_IsConstructorIx;
- JVM_IsInterface;
- JVM_IsInterrupted;
- JVM_IsPrimitiveClass;
- JVM_IsSameClassPackage;
- JVM_IsSupportedJNIVersion;
- JVM_IsThreadAlive;
- JVM_IsVMGeneratedMethodIx;
- JVM_LatestUserDefinedLoader;
- JVM_LoadLibrary;
- JVM_MaxObjectInspectionAge;
- JVM_MaxMemory;
- JVM_MonitorNotify;
- JVM_MonitorNotifyAll;
- JVM_MonitorWait;
- JVM_NativePath;
- JVM_NanoTime;
- JVM_NewArray;
- JVM_NewInstanceFromConstructor;
- JVM_NewMultiArray;
- JVM_RaiseSignal;
- JVM_RawMonitorCreate;
- JVM_RawMonitorDestroy;
- JVM_RawMonitorEnter;
- JVM_RawMonitorExit;
- JVM_RegisterSignal;
- JVM_ReleaseUTF;
- JVM_ResumeThread;
- JVM_SetArrayElement;
- JVM_SetClassSigners;
- JVM_SetNativeThreadName;
- JVM_SetPrimitiveArrayElement;
- JVM_SetThreadPriority;
- JVM_Sleep;
- JVM_StartThread;
- JVM_StopThread;
- JVM_SuspendThread;
- JVM_SupportsCX8;
- JVM_TotalMemory;
- JVM_UnloadLibrary;
- JVM_Yield;
JVM_handle_solaris_signal;
# miscellaneous functions
--- a/hotspot/make/solaris/makefiles/vm.make Thu Sep 17 16:53:42 2015 +0200
+++ b/hotspot/make/solaris/makefiles/vm.make Fri Sep 25 12:04:35 2015 -0700
@@ -241,13 +241,19 @@
vm_version.o: $(filter-out vm_version.o,$(JVM_OBJ_FILES))
-mapfile : $(MAPFILE) $(MAPFILE_DTRACE_OPT) vm.def mapfile_ext
+MAPFILE_SHARE := $(GAMMADIR)/make/share/makefiles/mapfile-vers
+
+MAPFILE_EXT_SRC := $(HS_ALT_MAKE)/share/makefiles/mapfile-ext
+ifneq ("$(wildcard $(MAPFILE_EXT_SRC))","")
+MAPFILE_EXT := $(MAPFILE_EXT_SRC)
+endif
+
+mapfile : $(MAPFILE) $(MAPFILE_SHARE) vm.def $(MAPFILE_EXT)
rm -f $@
cat $(MAPFILE) $(MAPFILE_DTRACE_OPT) \
| $(NAWK) '{ \
if ($$0 ~ "INSERT VTABLE SYMBOLS HERE") { \
- system ("cat mapfile_ext"); \
- system ("cat vm.def"); \
+ system ("cat ${MAPFILE_SHARE} $(MAPFILE_EXT) vm.def"); \
} else { \
print $$0; \
} \
@@ -260,12 +266,6 @@
vm.def: $(Obj_Files)
sh $(GAMMADIR)/make/solaris/makefiles/build_vm_def.sh *.o > $@
-mapfile_ext:
- rm -f $@
- touch $@
- if [ -f $(HS_ALT_MAKE)/solaris/makefiles/mapfile-ext ]; then \
- cat $(HS_ALT_MAKE)/solaris/makefiles/mapfile-ext > $@; \
- fi
ifeq ($(LINK_INTO),AOUT)
LIBJVM.o =
--- a/hotspot/src/cpu/aarch64/vm/interp_masm_aarch64.cpp Thu Sep 17 16:53:42 2015 +0200
+++ b/hotspot/src/cpu/aarch64/vm/interp_masm_aarch64.cpp Fri Sep 25 12:04:35 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, Red Hat Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -1613,6 +1613,8 @@
test_method_data_pointer(mdp, profile_continue);
if (MethodData::profile_return_jsr292_only()) {
+ assert(Method::intrinsic_id_size_in_bytes() == 2, "assuming Method::_intrinsic_id is u2");
+
// If we don't profile all invoke bytecodes we must make sure
// it's a bytecode we indeed profile. We can't go back to the
// begining of the ProfileData we intend to update to check its
@@ -1625,7 +1627,7 @@
cmp(rscratch1, Bytecodes::_invokehandle);
br(Assembler::EQ, do_profile);
get_method(tmp);
- ldrb(rscratch1, Address(tmp, Method::intrinsic_id_offset_in_bytes()));
+ ldrh(rscratch1, Address(tmp, Method::intrinsic_id_offset_in_bytes()));
cmp(rscratch1, vmIntrinsics::_compiledLambdaForm);
br(Assembler::NE, profile_continue);
--- a/hotspot/src/cpu/aarch64/vm/methodHandles_aarch64.cpp Thu Sep 17 16:53:42 2015 +0200
+++ b/hotspot/src/cpu/aarch64/vm/methodHandles_aarch64.cpp Fri Sep 25 12:04:35 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, Red Hat Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -188,9 +188,11 @@
address entry_point = __ pc();
if (VerifyMethodHandles) {
+ assert(Method::intrinsic_id_size_in_bytes() == 2, "assuming Method::_intrinsic_id is u2");
+
Label L;
BLOCK_COMMENT("verify_intrinsic_id {");
- __ ldrb(rscratch1, Address(rmethod, Method::intrinsic_id_offset_in_bytes()));
+ __ ldrh(rscratch1, Address(rmethod, Method::intrinsic_id_offset_in_bytes()));
__ cmp(rscratch1, (int) iid);
__ br(Assembler::EQ, L);
if (iid == vmIntrinsics::_linkToVirtual ||
--- a/hotspot/src/cpu/ppc/vm/interp_masm_ppc_64.cpp Thu Sep 17 16:53:42 2015 +0200
+++ b/hotspot/src/cpu/ppc/vm/interp_masm_ppc_64.cpp Fri Sep 25 12:04:35 2015 -0700
@@ -1817,13 +1817,15 @@
test_method_data_pointer(profile_continue);
if (MethodData::profile_return_jsr292_only()) {
+ assert(Method::intrinsic_id_size_in_bytes() == 2, "assuming Method::_intrinsic_id is u2");
+
// If we don't profile all invoke bytecodes we must make sure
// it's a bytecode we indeed profile. We can't go back to the
// begining of the ProfileData we intend to update to check its
// type because we're right after it and we don't known its
// length.
lbz(tmp1, 0, R14_bcp);
- lbz(tmp2, Method::intrinsic_id_offset_in_bytes(), R19_method);
+ lhz(tmp2, Method::intrinsic_id_offset_in_bytes(), R19_method);
cmpwi(CCR0, tmp1, Bytecodes::_invokedynamic);
cmpwi(CCR1, tmp1, Bytecodes::_invokehandle);
cror(CCR0, Assembler::equal, CCR1, Assembler::equal);
--- a/hotspot/src/cpu/ppc/vm/methodHandles_ppc.cpp Thu Sep 17 16:53:42 2015 +0200
+++ b/hotspot/src/cpu/ppc/vm/methodHandles_ppc.cpp Fri Sep 25 12:04:35 2015 -0700
@@ -224,11 +224,12 @@
address entry_point = __ pc();
if (VerifyMethodHandles) {
+ assert(Method::intrinsic_id_size_in_bytes() == 2, "assuming Method::_intrinsic_id is u2");
+
Label L;
BLOCK_COMMENT("verify_intrinsic_id {");
__ load_sized_value(temp1, Method::intrinsic_id_offset_in_bytes(), R19_method,
- sizeof(u1), /*is_signed*/ false);
- // assert(sizeof(u1) == sizeof(Method::_intrinsic_id), "");
+ sizeof(u2), /*is_signed*/ false);
__ cmpwi(CCR1, temp1, (int) iid);
__ beq(CCR1, L);
if (iid == vmIntrinsics::_linkToVirtual ||
--- a/hotspot/src/cpu/sparc/vm/interp_masm_sparc.cpp Thu Sep 17 16:53:42 2015 +0200
+++ b/hotspot/src/cpu/sparc/vm/interp_masm_sparc.cpp Fri Sep 25 12:04:35 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -2028,6 +2028,8 @@
test_method_data_pointer(profile_continue);
if (MethodData::profile_return_jsr292_only()) {
+ assert(Method::intrinsic_id_size_in_bytes() == 2, "assuming Method::_intrinsic_id is u2");
+
// If we don't profile all invoke bytecodes we must make sure
// it's a bytecode we indeed profile. We can't go back to the
// begining of the ProfileData we intend to update to check its
@@ -2038,7 +2040,7 @@
cmp_and_br_short(tmp1, Bytecodes::_invokedynamic, equal, pn, do_profile);
cmp(tmp1, Bytecodes::_invokehandle);
br(equal, false, pn, do_profile);
- delayed()->ldub(Lmethod, Method::intrinsic_id_offset_in_bytes(), tmp1);
+ delayed()->lduh(Lmethod, Method::intrinsic_id_offset_in_bytes(), tmp1);
cmp_and_br_short(tmp1, vmIntrinsics::_compiledLambdaForm, notEqual, pt, profile_continue);
bind(do_profile);
--- a/hotspot/src/cpu/sparc/vm/methodHandles_sparc.cpp Thu Sep 17 16:53:42 2015 +0200
+++ b/hotspot/src/cpu/sparc/vm/methodHandles_sparc.cpp Fri Sep 25 12:04:35 2015 -0700
@@ -229,9 +229,11 @@
address entry_point = __ pc();
if (VerifyMethodHandles) {
+ assert(Method::intrinsic_id_size_in_bytes() == 2, "assuming Method::_intrinsic_id is u2");
+
Label L;
BLOCK_COMMENT("verify_intrinsic_id {");
- __ ldub(Address(G5_method, Method::intrinsic_id_offset_in_bytes()), O1_scratch);
+ __ lduh(Address(G5_method, Method::intrinsic_id_offset_in_bytes()), O1_scratch);
__ cmp_and_br_short(O1_scratch, (int) iid, Assembler::equal, Assembler::pt, L);
if (iid == vmIntrinsics::_linkToVirtual ||
iid == vmIntrinsics::_linkToSpecial) {
--- a/hotspot/src/cpu/x86/vm/interp_masm_x86.cpp Thu Sep 17 16:53:42 2015 +0200
+++ b/hotspot/src/cpu/x86/vm/interp_masm_x86.cpp Fri Sep 25 12:04:35 2015 -0700
@@ -174,6 +174,8 @@
test_method_data_pointer(mdp, profile_continue);
if (MethodData::profile_return_jsr292_only()) {
+ assert(Method::intrinsic_id_size_in_bytes() == 2, "assuming Method::_intrinsic_id is u2");
+
// If we don't profile all invoke bytecodes we must make sure
// it's a bytecode we indeed profile. We can't go back to the
// begining of the ProfileData we intend to update to check its
@@ -185,7 +187,7 @@
cmpb(Address(_bcp_register, 0), Bytecodes::_invokehandle);
jcc(Assembler::equal, do_profile);
get_method(tmp);
- cmpb(Address(tmp, Method::intrinsic_id_offset_in_bytes()), vmIntrinsics::_compiledLambdaForm);
+ cmpw(Address(tmp, Method::intrinsic_id_offset_in_bytes()), vmIntrinsics::_compiledLambdaForm);
jcc(Assembler::notEqual, profile_continue);
bind(do_profile);
--- a/hotspot/src/cpu/x86/vm/methodHandles_x86.cpp Thu Sep 17 16:53:42 2015 +0200
+++ b/hotspot/src/cpu/x86/vm/methodHandles_x86.cpp Fri Sep 25 12:04:35 2015 -0700
@@ -222,9 +222,11 @@
address entry_point = __ pc();
if (VerifyMethodHandles) {
+ assert(Method::intrinsic_id_size_in_bytes() == 2, "assuming Method::_intrinsic_id is u2");
+
Label L;
BLOCK_COMMENT("verify_intrinsic_id {");
- __ cmpb(Address(rbx_method, Method::intrinsic_id_offset_in_bytes()), (int) iid);
+ __ cmpw(Address(rbx_method, Method::intrinsic_id_offset_in_bytes()), (int) iid);
__ jcc(Assembler::equal, L);
if (iid == vmIntrinsics::_linkToVirtual ||
iid == vmIntrinsics::_linkToSpecial) {
--- a/hotspot/src/share/vm/classfile/classFileParser.cpp Thu Sep 17 16:53:42 2015 +0200
+++ b/hotspot/src/share/vm/classfile/classFileParser.cpp Fri Sep 25 12:04:35 2015 -0700
@@ -1989,6 +1989,10 @@
flags = JVM_ACC_STATIC;
} else if ((flags & JVM_ACC_STATIC) == JVM_ACC_STATIC) {
flags &= JVM_ACC_STATIC | JVM_ACC_STRICT;
+ } else {
+ // As of major_version 51, a method named <clinit> without ACC_STATIC is
+ // just another method. So, do a normal method modifer check.
+ verify_legal_method_modifiers(flags, is_interface, name, CHECK_(nullHandle));
}
} else {
verify_legal_method_modifiers(flags, is_interface, name, CHECK_(nullHandle));
--- a/hotspot/src/share/vm/classfile/verificationType.cpp Thu Sep 17 16:53:42 2015 +0200
+++ b/hotspot/src/share/vm/classfile/verificationType.cpp Fri Sep 25 12:04:35 2015 -0700
@@ -70,9 +70,12 @@
if (this_class->is_interface() && (!from_field_is_protected ||
from.name() != vmSymbols::java_lang_Object())) {
// If we are not trying to access a protected field or method in
- // java.lang.Object then we treat interfaces as java.lang.Object,
- // including java.lang.Cloneable and java.io.Serializable.
- return true;
+ // java.lang.Object then, for arrays, we only allow assignability
+ // to interfaces java.lang.Cloneable and java.io.Serializable.
+ // Otherwise, we treat interfaces as java.lang.Object.
+ return !from.is_array() ||
+ this_class == SystemDictionary::Cloneable_klass() ||
+ this_class == SystemDictionary::Serializable_klass();
} else if (from.is_object()) {
Klass* from_class = SystemDictionary::resolve_or_fail(
from.name(), Handle(THREAD, klass->class_loader()),
--- a/hotspot/src/share/vm/classfile/verifier.cpp Thu Sep 17 16:53:42 2015 +0200
+++ b/hotspot/src/share/vm/classfile/verifier.cpp Fri Sep 25 12:04:35 2015 -0700
@@ -1579,9 +1579,11 @@
return;
}
// Make sure "this" has been initialized if current method is an
- // <init>
+ // <init>. Note that "<init>" methods in interfaces are just
+ // normal methods. Interfaces cannot have ctors.
if (_method->name() == vmSymbols::object_initializer_name() &&
- current_frame.flag_this_uninit()) {
+ current_frame.flag_this_uninit() &&
+ !current_class()->is_interface()) {
verify_error(ErrorContext::bad_code(bci),
"Constructor must call super() or this() "
"before return");
--- a/hotspot/src/share/vm/gc/g1/g1CollectedHeap.cpp Thu Sep 17 16:53:42 2015 +0200
+++ b/hotspot/src/share/vm/gc/g1/g1CollectedHeap.cpp Fri Sep 25 12:04:35 2015 -0700
@@ -73,13 +73,6 @@
size_t G1CollectedHeap::_humongous_object_threshold_in_words = 0;
-// turn it on so that the contents of the young list (scan-only /
-// to-be-collected) are printed at "strategic" points before / during
-// / after the collection --- this is useful for debugging
-#define YOUNG_LIST_VERBOSE 0
-// CURRENT STATUS
-// This file is under construction. Search for "FIXME".
-
// INVARIANTS/NOTES
//
// All allocation activity covered by the G1CollectedHeap interface is
@@ -4079,29 +4072,12 @@
// the possible verification above.
double sample_start_time_sec = os::elapsedTime();
-#if YOUNG_LIST_VERBOSE
- gclog_or_tty->print_cr("\nBefore recording pause start.\nYoung_list:");
- _young_list->print();
- g1_policy()->print_collection_set(g1_policy()->inc_cset_head(), gclog_or_tty);
-#endif // YOUNG_LIST_VERBOSE
-
g1_policy()->record_collection_pause_start(sample_start_time_sec);
-#if YOUNG_LIST_VERBOSE
- gclog_or_tty->print_cr("\nAfter recording pause start.\nYoung_list:");
- _young_list->print();
-#endif // YOUNG_LIST_VERBOSE
-
if (collector_state()->during_initial_mark_pause()) {
concurrent_mark()->checkpointRootsInitialPre();
}
-#if YOUNG_LIST_VERBOSE
- gclog_or_tty->print_cr("\nBefore choosing collection set.\nYoung_list:");
- _young_list->print();
- g1_policy()->print_collection_set(g1_policy()->inc_cset_head(), gclog_or_tty);
-#endif // YOUNG_LIST_VERBOSE
-
double time_remaining_ms = g1_policy()->finalize_young_cset_part(target_pause_time_ms);
g1_policy()->finalize_old_cset_part(time_remaining_ms);
@@ -4157,11 +4133,6 @@
assert(check_young_list_empty(false /* check_heap */),
"young list should be empty");
-#if YOUNG_LIST_VERBOSE
- gclog_or_tty->print_cr("Before recording survivors.\nYoung List:");
- _young_list->print();
-#endif // YOUNG_LIST_VERBOSE
-
g1_policy()->record_survivor_regions(_young_list->survivor_length(),
_young_list->first_survivor_region(),
_young_list->last_survivor_region());
@@ -4197,12 +4168,6 @@
allocate_dummy_regions();
-#if YOUNG_LIST_VERBOSE
- gclog_or_tty->print_cr("\nEnd of the pause.\nYoung_list:");
- _young_list->print();
- g1_policy()->print_collection_set(g1_policy()->inc_cset_head(), gclog_or_tty);
-#endif // YOUNG_LIST_VERBOSE
-
_allocator->init_mutator_alloc_region();
{
--- a/hotspot/src/share/vm/gc/g1/g1EvacStats.cpp Thu Sep 17 16:53:42 2015 +0200
+++ b/hotspot/src/share/vm/gc/g1/g1EvacStats.cpp Fri Sep 25 12:04:35 2015 -0700
@@ -93,7 +93,7 @@
size_t const used_for_waste_calculation = used() > _region_end_waste ? used() - _region_end_waste : 0;
size_t const total_waste_allowed = used_for_waste_calculation * TargetPLABWastePct;
- size_t const cur_plab_sz = (double)total_waste_allowed / G1LastPLABAverageOccupancy;
+ size_t const cur_plab_sz = (size_t)((double)total_waste_allowed / G1LastPLABAverageOccupancy);
// Take historical weighted average
_filter.sample(cur_plab_sz);
// Clip from above and below, and align to object boundary
--- a/hotspot/src/share/vm/gc/shared/gcTrace.cpp Thu Sep 17 16:53:42 2015 +0200
+++ b/hotspot/src/share/vm/gc/shared/gcTrace.cpp Fri Sep 25 12:04:35 2015 -0700
@@ -88,8 +88,6 @@
send_reference_stats_event(REF_WEAK, rps.weak_count());
send_reference_stats_event(REF_FINAL, rps.final_count());
send_reference_stats_event(REF_PHANTOM, rps.phantom_count());
- send_reference_stats_event(REF_CLEANER, rps.cleaner_count());
- send_reference_stats_event(REF_JNI, rps.jni_weak_ref_count());
}
#if INCLUDE_SERVICES
--- a/hotspot/src/share/vm/gc/shared/referenceProcessor.cpp Thu Sep 17 16:53:42 2015 +0200
+++ b/hotspot/src/share/vm/gc/shared/referenceProcessor.cpp Fri Sep 25 12:04:35 2015 -0700
@@ -243,13 +243,10 @@
process_discovered_reflist(_discoveredPhantomRefs, NULL, false,
is_alive, keep_alive, complete_gc, task_executor);
- }
-
- // Cleaners
- size_t cleaner_count = 0;
- {
- GCTraceTime tt("Cleaners", trace_time, false, gc_timer, gc_id);
- cleaner_count =
+ // Process cleaners, but include them in phantom statistics. We expect
+ // Cleaner references to be temporary, and don't want to deal with
+ // possible incompatibilities arising from making it more visible.
+ phantom_count +=
process_discovered_reflist(_discoveredCleanerRefs, NULL, true,
is_alive, keep_alive, complete_gc, task_executor);
}
@@ -259,17 +256,15 @@
// that is not how the JDK1.2 specification is. See #4126360. Native code can
// thus use JNI weak references to circumvent the phantom references and
// resurrect a "post-mortem" object.
- size_t jni_weak_ref_count = 0;
{
GCTraceTime tt("JNI Weak Reference", trace_time, false, gc_timer, gc_id);
if (task_executor != NULL) {
task_executor->set_single_threaded_mode();
}
- jni_weak_ref_count =
- process_phaseJNI(is_alive, keep_alive, complete_gc);
+ process_phaseJNI(is_alive, keep_alive, complete_gc);
}
- return ReferenceProcessorStats(soft_count, weak_count, final_count, phantom_count, cleaner_count, jni_weak_ref_count);
+ return ReferenceProcessorStats(soft_count, weak_count, final_count, phantom_count);
}
#ifndef PRODUCT
@@ -296,17 +291,17 @@
}
#endif
-size_t ReferenceProcessor::process_phaseJNI(BoolObjectClosure* is_alive,
- OopClosure* keep_alive,
- VoidClosure* complete_gc) {
- DEBUG_ONLY(size_t check_count = count_jni_refs();)
- size_t count = JNIHandles::weak_oops_do(is_alive, keep_alive);
- assert(count == check_count, "Counts didn't match");
+void ReferenceProcessor::process_phaseJNI(BoolObjectClosure* is_alive,
+ OopClosure* keep_alive,
+ VoidClosure* complete_gc) {
+#ifndef PRODUCT
+ if (PrintGCDetails && PrintReferenceGC) {
+ unsigned int count = count_jni_refs();
+ gclog_or_tty->print(", %u refs", count);
+ }
+#endif
+ JNIHandles::weak_oops_do(is_alive, keep_alive);
complete_gc->do_void();
- if (PrintGCDetails && PrintReferenceGC) {
- gclog_or_tty->print(", " SIZE_FORMAT " refs", count);
- }
- return count;
}
@@ -946,10 +941,9 @@
list = &_discoveredCleanerRefs[id];
break;
case REF_NONE:
- case REF_JNI:
// we should not reach here if we are an InstanceRefKlass
default:
- guarantee(false, err_msg("rt should not be %d", rt));
+ ShouldNotReachHere();
}
if (TraceReferenceGC && PrintGCDetails) {
gclog_or_tty->print_cr("Thread %d gets list " INTPTR_FORMAT, id, p2i(list));
--- a/hotspot/src/share/vm/gc/shared/referenceProcessor.hpp Thu Sep 17 16:53:42 2015 +0200
+++ b/hotspot/src/share/vm/gc/shared/referenceProcessor.hpp Fri Sep 25 12:04:35 2015 -0700
@@ -247,7 +247,7 @@
DiscoveredList* _discoveredCleanerRefs;
public:
- static int number_of_subclasses_of_ref() { return REF_LISTS_COUNT; }
+ static int number_of_subclasses_of_ref() { return (REF_CLEANER - REF_OTHER); }
uint num_q() { return _num_q; }
uint max_num_q() { return _max_num_q; }
@@ -271,9 +271,9 @@
VoidClosure* complete_gc,
AbstractRefProcTaskExecutor* task_executor);
- size_t process_phaseJNI(BoolObjectClosure* is_alive,
- OopClosure* keep_alive,
- VoidClosure* complete_gc);
+ void process_phaseJNI(BoolObjectClosure* is_alive,
+ OopClosure* keep_alive,
+ VoidClosure* complete_gc);
// Work methods used by the method process_discovered_reflist
// Phase1: keep alive all those referents that are otherwise
--- a/hotspot/src/share/vm/gc/shared/referenceProcessorStats.hpp Thu Sep 17 16:53:42 2015 +0200
+++ b/hotspot/src/share/vm/gc/shared/referenceProcessorStats.hpp Fri Sep 25 12:04:35 2015 -0700
@@ -36,30 +36,22 @@
size_t _weak_count;
size_t _final_count;
size_t _phantom_count;
- size_t _cleaner_count;
- size_t _jni_weak_ref_count;
public:
ReferenceProcessorStats() :
_soft_count(0),
_weak_count(0),
_final_count(0),
- _phantom_count(0),
- _cleaner_count(0),
- _jni_weak_ref_count(0) {}
+ _phantom_count(0) {}
ReferenceProcessorStats(size_t soft_count,
size_t weak_count,
size_t final_count,
- size_t phantom_count,
- size_t cleaner_count,
- size_t jni_weak_ref_count) :
+ size_t phantom_count) :
_soft_count(soft_count),
_weak_count(weak_count),
_final_count(final_count),
- _phantom_count(phantom_count),
- _cleaner_count(cleaner_count),
- _jni_weak_ref_count(jni_weak_ref_count)
+ _phantom_count(phantom_count)
{}
size_t soft_count() const {
@@ -77,13 +69,5 @@
size_t phantom_count() const {
return _phantom_count;
}
-
- size_t cleaner_count() const {
- return _cleaner_count;
- }
-
- size_t jni_weak_ref_count() const {
- return _jni_weak_ref_count;
- }
};
#endif
--- a/hotspot/src/share/vm/memory/referenceType.hpp Thu Sep 17 16:53:42 2015 +0200
+++ b/hotspot/src/share/vm/memory/referenceType.hpp Fri Sep 25 12:04:35 2015 -0700
@@ -32,15 +32,11 @@
enum ReferenceType {
REF_NONE, // Regular class
REF_OTHER, // Subclass of java/lang/ref/Reference, but not subclass of one of the classes below
- ///////////////// Only the types below have their own discovered lists
REF_SOFT, // Subclass of java/lang/ref/SoftReference
REF_WEAK, // Subclass of java/lang/ref/WeakReference
REF_FINAL, // Subclass of java/lang/ref/FinalReference
REF_PHANTOM, // Subclass of java/lang/ref/PhantomReference
- REF_CLEANER, // Subclass of sun/misc/Cleaner
- ///////////////// Only the types in the above range have their own discovered lists
- REF_JNI, // JNI weak refs
- REF_LISTS_COUNT = REF_CLEANER - REF_OTHER // Number of discovered lists
+ REF_CLEANER // Subclass of sun/misc/Cleaner
};
#endif // SHARE_VM_MEMORY_REFERENCETYPE_HPP
--- a/hotspot/src/share/vm/oops/method.hpp Thu Sep 17 16:53:42 2015 +0200
+++ b/hotspot/src/share/vm/oops/method.hpp Fri Sep 25 12:04:35 2015 -0700
@@ -72,7 +72,7 @@
int _result_index; // C++ interpreter needs for converting results to/from stack
#endif
u2 _method_size; // size of this object
- u1 _intrinsic_id; // vmSymbols::intrinsic_id (0 == _none)
+ u2 _intrinsic_id; // vmSymbols::intrinsic_id (0 == _none)
// Flags
enum Flags {
@@ -653,7 +653,7 @@
// for code generation
static int method_data_offset_in_bytes() { return offset_of(Method, _method_data); }
static int intrinsic_id_offset_in_bytes() { return offset_of(Method, _intrinsic_id); }
- static int intrinsic_id_size_in_bytes() { return sizeof(u1); }
+ static int intrinsic_id_size_in_bytes() { return sizeof(u2); }
// Static methods that are used to implement member methods where an exposed this pointer
// is needed due to possible GCs
@@ -777,7 +777,7 @@
// Support for inlining of intrinsic methods
vmIntrinsics::ID intrinsic_id() const { return (vmIntrinsics::ID) _intrinsic_id; }
- void set_intrinsic_id(vmIntrinsics::ID id) { _intrinsic_id = (u1) id; }
+ void set_intrinsic_id(vmIntrinsics::ID id) { _intrinsic_id = (u2) id; }
// Helper routines for intrinsic_id() and vmIntrinsics::method().
void init_intrinsic_id(); // updates from _none if a match
--- a/hotspot/src/share/vm/prims/jvmtiExport.cpp Thu Sep 17 16:53:42 2015 +0200
+++ b/hotspot/src/share/vm/prims/jvmtiExport.cpp Fri Sep 25 12:04:35 2015 -0700
@@ -2181,8 +2181,8 @@
JvmtiVMObjectAllocEventCollector::oops_do_for_all_threads(f);
}
-size_t JvmtiExport::weak_oops_do(BoolObjectClosure* is_alive, OopClosure* f) {
- return JvmtiTagMap::weak_oops_do(is_alive, f);
+void JvmtiExport::weak_oops_do(BoolObjectClosure* is_alive, OopClosure* f) {
+ JvmtiTagMap::weak_oops_do(is_alive, f);
}
void JvmtiExport::gc_epilogue() {
--- a/hotspot/src/share/vm/prims/jvmtiExport.hpp Thu Sep 17 16:53:42 2015 +0200
+++ b/hotspot/src/share/vm/prims/jvmtiExport.hpp Fri Sep 25 12:04:35 2015 -0700
@@ -366,7 +366,7 @@
static void clear_detected_exception (JavaThread* thread) NOT_JVMTI_RETURN;
static void oops_do(OopClosure* f) NOT_JVMTI_RETURN;
- static size_t weak_oops_do(BoolObjectClosure* b, OopClosure* f) NOT_JVMTI_RETURN_(0);
+ static void weak_oops_do(BoolObjectClosure* b, OopClosure* f) NOT_JVMTI_RETURN;
static void gc_epilogue() NOT_JVMTI_RETURN;
static void transition_pending_onload_raw_monitors() NOT_JVMTI_RETURN;
--- a/hotspot/src/share/vm/prims/jvmtiTagMap.cpp Thu Sep 17 16:53:42 2015 +0200
+++ b/hotspot/src/share/vm/prims/jvmtiTagMap.cpp Fri Sep 25 12:04:35 2015 -0700
@@ -3284,35 +3284,32 @@
}
-size_t JvmtiTagMap::weak_oops_do(BoolObjectClosure* is_alive, OopClosure* f) {
+void JvmtiTagMap::weak_oops_do(BoolObjectClosure* is_alive, OopClosure* f) {
// No locks during VM bring-up (0 threads) and no safepoints after main
// thread creation and before VMThread creation (1 thread); initial GC
// verification can happen in that window which gets to here.
assert(Threads::number_of_threads() <= 1 ||
SafepointSynchronize::is_at_safepoint(),
"must be executed at a safepoint");
- size_t count = 0;
if (JvmtiEnv::environments_might_exist()) {
JvmtiEnvIterator it;
for (JvmtiEnvBase* env = it.first(); env != NULL; env = it.next(env)) {
JvmtiTagMap* tag_map = env->tag_map();
if (tag_map != NULL && !tag_map->is_empty()) {
- count += tag_map->do_weak_oops(is_alive, f);
+ tag_map->do_weak_oops(is_alive, f);
}
}
}
- return count;
}
-size_t JvmtiTagMap::do_weak_oops(BoolObjectClosure* is_alive, OopClosure* f) {
+void JvmtiTagMap::do_weak_oops(BoolObjectClosure* is_alive, OopClosure* f) {
// does this environment have the OBJECT_FREE event enabled
bool post_object_free = env()->is_enabled(JVMTI_EVENT_OBJECT_FREE);
// counters used for trace message
- size_t freed = 0;
- size_t moved = 0;
- size_t stayed = 0;
+ int freed = 0;
+ int moved = 0;
JvmtiTagHashmap* hashmap = this->hashmap();
@@ -3321,7 +3318,7 @@
// if the hashmap is empty then we can skip it
if (hashmap->_entry_count == 0) {
- return 0;
+ return;
}
// now iterate through each entry in the table
@@ -3383,7 +3380,6 @@
} else {
// object didn't move
prev = entry;
- stayed++;
}
}
@@ -3402,12 +3398,10 @@
// stats
if (TraceJVMTIObjectTagging) {
- size_t post_total = hashmap->_entry_count;
- size_t pre_total = post_total + freed;
-
- tty->print_cr("(" SIZE_FORMAT "->" SIZE_FORMAT ", " SIZE_FORMAT " freed, " SIZE_FORMAT " stayed, " SIZE_FORMAT " moved)",
- pre_total, post_total, freed, stayed, moved);
+ int post_total = hashmap->_entry_count;
+ int pre_total = post_total + freed;
+
+ tty->print_cr("(%d->%d, %d freed, %d total moves)",
+ pre_total, post_total, freed, moved);
}
-
- return (freed + stayed + moved);
}
--- a/hotspot/src/share/vm/prims/jvmtiTagMap.hpp Thu Sep 17 16:53:42 2015 +0200
+++ b/hotspot/src/share/vm/prims/jvmtiTagMap.hpp Fri Sep 25 12:04:35 2015 -0700
@@ -60,7 +60,7 @@
inline Mutex* lock() { return &_lock; }
inline JvmtiEnv* env() const { return _env; }
- size_t do_weak_oops(BoolObjectClosure* is_alive, OopClosure* f);
+ void do_weak_oops(BoolObjectClosure* is_alive, OopClosure* f);
// iterate over all entries in this tag map
void entry_iterate(JvmtiTagHashmapEntryClosure* closure);
@@ -122,8 +122,8 @@
jint* count_ptr, jobject** object_result_ptr,
jlong** tag_result_ptr);
- static size_t weak_oops_do(BoolObjectClosure* is_alive,
- OopClosure* f) NOT_JVMTI_RETURN_(0);
+ static void weak_oops_do(
+ BoolObjectClosure* is_alive, OopClosure* f) NOT_JVMTI_RETURN;
};
#endif // SHARE_VM_PRIMS_JVMTITAGMAP_HPP
--- a/hotspot/src/share/vm/runtime/arguments.cpp Thu Sep 17 16:53:42 2015 +0200
+++ b/hotspot/src/share/vm/runtime/arguments.cpp Fri Sep 25 12:04:35 2015 -0700
@@ -118,7 +118,7 @@
// part of the option string.
static bool match_option(const JavaVMOption *option, const char* name,
const char** tail) {
- int len = (int)strlen(name);
+ size_t len = strlen(name);
if (strncmp(option->optionString, name, len) == 0) {
*tail = option->optionString + len;
return true;
@@ -219,11 +219,9 @@
void Arguments::init_version_specific_system_properties() {
enum { bufsz = 16 };
char buffer[bufsz];
- const char* spec_vendor = "Sun Microsystems Inc.";
- uint32_t spec_version = 0;
-
- spec_vendor = "Oracle Corporation";
- spec_version = JDK_Version::current().major_version();
+ const char* spec_vendor = "Oracle Corporation";
+ uint32_t spec_version = JDK_Version::current().major_version();
+
jio_snprintf(buffer, bufsz, "1." UINT32_FORMAT, spec_version);
PropertyList_add(&_system_properties,
@@ -234,75 +232,290 @@
new SystemProperty("java.vm.vendor", VM_Version::vm_vendor(), false));
}
-/**
- * Provide a slightly more user-friendly way of eliminating -XX flags.
- * When a flag is eliminated, it can be added to this list in order to
- * continue accepting this flag on the command-line, while issuing a warning
- * and ignoring the value. Once the JDK version reaches the 'accept_until'
- * limit, we flatly refuse to admit the existence of the flag. This allows
- * a flag to die correctly over JDK releases using HSX.
- * But now that HSX is no longer supported only options with a future
- * accept_until value need to be listed, and the list can be pruned
- * on each major release.
+/*
+ * -XX argument processing:
+ *
+ * -XX arguments are defined in several places, such as:
+ * globals.hpp, globals_<cpu>.hpp, globals_<os>.hpp, <compiler>_globals.hpp, or <gc>_globals.hpp.
+ * -XX arguments are parsed in parse_argument().
+ * -XX argument bounds checking is done in check_vm_args_consistency().
+ *
+ * Over time -XX arguments may change. There are mechanisms to handle common cases:
+ *
+ * ALIASED: An option that is simply another name for another option. This is often
+ * part of the process of deprecating a flag, but not all aliases need
+ * to be deprecated.
+ *
+ * Create an alias for an option by adding the old and new option names to the
+ * "aliased_jvm_flags" table. Delete the old variable from globals.hpp (etc).
+ *
+ * DEPRECATED: An option that is supported, but a warning is printed to let the user know that
+ * support may be removed in the future. Both regular and aliased options may be
+ * deprecated.
+ *
+ * Add a deprecation warning for an option (or alias) by adding an entry in the
+ * "special_jvm_flags" table and setting the "deprecated_in" field.
+ * Often an option "deprecated" in one major release will
+ * be made "obsolete" in the next. In this case the entry should also have it's
+ * "obsolete_in" field set.
+ *
+ * OBSOLETE: An option that has been removed (and deleted from globals.hpp), but is still accepted
+ * on the command line. A warning is printed to let the user know that option might not
+ * be accepted in the future.
+ *
+ * Add an obsolete warning for an option by adding an entry in the "special_jvm_flags"
+ * table and setting the "obsolete_in" field.
+ *
+ * EXPIRED: A deprecated or obsolete option that has an "accept_until" version less than or equal
+ * to the current JDK version. The system will flatly refuse to admit the existence of
+ * the flag. This allows a flag to die automatically over JDK releases.
+ *
+ * Note that manual cleanup of expired options should be done at major JDK version upgrades:
+ * - Newly expired options should be removed from the special_jvm_flags and aliased_jvm_flags tables.
+ * - Newly obsolete or expired deprecated options should have their global variable
+ * definitions removed (from globals.hpp, etc) and related implementations removed.
+ *
+ * Recommended approach for removing options:
+ *
+ * To remove options commonly used by customers (e.g. product, commercial -XX options), use
+ * the 3-step model adding major release numbers to the deprecate, obsolete and expire columns.
+ *
+ * To remove internal options (e.g. diagnostic, experimental, develop options), use
+ * a 2-step model adding major release numbers to the obsolete and expire columns.
+ *
+ * To change the name of an option, use the alias table as well as a 2-step
+ * model adding major release numbers to the deprecate and expire columns.
+ * Think twice about aliasing commonly used customer options.
+ *
+ * There are times when it is appropriate to leave a future release number as undefined.
+ *
+ * Tests: Aliases should be tested in VMAliasOptions.java.
+ * Deprecated options should be tested in VMDeprecatedOptions.java.
*/
+
+// Obsolete or deprecated -XX flag.
typedef struct {
const char* name;
- JDK_Version obsoleted_in; // when the flag went away
- JDK_Version accept_until; // which version to start denying the existence
-} ObsoleteFlag;
-
-static ObsoleteFlag obsolete_jvm_flags[] = {
- { "UseOldInlining", JDK_Version::jdk(9), JDK_Version::jdk(10) },
- { "SafepointPollOffset", JDK_Version::jdk(9), JDK_Version::jdk(10) },
- { "UseBoundThreads", JDK_Version::jdk(9), JDK_Version::jdk(10) },
- { "DefaultThreadPriority", JDK_Version::jdk(9), JDK_Version::jdk(10) },
- { "NoYieldsInMicrolock", JDK_Version::jdk(9), JDK_Version::jdk(10) },
- { "BackEdgeThreshold", JDK_Version::jdk(9), JDK_Version::jdk(10) },
- { "UseNewReflection", JDK_Version::jdk(9), JDK_Version::jdk(10) },
- { "ReflectionWrapResolutionErrors",JDK_Version::jdk(9), JDK_Version::jdk(10) },
- { "VerifyReflectionBytecodes", JDK_Version::jdk(9), JDK_Version::jdk(10) },
- { "AutoShutdownNMT", JDK_Version::jdk(9), JDK_Version::jdk(10) },
- { "NmethodSweepFraction", JDK_Version::jdk(9), JDK_Version::jdk(10) },
- { "NmethodSweepCheckInterval", JDK_Version::jdk(9), JDK_Version::jdk(10) },
- { "CodeCacheMinimumFreeSpace", JDK_Version::jdk(9), JDK_Version::jdk(10) },
+ JDK_Version deprecated_in; // When the deprecation warning started (or "undefined").
+ JDK_Version obsolete_in; // When the obsolete warning started (or "undefined").
+ JDK_Version expired_in; // When the option expires (or "undefined").
+} SpecialFlag;
+
+// The special_jvm_flags table declares options that are being deprecated and/or obsoleted. The
+// "deprecated_in" or "obsolete_in" fields may be set to "undefined", but not both.
+// When the JDK version reaches 'deprecated_in' limit, the JVM will process this flag on
+// the command-line as usual, but will issue a warning.
+// When the JDK version reaches 'obsolete_in' limit, the JVM will continue accepting this flag on
+// the command-line, while issuing a warning and ignoring the flag value.
+// Once the JDK version reaches 'expired_in' limit, the JVM will flatly refuse to admit the
+// existence of the flag.
+//
+// MANUAL CLEANUP ON JDK VERSION UPDATES:
+// This table ensures that the handling of options will update automatically when the JDK
+// version is incremented, but the source code needs to be cleanup up manually:
+// - As "deprecated" options age into "obsolete" or "expired" options, the associated "globals"
+// variable should be removed, as well as users of the variable.
+// - As "deprecated" options age into "obsolete" options, move the entry into the
+// "Obsolete Flags" section of the table.
+// - All expired options should be removed from the table.
+static SpecialFlag const special_jvm_flags[] = {
+ // -------------- Deprecated Flags --------------
+ // --- Non-alias flags - sorted by obsolete_in then expired_in:
+ { "MaxGCMinorPauseMillis", JDK_Version::jdk(8), JDK_Version::undefined(), JDK_Version::undefined() },
+ { "UseParNewGC", JDK_Version::jdk(9), JDK_Version::undefined(), JDK_Version::jdk(10) },
+
+ // --- Deprecated alias flags (see also aliased_jvm_flags) - sorted by obsolete_in then expired_in:
+ { "DefaultMaxRAMFraction", JDK_Version::jdk(8), JDK_Version::undefined(), JDK_Version::undefined() },
+ { "CreateMinidumpOnCrash", JDK_Version::jdk(9), JDK_Version::undefined(), JDK_Version::undefined() },
+ { "CMSMarkStackSizeMax", JDK_Version::jdk(9), JDK_Version::undefined(), JDK_Version::jdk(10) },
+ { "CMSMarkStackSize", JDK_Version::jdk(9), JDK_Version::undefined(), JDK_Version::jdk(10) },
+ { "G1MarkStackSize", JDK_Version::jdk(9), JDK_Version::undefined(), JDK_Version::jdk(10) },
+ { "ParallelMarkingThreads", JDK_Version::jdk(9), JDK_Version::undefined(), JDK_Version::jdk(10) },
+ { "ParallelCMSThreads", JDK_Version::jdk(9), JDK_Version::undefined(), JDK_Version::jdk(10) },
+
+ // -------------- Obsolete Flags - sorted by expired_in --------------
+ { "UseOldInlining", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) },
+ { "SafepointPollOffset", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) },
+ { "UseBoundThreads", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) },
+ { "DefaultThreadPriority", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) },
+ { "NoYieldsInMicrolock", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) },
+ { "BackEdgeThreshold", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) },
+ { "UseNewReflection", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) },
+ { "ReflectionWrapResolutionErrors",JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) },
+ { "VerifyReflectionBytecodes", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) },
+ { "AutoShutdownNMT", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) },
+ { "NmethodSweepFraction", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) },
+ { "NmethodSweepCheckInterval", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) },
+ { "CodeCacheMinimumFreeSpace", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) },
#ifndef ZERO
- { "UseFastAccessorMethods", JDK_Version::jdk(9), JDK_Version::jdk(10) },
- { "UseFastEmptyMethods", JDK_Version::jdk(9), JDK_Version::jdk(10) },
+ { "UseFastAccessorMethods", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) },
+ { "UseFastEmptyMethods", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) },
#endif // ZERO
- { "UseCompilerSafepoints", JDK_Version::jdk(9), JDK_Version::jdk(10) },
- { "AdaptiveSizePausePolicy", JDK_Version::jdk(9), JDK_Version::jdk(10) },
- { "ParallelGCRetainPLAB", JDK_Version::jdk(9), JDK_Version::jdk(10) },
- { "ThreadSafetyMargin", JDK_Version::jdk(9), JDK_Version::jdk(10) },
- { "LazyBootClassLoader", JDK_Version::jdk(9), JDK_Version::jdk(10) },
- { "StarvationMonitorInterval", JDK_Version::jdk(9), JDK_Version::jdk(10) },
- { "PreInflateSpin", JDK_Version::jdk(9), JDK_Version::jdk(10) },
+ { "UseCompilerSafepoints", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) },
+ { "AdaptiveSizePausePolicy", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) },
+ { "ParallelGCRetainPLAB", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) },
+ { "ThreadSafetyMargin", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) },
+ { "LazyBootClassLoader", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) },
+ { "StarvationMonitorInterval", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) },
+ { "PreInflateSpin", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) },
+
+#ifdef TEST_VERIFY_SPECIAL_JVM_FLAGS
+ { "dep > obs", JDK_Version::jdk(9), JDK_Version::jdk(8), JDK_Version::undefined() },
+ { "dep > exp ", JDK_Version::jdk(9), JDK_Version::undefined(), JDK_Version::jdk(8) },
+ { "obs > exp ", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(8) },
+ { "not deprecated or obsolete", JDK_Version::undefined(), JDK_Version::undefined(), JDK_Version::jdk(9) },
+ { "dup option", JDK_Version::jdk(9), JDK_Version::undefined(), JDK_Version::undefined() },
+ { "dup option", JDK_Version::jdk(9), JDK_Version::undefined(), JDK_Version::undefined() },
+ { "BytecodeVerificationRemote", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::undefined() },
+#endif
+
{ NULL, JDK_Version(0), JDK_Version(0) }
};
-// Returns true if the flag is obsolete and fits into the range specified
-// for being ignored. In the case that the flag is ignored, the 'version'
-// value is filled in with the version number when the flag became
-// obsolete so that that value can be displayed to the user.
-bool Arguments::is_newly_obsolete(const char *s, JDK_Version* version) {
- int i = 0;
- assert(version != NULL, "Must provide a version buffer");
- while (obsolete_jvm_flags[i].name != NULL) {
- const ObsoleteFlag& flag_status = obsolete_jvm_flags[i];
- // <flag>=xxx form
- // [-|+]<flag> form
- size_t len = strlen(flag_status.name);
- if ((strncmp(flag_status.name, s, len) == 0) &&
- (strlen(s) == len)){
- if (JDK_Version::current().compare(flag_status.accept_until) == -1) {
- *version = flag_status.obsoleted_in;
- return true;
- }
+// Flags that are aliases for other flags.
+typedef struct {
+ const char* alias_name;
+ const char* real_name;
+} AliasedFlag;
+
+static AliasedFlag const aliased_jvm_flags[] = {
+ { "DefaultMaxRAMFraction", "MaxRAMFraction" },
+ { "CMSMarkStackSizeMax", "MarkStackSizeMax" },
+ { "CMSMarkStackSize", "MarkStackSize" },
+ { "G1MarkStackSize", "MarkStackSize" },
+ { "ParallelMarkingThreads", "ConcGCThreads" },
+ { "ParallelCMSThreads", "ConcGCThreads" },
+ { "CreateMinidumpOnCrash", "CreateCoredumpOnCrash" },
+ { NULL, NULL}
+};
+
+// Return true if "v" is less than "other", where "other" may be "undefined".
+static bool version_less_than(JDK_Version v, JDK_Version other) {
+ assert(!v.is_undefined(), "must be defined");
+ if (!other.is_undefined() && v.compare(other) >= 0) {
+ return false;
+ } else {
+ return true;
+ }
+}
+
+static bool lookup_special_flag(const char *flag_name, SpecialFlag& flag) {
+ for (size_t i = 0; special_jvm_flags[i].name != NULL; i++) {
+ if ((strcmp(special_jvm_flags[i].name, flag_name) == 0)) {
+ flag = special_jvm_flags[i];
+ return true;
}
- i++;
}
return false;
}
+bool Arguments::is_obsolete_flag(const char *flag_name, JDK_Version* version) {
+ assert(version != NULL, "Must provide a version buffer");
+ SpecialFlag flag;
+ if (lookup_special_flag(flag_name, flag)) {
+ if (!flag.obsolete_in.is_undefined()) {
+ if (version_less_than(JDK_Version::current(), flag.expired_in)) {
+ *version = flag.obsolete_in;
+ return true;
+ }
+ }
+ }
+ return false;
+}
+
+int Arguments::is_deprecated_flag(const char *flag_name, JDK_Version* version) {
+ assert(version != NULL, "Must provide a version buffer");
+ SpecialFlag flag;
+ if (lookup_special_flag(flag_name, flag)) {
+ if (!flag.deprecated_in.is_undefined()) {
+ if (version_less_than(JDK_Version::current(), flag.obsolete_in) &&
+ version_less_than(JDK_Version::current(), flag.expired_in)) {
+ *version = flag.deprecated_in;
+ return 1;
+ } else {
+ return -1;
+ }
+ }
+ }
+ return 0;
+}
+
+const char* Arguments::real_flag_name(const char *flag_name) {
+ for (size_t i = 0; aliased_jvm_flags[i].alias_name != NULL; i++) {
+ const AliasedFlag& flag_status = aliased_jvm_flags[i];
+ if (strcmp(flag_status.alias_name, flag_name) == 0) {
+ return flag_status.real_name;
+ }
+ }
+ return flag_name;
+}
+
+#ifndef PRODUCT
+static bool lookup_special_flag(const char *flag_name, size_t skip_index) {
+ for (size_t i = 0; special_jvm_flags[i].name != NULL; i++) {
+ if ((i != skip_index) && (strcmp(special_jvm_flags[i].name, flag_name) == 0)) {
+ return true;
+ }
+ }
+ return false;
+}
+
+static bool verify_special_jvm_flags() {
+ bool success = true;
+ for (size_t i = 0; special_jvm_flags[i].name != NULL; i++) {
+ const SpecialFlag& flag = special_jvm_flags[i];
+ if (lookup_special_flag(flag.name, i)) {
+ warning("Duplicate special flag declaration \"%s\"", flag.name);
+ success = false;
+ }
+ if (flag.deprecated_in.is_undefined() &&
+ flag.obsolete_in.is_undefined()) {
+ warning("Special flag entry \"%s\" must declare version deprecated and/or obsoleted in.", flag.name);
+ success = false;
+ }
+
+ if (!flag.deprecated_in.is_undefined()) {
+ if (!version_less_than(flag.deprecated_in, flag.obsolete_in)) {
+ warning("Special flag entry \"%s\" must be deprecated before obsoleted.", flag.name);
+ success = false;
+ }
+
+ if (!version_less_than(flag.deprecated_in, flag.expired_in)) {
+ warning("Special flag entry \"%s\" must be deprecated before expired.", flag.name);
+ success = false;
+ }
+ }
+
+ if (!flag.obsolete_in.is_undefined()) {
+ if (!version_less_than(flag.obsolete_in, flag.expired_in)) {
+ warning("Special flag entry \"%s\" must be obsoleted before expired.", flag.name);
+ success = false;
+ }
+
+ // if flag has become obsolete it should not have a "globals" flag defined anymore.
+ if (!version_less_than(JDK_Version::current(), flag.obsolete_in)) {
+ if (Flag::find_flag(flag.name) != NULL) {
+ warning("Global variable for obsolete special flag entry \"%s\" should be removed", flag.name);
+ success = false;
+ }
+ }
+ }
+
+ if (!flag.expired_in.is_undefined()) {
+ // if flag has become expired it should not have a "globals" flag defined anymore.
+ if (!version_less_than(JDK_Version::current(), flag.expired_in)) {
+ if (Flag::find_flag(flag.name) != NULL) {
+ warning("Global variable for expired flag entry \"%s\" should be removed", flag.name);
+ success = false;
+ }
+ }
+ }
+
+ }
+ return success;
+}
+#endif
+
// Constructs the system class path (aka boot class path) from the following
// components, in order:
//
@@ -571,7 +784,7 @@
}
}
-static bool set_bool_flag(char* name, bool value, Flag::Flags origin) {
+static bool set_bool_flag(const char* name, bool value, Flag::Flags origin) {
if (CommandLineFlags::boolAtPut(name, &value, origin) == Flag::SUCCESS) {
return true;
} else {
@@ -579,7 +792,7 @@
}
}
-static bool set_fp_numeric_flag(char* name, char* value, Flag::Flags origin) {
+static bool set_fp_numeric_flag(const char* name, char* value, Flag::Flags origin) {
double v;
if (sscanf(value, "%lf", &v) != 1) {
return false;
@@ -591,7 +804,7 @@
return false;
}
-static bool set_numeric_flag(char* name, char* value, Flag::Flags origin) {
+static bool set_numeric_flag(const char* name, char* value, Flag::Flags origin) {
julong v;
int int_v;
intx intx_v;
@@ -640,14 +853,14 @@
return false;
}
-static bool set_string_flag(char* name, const char* value, Flag::Flags origin) {
+static bool set_string_flag(const char* name, const char* value, Flag::Flags origin) {
if (CommandLineFlags::ccstrAtPut(name, &value, origin) != Flag::SUCCESS) return false;
// Contract: CommandLineFlags always returns a pointer that needs freeing.
FREE_C_HEAP_ARRAY(char, value);
return true;
}
-static bool append_to_string_flag(char* name, const char* new_value, Flag::Flags origin) {
+static bool append_to_string_flag(const char* name, const char* new_value, Flag::Flags origin) {
const char* old_value = "";
if (CommandLineFlags::ccstrAt(name, &old_value) != Flag::SUCCESS) return false;
size_t old_len = old_value != NULL ? strlen(old_value) : 0;
@@ -675,6 +888,33 @@
return true;
}
+const char* Arguments::handle_aliases_and_deprecation(const char* arg, bool warn) {
+ const char* real_name = real_flag_name(arg);
+ JDK_Version since = JDK_Version();
+ switch (is_deprecated_flag(arg, &since)) {
+ case -1:
+ return NULL; // obsolete or expired, don't process normally
+ case 0:
+ return real_name;
+ case 1: {
+ if (warn) {
+ char version[256];
+ since.to_string(version, sizeof(version));
+ if (real_name != arg) {
+ warning("Option %s was deprecated in version %s and will likely be removed in a future release. Use option %s instead.",
+ arg, version, real_name);
+ } else {
+ warning("Option %s was deprecated in version %s and will likely be removed in a future release.",
+ arg, version);
+ }
+ }
+ return real_name;
+ }
+ }
+ ShouldNotReachHere();
+ return NULL;
+}
+
bool Arguments::parse_argument(const char* arg, Flag::Flags origin) {
// range of acceptable characters spelled out for portability reasons
@@ -682,27 +922,46 @@
#define BUFLEN 255
char name[BUFLEN+1];
char dummy;
+ const char* real_name;
+ bool warn_if_deprecated = true;
if (sscanf(arg, "-%" XSTR(BUFLEN) NAME_RANGE "%c", name, &dummy) == 1) {
- return set_bool_flag(name, false, origin);
+ real_name = handle_aliases_and_deprecation(name, warn_if_deprecated);
+ if (real_name == NULL) {
+ return false;
+ }
+ return set_bool_flag(real_name, false, origin);
}
if (sscanf(arg, "+%" XSTR(BUFLEN) NAME_RANGE "%c", name, &dummy) == 1) {
- return set_bool_flag(name, true, origin);
+ real_name = handle_aliases_and_deprecation(name, warn_if_deprecated);
+ if (real_name == NULL) {
+ return false;
+ }
+ return set_bool_flag(real_name, true, origin);
}
char punct;
if (sscanf(arg, "%" XSTR(BUFLEN) NAME_RANGE "%c", name, &punct) == 2 && punct == '=') {
const char* value = strchr(arg, '=') + 1;
- Flag* flag = Flag::find_flag(name, strlen(name));
+ Flag* flag;
+
+ // this scanf pattern matches both strings (handled here) and numbers (handled later))
+ real_name = handle_aliases_and_deprecation(name, warn_if_deprecated);
+ if (real_name == NULL) {
+ return false;
+ }
+ flag = Flag::find_flag(real_name);
if (flag != NULL && flag->is_ccstr()) {
if (flag->ccstr_accumulates()) {
- return append_to_string_flag(name, value, origin);
+ return append_to_string_flag(real_name, value, origin);
} else {
if (value[0] == '\0') {
value = NULL;
}
- return set_string_flag(name, value, origin);
+ return set_string_flag(real_name, value, origin);
}
+ } else {
+ warn_if_deprecated = false; // if arg is deprecated, we've already done warning...
}
}
@@ -712,7 +971,11 @@
if (value[0] == '\0') {
value = NULL;
}
- return set_string_flag(name, value, origin);
+ real_name = handle_aliases_and_deprecation(name, warn_if_deprecated);
+ if (real_name == NULL) {
+ return false;
+ }
+ return set_string_flag(real_name, value, origin);
}
#define SIGNED_FP_NUMBER_RANGE "[-0123456789.]"
@@ -723,13 +986,21 @@
if (sscanf(arg, "%" XSTR(BUFLEN) NAME_RANGE "=" "%" XSTR(BUFLEN) SIGNED_NUMBER_RANGE "." "%" XSTR(BUFLEN) NUMBER_RANGE "%c", name, value, value2, &dummy) == 3) {
// Looks like a floating-point number -- try again with more lenient format string
if (sscanf(arg, "%" XSTR(BUFLEN) NAME_RANGE "=" "%" XSTR(BUFLEN) SIGNED_FP_NUMBER_RANGE "%c", name, value, &dummy) == 2) {
- return set_fp_numeric_flag(name, value, origin);
+ real_name = handle_aliases_and_deprecation(name, warn_if_deprecated);
+ if (real_name == NULL) {
+ return false;
+ }
+ return set_fp_numeric_flag(real_name, value, origin);
}
}
#define VALUE_RANGE "[-kmgtxKMGTX0123456789abcdefABCDEF]"
if (sscanf(arg, "%" XSTR(BUFLEN) NAME_RANGE "=" "%" XSTR(BUFLEN) VALUE_RANGE "%c", name, value, &dummy) == 2) {
- return set_numeric_flag(name, value, origin);
+ real_name = handle_aliases_and_deprecation(name, warn_if_deprecated);
+ if (real_name == NULL) {
+ return false;
+ }
+ return set_numeric_flag(real_name, value, origin);
}
return false;
@@ -837,8 +1108,8 @@
}
bool Arguments::process_argument(const char* arg,
- jboolean ignore_unrecognized, Flag::Flags origin) {
-
+ jboolean ignore_unrecognized,
+ Flag::Flags origin) {
JDK_Version since = JDK_Version();
if (parse_argument(arg, origin) || ignore_unrecognized) {
@@ -864,10 +1135,10 @@
strncpy(stripped_argname, argname, arg_len);
stripped_argname[arg_len] = '\0'; // strncpy may not null terminate.
- if (is_newly_obsolete(stripped_argname, &since)) {
+ if (is_obsolete_flag(stripped_argname, &since)) {
char version[256];
since.to_string(version, sizeof(version));
- warning("ignoring option %s; support was removed in %s", stripped_argname, version);
+ warning("Ignoring option %s; support was removed in %s", stripped_argname, version);
return true;
}
}
@@ -1235,7 +1506,7 @@
static void disable_adaptive_size_policy(const char* collector_name) {
if (UseAdaptiveSizePolicy) {
if (FLAG_IS_CMDLINE(UseAdaptiveSizePolicy)) {
- warning("disabling UseAdaptiveSizePolicy; it is incompatible with %s.",
+ warning("Disabling UseAdaptiveSizePolicy; it is incompatible with %s.",
collector_name);
}
FLAG_SET_DEFAULT(UseAdaptiveSizePolicy, false);
@@ -1707,7 +1978,6 @@
} else if (UseG1GC) {
set_g1_gc_flags();
}
- check_deprecated_gc_flags();
if (AssumeMP && !UseSerialGC) {
if (FLAG_IS_DEFAULT(ParallelGCThreads) && ParallelGCThreads == 1) {
warning("If the number of processors is expected to increase from one, then"
@@ -1737,11 +2007,6 @@
static const size_t DefaultHeapBaseMinAddress = HeapBaseMinAddress;
void Arguments::set_heap_size() {
- if (!FLAG_IS_DEFAULT(DefaultMaxRAMFraction)) {
- // Deprecated flag
- FLAG_SET_CMDLINE(uintx, MaxRAMFraction, DefaultMaxRAMFraction);
- }
-
const julong phys_mem =
FLAG_IS_DEFAULT(MaxRAM) ? MIN2(os::physical_memory(), (julong)MaxRAM)
: (julong)MaxRAM;
@@ -1844,6 +2109,122 @@
}
}
+// This option inspects the machine and attempts to set various
+// parameters to be optimal for long-running, memory allocation
+// intensive jobs. It is intended for machines with large
+// amounts of cpu and memory.
+jint Arguments::set_aggressive_heap_flags() {
+ // initHeapSize is needed since _initial_heap_size is 4 bytes on a 32 bit
+ // VM, but we may not be able to represent the total physical memory
+ // available (like having 8gb of memory on a box but using a 32bit VM).
+ // Thus, we need to make sure we're using a julong for intermediate
+ // calculations.
+ julong initHeapSize;
+ julong total_memory = os::physical_memory();
+
+ if (total_memory < (julong) 256 * M) {
+ jio_fprintf(defaultStream::error_stream(),
+ "You need at least 256mb of memory to use -XX:+AggressiveHeap\n");
+ vm_exit(1);
+ }
+
+ // The heap size is half of available memory, or (at most)
+ // all of possible memory less 160mb (leaving room for the OS
+ // when using ISM). This is the maximum; because adaptive sizing
+ // is turned on below, the actual space used may be smaller.
+
+ initHeapSize = MIN2(total_memory / (julong) 2,
+ total_memory - (julong) 160 * M);
+
+ initHeapSize = limit_by_allocatable_memory(initHeapSize);
+
+ if (FLAG_IS_DEFAULT(MaxHeapSize)) {
+ if (FLAG_SET_CMDLINE(size_t, MaxHeapSize, initHeapSize) != Flag::SUCCESS) {
+ return JNI_EINVAL;
+ }
+ if (FLAG_SET_CMDLINE(size_t, InitialHeapSize, initHeapSize) != Flag::SUCCESS) {
+ return JNI_EINVAL;
+ }
+ // Currently the minimum size and the initial heap sizes are the same.
+ set_min_heap_size(initHeapSize);
+ }
+ if (FLAG_IS_DEFAULT(NewSize)) {
+ // Make the young generation 3/8ths of the total heap.
+ if (FLAG_SET_CMDLINE(size_t, NewSize,
+ ((julong) MaxHeapSize / (julong) 8) * (julong) 3) != Flag::SUCCESS) {
+ return JNI_EINVAL;
+ }
+ if (FLAG_SET_CMDLINE(size_t, MaxNewSize, NewSize) != Flag::SUCCESS) {
+ return JNI_EINVAL;
+ }
+ }
+
+#if !defined(_ALLBSD_SOURCE) && !defined(AIX) // UseLargePages is not yet supported on BSD and AIX.
+ FLAG_SET_DEFAULT(UseLargePages, true);
+#endif
+
+ // Increase some data structure sizes for efficiency
+ if (FLAG_SET_CMDLINE(size_t, BaseFootPrintEstimate, MaxHeapSize) != Flag::SUCCESS) {
+ return JNI_EINVAL;
+ }
+ if (FLAG_SET_CMDLINE(bool, ResizeTLAB, false) != Flag::SUCCESS) {
+ return JNI_EINVAL;
+ }
+ if (FLAG_SET_CMDLINE(size_t, TLABSize, 256 * K) != Flag::SUCCESS) {
+ return JNI_EINVAL;
+ }
+
+ // See the OldPLABSize comment below, but replace 'after promotion'
+ // with 'after copying'. YoungPLABSize is the size of the survivor
+ // space per-gc-thread buffers. The default is 4kw.
+ if (FLAG_SET_CMDLINE(size_t, YoungPLABSize, 256 * K) != Flag::SUCCESS) { // Note: this is in words
+ return JNI_EINVAL;
+ }
+
+ // OldPLABSize is the size of the buffers in the old gen that
+ // UseParallelGC uses to promote live data that doesn't fit in the
+ // survivor spaces. At any given time, there's one for each gc thread.
+ // The default size is 1kw. These buffers are rarely used, since the
+ // survivor spaces are usually big enough. For specjbb, however, there
+ // are occasions when there's lots of live data in the young gen
+ // and we end up promoting some of it. We don't have a definite
+ // explanation for why bumping OldPLABSize helps, but the theory
+ // is that a bigger PLAB results in retaining something like the
+ // original allocation order after promotion, which improves mutator
+ // locality. A minor effect may be that larger PLABs reduce the
+ // number of PLAB allocation events during gc. The value of 8kw
+ // was arrived at by experimenting with specjbb.
+ if (FLAG_SET_CMDLINE(size_t, OldPLABSize, 8 * K) != Flag::SUCCESS) { // Note: this is in words
+ return JNI_EINVAL;
+ }
+
+ // Enable parallel GC and adaptive generation sizing
+ if (FLAG_SET_CMDLINE(bool, UseParallelGC, true) != Flag::SUCCESS) {
+ return JNI_EINVAL;
+ }
+ FLAG_SET_DEFAULT(ParallelGCThreads,
+ Abstract_VM_Version::parallel_worker_threads());
+
+ // Encourage steady state memory management
+ if (FLAG_SET_CMDLINE(uintx, ThresholdTolerance, 100) != Flag::SUCCESS) {
+ return JNI_EINVAL;
+ }
+
+ // This appears to improve mutator locality
+ if (FLAG_SET_CMDLINE(bool, ScavengeBeforeFullGC, false) != Flag::SUCCESS) {
+ return JNI_EINVAL;
+ }
+
+ // Get around early Solaris scheduling bug
+ // (affinity vs other jobs on system)
+ // but disallow DR and offlining (5008695).
+ if (FLAG_SET_CMDLINE(bool, BindGCTaskThreadsToCPUs, true) != Flag::SUCCESS) {
+ return JNI_EINVAL;
+ }
+
+ return JNI_OK;
+}
+
// This must be called after ergonomics.
void Arguments::set_bytecode_flags() {
if (!RewriteBytecodes) {
@@ -2027,20 +2408,6 @@
return true;
}
-void Arguments::check_deprecated_gc_flags() {
- if (FLAG_IS_CMDLINE(UseParNewGC)) {
- warning("The UseParNewGC flag is deprecated and will likely be removed in a future release");
- }
- if (FLAG_IS_CMDLINE(MaxGCMinorPauseMillis)) {
- warning("Using MaxGCMinorPauseMillis as minor pause goal is deprecated"
- "and will likely be removed in future release");
- }
- if (FLAG_IS_CMDLINE(DefaultMaxRAMFraction)) {
- warning("DefaultMaxRAMFraction is deprecated and will likely be removed in a future release. "
- "Use MaxRAMFraction instead.");
- }
-}
-
// Check the consistency of vm_init_args
bool Arguments::check_vm_args_consistency() {
// Method for adding checks for flag consistency.
@@ -2576,7 +2943,7 @@
// All these options are deprecated in JDK 9 and will be removed in a future release
char version[256];
JDK_Version::jdk(9).to_string(version, sizeof(version));
- warning("ignoring option %s; support was removed in %s", option->optionString, version);
+ warning("Ignoring option %s; support was removed in %s", option->optionString, version);
} else if (match_option(option, "-XX:CodeCacheExpansionSize=", &tail)) {
julong long_CodeCacheExpansionSize = 0;
ArgsRange errcode = parse_memory_size(tail, &long_CodeCacheExpansionSize, os::vm_page_size());
@@ -2843,120 +3210,10 @@
_abort_hook = CAST_TO_FN_PTR(abort_hook_t, option->extraInfo);
// -XX:+AggressiveHeap
} else if (match_option(option, "-XX:+AggressiveHeap")) {
-
- // This option inspects the machine and attempts to set various
- // parameters to be optimal for long-running, memory allocation
- // intensive jobs. It is intended for machines with large
- // amounts of cpu and memory.
-
- // initHeapSize is needed since _initial_heap_size is 4 bytes on a 32 bit
- // VM, but we may not be able to represent the total physical memory
- // available (like having 8gb of memory on a box but using a 32bit VM).
- // Thus, we need to make sure we're using a julong for intermediate
- // calculations.
- julong initHeapSize;
- julong total_memory = os::physical_memory();
-
- if (total_memory < (julong)256*M) {
- jio_fprintf(defaultStream::error_stream(),
- "You need at least 256mb of memory to use -XX:+AggressiveHeap\n");
- vm_exit(1);
- }
-
- // The heap size is half of available memory, or (at most)
- // all of possible memory less 160mb (leaving room for the OS
- // when using ISM). This is the maximum; because adaptive sizing
- // is turned on below, the actual space used may be smaller.
-
- initHeapSize = MIN2(total_memory / (julong)2,
- total_memory - (julong)160*M);
-
- initHeapSize = limit_by_allocatable_memory(initHeapSize);
-
- if (FLAG_IS_DEFAULT(MaxHeapSize)) {
- if (FLAG_SET_CMDLINE(size_t, MaxHeapSize, initHeapSize) != Flag::SUCCESS) {
- return JNI_EINVAL;
- }
- if (FLAG_SET_CMDLINE(size_t, InitialHeapSize, initHeapSize) != Flag::SUCCESS) {
- return JNI_EINVAL;
- }
- // Currently the minimum size and the initial heap sizes are the same.
- set_min_heap_size(initHeapSize);
- }
- if (FLAG_IS_DEFAULT(NewSize)) {
- // Make the young generation 3/8ths of the total heap.
- if (FLAG_SET_CMDLINE(size_t, NewSize,
- ((julong)MaxHeapSize / (julong)8) * (julong)3) != Flag::SUCCESS) {
- return JNI_EINVAL;
- }
- if (FLAG_SET_CMDLINE(size_t, MaxNewSize, NewSize) != Flag::SUCCESS) {
- return JNI_EINVAL;
- }
+ jint result = set_aggressive_heap_flags();
+ if (result != JNI_OK) {
+ return result;
}
-
-#if !defined(_ALLBSD_SOURCE) && !defined(AIX) // UseLargePages is not yet supported on BSD and AIX.
- FLAG_SET_DEFAULT(UseLargePages, true);
-#endif
-
- // Increase some data structure sizes for efficiency
- if (FLAG_SET_CMDLINE(size_t, BaseFootPrintEstimate, MaxHeapSize) != Flag::SUCCESS) {
- return JNI_EINVAL;
- }
- if (FLAG_SET_CMDLINE(bool, ResizeTLAB, false) != Flag::SUCCESS) {
- return JNI_EINVAL;
- }
- if (FLAG_SET_CMDLINE(size_t, TLABSize, 256*K) != Flag::SUCCESS) {
- return JNI_EINVAL;
- }
-
- // See the OldPLABSize comment below, but replace 'after promotion'
- // with 'after copying'. YoungPLABSize is the size of the survivor
- // space per-gc-thread buffers. The default is 4kw.
- if (FLAG_SET_CMDLINE(size_t, YoungPLABSize, 256*K) != Flag::SUCCESS) { // Note: this is in words
- return JNI_EINVAL;
- }
-
- // OldPLABSize is the size of the buffers in the old gen that
- // UseParallelGC uses to promote live data that doesn't fit in the
- // survivor spaces. At any given time, there's one for each gc thread.
- // The default size is 1kw. These buffers are rarely used, since the
- // survivor spaces are usually big enough. For specjbb, however, there
- // are occasions when there's lots of live data in the young gen
- // and we end up promoting some of it. We don't have a definite
- // explanation for why bumping OldPLABSize helps, but the theory
- // is that a bigger PLAB results in retaining something like the
- // original allocation order after promotion, which improves mutator
- // locality. A minor effect may be that larger PLABs reduce the
- // number of PLAB allocation events during gc. The value of 8kw
- // was arrived at by experimenting with specjbb.
- if (FLAG_SET_CMDLINE(size_t, OldPLABSize, 8*K) != Flag::SUCCESS) { // Note: this is in words
- return JNI_EINVAL;
- }
-
- // Enable parallel GC and adaptive generation sizing
- if (FLAG_SET_CMDLINE(bool, UseParallelGC, true) != Flag::SUCCESS) {
- return JNI_EINVAL;
- }
- FLAG_SET_DEFAULT(ParallelGCThreads,
- Abstract_VM_Version::parallel_worker_threads());
-
- // Encourage steady state memory management
- if (FLAG_SET_CMDLINE(uintx, ThresholdTolerance, 100) != Flag::SUCCESS) {
- return JNI_EINVAL;
- }
-
- // This appears to improve mutator locality
- if (FLAG_SET_CMDLINE(bool, ScavengeBeforeFullGC, false) != Flag::SUCCESS) {
- return JNI_EINVAL;
- }
-
- // Get around early Solaris scheduling bug
- // (affinity vs other jobs on system)
- // but disallow DR and offlining (5008695).
- if (FLAG_SET_CMDLINE(bool, BindGCTaskThreadsToCPUs, true) != Flag::SUCCESS) {
- return JNI_EINVAL;
- }
-
// Need to keep consistency of MaxTenuringThreshold and AlwaysTenure/NeverTenure;
// and the last option wins.
} else if (match_option(option, "-XX:+NeverTenure")) {
@@ -3049,52 +3306,6 @@
return JNI_EINVAL;
}
#endif
- } else if (match_option(option, "-XX:CMSMarkStackSize=", &tail) ||
- match_option(option, "-XX:G1MarkStackSize=", &tail)) {
- julong stack_size = 0;
- ArgsRange errcode = parse_memory_size(tail, &stack_size, 1);
- if (errcode != arg_in_range) {
- jio_fprintf(defaultStream::error_stream(),
- "Invalid mark stack size: %s\n", option->optionString);
- describe_range_error(errcode);
- return JNI_EINVAL;
- }
- jio_fprintf(defaultStream::error_stream(),
- "Please use -XX:MarkStackSize in place of "
- "-XX:CMSMarkStackSize or -XX:G1MarkStackSize in the future\n");
- if (FLAG_SET_CMDLINE(size_t, MarkStackSize, stack_size) != Flag::SUCCESS) {
- return JNI_EINVAL;
- }
- } else if (match_option(option, "-XX:CMSMarkStackSizeMax=", &tail)) {
- julong max_stack_size = 0;
- ArgsRange errcode = parse_memory_size(tail, &max_stack_size, 1);
- if (errcode != arg_in_range) {
- jio_fprintf(defaultStream::error_stream(),
- "Invalid maximum mark stack size: %s\n",
- option->optionString);
- describe_range_error(errcode);
- return JNI_EINVAL;
- }
- jio_fprintf(defaultStream::error_stream(),
- "Please use -XX:MarkStackSizeMax in place of "
- "-XX:CMSMarkStackSizeMax in the future\n");
- if (FLAG_SET_CMDLINE(size_t, MarkStackSizeMax, max_stack_size) != Flag::SUCCESS) {
- return JNI_EINVAL;
- }
- } else if (match_option(option, "-XX:ParallelMarkingThreads=", &tail) ||
- match_option(option, "-XX:ParallelCMSThreads=", &tail)) {
- uintx conc_threads = 0;
- if (!parse_uintx(tail, &conc_threads, 1)) {
- jio_fprintf(defaultStream::error_stream(),
- "Invalid concurrent threads: %s\n", option->optionString);
- return JNI_EINVAL;
- }
- jio_fprintf(defaultStream::error_stream(),
- "Please use -XX:ConcGCThreads in place of "
- "-XX:ParallelMarkingThreads or -XX:ParallelCMSThreads in the future\n");
- if (FLAG_SET_CMDLINE(uint, ConcGCThreads, conc_threads) != Flag::SUCCESS) {
- return JNI_EINVAL;
- }
} else if (match_option(option, "-XX:MaxDirectMemorySize=", &tail)) {
julong max_direct_memory_size = 0;
ArgsRange errcode = parse_memory_size(tail, &max_direct_memory_size, 0);
@@ -3114,19 +3325,6 @@
"ManagementServer is not supported in this VM.\n");
return JNI_ERR;
#endif // INCLUDE_MANAGEMENT
- // CreateMinidumpOnCrash is removed, and replaced by CreateCoredumpOnCrash
- } else if (match_option(option, "-XX:+CreateMinidumpOnCrash")) {
- if (FLAG_SET_CMDLINE(bool, CreateCoredumpOnCrash, true) != Flag::SUCCESS) {
- return JNI_EINVAL;
- }
- jio_fprintf(defaultStream::output_stream(),
- "CreateMinidumpOnCrash is replaced by CreateCoredumpOnCrash: CreateCoredumpOnCrash is on\n");
- } else if (match_option(option, "-XX:-CreateMinidumpOnCrash")) {
- if (FLAG_SET_CMDLINE(bool, CreateCoredumpOnCrash, false) != Flag::SUCCESS) {
- return JNI_EINVAL;
- }
- jio_fprintf(defaultStream::output_stream(),
- "CreateMinidumpOnCrash is replaced by CreateCoredumpOnCrash: CreateCoredumpOnCrash is off\n");
} else if (match_option(option, "-XX:", &tail)) { // -XX:xxxx
// Skip -XX:Flags= and -XX:VMOptionsFile= since those cases have
// already been handled
@@ -3623,7 +3821,7 @@
void Arguments::set_shared_spaces_flags() {
if (DumpSharedSpaces) {
if (RequireSharedSpaces) {
- warning("cannot dump shared archive while using shared archive");
+ warning("Cannot dump shared archive while using shared archive");
}
UseSharedSpaces = false;
#ifdef _LP64
@@ -3848,6 +4046,7 @@
// Parse entry point called from JNI_CreateJavaVM
jint Arguments::parse(const JavaVMInitArgs* args) {
+ assert(verify_special_jvm_flags(), "deprecated and obsolete flag table inconsistent");
// Initialize ranges and constraints
CommandLineFlagRangeList::init();
@@ -3984,7 +4183,7 @@
if (ScavengeRootsInCode == 0) {
if (!FLAG_IS_DEFAULT(ScavengeRootsInCode)) {
- warning("forcing ScavengeRootsInCode non-zero");
+ warning("Forcing ScavengeRootsInCode non-zero");
}
ScavengeRootsInCode = 1;
}
--- a/hotspot/src/share/vm/runtime/arguments.hpp Thu Sep 17 16:53:42 2015 +0200
+++ b/hotspot/src/share/vm/runtime/arguments.hpp Fri Sep 25 12:04:35 2015 -0700
@@ -364,6 +364,8 @@
// Aggressive optimization flags.
static jint set_aggressive_opts_flags();
+ static jint set_aggressive_heap_flags();
+
// Argument parsing
static void do_pd_flag_adjustments();
static bool parse_argument(const char* arg, Flag::Flags origin);
@@ -427,11 +429,24 @@
short* methodsNum, short* methodsMax, char*** methods, bool** allClasses
);
- // Returns true if the string s is in the list of flags that have recently
- // been made obsolete. If we detect one of these flags on the command
- // line, instead of failing we print a warning message and ignore the
- // flag. This gives the user a release or so to stop using the flag.
- static bool is_newly_obsolete(const char* s, JDK_Version* buffer);
+ // Returns true if the flag is obsolete (and not yet expired).
+ // In this case the 'version' buffer is filled in with
+ // the version number when the flag became obsolete.
+ static bool is_obsolete_flag(const char* flag_name, JDK_Version* version);
+
+ // Returns 1 if the flag is deprecated (and not yet obsolete or expired).
+ // In this case the 'version' buffer is filled in with the version number when
+ // the flag became deprecated.
+ // Returns -1 if the flag is expired or obsolete.
+ // Returns 0 otherwise.
+ static int is_deprecated_flag(const char* flag_name, JDK_Version* version);
+
+ // Return the real name for the flag passed on the command line (either an alias name or "flag_name").
+ static const char* real_flag_name(const char *flag_name);
+
+ // Return the "real" name for option arg if arg is an alias, and print a warning if arg is deprecated.
+ // Return NULL if the arg has expired.
+ static const char* handle_aliases_and_deprecation(const char* arg, bool warn);
static short CompileOnlyClassesNum;
static short CompileOnlyClassesMax;
@@ -478,7 +493,6 @@
// Check for consistency in the selection of the garbage collector.
static bool check_gc_consistency(); // Check user-selected gc
- static void check_deprecated_gc_flags();
// Check consistency or otherwise of VM argument settings
static bool check_vm_args_consistency();
// Used by os_solaris
--- a/hotspot/src/share/vm/runtime/globals.hpp Thu Sep 17 16:53:42 2015 +0200
+++ b/hotspot/src/share/vm/runtime/globals.hpp Fri Sep 25 12:04:35 2015 -0700
@@ -1586,7 +1586,7 @@
"(ParallelGC only)") \
\
product(bool, ScavengeBeforeFullGC, true, \
- "Scavenge young generation before each full GC.") \
+ "Scavenge youngest generation before each full GC.") \
\
develop(bool, ScavengeWithObjectsInToSpace, false, \
"Allow scavenges to occur when to-space contains objects") \
@@ -2084,7 +2084,7 @@
"promotion failure") \
\
notproduct(bool, PromotionFailureALot, false, \
- "Use promotion failure handling on every young generation " \
+ "Use promotion failure handling on every youngest generation " \
"collection") \
\
develop(uintx, PromotionFailureALotCount, 1000, \
@@ -2170,11 +2170,6 @@
"size") \
range(1, max_uintx) \
\
- product(uintx, DefaultMaxRAMFraction, 4, \
- "Maximum fraction (1/n) of real memory used for maximum heap " \
- "size; deprecated: to be renamed to MaxRAMFraction") \
- range(1, max_uintx) \
- \
product(uintx, MinRAMFraction, 2, \
"Minimum fraction (1/n) of real memory used for maximum heap " \
"size on systems with small physical memory size") \
--- a/hotspot/src/share/vm/runtime/java.hpp Thu Sep 17 16:53:42 2015 +0200
+++ b/hotspot/src/share/vm/runtime/java.hpp Fri Sep 25 12:04:35 2015 -0700
@@ -137,6 +137,14 @@
return JDK_Version(major, 0, 0, update_number);
}
+ static JDK_Version undefined() {
+ return JDK_Version(0);
+ }
+
+ bool is_undefined() const {
+ return (_major == 0);
+ }
+
uint8_t major_version() const { return _major; }
uint8_t minor_version() const { return _minor; }
uint8_t micro_version() const { return _micro; }
--- a/hotspot/src/share/vm/runtime/jniHandles.cpp Thu Sep 17 16:53:42 2015 +0200
+++ b/hotspot/src/share/vm/runtime/jniHandles.cpp Fri Sep 25 12:04:35 2015 -0700
@@ -124,8 +124,8 @@
}
-size_t JNIHandles::weak_oops_do(BoolObjectClosure* is_alive, OopClosure* f) {
- return _weak_global_handles->weak_oops_do(is_alive, f);
+void JNIHandles::weak_oops_do(BoolObjectClosure* is_alive, OopClosure* f) {
+ _weak_global_handles->weak_oops_do(is_alive, f);
}
@@ -380,9 +380,8 @@
}
-size_t JNIHandleBlock::weak_oops_do(BoolObjectClosure* is_alive,
- OopClosure* f) {
- size_t count = 0;
+void JNIHandleBlock::weak_oops_do(BoolObjectClosure* is_alive,
+ OopClosure* f) {
for (JNIHandleBlock* current = this; current != NULL; current = current->_next) {
assert(current->pop_frame_link() == NULL,
"blocks holding weak global JNI handles should not have pop frame link set");
@@ -391,7 +390,6 @@
oop value = *root;
// traverse heap pointers only, not deleted handles or free list pointers
if (value != NULL && Universe::heap()->is_in_reserved(value)) {
- count++;
if (is_alive->do_object_b(value)) {
// The weakly referenced object is alive, update pointer
f->do_oop(root);
@@ -414,9 +412,7 @@
* JVMTI data structures may also contain weak oops. The iteration of them
* is placed here so that we don't need to add it to each of the collectors.
*/
- count += JvmtiExport::weak_oops_do(is_alive, f);
-
- return count;
+ JvmtiExport::weak_oops_do(is_alive, f);
}
--- a/hotspot/src/share/vm/runtime/jniHandles.hpp Thu Sep 17 16:53:42 2015 +0200
+++ b/hotspot/src/share/vm/runtime/jniHandles.hpp Fri Sep 25 12:04:35 2015 -0700
@@ -85,7 +85,7 @@
// Traversal of regular global handles
static void oops_do(OopClosure* f);
// Traversal of weak global handles. Unreachable oops are cleared.
- static size_t weak_oops_do(BoolObjectClosure* is_alive, OopClosure* f);
+ static void weak_oops_do(BoolObjectClosure* is_alive, OopClosure* f);
};
@@ -153,7 +153,7 @@
// Traversal of regular handles
void oops_do(OopClosure* f);
// Traversal of weak handles. Unreachable oops are cleared.
- size_t weak_oops_do(BoolObjectClosure* is_alive, OopClosure* f);
+ void weak_oops_do(BoolObjectClosure* is_alive, OopClosure* f);
// Checked JNI support
void set_planned_capacity(size_t planned_capacity) { _planned_capacity = planned_capacity; }
--- a/hotspot/src/share/vm/runtime/vmStructs.cpp Thu Sep 17 16:53:42 2015 +0200
+++ b/hotspot/src/share/vm/runtime/vmStructs.cpp Fri Sep 25 12:04:35 2015 -0700
@@ -383,7 +383,7 @@
nonstatic_field(Method, _access_flags, AccessFlags) \
nonstatic_field(Method, _vtable_index, int) \
nonstatic_field(Method, _method_size, u2) \
- nonstatic_field(Method, _intrinsic_id, u1) \
+ nonstatic_field(Method, _intrinsic_id, u2) \
nonproduct_nonstatic_field(Method, _compiled_invocation_count, int) \
volatile_nonstatic_field(Method, _code, nmethod*) \
nonstatic_field(Method, _i2i_entry, address) \
--- a/hotspot/test/TEST.groups Thu Sep 17 16:53:42 2015 +0200
+++ b/hotspot/test/TEST.groups Fri Sep 25 12:04:35 2015 -0700
@@ -190,7 +190,6 @@
gc/g1/TestShrinkToOneRegion.java \
gc/metaspace/G1AddMetaspaceDependency.java \
gc/startup_warnings/TestCMS.java \
- gc/startup_warnings/TestDefaultMaxRAMFraction.java \
gc/startup_warnings/TestDefNewCMS.java \
gc/startup_warnings/TestParallelGC.java \
gc/startup_warnings/TestParallelScavengeSerialOld.java \
--- a/hotspot/test/gc/logging/TestPrintReferences.java Thu Sep 17 16:53:42 2015 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,59 +0,0 @@
-/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
- * 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 TestPrintReferences
- * @bug 8133818
- * @summary Validate the reference processing logging
- * @key gc
- * @library /testlibrary
- * @modules java.base/sun.misc
- * java.management
- */
-
-import jdk.test.lib.ProcessTools;
-import jdk.test.lib.OutputAnalyzer;
-
-public class TestPrintReferences {
- public static void main(String[] args) throws Exception {
- ProcessBuilder pb_enabled =
- ProcessTools.createJavaProcessBuilder("-XX:+PrintGCDetails", "-XX:+PrintReferenceGC", "-Xmx10M", GCTest.class.getName());
- OutputAnalyzer output = new OutputAnalyzer(pb_enabled.start());
-
- output.shouldMatch(
- "#[0-9]+: \\[SoftReference, [0-9]+ refs, [0-9]+\\.[0-9]+ secs\\]" +
- "#[0-9]+: \\[WeakReference, [0-9]+ refs, [0-9]+\\.[0-9]+ secs\\]" +
- "#[0-9]+: \\[FinalReference, [0-9]+ refs, [0-9]+\\.[0-9]+ secs\\]" +
- "#[0-9]+: \\[PhantomReference, [0-9]+ refs, [0-9]+\\.[0-9]+ secs\\]" +
- "#[0-9]+: \\[Cleaners, [0-9]+ refs, [0-9]+\\.[0-9]+ secs\\]" +
- "#[0-9]+: \\[JNI Weak Reference, [0-9]+ refs, [0-9]+\\.[0-9]+ secs\\]");
-
- output.shouldHaveExitValue(0);
- }
-
- static class GCTest {
- public static void main(String [] args) {
- System.gc();
- }
- }
-}
--- a/hotspot/test/gc/startup_warnings/TestDefaultMaxRAMFraction.java Thu Sep 17 16:53:42 2015 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +0,0 @@
-/*
-* Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
-* 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 TestDefaultMaxRAMFraction
-* @key gc
-* @bug 8021967
-* @summary Test that the deprecated TestDefaultMaxRAMFraction flag print a warning message
-* @library /testlibrary
-* @modules java.base/sun.misc
-* java.management
-*/
-
-import jdk.test.lib.OutputAnalyzer;
-import jdk.test.lib.ProcessTools;
-
-public class TestDefaultMaxRAMFraction {
- public static void main(String[] args) throws Exception {
- ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:DefaultMaxRAMFraction=4", "-version");
- OutputAnalyzer output = new OutputAnalyzer(pb.start());
- output.shouldContain("warning: DefaultMaxRAMFraction is deprecated and will likely be removed in a future release. Use MaxRAMFraction instead.");
- output.shouldNotContain("error");
- output.shouldHaveExitValue(0);
- }
-
-}
--- a/hotspot/test/gc/startup_warnings/TestNoParNew.java Thu Sep 17 16:53:42 2015 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
-* Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
-* 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 TestNoParNew
-* @key gc
-* @bug 8065972
-* @summary Test that specifying -XX:-UseParNewGC on the command line logs a warning message
-* @library /testlibrary
-* @modules java.base/sun.misc
-* java.management
-*/
-
-import jdk.test.lib.OutputAnalyzer;
-import jdk.test.lib.ProcessTools;
-
-
-public class TestNoParNew {
-
- public static void main(String args[]) throws Exception {
- ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:-UseParNewGC", "-version");
- OutputAnalyzer output = new OutputAnalyzer(pb.start());
- output.shouldContain("warning: The UseParNewGC flag is deprecated and will likely be removed in a future release");
- output.shouldNotContain("error");
- output.shouldHaveExitValue(0);
- }
-
-}
--- a/hotspot/test/gc/startup_warnings/TestParNewCMS.java Thu Sep 17 16:53:42 2015 +0200
+++ b/hotspot/test/gc/startup_warnings/TestParNewCMS.java Fri Sep 25 12:04:35 2015 -0700
@@ -40,7 +40,7 @@
public static void main(String args[]) throws Exception {
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UseParNewGC", "-XX:+UseConcMarkSweepGC", "-version");
OutputAnalyzer output = new OutputAnalyzer(pb.start());
- output.shouldContain("warning: The UseParNewGC flag is deprecated and will likely be removed in a future release");
+ output.shouldContain("warning: Option UseParNewGC was deprecated in version");
output.shouldNotContain("error");
output.shouldHaveExitValue(0);
}
--- a/hotspot/test/runtime/CommandLine/ObsoleteFlagErrorMessage.java Thu Sep 17 16:53:42 2015 +0200
+++ b/hotspot/test/runtime/CommandLine/ObsoleteFlagErrorMessage.java Fri Sep 25 12:04:35 2015 -0700
@@ -46,7 +46,7 @@
"-XX:NmethodSweepFraction=10", "-version");
OutputAnalyzer output2 = new OutputAnalyzer(pb2.start());
- output2.shouldContain("ignoring option").shouldContain("support was removed");
+ output2.shouldContain("Ignoring option").shouldContain("support was removed");
output2.shouldContain("NmethodSweepFraction");
}
}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/runtime/CommandLine/VMAliasOptions.java Fri Sep 25 12:04:35 2015 -0700
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * 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 jdk.test.lib.*;
+import jdk.test.lib.cli.*;
+
+/*
+ * @test
+ * @bug 8061611
+ * @summary Test that various alias options correctly set the target options. See aliased_jvm_flags in arguments.cpp.
+ * @library /testlibrary
+ */
+public class VMAliasOptions {
+
+ /**
+ * each entry is {[0]: alias name, [1]: alias target, [2]: value to set
+ * (true/false/n/string)}.
+ */
+ public static final String[][] ALIAS_OPTIONS = {
+ {"DefaultMaxRAMFraction", "MaxRAMFraction", "1032"},
+ {"CMSMarkStackSizeMax", "MarkStackSizeMax", "1032"},
+ {"CMSMarkStackSize", "MarkStackSize", "1032"},
+ {"G1MarkStackSize", "MarkStackSize", "1032"},
+ {"ParallelMarkingThreads", "ConcGCThreads", "2"},
+ {"ParallelCMSThreads", "ConcGCThreads", "2"},
+ {"CreateMinidumpOnCrash", "CreateCoredumpOnCrash", "false" },
+ };
+
+ static void testAliases(String[][] optionInfo) throws Throwable {
+ String aliasNames[] = new String[optionInfo.length];
+ String optionNames[] = new String[optionInfo.length];
+ String expectedValues[] = new String[optionInfo.length];
+ for (int i = 0; i < optionInfo.length; i++) {
+ aliasNames[i] = optionInfo[i][0];
+ optionNames[i] = optionInfo[i][1];
+ expectedValues[i] = optionInfo[i][2];
+ }
+
+ OutputAnalyzer output = CommandLineOptionTest.startVMWithOptions(aliasNames, expectedValues, "-XX:+PrintFlagsFinal");
+ CommandLineOptionTest.verifyOptionValuesFromOutput(output, optionNames, expectedValues);
+ }
+
+ public static void main(String[] args) throws Throwable {
+ testAliases(ALIAS_OPTIONS);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/runtime/CommandLine/VMDeprecatedOptions.java Fri Sep 25 12:04:35 2015 -0700
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * 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 jdk.test.lib.*;
+import jdk.test.lib.cli.*;
+
+/*
+ * @test
+ * @bug 8066821
+ * @summary Test that various options are deprecated. See deprecated_jvm_flags in arguments.cpp.
+ * @library /testlibrary
+ */
+public class VMDeprecatedOptions {
+
+ /**
+ * each entry is {[0]: option name, [1]: value to set
+ * (true/false/n/string)}.
+ */
+ public static final String[][] DEPRECATED_OPTIONS = {
+ // deprecated non-alias flags:
+ {"MaxGCMinorPauseMillis", "1032"},
+ {"UseParNewGC", "false"},
+
+ // deprecated alias flags (see also aliased_jvm_flags):
+ {"DefaultMaxRAMFraction", "4"},
+ {"CMSMarkStackSizeMax", "1032"},
+ {"CMSMarkStackSize", "1032"},
+ {"G1MarkStackSize", "1032"},
+ {"ParallelMarkingThreads", "2"},
+ {"ParallelCMSThreads", "2"},
+ {"CreateMinidumpOnCrash", "false"}
+ };
+
+ static String getDeprecationString(String optionName) {
+ return "Option " + optionName
+ + " was deprecated in version [\\S]+ and will likely be removed in a future release";
+ }
+
+ static void testDeprecated(String[][] optionInfo) throws Throwable {
+ String optionNames[] = new String[optionInfo.length];
+ String expectedValues[] = new String[optionInfo.length];
+ for (int i = 0; i < optionInfo.length; i++) {
+ optionNames[i] = optionInfo[i][0];
+ expectedValues[i] = optionInfo[i][1];
+ }
+
+ OutputAnalyzer output = CommandLineOptionTest.startVMWithOptions(optionNames, expectedValues);
+
+ // check for option deprecation messages:
+ output.shouldHaveExitValue(0);
+ for (String[] deprecated : optionInfo) {
+ String match = getDeprecationString(deprecated[0]);
+ output.shouldMatch(match);
+ }
+ }
+
+ public static void main(String[] args) throws Throwable {
+ testDeprecated(DEPRECATED_OPTIONS); // Make sure that each deprecated option is mentioned in the output.
+ }
+}
--- a/hotspot/test/runtime/NMT/AutoshutdownNMT.java Thu Sep 17 16:53:42 2015 +0200
+++ b/hotspot/test/runtime/NMT/AutoshutdownNMT.java Fri Sep 25 12:04:35 2015 -0700
@@ -41,6 +41,6 @@
"-XX:-AutoShutdownNMT",
"-version");
OutputAnalyzer output = new OutputAnalyzer(pb.start());
- output.shouldContain("ignoring option AutoShutdownNMT");
+ output.shouldContain("Ignoring option AutoShutdownNMT");
}
}
--- a/hotspot/test/testlibrary/jdk/test/lib/cli/CommandLineOptionTest.java Thu Sep 17 16:53:42 2015 +0200
+++ b/hotspot/test/testlibrary/jdk/test/lib/cli/CommandLineOptionTest.java Fri Sep 25 12:04:35 2015 -0700
@@ -261,6 +261,73 @@
}
/**
+ * Start VM with given options and values.
+ * Generates command line option flags from
+ * {@code optionNames} and {@code optionValues}.
+ *
+ * @param optionNames names of options to pass in
+ * @param optionValues values of option
+ * @param additionalVMOpts additional options that should be
+ * passed to JVM.
+ * @return output from vm process
+ */
+ public static OutputAnalyzer startVMWithOptions(String[] optionNames,
+ String[] optionValues,
+ String... additionalVMOpts) throws Throwable {
+ List<String> vmOpts = new ArrayList<>();
+ if (optionNames == null || optionValues == null || optionNames.length != optionValues.length) {
+ throw new IllegalArgumentException("optionNames and/or optionValues");
+ }
+
+ for (int i = 0; i < optionNames.length; i++) {
+ vmOpts.add(prepareFlag(optionNames[i], optionValues[i]));
+ }
+ Collections.addAll(vmOpts, additionalVMOpts);
+ Collections.addAll(vmOpts, "-version");
+
+ ProcessBuilder processBuilder = ProcessTools.createJavaProcessBuilder(
+ vmOpts.toArray(new String[vmOpts.size()]));
+
+ return new OutputAnalyzer(processBuilder.start());
+ }
+
+ /**
+ * Verifies from the output that values of specified JVM options were the same as
+ * expected values.
+ *
+ * @param outputAnalyzer search output for expect options and values.
+ * @param optionNames names of tested options.
+ * @param expectedValues expected values of tested options.
+ * @throws Throwable if verification fails or some other issues occur.
+ */
+ public static void verifyOptionValuesFromOutput(OutputAnalyzer outputAnalyzer,
+ String[] optionNames,
+ String[] expectedValues) throws Throwable {
+ outputAnalyzer.shouldHaveExitValue(0);
+ for (int i = 0; i < optionNames.length; i++) {
+ outputAnalyzer.shouldMatch(String.format(
+ CommandLineOptionTest.PRINT_FLAGS_FINAL_FORMAT,
+ optionNames[i], expectedValues[i]));
+ }
+ }
+
+ /**
+ * Verifies that value of specified JVM options are the same as
+ * expected values.
+ * Generates command line option flags from
+ * {@code optionNames} and {@code expectedValues}.
+ *
+ * @param optionNames names of tested options.
+ * @param expectedValues expected values of tested options.
+ * @throws Throwable if verification fails or some other issues occur.
+ */
+ public static void verifyOptionValues(String[] optionNames,
+ String[] expectedValues) throws Throwable {
+ OutputAnalyzer outputAnalyzer = startVMWithOptions(optionNames, expectedValues, "-XX:+PrintFlagsFinal");
+ verifyOptionValuesFromOutput(outputAnalyzer, optionNames, expectedValues);
+ }
+
+ /**
* Verifies that value of specified JVM when type of newly started VM
* is the same as the type of current.
* This method filter out option with {@code optionName}
@@ -312,6 +379,24 @@
}
/**
+ * Prepares generic command line flag with name {@code name} by setting
+ * it's value to {@code value}.
+ *
+ * @param name the name of option to be prepared
+ * @param value the value of option ("+" or "-" can be used instead of "true" or "false")
+ * @return prepared command line flag
+ */
+ public static String prepareFlag(String name, String value) {
+ if (value.equals("+") || value.equalsIgnoreCase("true")) {
+ return "-XX:+" + name;
+ } else if (value.equals("-") || value.equalsIgnoreCase("false")) {
+ return "-XX:-" + name;
+ } else {
+ return "-XX:" + name + "=" + value;
+ }
+ }
+
+ /**
* Returns message that should occur in VM output if option
* {@code optionName} if unrecognized.
*
--- a/jaxp/.hgtags Thu Sep 17 16:53:42 2015 +0200
+++ b/jaxp/.hgtags Fri Sep 25 12:04:35 2015 -0700
@@ -324,3 +324,4 @@
cf809edc840ff7546677d38b13ebd8b3cae2bbda jdk9-b79
f464f9b2fb1178f6a957e5730b4b5252c6149ed9 jdk9-b80
6a418934997fc4b56664b88f8417e2f0fe658091 jdk9-b81
+53fe3c103b6fdf48e2b2676c0c4818ef5a10fa21 jdk9-b82
--- a/jaxws/.hgtags Thu Sep 17 16:53:42 2015 +0200
+++ b/jaxws/.hgtags Fri Sep 25 12:04:35 2015 -0700
@@ -327,3 +327,4 @@
42ae657e0e104fa7877996b8095f2e3ab1596118 jdk9-b79
e9940bf1c8ddaa6f1f5f1813846b080f0ccaf50b jdk9-b80
139338618c77d793ab8b550f06819ddb8381316f jdk9-b81
+52d9ad2536ba6c6f1cc5561c0a0ee2b4847fd62c jdk9-b82
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxws/src/java.xml.ws/share/classes/javax/xml/ws/package-info.java Fri Sep 25 12:04:35 2015 -0700
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * 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 package contains the core JAX-WS APIs.
+ */
+package javax.xml.ws;
--- a/jaxws/src/java.xml.ws/share/classes/javax/xml/ws/package.html Thu Sep 17 16:53:42 2015 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +0,0 @@
-<!--
- Copyright (c) 2005, 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.
--->
-
-<html>
-<body>
-This package contains the core JAX-WS APIs.
-</body>
-</html>
--- a/jaxws/src/java.xml.ws/share/classes/javax/xml/ws/spi/FactoryFinder.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jaxws/src/java.xml.ws/share/classes/javax/xml/ws/spi/FactoryFinder.java Fri Sep 25 12:04:35 2015 -0700
@@ -27,33 +27,25 @@
import java.io.*;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
import java.util.Properties;
+import java.util.logging.Level;
+import java.util.logging.Logger;
import javax.xml.ws.WebServiceException;
class FactoryFinder {
- /**
- * Creates an instance of the specified class using the specified
- * {@code ClassLoader} object.
- *
- * @exception WebServiceException if the given class could not be found
- * or could not be instantiated
- */
- private static Object newInstance(String className,
- ClassLoader classLoader)
- {
- try {
- Class spiClass = safeLoadClass(className, classLoader);
- return spiClass.newInstance();
- } catch (ClassNotFoundException x) {
- throw new WebServiceException(
- "Provider " + className + " not found", x);
- } catch (Exception x) {
- throw new WebServiceException(
- "Provider " + className + " could not be instantiated: " + x,
- x);
- }
- }
+ private static final Logger logger = Logger.getLogger("javax.xml.ws");
+
+ private static final ServiceLoaderUtil.ExceptionHandler<WebServiceException> EXCEPTION_HANDLER =
+ new ServiceLoaderUtil.ExceptionHandler<WebServiceException>() {
+ @Override
+ public WebServiceException createException(Throwable throwable, String message) {
+ return new WebServiceException(message, throwable);
+ }
+ };
/**
* Finds the implementation {@code Class} object for the given
@@ -67,7 +59,7 @@
* @return the {@code Class} object of the specified message factory;
* may not be {@code null}
*
- * @param factoryId the name of the factory to find, which is
+ * @param factoryClass the name of the factory to find, which is
* a system property
* @param fallbackClassName the implementation class name, which is
* to be used only if nothing else
@@ -75,72 +67,26 @@
* there is no fallback class name
* @exception WebServiceException if there is an error
*/
- static Object find(String factoryId, String fallbackClassName)
- {
- if (isOsgi()) {
- return lookupUsingOSGiServiceLoader(factoryId);
- }
- ClassLoader classLoader;
- try {
- classLoader = Thread.currentThread().getContextClassLoader();
- } catch (Exception x) {
- throw new WebServiceException(x.toString(), x);
- }
+ @SuppressWarnings("unchecked")
+ static <T> T find(Class<T> factoryClass, String fallbackClassName) {
+ ClassLoader classLoader = ServiceLoaderUtil.contextClassLoader(EXCEPTION_HANDLER);
- String serviceId = "META-INF/services/" + factoryId;
- // try to find services in CLASSPATH
- BufferedReader rd = null;
- try {
- InputStream is;
- if (classLoader == null) {
- is=ClassLoader.getSystemResourceAsStream(serviceId);
- } else {
- is=classLoader.getResourceAsStream(serviceId);
- }
+ T provider = ServiceLoaderUtil.firstByServiceLoader(factoryClass, logger, EXCEPTION_HANDLER);
+ if (provider != null) return provider;
- if( is!=null ) {
- rd = new BufferedReader(new InputStreamReader(is, "UTF-8"));
-
- String factoryClassName = rd.readLine();
-
- if (factoryClassName != null &&
- ! "".equals(factoryClassName)) {
- return newInstance(factoryClassName, classLoader);
- }
- }
- } catch( Exception ignored) {
- } finally {
- close(rd);
- }
-
+ String factoryId = factoryClass.getName();
// try to read from $java.home/lib/jaxws.properties
- FileInputStream inStream = null;
- try {
- String javah=System.getProperty( "java.home" );
- String configFile = javah + File.separator +
- "lib" + File.separator + "jaxws.properties";
- File f=new File( configFile );
- if( f.exists()) {
- Properties props=new Properties();
- inStream = new FileInputStream(f);
- props.load(inStream);
- String factoryClassName = props.getProperty(factoryId);
- return newInstance(factoryClassName, classLoader);
- }
- } catch(Exception ignored) {
- } finally {
- close(inStream);
- }
+ provider = (T) fromJDKProperties(factoryId, fallbackClassName, classLoader);
+ if (provider != null) return provider;
// Use the system property
- try {
- String systemProp =
- System.getProperty( factoryId );
- if( systemProp!=null) {
- return newInstance(systemProp, classLoader);
- }
- } catch (SecurityException ignored) {
+ provider = (T) fromSystemProperty(factoryId, fallbackClassName, classLoader);
+ if (provider != null) return provider;
+
+ // handling Glassfish (platform specific default)
+ if (isOsgi()) {
+ return (T) lookupUsingOSGiServiceLoader(factoryId);
}
if (fallbackClassName == null) {
@@ -148,43 +94,51 @@
"Provider for " + factoryId + " cannot be found", null);
}
- return newInstance(fallbackClassName, classLoader);
+ return (T) ServiceLoaderUtil.newInstance(fallbackClassName,
+ fallbackClassName, classLoader, EXCEPTION_HANDLER);
}
- private static void close(Closeable closeable) {
- if (closeable != null) {
- try {
- closeable.close();
- } catch (IOException ignored) {
+ private static Object fromSystemProperty(String factoryId,
+ String fallbackClassName,
+ ClassLoader classLoader) {
+ try {
+ String systemProp = System.getProperty(factoryId);
+ if (systemProp != null) {
+ return ServiceLoaderUtil.newInstance(systemProp,
+ fallbackClassName, classLoader, EXCEPTION_HANDLER);
}
+ } catch (SecurityException ignored) {
}
+ return null;
}
-
- /**
- * Loads the class, provided that the calling thread has an access to the class being loaded.
- */
- private static Class safeLoadClass(String className, ClassLoader classLoader) throws ClassNotFoundException {
+ private static Object fromJDKProperties(String factoryId,
+ String fallbackClassName,
+ ClassLoader classLoader) {
+ Path path = null;
try {
- // make sure that the current thread has an access to the package of the given name.
- SecurityManager s = System.getSecurityManager();
- if (s != null) {
- int i = className.lastIndexOf('.');
- if (i != -1) {
- s.checkPackageAccess(className.substring(0, i));
- }
+ String JAVA_HOME = System.getProperty("java.home");
+ path = Paths.get(JAVA_HOME, "conf", "jaxws.properties");
+
+ // to ensure backwards compatibility
+ if (!Files.exists(path)) {
+ path = Paths.get(JAVA_HOME, "lib", "jaxws.properties");
}
- if (classLoader == null)
- return Class.forName(className);
- else
- return classLoader.loadClass(className);
- } catch (SecurityException se) {
- // anyone can access the platform default factory class without permission
- if (Provider.DEFAULT_JAXWSPROVIDER.equals(className))
- return Class.forName(className);
- throw se;
+ if (!Files.exists(path)) {
+ Properties props = new Properties();
+ try (InputStream inStream = Files.newInputStream(path)) {
+ props.load(inStream);
+ }
+ String factoryClassName = props.getProperty(factoryId);
+ return ServiceLoaderUtil.newInstance(factoryClassName,
+ fallbackClassName, classLoader, EXCEPTION_HANDLER);
+ }
+ } catch (Exception ignored) {
+ logger.log(Level.SEVERE, "Error reading JAX-WS configuration from [" + path +
+ "] file. Check it is accessible and has correct format.", ignored);
}
+ return null;
}
private static final String OSGI_SERVICE_LOADER_CLASS_NAME = "com.sun.org.glassfish.hk2.osgiresourcelocator.ServiceLoader";
--- a/jaxws/src/java.xml.ws/share/classes/javax/xml/ws/spi/Provider.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jaxws/src/java.xml.ws/share/classes/javax/xml/ws/spi/Provider.java Fri Sep 25 12:04:35 2015 -0700
@@ -45,19 +45,12 @@
public abstract class Provider {
/**
- * A constant representing the property used to lookup the
- * name of a {@code Provider} implementation
- * class.
- */
- static public final String JAXWSPROVIDER_PROPERTY = "javax.xml.ws.spi.Provider";
-
- /**
* A constant representing the name of the default
* {@code Provider} implementation class.
**/
// Using two strings so that package renaming doesn't change it
- static final String DEFAULT_JAXWSPROVIDER
- = "com.sun"+".xml.internal.ws.spi.ProviderImpl";
+ private static final String DEFAULT_JAXWSPROVIDER =
+ "com.sun"+".xml.internal.ws.spi.ProviderImpl";
/**
* Creates a new instance of Provider
@@ -72,47 +65,22 @@
* The algorithm used to locate the provider subclass to use consists
* of the following steps:
* <ul>
- * <li>
- * If a resource with the name of
- * {@code META-INF/services/javax.xml.ws.spi.Provider}
- * exists, then its first line, if present, is used as the UTF-8 encoded
- * name of the implementation class.
- * </li>
- * <li>
- * If the $java.home/lib/jaxws.properties file exists and it is readable by
- * the {@code java.util.Properties.load(InputStream)} method and it contains
- * an entry whose key is {@code javax.xml.ws.spi.Provider}, then the value of
- * that entry is used as the name of the implementation class.
- * </li>
- * <li>
- * If a system property with the name {@code javax.xml.ws.spi.Provider}
- * is defined, then its value is used as the name of the implementation class.
- * </li>
- * <li>
- * Finally, a default implementation class name is used.
- * </li>
+ * <li> Use the service-provider loading facilities, defined by the {@link java.util.ServiceLoader} class,
+ * to attempt to locate and load an implementation of {@link javax.xml.ws.spi.Provider} service using
+ * the {@linkplain java.util.ServiceLoader#load(java.lang.Class) default loading mechanism}.
+ * <li>Use the configuration file "jaxws.properties". The file is in standard
+ * {@link java.util.Properties} format and typically located in the
+ * {@code conf} directory of the Java installation. It contains the fully qualified
+ * name of the implementation class with the key {@code javax.xml.ws.spi.Provider}.
+ * <li> If a system property with the name {@code javax.xml.ws.spi.Provider}
+ * is defined, then its value is used as the name of the implementation class.
+ * <li> Finally, a platform default implementation is used.
* </ul>
*
*/
public static Provider provider() {
try {
- Object provider = getProviderUsingServiceLoader();
- if (provider == null) {
- provider = FactoryFinder.find(JAXWSPROVIDER_PROPERTY, DEFAULT_JAXWSPROVIDER);
- }
- if (!(provider instanceof Provider)) {
- Class pClass = Provider.class;
- String classnameAsResource = pClass.getName().replace('.', '/') + ".class";
- ClassLoader loader = pClass.getClassLoader();
- if(loader == null) {
- loader = ClassLoader.getSystemClassLoader();
- }
- URL targetTypeURL = loader.getResource(classnameAsResource);
- throw new LinkageError("ClassCastException: attempting to cast" +
- provider.getClass().getClassLoader().getResource(classnameAsResource) +
- "to" + targetTypeURL.toString() );
- }
- return (Provider) provider;
+ return FactoryFinder.find(Provider.class, DEFAULT_JAXWSPROVIDER);
} catch (WebServiceException ex) {
throw ex;
} catch (Exception ex) {
@@ -120,18 +88,6 @@
}
}
- private static Provider getProviderUsingServiceLoader() {
- ServiceLoader<Provider> sl;
- Iterator<Provider> it;
- try {
- sl = ServiceLoader.load(Provider.class);
- it = (Iterator<Provider>)sl.iterator();
- } catch (Exception e) {
- throw new WebServiceException("Cannot invoke java.util.ServiceLoader#iterator()", e);
- }
- return ((it != null) && it.hasNext()) ? it.next() : null;
- }
-
/**
* Creates a service delegate object.
*
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxws/src/java.xml.ws/share/classes/javax/xml/ws/spi/ServiceLoaderUtil.java Fri Sep 25 12:04:35 2015 -0700
@@ -0,0 +1,125 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * 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 javax.xml.ws.spi;
+
+import java.util.ServiceLoader;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+/**
+ * Shared ServiceLoader/FactoryFinder Utils shared among SAAJ, JAXB and JAXWS
+ * Class duplicated to all those projects.
+ *
+ * @author Miroslav.Kos@oracle.com
+ */
+class ServiceLoaderUtil {
+
+ static <P, T extends Exception> P firstByServiceLoader(Class<P> spiClass,
+ Logger logger,
+ ExceptionHandler<T> handler) throws T {
+ logger.log(Level.FINE, "Using java.util.ServiceLoader to find {0}", spiClass.getName());
+ // service discovery
+ try {
+ ServiceLoader<P> serviceLoader = ServiceLoader.load(spiClass);
+
+ for (P impl : serviceLoader) {
+ logger.fine("ServiceProvider loading Facility used; returning object [" +
+ impl.getClass().getName() + "]");
+
+ return impl;
+ }
+ } catch (Throwable t) {
+ throw handler.createException(t, "Error while searching for service [" + spiClass.getName() + "]");
+ }
+ return null;
+ }
+
+ static void checkPackageAccess(String className) {
+ // make sure that the current thread has an access to the package of the given name.
+ SecurityManager s = System.getSecurityManager();
+ if (s != null) {
+ int i = className.lastIndexOf('.');
+ if (i != -1) {
+ s.checkPackageAccess(className.substring(0, i));
+ }
+ }
+ }
+
+ static Class nullSafeLoadClass(String className, ClassLoader classLoader) throws ClassNotFoundException {
+ if (classLoader == null) {
+ return Class.forName(className);
+ } else {
+ return classLoader.loadClass(className);
+ }
+ }
+
+ // Returns instance of required class. It checks package access (security)
+ // unless it is defaultClassname. It means if you are trying to instantiate
+ // default implementation (fallback), pass the class name to both first and second parameter.
+ static <T extends Exception> Object newInstance(String className,
+ String defaultImplClassName, ClassLoader classLoader,
+ final ExceptionHandler<T> handler) throws T {
+ try {
+ return safeLoadClass(className, defaultImplClassName, classLoader).newInstance();
+ } catch (ClassNotFoundException x) {
+ throw handler.createException(x, "Provider " + className + " not found");
+ } catch (Exception x) {
+ throw handler.createException(x, "Provider " + className + " could not be instantiated: " + x);
+ }
+ }
+
+ static Class safeLoadClass(String className,
+ String defaultImplClassName,
+ ClassLoader classLoader) throws ClassNotFoundException {
+
+ try {
+ checkPackageAccess(className);
+ } catch (SecurityException se) {
+ // anyone can access the platform default factory class without permission
+ if (defaultImplClassName != null && defaultImplClassName.equals(className)) {
+ return Class.forName(className);
+ }
+ // not platform default implementation ...
+ throw se;
+ }
+ return nullSafeLoadClass(className, classLoader);
+ }
+
+ static <T extends Exception> ClassLoader contextClassLoader(ExceptionHandler<T> exceptionHandler) throws T {
+ try {
+ return Thread.currentThread().getContextClassLoader();
+ } catch (Exception x) {
+ throw exceptionHandler.createException(x, x.toString());
+ }
+ }
+
+ static abstract class ExceptionHandler<T extends Exception> {
+
+ public abstract T createException(Throwable throwable, String message);
+
+ }
+
+}
--- a/jdk/.hgtags Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/.hgtags Fri Sep 25 12:04:35 2015 -0700
@@ -324,3 +324,4 @@
d99c2ffdd0f15753e69126583688f2f075a0a5e8 jdk9-b79
4947810137ae53abba3028cc366af953d90fa81a jdk9-b80
fdc13a2d32867ca3c57b7fa2620c6b59c83168cb jdk9-b81
+b10b64263b563e21f055c881444f625ec618b826 jdk9-b82
--- a/jdk/make/lib/CoreLibraries.gmk Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/make/lib/CoreLibraries.gmk Fri Sep 25 12:04:35 2015 -0700
@@ -239,6 +239,53 @@
##########################################################################################
+ifeq ($(OPENJDK_TARGET_OS), aix)
+ LIBJIMAGE_TOOLCHAIN := TOOLCHAIN_LINK_CXX
+endif # OPENJDK_TARGET_OS aix
+
+$(eval $(call SetupNativeCompilation,BUILD_LIBJIMAGE, \
+ LIBRARY := jimage, \
+ TOOLCHAIN := $(LIBJIMAGE_TOOLCHAIN), \
+ OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
+ OPTIMIZATION := LOW, \
+ SRC := $(JDK_TOPDIR)/src/java.base/share/native/libjimage \
+ $(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/libjimage, \
+ EXCLUDES := $(LIBJIMAGE_EXCLUDES), \
+ CFLAGS := $(CFLAGS_JDKLIB) \
+ $(JIMAGELIB_CPPFLAGS) \
+ -I$(JDK_TOPDIR)/src/java.base/share/native/libjava \
+ -I$(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/libjava \
+ -I$(JDK_TOPDIR)/src/java.base/share/native/libjimage \
+ -I$(SUPPORT_OUTPUTDIR)/headers/java.base, \
+ CFLAGS_unix := -UDEBUG, \
+ MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libjimage/mapfile-vers, \
+ LDFLAGS := $(LDFLAGS_JDKLIB) \
+ $(call SET_SHARED_LIBRARY_ORIGIN) \
+ $(EXPORT_JIMAGE_FUNCS), \
+ LDFLAGS_windows := -export:JIMAGE_Open -export:JIMAGE_Close \
+ -export:JIMAGE_PackageToModule \
+ -export:JIMAGE_FindResource -export:JIMAGE_GetResource \
+ -export:JIMAGE_ResourceIterator, \
+ LDFLAGS_SUFFIX_unix := -ljvm -ldl $(LIBCXX), \
+ LDFLAGS_SUFFIX_linux := , \
+ LDFLAGS_SUFFIX_solaris := -lc, \
+ LDFLAGS_SUFFIX_aix := ,\
+ LDFLAGS_SUFFIX_macosx := -lc++, \
+ LDFLAGS_SUFFIX_windows := jvm.lib, \
+ VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \
+ RC_FLAGS := $(RC_FLAGS) \
+ -D "JDK_FNAME=jimage.dll" \
+ -D "JDK_INTERNAL_NAME=jimage" \
+ -D "JDK_FTYPE=0x2L", \
+ OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjimage, \
+ DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
+
+$(BUILD_LIBJIMAGE): $(BUILD_LIBJAVA)
+
+TARGETS += $(BUILD_LIBJIMAGE)
+
+##########################################################################################
+
LIBJLI_SRC_DIRS := $(call FindSrcDirsForLib, java.base, jli)
LIBJLI_CFLAGS := $(CFLAGS_JDKLIB)
--- a/jdk/make/mapfiles/libjava/mapfile-vers Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/make/mapfiles/libjava/mapfile-vers Fri Sep 25 12:04:35 2015 -0700
@@ -150,7 +150,6 @@
Java_java_lang_StrictMath_exp;
Java_java_lang_StrictMath_log;
Java_java_lang_StrictMath_log10;
- Java_java_lang_StrictMath_pow;
Java_java_lang_StrictMath_sin;
Java_java_lang_StrictMath_sqrt;
Java_java_lang_StrictMath_cbrt;
@@ -240,16 +239,6 @@
Java_java_util_TimeZone_getSystemTimeZoneID;
Java_java_util_TimeZone_getSystemGMTOffsetID;
Java_java_util_concurrent_atomic_AtomicLong_VMSupportsCS8;
- Java_jdk_internal_jimage_ImageNativeSubstrate_openImage;
- Java_jdk_internal_jimage_ImageNativeSubstrate_closeImage;
- Java_jdk_internal_jimage_ImageNativeSubstrate_getIndexAddress;
- Java_jdk_internal_jimage_ImageNativeSubstrate_getDataAddress;
- Java_jdk_internal_jimage_ImageNativeSubstrate_read;
- Java_jdk_internal_jimage_ImageNativeSubstrate_readCompressed;
- Java_jdk_internal_jimage_ImageNativeSubstrate_getStringBytes;
- Java_jdk_internal_jimage_ImageNativeSubstrate_getAttributes;
- Java_jdk_internal_jimage_ImageNativeSubstrate_findAttributes;
- Java_jdk_internal_jimage_ImageNativeSubstrate_attributeOffsets;
Java_sun_misc_MessageUtils_toStderr;
Java_sun_misc_MessageUtils_toStdout;
Java_sun_misc_NativeSignalHandler_handle0;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/make/mapfiles/libjimage/mapfile-vers Fri Sep 25 12:04:35 2015 -0700
@@ -0,0 +1,55 @@
+#
+# Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+# 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 public interface.
+
+SUNWprivate_1.1 {
+ global:
+ JNI_OnLoad;
+ Java_jdk_internal_jimage_ImageNativeSubstrate_openImage;
+ Java_jdk_internal_jimage_ImageNativeSubstrate_closeImage;
+ Java_jdk_internal_jimage_ImageNativeSubstrate_getIndexAddress;
+ Java_jdk_internal_jimage_ImageNativeSubstrate_getDataAddress;
+ Java_jdk_internal_jimage_ImageNativeSubstrate_read;
+ Java_jdk_internal_jimage_ImageNativeSubstrate_readCompressed;
+ Java_jdk_internal_jimage_ImageNativeSubstrate_getStringBytes;
+ Java_jdk_internal_jimage_ImageNativeSubstrate_getAttributes;
+ Java_jdk_internal_jimage_ImageNativeSubstrate_findAttributes;
+ Java_jdk_internal_jimage_ImageNativeSubstrate_attributeOffsets;
+ Java_jdk_internal_jimage_ImageNativeSubstrate_JIMAGE_1Open;
+ Java_jdk_internal_jimage_ImageNativeSubstrate_JIMAGE_1Close;
+ Java_jdk_internal_jimage_ImageNativeSubstrate_JIMAGE_1FindResource;
+ Java_jdk_internal_jimage_ImageNativeSubstrate_JIMAGE_1GetResource;
+ Java_jdk_internal_jimage_ImageNativeSubstrate_JIMAGE_1PackageToModule;
+ Java_jdk_internal_jimage_ImageNativeSubstrate_JIMAGE_1Resources;
+ JIMAGE_Open;
+ JIMAGE_Close;
+ JIMAGE_PackageToModule;
+ JIMAGE_FindResource;
+ JIMAGE_GetResource;
+ JIMAGE_ResourceIterator;
+ local:
+ *;
+};
--- a/jdk/make/mapfiles/libzip/reorder-sparc Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/make/mapfiles/libzip/reorder-sparc Fri Sep 25 12:04:35 2015 -0700
@@ -12,6 +12,7 @@
text: .text%addMetaName: OUTPUTDIR/zip_util.o;
text: .text%ZIP_FindEntry;
text: .text%ZIP_GetEntry;
+text: .text%ZIP_InflateFully;
text: .text%ZIP_Lock;
text: .text%ZIP_Unlock;
text: .text%ZIP_FreeEntry;
--- a/jdk/make/mapfiles/libzip/reorder-sparcv9 Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/make/mapfiles/libzip/reorder-sparcv9 Fri Sep 25 12:04:35 2015 -0700
@@ -11,6 +11,7 @@
text: .text%addMetaName: OUTPUTDIR/zip_util.o;
text: .text%ZIP_FindEntry;
text: .text%ZIP_GetEntry;
+text: .text%ZIP_InflateFully;
text: .text%ZIP_Lock;
text: .text%ZIP_Unlock;
text: .text%ZIP_FreeEntry;
--- a/jdk/make/mapfiles/libzip/reorder-x86 Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/make/mapfiles/libzip/reorder-x86 Fri Sep 25 12:04:35 2015 -0700
@@ -12,6 +12,7 @@
text: .text%addMetaName: OUTPUTDIR/zip_util.o;
text: .text%ZIP_FindEntry;
text: .text%ZIP_GetEntry;
+text: .text%ZIP_InflateFully;
text: .text%ZIP_Lock;
text: .text%ZIP_Unlock;
text: .text%ZIP_FreeEntry;
--- a/jdk/make/netbeans/jmx/build.xml Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/make/netbeans/jmx/build.xml Fri Sep 25 12:04:35 2015 -0700
@@ -63,8 +63,8 @@
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<!-- Call rmic-jmx subtargets -->
- <target name="-rmic-jmx" depends="-init,-rmic-jmx-jrmp,-rmic-jmx-iiop"
- description="Calls -init,-rmic-jmx-jrmp,-rmic-jmx-iiop"
+ <target name="-rmic-jmx" depends="-init,-rmic-jmx-jrmp"
+ description="Calls -init,-rmic-jmx-jrmp"
/>
@@ -90,44 +90,6 @@
</target>
-
- <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
- <!-- Generate RMI IIOP stub class files for remote objects -->
-
- <target name="-rmic-jmx-iiop" depends="-init,-check-jmx-iiop-uptodate" unless="jmx-iiop-uptodate"
- description="Generate RMI IIOP stub class files for remote objects. Do not keep generated java files." >
-
- <rmic base="${classes.dir}"
- includeAntRuntime="no"
- includeJavaRuntime="no"
- stubversion="1.2"
- iiop="yes"
- >
- <include name="javax/management/remote/rmi/RMIConnectionImpl.class" />
- <include name="javax/management/remote/rmi/RMIServerImpl.class" />
- </rmic>
-
- </target>
-
-
- <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
- <!-- Check if jmx rmic generated IIOP stub and tie class files are up to date -->
-
- <target name="-check-jmx-iiop-uptodate" depends="-init">
-
- <uptodate property="jmx-iiop-uptodate"
- srcfile="${classes.dir}/javax/management/remote/rmi/RMIConnectionImpl.class"
- targetfile="${classes.dir}/org/omg/stub/javax/management/remote/rmi/_RMIConnectionImpl_Tie.class"
- />
- <uptodate property="jmx-iiop-uptodate"
- srcfile="${classes.dir}/javax/management/remote/rmi/RMIServerImpl.class"
- targetfile="${classes.dir}/org/omg/stub/javax/management/remote/rmi/_RMIServerImpl_Tie.class"
- />
-
- <echo message="jmx-iiop-uptodate=${jmx-iiop-uptodate}" />
-
- </target>
-
<target name="-post-compile" depends="-init,-rmic-jmx"
description="Jar JMX class files (including RMI stubs)" >
<mkdir dir="${dist.dir}/lib"/>
--- a/jdk/make/rmic/Rmic-java.management.gmk Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/make/rmic/Rmic-java.management.gmk Fri Sep 25 12:04:35 2015 -0700
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@@ -32,38 +32,31 @@
# Generate RMI stubs
#
-# For RMI/IIOP call rmic a second time with -standardPackage option
-# so that *_tie classes are generated in package without the prefix
-# org.omg.stub (6375696)
JMX_RMI_CLASSES := javax.management.remote.rmi.RMIConnectionImpl \
javax.management.remote.rmi.RMIServerImpl
-GENRMIIIOPCLASSES :=
-ifneq ($(RMICONNECTOR_IIOP), false)
- GENRMIIIOPCLASSES := $(RMICONNECTOR_IIOP)
-endif
-$(eval $(call SetupRMICompilation,RMI_IIOP, \
+
+# Generate into gensrc dir where sources get picked up for javadoc, then move the classes
+# into the stub classes dir.
+$(eval $(call SetupRMICompilation,RMI_GEN, \
CLASSES := $(JMX_RMI_CLASSES), \
CLASSES_DIR := $(CLASSES_DIR)/java.management, \
- STUB_CLASSES_DIR := $(STUB_CLASSES_DIR)/java.management, \
+ STUB_CLASSES_DIR := $(RMIC_GENSRC_DIR), \
RUN_V12 := true, \
- RUN_IIOP := $(GENRMIIIOPCLASSES), \
- RUN_IIOP_STDPKG := $(GENRMIIIOPCLASSES)))
+ KEEP_GENERATED := true, \
+))
-# Keep generated RMI/JRMP Stub source files and copy them to RMIC_GENSRC_DIR
-# so that javadoc can include them in the API (4997471)
-$(eval $(call SetupRMICompilation,RMI_SRC, \
- CLASSES := $(JMX_RMI_CLASSES), \
- CLASSES_DIR := $(CLASSES_DIR)/java.management, \
- STUB_CLASSES_DIR := $(RMIC_GENSRC_DIR)/java.management, \
- RUN_V12 := true, \
- KEEP_GENERATED := true))
+# Find all classes generated and move them from the gensrc dir to the stub classes dir
+$(RMIC_GENSRC_DIR)/_classes.moved: $(RMI_GEN)
+ $(eval classfiles := $(shell $(FIND) $(RMIC_GENSRC_DIR) -name "*.class"))
+ $(foreach src, $(classfiles), \
+ $(eval target := $(patsubst $(RMIC_GENSRC_DIR)/%, \
+ $(STUB_CLASSES_DIR)/java.management/%, $(src))) \
+ $(MKDIR) -p $(dir $(target)) ; \
+ $(MV) $(src) $(target) $(NEWLINE))
+ $(TOUCH) $@
##########################################################################################
-$(RMIC_GENSRC_DIR)/_the.classes.removed: $(RMI_IIOP) $(RMI_SRC)
- $(FIND) $(RMIC_GENSRC_DIR) -name "*.class" $(FIND_DELETE)
- $(TOUCH) $@
-
-all: $(RMIC_GENSRC_DIR)/_the.classes.removed $(RMI_IIOP) $(RMI_SRC)
+all: $(RMIC_GENSRC_DIR)/_classes.moved $(RMI_GEN)
.PHONY: all
--- a/jdk/src/java.base/macosx/classes/java/net/DefaultInterface.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/macosx/classes/java/net/DefaultInterface.java Fri Sep 25 12:04:35 2015 -0700
@@ -42,7 +42,7 @@
class DefaultInterface {
- private final static NetworkInterface defaultInterface =
+ private static final NetworkInterface defaultInterface =
chooseDefaultInterface();
static NetworkInterface getDefault() {
--- a/jdk/src/java.base/macosx/classes/sun/util/locale/provider/HostLocaleProviderAdapterImpl.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/macosx/classes/sun/util/locale/provider/HostLocaleProviderAdapterImpl.java Fri Sep 25 12:04:35 2015 -0700
@@ -106,7 +106,7 @@
tmpSet.addAll(Control.getNoFallbackControl(Control.FORMAT_DEFAULT).getCandidateLocales("", l));
supportedLocaleSet = Collections.unmodifiableSet(tmpSet);
}
- private final static Locale[] supportedLocale = supportedLocaleSet.toArray(new Locale[0]);
+ private static final Locale[] supportedLocale = supportedLocaleSet.toArray(new Locale[0]);
@SuppressWarnings("fallthrough")
private static Locale convertMacOSXLocaleToJavaLocale(String macosxloc) {
--- a/jdk/src/java.base/macosx/native/libosxsecurity/KeystoreImpl.m Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/macosx/native/libosxsecurity/KeystoreImpl.m Fri Sep 25 12:04:35 2015 -0700
@@ -508,7 +508,7 @@
SecKeychainRef defaultKeychain = NULL;
SecKeychainCopyDefault(&defaultKeychain);
- SecExternalItemType dataType = (isCertificate == JNI_TRUE ? kSecFormatX509Cert : kSecFormatWrappedPKCS8);
+ SecExternalFormat dataFormat = (isCertificate == JNI_TRUE ? kSecFormatX509Cert : kSecFormatWrappedPKCS8);
// Convert the password obj into a CFStringRef that the keychain importer can use for encryption.
SecKeyImportExportParameters paramBlock;
@@ -533,7 +533,7 @@
paramBlock.keyUsage = CSSM_KEYUSE_ANY;
paramBlock.keyAttributes = CSSM_KEYATTR_RETURN_DEFAULT;
- err = SecKeychainItemImport(cfDataToImport, NULL, &dataType, NULL,
+ err = SecKeychainItemImport(cfDataToImport, NULL, &dataFormat, NULL,
0, ¶mBlock, defaultKeychain, &createdItems);
if (err == noErr) {
--- a/jdk/src/java.base/share/classes/com/sun/crypto/provider/JceKeyStore.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/com/sun/crypto/provider/JceKeyStore.java Fri Sep 25 12:04:35 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -864,7 +864,9 @@
if (computed[i] != actual[i]) {
throw new IOException(
"Keystore was tampered with, or "
- + "password was incorrect");
+ + "password was incorrect",
+ new UnrecoverableKeyException(
+ "Password verification failed"));
}
}
}
--- a/jdk/src/java.base/share/classes/com/sun/crypto/provider/RC2Crypt.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/com/sun/crypto/provider/RC2Crypt.java Fri Sep 25 12:04:35 2015 -0700
@@ -45,7 +45,7 @@
final class RC2Crypt extends SymmetricCipher {
// PITABLE from the RFC, used in key setup
- private final static int[] PI_TABLE = new int[] {
+ private static final int[] PI_TABLE = new int[] {
0xd9, 0x78, 0xf9, 0xc4, 0x19, 0xdd, 0xb5, 0xed,
0x28, 0xe9, 0xfd, 0x79, 0x4a, 0xa0, 0xd8, 0x9d,
0xc6, 0x7e, 0x37, 0x83, 0x2b, 0x76, 0x53, 0x8e,
--- a/jdk/src/java.base/share/classes/com/sun/crypto/provider/RC2Parameters.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/com/sun/crypto/provider/RC2Parameters.java Fri Sep 25 12:04:35 2015 -0700
@@ -59,7 +59,7 @@
// TABLE[EKB] from section 6 of RFC 2268, used to convert effective key
// size to/from encoded version number
- private final static int[] EKB_TABLE = new int[] {
+ private static final int[] EKB_TABLE = new int[] {
0xbd, 0x56, 0xea, 0xf2, 0xa2, 0xf1, 0xac, 0x2a,
0xb0, 0x93, 0xd1, 0x9c, 0x1b, 0x33, 0xfd, 0xd0,
0x30, 0x04, 0xb6, 0xdc, 0x7d, 0xdf, 0x32, 0x4b,
--- a/jdk/src/java.base/share/classes/com/sun/crypto/provider/RSACipher.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/com/sun/crypto/provider/RSACipher.java Fri Sep 25 12:04:35 2015 -0700
@@ -66,23 +66,23 @@
public final class RSACipher extends CipherSpi {
// constant for an empty byte array
- private final static byte[] B0 = new byte[0];
+ private static final byte[] B0 = new byte[0];
// mode constant for public key encryption
- private final static int MODE_ENCRYPT = 1;
+ private static final int MODE_ENCRYPT = 1;
// mode constant for private key decryption
- private final static int MODE_DECRYPT = 2;
+ private static final int MODE_DECRYPT = 2;
// mode constant for private key encryption (signing)
- private final static int MODE_SIGN = 3;
+ private static final int MODE_SIGN = 3;
// mode constant for public key decryption (verifying)
- private final static int MODE_VERIFY = 4;
+ private static final int MODE_VERIFY = 4;
// constant for raw RSA
- private final static String PAD_NONE = "NoPadding";
+ private static final String PAD_NONE = "NoPadding";
// constant for PKCS#1 v1.5 RSA
- private final static String PAD_PKCS1 = "PKCS1Padding";
+ private static final String PAD_PKCS1 = "PKCS1Padding";
// constant for PKCS#2 v2.0 OAEP with MGF1
- private final static String PAD_OAEP_MGF1 = "OAEP";
+ private static final String PAD_OAEP_MGF1 = "OAEP";
// current mode, one of MODE_* above. Set when init() is called
private int mode;
--- a/jdk/src/java.base/share/classes/com/sun/crypto/provider/TlsKeyMaterialGenerator.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/com/sun/crypto/provider/TlsKeyMaterialGenerator.java Fri Sep 25 12:04:35 2015 -0700
@@ -43,7 +43,7 @@
*/
public final class TlsKeyMaterialGenerator extends KeyGeneratorSpi {
- private final static String MSG = "TlsKeyMaterialGenerator must be "
+ private static final String MSG = "TlsKeyMaterialGenerator must be "
+ "initialized using a TlsKeyMaterialParameterSpec";
@SuppressWarnings("deprecation")
--- a/jdk/src/java.base/share/classes/com/sun/crypto/provider/TlsMasterSecretGenerator.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/com/sun/crypto/provider/TlsMasterSecretGenerator.java Fri Sep 25 12:04:35 2015 -0700
@@ -43,7 +43,7 @@
*/
public final class TlsMasterSecretGenerator extends KeyGeneratorSpi {
- private final static String MSG = "TlsMasterSecretGenerator must be "
+ private static final String MSG = "TlsMasterSecretGenerator must be "
+ "initialized using a TlsMasterSecretParameterSpec";
@SuppressWarnings("deprecation")
--- a/jdk/src/java.base/share/classes/com/sun/crypto/provider/TlsPrfGenerator.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/com/sun/crypto/provider/TlsPrfGenerator.java Fri Sep 25 12:04:35 2015 -0700
@@ -50,23 +50,23 @@
// magic constants and utility functions, also used by other files
// in this package
- private final static byte[] B0 = new byte[0];
+ private static final byte[] B0 = new byte[0];
- final static byte[] LABEL_MASTER_SECRET = // "master secret"
+ static final byte[] LABEL_MASTER_SECRET = // "master secret"
{ 109, 97, 115, 116, 101, 114, 32, 115, 101, 99, 114, 101, 116 };
- final static byte[] LABEL_KEY_EXPANSION = // "key expansion"
+ static final byte[] LABEL_KEY_EXPANSION = // "key expansion"
{ 107, 101, 121, 32, 101, 120, 112, 97, 110, 115, 105, 111, 110 };
- final static byte[] LABEL_CLIENT_WRITE_KEY = // "client write key"
+ static final byte[] LABEL_CLIENT_WRITE_KEY = // "client write key"
{ 99, 108, 105, 101, 110, 116, 32, 119, 114, 105, 116, 101, 32,
107, 101, 121 };
- final static byte[] LABEL_SERVER_WRITE_KEY = // "server write key"
+ static final byte[] LABEL_SERVER_WRITE_KEY = // "server write key"
{ 115, 101, 114, 118, 101, 114, 32, 119, 114, 105, 116, 101, 32,
107, 101, 121 };
- final static byte[] LABEL_IV_BLOCK = // "IV block"
+ static final byte[] LABEL_IV_BLOCK = // "IV block"
{ 73, 86, 32, 98, 108, 111, 99, 107 };
/*
@@ -79,7 +79,7 @@
private static final byte[] HMAC_opad128 = genPad((byte)0x5c, 128);
// SSL3 magic mix constants ("A", "BB", "CCC", ...)
- final static byte[][] SSL3_CONST = genConst();
+ static final byte[][] SSL3_CONST = genConst();
static byte[] genPad(byte b, int count) {
byte[] padding = new byte[count];
@@ -109,7 +109,7 @@
// PRF implementation
- private final static String MSG = "TlsPrfGenerator must be "
+ private static final String MSG = "TlsPrfGenerator must be "
+ "initialized using a TlsPrfParameterSpec";
@SuppressWarnings("deprecation")
@@ -368,7 +368,7 @@
* appropriate supportsParamters() checks into KeyGenerators (not
* currently there).
*/
- static public class V12 extends TlsPrfGenerator {
+ public static class V12 extends TlsPrfGenerator {
protected SecretKey engineGenerateKey() {
return engineGenerateKey0(true);
}
@@ -377,7 +377,7 @@
/**
* A KeyGenerator implementation that supports TLS 1.0/1.1.
*/
- static public class V10 extends TlsPrfGenerator {
+ public static class V10 extends TlsPrfGenerator {
protected SecretKey engineGenerateKey() {
return engineGenerateKey0(false);
}
--- a/jdk/src/java.base/share/classes/com/sun/crypto/provider/TlsRsaPremasterSecretGenerator.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/com/sun/crypto/provider/TlsRsaPremasterSecretGenerator.java Fri Sep 25 12:04:35 2015 -0700
@@ -41,7 +41,7 @@
*/
public final class TlsRsaPremasterSecretGenerator extends KeyGeneratorSpi {
- private final static String MSG = "TlsRsaPremasterSecretGenerator must be "
+ private static final String MSG = "TlsRsaPremasterSecretGenerator must be "
+ "initialized using a TlsRsaPremasterSecretParameterSpec";
@SuppressWarnings("deprecation")
--- a/jdk/src/java.base/share/classes/com/sun/java/util/jar/pack/Attribute.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/com/sun/java/util/jar/pack/Attribute.java Fri Sep 25 12:04:35 2015 -0700
@@ -342,7 +342,7 @@
* presence of attributes. That is, flags are a mix of modifier
* bits and attribute indicators.
*/
- public static abstract
+ public abstract static
class Holder {
// We need this abstract method to interpret embedded CP refs.
@@ -461,7 +461,7 @@
// Lightweight interface to hide details of band structure.
// Also used for testing.
- public static abstract
+ public abstract static
class ValueStream {
public int getInt(int bandIndex) { throw undef(); }
public void putInt(int bandIndex, int value) { throw undef(); }
@@ -667,7 +667,7 @@
public boolean hasCallables() {
return (elems.length > 0 && elems[0].kind == EK_CBLE);
}
- static private final Element[] noElems = {};
+ private static final Element[] noElems = {};
public Element[] getCallables() {
if (hasCallables()) {
Element[] nelems = Arrays.copyOf(elems, elems.length);
@@ -783,7 +783,7 @@
* Replaces '\c' by the decimal code of the character c.
* Replaces '0xNNN' by the decimal code of the hex number NNN.
*/
- static public
+ public static
String normalizeLayoutString(String layout) {
StringBuilder buf = new StringBuilder();
for (int i = 0, len = layout.length(); i < len; ) {
@@ -1139,7 +1139,7 @@
bodies.toArray(res);
return res;
}
- static private
+ private static
int skipBody(String layout, int i) {
assert(layout.charAt(i-1) == '[');
if (layout.charAt(i) == ']')
@@ -1156,7 +1156,7 @@
assert(layout.charAt(i) == ']');
return i; // return closing bracket
}
- static private
+ private static
int tokenizeUInt(Layout.Element e, String layout, int i) {
switch (layout.charAt(i++)) {
case 'V': e.len = 0; break;
@@ -1167,7 +1167,7 @@
}
return i;
}
- static private
+ private static
int tokenizeSInt(Layout.Element e, String layout, int i) {
if (layout.charAt(i) == 'S') {
e.flags |= EF_SIGN;
@@ -1176,7 +1176,7 @@
return tokenizeUInt(e, layout, i);
}
- static private
+ private static
boolean isDigit(char c) {
return c >= '0' && c <= '9';
}
@@ -1383,7 +1383,7 @@
return e.body[lastj];
}
- static private
+ private static
int parseInt(Layout.Element e, byte[] bytes, int pos, int[] buf) {
int value = 0;
int loBits = e.len * 8;
@@ -1483,7 +1483,7 @@
}
}
- static private
+ private static
void unparseInt(Layout.Element e, int value, ByteArrayOutputStream out) {
int loBits = e.len * 8;
if (loBits == 0) {
--- a/jdk/src/java.base/share/classes/com/sun/java/util/jar/pack/BandStructure.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/com/sun/java/util/jar/pack/BandStructure.java Fri Sep 25 12:04:35 2015 -0700
@@ -73,7 +73,7 @@
boolean optVaryCodings = !p200.getBoolean(Utils.COM_PREFIX+"no.vary.codings");
boolean optBigStrings = !p200.getBoolean(Utils.COM_PREFIX+"no.big.strings");
- abstract protected Index getCPIndex(byte tag);
+ protected abstract Index getCPIndex(byte tag);
// Local copy of highest class version.
private Package.Version highestClassVersion = null;
@@ -97,27 +97,27 @@
protected BandStructure() {}
- final static Coding BYTE1 = Coding.of(1,256);
+ static final Coding BYTE1 = Coding.of(1,256);
- final static Coding CHAR3 = Coding.of(3,128);
+ static final Coding CHAR3 = Coding.of(3,128);
// Note: Tried sharper (3,16) with no post-zip benefit.
// This is best used with BCI values:
- final static Coding BCI5 = Coding.of(5,4); // mostly 1-byte offsets
- final static Coding BRANCH5 = Coding.of(5,4,2); // mostly forward branches
+ static final Coding BCI5 = Coding.of(5,4); // mostly 1-byte offsets
+ static final Coding BRANCH5 = Coding.of(5,4,2); // mostly forward branches
- final static Coding UNSIGNED5 = Coding.of(5,64);
- final static Coding UDELTA5 = UNSIGNED5.getDeltaCoding();
+ static final Coding UNSIGNED5 = Coding.of(5,64);
+ static final Coding UDELTA5 = UNSIGNED5.getDeltaCoding();
// "sharp" (5,64) zips 0.4% better than "medium" (5,128)
// It zips 1.1% better than "flat" (5,192)
- final static Coding SIGNED5 = Coding.of(5,64,1); //sharp
- final static Coding DELTA5 = SIGNED5.getDeltaCoding();
+ static final Coding SIGNED5 = Coding.of(5,64,1); //sharp
+ static final Coding DELTA5 = SIGNED5.getDeltaCoding();
// Note: Tried (5,128,2) and (5,192,2) with no benefit.
- final static Coding MDELTA5 = Coding.of(5,64,2).getDeltaCoding();
+ static final Coding MDELTA5 = Coding.of(5,64,2).getDeltaCoding();
- final private static Coding[] basicCodings = {
+ private static final Coding[] basicCodings = {
// Table of "Canonical BHSD Codings" from Pack200 spec.
null, // _meta_default
@@ -250,7 +250,7 @@
null
};
- final private static Map<Coding, Integer> basicCodingIndexes;
+ private static final Map<Coding, Integer> basicCodingIndexes;
static {
assert(basicCodings[_meta_default] == null);
assert(basicCodings[_meta_canon_min] != null);
@@ -362,9 +362,9 @@
protected long outputSize = -1; // cache
- final public Coding regularCoding;
+ public final Coding regularCoding;
- final public int seqForDebug;
+ public final int seqForDebug;
public int elementCountForDebug;
@@ -430,7 +430,7 @@
protected abstract long computeOutputSize();
- abstract protected void writeDataTo(OutputStream out) throws IOException;
+ protected abstract void writeDataTo(OutputStream out) throws IOException;
/** Expect a certain number of values. */
void expectLength(int l) {
@@ -468,7 +468,7 @@
readDataFrom(in);
readyToDisburse();
}
- abstract protected void readDataFrom(InputStream in) throws IOException;
+ protected abstract void readDataFrom(InputStream in) throws IOException;
protected void readyToDisburse() {
if (verbose > 1) Utils.log.fine("readyToDisburse "+this);
setPhase(DISBURSE_PHASE);
@@ -1447,7 +1447,7 @@
return b;
}
- static private final boolean NULL_IS_OK = true;
+ private static final boolean NULL_IS_OK = true;
MultiBand all_bands = (MultiBand) new MultiBand("(package)", UNSIGNED5).init();
@@ -2539,7 +2539,7 @@
return false;
}
- static private boolean assertDoneDisbursing(Band b) {
+ private static boolean assertDoneDisbursing(Band b) {
if (b.phase != DISBURSE_PHASE) {
Utils.log.warning("assertDoneDisbursing: still in phase "+b.phase+": "+b);
if (verbose() <= 1) return false; // fail now
@@ -2562,7 +2562,7 @@
return true;
}
- static private void printCDecl(Band b) {
+ private static void printCDecl(Band b) {
if (b instanceof MultiBand) {
MultiBand mb = (MultiBand) b;
for (int i = 0; i < mb.bandCount; i++) {
--- a/jdk/src/java.base/share/classes/com/sun/java/util/jar/pack/Code.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/com/sun/java/util/jar/pack/Code.java Fri Sep 25 12:04:35 2015 -0700
@@ -56,7 +56,7 @@
return m.getCPMap();
}
- static private final ConstantPool.Entry[] noRefs = ConstantPool.noRefs;
+ private static final ConstantPool.Entry[] noRefs = ConstantPool.noRefs;
// The following fields are used directly by the ClassReader, etc.
int max_stack;
--- a/jdk/src/java.base/share/classes/com/sun/java/util/jar/pack/Coding.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/com/sun/java/util/jar/pack/Coding.java Fri Sep 25 12:04:35 2015 -0700
@@ -662,7 +662,7 @@
return lg;
}
- static private final byte[] byteBitWidths = new byte[0x100];
+ private static final byte[] byteBitWidths = new byte[0x100];
static {
for (int b = 0; b < byteBitWidths.length; b++) {
byteBitWidths[b] = (byte) ceil_lg2(b + 1);
--- a/jdk/src/java.base/share/classes/com/sun/java/util/jar/pack/CodingChooser.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/com/sun/java/util/jar/pack/CodingChooser.java Fri Sep 25 12:04:35 2015 -0700
@@ -1139,7 +1139,7 @@
}
}
- static private
+ private static
String pct(double num, double den) {
return (Math.round((num / den)*10000)/100.0)+"%";
}
--- a/jdk/src/java.base/share/classes/com/sun/java/util/jar/pack/ConstantPool.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/com/sun/java/util/jar/pack/ConstantPool.java Fri Sep 25 12:04:35 2015 -0700
@@ -194,7 +194,7 @@
/** Entries in the constant pool. */
- public static abstract
+ public abstract static
class Entry implements Comparable<Object> {
protected final byte tag; // a CONSTANT_foo code
protected int valueHash; // cached hashCode
@@ -338,7 +338,7 @@
return (REF_getField <= refKind && refKind <= REF_invokeInterface);
}
- public static abstract
+ public abstract static
class LiteralEntry extends Entry {
protected LiteralEntry(byte tag) {
super(tag);
@@ -785,7 +785,7 @@
return new String(sig);
}
- static private int skipTo(char semi, String sig, int i) {
+ private static int skipTo(char semi, String sig, int i) {
i = sig.indexOf(semi, i);
return (i >= 0) ? i : sig.length();
}
--- a/jdk/src/java.base/share/classes/com/sun/java/util/jar/pack/Constants.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/com/sun/java/util/jar/pack/Constants.java Fri Sep 25 12:04:35 2015 -0700
@@ -36,7 +36,7 @@
private Constants(){}
- public final static int JAVA_MAGIC = 0xCAFEBABE;
+ public static final int JAVA_MAGIC = 0xCAFEBABE;
/*
Java Class Version numbers history
@@ -48,93 +48,93 @@
1.8 to 1.7.x 52,0
*/
- public final static Package.Version JAVA_MIN_CLASS_VERSION =
+ public static final Package.Version JAVA_MIN_CLASS_VERSION =
Package.Version.of(45, 03);
- public final static Package.Version JAVA5_MAX_CLASS_VERSION =
+ public static final Package.Version JAVA5_MAX_CLASS_VERSION =
Package.Version.of(49, 00);
- public final static Package.Version JAVA6_MAX_CLASS_VERSION =
+ public static final Package.Version JAVA6_MAX_CLASS_VERSION =
Package.Version.of(50, 00);
- public final static Package.Version JAVA7_MAX_CLASS_VERSION =
+ public static final Package.Version JAVA7_MAX_CLASS_VERSION =
Package.Version.of(51, 00);
- public final static Package.Version JAVA8_MAX_CLASS_VERSION =
+ public static final Package.Version JAVA8_MAX_CLASS_VERSION =
Package.Version.of(52, 00);
- public final static int JAVA_PACKAGE_MAGIC = 0xCAFED00D;
+ public static final int JAVA_PACKAGE_MAGIC = 0xCAFED00D;
- public final static Package.Version JAVA5_PACKAGE_VERSION =
+ public static final Package.Version JAVA5_PACKAGE_VERSION =
Package.Version.of(150, 7);
- public final static Package.Version JAVA6_PACKAGE_VERSION =
+ public static final Package.Version JAVA6_PACKAGE_VERSION =
Package.Version.of(160, 1);
- public final static Package.Version JAVA7_PACKAGE_VERSION =
+ public static final Package.Version JAVA7_PACKAGE_VERSION =
Package.Version.of(170, 1);
- public final static Package.Version JAVA8_PACKAGE_VERSION =
+ public static final Package.Version JAVA8_PACKAGE_VERSION =
Package.Version.of(171, 0);
// upper limit, should point to the latest class version
- public final static Package.Version JAVA_MAX_CLASS_VERSION =
+ public static final Package.Version JAVA_MAX_CLASS_VERSION =
JAVA8_MAX_CLASS_VERSION;
// upper limit should point to the latest package version, for version info!.
- public final static Package.Version MAX_PACKAGE_VERSION =
+ public static final Package.Version MAX_PACKAGE_VERSION =
JAVA7_PACKAGE_VERSION;
- public final static int CONSTANT_POOL_INDEX_LIMIT = 0x10000;
- public final static int CONSTANT_POOL_NARROW_LIMIT = 0x00100;
+ public static final int CONSTANT_POOL_INDEX_LIMIT = 0x10000;
+ public static final int CONSTANT_POOL_NARROW_LIMIT = 0x00100;
- public final static String JAVA_SIGNATURE_CHARS = "BSCIJFDZLV([";
+ public static final String JAVA_SIGNATURE_CHARS = "BSCIJFDZLV([";
- public final static byte CONSTANT_Utf8 = 1;
- public final static byte CONSTANT_unused2 = 2; // unused, was Unicode
- public final static byte CONSTANT_Integer = 3;
- public final static byte CONSTANT_Float = 4;
- public final static byte CONSTANT_Long = 5;
- public final static byte CONSTANT_Double = 6;
- public final static byte CONSTANT_Class = 7;
- public final static byte CONSTANT_String = 8;
- public final static byte CONSTANT_Fieldref = 9;
- public final static byte CONSTANT_Methodref = 10;
- public final static byte CONSTANT_InterfaceMethodref = 11;
- public final static byte CONSTANT_NameandType = 12;
- public final static byte CONSTANT_unused13 = 13;
- public final static byte CONSTANT_unused14 = 14;
- public final static byte CONSTANT_MethodHandle = 15;
- public final static byte CONSTANT_MethodType = 16;
- public final static byte CONSTANT_unused17 = 17; // unused
- public final static byte CONSTANT_InvokeDynamic = 18;
+ public static final byte CONSTANT_Utf8 = 1;
+ public static final byte CONSTANT_unused2 = 2; // unused, was Unicode
+ public static final byte CONSTANT_Integer = 3;
+ public static final byte CONSTANT_Float = 4;
+ public static final byte CONSTANT_Long = 5;
+ public static final byte CONSTANT_Double = 6;
+ public static final byte CONSTANT_Class = 7;
+ public static final byte CONSTANT_String = 8;
+ public static final byte CONSTANT_Fieldref = 9;
+ public static final byte CONSTANT_Methodref = 10;
+ public static final byte CONSTANT_InterfaceMethodref = 11;
+ public static final byte CONSTANT_NameandType = 12;
+ public static final byte CONSTANT_unused13 = 13;
+ public static final byte CONSTANT_unused14 = 14;
+ public static final byte CONSTANT_MethodHandle = 15;
+ public static final byte CONSTANT_MethodType = 16;
+ public static final byte CONSTANT_unused17 = 17; // unused
+ public static final byte CONSTANT_InvokeDynamic = 18;
// pseudo-constants:
- public final static byte CONSTANT_None = 0;
- public final static byte CONSTANT_Signature = CONSTANT_unused13;
- public final static byte CONSTANT_BootstrapMethod = CONSTANT_unused17; // used only in InvokeDynamic constants
- public final static byte CONSTANT_Limit = 19;
+ public static final byte CONSTANT_None = 0;
+ public static final byte CONSTANT_Signature = CONSTANT_unused13;
+ public static final byte CONSTANT_BootstrapMethod = CONSTANT_unused17; // used only in InvokeDynamic constants
+ public static final byte CONSTANT_Limit = 19;
- public final static byte CONSTANT_All = 50; // combined global map
- public final static byte CONSTANT_LoadableValue = 51; // used for 'KL' and qldc operands
- public final static byte CONSTANT_AnyMember = 52; // union of refs to field or (interface) method
- public final static byte CONSTANT_FieldSpecific = 53; // used only for 'KQ' ConstantValue attrs
- public final static byte CONSTANT_GroupFirst = CONSTANT_All;
- public final static byte CONSTANT_GroupLimit = CONSTANT_FieldSpecific+1;
+ public static final byte CONSTANT_All = 50; // combined global map
+ public static final byte CONSTANT_LoadableValue = 51; // used for 'KL' and qldc operands
+ public static final byte CONSTANT_AnyMember = 52; // union of refs to field or (interface) method
+ public static final byte CONSTANT_FieldSpecific = 53; // used only for 'KQ' ConstantValue attrs
+ public static final byte CONSTANT_GroupFirst = CONSTANT_All;
+ public static final byte CONSTANT_GroupLimit = CONSTANT_FieldSpecific+1;
// CONSTANT_MethodHandle reference kinds
- public final static byte REF_getField = 1;
- public final static byte REF_getStatic = 2;
- public final static byte REF_putField = 3;
- public final static byte REF_putStatic = 4;
- public final static byte REF_invokeVirtual = 5;
- public final static byte REF_invokeStatic = 6;
- public final static byte REF_invokeSpecial = 7;
- public final static byte REF_newInvokeSpecial = 8;
- public final static byte REF_invokeInterface = 9;
+ public static final byte REF_getField = 1;
+ public static final byte REF_getStatic = 2;
+ public static final byte REF_putField = 3;
+ public static final byte REF_putStatic = 4;
+ public static final byte REF_invokeVirtual = 5;
+ public static final byte REF_invokeStatic = 6;
+ public static final byte REF_invokeSpecial = 7;
+ public static final byte REF_newInvokeSpecial = 8;
+ public static final byte REF_invokeInterface = 9;
// pseudo-access bits
- public final static int ACC_IC_LONG_FORM = (1<<16); //for ic_flags
+ public static final int ACC_IC_LONG_FORM = (1<<16); //for ic_flags
// attribute "context types"
public static final int ATTR_CONTEXT_CLASS = 0;
@@ -199,14 +199,14 @@
public static final int NO_MODTIME = 0; // null modtime value
// some comstantly empty containers
- public final static int[] noInts = {};
- public final static byte[] noBytes = {};
- public final static Object[] noValues = {};
- public final static String[] noStrings = {};
- public final static List<Object> emptyList = Arrays.asList(noValues);
+ public static final int[] noInts = {};
+ public static final byte[] noBytes = {};
+ public static final Object[] noValues = {};
+ public static final String[] noStrings = {};
+ public static final List<Object> emptyList = Arrays.asList(noValues);
// meta-coding
- public final static int
+ public static final int
_meta_default = 0,
_meta_canon_min = 1,
_meta_canon_max = 115,
@@ -216,7 +216,7 @@
_meta_limit = 189;
// bytecodes
- public final static int
+ public static final int
_nop = 0, // 0x00
_aconst_null = 1, // 0x01
_iconst_m1 = 2, // 0x02
@@ -422,10 +422,10 @@
_bytecode_limit = 202; // 0xca
// End marker, used to terminate bytecode sequences:
- public final static int _end_marker = 255;
+ public static final int _end_marker = 255;
// Escapes:
- public final static int _byte_escape = 254;
- public final static int _ref_escape = 253;
+ public static final int _byte_escape = 254;
+ public static final int _ref_escape = 253;
// Self-relative pseudo-opcodes for better compression.
// A "linker op" is a bytecode which links to a class member.
@@ -440,26 +440,26 @@
// For simplicity, we define the full symmetric set of variants.
// However, some of them are relatively useless.
// Self linker ops are enabled by Pack.selfCallVariants (true).
- public final static int _first_linker_op = _getstatic;
- public final static int _last_linker_op = _invokestatic;
- public final static int _num_linker_ops = (_last_linker_op - _first_linker_op) + 1;
- public final static int _self_linker_op = _bytecode_limit;
- public final static int _self_linker_aload_flag = 1*_num_linker_ops;
- public final static int _self_linker_super_flag = 2*_num_linker_ops;
- public final static int _self_linker_limit = _self_linker_op + 4*_num_linker_ops;
+ public static final int _first_linker_op = _getstatic;
+ public static final int _last_linker_op = _invokestatic;
+ public static final int _num_linker_ops = (_last_linker_op - _first_linker_op) + 1;
+ public static final int _self_linker_op = _bytecode_limit;
+ public static final int _self_linker_aload_flag = 1*_num_linker_ops;
+ public static final int _self_linker_super_flag = 2*_num_linker_ops;
+ public static final int _self_linker_limit = _self_linker_op + 4*_num_linker_ops;
// An "invoke init" op is a variant of invokespecial which works
// only with the method name "<init>". There are variants which
// link to the current class, the super class, or the class of the
// immediately previous "newinstance" op. There are 3 of these ops.
// They all take method signature references as operands.
// Invoke init ops are enabled by Pack.initCallVariants (true).
- public final static int _invokeinit_op = _self_linker_limit;
- public final static int _invokeinit_self_option = 0;
- public final static int _invokeinit_super_option = 1;
- public final static int _invokeinit_new_option = 2;
- public final static int _invokeinit_limit = _invokeinit_op+3;
+ public static final int _invokeinit_op = _self_linker_limit;
+ public static final int _invokeinit_self_option = 0;
+ public static final int _invokeinit_super_option = 1;
+ public static final int _invokeinit_new_option = 2;
+ public static final int _invokeinit_limit = _invokeinit_op+3;
- public final static int _pseudo_instruction_limit = _invokeinit_limit;
+ public static final int _pseudo_instruction_limit = _invokeinit_limit;
// linker variant limit == 202+(7*4)+3 == 233
// Ldc variants support strongly typed references to constants.
@@ -467,25 +467,25 @@
// which is a great simplification.
// Ldc variants gain us only 0.007% improvement in compression ratio,
// but they simplify the file format greatly.
- public final static int _xldc_op = _invokeinit_limit;
- public final static int _sldc = _ldc; // previously named _aldc
- public final static int _cldc = _xldc_op+0;
- public final static int _ildc = _xldc_op+1;
- public final static int _fldc = _xldc_op+2;
- public final static int _sldc_w = _ldc_w; // previously named _aldc_w
- public final static int _cldc_w = _xldc_op+3;
- public final static int _ildc_w = _xldc_op+4;
- public final static int _fldc_w = _xldc_op+5;
- public final static int _lldc2_w = _ldc2_w;
- public final static int _dldc2_w = _xldc_op+6;
+ public static final int _xldc_op = _invokeinit_limit;
+ public static final int _sldc = _ldc; // previously named _aldc
+ public static final int _cldc = _xldc_op+0;
+ public static final int _ildc = _xldc_op+1;
+ public static final int _fldc = _xldc_op+2;
+ public static final int _sldc_w = _ldc_w; // previously named _aldc_w
+ public static final int _cldc_w = _xldc_op+3;
+ public static final int _ildc_w = _xldc_op+4;
+ public static final int _fldc_w = _xldc_op+5;
+ public static final int _lldc2_w = _ldc2_w;
+ public static final int _dldc2_w = _xldc_op+6;
// anything other than primitive, string, or class must be handled with qldc:
- public final static int _qldc = _xldc_op+7;
- public final static int _qldc_w = _xldc_op+8;
- public final static int _xldc_limit = _xldc_op+9;
+ public static final int _qldc = _xldc_op+7;
+ public static final int _qldc_w = _xldc_op+8;
+ public static final int _xldc_limit = _xldc_op+9;
// handling of InterfaceMethodRef
- public final static int _invoke_int_op = _xldc_limit;
- public final static int _invokespecial_int = _invoke_int_op+0;
- public final static int _invokestatic_int = _invoke_int_op+1;
- public final static int _invoke_int_limit = _invoke_int_op+2;
+ public static final int _invoke_int_op = _xldc_limit;
+ public static final int _invokespecial_int = _invoke_int_op+0;
+ public static final int _invokestatic_int = _invoke_int_op+1;
+ public static final int _invoke_int_limit = _invoke_int_op+2;
}
--- a/jdk/src/java.base/share/classes/com/sun/java/util/jar/pack/Driver.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/com/sun/java/util/jar/pack/Driver.java Fri Sep 25 12:04:35 2015 -0700
@@ -376,7 +376,7 @@
}
}
- static private
+ private static
File createTempFile(String basefile, String suffix) throws IOException {
File base = new File(basefile);
String prefix = base.getName();
@@ -393,7 +393,7 @@
return tmpfile.toFile();
}
- static private
+ private static
void printUsage(boolean doPack, boolean full, PrintStream out) {
String prog = doPack ? "pack200" : "unpack200";
String[] packUsage = (String[])RESOURCE.getObject(DriverResource.PACK_HELP);
@@ -408,7 +408,7 @@
}
}
- static private
+ private static
String getZipComment(String jarfile) throws IOException {
byte[] tail = new byte[1000];
long filelen = new File(jarfile).length();
--- a/jdk/src/java.base/share/classes/com/sun/java/util/jar/pack/Histogram.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/com/sun/java/util/jar/pack/Histogram.java Fri Sep 25 12:04:35 2015 -0700
@@ -218,7 +218,7 @@
return sum;
}
- static private
+ private static
double round(double x, double scale) {
return Math.round(x * scale) / scale;
}
--- a/jdk/src/java.base/share/classes/com/sun/java/util/jar/pack/Instruction.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/com/sun/java/util/jar/pack/Instruction.java Fri Sep 25 12:04:35 2015 -0700
@@ -471,14 +471,14 @@
/// Format definitions.
- static private final byte[][] BC_LENGTH = new byte[2][0x100];
- static private final byte[][] BC_INDEX = new byte[2][0x100];
- static private final byte[][] BC_TAG = new byte[2][0x100];
- static private final byte[][] BC_BRANCH = new byte[2][0x100];
- static private final byte[][] BC_SLOT = new byte[2][0x100];
- static private final byte[][] BC_CON = new byte[2][0x100];
- static private final String[] BC_NAME = new String[0x100]; // debug only
- static private final String[][] BC_FORMAT = new String[2][_bytecode_limit]; // debug only
+ private static final byte[][] BC_LENGTH = new byte[2][0x100];
+ private static final byte[][] BC_INDEX = new byte[2][0x100];
+ private static final byte[][] BC_TAG = new byte[2][0x100];
+ private static final byte[][] BC_BRANCH = new byte[2][0x100];
+ private static final byte[][] BC_SLOT = new byte[2][0x100];
+ private static final byte[][] BC_CON = new byte[2][0x100];
+ private static final String[] BC_NAME = new String[0x100]; // debug only
+ private static final String[][] BC_FORMAT = new String[2][_bytecode_limit]; // debug only
static {
for (int i = 0; i < _bytecode_limit; i++) {
BC_LENGTH[0][i] = -1;
--- a/jdk/src/java.base/share/classes/com/sun/java/util/jar/pack/NativeUnpack.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/com/sun/java/util/jar/pack/NativeUnpack.java Fri Sep 25 12:04:35 2015 -0700
@@ -104,7 +104,7 @@
}
// for JNI callbacks
- static private Object currentInstance() {
+ private static Object currentInstance() {
UnpackerImpl p200 = (UnpackerImpl) Utils.getTLGlobals();
return (p200 == null)? null: p200._nunp;
}
--- a/jdk/src/java.base/share/classes/com/sun/java/util/jar/pack/Package.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/com/sun/java/util/jar/pack/Package.java Fri Sep 25 12:04:35 2015 -0700
@@ -990,7 +990,7 @@
}
// Helper for building InnerClasses attributes.
- static private
+ private static
void visitInnerClassRefs(Collection<InnerClass> innerClasses, int mode, Collection<Entry> refs) {
if (innerClasses == null) {
return; // no attribute; nothing to do
--- a/jdk/src/java.base/share/classes/com/sun/java/util/jar/pack/PackageReader.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/com/sun/java/util/jar/pack/PackageReader.java Fri Sep 25 12:04:35 2015 -0700
@@ -218,7 +218,7 @@
return res;
}
- final static int MAGIC_BYTES = 4;
+ static final int MAGIC_BYTES = 4;
void readArchiveMagic() throws IOException {
// Read a minimum of bytes in the first gulp.
--- a/jdk/src/java.base/share/classes/com/sun/java/util/jar/pack/Utils.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/com/sun/java/util/jar/pack/Utils.java Fri Sep 25 12:04:35 2015 -0700
@@ -265,7 +265,7 @@
}
}
// Wrapper to prevent closing of client-supplied stream.
- static private
+ private static
class NonCloser extends FilterOutputStream {
NonCloser(OutputStream out) { super(out); }
public void close() throws IOException { flush(); }
--- a/jdk/src/java.base/share/classes/com/sun/net/ssl/HttpsURLConnection.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/com/sun/net/ssl/HttpsURLConnection.java Fri Sep 25 12:04:35 2015 -0700
@@ -46,7 +46,7 @@
* replaced by {@link javax.net.ssl.HttpsURLConnection}.
*/
@Deprecated
-abstract public
+public abstract
class HttpsURLConnection extends HttpURLConnection
{
/*
--- a/jdk/src/java.base/share/classes/com/sun/net/ssl/KeyManagerFactory.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/com/sun/net/ssl/KeyManagerFactory.java Fri Sep 25 12:04:35 2015 -0700
@@ -61,7 +61,7 @@
*
* @see java.security.Security security properties
*/
- public final static String getDefaultAlgorithm() {
+ public static final String getDefaultAlgorithm() {
String type;
type = AccessController.doPrivileged(new PrivilegedAction<>() {
public String run() {
--- a/jdk/src/java.base/share/classes/com/sun/net/ssl/TrustManagerFactory.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/com/sun/net/ssl/TrustManagerFactory.java Fri Sep 25 12:04:35 2015 -0700
@@ -61,7 +61,7 @@
*
* @see java.security.Security security properties
*/
- public final static String getDefaultAlgorithm() {
+ public static final String getDefaultAlgorithm() {
String type;
type = AccessController.doPrivileged(new PrivilegedAction<>() {
public String run() {
--- a/jdk/src/java.base/share/classes/com/sun/security/cert/internal/x509/X509V1CertImpl.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/com/sun/security/cert/internal/x509/X509V1CertImpl.java Fri Sep 25 12:04:35 2015 -0700
@@ -56,7 +56,7 @@
static final long serialVersionUID = -2048442350420423405L;
private java.security.cert.X509Certificate wrappedCert;
- synchronized private static java.security.cert.CertificateFactory
+ private static synchronized java.security.cert.CertificateFactory
getFactory()
throws java.security.cert.CertificateException
{
--- a/jdk/src/java.base/share/classes/com/sun/security/ntlm/Client.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/com/sun/security/ntlm/Client.java Fri Sep 25 12:04:35 2015 -0700
@@ -43,8 +43,8 @@
* </pre>
*/
public final class Client extends NTLM {
- final private String hostname;
- final private String username;
+ private final String hostname;
+ private final String username;
private String domain;
private byte[] pw1, pw2;
--- a/jdk/src/java.base/share/classes/com/sun/security/ntlm/NTLMException.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/com/sun/security/ntlm/NTLMException.java Fri Sep 25 12:04:35 2015 -0700
@@ -36,13 +36,13 @@
/**
* If the incoming packet is invalid.
*/
- public final static int PACKET_READ_ERROR = 1;
+ public static final int PACKET_READ_ERROR = 1;
/**
* If the client cannot get a domain value from the server and the
* caller has not provided one.
*/
- public final static int NO_DOMAIN_INFO = 2;
+ public static final int NO_DOMAIN_INFO = 2;
/**
* If the domain provided by the client does not match the one received
@@ -53,22 +53,22 @@
/**
* If the client name is not found on server's user database.
*/
- public final static int USER_UNKNOWN = 3;
+ public static final int USER_UNKNOWN = 3;
/**
* If authentication fails.
*/
- public final static int AUTH_FAILED = 4;
+ public static final int AUTH_FAILED = 4;
/**
* If an illegal version string is provided.
*/
- public final static int BAD_VERSION = 5;
+ public static final int BAD_VERSION = 5;
/**
* Protocol errors.
*/
- public final static int PROTOCOL = 6;
+ public static final int PROTOCOL = 6;
private int errorCode;
--- a/jdk/src/java.base/share/classes/com/sun/security/ntlm/Server.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/com/sun/security/ntlm/Server.java Fri Sep 25 12:04:35 2015 -0700
@@ -49,8 +49,8 @@
* </pre>
*/
public abstract class Server extends NTLM {
- final private String domain;
- final private boolean allVersion;
+ private final String domain;
+ private final boolean allVersion;
/**
* Creates a Server instance.
* @param version the NTLM version to use, which can be:
--- a/jdk/src/java.base/share/classes/java/io/Console.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/io/Console.java Fri Sep 25 12:04:35 2015 -0700
@@ -554,7 +554,7 @@
});
}
private static Console cons;
- private native static boolean istty();
+ private static native boolean istty();
private Console() {
readLock = new Object();
writeLock = new Object();
--- a/jdk/src/java.base/share/classes/java/io/DataInputStream.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/io/DataInputStream.java Fri Sep 25 12:04:35 2015 -0700
@@ -585,7 +585,7 @@
* valid modified UTF-8 encoding of a Unicode string.
* @see java.io.DataInputStream#readUnsignedShort()
*/
- public final static String readUTF(DataInput in) throws IOException {
+ public static final String readUTF(DataInput in) throws IOException {
int utflen = in.readUnsignedShort();
byte[] bytearr = null;
char[] chararr = null;
--- a/jdk/src/java.base/share/classes/java/io/File.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/io/File.java Fri Sep 25 12:04:35 2015 -0700
@@ -2204,7 +2204,7 @@
// -- Integration with java.nio.file --
- private volatile transient Path filePath;
+ private transient volatile Path filePath;
/**
* Returns a {@link Path java.nio.file.Path} object constructed from the
--- a/jdk/src/java.base/share/classes/java/io/FilePermission.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/io/FilePermission.java Fri Sep 25 12:04:35 2015 -0700
@@ -101,32 +101,32 @@
/**
* Execute action.
*/
- private final static int EXECUTE = 0x1;
+ private static final int EXECUTE = 0x1;
/**
* Write action.
*/
- private final static int WRITE = 0x2;
+ private static final int WRITE = 0x2;
/**
* Read action.
*/
- private final static int READ = 0x4;
+ private static final int READ = 0x4;
/**
* Delete action.
*/
- private final static int DELETE = 0x8;
+ private static final int DELETE = 0x8;
/**
* Read link action.
*/
- private final static int READLINK = 0x10;
+ private static final int READLINK = 0x10;
/**
* All actions (read,write,execute,delete,readlink)
*/
- private final static int ALL = READ|WRITE|EXECUTE|DELETE|READLINK;
+ private static final int ALL = READ|WRITE|EXECUTE|DELETE|READLINK;
/**
* No actions.
*/
- private final static int NONE = 0x0;
+ private static final int NONE = 0x0;
// the actions mask
private transient int mask;
--- a/jdk/src/java.base/share/classes/java/io/ObjectInputStream.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/io/ObjectInputStream.java Fri Sep 25 12:04:35 2015 -0700
@@ -1079,7 +1079,7 @@
/**
* Provide access to the persistent fields read from the input stream.
*/
- public static abstract class GetField {
+ public abstract static class GetField {
/**
* Get the ObjectStreamClass that describes the fields in the stream.
--- a/jdk/src/java.base/share/classes/java/io/ObjectOutputStream.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/io/ObjectOutputStream.java Fri Sep 25 12:04:35 2015 -0700
@@ -875,7 +875,7 @@
*
* @since 1.2
*/
- public static abstract class PutField {
+ public abstract static class PutField {
/**
* Put the value of the named boolean field into the persistent field.
--- a/jdk/src/java.base/share/classes/java/io/ObjectStreamClass.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/io/ObjectStreamClass.java Fri Sep 25 12:04:35 2015 -0700
@@ -1839,7 +1839,7 @@
* Returns true if the given class defines a static initializer method,
* false otherwise.
*/
- private native static boolean hasStaticInitializer(Class<?> cl);
+ private static native boolean hasStaticInitializer(Class<?> cl);
/**
* Class for computing and caching field/constructor/method signatures
--- a/jdk/src/java.base/share/classes/java/io/ObjectStreamConstants.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/io/ObjectStreamConstants.java Fri Sep 25 12:04:35 2015 -0700
@@ -36,12 +36,12 @@
/**
* Magic number that is written to the stream header.
*/
- final static short STREAM_MAGIC = (short)0xaced;
+ static final short STREAM_MAGIC = (short)0xaced;
/**
* Version number that is written to the stream header.
*/
- final static short STREAM_VERSION = 5;
+ static final short STREAM_VERSION = 5;
/* Each item in the stream is preceded by a tag
*/
@@ -49,95 +49,95 @@
/**
* First tag value.
*/
- final static byte TC_BASE = 0x70;
+ static final byte TC_BASE = 0x70;
/**
* Null object reference.
*/
- final static byte TC_NULL = (byte)0x70;
+ static final byte TC_NULL = (byte)0x70;
/**
* Reference to an object already written into the stream.
*/
- final static byte TC_REFERENCE = (byte)0x71;
+ static final byte TC_REFERENCE = (byte)0x71;
/**
* new Class Descriptor.
*/
- final static byte TC_CLASSDESC = (byte)0x72;
+ static final byte TC_CLASSDESC = (byte)0x72;
/**
* new Object.
*/
- final static byte TC_OBJECT = (byte)0x73;
+ static final byte TC_OBJECT = (byte)0x73;
/**
* new String.
*/
- final static byte TC_STRING = (byte)0x74;
+ static final byte TC_STRING = (byte)0x74;
/**
* new Array.
*/
- final static byte TC_ARRAY = (byte)0x75;
+ static final byte TC_ARRAY = (byte)0x75;
/**
* Reference to Class.
*/
- final static byte TC_CLASS = (byte)0x76;
+ static final byte TC_CLASS = (byte)0x76;
/**
* Block of optional data. Byte following tag indicates number
* of bytes in this block data.
*/
- final static byte TC_BLOCKDATA = (byte)0x77;
+ static final byte TC_BLOCKDATA = (byte)0x77;
/**
* End of optional block data blocks for an object.
*/
- final static byte TC_ENDBLOCKDATA = (byte)0x78;
+ static final byte TC_ENDBLOCKDATA = (byte)0x78;
/**
* Reset stream context. All handles written into stream are reset.
*/
- final static byte TC_RESET = (byte)0x79;
+ static final byte TC_RESET = (byte)0x79;
/**
* long Block data. The long following the tag indicates the
* number of bytes in this block data.
*/
- final static byte TC_BLOCKDATALONG= (byte)0x7A;
+ static final byte TC_BLOCKDATALONG= (byte)0x7A;
/**
* Exception during write.
*/
- final static byte TC_EXCEPTION = (byte)0x7B;
+ static final byte TC_EXCEPTION = (byte)0x7B;
/**
* Long string.
*/
- final static byte TC_LONGSTRING = (byte)0x7C;
+ static final byte TC_LONGSTRING = (byte)0x7C;
/**
* new Proxy Class Descriptor.
*/
- final static byte TC_PROXYCLASSDESC = (byte)0x7D;
+ static final byte TC_PROXYCLASSDESC = (byte)0x7D;
/**
* new Enum constant.
* @since 1.5
*/
- final static byte TC_ENUM = (byte)0x7E;
+ static final byte TC_ENUM = (byte)0x7E;
/**
* Last tag value.
*/
- final static byte TC_MAX = (byte)0x7E;
+ static final byte TC_MAX = (byte)0x7E;
/**
* First wire handle to be assigned.
*/
- final static int baseWireHandle = 0x7e0000;
+ static final int baseWireHandle = 0x7e0000;
/******************************************************/
@@ -147,7 +147,7 @@
* Bit mask for ObjectStreamClass flag. Indicates a Serializable class
* defines its own writeObject method.
*/
- final static byte SC_WRITE_METHOD = 0x01;
+ static final byte SC_WRITE_METHOD = 0x01;
/**
* Bit mask for ObjectStreamClass flag. Indicates Externalizable data
@@ -157,23 +157,23 @@
* @see #PROTOCOL_VERSION_2
* @since 1.2
*/
- final static byte SC_BLOCK_DATA = 0x08;
+ static final byte SC_BLOCK_DATA = 0x08;
/**
* Bit mask for ObjectStreamClass flag. Indicates class is Serializable.
*/
- final static byte SC_SERIALIZABLE = 0x02;
+ static final byte SC_SERIALIZABLE = 0x02;
/**
* Bit mask for ObjectStreamClass flag. Indicates class is Externalizable.
*/
- final static byte SC_EXTERNALIZABLE = 0x04;
+ static final byte SC_EXTERNALIZABLE = 0x04;
/**
* Bit mask for ObjectStreamClass flag. Indicates class is an enum type.
* @since 1.5
*/
- final static byte SC_ENUM = 0x10;
+ static final byte SC_ENUM = 0x10;
/* *******************************************************************/
@@ -187,7 +187,7 @@
* @see java.io.ObjectInputStream#enableResolveObject(boolean)
* @since 1.2
*/
- final static SerializablePermission SUBSTITUTION_PERMISSION =
+ static final SerializablePermission SUBSTITUTION_PERMISSION =
new SerializablePermission("enableSubstitution");
/**
@@ -197,7 +197,7 @@
* @see java.io.ObjectInputStream#readObjectOverride()
* @since 1.2
*/
- final static SerializablePermission SUBCLASS_IMPLEMENTATION_PERMISSION =
+ static final SerializablePermission SUBCLASS_IMPLEMENTATION_PERMISSION =
new SerializablePermission("enableSubclassImplementation");
/**
* A Stream Protocol Version. <p>
@@ -210,7 +210,7 @@
* @see java.io.ObjectOutputStream#useProtocolVersion(int)
* @since 1.2
*/
- public final static int PROTOCOL_VERSION_1 = 1;
+ public static final int PROTOCOL_VERSION_1 = 1;
/**
@@ -231,5 +231,5 @@
* @see #SC_BLOCK_DATA
* @since 1.2
*/
- public final static int PROTOCOL_VERSION_2 = 2;
+ public static final int PROTOCOL_VERSION_2 = 2;
}
--- a/jdk/src/java.base/share/classes/java/io/Reader.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/io/Reader.java Fri Sep 25 12:04:35 2015 -0700
@@ -157,7 +157,7 @@
* If {@code off} is negative, or {@code len} is negative,
* or {@code len} is greater than {@code cbuf.length - off}
*/
- abstract public int read(char cbuf[], int off, int len) throws IOException;
+ public abstract int read(char cbuf[], int off, int len) throws IOException;
/** Maximum skip-buffer size */
private static final int maxSkipBufferSize = 8192;
@@ -260,6 +260,6 @@
*
* @exception IOException If an I/O error occurs
*/
- abstract public void close() throws IOException;
+ public abstract void close() throws IOException;
}
--- a/jdk/src/java.base/share/classes/java/io/Writer.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/io/Writer.java Fri Sep 25 12:04:35 2015 -0700
@@ -142,7 +142,7 @@
* @throws IOException
* If an I/O error occurs
*/
- abstract public void write(char cbuf[], int off, int len) throws IOException;
+ public abstract void write(char cbuf[], int off, int len) throws IOException;
/**
* Writes a string.
@@ -312,7 +312,7 @@
* @throws IOException
* If an I/O error occurs
*/
- abstract public void flush() throws IOException;
+ public abstract void flush() throws IOException;
/**
* Closes the stream, flushing it first. Once the stream has been closed,
@@ -322,6 +322,6 @@
* @throws IOException
* If an I/O error occurs
*/
- abstract public void close() throws IOException;
+ public abstract void close() throws IOException;
}
--- a/jdk/src/java.base/share/classes/java/lang/Class.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/lang/Class.java Fri Sep 25 12:04:35 2015 -0700
@@ -469,8 +469,8 @@
return null;
}
}
- private volatile transient Constructor<T> cachedConstructor;
- private volatile transient Class<?> newInstanceCallerCache;
+ private transient volatile Constructor<T> cachedConstructor;
+ private transient volatile Class<?> newInstanceCallerCache;
/**
@@ -1123,7 +1123,7 @@
}
}
- private final static class EnclosingMethodInfo {
+ private static final class EnclosingMethodInfo {
private Class<?> enclosingClass;
private String name;
private String descriptor;
@@ -2514,11 +2514,11 @@
}
}
- private volatile transient SoftReference<ReflectionData<T>> reflectionData;
+ private transient volatile SoftReference<ReflectionData<T>> reflectionData;
// Incremented by the VM on each call to JVM TI RedefineClasses()
// that redefines this class or a superclass.
- private volatile transient int classRedefinedCount = 0;
+ private transient volatile int classRedefinedCount = 0;
// Lazily create and cache ReflectionData
private ReflectionData<T> reflectionData() {
@@ -2561,7 +2561,7 @@
private native String getGenericSignature0();
// Generic info repository; lazily initialized
- private volatile transient ClassRepository genericInfo;
+ private transient volatile ClassRepository genericInfo;
// accessor for factory
private GenericsFactory getFactory() {
@@ -3353,7 +3353,7 @@
}
return enumConstants;
}
- private volatile transient T[] enumConstants = null;
+ private transient volatile T[] enumConstants = null;
/**
* Returns a map from simple name to enum constant. This package-private
@@ -3375,7 +3375,7 @@
}
return enumConstantDirectory;
}
- private volatile transient Map<String, T> enumConstantDirectory = null;
+ private transient volatile Map<String, T> enumConstantDirectory = null;
/**
* Casts an object to the class or interface represented
@@ -3523,7 +3523,7 @@
// Annotations cache
@SuppressWarnings("UnusedDeclaration")
- private volatile transient AnnotationData annotationData;
+ private transient volatile AnnotationData annotationData;
private AnnotationData annotationData() {
while (true) { // retry loop
@@ -3578,7 +3578,7 @@
// Annotation types cache their internal (AnnotationType) form
@SuppressWarnings("UnusedDeclaration")
- private volatile transient AnnotationType annotationType;
+ private transient volatile AnnotationType annotationType;
boolean casAnnotationType(AnnotationType oldType, AnnotationType newType) {
return Atomic.casAnnotationType(this, oldType, newType);
--- a/jdk/src/java.base/share/classes/java/lang/ClassLoader.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/lang/ClassLoader.java Fri Sep 25 12:04:35 2015 -0700
@@ -1030,7 +1030,7 @@
return findLoadedClass0(name);
}
- private native final Class<?> findLoadedClass0(String name);
+ private final native Class<?> findLoadedClass0(String name);
/**
* Sets the signers of a class. This should be invoked after defining a
--- a/jdk/src/java.base/share/classes/java/lang/ConditionalSpecialCasing.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/lang/ConditionalSpecialCasing.java Fri Sep 25 12:04:35 2015 -0700
@@ -47,14 +47,14 @@
final class ConditionalSpecialCasing {
// context conditions.
- final static int FINAL_CASED = 1;
- final static int AFTER_SOFT_DOTTED = 2;
- final static int MORE_ABOVE = 3;
- final static int AFTER_I = 4;
- final static int NOT_BEFORE_DOT = 5;
+ static final int FINAL_CASED = 1;
+ static final int AFTER_SOFT_DOTTED = 2;
+ static final int MORE_ABOVE = 3;
+ static final int AFTER_I = 4;
+ static final int NOT_BEFORE_DOT = 5;
// combining class definitions
- final static int COMBINING_CLASS_ABOVE = 230;
+ static final int COMBINING_CLASS_ABOVE = 230;
// Special case mapping entries
static Entry[] entry = {
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/java.base/share/classes/java/lang/FdLibm.java Fri Sep 25 12:04:35 2015 -0700
@@ -0,0 +1,383 @@
+/*
+ * Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved.
+ * 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;
+
+/**
+ * Port of the "Freely Distributable Math Library", version 5.3, from C to Java.
+ *
+ * <p>The C version of fdlibm relied on the idiom of pointer aliasing
+ * a 64-bit double floating-point value as a two-element array of
+ * 32-bit integers and reading and writing the two halves of the
+ * double independently. This coding pattern was problematic to C
+ * optimizers and not directly expressible in Java. Therefore, rather
+ * than a memory level overlay, if portions of a double need to be
+ * operated on as integer values, the standard library methods for
+ * bitwise floating-point to integer conversion,
+ * Double.longBitsToDouble and Double.doubleToRawLongBits, are directly
+ * or indirectly used .
+ *
+ * <p>The C version of fdlibm also took some pains to signal the
+ * correct IEEE 754 exceptional conditions divide by zero, invalid,
+ * overflow and underflow. For example, overflow would be signaled by
+ * {@code huge * huge} where {@code huge} was a large constant that
+ * would overflow when squared. Since IEEE floating-point exceptional
+ * handling is not supported natively in the JVM, such coding patterns
+ * have been omitted from this port. For example, rather than {@code
+ * return huge * huge}, this port will use {@code return INFINITY}.
+ */
+class FdLibm {
+ // Constants used by multiple algorithms
+ private static final double INFINITY = Double.POSITIVE_INFINITY;
+
+ private FdLibm() {
+ throw new UnsupportedOperationException("No instances for you.");
+ }
+
+ /**
+ * Return the low-order 32 bits of the double argument as an int.
+ */
+ private static int __LO(double x) {
+ long transducer = Double.doubleToRawLongBits(x);
+ return (int)transducer;
+ }
+
+ /**
+ * Return a double with its low-order bits of the second argument
+ * and the high-order bits of the first argument..
+ */
+ private static double __LO(double x, int low) {
+ long transX = Double.doubleToRawLongBits(x);
+ return Double.longBitsToDouble((transX & 0xFFFF_FFFF_0000_0000L)|low );
+ }
+
+ /**
+ * Return the high-order 32 bits of the double argument as an int.
+ */
+ private static int __HI(double x) {
+ long transducer = Double.doubleToRawLongBits(x);
+ return (int)(transducer >> 32);
+ }
+
+ /**
+ * Return a double with its high-order bits of the second argument
+ * and the low-order bits of the first argument..
+ */
+ private static double __HI(double x, int high) {
+ long transX = Double.doubleToRawLongBits(x);
+ return Double.longBitsToDouble((transX & 0x0000_0000_FFFF_FFFFL)|( ((long)high)) << 32 );
+ }
+
+ /**
+ * Compute x**y
+ * n
+ * Method: Let x = 2 * (1+f)
+ * 1. Compute and return log2(x) in two pieces:
+ * log2(x) = w1 + w2,
+ * where w1 has 53 - 24 = 29 bit trailing zeros.
+ * 2. Perform y*log2(x) = n+y' by simulating muti-precision
+ * arithmetic, where |y'| <= 0.5.
+ * 3. Return x**y = 2**n*exp(y'*log2)
+ *
+ * Special cases:
+ * 1. (anything) ** 0 is 1
+ * 2. (anything) ** 1 is itself
+ * 3. (anything) ** NAN is NAN
+ * 4. NAN ** (anything except 0) is NAN
+ * 5. +-(|x| > 1) ** +INF is +INF
+ * 6. +-(|x| > 1) ** -INF is +0
+ * 7. +-(|x| < 1) ** +INF is +0
+ * 8. +-(|x| < 1) ** -INF is +INF
+ * 9. +-1 ** +-INF is NAN
+ * 10. +0 ** (+anything except 0, NAN) is +0
+ * 11. -0 ** (+anything except 0, NAN, odd integer) is +0
+ * 12. +0 ** (-anything except 0, NAN) is +INF
+ * 13. -0 ** (-anything except 0, NAN, odd integer) is +INF
+ * 14. -0 ** (odd integer) = -( +0 ** (odd integer) )
+ * 15. +INF ** (+anything except 0,NAN) is +INF
+ * 16. +INF ** (-anything except 0,NAN) is +0
+ * 17. -INF ** (anything) = -0 ** (-anything)
+ * 18. (-anything) ** (integer) is (-1)**(integer)*(+anything**integer)
+ * 19. (-anything except 0 and inf) ** (non-integer) is NAN
+ *
+ * Accuracy:
+ * pow(x,y) returns x**y nearly rounded. In particular
+ * pow(integer,integer)
+ * always returns the correct integer provided it is
+ * representable.
+ */
+ public static class Pow {
+ public static strictfp double compute(final double x, final double y) {
+ double z;
+ double r, s, t, u, v, w;
+ int i, j, k, n;
+
+ // y == zero: x**0 = 1
+ if (y == 0.0)
+ return 1.0;
+
+ // +/-NaN return x + y to propagate NaN significands
+ if (Double.isNaN(x) || Double.isNaN(y))
+ return x + y;
+
+ final double y_abs = Math.abs(y);
+ double x_abs = Math.abs(x);
+ // Special values of y
+ if (y == 2.0) {
+ return x * x;
+ } else if (y == 0.5) {
+ if (x >= -Double.MAX_VALUE) // Handle x == -infinity later
+ return Math.sqrt(x + 0.0); // Add 0.0 to properly handle x == -0.0
+ } else if (y_abs == 1.0) { // y is +/-1
+ return (y == 1.0) ? x : 1.0 / x;
+ } else if (y_abs == INFINITY) { // y is +/-infinity
+ if (x_abs == 1.0)
+ return y - y; // inf**+/-1 is NaN
+ else if (x_abs > 1.0) // (|x| > 1)**+/-inf = inf, 0
+ return (y >= 0) ? y : 0.0;
+ else // (|x| < 1)**-/+inf = inf, 0
+ return (y < 0) ? -y : 0.0;
+ }
+
+ final int hx = __HI(x);
+ int ix = hx & 0x7fffffff;
+
+ /*
+ * When x < 0, determine if y is an odd integer:
+ * y_is_int = 0 ... y is not an integer
+ * y_is_int = 1 ... y is an odd int
+ * y_is_int = 2 ... y is an even int
+ */
+ int y_is_int = 0;
+ if (hx < 0) {
+ if (y_abs >= 0x1.0p53) // |y| >= 2^53 = 9.007199254740992E15
+ y_is_int = 2; // y is an even integer since ulp(2^53) = 2.0
+ else if (y_abs >= 1.0) { // |y| >= 1.0
+ long y_abs_as_long = (long) y_abs;
+ if ( ((double) y_abs_as_long) == y_abs) {
+ y_is_int = 2 - (int)(y_abs_as_long & 0x1L);
+ }
+ }
+ }
+
+ // Special value of x
+ if (x_abs == 0.0 ||
+ x_abs == INFINITY ||
+ x_abs == 1.0) {
+ z = x_abs; // x is +/-0, +/-inf, +/-1
+ if (y < 0.0)
+ z = 1.0/z; // z = (1/|x|)
+ if (hx < 0) {
+ if (((ix - 0x3ff00000) | y_is_int) == 0) {
+ z = (z-z)/(z-z); // (-1)**non-int is NaN
+ } else if (y_is_int == 1)
+ z = -1.0 * z; // (x < 0)**odd = -(|x|**odd)
+ }
+ return z;
+ }
+
+ n = (hx >> 31) + 1;
+
+ // (x < 0)**(non-int) is NaN
+ if ((n | y_is_int) == 0)
+ return (x-x)/(x-x);
+
+ s = 1.0; // s (sign of result -ve**odd) = -1 else = 1
+ if ( (n | (y_is_int - 1)) == 0)
+ s = -1.0; // (-ve)**(odd int)
+
+ double p_h, p_l, t1, t2;
+ // |y| is huge
+ if (y_abs > 0x1.0p31) { // if |y| > 2**31
+ final double INV_LN2 = 0x1.7154_7652_b82fep0; // 1.44269504088896338700e+00 = 1/ln2
+ final double INV_LN2_H = 0x1.715476p0; // 1.44269502162933349609e+00 = 24 bits of 1/ln2
+ final double INV_LN2_L = 0x1.4ae0_bf85_ddf44p-26; // 1.92596299112661746887e-08 = 1/ln2 tail
+
+ // Over/underflow if x is not close to one
+ if (x_abs < 0x1.fffffp-1) // |x| < 0.9999995231628418
+ return (y < 0.0) ? s * INFINITY : s * 0.0;
+ if (x_abs > 1.0) // |x| > 1.0
+ return (y > 0.0) ? s * INFINITY : s * 0.0;
+ /*
+ * now |1-x| is tiny <= 2**-20, sufficient to compute
+ * log(x) by x - x^2/2 + x^3/3 - x^4/4
+ */
+ t = x_abs - 1.0; // t has 20 trailing zeros
+ w = (t * t) * (0.5 - t * (0.3333333333333333333333 - t * 0.25));
+ u = INV_LN2_H * t; // INV_LN2_H has 21 sig. bits
+ v = t * INV_LN2_L - w * INV_LN2;
+ t1 = u + v;
+ t1 =__LO(t1, 0);
+ t2 = v - (t1 - u);
+ } else {
+ final double CP = 0x1.ec70_9dc3_a03fdp-1; // 9.61796693925975554329e-01 = 2/(3ln2)
+ final double CP_H = 0x1.ec709ep-1; // 9.61796700954437255859e-01 = (float)cp
+ final double CP_L = -0x1.e2fe_0145_b01f5p-28; // -7.02846165095275826516e-09 = tail of CP_H
+
+ double z_h, z_l, ss, s2, s_h, s_l, t_h, t_l;
+ n = 0;
+ // Take care of subnormal numbers
+ if (ix < 0x00100000) {
+ x_abs *= 0x1.0p53; // 2^53 = 9007199254740992.0
+ n -= 53;
+ ix = __HI(x_abs);
+ }
+ n += ((ix) >> 20) - 0x3ff;
+ j = ix & 0x000fffff;
+ // Determine interval
+ ix = j | 0x3ff00000; // Normalize ix
+ if (j <= 0x3988E)
+ k = 0; // |x| <sqrt(3/2)
+ else if (j < 0xBB67A)
+ k = 1; // |x| <sqrt(3)
+ else {
+ k = 0;
+ n += 1;
+ ix -= 0x00100000;
+ }
+ x_abs = __HI(x_abs, ix);
+
+ // Compute ss = s_h + s_l = (x-1)/(x+1) or (x-1.5)/(x+1.5)
+
+ final double BP[] = {1.0,
+ 1.5};
+ final double DP_H[] = {0.0,
+ 0x1.2b80_34p-1}; // 5.84962487220764160156e-01
+ final double DP_L[] = {0.0,
+ 0x1.cfde_b43c_fd006p-27};// 1.35003920212974897128e-08
+
+ // Poly coefs for (3/2)*(log(x)-2s-2/3*s**3
+ final double L1 = 0x1.3333_3333_33303p-1; // 5.99999999999994648725e-01
+ final double L2 = 0x1.b6db_6db6_fabffp-2; // 4.28571428578550184252e-01
+ final double L3 = 0x1.5555_5518_f264dp-2; // 3.33333329818377432918e-01
+ final double L4 = 0x1.1746_0a91_d4101p-2; // 2.72728123808534006489e-01
+ final double L5 = 0x1.d864_a93c_9db65p-3; // 2.30660745775561754067e-01
+ final double L6 = 0x1.a7e2_84a4_54eefp-3; // 2.06975017800338417784e-01
+ u = x_abs - BP[k]; // BP[0]=1.0, BP[1]=1.5
+ v = 1.0 / (x_abs + BP[k]);
+ ss = u * v;
+ s_h = ss;
+ s_h = __LO(s_h, 0);
+ // t_h=x_abs + BP[k] High
+ t_h = 0.0;
+ t_h = __HI(t_h, ((ix >> 1) | 0x20000000) + 0x00080000 + (k << 18) );
+ t_l = x_abs - (t_h - BP[k]);
+ s_l = v * ((u - s_h * t_h) - s_h * t_l);
+ // Compute log(x_abs)
+ s2 = ss * ss;
+ r = s2 * s2* (L1 + s2 * (L2 + s2 * (L3 + s2 * (L4 + s2 * (L5 + s2 * L6)))));
+ r += s_l * (s_h + ss);
+ s2 = s_h * s_h;
+ t_h = 3.0 + s2 + r;
+ t_h = __LO(t_h, 0);
+ t_l = r - ((t_h - 3.0) - s2);
+ // u+v = ss*(1+...)
+ u = s_h * t_h;
+ v = s_l * t_h + t_l * ss;
+ // 2/(3log2)*(ss + ...)
+ p_h = u + v;
+ p_h = __LO(p_h, 0);
+ p_l = v - (p_h - u);
+ z_h = CP_H * p_h; // CP_H + CP_L = 2/(3*log2)
+ z_l = CP_L * p_h + p_l * CP + DP_L[k];
+ // log2(x_abs) = (ss + ..)*2/(3*log2) = n + DP_H + z_h + z_l
+ t = (double)n;
+ t1 = (((z_h + z_l) + DP_H[k]) + t);
+ t1 = __LO(t1, 0);
+ t2 = z_l - (((t1 - t) - DP_H[k]) - z_h);
+ }
+
+ // Split up y into (y1 + y2) and compute (y1 + y2) * (t1 + t2)
+ double y1 = y;
+ y1 = __LO(y1, 0);
+ p_l = (y - y1) * t1 + y * t2;
+ p_h = y1 * t1;
+ z = p_l + p_h;
+ j = __HI(z);
+ i = __LO(z);
+ if (j >= 0x40900000) { // z >= 1024
+ if (((j - 0x40900000) | i)!=0) // if z > 1024
+ return s * INFINITY; // Overflow
+ else {
+ final double OVT = 8.0085662595372944372e-0017; // -(1024-log2(ovfl+.5ulp))
+ if (p_l + OVT > z - p_h)
+ return s * INFINITY; // Overflow
+ }
+ } else if ((j & 0x7fffffff) >= 0x4090cc00 ) { // z <= -1075
+ if (((j - 0xc090cc00) | i)!=0) // z < -1075
+ return s * 0.0; // Underflow
+ else {
+ if (p_l <= z - p_h)
+ return s * 0.0; // Underflow
+ }
+ }
+ /*
+ * Compute 2**(p_h+p_l)
+ */
+ // Poly coefs for (3/2)*(log(x)-2s-2/3*s**3
+ final double P1 = 0x1.5555_5555_5553ep-3; // 1.66666666666666019037e-01
+ final double P2 = -0x1.6c16_c16b_ebd93p-9; // -2.77777777770155933842e-03
+ final double P3 = 0x1.1566_aaf2_5de2cp-14; // 6.61375632143793436117e-05
+ final double P4 = -0x1.bbd4_1c5d_26bf1p-20; // -1.65339022054652515390e-06
+ final double P5 = 0x1.6376_972b_ea4d0p-25; // 4.13813679705723846039e-08
+ final double LG2 = 0x1.62e4_2fef_a39efp-1; // 6.93147180559945286227e-01
+ final double LG2_H = 0x1.62e43p-1; // 6.93147182464599609375e-01
+ final double LG2_L = -0x1.05c6_10ca_86c39p-29; // -1.90465429995776804525e-09
+ i = j & 0x7fffffff;
+ k = (i >> 20) - 0x3ff;
+ n = 0;
+ if (i > 0x3fe00000) { // if |z| > 0.5, set n = [z + 0.5]
+ n = j + (0x00100000 >> (k + 1));
+ k = ((n & 0x7fffffff) >> 20) - 0x3ff; // new k for n
+ t = 0.0;
+ t = __HI(t, (n & ~(0x000fffff >> k)) );
+ n = ((n & 0x000fffff) | 0x00100000) >> (20 - k);
+ if (j < 0)
+ n = -n;
+ p_h -= t;
+ }
+ t = p_l + p_h;
+ t = __LO(t, 0);
+ u = t * LG2_H;
+ v = (p_l - (t - p_h)) * LG2 + t * LG2_L;
+ z = u + v;
+ w = v - (z - u);
+ t = z * z;
+ t1 = z - t * (P1 + t * (P2 + t * (P3 + t * (P4 + t * P5))));
+ r = (z * t1)/(t1 - 2.0) - (w + z * w);
+ z = 1.0 - (r - z);
+ j = __HI(z);
+ j += (n << 20);
+ if ((j >> 20) <= 0)
+ z = Math.scalb(z, n); // subnormal output
+ else {
+ int z_hi = __HI(z);
+ z_hi += (n << 20);
+ z = __HI(z, z_hi);
+ }
+ return s * z;
+ }
+ }
+}
--- a/jdk/src/java.base/share/classes/java/lang/Integer.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/lang/Integer.java Fri Sep 25 12:04:35 2015 -0700
@@ -76,7 +76,7 @@
/**
* All possible chars for representing a number as a String
*/
- final static char[] digits = {
+ static final char[] digits = {
'0' , '1' , '2' , '3' , '4' , '5' ,
'6' , '7' , '8' , '9' , 'a' , 'b' ,
'c' , 'd' , 'e' , 'f' , 'g' , 'h' ,
@@ -344,7 +344,7 @@
} while (charPos > offset);
}
- final static char [] DigitTens = {
+ static final char [] DigitTens = {
'0', '0', '0', '0', '0', '0', '0', '0', '0', '0',
'1', '1', '1', '1', '1', '1', '1', '1', '1', '1',
'2', '2', '2', '2', '2', '2', '2', '2', '2', '2',
@@ -357,7 +357,7 @@
'9', '9', '9', '9', '9', '9', '9', '9', '9', '9',
} ;
- final static char [] DigitOnes = {
+ static final char [] DigitOnes = {
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
@@ -467,7 +467,7 @@
}
}
- final static int [] sizeTable = { 9, 99, 999, 9999, 99999, 999999, 9999999,
+ static final int [] sizeTable = { 9, 99, 999, 9999, 99999, 999999, 9999999,
99999999, 999999999, Integer.MAX_VALUE };
// Requires positive x
--- a/jdk/src/java.base/share/classes/java/lang/Package.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/lang/Package.java Fri Sep 25 12:04:35 2015 -0700
@@ -656,6 +656,6 @@
private final String implVersion;
private final String implVendor;
private final URL sealBase;
- private transient final ClassLoader loader;
+ private final transient ClassLoader loader;
private transient Class<?> packageInfo;
}
--- a/jdk/src/java.base/share/classes/java/lang/ProcessBuilder.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/lang/ProcessBuilder.java Fri Sep 25 12:04:35 2015 -0700
@@ -458,7 +458,7 @@
*
* @since 1.7
*/
- public static abstract class Redirect {
+ public abstract static class Redirect {
/**
* The type of a {@link Redirect}.
*/
--- a/jdk/src/java.base/share/classes/java/lang/StrictMath.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/lang/StrictMath.java Fri Sep 25 12:04:35 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -643,7 +643,9 @@
* @param b the exponent.
* @return the value {@code a}<sup>{@code b}</sup>.
*/
- public static native double pow(double a, double b);
+ public static double pow(double a, double b) {
+ return FdLibm.Pow.compute(a, b);
+ }
/**
* Returns the closest {@code int} to the argument, with ties
--- a/jdk/src/java.base/share/classes/java/lang/StringCoding.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/lang/StringCoding.java Fri Sep 25 12:04:35 2015 -0700
@@ -52,9 +52,9 @@
private StringCoding() { }
/** The cached coders for each thread */
- private final static ThreadLocal<SoftReference<StringDecoder>> decoder =
+ private static final ThreadLocal<SoftReference<StringDecoder>> decoder =
new ThreadLocal<>();
- private final static ThreadLocal<SoftReference<StringEncoder>> encoder =
+ private static final ThreadLocal<SoftReference<StringEncoder>> encoder =
new ThreadLocal<>();
private static boolean warnUnsupportedCharset = true;
--- a/jdk/src/java.base/share/classes/java/lang/System.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/lang/System.java Fri Sep 25 12:04:35 2015 -0700
@@ -81,7 +81,7 @@
* corresponds to keyboard input or another input source specified by
* the host environment or user.
*/
- public final static InputStream in = null;
+ public static final InputStream in = null;
/**
* The "standard" output stream. This stream is already
@@ -108,7 +108,7 @@
* @see java.io.PrintStream#println(java.lang.Object)
* @see java.io.PrintStream#println(java.lang.String)
*/
- public final static PrintStream out = null;
+ public static final PrintStream out = null;
/**
* The "standard" error output stream. This stream is already
@@ -122,7 +122,7 @@
* variable <code>out</code>, has been redirected to a file or other
* destination that is typically not continuously monitored.
*/
- public final static PrintStream err = null;
+ public static final PrintStream err = null;
/* The security manager for the system.
*/
--- a/jdk/src/java.base/share/classes/java/lang/Thread.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/lang/Thread.java Fri Sep 25 12:04:35 2015 -0700
@@ -244,17 +244,17 @@
/**
* The minimum priority that a thread can have.
*/
- public final static int MIN_PRIORITY = 1;
+ public static final int MIN_PRIORITY = 1;
/**
* The default priority that is assigned to a thread.
*/
- public final static int NORM_PRIORITY = 5;
+ public static final int NORM_PRIORITY = 5;
/**
* The maximum priority that a thread can have.
*/
- public final static int MAX_PRIORITY = 10;
+ public static final int MAX_PRIORITY = 10;
/**
* Returns a reference to the currently executing thread object.
@@ -1688,8 +1688,8 @@
return result.booleanValue();
}
- private native static StackTraceElement[][] dumpThreads(Thread[] threads);
- private native static Thread[] getThreads();
+ private static native StackTraceElement[][] dumpThreads(Thread[] threads);
+ private static native Thread[] getThreads();
/**
* Returns the identifier of this Thread. The thread ID is a positive
--- a/jdk/src/java.base/share/classes/java/lang/VirtualMachineError.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/lang/VirtualMachineError.java Fri Sep 25 12:04:35 2015 -0700
@@ -33,7 +33,7 @@
* @author Frank Yellin
* @since 1.0
*/
-abstract public class VirtualMachineError extends Error {
+public abstract class VirtualMachineError extends Error {
private static final long serialVersionUID = 4161983926571568670L;
/**
--- a/jdk/src/java.base/share/classes/java/lang/invoke/DelegatingMethodHandle.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/lang/invoke/DelegatingMethodHandle.java Fri Sep 25 12:04:35 2015 -0700
@@ -49,7 +49,7 @@
}
/** Define this to extract the delegated target which supplies the invocation behavior. */
- abstract protected MethodHandle getTarget();
+ protected abstract MethodHandle getTarget();
@Override
abstract MethodHandle asTypeUncached(MethodType newType);
--- a/jdk/src/java.base/share/classes/java/lang/invoke/DirectMethodHandle.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/lang/invoke/DirectMethodHandle.java Fri Sep 25 12:04:35 2015 -0700
@@ -445,9 +445,9 @@
/** This subclass handles static field references. */
static class StaticAccessor extends DirectMethodHandle {
- final private Class<?> fieldType;
- final private Object staticBase;
- final private long staticOffset;
+ private final Class<?> fieldType;
+ private final Object staticBase;
+ private final long staticOffset;
private StaticAccessor(MethodType mtype, LambdaForm form, MemberName member,
Object staticBase, long staticOffset) {
--- a/jdk/src/java.base/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java Fri Sep 25 12:04:35 2015 -0700
@@ -140,9 +140,9 @@
/** instance counters for dumped classes */
- private final static HashMap<String,Integer> DUMP_CLASS_FILES_COUNTERS;
+ private static final HashMap<String,Integer> DUMP_CLASS_FILES_COUNTERS;
/** debugging flag for saving generated class files */
- private final static File DUMP_CLASS_FILES_DIR;
+ private static final File DUMP_CLASS_FILES_DIR;
static {
if (DUMP_CLASS_FILES) {
@@ -771,7 +771,7 @@
mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, MH, "invokeBasic", type.basicType().toMethodDescriptorString(), false);
}
- static private Class<?>[] STATICALLY_INVOCABLE_PACKAGES = {
+ private static Class<?>[] STATICALLY_INVOCABLE_PACKAGES = {
// Sample classes from each package we are willing to bind to statically:
java.lang.Object.class,
java.util.Arrays.class,
--- a/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandleNatives.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandleNatives.java Fri Sep 25 12:04:35 2015 -0700
@@ -440,7 +440,7 @@
* Use best possible cause for err.initCause(), substituting the
* cause for err itself if the cause has the same (or better) type.
*/
- static private Error initCauseFrom(Error err, Exception ex) {
+ private static Error initCauseFrom(Error err, Exception ex) {
Throwable th = ex.getCause();
if (err.getClass().isInstance(th))
return (Error) th;
--- a/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandles.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandles.java Fri Sep 25 12:04:35 2015 -0700
@@ -147,7 +147,7 @@
return lookup.revealDirect(target).reflectAs(expected, lookup);
}
// Copied from AccessibleObject, as used by Method.setAccessible, etc.:
- static final private java.security.Permission ACCESS_PERMISSION =
+ private static final java.security.Permission ACCESS_PERMISSION =
new ReflectPermission("suppressAccessChecks");
/**
@@ -1884,7 +1884,7 @@
* or if the resulting method handle's type would have
* <a href="MethodHandle.html#maxarity">too many parameters</a>
*/
- static public
+ public static
MethodHandle spreadInvoker(MethodType type, int leadingArgCount) {
if (leadingArgCount < 0 || leadingArgCount > type.parameterCount())
throw newIllegalArgumentException("bad argument count", leadingArgCount);
@@ -1927,7 +1927,7 @@
* @throws IllegalArgumentException if the resulting method handle's type would have
* <a href="MethodHandle.html#maxarity">too many parameters</a>
*/
- static public
+ public static
MethodHandle exactInvoker(MethodType type) {
return type.invokers().exactInvoker();
}
@@ -1966,7 +1966,7 @@
* @throws IllegalArgumentException if the resulting method handle's type would have
* <a href="MethodHandle.html#maxarity">too many parameters</a>
*/
- static public
+ public static
MethodHandle invoker(MethodType type) {
return type.invokers().genericInvoker();
}
@@ -2322,7 +2322,7 @@
return MethodHandleImpl.makeIntrinsic(mtype, lform, Intrinsic.ZERO);
}
- synchronized private static MethodHandle setCachedMethodHandle(MethodHandle[] cache, int pos, MethodHandle value) {
+ private static synchronized MethodHandle setCachedMethodHandle(MethodHandle[] cache, int pos, MethodHandle value) {
// Simulate a CAS, to avoid racy duplication of results.
MethodHandle prev = cache[pos];
if (prev != null) return prev;
--- a/jdk/src/java.base/share/classes/java/lang/invoke/MethodTypeForm.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/lang/invoke/MethodTypeForm.java Fri Sep 25 12:04:35 2015 -0700
@@ -111,7 +111,7 @@
return (entry != null) ? entry.get() : null;
}
- synchronized public MethodHandle setCachedMethodHandle(int which, MethodHandle mh) {
+ public synchronized MethodHandle setCachedMethodHandle(int which, MethodHandle mh) {
// Simulate a CAS, to avoid racy duplication of results.
SoftReference<MethodHandle> entry = methodHandles[which];
if (entry != null) {
@@ -130,7 +130,7 @@
return (entry != null) ? entry.get() : null;
}
- synchronized public LambdaForm setCachedLambdaForm(int which, LambdaForm form) {
+ public synchronized LambdaForm setCachedLambdaForm(int which, LambdaForm form) {
// Simulate a CAS, to avoid racy duplication of results.
SoftReference<LambdaForm> entry = lambdaForms[which];
if (entry != null) {
--- a/jdk/src/java.base/share/classes/java/lang/ref/Reference.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/lang/ref/Reference.java Fri Sep 25 12:04:35 2015 -0700
@@ -107,7 +107,7 @@
* pending: next element in the pending list (or null if last)
* otherwise: NULL
*/
- transient private Reference<T> discovered; /* used by VM */
+ private transient Reference<T> discovered; /* used by VM */
/* Object used to synchronize with the garbage collector. The collector
@@ -115,7 +115,7 @@
* therefore critical that any code holding this lock complete as quickly
* as possible, allocate no new objects, and avoid calling user code.
*/
- static private class Lock { }
+ private static class Lock { }
private static Lock lock = new Lock();
--- a/jdk/src/java.base/share/classes/java/lang/ref/ReferenceQueue.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/lang/ref/ReferenceQueue.java Fri Sep 25 12:04:35 2015 -0700
@@ -51,7 +51,7 @@
static ReferenceQueue<Object> NULL = new Null<>();
static ReferenceQueue<Object> ENQUEUED = new Null<>();
- static private class Lock { };
+ private static class Lock { };
private Lock lock = new Lock();
private volatile Reference<? extends T> head = null;
private long queueLength = 0;
--- a/jdk/src/java.base/share/classes/java/lang/ref/SoftReference.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/lang/ref/SoftReference.java Fri Sep 25 12:04:35 2015 -0700
@@ -66,7 +66,7 @@
/**
* Timestamp clock, updated by the garbage collector
*/
- static private long clock;
+ private static long clock;
/**
* Timestamp updated by each invocation of the get method. The VM may use
--- a/jdk/src/java.base/share/classes/java/lang/reflect/AccessibleObject.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/lang/reflect/AccessibleObject.java Fri Sep 25 12:04:35 2015 -0700
@@ -61,7 +61,7 @@
* has sufficient privilege to defeat Java language access
* control checks.
*/
- static final private java.security.Permission ACCESS_PERMISSION =
+ private static final java.security.Permission ACCESS_PERMISSION =
new ReflectPermission("suppressAccessChecks");
/**
--- a/jdk/src/java.base/share/classes/java/math/BigDecimal.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/math/BigDecimal.java Fri Sep 25 12:04:35 2015 -0700
@@ -2268,14 +2268,14 @@
* digit prior to a nonzero discarded fraction. Note that this rounding
* mode never decreases the magnitude of the calculated value.
*/
- public final static int ROUND_UP = 0;
+ public static final int ROUND_UP = 0;
/**
* Rounding mode to round towards zero. Never increments the digit
* prior to a discarded fraction (i.e., truncates). Note that this
* rounding mode never increases the magnitude of the calculated value.
*/
- public final static int ROUND_DOWN = 1;
+ public static final int ROUND_DOWN = 1;
/**
* Rounding mode to round towards positive infinity. If the
@@ -2284,7 +2284,7 @@
* {@code ROUND_DOWN}. Note that this rounding mode never
* decreases the calculated value.
*/
- public final static int ROUND_CEILING = 2;
+ public static final int ROUND_CEILING = 2;
/**
* Rounding mode to round towards negative infinity. If the
@@ -2293,7 +2293,7 @@
* {@code ROUND_UP}. Note that this rounding mode never
* increases the calculated value.
*/
- public final static int ROUND_FLOOR = 3;
+ public static final int ROUND_FLOOR = 3;
/**
* Rounding mode to round towards {@literal "nearest neighbor"}
@@ -2303,7 +2303,7 @@
* that this is the rounding mode that most of us were taught in
* grade school.
*/
- public final static int ROUND_HALF_UP = 4;
+ public static final int ROUND_HALF_UP = 4;
/**
* Rounding mode to round towards {@literal "nearest neighbor"}
@@ -2312,7 +2312,7 @@
* fraction is {@literal >} 0.5; otherwise, behaves as for
* {@code ROUND_DOWN}.
*/
- public final static int ROUND_HALF_DOWN = 5;
+ public static final int ROUND_HALF_DOWN = 5;
/**
* Rounding mode to round towards the {@literal "nearest neighbor"}
@@ -2324,7 +2324,7 @@
* rounding mode that minimizes cumulative error when applied
* repeatedly over a sequence of calculations.
*/
- public final static int ROUND_HALF_EVEN = 6;
+ public static final int ROUND_HALF_EVEN = 6;
/**
* Rounding mode to assert that the requested operation has an exact
@@ -2332,7 +2332,7 @@
* specified on an operation that yields an inexact result, an
* {@code ArithmeticException} is thrown.
*/
- public final static int ROUND_UNNECESSARY = 7;
+ public static final int ROUND_UNNECESSARY = 7;
// Scaling/Rounding Operations
@@ -3398,7 +3398,7 @@
return charPos;
}
- final static char[] DIGIT_TENS = {
+ static final char[] DIGIT_TENS = {
'0', '0', '0', '0', '0', '0', '0', '0', '0', '0',
'1', '1', '1', '1', '1', '1', '1', '1', '1', '1',
'2', '2', '2', '2', '2', '2', '2', '2', '2', '2',
@@ -3411,7 +3411,7 @@
'9', '9', '9', '9', '9', '9', '9', '9', '9', '9',
};
- final static char[] DIGIT_ONES = {
+ static final char[] DIGIT_ONES = {
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
--- a/jdk/src/java.base/share/classes/java/math/BigInteger.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/math/BigInteger.java Fri Sep 25 12:04:35 2015 -0700
@@ -184,7 +184,7 @@
/**
* This mask is used to obtain the value of an int as if it were unsigned.
*/
- final static long LONG_MASK = 0xffffffffL;
+ static final long LONG_MASK = 0xffffffffL;
/**
* This constant limits {@code mag.length} of BigIntegers to the supported
@@ -1212,7 +1212,7 @@
/**
* Initialize static constant array when class is loaded.
*/
- private final static int MAX_CONSTANT = 16;
+ private static final int MAX_CONSTANT = 16;
private static BigInteger posConst[] = new BigInteger[MAX_CONSTANT+1];
private static BigInteger negConst[] = new BigInteger[MAX_CONSTANT+1];
--- a/jdk/src/java.base/share/classes/java/net/AbstractPlainDatagramSocketImpl.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/net/AbstractPlainDatagramSocketImpl.java Fri Sep 25 12:04:35 2015 -0700
@@ -55,7 +55,7 @@
/**
* flag set if the native connect() call not to be used
*/
- private final static boolean connectDisabled = os.contains("OS X");
+ private static final boolean connectDisabled = os.contains("OS X");
/**
* Load net library into runtime.
--- a/jdk/src/java.base/share/classes/java/net/AbstractPlainSocketImpl.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/net/AbstractPlainSocketImpl.java Fri Sep 25 12:04:35 2015 -0700
@@ -721,6 +721,6 @@
abstract void socketSendUrgentData(int data)
throws IOException;
- public final static int SHUT_RD = 0;
- public final static int SHUT_WR = 1;
+ public static final int SHUT_RD = 0;
+ public static final int SHUT_WR = 1;
}
--- a/jdk/src/java.base/share/classes/java/net/Authenticator.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/net/Authenticator.java Fri Sep 25 12:04:35 2015 -0700
@@ -119,7 +119,7 @@
* @see SecurityManager#checkPermission
* @see java.net.NetPermission
*/
- public synchronized static void setDefault(Authenticator a) {
+ public static synchronized void setDefault(Authenticator a) {
SecurityManager sm = System.getSecurityManager();
if (sm != null) {
NetPermission setDefaultPermission
--- a/jdk/src/java.base/share/classes/java/net/ContentHandler.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/net/ContentHandler.java Fri Sep 25 12:04:35 2015 -0700
@@ -81,7 +81,7 @@
* @see java.net.URLConnection#setContentHandlerFactory(java.net.ContentHandlerFactory)
* @since 1.0
*/
-abstract public class ContentHandler {
+public abstract class ContentHandler {
/**
* Given a URL connect stream positioned at the beginning of the
@@ -92,7 +92,7 @@
* @return the object read by the {@code ContentHandler}.
* @exception IOException if an I/O error occurs while reading the object.
*/
- abstract public Object getContent(URLConnection urlc) throws IOException;
+ public abstract Object getContent(URLConnection urlc) throws IOException;
/**
* Given a URL connect stream positioned at the beginning of the
--- a/jdk/src/java.base/share/classes/java/net/CookieHandler.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/net/CookieHandler.java Fri Sep 25 12:04:35 2015 -0700
@@ -69,7 +69,7 @@
* {@link NetPermission}{@code ("getCookieHandler")}
* @see #setDefault(CookieHandler)
*/
- public synchronized static CookieHandler getDefault() {
+ public static synchronized CookieHandler getDefault() {
SecurityManager sm = System.getSecurityManager();
if (sm != null) {
sm.checkPermission(SecurityConstants.GET_COOKIEHANDLER_PERMISSION);
@@ -89,7 +89,7 @@
* {@link NetPermission}{@code ("setCookieHandler")}
* @see #getDefault()
*/
- public synchronized static void setDefault(CookieHandler cHandler) {
+ public static synchronized void setDefault(CookieHandler cHandler) {
SecurityManager sm = System.getSecurityManager();
if (sm != null) {
sm.checkPermission(SecurityConstants.SET_COOKIEHANDLER_PERMISSION);
--- a/jdk/src/java.base/share/classes/java/net/CookieManager.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/net/CookieManager.java Fri Sep 25 12:04:35 2015 -0700
@@ -362,7 +362,7 @@
}
- static private boolean isInPortList(String lst, int port) {
+ private static boolean isInPortList(String lst, int port) {
int i = lst.indexOf(',');
int val = -1;
while (i > 0) {
--- a/jdk/src/java.base/share/classes/java/net/DatagramPacket.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/net/DatagramPacket.java Fri Sep 25 12:04:35 2015 -0700
@@ -384,5 +384,5 @@
/**
* Perform class load-time initializations.
*/
- private native static void init();
+ private static native void init();
}
--- a/jdk/src/java.base/share/classes/java/net/HostPortrange.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/net/HostPortrange.java Fri Sep 25 12:04:35 2015 -0700
@@ -225,9 +225,9 @@
}
// these shouldn't leak outside the implementation
- final static int[] HTTP_PORT = {80, 80};
- final static int[] HTTPS_PORT = {443, 443};
- final static int[] NO_PORT = {-1, -1};
+ static final int[] HTTP_PORT = {80, 80};
+ static final int[] HTTPS_PORT = {443, 443};
+ static final int[] NO_PORT = {-1, -1};
int[] defaultPort() {
if (scheme.equals("http")) {
--- a/jdk/src/java.base/share/classes/java/net/HttpCookie.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/net/HttpCookie.java Fri Sep 25 12:04:35 2015 -0700
@@ -84,11 +84,11 @@
// Since the positive and zero max-age have their meanings,
// this value serves as a hint as 'not specify max-age'
- private final static long MAX_AGE_UNSPECIFIED = -1;
+ private static final long MAX_AGE_UNSPECIFIED = -1;
// date formats used by Netscape's cookie draft
// as well as formats seen on various sites
- private final static String[] COOKIE_DATE_FORMATS = {
+ private static final String[] COOKIE_DATE_FORMATS = {
"EEE',' dd-MMM-yyyy HH:mm:ss 'GMT'",
"EEE',' dd MMM yyyy HH:mm:ss 'GMT'",
"EEE MMM dd yyyy HH:mm:ss 'GMT'Z",
@@ -98,8 +98,8 @@
};
// constant strings represent set-cookie header token
- private final static String SET_COOKIE = "set-cookie:";
- private final static String SET_COOKIE2 = "set-cookie2:";
+ private static final String SET_COOKIE = "set-cookie:";
+ private static final String SET_COOKIE2 = "set-cookie2:";
// ---------------- Ctors --------------
--- a/jdk/src/java.base/share/classes/java/net/HttpURLConnection.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/net/HttpURLConnection.java Fri Sep 25 12:04:35 2015 -0700
@@ -66,7 +66,7 @@
* @see java.net.HttpURLConnection#disconnect()
* @since 1.1
*/
-abstract public class HttpURLConnection extends URLConnection {
+public abstract class HttpURLConnection extends URLConnection {
/* instance variables */
/**
--- a/jdk/src/java.base/share/classes/java/net/Inet4Address.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/net/Inet4Address.java Fri Sep 25 12:04:35 2015 -0700
@@ -84,7 +84,7 @@
public final
class Inet4Address extends InetAddress {
- final static int INADDRSZ = 4;
+ static final int INADDRSZ = 4;
/** use serialVersionUID from InetAddress, but Inet4Address instance
* is always replaced by an InetAddress instance before being
--- a/jdk/src/java.base/share/classes/java/net/Inet6Address.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/net/Inet6Address.java Fri Sep 25 12:04:35 2015 -0700
@@ -173,7 +173,7 @@
public final
class Inet6Address extends InetAddress {
- final static int INADDRSZ = 16;
+ static final int INADDRSZ = 16;
/*
* cached scope_id - for link-local address use only.
@@ -922,7 +922,7 @@
}
// Utilities
- private final static int INT16SZ = 2;
+ private static final int INT16SZ = 2;
/*
* Convert IPv6 binary address into presentation (printable) format.
--- a/jdk/src/java.base/share/classes/java/net/NetworkInterface.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/net/NetworkInterface.java Fri Sep 25 12:04:35 2015 -0700
@@ -400,16 +400,16 @@
false);
}
- private native static NetworkInterface[] getAll()
+ private static native NetworkInterface[] getAll()
throws SocketException;
- private native static NetworkInterface getByName0(String name)
+ private static native NetworkInterface getByName0(String name)
throws SocketException;
- private native static NetworkInterface getByIndex0(int index)
+ private static native NetworkInterface getByIndex0(int index)
throws SocketException;
- private native static NetworkInterface getByInetAddress0(InetAddress addr)
+ private static native NetworkInterface getByInetAddress0(InetAddress addr)
throws SocketException;
/**
@@ -525,12 +525,12 @@
return virtual;
}
- private native static boolean isUp0(String name, int ind) throws SocketException;
- private native static boolean isLoopback0(String name, int ind) throws SocketException;
- private native static boolean supportsMulticast0(String name, int ind) throws SocketException;
- private native static boolean isP2P0(String name, int ind) throws SocketException;
- private native static byte[] getMacAddr0(byte[] inAddr, String name, int ind) throws SocketException;
- private native static int getMTU0(String name, int ind) throws SocketException;
+ private static native boolean isUp0(String name, int ind) throws SocketException;
+ private static native boolean isLoopback0(String name, int ind) throws SocketException;
+ private static native boolean supportsMulticast0(String name, int ind) throws SocketException;
+ private static native boolean isP2P0(String name, int ind) throws SocketException;
+ private static native byte[] getMacAddr0(byte[] inAddr, String name, int ind) throws SocketException;
+ private static native int getMTU0(String name, int ind) throws SocketException;
/**
* Compares this object against the specified object.
--- a/jdk/src/java.base/share/classes/java/net/Proxy.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/net/Proxy.java Fri Sep 25 12:04:35 2015 -0700
@@ -69,7 +69,7 @@
* {@code Socket s = new Socket(Proxy.NO_PROXY);}
*
*/
- public final static Proxy NO_PROXY = new Proxy();
+ public static final Proxy NO_PROXY = new Proxy();
// Creates the proxy that represents a {@code DIRECT} connection.
private Proxy() {
--- a/jdk/src/java.base/share/classes/java/net/ResponseCache.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/net/ResponseCache.java Fri Sep 25 12:04:35 2015 -0700
@@ -80,7 +80,7 @@
* @return the system-wide {@code ResponseCache}
* @since 1.5
*/
- public synchronized static ResponseCache getDefault() {
+ public static synchronized ResponseCache getDefault() {
SecurityManager sm = System.getSecurityManager();
if (sm != null) {
sm.checkPermission(SecurityConstants.GET_RESPONSECACHE_PERMISSION);
@@ -103,7 +103,7 @@
* @see #getDefault()
* @since 1.5
*/
- public synchronized static void setDefault(ResponseCache responseCache) {
+ public static synchronized void setDefault(ResponseCache responseCache) {
SecurityManager sm = System.getSecurityManager();
if (sm != null) {
sm.checkPermission(SecurityConstants.SET_RESPONSECACHE_PERMISSION);
--- a/jdk/src/java.base/share/classes/java/net/SocketInputStream.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/net/SocketInputStream.java Fri Sep 25 12:04:35 2015 -0700
@@ -287,5 +287,5 @@
/**
* Perform class load-time initializations.
*/
- private native static void init();
+ private static native void init();
}
--- a/jdk/src/java.base/share/classes/java/net/SocketOptions.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/net/SocketOptions.java Fri Sep 25 12:04:35 2015 -0700
@@ -139,7 +139,7 @@
* @see Socket#getTcpNoDelay
*/
- @Native public final static int TCP_NODELAY = 0x0001;
+ @Native public static final int TCP_NODELAY = 0x0001;
/**
* Fetch the local address binding of a socket (this option cannot
@@ -160,7 +160,7 @@
* @see DatagramSocket#getLocalAddress
*/
- @Native public final static int SO_BINDADDR = 0x000F;
+ @Native public static final int SO_BINDADDR = 0x000F;
/** Sets SO_REUSEADDR for a socket. This is used only for MulticastSockets
* in java, and it is set by default for MulticastSockets.
@@ -168,7 +168,7 @@
* Valid for: DatagramSocketImpl
*/
- @Native public final static int SO_REUSEADDR = 0x04;
+ @Native public static final int SO_REUSEADDR = 0x04;
/**
* Sets SO_BROADCAST for a socket. This option enables and disables
@@ -179,7 +179,7 @@
* @since 1.4
*/
- @Native public final static int SO_BROADCAST = 0x0020;
+ @Native public static final int SO_BROADCAST = 0x0020;
/** Set which outgoing interface on which to send multicast packets.
* Useful on hosts with multiple network interfaces, where applications
@@ -191,7 +191,7 @@
* @see MulticastSocket#getInterface()
*/
- @Native public final static int IP_MULTICAST_IF = 0x10;
+ @Native public static final int IP_MULTICAST_IF = 0x10;
/** Same as above. This option is introduced so that the behaviour
* with IP_MULTICAST_IF will be kept the same as before, while
@@ -203,7 +203,7 @@
* @see MulticastSocket#getNetworkInterface()
* @since 1.4
*/
- @Native public final static int IP_MULTICAST_IF2 = 0x1f;
+ @Native public static final int IP_MULTICAST_IF2 = 0x1f;
/**
* This option enables or disables local loopback of multicast datagrams.
@@ -211,7 +211,7 @@
* @since 1.4
*/
- @Native public final static int IP_MULTICAST_LOOP = 0x12;
+ @Native public static final int IP_MULTICAST_LOOP = 0x12;
/**
* This option sets the type-of-service or traffic class field
@@ -219,7 +219,7 @@
* @since 1.4
*/
- @Native public final static int IP_TOS = 0x3;
+ @Native public static final int IP_TOS = 0x3;
/**
* Specify a linger-on-close timeout. This option disables/enables
@@ -237,7 +237,7 @@
* @see Socket#setSoLinger
* @see Socket#getSoLinger
*/
- @Native public final static int SO_LINGER = 0x0080;
+ @Native public static final int SO_LINGER = 0x0080;
/** Set a timeout on blocking Socket operations:
* <PRE>
@@ -258,7 +258,7 @@
* @see ServerSocket#setSoTimeout
* @see DatagramSocket#setSoTimeout
*/
- @Native public final static int SO_TIMEOUT = 0x1006;
+ @Native public static final int SO_TIMEOUT = 0x1006;
/**
* Set a hint the size of the underlying buffers used by the
@@ -275,7 +275,7 @@
* @see DatagramSocket#setSendBufferSize
* @see DatagramSocket#getSendBufferSize
*/
- @Native public final static int SO_SNDBUF = 0x1001;
+ @Native public static final int SO_SNDBUF = 0x1001;
/**
* Set a hint the size of the underlying buffers used by the
@@ -293,7 +293,7 @@
* @see DatagramSocket#setReceiveBufferSize
* @see DatagramSocket#getReceiveBufferSize
*/
- @Native public final static int SO_RCVBUF = 0x1002;
+ @Native public static final int SO_RCVBUF = 0x1002;
/**
* When the keepalive option is set for a TCP socket and no data
@@ -316,7 +316,7 @@
* @see Socket#setKeepAlive
* @see Socket#getKeepAlive
*/
- @Native public final static int SO_KEEPALIVE = 0x0008;
+ @Native public static final int SO_KEEPALIVE = 0x0008;
/**
* When the OOBINLINE option is set, any TCP urgent data received on
@@ -327,5 +327,5 @@
* @see Socket#setOOBInline
* @see Socket#getOOBInline
*/
- @Native public final static int SO_OOBINLINE = 0x1003;
+ @Native public static final int SO_OOBINLINE = 0x1003;
}
--- a/jdk/src/java.base/share/classes/java/net/SocketOutputStream.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/net/SocketOutputStream.java Fri Sep 25 12:04:35 2015 -0700
@@ -178,6 +178,6 @@
/**
* Perform class load-time initializations.
*/
- private native static void init();
+ private static native void init();
}
--- a/jdk/src/java.base/share/classes/java/net/SocketPermission.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/net/SocketPermission.java Fri Sep 25 12:04:35 2015 -0700
@@ -154,32 +154,32 @@
/**
* Connect to host:port
*/
- private final static int CONNECT = 0x1;
+ private static final int CONNECT = 0x1;
/**
* Listen on host:port
*/
- private final static int LISTEN = 0x2;
+ private static final int LISTEN = 0x2;
/**
* Accept a connection from host:port
*/
- private final static int ACCEPT = 0x4;
+ private static final int ACCEPT = 0x4;
/**
* Resolve DNS queries
*/
- private final static int RESOLVE = 0x8;
+ private static final int RESOLVE = 0x8;
/**
* No actions
*/
- private final static int NONE = 0x0;
+ private static final int NONE = 0x0;
/**
* All actions
*/
- private final static int ALL = CONNECT|LISTEN|ACCEPT|RESOLVE;
+ private static final int ALL = CONNECT|LISTEN|ACCEPT|RESOLVE;
// various port constants
private static final int PORT_MIN = 0;
--- a/jdk/src/java.base/share/classes/java/net/URI.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/net/URI.java Fri Sep 25 12:04:35 2015 -0700
@@ -492,15 +492,15 @@
// The remaining fields may be computed on demand
- private volatile transient String schemeSpecificPart;
- private volatile transient int hash; // Zero ==> undefined
-
- private volatile transient String decodedUserInfo = null;
- private volatile transient String decodedAuthority = null;
- private volatile transient String decodedPath = null;
- private volatile transient String decodedQuery = null;
- private volatile transient String decodedFragment = null;
- private volatile transient String decodedSchemeSpecificPart = null;
+ private transient volatile String schemeSpecificPart;
+ private transient volatile int hash; // Zero ==> undefined
+
+ private transient volatile String decodedUserInfo = null;
+ private transient volatile String decodedAuthority = null;
+ private transient volatile String decodedPath = null;
+ private transient volatile String decodedQuery = null;
+ private transient volatile String decodedFragment = null;
+ private transient volatile String decodedSchemeSpecificPart = null;
/**
* The string form of this URI.
@@ -2175,7 +2175,7 @@
// This method takes a string argument rather than a char array so that
// this test can be performed without invoking path.toCharArray().
//
- static private int needsNormalization(String path) {
+ private static int needsNormalization(String path) {
boolean normal = true;
int ns = 0; // Number of segments
int end = path.length() - 1; // Index of last char in path
@@ -2232,7 +2232,7 @@
// All slashes in path replaced by '\0'
// segs[i] == Index of first char in segment i (0 <= i < segs.length)
//
- static private void split(char[] path, int[] segs) {
+ private static void split(char[] path, int[] segs) {
int end = path.length - 1; // Index of last char in path
int p = 0; // Index of next char in path
int i = 0; // Index of current segment
@@ -2281,7 +2281,7 @@
// Postconditions:
// path[0] .. path[return value] == Resulting path
//
- static private int join(char[] path, int[] segs) {
+ private static int join(char[] path, int[] segs) {
int ns = segs.length; // Number of segments
int end = path.length - 1; // Index of last char in path
int p = 0; // Index of next path char to write
@@ -2645,7 +2645,7 @@
// -- Escaping and encoding --
- private final static char[] hexDigits = {
+ private static final char[] hexDigits = {
'0', '1', '2', '3', '4', '5', '6', '7',
'8', '9', 'A', 'B', 'C', 'D', 'E', 'F'
};
--- a/jdk/src/java.base/share/classes/java/net/URLConnection.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/net/URLConnection.java Fri Sep 25 12:04:35 2015 -0700
@@ -365,7 +365,7 @@
* @see #getConnectTimeout()
* @see #setConnectTimeout(int)
*/
- abstract public void connect() throws IOException;
+ public abstract void connect() throws IOException;
/**
* Sets a specified timeout value, in milliseconds, to be used
@@ -1440,7 +1440,7 @@
* @see java.io.InputStream#markSupported()
* @see java.net.URLConnection#getContentType()
*/
- static public String guessContentTypeFromStream(InputStream is)
+ public static String guessContentTypeFromStream(InputStream is)
throws IOException {
// If we can't read ahead safely, just give up on guessing
if (!is.markSupported())
@@ -1605,7 +1605,7 @@
* method, the stream should have already been checked to be sure it
* contains Microsoft Structured Storage data.
*/
- static private boolean checkfpx(InputStream is) throws IOException {
+ private static boolean checkfpx(InputStream is) throws IOException {
/* Test for FlashPix image data in Microsoft Structured Storage format.
* In general, should do this with calls to an SS implementation.
@@ -1766,7 +1766,7 @@
* Returns -1, If EOF is reached before len bytes are read, returns 0
* otherwise
*/
- static private int readBytes(int c[], int len, InputStream is)
+ private static int readBytes(int c[], int len, InputStream is)
throws IOException {
byte buf[] = new byte[len];
@@ -1787,7 +1787,7 @@
* until either EOF is reached, or the specified
* number of bytes have been skipped
*/
- static private long skipForward(InputStream is, long toSkip)
+ private static long skipForward(InputStream is, long toSkip)
throws IOException {
long eachSkip = 0;
--- a/jdk/src/java.base/share/classes/java/net/URLStreamHandler.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/net/URLStreamHandler.java Fri Sep 25 12:04:35 2015 -0700
@@ -68,7 +68,7 @@
* @exception IOException if an I/O error occurs while opening the
* connection.
*/
- abstract protected URLConnection openConnection(URL u) throws IOException;
+ protected abstract URLConnection openConnection(URL u) throws IOException;
/**
* Same as openConnection(URL), except that the connection will be
--- a/jdk/src/java.base/share/classes/java/nio/Bits.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/nio/Bits.java Fri Sep 25 12:04:35 2015 -0700
@@ -64,7 +64,7 @@
// -- get/put char --
- static private char makeChar(byte b1, byte b0) {
+ private static char makeChar(byte b1, byte b0) {
return (char)((b1 << 8) | (b0 & 0xff));
}
@@ -136,7 +136,7 @@
// -- get/put short --
- static private short makeShort(byte b1, byte b0) {
+ private static short makeShort(byte b1, byte b0) {
return (short)((b1 << 8) | (b0 & 0xff));
}
@@ -208,7 +208,7 @@
// -- get/put int --
- static private int makeInt(byte b3, byte b2, byte b1, byte b0) {
+ private static int makeInt(byte b3, byte b2, byte b1, byte b0) {
return (((b3 ) << 24) |
((b2 & 0xff) << 16) |
((b1 & 0xff) << 8) |
@@ -301,7 +301,7 @@
// -- get/put long --
- static private long makeLong(byte b7, byte b6, byte b5, byte b4,
+ private static long makeLong(byte b7, byte b6, byte b5, byte b4,
byte b3, byte b2, byte b1, byte b0)
{
return ((((long)b7 ) << 56) |
--- a/jdk/src/java.base/share/classes/java/nio/channels/Pipe.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/nio/channels/Pipe.java Fri Sep 25 12:04:35 2015 -0700
@@ -56,7 +56,7 @@
*
* @since 1.4
*/
- public static abstract class SourceChannel
+ public abstract static class SourceChannel
extends AbstractSelectableChannel
implements ReadableByteChannel, ScatteringByteChannel
{
@@ -90,7 +90,7 @@
*
* @since 1.4
*/
- public static abstract class SinkChannel
+ public abstract static class SinkChannel
extends AbstractSelectableChannel
implements WritableByteChannel, GatheringByteChannel
{
--- a/jdk/src/java.base/share/classes/java/nio/charset/CoderResult.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/nio/charset/CoderResult.java Fri Sep 25 12:04:35 2015 -0700
@@ -191,7 +191,7 @@
public static final CoderResult OVERFLOW
= new CoderResult(CR_OVERFLOW, 0);
- private static abstract class Cache {
+ private abstract static class Cache {
private Map<Integer,WeakReference<CoderResult>> cache = null;
--- a/jdk/src/java.base/share/classes/java/security/AlgorithmParameterGenerator.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/security/AlgorithmParameterGenerator.java Fri Sep 25 12:04:35 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -70,8 +70,8 @@
* following standard {@code AlgorithmParameterGenerator} algorithms and
* keysizes in parentheses:
* <ul>
- * <li>{@code DiffieHellman} (1024)</li>
- * <li>{@code DSA} (1024)</li>
+ * <li>{@code DiffieHellman} (1024, 2048, 4096)</li>
+ * <li>{@code DSA} (1024, 2048)</li>
* </ul>
* These algorithms are described in the <a href=
* "{@docRoot}/../technotes/guides/security/StandardNames.html#AlgorithmParameterGenerator">
--- a/jdk/src/java.base/share/classes/java/security/KeyPairGenerator.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/security/KeyPairGenerator.java Fri Sep 25 12:04:35 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -109,9 +109,9 @@
* following standard {@code KeyPairGenerator} algorithms and keysizes in
* parentheses:
* <ul>
- * <li>{@code DiffieHellman} (1024)</li>
- * <li>{@code DSA} (1024)</li>
- * <li>{@code RSA} (1024, 2048)</li>
+ * <li>{@code DiffieHellman} (1024, 2048, 4096)</li>
+ * <li>{@code DSA} (1024, 2048)</li>
+ * <li>{@code RSA} (1024, 2048, 4096)</li>
* </ul>
* These algorithms are described in the <a href=
* "{@docRoot}/../technotes/guides/security/StandardNames.html#KeyPairGenerator">
@@ -547,9 +547,9 @@
private Iterator<Service> serviceIterator;
- private final static int I_NONE = 1;
- private final static int I_SIZE = 2;
- private final static int I_PARAMS = 3;
+ private static final int I_NONE = 1;
+ private static final int I_SIZE = 2;
+ private static final int I_PARAMS = 3;
private int initType;
private int initKeySize;
--- a/jdk/src/java.base/share/classes/java/security/KeyStore.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/security/KeyStore.java Fri Sep 25 12:04:35 2015 -0700
@@ -974,7 +974,7 @@
* if no such property exists.
* @see java.security.Security security properties
*/
- public final static String getDefaultType() {
+ public static final String getDefaultType() {
String kstype;
kstype = AccessController.doPrivileged(new PrivilegedAction<>() {
public String run() {
@@ -1811,7 +1811,7 @@
* @see javax.net.ssl.KeyStoreBuilderParameters
* @since 1.5
*/
- public static abstract class Builder {
+ public abstract static class Builder {
// maximum times to try the callbackhandler if the password is wrong
static final int MAX_CALLBACK_TRIES = 3;
--- a/jdk/src/java.base/share/classes/java/security/Provider.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/security/Provider.java Fri Sep 25 12:04:35 2015 -0700
@@ -998,9 +998,9 @@
return new String[] {type, alg};
}
- private final static String ALIAS_PREFIX = "Alg.Alias.";
- private final static String ALIAS_PREFIX_LOWER = "alg.alias.";
- private final static int ALIAS_LENGTH = ALIAS_PREFIX.length();
+ private static final String ALIAS_PREFIX = "Alg.Alias.";
+ private static final String ALIAS_PREFIX_LOWER = "alg.alias.";
+ private static final int ALIAS_LENGTH = ALIAS_PREFIX.length();
private void parseLegacyPut(String name, String value) {
if (name.toLowerCase(ENGLISH).startsWith(ALIAS_PREFIX_LOWER)) {
--- a/jdk/src/java.base/share/classes/java/security/SecureRandom.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/security/SecureRandom.java Fri Sep 25 12:04:35 2015 -0700
@@ -424,7 +424,7 @@
*
* @see #getSeed
*/
- synchronized public void setSeed(byte[] seed) {
+ public synchronized void setSeed(byte[] seed) {
secureRandomSpi.engineSetSeed(seed);
}
@@ -465,7 +465,7 @@
* @param bytes the array to be filled in with random bytes.
*/
@Override
- synchronized public void nextBytes(byte[] bytes) {
+ public synchronized void nextBytes(byte[] bytes) {
secureRandomSpi.engineNextBytes(bytes);
}
@@ -484,7 +484,7 @@
* of pseudo-random bits (right justified, with leading zeros).
*/
@Override
- final protected int next(int numBits) {
+ protected final int next(int numBits) {
int numBytes = (numBits+7)/8;
byte[] b = new byte[numBytes];
int next = 0;
--- a/jdk/src/java.base/share/classes/java/security/Signature.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/security/Signature.java Fri Sep 25 12:04:35 2015 -0700
@@ -102,6 +102,7 @@
* following standard {@code Signature} algorithms:
* <ul>
* <li>{@code SHA1withDSA}</li>
+ * <li>{@code SHA256withDSA}</li>
* <li>{@code SHA1withRSA}</li>
* <li>{@code SHA256withRSA}</li>
* </ul>
@@ -140,19 +141,19 @@
* Possible {@link #state} value, signifying that
* this signature object has not yet been initialized.
*/
- protected final static int UNINITIALIZED = 0;
+ protected static final int UNINITIALIZED = 0;
/**
* Possible {@link #state} value, signifying that
* this signature object has been initialized for signing.
*/
- protected final static int SIGN = 2;
+ protected static final int SIGN = 2;
/**
* Possible {@link #state} value, signifying that
* this signature object has been initialized for verification.
*/
- protected final static int VERIFY = 3;
+ protected static final int VERIFY = 3;
/**
* Current state of this signature object.
@@ -173,13 +174,13 @@
}
// name of the special signature alg
- private final static String RSA_SIGNATURE = "NONEwithRSA";
+ private static final String RSA_SIGNATURE = "NONEwithRSA";
// name of the equivalent cipher alg
- private final static String RSA_CIPHER = "RSA/ECB/PKCS1Padding";
+ private static final String RSA_CIPHER = "RSA/ECB/PKCS1Padding";
// all the services we need to lookup for compatibility with Cipher
- private final static List<ServiceId> rsaIds = Arrays.asList(
+ private static final List<ServiceId> rsaIds = Arrays.asList(
new ServiceId[] {
new ServiceId("Signature", "NONEwithRSA"),
new ServiceId("Cipher", "RSA/ECB/PKCS1Padding"),
@@ -262,7 +263,7 @@
return sig;
}
- private final static Map<String,Boolean> signatureInfo;
+ private static final Map<String,Boolean> signatureInfo;
static {
signatureInfo = new ConcurrentHashMap<>();
@@ -1146,9 +1147,9 @@
}
}
- private final static int I_PUB = 1;
- private final static int I_PRIV = 2;
- private final static int I_PRIV_SR = 3;
+ private static final int I_PUB = 1;
+ private static final int I_PRIV = 2;
+ private static final int I_PRIV_SR = 3;
private void init(SignatureSpi spi, int type, Key key,
SecureRandom random) throws InvalidKeyException {
--- a/jdk/src/java.base/share/classes/java/security/cert/CertPathBuilder.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/security/cert/CertPathBuilder.java Fri Sep 25 12:04:35 2015 -0700
@@ -299,7 +299,7 @@
* by the {@code certpathbuilder.type} security property, or the string
* {@literal "PKIX"} if no such property exists.
*/
- public final static String getDefaultType() {
+ public static final String getDefaultType() {
String cpbtype =
AccessController.doPrivileged(new PrivilegedAction<>() {
public String run() {
--- a/jdk/src/java.base/share/classes/java/security/cert/CertPathHelperImpl.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/security/cert/CertPathHelperImpl.java Fri Sep 25 12:04:35 2015 -0700
@@ -49,7 +49,7 @@
* the methods in this class. This ensures that the helper is initialized
* prior to a tunneled call from the Sun provider.
*/
- synchronized static void initialize() {
+ static synchronized void initialize() {
if (CertPathHelper.instance == null) {
CertPathHelper.instance = new CertPathHelperImpl();
}
--- a/jdk/src/java.base/share/classes/java/security/cert/CertPathValidator.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/security/cert/CertPathValidator.java Fri Sep 25 12:04:35 2015 -0700
@@ -311,7 +311,7 @@
* by the {@code certpathvalidator.type} security property, or the string
* {@literal "PKIX"} if no such property exists.
*/
- public final static String getDefaultType() {
+ public static final String getDefaultType() {
String cpvtype =
AccessController.doPrivileged(new PrivilegedAction<>() {
public String run() {
--- a/jdk/src/java.base/share/classes/java/security/cert/CertStore.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/security/cert/CertStore.java Fri Sep 25 12:04:35 2015 -0700
@@ -407,7 +407,7 @@
* {@code certstore.type} security property, or the string
* {@literal "LDAP"} if no such property exists.
*/
- public final static String getDefaultType() {
+ public static final String getDefaultType() {
String cstype;
cstype = AccessController.doPrivileged(new PrivilegedAction<>() {
public String run() {
--- a/jdk/src/java.base/share/classes/java/security/cert/X509CertSelector.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/security/cert/X509CertSelector.java Fri Sep 25 12:04:35 2015 -0700
@@ -87,7 +87,7 @@
private static final Debug debug = Debug.getInstance("certpath");
- private final static ObjectIdentifier ANY_EXTENDED_KEY_USAGE =
+ private static final ObjectIdentifier ANY_EXTENDED_KEY_USAGE =
ObjectIdentifier.newInternal(new int[] {2, 5, 29, 37, 0});
static {
--- a/jdk/src/java.base/share/classes/java/text/AttributedString.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/text/AttributedString.java Fri Sep 25 12:04:35 2015 -0700
@@ -667,7 +667,7 @@
}
// returns whether the two objects are either both null or equal
- private final static boolean valuesMatch(Object value1, Object value2) {
+ private static final boolean valuesMatch(Object value1, Object value2) {
if (value1 == null) {
return value2 == null;
} else {
@@ -732,7 +732,7 @@
// the iterator class associated with this string class
- final private class AttributedStringIterator implements AttributedCharacterIterator {
+ private final class AttributedStringIterator implements AttributedCharacterIterator {
// note on synchronization:
// we don't synchronize on the iterator, assuming that an iterator is only used in one thread.
@@ -1045,7 +1045,7 @@
// the map class associated with this string class, giving access to the attributes of one run
- final private class AttributeMap extends AbstractMap<Attribute,Object> {
+ private final class AttributeMap extends AbstractMap<Attribute,Object> {
int runIndex;
int beginIndex;
--- a/jdk/src/java.base/share/classes/java/text/CollationElementIterator.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/text/CollationElementIterator.java Fri Sep 25 12:04:35 2015 -0700
@@ -111,7 +111,7 @@
* Null order which indicates the end of string is reached by the
* cursor.
*/
- public final static int NULLORDER = 0xffffffff;
+ public static final int NULLORDER = 0xffffffff;
/**
* CollationElementIterator constructor. This takes the source string and
@@ -358,7 +358,7 @@
* @param order the collation element
* @return the element's primary component
*/
- public final static int primaryOrder(int order)
+ public static final int primaryOrder(int order)
{
order &= RBCollationTables.PRIMARYORDERMASK;
return (order >>> RBCollationTables.PRIMARYORDERSHIFT);
@@ -368,7 +368,7 @@
* @param order the collation element
* @return the element's secondary component
*/
- public final static short secondaryOrder(int order)
+ public static final short secondaryOrder(int order)
{
order = order & RBCollationTables.SECONDARYORDERMASK;
return ((short)(order >> RBCollationTables.SECONDARYORDERSHIFT));
@@ -378,7 +378,7 @@
* @param order the collation element
* @return the element's tertiary component
*/
- public final static short tertiaryOrder(int order)
+ public static final short tertiaryOrder(int order)
{
return ((short)(order &= RBCollationTables.TERTIARYORDERMASK));
}
@@ -540,14 +540,14 @@
* Determine if a character is a Thai vowel (which sorts after
* its base consonant).
*/
- private final static boolean isThaiPreVowel(int ch) {
+ private static final boolean isThaiPreVowel(int ch) {
return (ch >= 0x0e40) && (ch <= 0x0e44);
}
/**
* Determine if a character is a Thai base consonant
*/
- private final static boolean isThaiBaseConsonant(int ch) {
+ private static final boolean isThaiBaseConsonant(int ch) {
return (ch >= 0x0e01) && (ch <= 0x0e2e);
}
@@ -555,14 +555,14 @@
* Determine if a character is a Lao vowel (which sorts after
* its base consonant).
*/
- private final static boolean isLaoPreVowel(int ch) {
+ private static final boolean isLaoPreVowel(int ch) {
return (ch >= 0x0ec0) && (ch <= 0x0ec4);
}
/**
* Determine if a character is a Lao base consonant
*/
- private final static boolean isLaoBaseConsonant(int ch) {
+ private static final boolean isLaoBaseConsonant(int ch) {
return (ch >= 0x0e81) && (ch <= 0x0eae);
}
@@ -634,7 +634,7 @@
* Check if a comparison order is ignorable.
* @return true if a character is ignorable, false otherwise.
*/
- final static boolean isIgnorable(int order)
+ static final boolean isIgnorable(int order)
{
return ((primaryOrder(order) == 0) ? true : false);
}
@@ -770,7 +770,7 @@
return order;
}
- final static int UNMAPPEDCHARVALUE = 0x7FFF0000;
+ static final int UNMAPPEDCHARVALUE = 0x7FFF0000;
private NormalizerBase text = null;
private int[] buffer = null;
--- a/jdk/src/java.base/share/classes/java/text/CollationKey.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/text/CollationKey.java Fri Sep 25 12:04:35 2015 -0700
@@ -108,7 +108,7 @@
* zero if this is greater than target.
* @see java.text.Collator#compare
*/
- abstract public int compareTo(CollationKey target);
+ public abstract int compareTo(CollationKey target);
/**
* Returns the String that this CollationKey represents.
@@ -128,7 +128,7 @@
*
* @return a byte array representation of the CollationKey
*/
- abstract public byte[] toByteArray();
+ public abstract byte[] toByteArray();
/**
@@ -145,5 +145,5 @@
this.source = source;
}
- final private String source;
+ private final String source;
}
--- a/jdk/src/java.base/share/classes/java/text/Collator.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/text/Collator.java Fri Sep 25 12:04:35 2015 -0700
@@ -136,7 +136,7 @@
* @see java.text.Collator#setStrength
* @see java.text.Collator#getStrength
*/
- public final static int PRIMARY = 0;
+ public static final int PRIMARY = 0;
/**
* Collator strength value. When set, only SECONDARY and above differences are
* considered significant during comparison. The assignment of strengths
@@ -146,7 +146,7 @@
* @see java.text.Collator#setStrength
* @see java.text.Collator#getStrength
*/
- public final static int SECONDARY = 1;
+ public static final int SECONDARY = 1;
/**
* Collator strength value. When set, only TERTIARY and above differences are
* considered significant during comparison. The assignment of strengths
@@ -155,7 +155,7 @@
* @see java.text.Collator#setStrength
* @see java.text.Collator#getStrength
*/
- public final static int TERTIARY = 2;
+ public static final int TERTIARY = 2;
/**
* Collator strength value. When set, all differences are
@@ -168,7 +168,7 @@
* (A, combining-grave) will be considered significant at the IDENTICAL
* level if decomposition is set to NO_DECOMPOSITION.
*/
- public final static int IDENTICAL = 3;
+ public static final int IDENTICAL = 3;
/**
* Decomposition mode value. With NO_DECOMPOSITION
@@ -178,7 +178,7 @@
* @see java.text.Collator#getDecomposition
* @see java.text.Collator#setDecomposition
*/
- public final static int NO_DECOMPOSITION = 0;
+ public static final int NO_DECOMPOSITION = 0;
/**
* Decomposition mode value. With CANONICAL_DECOMPOSITION
@@ -193,7 +193,7 @@
* @see java.text.Collator#getDecomposition
* @see java.text.Collator#setDecomposition
*/
- public final static int CANONICAL_DECOMPOSITION = 1;
+ public static final int CANONICAL_DECOMPOSITION = 1;
/**
* Decomposition mode value. With FULL_DECOMPOSITION
@@ -212,7 +212,7 @@
* @see java.text.Collator#getDecomposition
* @see java.text.Collator#setDecomposition
*/
- public final static int FULL_DECOMPOSITION = 2;
+ public static final int FULL_DECOMPOSITION = 2;
/**
* Gets the Collator for the current default locale.
@@ -472,7 +472,7 @@
* Generates the hash code for this Collator.
*/
@Override
- abstract public int hashCode();
+ public abstract int hashCode();
/**
* Default constructor. This constructor is
@@ -499,17 +499,17 @@
* string in the compare() method.
* @see java.text.Collator#compare
*/
- final static int LESS = -1;
+ static final int LESS = -1;
/**
* EQUAL is returned if source string is compared to be equal to target
* string in the compare() method.
* @see java.text.Collator#compare
*/
- final static int EQUAL = 0;
+ static final int EQUAL = 0;
/**
* GREATER is returned if source string is compared to be greater than
* target string in the compare() method.
* @see java.text.Collator#compare
*/
- final static int GREATER = 1;
+ static final int GREATER = 1;
}
--- a/jdk/src/java.base/share/classes/java/text/DateFormat.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/text/DateFormat.java Fri Sep 25 12:04:35 2015 -0700
@@ -175,100 +175,100 @@
* Useful constant for ERA field alignment.
* Used in FieldPosition of date/time formatting.
*/
- public final static int ERA_FIELD = 0;
+ public static final int ERA_FIELD = 0;
/**
* Useful constant for YEAR field alignment.
* Used in FieldPosition of date/time formatting.
*/
- public final static int YEAR_FIELD = 1;
+ public static final int YEAR_FIELD = 1;
/**
* Useful constant for MONTH field alignment.
* Used in FieldPosition of date/time formatting.
*/
- public final static int MONTH_FIELD = 2;
+ public static final int MONTH_FIELD = 2;
/**
* Useful constant for DATE field alignment.
* Used in FieldPosition of date/time formatting.
*/
- public final static int DATE_FIELD = 3;
+ public static final int DATE_FIELD = 3;
/**
* Useful constant for one-based HOUR_OF_DAY field alignment.
* Used in FieldPosition of date/time formatting.
* HOUR_OF_DAY1_FIELD is used for the one-based 24-hour clock.
* For example, 23:59 + 01:00 results in 24:59.
*/
- public final static int HOUR_OF_DAY1_FIELD = 4;
+ public static final int HOUR_OF_DAY1_FIELD = 4;
/**
* Useful constant for zero-based HOUR_OF_DAY field alignment.
* Used in FieldPosition of date/time formatting.
* HOUR_OF_DAY0_FIELD is used for the zero-based 24-hour clock.
* For example, 23:59 + 01:00 results in 00:59.
*/
- public final static int HOUR_OF_DAY0_FIELD = 5;
+ public static final int HOUR_OF_DAY0_FIELD = 5;
/**
* Useful constant for MINUTE field alignment.
* Used in FieldPosition of date/time formatting.
*/
- public final static int MINUTE_FIELD = 6;
+ public static final int MINUTE_FIELD = 6;
/**
* Useful constant for SECOND field alignment.
* Used in FieldPosition of date/time formatting.
*/
- public final static int SECOND_FIELD = 7;
+ public static final int SECOND_FIELD = 7;
/**
* Useful constant for MILLISECOND field alignment.
* Used in FieldPosition of date/time formatting.
*/
- public final static int MILLISECOND_FIELD = 8;
+ public static final int MILLISECOND_FIELD = 8;
/**
* Useful constant for DAY_OF_WEEK field alignment.
* Used in FieldPosition of date/time formatting.
*/
- public final static int DAY_OF_WEEK_FIELD = 9;
+ public static final int DAY_OF_WEEK_FIELD = 9;
/**
* Useful constant for DAY_OF_YEAR field alignment.
* Used in FieldPosition of date/time formatting.
*/
- public final static int DAY_OF_YEAR_FIELD = 10;
+ public static final int DAY_OF_YEAR_FIELD = 10;
/**
* Useful constant for DAY_OF_WEEK_IN_MONTH field alignment.
* Used in FieldPosition of date/time formatting.
*/
- public final static int DAY_OF_WEEK_IN_MONTH_FIELD = 11;
+ public static final int DAY_OF_WEEK_IN_MONTH_FIELD = 11;
/**
* Useful constant for WEEK_OF_YEAR field alignment.
* Used in FieldPosition of date/time formatting.
*/
- public final static int WEEK_OF_YEAR_FIELD = 12;
+ public static final int WEEK_OF_YEAR_FIELD = 12;
/**
* Useful constant for WEEK_OF_MONTH field alignment.
* Used in FieldPosition of date/time formatting.
*/
- public final static int WEEK_OF_MONTH_FIELD = 13;
+ public static final int WEEK_OF_MONTH_FIELD = 13;
/**
* Useful constant for AM_PM field alignment.
* Used in FieldPosition of date/time formatting.
*/
- public final static int AM_PM_FIELD = 14;
+ public static final int AM_PM_FIELD = 14;
/**
* Useful constant for one-based HOUR field alignment.
* Used in FieldPosition of date/time formatting.
* HOUR1_FIELD is used for the one-based 12-hour clock.
* For example, 11:30 PM + 1 hour results in 12:30 AM.
*/
- public final static int HOUR1_FIELD = 15;
+ public static final int HOUR1_FIELD = 15;
/**
* Useful constant for zero-based HOUR field alignment.
* Used in FieldPosition of date/time formatting.
* HOUR0_FIELD is used for the zero-based 12-hour clock.
* For example, 11:30 PM + 1 hour results in 00:30 AM.
*/
- public final static int HOUR0_FIELD = 16;
+ public static final int HOUR0_FIELD = 16;
/**
* Useful constant for TIMEZONE field alignment.
* Used in FieldPosition of date/time formatting.
*/
- public final static int TIMEZONE_FIELD = 17;
+ public static final int TIMEZONE_FIELD = 17;
// Proclaim serial compatibility with 1.1 FCS
private static final long serialVersionUID = 7218322306649953788L;
@@ -455,7 +455,7 @@
* @see java.util.Locale.Category#FORMAT
* @return a time formatter.
*/
- public final static DateFormat getTimeInstance()
+ public static final DateFormat getTimeInstance()
{
return get(DEFAULT, 0, 1, Locale.getDefault(Locale.Category.FORMAT));
}
@@ -472,7 +472,7 @@
* SHORT for "h:mm a" in the US locale.
* @return a time formatter.
*/
- public final static DateFormat getTimeInstance(int style)
+ public static final DateFormat getTimeInstance(int style)
{
return get(style, 0, 1, Locale.getDefault(Locale.Category.FORMAT));
}
@@ -485,7 +485,7 @@
* @param aLocale the given locale.
* @return a time formatter.
*/
- public final static DateFormat getTimeInstance(int style,
+ public static final DateFormat getTimeInstance(int style,
Locale aLocale)
{
return get(style, 0, 1, aLocale);
@@ -501,7 +501,7 @@
* @see java.util.Locale.Category#FORMAT
* @return a date formatter.
*/
- public final static DateFormat getDateInstance()
+ public static final DateFormat getDateInstance()
{
return get(0, DEFAULT, 2, Locale.getDefault(Locale.Category.FORMAT));
}
@@ -518,7 +518,7 @@
* SHORT for "M/d/yy" in the US locale.
* @return a date formatter.
*/
- public final static DateFormat getDateInstance(int style)
+ public static final DateFormat getDateInstance(int style)
{
return get(0, style, 2, Locale.getDefault(Locale.Category.FORMAT));
}
@@ -531,7 +531,7 @@
* @param aLocale the given locale.
* @return a date formatter.
*/
- public final static DateFormat getDateInstance(int style,
+ public static final DateFormat getDateInstance(int style,
Locale aLocale)
{
return get(0, style, 2, aLocale);
@@ -547,7 +547,7 @@
* @see java.util.Locale.Category#FORMAT
* @return a date/time formatter.
*/
- public final static DateFormat getDateTimeInstance()
+ public static final DateFormat getDateTimeInstance()
{
return get(DEFAULT, DEFAULT, 3, Locale.getDefault(Locale.Category.FORMAT));
}
@@ -566,7 +566,7 @@
* SHORT for "h:mm a" in the US locale.
* @return a date/time formatter.
*/
- public final static DateFormat getDateTimeInstance(int dateStyle,
+ public static final DateFormat getDateTimeInstance(int dateStyle,
int timeStyle)
{
return get(timeStyle, dateStyle, 3, Locale.getDefault(Locale.Category.FORMAT));
@@ -580,7 +580,7 @@
* @param aLocale the given locale.
* @return a date/time formatter.
*/
- public final static DateFormat
+ public static final DateFormat
getDateTimeInstance(int dateStyle, int timeStyle, Locale aLocale)
{
return get(timeStyle, dateStyle, 3, aLocale);
@@ -592,7 +592,7 @@
*
* @return a date/time formatter
*/
- public final static DateFormat getInstance() {
+ public static final DateFormat getInstance() {
return getDateTimeInstance(SHORT, SHORT);
}
@@ -934,107 +934,107 @@
/**
* Constant identifying the era field.
*/
- public final static Field ERA = new Field("era", Calendar.ERA);
+ public static final Field ERA = new Field("era", Calendar.ERA);
/**
* Constant identifying the year field.
*/
- public final static Field YEAR = new Field("year", Calendar.YEAR);
+ public static final Field YEAR = new Field("year", Calendar.YEAR);
/**
* Constant identifying the month field.
*/
- public final static Field MONTH = new Field("month", Calendar.MONTH);
+ public static final Field MONTH = new Field("month", Calendar.MONTH);
/**
* Constant identifying the day of month field.
*/
- public final static Field DAY_OF_MONTH = new
+ public static final Field DAY_OF_MONTH = new
Field("day of month", Calendar.DAY_OF_MONTH);
/**
* Constant identifying the hour of day field, where the legal values
* are 1 to 24.
*/
- public final static Field HOUR_OF_DAY1 = new Field("hour of day 1",-1);
+ public static final Field HOUR_OF_DAY1 = new Field("hour of day 1",-1);
/**
* Constant identifying the hour of day field, where the legal values
* are 0 to 23.
*/
- public final static Field HOUR_OF_DAY0 = new
+ public static final Field HOUR_OF_DAY0 = new
Field("hour of day", Calendar.HOUR_OF_DAY);
/**
* Constant identifying the minute field.
*/
- public final static Field MINUTE =new Field("minute", Calendar.MINUTE);
+ public static final Field MINUTE =new Field("minute", Calendar.MINUTE);
/**
* Constant identifying the second field.
*/
- public final static Field SECOND =new Field("second", Calendar.SECOND);
+ public static final Field SECOND =new Field("second", Calendar.SECOND);
/**
* Constant identifying the millisecond field.
*/
- public final static Field MILLISECOND = new
+ public static final Field MILLISECOND = new
Field("millisecond", Calendar.MILLISECOND);
/**
* Constant identifying the day of week field.
*/
- public final static Field DAY_OF_WEEK = new
+ public static final Field DAY_OF_WEEK = new
Field("day of week", Calendar.DAY_OF_WEEK);
/**
* Constant identifying the day of year field.
*/
- public final static Field DAY_OF_YEAR = new
+ public static final Field DAY_OF_YEAR = new
Field("day of year", Calendar.DAY_OF_YEAR);
/**
* Constant identifying the day of week field.
*/
- public final static Field DAY_OF_WEEK_IN_MONTH =
+ public static final Field DAY_OF_WEEK_IN_MONTH =
new Field("day of week in month",
Calendar.DAY_OF_WEEK_IN_MONTH);
/**
* Constant identifying the week of year field.
*/
- public final static Field WEEK_OF_YEAR = new
+ public static final Field WEEK_OF_YEAR = new
Field("week of year", Calendar.WEEK_OF_YEAR);
/**
* Constant identifying the week of month field.
*/
- public final static Field WEEK_OF_MONTH = new
+ public static final Field WEEK_OF_MONTH = new
Field("week of month", Calendar.WEEK_OF_MONTH);
/**
* Constant identifying the time of day indicator
* (e.g. "a.m." or "p.m.") field.
*/
- public final static Field AM_PM = new
+ public static final Field AM_PM = new
Field("am pm", Calendar.AM_PM);
/**
* Constant identifying the hour field, where the legal values are
* 1 to 12.
*/
- public final static Field HOUR1 = new Field("hour 1", -1);
+ public static final Field HOUR1 = new Field("hour 1", -1);
/**
* Constant identifying the hour field, where the legal values are
* 0 to 11.
*/
- public final static Field HOUR0 = new
+ public static final Field HOUR0 = new
Field("hour", Calendar.HOUR);
/**
* Constant identifying the time zone field.
*/
- public final static Field TIME_ZONE = new Field("time zone", -1);
+ public static final Field TIME_ZONE = new Field("time zone", -1);
}
}
--- a/jdk/src/java.base/share/classes/java/text/MessageFormat.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/text/MessageFormat.java Fri Sep 25 12:04:35 2015 -0700
@@ -1168,7 +1168,7 @@
* indicating the index in the <code>arguments</code> array of the
* argument from which the text was generated.
*/
- public final static Field ARGUMENT =
+ public static final Field ARGUMENT =
new Field("message argument field");
}
--- a/jdk/src/java.base/share/classes/java/text/NumberFormat.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/text/NumberFormat.java Fri Sep 25 12:04:35 2015 -0700
@@ -425,7 +425,7 @@
* @return the {@code NumberFormat} instance for general-purpose number
* formatting
*/
- public final static NumberFormat getInstance() {
+ public static final NumberFormat getInstance() {
return getInstance(Locale.getDefault(Locale.Category.FORMAT), NUMBERSTYLE);
}
@@ -454,7 +454,7 @@
* @see java.util.Locale#getDefault(java.util.Locale.Category)
* @see java.util.Locale.Category#FORMAT
*/
- public final static NumberFormat getNumberInstance() {
+ public static final NumberFormat getNumberInstance() {
return getInstance(Locale.getDefault(Locale.Category.FORMAT), NUMBERSTYLE);
}
@@ -487,7 +487,7 @@
* @return a number format for integer values
* @since 1.4
*/
- public final static NumberFormat getIntegerInstance() {
+ public static final NumberFormat getIntegerInstance() {
return getInstance(Locale.getDefault(Locale.Category.FORMAT), INTEGERSTYLE);
}
@@ -519,7 +519,7 @@
* @see java.util.Locale#getDefault(java.util.Locale.Category)
* @see java.util.Locale.Category#FORMAT
*/
- public final static NumberFormat getCurrencyInstance() {
+ public static final NumberFormat getCurrencyInstance() {
return getInstance(Locale.getDefault(Locale.Category.FORMAT), CURRENCYSTYLE);
}
@@ -544,7 +544,7 @@
* @see java.util.Locale#getDefault(java.util.Locale.Category)
* @see java.util.Locale.Category#FORMAT
*/
- public final static NumberFormat getPercentInstance() {
+ public static final NumberFormat getPercentInstance() {
return getInstance(Locale.getDefault(Locale.Category.FORMAT), PERCENTSTYLE);
}
--- a/jdk/src/java.base/share/classes/java/text/RBCollationTables.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/text/RBCollationTables.java Fri Sep 25 12:04:35 2015 -0700
@@ -258,7 +258,7 @@
}
}
- final static int getEntry(Vector<EntryPair> list, String name, boolean fwd) {
+ static final int getEntry(Vector<EntryPair> list, String name, boolean fwd) {
for (int i = 0; i < list.size(); i++) {
EntryPair pair = list.elementAt(i);
if (pair.fwd == fwd && pair.entryName.equals(name)) {
@@ -272,17 +272,17 @@
// constants
// ==============================================================
//sherman/Todo: is the value big enough?????
- final static int EXPANDCHARINDEX = 0x7E000000; // Expand index follows
- final static int CONTRACTCHARINDEX = 0x7F000000; // contract indexes follow
- final static int UNMAPPED = 0xFFFFFFFF;
+ static final int EXPANDCHARINDEX = 0x7E000000; // Expand index follows
+ static final int CONTRACTCHARINDEX = 0x7F000000; // contract indexes follow
+ static final int UNMAPPED = 0xFFFFFFFF;
- final static int PRIMARYORDERMASK = 0xffff0000;
- final static int SECONDARYORDERMASK = 0x0000ff00;
- final static int TERTIARYORDERMASK = 0x000000ff;
- final static int PRIMARYDIFFERENCEONLY = 0xffff0000;
- final static int SECONDARYDIFFERENCEONLY = 0xffffff00;
- final static int PRIMARYORDERSHIFT = 16;
- final static int SECONDARYORDERSHIFT = 8;
+ static final int PRIMARYORDERMASK = 0xffff0000;
+ static final int SECONDARYORDERMASK = 0x0000ff00;
+ static final int TERTIARYORDERMASK = 0x000000ff;
+ static final int PRIMARYDIFFERENCEONLY = 0xffff0000;
+ static final int SECONDARYDIFFERENCEONLY = 0xffffff00;
+ static final int PRIMARYORDERSHIFT = 16;
+ static final int SECONDARYORDERSHIFT = 8;
// ==============================================================
// instance variables
--- a/jdk/src/java.base/share/classes/java/text/RBTableBuilder.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/text/RBTableBuilder.java Fri Sep 25 12:04:35 2015 -0700
@@ -583,14 +583,14 @@
// ==============================================================
// constants
// ==============================================================
- final static int CHARINDEX = 0x70000000; // need look up in .commit()
+ static final int CHARINDEX = 0x70000000; // need look up in .commit()
- private final static int IGNORABLEMASK = 0x0000ffff;
- private final static int PRIMARYORDERINCREMENT = 0x00010000;
- private final static int SECONDARYORDERINCREMENT = 0x00000100;
- private final static int TERTIARYORDERINCREMENT = 0x00000001;
- private final static int INITIALTABLESIZE = 20;
- private final static int MAXKEYSIZE = 5;
+ private static final int IGNORABLEMASK = 0x0000ffff;
+ private static final int PRIMARYORDERINCREMENT = 0x00010000;
+ private static final int SECONDARYORDERINCREMENT = 0x00000100;
+ private static final int TERTIARYORDERINCREMENT = 0x00000001;
+ private static final int INITIALTABLESIZE = 20;
+ private static final int MAXKEYSIZE = 5;
// ==============================================================
// instance variables
--- a/jdk/src/java.base/share/classes/java/text/RuleBasedCollator.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/text/RuleBasedCollator.java Fri Sep 25 12:04:35 2015 -0700
@@ -750,12 +750,12 @@
// private
// ==============================================================
- final static int CHARINDEX = 0x70000000; // need look up in .commit()
- final static int EXPANDCHARINDEX = 0x7E000000; // Expand index follows
- final static int CONTRACTCHARINDEX = 0x7F000000; // contract indexes follow
- final static int UNMAPPED = 0xFFFFFFFF;
+ static final int CHARINDEX = 0x70000000; // need look up in .commit()
+ static final int EXPANDCHARINDEX = 0x7E000000; // Expand index follows
+ static final int CONTRACTCHARINDEX = 0x7F000000; // contract indexes follow
+ static final int UNMAPPED = 0xFFFFFFFF;
- private final static int COLLATIONKEYOFFSET = 1;
+ private static final int COLLATIONKEYOFFSET = 1;
private RBCollationTables tables = null;
--- a/jdk/src/java.base/share/classes/java/text/SimpleDateFormat.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/text/SimpleDateFormat.java Fri Sep 25 12:04:35 2015 -0700
@@ -456,42 +456,42 @@
* Saved numberFormat and pattern.
* @see SimpleDateFormat#checkNegativeNumberExpression
*/
- transient private NumberFormat originalNumberFormat;
- transient private String originalNumberPattern;
+ private transient NumberFormat originalNumberFormat;
+ private transient String originalNumberPattern;
/**
* The minus sign to be used with format and parse.
*/
- transient private char minusSign = '-';
+ private transient char minusSign = '-';
/**
* True when a negative sign follows a number.
* (True as default in Arabic.)
*/
- transient private boolean hasFollowingMinusSign = false;
+ private transient boolean hasFollowingMinusSign = false;
/**
* True if standalone form needs to be used.
*/
- transient private boolean forceStandaloneForm = false;
+ private transient boolean forceStandaloneForm = false;
/**
* The compiled pattern.
*/
- transient private char[] compiledPattern;
+ private transient char[] compiledPattern;
/**
* Tags for the compiled pattern.
*/
- private final static int TAG_QUOTE_ASCII_CHAR = 100;
- private final static int TAG_QUOTE_CHARS = 101;
+ private static final int TAG_QUOTE_ASCII_CHAR = 100;
+ private static final int TAG_QUOTE_CHARS = 101;
/**
* Locale dependent digit zero.
* @see #zeroPaddingNumber
* @see java.text.DecimalFormatSymbols#getZeroDigit
*/
- transient private char zeroDigit;
+ private transient char zeroDigit;
/**
* The symbols used by this formatter for week names, month names,
@@ -510,7 +510,7 @@
*/
private Date defaultCenturyStart;
- transient private int defaultCenturyStartYear;
+ private transient int defaultCenturyStartYear;
private static final int MILLIS_PER_MINUTE = 60 * 1000;
--- a/jdk/src/java.base/share/classes/java/util/AbstractList.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/util/AbstractList.java Fri Sep 25 12:04:35 2015 -0700
@@ -115,7 +115,7 @@
*
* @throws IndexOutOfBoundsException {@inheritDoc}
*/
- abstract public E get(int index);
+ public abstract E get(int index);
/**
* {@inheritDoc}
--- a/jdk/src/java.base/share/classes/java/util/BitSet.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/util/BitSet.java Fri Sep 25 12:04:35 2015 -0700
@@ -68,9 +68,9 @@
* a long, which consists of 64 bits, requiring 6 address bits.
* The choice of word size is determined purely by performance concerns.
*/
- private final static int ADDRESS_BITS_PER_WORD = 6;
- private final static int BITS_PER_WORD = 1 << ADDRESS_BITS_PER_WORD;
- private final static int BIT_INDEX_MASK = BITS_PER_WORD - 1;
+ private static final int ADDRESS_BITS_PER_WORD = 6;
+ private static final int BITS_PER_WORD = 1 << ADDRESS_BITS_PER_WORD;
+ private static final int BIT_INDEX_MASK = BITS_PER_WORD - 1;
/* Used to shift left or right for a partial word mask */
private static final long WORD_MASK = 0xffffffffffffffffL;
--- a/jdk/src/java.base/share/classes/java/util/Calendar.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/util/Calendar.java Fri Sep 25 12:04:35 2015 -0700
@@ -370,13 +370,13 @@
* @see GregorianCalendar#AD
* @see GregorianCalendar#BC
*/
- public final static int ERA = 0;
+ public static final int ERA = 0;
/**
* Field number for <code>get</code> and <code>set</code> indicating the
* year. This is a calendar-specific value; see subclass documentation.
*/
- public final static int YEAR = 1;
+ public static final int YEAR = 1;
/**
* Field number for <code>get</code> and <code>set</code> indicating the
@@ -399,7 +399,7 @@
* @see #DECEMBER
* @see #UNDECIMBER
*/
- public final static int MONTH = 2;
+ public static final int MONTH = 2;
/**
* Field number for <code>get</code> and <code>set</code> indicating the
@@ -412,7 +412,7 @@
* @see #getFirstDayOfWeek
* @see #getMinimalDaysInFirstWeek
*/
- public final static int WEEK_OF_YEAR = 3;
+ public static final int WEEK_OF_YEAR = 3;
/**
* Field number for <code>get</code> and <code>set</code> indicating the
@@ -425,7 +425,7 @@
* @see #getFirstDayOfWeek
* @see #getMinimalDaysInFirstWeek
*/
- public final static int WEEK_OF_MONTH = 4;
+ public static final int WEEK_OF_MONTH = 4;
/**
* Field number for <code>get</code> and <code>set</code> indicating the
@@ -434,7 +434,7 @@
*
* @see #DAY_OF_MONTH
*/
- public final static int DATE = 5;
+ public static final int DATE = 5;
/**
* Field number for <code>get</code> and <code>set</code> indicating the
@@ -443,13 +443,13 @@
*
* @see #DATE
*/
- public final static int DAY_OF_MONTH = 5;
+ public static final int DAY_OF_MONTH = 5;
/**
* Field number for <code>get</code> and <code>set</code> indicating the day
* number within the current year. The first day of the year has value 1.
*/
- public final static int DAY_OF_YEAR = 6;
+ public static final int DAY_OF_YEAR = 6;
/**
* Field number for <code>get</code> and <code>set</code> indicating the day
@@ -465,7 +465,7 @@
* @see #FRIDAY
* @see #SATURDAY
*/
- public final static int DAY_OF_WEEK = 7;
+ public static final int DAY_OF_WEEK = 7;
/**
* Field number for <code>get</code> and <code>set</code> indicating the
@@ -490,7 +490,7 @@
* @see #DAY_OF_WEEK
* @see #WEEK_OF_MONTH
*/
- public final static int DAY_OF_WEEK_IN_MONTH = 8;
+ public static final int DAY_OF_WEEK_IN_MONTH = 8;
/**
* Field number for <code>get</code> and <code>set</code> indicating
@@ -501,7 +501,7 @@
* @see #PM
* @see #HOUR
*/
- public final static int AM_PM = 9;
+ public static final int AM_PM = 9;
/**
* Field number for <code>get</code> and <code>set</code> indicating the
@@ -512,7 +512,7 @@
* @see #AM_PM
* @see #HOUR_OF_DAY
*/
- public final static int HOUR = 10;
+ public static final int HOUR = 10;
/**
* Field number for <code>get</code> and <code>set</code> indicating the
@@ -521,28 +521,28 @@
*
* @see #HOUR
*/
- public final static int HOUR_OF_DAY = 11;
+ public static final int HOUR_OF_DAY = 11;
/**
* Field number for <code>get</code> and <code>set</code> indicating the
* minute within the hour.
* E.g., at 10:04:15.250 PM the <code>MINUTE</code> is 4.
*/
- public final static int MINUTE = 12;
+ public static final int MINUTE = 12;
/**
* Field number for <code>get</code> and <code>set</code> indicating the
* second within the minute.
* E.g., at 10:04:15.250 PM the <code>SECOND</code> is 15.
*/
- public final static int SECOND = 13;
+ public static final int SECOND = 13;
/**
* Field number for <code>get</code> and <code>set</code> indicating the
* millisecond within the second.
* E.g., at 10:04:15.250 PM the <code>MILLISECOND</code> is 250.
*/
- public final static int MILLISECOND = 14;
+ public static final int MILLISECOND = 14;
/**
* Field number for <code>get</code> and <code>set</code>
@@ -553,7 +553,7 @@
* <code>TimeZone</code> implementation subclass supports
* historical GMT offset changes.
*/
- public final static int ZONE_OFFSET = 15;
+ public static final int ZONE_OFFSET = 15;
/**
* Field number for <code>get</code> and <code>set</code> indicating the
@@ -564,146 +564,146 @@
* <code>TimeZone</code> implementation subclass supports
* historical Daylight Saving Time schedule changes.
*/
- public final static int DST_OFFSET = 16;
+ public static final int DST_OFFSET = 16;
/**
* The number of distinct fields recognized by <code>get</code> and <code>set</code>.
* Field numbers range from <code>0..FIELD_COUNT-1</code>.
*/
- public final static int FIELD_COUNT = 17;
+ public static final int FIELD_COUNT = 17;
/**
* Value of the {@link #DAY_OF_WEEK} field indicating
* Sunday.
*/
- public final static int SUNDAY = 1;
+ public static final int SUNDAY = 1;
/**
* Value of the {@link #DAY_OF_WEEK} field indicating
* Monday.
*/
- public final static int MONDAY = 2;
+ public static final int MONDAY = 2;
/**
* Value of the {@link #DAY_OF_WEEK} field indicating
* Tuesday.
*/
- public final static int TUESDAY = 3;
+ public static final int TUESDAY = 3;
/**
* Value of the {@link #DAY_OF_WEEK} field indicating
* Wednesday.
*/
- public final static int WEDNESDAY = 4;
+ public static final int WEDNESDAY = 4;
/**
* Value of the {@link #DAY_OF_WEEK} field indicating
* Thursday.
*/
- public final static int THURSDAY = 5;
+ public static final int THURSDAY = 5;
/**
* Value of the {@link #DAY_OF_WEEK} field indicating
* Friday.
*/
- public final static int FRIDAY = 6;
+ public static final int FRIDAY = 6;
/**
* Value of the {@link #DAY_OF_WEEK} field indicating
* Saturday.
*/
- public final static int SATURDAY = 7;
+ public static final int SATURDAY = 7;
/**
* Value of the {@link #MONTH} field indicating the
* first month of the year in the Gregorian and Julian calendars.
*/
- public final static int JANUARY = 0;
+ public static final int JANUARY = 0;
/**
* Value of the {@link #MONTH} field indicating the
* second month of the year in the Gregorian and Julian calendars.
*/
- public final static int FEBRUARY = 1;
+ public static final int FEBRUARY = 1;
/**
* Value of the {@link #MONTH} field indicating the
* third month of the year in the Gregorian and Julian calendars.
*/
- public final static int MARCH = 2;
+ public static final int MARCH = 2;
/**
* Value of the {@link #MONTH} field indicating the
* fourth month of the year in the Gregorian and Julian calendars.
*/
- public final static int APRIL = 3;
+ public static final int APRIL = 3;
/**
* Value of the {@link #MONTH} field indicating the
* fifth month of the year in the Gregorian and Julian calendars.
*/
- public final static int MAY = 4;
+ public static final int MAY = 4;
/**
* Value of the {@link #MONTH} field indicating the
* sixth month of the year in the Gregorian and Julian calendars.
*/
- public final static int JUNE = 5;
+ public static final int JUNE = 5;
/**
* Value of the {@link #MONTH} field indicating the
* seventh month of the year in the Gregorian and Julian calendars.
*/
- public final static int JULY = 6;
+ public static final int JULY = 6;
/**
* Value of the {@link #MONTH} field indicating the
* eighth month of the year in the Gregorian and Julian calendars.
*/
- public final static int AUGUST = 7;
+ public static final int AUGUST = 7;
/**
* Value of the {@link #MONTH} field indicating the
* ninth month of the year in the Gregorian and Julian calendars.
*/
- public final static int SEPTEMBER = 8;
+ public static final int SEPTEMBER = 8;
/**
* Value of the {@link #MONTH} field indicating the
* tenth month of the year in the Gregorian and Julian calendars.
*/
- public final static int OCTOBER = 9;
+ public static final int OCTOBER = 9;
/**
* Value of the {@link #MONTH} field indicating the
* eleventh month of the year in the Gregorian and Julian calendars.
*/
- public final static int NOVEMBER = 10;
+ public static final int NOVEMBER = 10;
/**
* Value of the {@link #MONTH} field indicating the
* twelfth month of the year in the Gregorian and Julian calendars.
*/
- public final static int DECEMBER = 11;
+ public static final int DECEMBER = 11;
/**
* Value of the {@link #MONTH} field indicating the
* thirteenth month of the year. Although <code>GregorianCalendar</code>
* does not use this value, lunar calendars do.
*/
- public final static int UNDECIMBER = 12;
+ public static final int UNDECIMBER = 12;
/**
* Value of the {@link #AM_PM} field indicating the
* period of the day from midnight to just before noon.
*/
- public final static int AM = 0;
+ public static final int AM = 0;
/**
* Value of the {@link #AM_PM} field indicating the
* period of the day from noon to just before midnight.
*/
- public final static int PM = 1;
+ public static final int PM = 1;
/**
* A style specifier for {@link #getDisplayNames(int, int, Locale)
@@ -856,7 +856,7 @@
* are two special values, UNSET and COMPUTED. Values from
* MINIMUM_USER_SET to Integer.MAX_VALUE are legal user set values.
*/
- transient private int stamp[];
+ private transient int stamp[];
/**
* The currently set time for this calendar, expressed in milliseconds after
@@ -911,7 +911,7 @@
/**
* <code>True</code> if zone references to a shared TimeZone object.
*/
- transient private boolean sharedZone = false;
+ private transient boolean sharedZone = false;
/**
* The first day of the week, with possible values <code>SUNDAY</code>,
@@ -1003,24 +1003,24 @@
// Mask values for calendar fields
@SuppressWarnings("PointlessBitwiseExpression")
- final static int ERA_MASK = (1 << ERA);
- final static int YEAR_MASK = (1 << YEAR);
- final static int MONTH_MASK = (1 << MONTH);
- final static int WEEK_OF_YEAR_MASK = (1 << WEEK_OF_YEAR);
- final static int WEEK_OF_MONTH_MASK = (1 << WEEK_OF_MONTH);
- final static int DAY_OF_MONTH_MASK = (1 << DAY_OF_MONTH);
- final static int DATE_MASK = DAY_OF_MONTH_MASK;
- final static int DAY_OF_YEAR_MASK = (1 << DAY_OF_YEAR);
- final static int DAY_OF_WEEK_MASK = (1 << DAY_OF_WEEK);
- final static int DAY_OF_WEEK_IN_MONTH_MASK = (1 << DAY_OF_WEEK_IN_MONTH);
- final static int AM_PM_MASK = (1 << AM_PM);
- final static int HOUR_MASK = (1 << HOUR);
- final static int HOUR_OF_DAY_MASK = (1 << HOUR_OF_DAY);
- final static int MINUTE_MASK = (1 << MINUTE);
- final static int SECOND_MASK = (1 << SECOND);
- final static int MILLISECOND_MASK = (1 << MILLISECOND);
- final static int ZONE_OFFSET_MASK = (1 << ZONE_OFFSET);
- final static int DST_OFFSET_MASK = (1 << DST_OFFSET);
+ static final int ERA_MASK = (1 << ERA);
+ static final int YEAR_MASK = (1 << YEAR);
+ static final int MONTH_MASK = (1 << MONTH);
+ static final int WEEK_OF_YEAR_MASK = (1 << WEEK_OF_YEAR);
+ static final int WEEK_OF_MONTH_MASK = (1 << WEEK_OF_MONTH);
+ static final int DAY_OF_MONTH_MASK = (1 << DAY_OF_MONTH);
+ static final int DATE_MASK = DAY_OF_MONTH_MASK;
+ static final int DAY_OF_YEAR_MASK = (1 << DAY_OF_YEAR);
+ static final int DAY_OF_WEEK_MASK = (1 << DAY_OF_WEEK);
+ static final int DAY_OF_WEEK_IN_MONTH_MASK = (1 << DAY_OF_WEEK_IN_MONTH);
+ static final int AM_PM_MASK = (1 << AM_PM);
+ static final int HOUR_MASK = (1 << HOUR);
+ static final int HOUR_OF_DAY_MASK = (1 << HOUR_OF_DAY);
+ static final int MINUTE_MASK = (1 << MINUTE);
+ static final int SECOND_MASK = (1 << SECOND);
+ static final int MILLISECOND_MASK = (1 << MILLISECOND);
+ static final int ZONE_OFFSET_MASK = (1 << ZONE_OFFSET);
+ static final int DST_OFFSET_MASK = (1 << DST_OFFSET);
/**
* {@code Calendar.Builder} is used for creating a {@code Calendar} from
@@ -2795,7 +2795,7 @@
* @see #roll(int,int)
* @see #set(int,int)
*/
- abstract public void add(int field, int amount);
+ public abstract void add(int field, int amount);
/**
* Adds or subtracts (up/down) a single unit of time on the given time
@@ -2817,7 +2817,7 @@
* @see Calendar#add(int,int)
* @see Calendar#set(int,int)
*/
- abstract public void roll(int field, boolean up);
+ public abstract void roll(int field, boolean up);
/**
* Adds the specified (signed) amount to the specified calendar field
@@ -3104,7 +3104,7 @@
* @see #getActualMinimum(int)
* @see #getActualMaximum(int)
*/
- abstract public int getMinimum(int field);
+ public abstract int getMinimum(int field);
/**
* Returns the maximum value for the given calendar field of this
@@ -3121,7 +3121,7 @@
* @see #getActualMinimum(int)
* @see #getActualMaximum(int)
*/
- abstract public int getMaximum(int field);
+ public abstract int getMaximum(int field);
/**
* Returns the highest minimum value for the given calendar field
@@ -3139,7 +3139,7 @@
* @see #getActualMinimum(int)
* @see #getActualMaximum(int)
*/
- abstract public int getGreatestMinimum(int field);
+ public abstract int getGreatestMinimum(int field);
/**
* Returns the lowest maximum value for the given calendar field
@@ -3161,7 +3161,7 @@
* @see #getActualMinimum(int)
* @see #getActualMaximum(int)
*/
- abstract public int getLeastMaximum(int field);
+ public abstract int getLeastMaximum(int field);
/**
* Returns the minimum value that the specified calendar field
--- a/jdk/src/java.base/share/classes/java/util/Comparators.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/util/Comparators.java Fri Sep 25 12:04:35 2015 -0700
@@ -61,7 +61,7 @@
/**
* Null-friendly comparators
*/
- final static class NullComparator<T> implements Comparator<T>, Serializable {
+ static final class NullComparator<T> implements Comparator<T>, Serializable {
private static final long serialVersionUID = -7569533591570686392L;
private final boolean nullFirst;
// if null, non-null Ts are considered equal
--- a/jdk/src/java.base/share/classes/java/util/Currency.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/util/Currency.java Fri Sep 25 12:04:35 2015 -0700
@@ -110,13 +110,13 @@
* Default fraction digits for this currency.
* Set from currency data tables.
*/
- transient private final int defaultFractionDigits;
+ private final transient int defaultFractionDigits;
/**
* ISO 4217 numeric code for this currency.
* Set from currency data tables.
*/
- transient private final int numericCode;
+ private final transient int numericCode;
// class data: instance map
--- a/jdk/src/java.base/share/classes/java/util/Date.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/util/Date.java Fri Sep 25 12:04:35 2015 -0700
@@ -613,7 +613,7 @@
// syntax error
throw new IllegalArgumentException();
}
- private final static String wtb[] = {
+ private static final String wtb[] = {
"am", "pm",
"monday", "tuesday", "wednesday", "thursday", "friday",
"saturday", "sunday",
@@ -622,7 +622,7 @@
"gmt", "ut", "utc", "est", "edt", "cst", "cdt",
"mst", "mdt", "pst", "pdt"
};
- private final static int ttb[] = {
+ private static final int ttb[] = {
14, 1, 0, 0, 0, 0, 0, 0, 0,
2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
10000 + 0, 10000 + 0, 10000 + 0, // GMT/UT/UTC
@@ -1300,7 +1300,7 @@
return gcal;
}
- synchronized private static final BaseCalendar getJulianCalendar() {
+ private static final synchronized BaseCalendar getJulianCalendar() {
if (jcal == null) {
jcal = (BaseCalendar) CalendarSystem.forName("julian");
}
--- a/jdk/src/java.base/share/classes/java/util/Dictionary.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/util/Dictionary.java Fri Sep 25 12:04:35 2015 -0700
@@ -60,7 +60,7 @@
*
* @return the number of keys in this dictionary.
*/
- abstract public int size();
+ public abstract int size();
/**
* Tests if this dictionary maps no keys to value. The general contract
@@ -70,7 +70,7 @@
* @return {@code true} if this dictionary maps no keys to values;
* {@code false} otherwise.
*/
- abstract public boolean isEmpty();
+ public abstract boolean isEmpty();
/**
* Returns an enumeration of the keys in this dictionary. The general
@@ -82,7 +82,7 @@
* @see java.util.Dictionary#elements()
* @see java.util.Enumeration
*/
- abstract public Enumeration<K> keys();
+ public abstract Enumeration<K> keys();
/**
* Returns an enumeration of the values in this dictionary. The general
@@ -94,7 +94,7 @@
* @see java.util.Dictionary#keys()
* @see java.util.Enumeration
*/
- abstract public Enumeration<V> elements();
+ public abstract Enumeration<V> elements();
/**
* Returns the value to which the key is mapped in this dictionary.
@@ -109,7 +109,7 @@
* @exception NullPointerException if the {@code key} is {@code null}.
* @see java.util.Dictionary#put(java.lang.Object, java.lang.Object)
*/
- abstract public V get(Object key);
+ public abstract V get(Object key);
/**
* Maps the specified {@code key} to the specified
@@ -138,7 +138,7 @@
* @see java.lang.Object#equals(java.lang.Object)
* @see java.util.Dictionary#get(java.lang.Object)
*/
- abstract public V put(K key, V value);
+ public abstract V put(K key, V value);
/**
* Removes the {@code key} (and its corresponding
@@ -151,5 +151,5 @@
* mapping.
* @exception NullPointerException if {@code key} is {@code null}.
*/
- abstract public V remove(Object key);
+ public abstract V remove(Object key);
}
--- a/jdk/src/java.base/share/classes/java/util/GregorianCalendar.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/util/GregorianCalendar.java Fri Sep 25 12:04:35 2015 -0700
@@ -2282,7 +2282,7 @@
* Long.MIN_VALUE, the fixed date value is unknown. Currently,
* Julian calendar dates are not cached.
*/
- transient private long cachedFixedDate = Long.MIN_VALUE;
+ private transient long cachedFixedDate = Long.MIN_VALUE;
/**
* Converts the time value (millisecond offset from the <a
--- a/jdk/src/java.base/share/classes/java/util/JapaneseImperialCalendar.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/util/JapaneseImperialCalendar.java Fri Sep 25 12:04:35 2015 -0700
@@ -1551,7 +1551,7 @@
* The fixed date corresponding to jdate. If the value is
* Long.MIN_VALUE, the fixed date value is unknown.
*/
- transient private long cachedFixedDate = Long.MIN_VALUE;
+ private transient long cachedFixedDate = Long.MIN_VALUE;
/**
* Converts the time value (millisecond offset from the <a
--- a/jdk/src/java.base/share/classes/java/util/ListResourceBundle.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/util/ListResourceBundle.java Fri Sep 25 12:04:35 2015 -0700
@@ -180,7 +180,7 @@
* @return an array of an <code>Object</code> array representing a
* key-value pair.
*/
- abstract protected Object[][] getContents();
+ protected abstract Object[][] getContents();
// ==================privates====================
--- a/jdk/src/java.base/share/classes/java/util/Locale.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/util/Locale.java Fri Sep 25 12:04:35 2015 -0700
@@ -483,91 +483,91 @@
*/
public final class Locale implements Cloneable, Serializable {
- static private final Cache LOCALECACHE = new Cache();
+ private static final Cache LOCALECACHE = new Cache();
/** Useful constant for language.
*/
- static public final Locale ENGLISH = createConstant("en", "");
+ public static final Locale ENGLISH = createConstant("en", "");
/** Useful constant for language.
*/
- static public final Locale FRENCH = createConstant("fr", "");
+ public static final Locale FRENCH = createConstant("fr", "");
/** Useful constant for language.
*/
- static public final Locale GERMAN = createConstant("de", "");
+ public static final Locale GERMAN = createConstant("de", "");
/** Useful constant for language.
*/
- static public final Locale ITALIAN = createConstant("it", "");
+ public static final Locale ITALIAN = createConstant("it", "");
/** Useful constant for language.
*/
- static public final Locale JAPANESE = createConstant("ja", "");
+ public static final Locale JAPANESE = createConstant("ja", "");
/** Useful constant for language.
*/
- static public final Locale KOREAN = createConstant("ko", "");
+ public static final Locale KOREAN = createConstant("ko", "");
/** Useful constant for language.
*/
- static public final Locale CHINESE = createConstant("zh", "");
+ public static final Locale CHINESE = createConstant("zh", "");
/** Useful constant for language.
*/
- static public final Locale SIMPLIFIED_CHINESE = createConstant("zh", "CN");
+ public static final Locale SIMPLIFIED_CHINESE = createConstant("zh", "CN");
/** Useful constant for language.
*/
- static public final Locale TRADITIONAL_CHINESE = createConstant("zh", "TW");
+ public static final Locale TRADITIONAL_CHINESE = createConstant("zh", "TW");
/** Useful constant for country.
*/
- static public final Locale FRANCE = createConstant("fr", "FR");
+ public static final Locale FRANCE = createConstant("fr", "FR");
/** Useful constant for country.
*/
- static public final Locale GERMANY = createConstant("de", "DE");
+ public static final Locale GERMANY = createConstant("de", "DE");
/** Useful constant for country.
*/
- static public final Locale ITALY = createConstant("it", "IT");
+ public static final Locale ITALY = createConstant("it", "IT");
/** Useful constant for country.
*/
- static public final Locale JAPAN = createConstant("ja", "JP");
+ public static final Locale JAPAN = createConstant("ja", "JP");
/** Useful constant for country.
*/
- static public final Locale KOREA = createConstant("ko", "KR");
+ public static final Locale KOREA = createConstant("ko", "KR");
/** Useful constant for country.
*/
- static public final Locale CHINA = SIMPLIFIED_CHINESE;
+ public static final Locale CHINA = SIMPLIFIED_CHINESE;
/** Useful constant for country.
*/
- static public final Locale PRC = SIMPLIFIED_CHINESE;
+ public static final Locale PRC = SIMPLIFIED_CHINESE;
/** Useful constant for country.
*/
- static public final Locale TAIWAN = TRADITIONAL_CHINESE;
+ public static final Locale TAIWAN = TRADITIONAL_CHINESE;
/** Useful constant for country.
*/
- static public final Locale UK = createConstant("en", "GB");
+ public static final Locale UK = createConstant("en", "GB");
/** Useful constant for country.
*/
- static public final Locale US = createConstant("en", "US");
+ public static final Locale US = createConstant("en", "US");
/** Useful constant for country.
*/
- static public final Locale CANADA = createConstant("en", "CA");
+ public static final Locale CANADA = createConstant("en", "CA");
/** Useful constant for country.
*/
- static public final Locale CANADA_FRENCH = createConstant("fr", "CA");
+ public static final Locale CANADA_FRENCH = createConstant("fr", "CA");
/**
* Useful constant for the root locale. The root locale is the locale whose
@@ -577,7 +577,7 @@
*
* @since 1.6
*/
- static public final Locale ROOT = createConstant("", "");
+ public static final Locale ROOT = createConstant("", "");
/**
* The key for the private use extension ('x').
@@ -586,7 +586,7 @@
* @see Builder#setExtension(char, String)
* @since 1.7
*/
- static public final char PRIVATE_USE_EXTENSION = 'x';
+ public static final char PRIVATE_USE_EXTENSION = 'x';
/**
* The key for Unicode locale extension ('u').
@@ -595,7 +595,7 @@
* @see Builder#setExtension(char, String)
* @since 1.7
*/
- static public final char UNICODE_LOCALE_EXTENSION = 'u';
+ public static final char UNICODE_LOCALE_EXTENSION = 'u';
/** serialization ID
*/
@@ -2018,9 +2018,9 @@
*/
private transient volatile int hashCodeValue = 0;
- private volatile static Locale defaultLocale = initDefault();
- private volatile static Locale defaultDisplayLocale = null;
- private volatile static Locale defaultFormatLocale = null;
+ private static volatile Locale defaultLocale = initDefault();
+ private static volatile Locale defaultDisplayLocale = null;
+ private static volatile Locale defaultFormatLocale = null;
private transient volatile String languageTag;
--- a/jdk/src/java.base/share/classes/java/util/PropertyPermission.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/util/PropertyPermission.java Fri Sep 25 12:04:35 2015 -0700
@@ -90,20 +90,20 @@
/**
* Read action.
*/
- private final static int READ = 0x1;
+ private static final int READ = 0x1;
/**
* Write action.
*/
- private final static int WRITE = 0x2;
+ private static final int WRITE = 0x2;
/**
* All actions (read,write);
*/
- private final static int ALL = READ|WRITE;
+ private static final int ALL = READ|WRITE;
/**
* No actions.
*/
- private final static int NONE = 0x0;
+ private static final int NONE = 0x0;
/**
* The actions mask.
--- a/jdk/src/java.base/share/classes/java/util/Random.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/util/Random.java Fri Sep 25 12:04:35 2015 -0700
@@ -165,7 +165,7 @@
*
* @param seed the initial seed
*/
- synchronized public void setSeed(long seed) {
+ public synchronized void setSeed(long seed) {
this.seed.set(initialScramble(seed));
haveNextNextGaussian = false;
}
@@ -580,7 +580,7 @@
* standard deviation {@code 1.0} from this random number
* generator's sequence
*/
- synchronized public double nextGaussian() {
+ public synchronized double nextGaussian() {
// See Knuth, ACP, Section 3.4.1 Algorithm C.
if (haveNextNextGaussian) {
haveNextNextGaussian = false;
@@ -1197,7 +1197,7 @@
/**
* Save the {@code Random} instance to a stream.
*/
- synchronized private void writeObject(ObjectOutputStream s)
+ private synchronized void writeObject(ObjectOutputStream s)
throws IOException {
// set the values of the Serializable fields
--- a/jdk/src/java.base/share/classes/java/util/Scanner.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/util/Scanner.java Fri Sep 25 12:04:35 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,16 +25,18 @@
package java.util;
-import java.nio.file.Path;
-import java.nio.file.Files;
-import java.util.regex.*;
import java.io.*;
import java.math.*;
import java.nio.*;
import java.nio.channels.*;
import java.nio.charset.*;
+import java.nio.file.Path;
+import java.nio.file.Files;
import java.text.*;
-import java.util.Locale;
+import java.util.function.Consumer;
+import java.util.regex.*;
+import java.util.stream.Stream;
+import java.util.stream.StreamSupport;
import sun.misc.LRUCache;
@@ -96,22 +98,25 @@
* }</pre></blockquote>
*
* <p>The <a name="default-delimiter">default whitespace delimiter</a> used
- * by a scanner is as recognized by {@link java.lang.Character}.{@link
- * java.lang.Character#isWhitespace(char) isWhitespace}. The {@link #reset}
+ * by a scanner is as recognized by {@link Character#isWhitespace(char)
+ * Character.isWhitespace()}. The {@link #reset reset()}
* method will reset the value of the scanner's delimiter to the default
* whitespace delimiter regardless of whether it was previously changed.
*
* <p>A scanning operation may block waiting for input.
*
* <p>The {@link #next} and {@link #hasNext} methods and their
- * primitive-type companion methods (such as {@link #nextInt} and
+ * companion methods (such as {@link #nextInt} and
* {@link #hasNextInt}) first skip any input that matches the delimiter
- * pattern, and then attempt to return the next token. Both {@code hasNext}
- * and {@code next} methods may block waiting for further input. Whether a
- * {@code hasNext} method blocks has no connection to whether or not its
- * associated {@code next} method will block.
+ * pattern, and then attempt to return the next token. Both {@code hasNext()}
+ * and {@code next()} methods may block waiting for further input. Whether a
+ * {@code hasNext()} method blocks has no connection to whether or not its
+ * associated {@code next()} method will block. The {@link #tokens} method
+ * may also block waiting for input.
*
- * <p> The {@link #findInLine}, {@link #findWithinHorizon}, and {@link #skip}
+ * <p>The {@link #findInLine findInLine()},
+ * {@link #findWithinHorizon findWithinHorizon()},
+ * {@link #skip skip()}, and {@link #findAll findAll()}
* methods operate independently of the delimiter pattern. These methods will
* attempt to match the specified pattern with no regard to delimiters in the
* input and thus can be used in special circumstances where delimiters are
@@ -129,7 +134,7 @@
*
* <p> A scanner can read text from any object which implements the {@link
* java.lang.Readable} interface. If an invocation of the underlying
- * readable's {@link java.lang.Readable#read} method throws an {@link
+ * readable's {@link java.lang.Readable#read read()} method throws an {@link
* java.io.IOException} then the scanner assumes that the end of the input
* has been reached. The most recent {@code IOException} thrown by the
* underlying readable can be retrieved via the {@link #ioException} method.
@@ -156,7 +161,7 @@
* <a name="initial-locale">initial locale </a>is the value returned by the {@link
* java.util.Locale#getDefault(Locale.Category)
* Locale.getDefault(Locale.Category.FORMAT)} method; it may be changed via the {@link
- * #useLocale} method. The {@link #reset} method will reset the value of the
+ * #useLocale useLocale()} method. The {@link #reset} method will reset the value of the
* scanner's locale to the initial locale regardless of whether it was
* previously changed.
*
@@ -374,6 +379,11 @@
// A holder of the last IOException encountered
private IOException lastException;
+ // Number of times this scanner's state has been modified.
+ // Generally incremented on most public APIs and checked
+ // within spliterator implementations.
+ int modCount;
+
// A pattern for java whitespace
private static Pattern WHITESPACE_PATTERN = Pattern.compile(
"\\p{javaWhitespace}+");
@@ -995,8 +1005,9 @@
}
// Finds the specified pattern in the buffer up to horizon.
- // Returns a match for the specified input pattern.
- private String findPatternInBuffer(Pattern pattern, int horizon) {
+ // Returns true if the specified input pattern was matched,
+ // and leaves the matcher field with the current match state.
+ private boolean findPatternInBuffer(Pattern pattern, int horizon) {
matchValid = false;
matcher.usePattern(pattern);
int bufferLimit = buf.limit();
@@ -1014,7 +1025,7 @@
if (searchLimit != horizonLimit) {
// Hit an artificial end; try to extend the match
needInput = true;
- return null;
+ return false;
}
// The match could go away depending on what is next
if ((searchLimit == horizonLimit) && matcher.requireEnd()) {
@@ -1022,27 +1033,28 @@
// that it is at the horizon and the end of input is
// required for the match.
needInput = true;
- return null;
+ return false;
}
}
// Did not hit end, or hit real end, or hit horizon
position = matcher.end();
- return matcher.group();
+ return true;
}
if (sourceClosed)
- return null;
+ return false;
// If there is no specified horizon, or if we have not searched
// to the specified horizon yet, get more input
if ((horizon == 0) || (searchLimit != horizonLimit))
needInput = true;
- return null;
+ return false;
}
- // Returns a match for the specified input pattern anchored at
- // the current position
- private String matchPatternInBuffer(Pattern pattern) {
+ // Attempts to match a pattern anchored at the current position.
+ // Returns true if the specified input pattern was matched,
+ // and leaves the matcher field with the current match state.
+ private boolean matchPatternInBuffer(Pattern pattern) {
matchValid = false;
matcher.usePattern(pattern);
matcher.region(position, buf.limit());
@@ -1050,18 +1062,18 @@
if (matcher.hitEnd() && (!sourceClosed)) {
// Get more input and try again
needInput = true;
- return null;
+ return false;
}
position = matcher.end();
- return matcher.group();
+ return true;
}
if (sourceClosed)
- return null;
+ return false;
// Read more to find pattern
needInput = true;
- return null;
+ return false;
}
// Throws if the scanner is closed
@@ -1128,6 +1140,7 @@
* @return this scanner
*/
public Scanner useDelimiter(Pattern pattern) {
+ modCount++;
delimPattern = pattern;
return this;
}
@@ -1147,6 +1160,7 @@
* @return this scanner
*/
public Scanner useDelimiter(String pattern) {
+ modCount++;
delimPattern = patternCache.forName(pattern);
return this;
}
@@ -1181,6 +1195,7 @@
if (locale.equals(this.locale))
return this;
+ modCount++;
this.locale = locale;
DecimalFormat df =
(DecimalFormat)NumberFormat.getNumberInstance(locale);
@@ -1236,8 +1251,8 @@
* number matching regular expressions; see
* <a href= "#localized-numbers">localized numbers</a> above.
*
- * <p>If the radix is less than {@code Character.MIN_RADIX}
- * or greater than {@code Character.MAX_RADIX}, then an
+ * <p>If the radix is less than {@link Character#MIN_RADIX Character.MIN_RADIX}
+ * or greater than {@link Character#MAX_RADIX Character.MAX_RADIX}, then an
* {@code IllegalArgumentException} is thrown.
*
* <p>Invoking the {@link #reset} method will set the scanner's radix to
@@ -1253,6 +1268,7 @@
if (this.defaultRadix == radix)
return this;
+ modCount++;
this.defaultRadix = radix;
// Force rebuilding and recompilation of radix dependent patterns
integerPattern = null;
@@ -1275,15 +1291,15 @@
* if no match has been performed, or if the last match was
* not successful.
*
- * <p>The various {@code next}methods of {@code Scanner}
+ * <p>The various {@code next} methods of {@code Scanner}
* make a match result available if they complete without throwing an
* exception. For instance, after an invocation of the {@link #nextInt}
* method that returned an int, this method returns a
* {@code MatchResult} for the search of the
* <a href="#Integer-regex"><i>Integer</i></a> regular expression
- * defined above. Similarly the {@link #findInLine},
- * {@link #findWithinHorizon}, and {@link #skip} methods will make a
- * match available if they succeed.
+ * defined above. Similarly the {@link #findInLine findInLine()},
+ * {@link #findWithinHorizon findWithinHorizon()}, and {@link #skip skip()}
+ * methods will make a match available if they succeed.
*
* @return a match result for the last match operation
* @throws IllegalStateException If no match result is available
@@ -1333,6 +1349,7 @@
public boolean hasNext() {
ensureOpen();
saveState();
+ modCount++;
while (!sourceClosed) {
if (hasTokenInBuffer())
return revertState(true);
@@ -1357,6 +1374,7 @@
public String next() {
ensureOpen();
clearCaches();
+ modCount++;
while (true) {
String token = getCompleteTokenInBuffer(null);
@@ -1435,6 +1453,7 @@
throw new NullPointerException();
hasNextPattern = null;
saveState();
+ modCount++;
while (true) {
if (getCompleteTokenInBuffer(pattern) != null) {
@@ -1466,6 +1485,7 @@
if (pattern == null)
throw new NullPointerException();
+ modCount++;
// Did we already find this pattern?
if (hasNextPattern == pattern)
return getCachedResult();
@@ -1497,6 +1517,7 @@
public boolean hasNextLine() {
saveState();
+ modCount++;
String result = findWithinHorizon(linePattern(), 0);
if (result != null) {
MatchResult mr = this.match();
@@ -1531,6 +1552,7 @@
* @throws IllegalStateException if this scanner is closed
*/
public String nextLine() {
+ modCount++;
if (hasNextPattern == linePattern())
return getCachedResult();
clearCaches();
@@ -1589,12 +1611,12 @@
if (pattern == null)
throw new NullPointerException();
clearCaches();
+ modCount++;
// Expand buffer to include the next newline or end of input
int endPosition = 0;
saveState();
while (true) {
- String token = findPatternInBuffer(separatorPattern(), 0);
- if (token != null) {
+ if (findPatternInBuffer(separatorPattern(), 0)) {
endPosition = matcher.start();
break; // up to next newline
}
@@ -1623,7 +1645,7 @@
* <p>An invocation of this method of the form
* {@code findWithinHorizon(pattern)} behaves in exactly the same way as
* the invocation
- * {@code findWithinHorizon(Pattern.compile(pattern, horizon))}.
+ * {@code findWithinHorizon(Pattern.compile(pattern), horizon)}.
*
* @param pattern a string specifying the pattern to search for
* @param horizon the search horizon
@@ -1673,13 +1695,13 @@
if (horizon < 0)
throw new IllegalArgumentException("horizon < 0");
clearCaches();
+ modCount++;
// Search for the pattern
while (true) {
- String token = findPatternInBuffer(pattern, horizon);
- if (token != null) {
+ if (findPatternInBuffer(pattern, horizon)) {
matchValid = true;
- return token;
+ return matcher.group();
}
if (needInput)
readInput();
@@ -1717,11 +1739,11 @@
if (pattern == null)
throw new NullPointerException();
clearCaches();
+ modCount++;
// Search for the pattern
while (true) {
- String token = matchPatternInBuffer(pattern);
- if (token != null) {
+ if (matchPatternInBuffer(pattern)) {
matchValid = true;
position = matcher.end();
return this;
@@ -1932,7 +1954,7 @@
*
* <p> An invocation of this method of the form
* {@code nextShort()} behaves in exactly the same way as the
- * invocation {@code nextShort(radix)}, where {@code radix}
+ * invocation {@link #nextShort(int) nextShort(radix)}, where {@code radix}
* is the default radix of this scanner.
*
* @return the {@code short} scanned from the input
@@ -2590,8 +2612,10 @@
* Resets this scanner.
*
* <p> Resetting a scanner discards all of its explicit state
- * information which may have been changed by invocations of {@link
- * #useDelimiter}, {@link #useLocale}, or {@link #useRadix}.
+ * information which may have been changed by invocations of
+ * {@link #useDelimiter useDelimiter()},
+ * {@link #useLocale useLocale()}, or
+ * {@link #useRadix useRadix()}.
*
* <p> An invocation of this method of the form
* {@code scanner.reset()} behaves in exactly the same way as the
@@ -2612,6 +2636,206 @@
useLocale(Locale.getDefault(Locale.Category.FORMAT));
useRadix(10);
clearCaches();
+ modCount++;
return this;
}
+
+ /**
+ * Returns a stream of delimiter-separated tokens from this scanner. The
+ * stream contains the same tokens that would be returned, starting from
+ * this scanner's current state, by calling the {@link #next} method
+ * repeatedly until the {@link #hasNext} method returns false.
+ *
+ * <p>The resulting stream is sequential and ordered. All stream elements are
+ * non-null.
+ *
+ * <p>Scanning starts upon initiation of the terminal stream operation, using the
+ * current state of this scanner. Subsequent calls to any methods on this scanner
+ * other than {@link #close} and {@link #ioException} may return undefined results
+ * or may cause undefined effects on the returned stream. The returned stream's source
+ * {@code Spliterator} is <em>fail-fast</em> and will, on a best-effort basis, throw a
+ * {@link java.util.ConcurrentModificationException} if any such calls are detected
+ * during stream pipeline execution.
+ *
+ * <p>After stream pipeline execution completes, this scanner is left in an indeterminate
+ * state and cannot be reused.
+ *
+ * <p>If this scanner contains a resource that must be released, this scanner
+ * should be closed, either by calling its {@link #close} method, or by
+ * closing the returned stream. Closing the stream will close the underlying scanner.
+ * {@code IllegalStateException} is thrown if the scanner has been closed when this
+ * method is called, or if this scanner is closed during stream pipeline execution.
+ *
+ * <p>This method might block waiting for more input.
+ *
+ * @apiNote
+ * For example, the following code will create a list of
+ * comma-delimited tokens from a string:
+ *
+ * <pre>{@code
+ * List<String> result = new Scanner("abc,def,,ghi")
+ * .useDelimiter(",")
+ * .tokens()
+ * .collect(Collectors.toList());
+ * }</pre>
+ *
+ * <p>The resulting list would contain {@code "abc"}, {@code "def"},
+ * the empty string, and {@code "ghi"}.
+ *
+ * @return a sequential stream of token strings
+ * @throws IllegalStateException if this scanner is closed
+ * @since 1.9
+ */
+ public Stream<String> tokens() {
+ ensureOpen();
+ Stream<String> stream = StreamSupport.stream(new TokenSpliterator(), false);
+ return stream.onClose(this::close);
+ }
+
+ class TokenSpliterator extends Spliterators.AbstractSpliterator<String> {
+ int expectedCount = -1;
+
+ TokenSpliterator() {
+ super(Long.MAX_VALUE,
+ Spliterator.IMMUTABLE | Spliterator.NONNULL | Spliterator.ORDERED);
+ }
+
+ @Override
+ public boolean tryAdvance(Consumer<? super String> cons) {
+ if (expectedCount >= 0 && expectedCount != modCount) {
+ throw new ConcurrentModificationException();
+ }
+
+ if (hasNext()) {
+ String token = next();
+ expectedCount = modCount;
+ cons.accept(token);
+ if (expectedCount != modCount) {
+ throw new ConcurrentModificationException();
+ }
+ return true;
+ } else {
+ expectedCount = modCount;
+ return false;
+ }
+ }
+ }
+
+ /**
+ * Returns a stream of match results from this scanner. The stream
+ * contains the same results in the same order that would be returned by
+ * calling {@code findWithinHorizon(pattern, 0)} and then {@link #match}
+ * successively as long as {@link #findWithinHorizon findWithinHorizon()}
+ * finds matches.
+ *
+ * <p>The resulting stream is sequential and ordered. All stream elements are
+ * non-null.
+ *
+ * <p>Scanning starts upon initiation of the terminal stream operation, using the
+ * current state of this scanner. Subsequent calls to any methods on this scanner
+ * other than {@link #close} and {@link #ioException} may return undefined results
+ * or may cause undefined effects on the returned stream. The returned stream's source
+ * {@code Spliterator} is <em>fail-fast</em> and will, on a best-effort basis, throw a
+ * {@link java.util.ConcurrentModificationException} if any such calls are detected
+ * during stream pipeline execution.
+ *
+ * <p>After stream pipeline execution completes, this scanner is left in an indeterminate
+ * state and cannot be reused.
+ *
+ * <p>If this scanner contains a resource that must be released, this scanner
+ * should be closed, either by calling its {@link #close} method, or by
+ * closing the returned stream. Closing the stream will close the underlying scanner.
+ * {@code IllegalStateException} is thrown if the scanner has been closed when this
+ * method is called, or if this scanner is closed during stream pipeline execution.
+ *
+ * <p>As with the {@link #findWithinHorizon findWithinHorizon()} methods, this method
+ * might block waiting for additional input, and it might buffer an unbounded amount of
+ * input searching for a match.
+ *
+ * @apiNote
+ * For example, the following code will read a file and return a list
+ * of all sequences of characters consisting of seven or more Latin capital
+ * letters:
+ *
+ * <pre>{@code
+ * try (Scanner sc = new Scanner(Paths.get("input.txt"))) {
+ * Pattern pat = Pattern.compile("[A-Z]{7,}");
+ * List<String> capWords = sc.findAll(pat)
+ * .map(MatchResult::group)
+ * .collect(Collectors.toList());
+ * }
+ * }</pre>
+ *
+ * @param pattern the pattern to be matched
+ * @return a sequential stream of match results
+ * @throws NullPointerException if pattern is null
+ * @throws IllegalStateException if this scanner is closed
+ * @since 1.9
+ */
+ public Stream<MatchResult> findAll(Pattern pattern) {
+ Objects.requireNonNull(pattern);
+ ensureOpen();
+ Stream<MatchResult> stream = StreamSupport.stream(new FindSpliterator(pattern), false);
+ return stream.onClose(this::close);
+ }
+
+ /**
+ * Returns a stream of match results that match the provided pattern string.
+ * The effect is equivalent to the following code:
+ *
+ * <pre>{@code
+ * scanner.findAll(Pattern.compile(patString))
+ * }</pre>
+ *
+ * @param patString the pattern string
+ * @return a sequential stream of match results
+ * @throws NullPointerException if patString is null
+ * @throws IllegalStateException if this scanner is closed
+ * @throws PatternSyntaxException if the regular expression's syntax is invalid
+ * @since 1.9
+ * @see java.util.regex.Pattern
+ */
+ public Stream<MatchResult> findAll(String patString) {
+ Objects.requireNonNull(patString);
+ ensureOpen();
+ return findAll(patternCache.forName(patString));
+ }
+
+ class FindSpliterator extends Spliterators.AbstractSpliterator<MatchResult> {
+ final Pattern pattern;
+ int expectedCount = -1;
+
+ FindSpliterator(Pattern pattern) {
+ super(Long.MAX_VALUE,
+ Spliterator.IMMUTABLE | Spliterator.NONNULL | Spliterator.ORDERED);
+ this.pattern = pattern;
+ }
+
+ @Override
+ public boolean tryAdvance(Consumer<? super MatchResult> cons) {
+ ensureOpen();
+ if (expectedCount >= 0) {
+ if (expectedCount != modCount) {
+ throw new ConcurrentModificationException();
+ }
+ } else {
+ expectedCount = modCount;
+ }
+
+ while (true) {
+ // assert expectedCount == modCount
+ if (findPatternInBuffer(pattern, 0)) { // doesn't increment modCount
+ cons.accept(matcher.toMatchResult());
+ if (expectedCount != modCount) {
+ throw new ConcurrentModificationException();
+ }
+ return true;
+ }
+ if (needInput)
+ readInput(); // doesn't increment modCount
+ else
+ return false; // reached end of input
+ }
+ }
+ }
}
--- a/jdk/src/java.base/share/classes/java/util/SimpleTimeZone.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/util/SimpleTimeZone.java Fri Sep 25 12:04:35 2015 -0700
@@ -1125,8 +1125,8 @@
* be streamed out for compatibility with JDK 1.1.
*/
private final byte monthLength[] = staticMonthLength;
- private final static byte staticMonthLength[] = {31,28,31,30,31,30,31,31,30,31,30,31};
- private final static byte staticLeapMonthLength[] = {31,29,31,30,31,30,31,31,30,31,30,31};
+ private static final byte staticMonthLength[] = {31,28,31,30,31,30,31,31,30,31,30,31};
+ private static final byte staticLeapMonthLength[] = {31,29,31,30,31,30,31,31,30,31,30,31};
/**
* Variables specifying the mode of the start rule. Takes the following
@@ -1278,7 +1278,7 @@
*/
private int serialVersionOnStream = currentSerialVersion;
- synchronized private void invalidateCache() {
+ private synchronized void invalidateCache() {
cacheYear = startYear - 1;
cacheStart = cacheEnd = 0;
}
--- a/jdk/src/java.base/share/classes/java/util/Spliterators.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/util/Spliterators.java Fri Sep 25 12:04:35 2015 -0700
@@ -833,7 +833,7 @@
// Implementations
- private static abstract class EmptySpliterator<T, S extends Spliterator<T>, C> {
+ private abstract static class EmptySpliterator<T, S extends Spliterator<T>, C> {
EmptySpliterator() { }
@@ -1253,7 +1253,7 @@
* @see #spliterator(Iterator, long, int)
* @since 1.8
*/
- public static abstract class AbstractSpliterator<T> implements Spliterator<T> {
+ public abstract static class AbstractSpliterator<T> implements Spliterator<T> {
static final int BATCH_UNIT = 1 << 10; // batch array size increment
static final int MAX_BATCH = 1 << 25; // max batch array size;
private final int characteristics;
@@ -1376,7 +1376,7 @@
* @see #spliterator(java.util.PrimitiveIterator.OfInt, long, int)
* @since 1.8
*/
- public static abstract class AbstractIntSpliterator implements Spliterator.OfInt {
+ public abstract static class AbstractIntSpliterator implements Spliterator.OfInt {
static final int MAX_BATCH = AbstractSpliterator.MAX_BATCH;
static final int BATCH_UNIT = AbstractSpliterator.BATCH_UNIT;
private final int characteristics;
@@ -1486,7 +1486,7 @@
* @see #spliterator(java.util.PrimitiveIterator.OfLong, long, int)
* @since 1.8
*/
- public static abstract class AbstractLongSpliterator implements Spliterator.OfLong {
+ public abstract static class AbstractLongSpliterator implements Spliterator.OfLong {
static final int MAX_BATCH = AbstractSpliterator.MAX_BATCH;
static final int BATCH_UNIT = AbstractSpliterator.BATCH_UNIT;
private final int characteristics;
@@ -1596,7 +1596,7 @@
* @see #spliterator(java.util.PrimitiveIterator.OfDouble, long, int)
* @since 1.8
*/
- public static abstract class AbstractDoubleSpliterator implements Spliterator.OfDouble {
+ public abstract static class AbstractDoubleSpliterator implements Spliterator.OfDouble {
static final int MAX_BATCH = AbstractSpliterator.MAX_BATCH;
static final int BATCH_UNIT = AbstractSpliterator.BATCH_UNIT;
private final int characteristics;
--- a/jdk/src/java.base/share/classes/java/util/TimeZone.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/util/TimeZone.java Fri Sep 25 12:04:35 2015 -0700
@@ -130,7 +130,7 @@
* @author Mark Davis, David Goldsmith, Chen-Lieh Huang, Alan Liu
* @since 1.1
*/
-abstract public class TimeZone implements Serializable, Cloneable {
+public abstract class TimeZone implements Serializable, Cloneable {
/**
* Sole constructor. (For invocation by subclass constructors, typically
* implicit.)
@@ -253,7 +253,7 @@
*
* @param offsetMillis the given base time zone offset to GMT.
*/
- abstract public void setRawOffset(int offsetMillis);
+ public abstract void setRawOffset(int offsetMillis);
/**
* Returns the amount of time in milliseconds to add to UTC to get
@@ -500,7 +500,7 @@
* @return {@code true} if the given date is in Daylight Saving Time,
* {@code false}, otherwise.
*/
- abstract public boolean inDaylightTime(Date date);
+ public abstract boolean inDaylightTime(Date date);
/**
* Gets the <code>TimeZone</code> for the given ID.
--- a/jdk/src/java.base/share/classes/java/util/Timer.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/util/Timer.java Fri Sep 25 12:04:35 2015 -0700
@@ -119,7 +119,7 @@
/**
* This ID is used to generate thread names.
*/
- private final static AtomicInteger nextSerialNumber = new AtomicInteger(0);
+ private static final AtomicInteger nextSerialNumber = new AtomicInteger(0);
private static int serialNumber() {
return nextSerialNumber.getAndIncrement();
}
--- a/jdk/src/java.base/share/classes/java/util/jar/Pack200.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/util/jar/Pack200.java Fri Sep 25 12:04:35 2015 -0700
@@ -127,7 +127,7 @@
*
* @return A newly allocated Packer engine.
*/
- public synchronized static Packer newPacker() {
+ public static synchronized Packer newPacker() {
return (Packer) newInstance(PACK_PROVIDER);
}
@@ -688,7 +688,7 @@
private static Class<?> packerImpl;
private static Class<?> unpackerImpl;
- private synchronized static Object newInstance(String prop) {
+ private static synchronized Object newInstance(String prop) {
String implName = "(unknown)";
try {
Class<?> impl = (PACK_PROVIDER.equals(prop))? packerImpl: unpackerImpl;
--- a/jdk/src/java.base/share/classes/java/util/regex/Pattern.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/util/regex/Pattern.java Fri Sep 25 12:04:35 2015 -0700
@@ -3787,7 +3787,7 @@
* Abstract node class to match one character satisfying some
* boolean property.
*/
- private static abstract class CharProperty extends Node {
+ private abstract static class CharProperty extends Node {
abstract boolean isSatisfiedBy(int ch);
CharProperty complement() {
return new CharProperty() {
@@ -3815,7 +3815,7 @@
* Optimized version of CharProperty that works only for
* properties never satisfied by Supplementary characters.
*/
- private static abstract class BmpCharProperty extends CharProperty {
+ private abstract static class BmpCharProperty extends CharProperty {
boolean match(Matcher matcher, int i, CharSequence seq) {
if (i < matcher.to) {
return isSatisfiedBy(seq.charAt(i))
@@ -5578,7 +5578,7 @@
return m == null ? null : m.make();
}
- private static abstract class CharPropertyFactory {
+ private abstract static class CharPropertyFactory {
abstract CharProperty make();
}
@@ -5600,7 +5600,7 @@
CharProperty make() { return new Ctype(ctype);}});
}
- private static abstract class CloneableProperty
+ private abstract static class CloneableProperty
extends CharProperty implements Cloneable
{
public CloneableProperty clone() {
--- a/jdk/src/java.base/share/classes/java/util/regex/UnicodeProp.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/util/regex/UnicodeProp.java Fri Sep 25 12:04:35 2015 -0700
@@ -202,8 +202,8 @@
}
};
- private final static HashMap<String, String> posix = new HashMap<>();
- private final static HashMap<String, String> aliases = new HashMap<>();
+ private static final HashMap<String, String> posix = new HashMap<>();
+ private static final HashMap<String, String> aliases = new HashMap<>();
static {
posix.put("ALPHA", "ALPHABETIC");
posix.put("LOWER", "LOWERCASE");
--- a/jdk/src/java.base/share/classes/java/util/stream/FindOps.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/util/stream/FindOps.java Fri Sep 25 12:04:35 2015 -0700
@@ -167,7 +167,7 @@
* @param <T> The type of input element
* @param <O> The result type, typically an optional type
*/
- private static abstract class FindSink<T, O> implements TerminalSink<T, O> {
+ private abstract static class FindSink<T, O> implements TerminalSink<T, O> {
boolean hasValue;
T value;
--- a/jdk/src/java.base/share/classes/java/util/stream/ForEachOps.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/util/stream/ForEachOps.java Fri Sep 25 12:04:35 2015 -0700
@@ -130,7 +130,7 @@
*
* @param <T> the output type of the stream pipeline
*/
- static abstract class ForEachOp<T>
+ abstract static class ForEachOp<T>
implements TerminalOp<T, Void>, TerminalSink<T, Void> {
private final boolean ordered;
--- a/jdk/src/java.base/share/classes/java/util/stream/MatchOps.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/util/stream/MatchOps.java Fri Sep 25 12:04:35 2015 -0700
@@ -249,7 +249,7 @@
*
* @param <T> The output type of the stream pipeline
*/
- private static abstract class BooleanTerminalSink<T> implements Sink<T> {
+ private abstract static class BooleanTerminalSink<T> implements Sink<T> {
boolean stop;
boolean value;
--- a/jdk/src/java.base/share/classes/java/util/stream/Nodes.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/util/stream/Nodes.java Fri Sep 25 12:04:35 2015 -0700
@@ -562,7 +562,7 @@
// Implementations
- private static abstract class EmptyNode<T, T_ARR, T_CONS> implements Node<T> {
+ private abstract static class EmptyNode<T, T_ARR, T_CONS> implements Node<T> {
EmptyNode() { }
@Override
@@ -750,7 +750,7 @@
/**
* Node class for an internal node with two or more children
*/
- private static abstract class AbstractConcNode<T, T_NODE extends Node<T>> implements Node<T> {
+ private abstract static class AbstractConcNode<T, T_NODE extends Node<T>> implements Node<T> {
protected final T_NODE left;
protected final T_NODE right;
private final long size;
@@ -932,7 +932,7 @@
}
/** Abstract class for spliterator for all internal node classes */
- private static abstract class InternalNodeSpliterator<T,
+ private abstract static class InternalNodeSpliterator<T,
S extends Spliterator<T>,
N extends Node<T>>
implements Spliterator<T> {
@@ -1114,7 +1114,7 @@
}
}
- private static abstract class OfPrimitive<T, T_CONS, T_ARR,
+ private abstract static class OfPrimitive<T, T_CONS, T_ARR,
T_SPLITR extends Spliterator.OfPrimitive<T, T_CONS, T_SPLITR>,
N extends Node.OfPrimitive<T, T_CONS, T_ARR, T_SPLITR, N>>
extends InternalNodeSpliterator<T, T_SPLITR, N>
@@ -1827,7 +1827,7 @@
* This and subclasses are not intended to be serializable
*/
@SuppressWarnings("serial")
- private static abstract class SizedCollectorTask<P_IN, P_OUT, T_SINK extends Sink<P_OUT>,
+ private abstract static class SizedCollectorTask<P_IN, P_OUT, T_SINK extends Sink<P_OUT>,
K extends SizedCollectorTask<P_IN, P_OUT, T_SINK, K>>
extends CountedCompleter<Void>
implements Sink<P_OUT> {
@@ -2030,7 +2030,7 @@
}
@SuppressWarnings("serial")
- private static abstract class ToArrayTask<T, T_NODE extends Node<T>,
+ private abstract static class ToArrayTask<T, T_NODE extends Node<T>,
K extends ToArrayTask<T, T_NODE, K>>
extends CountedCompleter<Void> {
protected final T_NODE node;
--- a/jdk/src/java.base/share/classes/java/util/stream/ReduceOps.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/util/stream/ReduceOps.java Fri Sep 25 12:04:35 2015 -0700
@@ -797,7 +797,7 @@
/**
* A sink that counts elements
*/
- static abstract class CountingSink<T>
+ abstract static class CountingSink<T>
extends Box<Long>
implements AccumulatingSink<T, Long, CountingSink<T>> {
long count;
@@ -866,7 +866,7 @@
*
* @param <U> The type of the state element
*/
- private static abstract class Box<U> {
+ private abstract static class Box<U> {
U state;
Box() {} // Avoid creation of special accessor
@@ -886,7 +886,7 @@
* @param <R> the result type of the reducing operation
* @param <S> the type of the {@code AccumulatingSink}
*/
- private static abstract class ReduceOp<T, R, S extends AccumulatingSink<T, R, S>>
+ private abstract static class ReduceOp<T, R, S extends AccumulatingSink<T, R, S>>
implements TerminalOp<T, R> {
private final StreamShape inputShape;
--- a/jdk/src/java.base/share/classes/java/util/stream/Sink.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/util/stream/Sink.java Fri Sep 25 12:04:35 2015 -0700
@@ -241,7 +241,7 @@
* implementation of the {@code accept()} method must call the correct
* {@code accept()} method on the downstream {@code Sink}.
*/
- static abstract class ChainedReference<T, E_OUT> implements Sink<T> {
+ abstract static class ChainedReference<T, E_OUT> implements Sink<T> {
protected final Sink<? super E_OUT> downstream;
public ChainedReference(Sink<? super E_OUT> downstream) {
@@ -273,7 +273,7 @@
* The implementation of the {@code accept()} method must call the correct
* {@code accept()} method on the downstream {@code Sink}.
*/
- static abstract class ChainedInt<E_OUT> implements Sink.OfInt {
+ abstract static class ChainedInt<E_OUT> implements Sink.OfInt {
protected final Sink<? super E_OUT> downstream;
public ChainedInt(Sink<? super E_OUT> downstream) {
@@ -305,7 +305,7 @@
* The implementation of the {@code accept()} method must call the correct
* {@code accept()} method on the downstream {@code Sink}.
*/
- static abstract class ChainedLong<E_OUT> implements Sink.OfLong {
+ abstract static class ChainedLong<E_OUT> implements Sink.OfLong {
protected final Sink<? super E_OUT> downstream;
public ChainedLong(Sink<? super E_OUT> downstream) {
@@ -337,7 +337,7 @@
* The implementation of the {@code accept()} method must call the correct
* {@code accept()} method on the downstream {@code Sink}.
*/
- static abstract class ChainedDouble<E_OUT> implements Sink.OfDouble {
+ abstract static class ChainedDouble<E_OUT> implements Sink.OfDouble {
protected final Sink<? super E_OUT> downstream;
public ChainedDouble(Sink<? super E_OUT> downstream) {
--- a/jdk/src/java.base/share/classes/java/util/stream/SortedOps.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/util/stream/SortedOps.java Fri Sep 25 12:04:35 2015 -0700
@@ -301,7 +301,7 @@
* occur, in general (not restricted to just sorting), for short-circuiting
* parallel pipelines.
*/
- private static abstract class AbstractRefSortingSink<T> extends Sink.ChainedReference<T, T> {
+ private abstract static class AbstractRefSortingSink<T> extends Sink.ChainedReference<T, T> {
protected final Comparator<? super T> comparator;
// @@@ could be a lazy final value, if/when support is added
protected boolean cancellationWasRequested;
@@ -408,7 +408,7 @@
/**
* Abstract {@link Sink} for implementing sort on int streams.
*/
- private static abstract class AbstractIntSortingSink extends Sink.ChainedInt<Integer> {
+ private abstract static class AbstractIntSortingSink extends Sink.ChainedInt<Integer> {
protected boolean cancellationWasRequested;
AbstractIntSortingSink(Sink<? super Integer> downstream) {
@@ -506,7 +506,7 @@
/**
* Abstract {@link Sink} for implementing sort on long streams.
*/
- private static abstract class AbstractLongSortingSink extends Sink.ChainedLong<Long> {
+ private abstract static class AbstractLongSortingSink extends Sink.ChainedLong<Long> {
protected boolean cancellationWasRequested;
AbstractLongSortingSink(Sink<? super Long> downstream) {
@@ -604,7 +604,7 @@
/**
* Abstract {@link Sink} for implementing sort on long streams.
*/
- private static abstract class AbstractDoubleSortingSink extends Sink.ChainedDouble<Double> {
+ private abstract static class AbstractDoubleSortingSink extends Sink.ChainedDouble<Double> {
protected boolean cancellationWasRequested;
AbstractDoubleSortingSink(Sink<? super Double> downstream) {
--- a/jdk/src/java.base/share/classes/java/util/stream/StreamSpliterators.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/util/stream/StreamSpliterators.java Fri Sep 25 12:04:35 2015 -0700
@@ -57,7 +57,7 @@
* <p>A wrapping spliterator produced from a sequential stream
* cannot be split if there are stateful operations present.
*/
- private static abstract class AbstractWrappingSpliterator<P_IN, P_OUT,
+ private abstract static class AbstractWrappingSpliterator<P_IN, P_OUT,
T_BUFFER extends AbstractSpinedBuffer>
implements Spliterator<P_OUT> {
@@ -607,7 +607,7 @@
* {@code SUBSIZED}.
*
*/
- static abstract class SliceSpliterator<T, T_SPLITR extends Spliterator<T>> {
+ abstract static class SliceSpliterator<T, T_SPLITR extends Spliterator<T>> {
// The start index of the slice
final long sliceOrigin;
// One past the last index of the slice
@@ -753,7 +753,7 @@
}
}
- static abstract class OfPrimitive<T,
+ abstract static class OfPrimitive<T,
T_SPLITR extends Spliterator.OfPrimitive<T, T_CONS, T_SPLITR>,
T_CONS>
extends SliceSpliterator<T, T_SPLITR>
@@ -899,7 +899,7 @@
* collected to a {@code Node}. It is the order of the pipeline stage
* that governs whether the this slice spliterator is to be used or not.
*/
- static abstract class UnorderedSliceSpliterator<T, T_SPLITR extends Spliterator<T>> {
+ abstract static class UnorderedSliceSpliterator<T, T_SPLITR extends Spliterator<T>> {
static final int CHUNK_SIZE = 1 << 7;
// The spliterator to slice
@@ -1060,7 +1060,7 @@
* @param <T_BUFF> the type of the spined buffer. Must also be a type of
* {@code T_CONS}.
*/
- static abstract class OfPrimitive<
+ abstract static class OfPrimitive<
T,
T_CONS,
T_BUFF extends ArrayBuffer.OfPrimitive<T_CONS>,
@@ -1324,7 +1324,7 @@
* The {@code tryAdvance} method always returns true.
*
*/
- static abstract class InfiniteSupplyingSpliterator<T> implements Spliterator<T> {
+ abstract static class InfiniteSupplyingSpliterator<T> implements Spliterator<T> {
long estimate;
protected InfiniteSupplyingSpliterator(long estimate) {
@@ -1442,7 +1442,7 @@
}
// @@@ Consolidate with Node.Builder
- static abstract class ArrayBuffer {
+ abstract static class ArrayBuffer {
int index;
void reset() {
@@ -1470,7 +1470,7 @@
}
}
- static abstract class OfPrimitive<T_CONS> extends ArrayBuffer {
+ abstract static class OfPrimitive<T_CONS> extends ArrayBuffer {
int index;
@Override
--- a/jdk/src/java.base/share/classes/java/util/stream/Streams.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/util/stream/Streams.java Fri Sep 25 12:04:35 2015 -0700
@@ -298,7 +298,7 @@
}
}
- private static abstract class AbstractStreamBuilderImpl<T, S extends Spliterator<T>> implements Spliterator<T> {
+ private abstract static class AbstractStreamBuilderImpl<T, S extends Spliterator<T>> implements Spliterator<T> {
// >= 0 when building, < 0 when built
// -1 == no elements
// -2 == one element, held by first
@@ -782,7 +782,7 @@
}
}
- private static abstract class OfPrimitive<T, T_CONS, T_SPLITR extends Spliterator.OfPrimitive<T, T_CONS, T_SPLITR>>
+ private abstract static class OfPrimitive<T, T_CONS, T_SPLITR extends Spliterator.OfPrimitive<T, T_CONS, T_SPLITR>>
extends ConcatSpliterator<T, T_SPLITR>
implements Spliterator.OfPrimitive<T, T_CONS, T_SPLITR> {
private OfPrimitive(T_SPLITR aSpliterator, T_SPLITR bSpliterator) {
--- a/jdk/src/java.base/share/classes/java/util/stream/WhileOps.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/util/stream/WhileOps.java Fri Sep 25 12:04:35 2015 -0700
@@ -649,7 +649,7 @@
* @param <T> the type of elements returned by this spliterator
* @param <T_SPLITR> the type of the spliterator
*/
- static abstract class UnorderedWhileSpliterator<T, T_SPLITR extends Spliterator<T>> implements Spliterator<T> {
+ abstract static class UnorderedWhileSpliterator<T, T_SPLITR extends Spliterator<T>> implements Spliterator<T> {
// Power of two constant minus one used for modulus of count
static final int CANCEL_CHECK_COUNT = (1 << 6) - 1;
@@ -715,7 +715,7 @@
abstract T_SPLITR makeSpliterator(T_SPLITR s);
- static abstract class OfRef<T> extends UnorderedWhileSpliterator<T, Spliterator<T>> implements Consumer<T> {
+ abstract static class OfRef<T> extends UnorderedWhileSpliterator<T, Spliterator<T>> implements Consumer<T> {
final Predicate<? super T> p;
T t;
@@ -820,7 +820,7 @@
}
}
- static abstract class OfInt extends UnorderedWhileSpliterator<Integer, Spliterator.OfInt> implements IntConsumer, Spliterator.OfInt {
+ abstract static class OfInt extends UnorderedWhileSpliterator<Integer, Spliterator.OfInt> implements IntConsumer, Spliterator.OfInt {
final IntPredicate p;
int t;
@@ -925,7 +925,7 @@
}
}
- static abstract class OfLong extends UnorderedWhileSpliterator<Long, Spliterator.OfLong> implements LongConsumer, Spliterator.OfLong {
+ abstract static class OfLong extends UnorderedWhileSpliterator<Long, Spliterator.OfLong> implements LongConsumer, Spliterator.OfLong {
final LongPredicate p;
long t;
@@ -1030,7 +1030,7 @@
}
}
- static abstract class OfDouble extends UnorderedWhileSpliterator<Double, Spliterator.OfDouble> implements DoubleConsumer, Spliterator.OfDouble {
+ abstract static class OfDouble extends UnorderedWhileSpliterator<Double, Spliterator.OfDouble> implements DoubleConsumer, Spliterator.OfDouble {
final DoublePredicate p;
double t;
--- a/jdk/src/java.base/share/classes/java/util/zip/Adler32.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/util/zip/Adler32.java Fri Sep 25 12:04:35 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -28,6 +28,8 @@
import java.nio.ByteBuffer;
import sun.nio.ch.DirectBuffer;
+import jdk.internal.HotSpotIntrinsicCandidate;
+
/**
* A class that can be used to compute the Adler-32 checksum of a data
* stream. An Adler-32 checksum is almost as reliable as a CRC-32 but
@@ -125,9 +127,12 @@
return (long)adler & 0xffffffffL;
}
- private native static int update(int adler, int b);
- private native static int updateBytes(int adler, byte[] b, int off,
+ private static native int update(int adler, int b);
+
+ @HotSpotIntrinsicCandidate
+ private static native int updateBytes(int adler, byte[] b, int off,
int len);
- private native static int updateByteBuffer(int adler, long addr,
+ @HotSpotIntrinsicCandidate
+ private static native int updateByteBuffer(int adler, long addr,
int off, int len);
}
--- a/jdk/src/java.base/share/classes/java/util/zip/CRC32.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/util/zip/CRC32.java Fri Sep 25 12:04:35 2015 -0700
@@ -127,7 +127,7 @@
}
@HotSpotIntrinsicCandidate
- private native static int update(int crc, int b);
+ private static native int update(int crc, int b);
private static int updateBytes(int crc, byte[] b, int off, int len) {
updateBytesCheck(b, off, len);
@@ -135,7 +135,7 @@
}
@HotSpotIntrinsicCandidate
- private native static int updateBytes0(int crc, byte[] b, int off, int len);
+ private static native int updateBytes0(int crc, byte[] b, int off, int len);
private static void updateBytesCheck(byte[] b, int off, int len) {
if (len <= 0) {
@@ -161,7 +161,7 @@
}
@HotSpotIntrinsicCandidate
- private native static int updateByteBuffer0(int alder, long addr,
+ private static native int updateByteBuffer0(int alder, long addr,
int off, int len);
private static void updateByteBufferCheck(long addr) {
--- a/jdk/src/java.base/share/classes/java/util/zip/Deflater.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/util/zip/Deflater.java Fri Sep 25 12:04:35 2015 -0700
@@ -558,11 +558,11 @@
}
private static native void initIDs();
- private native static long init(int level, int strategy, boolean nowrap);
- private native static void setDictionary(long addr, byte[] b, int off, int len);
+ private static native long init(int level, int strategy, boolean nowrap);
+ private static native void setDictionary(long addr, byte[] b, int off, int len);
private native int deflateBytes(long addr, byte[] b, int off, int len,
int flush);
- private native static int getAdler(long addr);
- private native static void reset(long addr);
- private native static void end(long addr);
+ private static native int getAdler(long addr);
+ private static native void reset(long addr);
+ private static native void end(long addr);
}
--- a/jdk/src/java.base/share/classes/java/util/zip/GZIPInputStream.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/util/zip/GZIPInputStream.java Fri Sep 25 12:04:35 2015 -0700
@@ -142,16 +142,16 @@
/**
* GZIP header magic number.
*/
- public final static int GZIP_MAGIC = 0x8b1f;
+ public static final int GZIP_MAGIC = 0x8b1f;
/*
* File header flags.
*/
- private final static int FTEXT = 1; // Extra text
- private final static int FHCRC = 2; // Header CRC
- private final static int FEXTRA = 4; // Extra field
- private final static int FNAME = 8; // File name
- private final static int FCOMMENT = 16; // File comment
+ private static final int FTEXT = 1; // Extra text
+ private static final int FHCRC = 2; // Header CRC
+ private static final int FEXTRA = 4; // Extra field
+ private static final int FNAME = 8; // File name
+ private static final int FCOMMENT = 16; // File comment
/*
* Reads GZIP member header and returns the total byte number
--- a/jdk/src/java.base/share/classes/java/util/zip/GZIPOutputStream.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/util/zip/GZIPOutputStream.java Fri Sep 25 12:04:35 2015 -0700
@@ -44,13 +44,13 @@
/*
* GZIP header magic number.
*/
- private final static int GZIP_MAGIC = 0x8b1f;
+ private static final int GZIP_MAGIC = 0x8b1f;
/*
* Trailer size in bytes.
*
*/
- private final static int TRAILER_SIZE = 8;
+ private static final int TRAILER_SIZE = 8;
/**
* Creates a new output stream with the specified buffer size.
--- a/jdk/src/java.base/share/classes/java/util/zip/Inflater.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/util/zip/Inflater.java Fri Sep 25 12:04:35 2015 -0700
@@ -395,13 +395,13 @@
}
}
- private native static void initIDs();
- private native static long init(boolean nowrap);
- private native static void setDictionary(long addr, byte[] b, int off,
+ private static native void initIDs();
+ private static native long init(boolean nowrap);
+ private static native void setDictionary(long addr, byte[] b, int off,
int len);
private native int inflateBytes(long addr, byte[] b, int off, int len)
throws DataFormatException;
- private native static int getAdler(long addr);
- private native static void reset(long addr);
- private native static void end(long addr);
+ private static native int getAdler(long addr);
+ private static native void reset(long addr);
+ private static native void end(long addr);
}
--- a/jdk/src/java.base/share/classes/javax/crypto/Cipher.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/javax/crypto/Cipher.java Fri Sep 25 12:04:35 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -336,15 +336,15 @@
}
// Provider attribute name for supported chaining mode
- private final static String ATTR_MODE = "SupportedModes";
+ private static final String ATTR_MODE = "SupportedModes";
// Provider attribute name for supported padding names
- private final static String ATTR_PAD = "SupportedPaddings";
+ private static final String ATTR_PAD = "SupportedPaddings";
// constants indicating whether the provider supports
// a given mode or padding
- private final static int S_NO = 0; // does not support
- private final static int S_MAYBE = 1; // unable to determine
- private final static int S_YES = 2; // does support
+ private static final int S_NO = 0; // does not support
+ private static final int S_MAYBE = 1; // unable to determine
+ private static final int S_YES = 2; // does support
/**
* Nested class to deal with modes and paddings.
@@ -410,7 +410,7 @@
}
// ConcurrentMap<String,Pattern> for previously compiled patterns
- private final static ConcurrentMap<String, Pattern> patternCache =
+ private static final ConcurrentMap<String, Pattern> patternCache =
new ConcurrentHashMap<String, Pattern>();
private static boolean matches(String regexp, String str) {
@@ -787,10 +787,10 @@
}
}
- private final static int I_KEY = 1;
- private final static int I_PARAMSPEC = 2;
- private final static int I_PARAMS = 3;
- private final static int I_CERT = 4;
+ private static final int I_KEY = 1;
+ private static final int I_PARAMSPEC = 2;
+ private static final int I_PARAMS = 3;
+ private static final int I_CERT = 4;
private void implInit(CipherSpi thisSpi, int type, int opmode, Key key,
AlgorithmParameterSpec paramSpec, AlgorithmParameters params,
--- a/jdk/src/java.base/share/classes/javax/crypto/JceSecurity.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/javax/crypto/JceSecurity.java Fri Sep 25 12:04:35 2015 -0700
@@ -57,11 +57,11 @@
// Map<Provider,?> of the providers we already have verified
// value == PROVIDER_VERIFIED is successfully verified
// value is failure cause Exception in error case
- private final static Map<Provider, Object> verificationResults =
+ private static final Map<Provider, Object> verificationResults =
new IdentityHashMap<>();
// Map<Provider,?> of the providers currently being verified
- private final static Map<Provider, Object> verifyingProviders =
+ private static final Map<Provider, Object> verifyingProviders =
new IdentityHashMap<>();
// Set the default value. May be changed in the static initializer.
@@ -162,7 +162,7 @@
pv.verify();
}
- private final static Object PROVIDER_VERIFIED = Boolean.TRUE;
+ private static final Object PROVIDER_VERIFIED = Boolean.TRUE;
/*
* Verify that the provider JAR files are signed properly, which
--- a/jdk/src/java.base/share/classes/javax/crypto/KeyAgreement.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/javax/crypto/KeyAgreement.java Fri Sep 25 12:04:35 2015 -0700
@@ -336,8 +336,8 @@
}
}
- private final static int I_NO_PARAMS = 1;
- private final static int I_PARAMS = 2;
+ private static final int I_NO_PARAMS = 1;
+ private static final int I_PARAMS = 2;
private void implInit(KeyAgreementSpi spi, int type, Key key,
AlgorithmParameterSpec params, SecureRandom random)
--- a/jdk/src/java.base/share/classes/javax/crypto/KeyGenerator.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/javax/crypto/KeyGenerator.java Fri Sep 25 12:04:35 2015 -0700
@@ -116,10 +116,10 @@
// see java.security.KeyPairGenerator for failover notes
- private final static int I_NONE = 1;
- private final static int I_RANDOM = 2;
- private final static int I_PARAMS = 3;
- private final static int I_SIZE = 4;
+ private static final int I_NONE = 1;
+ private static final int I_RANDOM = 2;
+ private static final int I_PARAMS = 3;
+ private static final int I_SIZE = 4;
// The provider
private Provider provider;
--- a/jdk/src/java.base/share/classes/javax/net/ssl/HttpsURLConnection.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/javax/net/ssl/HttpsURLConnection.java Fri Sep 25 12:04:35 2015 -0700
@@ -52,7 +52,7 @@
*
* @since 1.4
*/
-abstract public
+public abstract
class HttpsURLConnection extends HttpURLConnection
{
/**
--- a/jdk/src/java.base/share/classes/javax/net/ssl/KeyManagerFactory.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/javax/net/ssl/KeyManagerFactory.java Fri Sep 25 12:04:35 2015 -0700
@@ -61,7 +61,7 @@
* {@code ssl.KeyManagerFactory.algorithm} security property, or an
* implementation-specific default if no such property exists.
*/
- public final static String getDefaultAlgorithm() {
+ public static final String getDefaultAlgorithm() {
String type;
type = AccessController.doPrivileged(new PrivilegedAction<>() {
@Override
--- a/jdk/src/java.base/share/classes/javax/net/ssl/SNIHostName.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/javax/net/ssl/SNIHostName.java Fri Sep 25 12:04:35 2015 -0700
@@ -321,7 +321,7 @@
}
}
- private final static class SNIHostNameMatcher extends SNIMatcher {
+ private static final class SNIHostNameMatcher extends SNIMatcher {
// the compiled representation of a regular expression.
private final Pattern pattern;
--- a/jdk/src/java.base/share/classes/javax/net/ssl/SSLContext.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/javax/net/ssl/SSLContext.java Fri Sep 25 12:04:35 2015 -0700
@@ -37,11 +37,13 @@
* secure random bytes.
*
* <p> Every implementation of the Java platform is required to support the
- * following standard {@code SSLContext} protocol:
+ * following standard {@code SSLContext} protocols:
* <ul>
* <li>{@code TLSv1}</li>
+ * <li>{@code TLSv1.1}</li>
+ * <li>{@code TLSv1.2}</li>
* </ul>
- * This protocol is described in the <a href=
+ * These protocols are described in the <a href=
* "{@docRoot}/../technotes/guides/security/StandardNames.html#SSLContext">
* SSLContext section</a> of the
* Java Cryptography Architecture Standard Algorithm Name Documentation.
--- a/jdk/src/java.base/share/classes/javax/net/ssl/SSLEngineResult.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/javax/net/ssl/SSLEngineResult.java Fri Sep 25 12:04:35 2015 -0700
@@ -243,7 +243,7 @@
*
* @return the return value
*/
- final public Status getStatus() {
+ public final Status getStatus() {
return status;
}
@@ -253,7 +253,7 @@
*
* @return the handshake status
*/
- final public HandshakeStatus getHandshakeStatus() {
+ public final HandshakeStatus getHandshakeStatus() {
return handshakeStatus;
}
@@ -262,7 +262,7 @@
*
* @return the number of bytes consumed.
*/
- final public int bytesConsumed() {
+ public final int bytesConsumed() {
return bytesConsumed;
}
@@ -271,7 +271,7 @@
*
* @return the number of bytes produced
*/
- final public int bytesProduced() {
+ public final int bytesProduced() {
return bytesProduced;
}
@@ -306,7 +306,7 @@
*
* @since 9
*/
- final public long sequenceNumber() {
+ public final long sequenceNumber() {
return sequenceNumber;
}
--- a/jdk/src/java.base/share/classes/javax/net/ssl/TrustManagerFactory.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/javax/net/ssl/TrustManagerFactory.java Fri Sep 25 12:04:35 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -34,7 +34,19 @@
* This class acts as a factory for trust managers based on a
* source of trust material. Each trust manager manages a specific
* type of trust material for use by secure sockets. The trust
- * material is based on a KeyStore and/or provider specific sources.
+ * material is based on a KeyStore and/or provider-specific sources.
+ *
+ * <p> Every implementation of the Java platform is required to support the
+ * following standard {@code TrustManagerFactory} algorithm:
+ * <ul>
+ * <li><tt>PKIX</tt></li>
+ * </ul>
+ * This algorithm is described in the <a href=
+ * "{@docRoot}/../technotes/guides/security/StandardNames.html#TrustManagerFactory">
+ * TrustManagerFactory section</a> of the
+ * Java Cryptography Architecture Standard Algorithm Name Documentation.
+ * Consult the release documentation for your implementation to see if any
+ * other algorithms are supported.
*
* @since 1.4
* @see TrustManager
@@ -61,7 +73,7 @@
* {@code ssl.TrustManagerFactory.algorithm} security property, or an
* implementation-specific default if no such property exists.
*/
- public final static String getDefaultAlgorithm() {
+ public static final String getDefaultAlgorithm() {
String type;
type = AccessController.doPrivileged(new PrivilegedAction<>() {
@Override
--- a/jdk/src/java.base/share/classes/javax/security/auth/Policy.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/javax/security/auth/Policy.java Fri Sep 25 12:04:35 2015 -0700
@@ -159,7 +159,7 @@
public abstract class Policy {
private static Policy policy;
- private final static String AUTH_POLICY =
+ private static final String AUTH_POLICY =
"sun.security.provider.AuthPolicyFile";
private final java.security.AccessControlContext acc =
--- a/jdk/src/java.base/share/classes/jdk/internal/jimage/BasicImageReader.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/jdk/internal/jimage/BasicImageReader.java Fri Sep 25 12:04:35 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -34,7 +34,7 @@
import java.util.Comparator;
import java.util.stream.IntStream;
-public class BasicImageReader {
+public class BasicImageReader implements AutoCloseable {
private final String imagePath;
private final ImageSubstrate substrate;
private final ByteOrder byteOrder;
--- a/jdk/src/java.base/share/classes/jdk/internal/jimage/BasicImageWriter.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/jdk/internal/jimage/BasicImageWriter.java Fri Sep 25 12:04:35 2015 -0700
@@ -35,7 +35,7 @@
public static final String BOOT_NAME = "bootmodules";
public static final String BOOT_IMAGE_NAME = BOOT_NAME + IMAGE_EXT;
- private final static int RETRY_LIMIT = 1000;
+ private static final int RETRY_LIMIT = 1000;
private ByteOrder byteOrder;
private ImageStringsWriter strings;
--- a/jdk/src/java.base/share/classes/jdk/internal/jimage/ImageLocationBase.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/jdk/internal/jimage/ImageLocationBase.java Fri Sep 25 12:04:35 2015 -0700
@@ -26,15 +26,15 @@
package jdk.internal.jimage;
public class ImageLocationBase {
- final static int ATTRIBUTE_END = 0;
- final static int ATTRIBUTE_MODULE = 1;
- final static int ATTRIBUTE_PARENT = 2;
- final static int ATTRIBUTE_BASE = 3;
- final static int ATTRIBUTE_EXTENSION = 4;
- final static int ATTRIBUTE_OFFSET = 5;
- final static int ATTRIBUTE_COMPRESSED = 6;
- final static int ATTRIBUTE_UNCOMPRESSED = 7;
- final static int ATTRIBUTE_COUNT = 8;
+ static final int ATTRIBUTE_END = 0;
+ static final int ATTRIBUTE_MODULE = 1;
+ static final int ATTRIBUTE_PARENT = 2;
+ static final int ATTRIBUTE_BASE = 3;
+ static final int ATTRIBUTE_EXTENSION = 4;
+ static final int ATTRIBUTE_OFFSET = 5;
+ static final int ATTRIBUTE_COMPRESSED = 6;
+ static final int ATTRIBUTE_UNCOMPRESSED = 7;
+ static final int ATTRIBUTE_COUNT = 8;
protected final long[] attributes;
--- a/jdk/src/java.base/share/classes/jdk/internal/jimage/ImageModuleData.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/jdk/internal/jimage/ImageModuleData.java Fri Sep 25 12:04:35 2015 -0700
@@ -63,19 +63,19 @@
* Offset to package name in string table
*/
-final public class ImageModuleData {
- public final static String META_DATA_EXTENSION = ".jdata";
- public final static String SEPARATOR = "\t";
- public final static int NOT_FOUND = -1;
- private final static int ptmCountOffset = 0;
- private final static int mtpCountOffset = 1;
- private final static int ptmRedirectOffset = 2;
- private final static int dataNameOffset = 0;
- private final static int ptmDataWidth = 2;
- private final static int ptmDataModuleOffset = 1;
- private final static int mtpDataWidth = 3;
- private final static int mtpDataCountOffset = 1;
- private final static int mtpDataOffsetOffset = 2;
+public final class ImageModuleData {
+ public static final String META_DATA_EXTENSION = ".jdata";
+ public static final String SEPARATOR = "\t";
+ public static final int NOT_FOUND = -1;
+ private static final int ptmCountOffset = 0;
+ private static final int mtpCountOffset = 1;
+ private static final int ptmRedirectOffset = 2;
+ private static final int dataNameOffset = 0;
+ private static final int ptmDataWidth = 2;
+ private static final int ptmDataModuleOffset = 1;
+ private static final int mtpDataWidth = 3;
+ private static final int mtpDataCountOffset = 1;
+ private static final int mtpDataOffsetOffset = 2;
private final BasicImageReader reader;
private final IntBuffer intBuffer;
--- a/jdk/src/java.base/share/classes/jdk/internal/jimage/ImageNativeSubstrate.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/jdk/internal/jimage/ImageNativeSubstrate.java Fri Sep 25 12:04:35 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
* 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,7 +30,18 @@
import sun.misc.JavaNioAccess;
import sun.misc.SharedSecrets;
-final class ImageNativeSubstrate implements ImageSubstrate {
+public final class ImageNativeSubstrate implements ImageSubstrate {
+ static {
+ java.security.AccessController.doPrivileged(
+ new java.security.PrivilegedAction<Void>() {
+ @Override
+ public Void run() {
+ System.loadLibrary("jimage");
+ return null;
+ }
+ });
+ }
+
private static final JavaNioAccess NIOACCESS =
SharedSecrets.getJavaNioAccess();
@@ -38,19 +49,33 @@
private final long indexAddress;
private final long dataAddress;
- native static long openImage(String imagePath, boolean bigEndian);
- native static void closeImage(long id);
- native static long getIndexAddress(long id);
- native static long getDataAddress(long id);
- native static boolean readCompressed(long id, long offset,
+ static native long openImage(String imagePath, boolean bigEndian);
+ static native void closeImage(long id);
+ static native long getIndexAddress(long id);
+ static native long getDataAddress(long id);
+ static native boolean readCompressed(long id, long offset,
ByteBuffer compressedBuffer, long compressedSize,
ByteBuffer uncompressedBuffer, long uncompressedSize);
- native static boolean read(long id, long offset,
+ static native boolean read(long id, long offset,
ByteBuffer uncompressedBuffer, long uncompressedSize);
- native static byte[] getStringBytes(long id, int offset);
- native static long[] getAttributes(long id, int offset);
- native static long[] findAttributes(long id, byte[] path);
- native static int[] attributeOffsets(long id);
+ static native byte[] getStringBytes(long id, int offset);
+ static native long[] getAttributes(long id, int offset);
+ static native long[] findAttributes(long id, byte[] path);
+ static native int[] attributeOffsets(long id);
+
+ public static native long JIMAGE_Open(String path) throws IOException;
+ public static native void JIMAGE_Close(long jimageHandle);
+ public static native long JIMAGE_FindResource(long jimageHandle,
+ String moduleName, String Version, String path,
+ long[] size);
+ public static native long JIMAGE_GetResource(long jimageHandle,
+ long locationHandle, byte[] buffer, long size);
+ // Get an array of names that match; return the count found upto array size
+ public static native int JIMAGE_Resources(long jimageHandle,
+ String[] outputNames);
+ // Return the module name for the package
+ public static native String JIMAGE_PackageToModule(long imageHandle,
+ String packageName);
static ByteBuffer newDirectByteBuffer(long address, long capacity) {
assert capacity < Integer.MAX_VALUE;
--- a/jdk/src/java.base/share/classes/jdk/internal/jimage/ImageReader.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/jdk/internal/jimage/ImageReader.java Fri Sep 25 12:04:35 2015 -0700
@@ -129,7 +129,7 @@
// jimage file does not store directory structure. We build nodes
// using the "path" strings found in the jimage file.
// Node can be a directory or a resource
- public static abstract class Node {
+ public abstract static class Node {
private static final int ROOT_DIR = 0b0000_0000_0000_0001;
private static final int PACKAGES_DIR = 0b0000_0000_0000_0010;
private static final int MODULES_DIR = 0b0000_0000_0000_0100;
--- a/jdk/src/java.base/share/classes/jdk/internal/jimage/PerfectHashBuilder.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/jdk/internal/jimage/PerfectHashBuilder.java Fri Sep 25 12:04:35 2015 -0700
@@ -33,7 +33,7 @@
import java.util.Map;
public class PerfectHashBuilder<E> {
- private final static int RETRY_LIMIT = 1000;
+ private static final int RETRY_LIMIT = 1000;
private Class<?> entryComponent;
private Class<?> bucketComponent;
--- a/jdk/src/java.base/share/classes/jdk/internal/org/objectweb/asm/TypePath.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/jdk/internal/org/objectweb/asm/TypePath.java Fri Sep 25 12:04:35 2015 -0700
@@ -71,25 +71,25 @@
* A type path step that steps into the element type of an array type. See
* {@link #getStep getStep}.
*/
- public final static int ARRAY_ELEMENT = 0;
+ public static final int ARRAY_ELEMENT = 0;
/**
* A type path step that steps into the nested type of a class type. See
* {@link #getStep getStep}.
*/
- public final static int INNER_TYPE = 1;
+ public static final int INNER_TYPE = 1;
/**
* A type path step that steps into the bound of a wildcard type. See
* {@link #getStep getStep}.
*/
- public final static int WILDCARD_BOUND = 2;
+ public static final int WILDCARD_BOUND = 2;
/**
* A type path step that steps into a type argument of a generic type. See
* {@link #getStep getStep}.
*/
- public final static int TYPE_ARGUMENT = 3;
+ public static final int TYPE_ARGUMENT = 3;
/**
* The byte array where the path is stored, in Java class file format.
--- a/jdk/src/java.base/share/classes/jdk/internal/org/objectweb/asm/TypeReference.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/jdk/internal/org/objectweb/asm/TypeReference.java Fri Sep 25 12:04:35 2015 -0700
@@ -74,133 +74,133 @@
* The sort of type references that target a type parameter of a generic
* class. See {@link #getSort getSort}.
*/
- public final static int CLASS_TYPE_PARAMETER = 0x00;
+ public static final int CLASS_TYPE_PARAMETER = 0x00;
/**
* The sort of type references that target a type parameter of a generic
* method. See {@link #getSort getSort}.
*/
- public final static int METHOD_TYPE_PARAMETER = 0x01;
+ public static final int METHOD_TYPE_PARAMETER = 0x01;
/**
* The sort of type references that target the super class of a class or one
* of the interfaces it implements. See {@link #getSort getSort}.
*/
- public final static int CLASS_EXTENDS = 0x10;
+ public static final int CLASS_EXTENDS = 0x10;
/**
* The sort of type references that target a bound of a type parameter of a
* generic class. See {@link #getSort getSort}.
*/
- public final static int CLASS_TYPE_PARAMETER_BOUND = 0x11;
+ public static final int CLASS_TYPE_PARAMETER_BOUND = 0x11;
/**
* The sort of type references that target a bound of a type parameter of a
* generic method. See {@link #getSort getSort}.
*/
- public final static int METHOD_TYPE_PARAMETER_BOUND = 0x12;
+ public static final int METHOD_TYPE_PARAMETER_BOUND = 0x12;
/**
* The sort of type references that target the type of a field. See
* {@link #getSort getSort}.
*/
- public final static int FIELD = 0x13;
+ public static final int FIELD = 0x13;
/**
* The sort of type references that target the return type of a method. See
* {@link #getSort getSort}.
*/
- public final static int METHOD_RETURN = 0x14;
+ public static final int METHOD_RETURN = 0x14;
/**
* The sort of type references that target the receiver type of a method.
* See {@link #getSort getSort}.
*/
- public final static int METHOD_RECEIVER = 0x15;
+ public static final int METHOD_RECEIVER = 0x15;
/**
* The sort of type references that target the type of a formal parameter of
* a method. See {@link #getSort getSort}.
*/
- public final static int METHOD_FORMAL_PARAMETER = 0x16;
+ public static final int METHOD_FORMAL_PARAMETER = 0x16;
/**
* The sort of type references that target the type of an exception declared
* in the throws clause of a method. See {@link #getSort getSort}.
*/
- public final static int THROWS = 0x17;
+ public static final int THROWS = 0x17;
/**
* The sort of type references that target the type of a local variable in a
* method. See {@link #getSort getSort}.
*/
- public final static int LOCAL_VARIABLE = 0x40;
+ public static final int LOCAL_VARIABLE = 0x40;
/**
* The sort of type references that target the type of a resource variable
* in a method. See {@link #getSort getSort}.
*/
- public final static int RESOURCE_VARIABLE = 0x41;
+ public static final int RESOURCE_VARIABLE = 0x41;
/**
* The sort of type references that target the type of the exception of a
* 'catch' clause in a method. See {@link #getSort getSort}.
*/
- public final static int EXCEPTION_PARAMETER = 0x42;
+ public static final int EXCEPTION_PARAMETER = 0x42;
/**
* The sort of type references that target the type declared in an
* 'instanceof' instruction. See {@link #getSort getSort}.
*/
- public final static int INSTANCEOF = 0x43;
+ public static final int INSTANCEOF = 0x43;
/**
* The sort of type references that target the type of the object created by
* a 'new' instruction. See {@link #getSort getSort}.
*/
- public final static int NEW = 0x44;
+ public static final int NEW = 0x44;
/**
* The sort of type references that target the receiver type of a
* constructor reference. See {@link #getSort getSort}.
*/
- public final static int CONSTRUCTOR_REFERENCE = 0x45;
+ public static final int CONSTRUCTOR_REFERENCE = 0x45;
/**
* The sort of type references that target the receiver type of a method
* reference. See {@link #getSort getSort}.
*/
- public final static int METHOD_REFERENCE = 0x46;
+ public static final int METHOD_REFERENCE = 0x46;
/**
* The sort of type references that target the type declared in an explicit
* or implicit cast instruction. See {@link #getSort getSort}.
*/
- public final static int CAST = 0x47;
+ public static final int CAST = 0x47;
/**
* The sort of type references that target a type parameter of a generic
* constructor in a constructor call. See {@link #getSort getSort}.
*/
- public final static int CONSTRUCTOR_INVOCATION_TYPE_ARGUMENT = 0x48;
+ public static final int CONSTRUCTOR_INVOCATION_TYPE_ARGUMENT = 0x48;
/**
* The sort of type references that target a type parameter of a generic
* method in a method call. See {@link #getSort getSort}.
*/
- public final static int METHOD_INVOCATION_TYPE_ARGUMENT = 0x49;
+ public static final int METHOD_INVOCATION_TYPE_ARGUMENT = 0x49;
/**
* The sort of type references that target a type parameter of a generic
* constructor in a constructor reference. See {@link #getSort getSort}.
*/
- public final static int CONSTRUCTOR_REFERENCE_TYPE_ARGUMENT = 0x4A;
+ public static final int CONSTRUCTOR_REFERENCE_TYPE_ARGUMENT = 0x4A;
/**
* The sort of type references that target a type parameter of a generic
* method in a method reference. See {@link #getSort getSort}.
*/
- public final static int METHOD_REFERENCE_TYPE_ARGUMENT = 0x4B;
+ public static final int METHOD_REFERENCE_TYPE_ARGUMENT = 0x4B;
/**
* The type reference value in Java class file format.
--- a/jdk/src/java.base/share/classes/jdk/internal/org/objectweb/asm/commons/InstructionAdapter.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/jdk/internal/org/objectweb/asm/commons/InstructionAdapter.java Fri Sep 25 12:04:35 2015 -0700
@@ -73,7 +73,7 @@
*/
public class InstructionAdapter extends MethodVisitor {
- public final static Type OBJECT_TYPE = Type.getType("Ljava/lang/Object;");
+ public static final Type OBJECT_TYPE = Type.getType("Ljava/lang/Object;");
/**
* Creates a new {@link InstructionAdapter}. <i>Subclasses must not use this
--- a/jdk/src/java.base/share/classes/jdk/internal/org/objectweb/asm/signature/SignatureVisitor.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/jdk/internal/org/objectweb/asm/signature/SignatureVisitor.java Fri Sep 25 12:04:35 2015 -0700
@@ -88,17 +88,17 @@
/**
* Wildcard for an "extends" type argument.
*/
- public final static char EXTENDS = '+';
+ public static final char EXTENDS = '+';
/**
* Wildcard for a "super" type argument.
*/
- public final static char SUPER = '-';
+ public static final char SUPER = '-';
/**
* Wildcard for a normal type argument.
*/
- public final static char INSTANCEOF = '=';
+ public static final char INSTANCEOF = '=';
/**
* The ASM API version implemented by this visitor. The value of this field
--- a/jdk/src/java.base/share/classes/jdk/internal/util/xml/PropertiesDefaultHandler.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/jdk/internal/util/xml/PropertiesDefaultHandler.java Fri Sep 25 12:04:35 2015 -0700
@@ -135,8 +135,8 @@
////////////////////////////////////////////////////////////////////
// Validate while parsing
////////////////////////////////////////////////////////////////////
- final static String ALLOWED_ELEMENTS = "properties, comment, entry";
- final static String ALLOWED_COMMENT = "comment";
+ static final String ALLOWED_ELEMENTS = "properties, comment, entry";
+ static final String ALLOWED_COMMENT = "comment";
////////////////////////////////////////////////////////////////////
// Handler methods
////////////////////////////////////////////////////////////////////
--- a/jdk/src/java.base/share/classes/jdk/internal/util/xml/XMLStreamWriter.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/jdk/internal/util/xml/XMLStreamWriter.java Fri Sep 25 12:04:35 2015 -0700
@@ -36,8 +36,8 @@
public interface XMLStreamWriter {
//Defaults the XML version to 1.0, and the encoding to utf-8
- public final static String DEFAULT_XML_VERSION = "1.0";
- public final static String DEFAULT_ENCODING = "UTF-8";
+ public static final String DEFAULT_XML_VERSION = "1.0";
+ public static final String DEFAULT_ENCODING = "UTF-8";
/**
* Writes a start tag to the output. All writeStartElement methods
--- a/jdk/src/java.base/share/classes/jdk/internal/util/xml/impl/Parser.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/jdk/internal/util/xml/impl/Parser.java Fri Sep 25 12:04:35 2015 -0700
@@ -40,13 +40,13 @@
*/
public abstract class Parser {
- public final static String FAULT = "";
- protected final static int BUFFSIZE_READER = 512;
- protected final static int BUFFSIZE_PARSER = 128;
+ public static final String FAULT = "";
+ protected static final int BUFFSIZE_READER = 512;
+ protected static final int BUFFSIZE_PARSER = 128;
/**
* The end of stream character.
*/
- public final static char EOS = 0xffff;
+ public static final char EOS = 0xffff;
private Pair mNoNS; // there is no namespace
private Pair mXml; // the xml namespace
private Map<String, Input> mEnt; // the entities look up table
@@ -55,26 +55,26 @@
protected boolean mIsSAloneSet; // standalone is explicitely set
protected boolean mIsNSAware; // if true - namespace aware mode
protected int mPh; // current phase of document processing
- protected final static int PH_BEFORE_DOC = -1; // before parsing
- protected final static int PH_DOC_START = 0; // document start
- protected final static int PH_MISC_DTD = 1; // misc before DTD
- protected final static int PH_DTD = 2; // DTD
- protected final static int PH_DTD_MISC = 3; // misc after DTD
- protected final static int PH_DOCELM = 4; // document's element
- protected final static int PH_DOCELM_MISC = 5; // misc after element
- protected final static int PH_AFTER_DOC = 6; // after parsing
+ protected static final int PH_BEFORE_DOC = -1; // before parsing
+ protected static final int PH_DOC_START = 0; // document start
+ protected static final int PH_MISC_DTD = 1; // misc before DTD
+ protected static final int PH_DTD = 2; // DTD
+ protected static final int PH_DTD_MISC = 3; // misc after DTD
+ protected static final int PH_DOCELM = 4; // document's element
+ protected static final int PH_DOCELM_MISC = 5; // misc after element
+ protected static final int PH_AFTER_DOC = 6; // after parsing
protected int mEvt; // current event type
- protected final static int EV_NULL = 0; // unknown
- protected final static int EV_ELM = 1; // empty element
- protected final static int EV_ELMS = 2; // start element
- protected final static int EV_ELME = 3; // end element
- protected final static int EV_TEXT = 4; // textual content
- protected final static int EV_WSPC = 5; // white space content
- protected final static int EV_PI = 6; // processing instruction
- protected final static int EV_CDAT = 7; // character data
- protected final static int EV_COMM = 8; // comment
- protected final static int EV_DTD = 9; // document type definition
- protected final static int EV_ENT = 10; // skipped entity
+ protected static final int EV_NULL = 0; // unknown
+ protected static final int EV_ELM = 1; // empty element
+ protected static final int EV_ELMS = 2; // start element
+ protected static final int EV_ELME = 3; // end element
+ protected static final int EV_TEXT = 4; // textual content
+ protected static final int EV_WSPC = 5; // white space content
+ protected static final int EV_PI = 6; // processing instruction
+ protected static final int EV_CDAT = 7; // character data
+ protected static final int EV_COMM = 8; // comment
+ protected static final int EV_DTD = 9; // document type definition
+ protected static final int EV_ENT = 10; // skipped entity
private char mESt; // built-in entity recognizer state
// mESt values:
// 0x100 : the initial state
@@ -120,9 +120,9 @@
/**
* Default prefixes
*/
- private final static char NONS[];
- private final static char XML[];
- private final static char XMLNS[];
+ private static final char NONS[];
+ private static final char XML[];
+ private static final char XMLNS[];
static {
NONS = new char[1];
--- a/jdk/src/java.base/share/classes/jdk/internal/util/xml/impl/ParserSAX.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/jdk/internal/util/xml/impl/ParserSAX.java Fri Sep 25 12:04:35 2015 -0700
@@ -56,9 +56,9 @@
final class ParserSAX
extends Parser implements XMLReader, Locator
{
- public final static String FEATURE_NS =
+ public static final String FEATURE_NS =
"http://xml.org/sax/features/namespaces";
- public final static String FEATURE_PREF =
+ public static final String FEATURE_PREF =
"http://xml.org/sax/features/namespace-prefixes";
// SAX feature flags
private boolean mFNamespaces;
--- a/jdk/src/java.base/share/classes/jdk/net/Sockets.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/jdk/net/Sockets.java Fri Sep 25 12:04:35 2015 -0700
@@ -58,7 +58,7 @@
@jdk.Exported
public class Sockets {
- private final static HashMap<Class<?>,Set<SocketOption<?>>>
+ private static final HashMap<Class<?>,Set<SocketOption<?>>>
options = new HashMap<>();
static {
--- a/jdk/src/java.base/share/classes/sun/invoke/anon/AnonymousClassLoader.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/invoke/anon/AnonymousClassLoader.java Fri Sep 25 12:04:35 2015 -0700
@@ -192,7 +192,7 @@
private static sun.misc.Unsafe unsafe = sun.misc.Unsafe.getUnsafe();
// preceding line requires that this class be on the boot class path
- static private final Method defineAnonymousClass;
+ private static final Method defineAnonymousClass;
static {
Method dac = null;
Class<? extends sun.misc.Unsafe> unsafeClass = unsafe.getClass();
--- a/jdk/src/java.base/share/classes/sun/invoke/anon/ConstantPoolPatch.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/invoke/anon/ConstantPoolPatch.java Fri Sep 25 12:04:35 2015 -0700
@@ -411,7 +411,7 @@
patchArray[index] = addSemis(className, memberName, signature);
}
- static private final int CONSTANT_MemberRef_MASK =
+ private static final int CONSTANT_MemberRef_MASK =
CONSTANT_Fieldref
| CONSTANT_Methodref
| CONSTANT_InterfaceMethodref;
--- a/jdk/src/java.base/share/classes/sun/invoke/util/BytecodeDescriptor.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/invoke/util/BytecodeDescriptor.java Fri Sep 25 12:04:35 2015 -0700
@@ -67,11 +67,11 @@
return ptypes;
}
- static private void parseError(String str, String msg) {
+ private static void parseError(String str, String msg) {
throw new IllegalArgumentException("bad signature: "+str+": "+msg);
}
- static private Class<?> parseSig(String str, int[] i, int end, ClassLoader loader) {
+ private static Class<?> parseSig(String str, int[] i, int end, ClassLoader loader) {
if (i[0] == end) return null;
char c = str.charAt(i[0]++);
if (c == 'L') {
@@ -122,7 +122,7 @@
return sb.toString();
}
- static private void unparseSig(Class<?> t, StringBuilder sb) {
+ private static void unparseSig(Class<?> t, StringBuilder sb) {
char c = Wrapper.forBasicType(t).basicTypeChar();
if (c != 'L') {
sb.append(c);
--- a/jdk/src/java.base/share/classes/sun/invoke/util/ValueConversions.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/invoke/util/ValueConversions.java Fri Sep 25 12:04:35 2015 -0700
@@ -215,7 +215,7 @@
return unbox(type, 3);
}
- static private final Integer ZERO_INT = 0, ONE_INT = 1;
+ private static final Integer ZERO_INT = 0, ONE_INT = 1;
/// Primitive conversions
/**
--- a/jdk/src/java.base/share/classes/sun/invoke/util/Wrapper.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/invoke/util/Wrapper.java Fri Sep 25 12:04:35 2015 -0700
@@ -69,7 +69,7 @@
"0x"+Integer.toHexString(format));
}
- private static abstract class Format {
+ private abstract static class Format {
static final int SLOT_SHIFT = 0, SIZE_SHIFT = 2, KIND_SHIFT = 12;
static final int
SIGNED = (-1) << KIND_SHIFT,
--- a/jdk/src/java.base/share/classes/sun/launcher/LauncherHelper.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/launcher/LauncherHelper.java Fri Sep 25 12:04:35 2015 -0700
@@ -88,7 +88,7 @@
// sync with java.c and sun.misc.VM
private static final String diagprop = "sun.java.launcher.diag";
- final static boolean trace = sun.misc.VM.getSavedProperty(diagprop) != null;
+ static final boolean trace = sun.misc.VM.getSavedProperty(diagprop) != null;
private static final String defaultBundleName =
"sun.launcher.resources.launcher";
--- a/jdk/src/java.base/share/classes/sun/misc/BASE64Decoder.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/misc/BASE64Decoder.java Fri Sep 25 12:04:35 2015 -0700
@@ -74,7 +74,7 @@
* This character array provides the character to value map
* based on RFC1521.
*/
- private final static char pem_array[] = {
+ private static final char pem_array[] = {
// 0 1 2 3 4 5 6 7
'A','B','C','D','E','F','G','H', // 0
'I','J','K','L','M','N','O','P', // 1
@@ -86,7 +86,7 @@
'4','5','6','7','8','9','+','/' // 7
};
- private final static byte pem_convert_array[] = new byte[256];
+ private static final byte pem_convert_array[] = new byte[256];
static {
for (int i = 0; i < 255; i++) {
--- a/jdk/src/java.base/share/classes/sun/misc/BASE64Encoder.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/misc/BASE64Encoder.java Fri Sep 25 12:04:35 2015 -0700
@@ -61,7 +61,7 @@
}
/** This array maps the characters to their 6 bit values */
- private final static char pem_array[] = {
+ private static final char pem_array[] = {
// 0 1 2 3 4 5 6 7
'A','B','C','D','E','F','G','H', // 0
'I','J','K','L','M','N','O','P', // 1
--- a/jdk/src/java.base/share/classes/sun/misc/CharacterDecoder.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/misc/CharacterDecoder.java Fri Sep 25 12:04:35 2015 -0700
@@ -88,10 +88,10 @@
public abstract class CharacterDecoder {
/** Return the number of bytes per atom of decoding */
- abstract protected int bytesPerAtom();
+ protected abstract int bytesPerAtom();
/** Return the maximum number of bytes that can be encoded per line */
- abstract protected int bytesPerLine();
+ protected abstract int bytesPerLine();
/** decode the beginning of the buffer, by default this is a NOP. */
protected void decodeBufferPrefix(PushbackInputStream aStream, OutputStream bStream) throws IOException { }
--- a/jdk/src/java.base/share/classes/sun/misc/CharacterEncoder.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/misc/CharacterEncoder.java Fri Sep 25 12:04:35 2015 -0700
@@ -79,10 +79,10 @@
protected PrintStream pStream;
/** Return the number of bytes per atom of encoding */
- abstract protected int bytesPerAtom();
+ protected abstract int bytesPerAtom();
/** Return the number of bytes that can be encoded per line */
- abstract protected int bytesPerLine();
+ protected abstract int bytesPerLine();
/**
* Encode the prefix for the entire buffer. By default is simply
@@ -114,7 +114,7 @@
}
/** Encode one "atom" of information into characters. */
- abstract protected void encodeAtom(OutputStream aStream, byte someBytes[],
+ protected abstract void encodeAtom(OutputStream aStream, byte someBytes[],
int anOffset, int aLength) throws IOException;
/**
--- a/jdk/src/java.base/share/classes/sun/misc/Cleaner.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/misc/Cleaner.java Fri Sep 25 12:04:35 2015 -0700
@@ -69,7 +69,7 @@
// Doubly-linked list of live cleaners, which prevents the cleaners
// themselves from being GC'd before their referents
//
- static private Cleaner first = null;
+ private static Cleaner first = null;
private Cleaner
next = null,
--- a/jdk/src/java.base/share/classes/sun/misc/FDBigInteger.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/misc/FDBigInteger.java Fri Sep 25 12:04:35 2015 -0700
@@ -144,7 +144,7 @@
}
// Constant for casting an int to a long via bitwise AND.
- private final static long LONG_MASK = 0xffffffffL;
+ private static final long LONG_MASK = 0xffffffffL;
//@ spec_public non_null;
private int data[]; // value: data[0] is least significant
--- a/jdk/src/java.base/share/classes/sun/misc/FloatingDecimal.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/misc/FloatingDecimal.java Fri Sep 25 12:04:35 2015 -0700
@@ -187,7 +187,7 @@
* and infinite values.
*/
private static class ExceptionalBinaryToASCIIBuffer implements BinaryToASCIIConverter {
- final private String image;
+ private final String image;
private boolean isNegative;
public ExceptionalBinaryToASCIIBuffer(String image, boolean isNegative) {
@@ -1003,8 +1003,8 @@
* A <code>ASCIIToBinaryConverter</code> container for a <code>double</code>.
*/
static class PreparedASCIIToBinaryBuffer implements ASCIIToBinaryConverter {
- final private double doubleVal;
- final private float floatVal;
+ private final double doubleVal;
+ private final float floatVal;
public PreparedASCIIToBinaryBuffer(double doubleVal, float floatVal) {
this.doubleVal = doubleVal;
--- a/jdk/src/java.base/share/classes/sun/misc/LRUCache.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/misc/LRUCache.java Fri Sep 25 12:04:35 2015 -0700
@@ -39,9 +39,9 @@
this.size = size;
}
- abstract protected V create(N name);
+ protected abstract V create(N name);
- abstract protected boolean hasName(V ob, N name);
+ protected abstract boolean hasName(V ob, N name);
public static void moveToFront(Object[] oa, int i) {
Object ob = oa[i];
--- a/jdk/src/java.base/share/classes/sun/misc/PerfCounter.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/misc/PerfCounter.java Fri Sep 25 12:04:35 2015 -0700
@@ -52,10 +52,10 @@
AccessController.doPrivileged(new Perf.GetPerfAction());
// Must match values defined in hotspot/src/share/vm/runtime/perfdata.hpp
- private final static int V_Constant = 1;
- private final static int V_Monotonic = 2;
- private final static int V_Variable = 3;
- private final static int U_None = 1;
+ private static final int V_Constant = 1;
+ private static final int V_Monotonic = 2;
+ private static final int V_Variable = 3;
+ private static final int U_None = 1;
private final String name;
private final LongBuffer lb;
--- a/jdk/src/java.base/share/classes/sun/misc/ProxyGenerator.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/misc/ProxyGenerator.java Fri Sep 25 12:04:35 2015 -0700
@@ -305,13 +305,13 @@
// end of constants copied from sun.tools.java.RuntimeConstants
/** name of the superclass of proxy classes */
- private final static String superclassName = "java/lang/reflect/Proxy";
+ private static final String superclassName = "java/lang/reflect/Proxy";
/** name of field for storing a proxy instance's invocation handler */
- private final static String handlerFieldName = "h";
+ private static final String handlerFieldName = "h";
/** debugging flag for saving generated class files */
- private final static boolean saveGeneratedFiles =
+ private static final boolean saveGeneratedFiles =
java.security.AccessController.doPrivileged(
new GetBooleanAction(
"sun.misc.ProxyGenerator.saveGeneratedFiles")).booleanValue();
@@ -1913,7 +1913,7 @@
* that can be stored in the "pool" list; its purpose is to define a
* common method for writing constant pool entries to a class file.
*/
- private static abstract class Entry {
+ private abstract static class Entry {
public abstract void write(DataOutputStream out)
throws IOException;
}
--- a/jdk/src/java.base/share/classes/sun/misc/Request.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/misc/Request.java Fri Sep 25 12:04:35 2015 -0700
@@ -32,10 +32,10 @@
* @author Steven B. Byrne
*/
-abstract public class Request {
+public abstract class Request {
/**
* The main task of the Request object is to be exectuted from a request
* queue.
*/
- abstract public void execute();
+ public abstract void execute();
}
--- a/jdk/src/java.base/share/classes/sun/misc/SoftCache.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/misc/SoftCache.java Fri Sep 25 12:04:35 2015 -0700
@@ -117,9 +117,9 @@
*/
- static private class ValueCell extends SoftReference<Object> {
- static private Object INVALID_KEY = new Object();
- static private int dropped = 0;
+ private static class ValueCell extends SoftReference<Object> {
+ private static Object INVALID_KEY = new Object();
+ private static int dropped = 0;
private Object key;
private ValueCell(Object key, Object value, ReferenceQueue<Object> queue) {
--- a/jdk/src/java.base/share/classes/sun/misc/UCDecoder.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/misc/UCDecoder.java Fri Sep 25 12:04:35 2015 -0700
@@ -95,7 +95,7 @@
}
/* this is the UCE mapping of 0-63 to characters .. */
- private final static byte map_array[] = {
+ private static final byte map_array[] = {
// 0 1 2 3 4 5 6 7
(byte)'0',(byte)'1',(byte)'2',(byte)'3',(byte)'4',(byte)'5',(byte)'6',(byte)'7', // 0
(byte)'8',(byte)'9',(byte)'A',(byte)'B',(byte)'C',(byte)'D',(byte)'E',(byte)'F', // 1
--- a/jdk/src/java.base/share/classes/sun/misc/UCEncoder.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/misc/UCEncoder.java Fri Sep 25 12:04:35 2015 -0700
@@ -86,7 +86,7 @@
}
/* this is the UCE mapping of 0-63 to characters .. */
- private final static byte map_array[] = {
+ private static final byte map_array[] = {
// 0 1 2 3 4 5 6 7
(byte)'0',(byte)'1',(byte)'2',(byte)'3',(byte)'4',(byte)'5',(byte)'6',(byte)'7', // 0
(byte)'8',(byte)'9',(byte)'A',(byte)'B',(byte)'C',(byte)'D',(byte)'E',(byte)'F', // 1
--- a/jdk/src/java.base/share/classes/sun/misc/VM.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/misc/VM.java Fri Sep 25 12:04:35 2015 -0700
@@ -354,12 +354,12 @@
* in the hotspot implementation. Its value is set according to
* the JVM TI specification GetThreadState function.
*/
- private final static int JVMTI_THREAD_STATE_ALIVE = 0x0001;
- private final static int JVMTI_THREAD_STATE_TERMINATED = 0x0002;
- private final static int JVMTI_THREAD_STATE_RUNNABLE = 0x0004;
- private final static int JVMTI_THREAD_STATE_BLOCKED_ON_MONITOR_ENTER = 0x0400;
- private final static int JVMTI_THREAD_STATE_WAITING_INDEFINITELY = 0x0010;
- private final static int JVMTI_THREAD_STATE_WAITING_WITH_TIMEOUT = 0x0020;
+ private static final int JVMTI_THREAD_STATE_ALIVE = 0x0001;
+ private static final int JVMTI_THREAD_STATE_TERMINATED = 0x0002;
+ private static final int JVMTI_THREAD_STATE_RUNNABLE = 0x0004;
+ private static final int JVMTI_THREAD_STATE_BLOCKED_ON_MONITOR_ENTER = 0x0400;
+ private static final int JVMTI_THREAD_STATE_WAITING_INDEFINITELY = 0x0010;
+ private static final int JVMTI_THREAD_STATE_WAITING_WITH_TIMEOUT = 0x0020;
/*
* Returns the first non-null class loader up the execution stack,
@@ -435,5 +435,5 @@
static {
initialize();
}
- private native static void initialize();
+ private static native void initialize();
}
--- a/jdk/src/java.base/share/classes/sun/net/NetProperties.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/net/NetProperties.java Fri Sep 25 12:04:35 2015 -0700
@@ -39,7 +39,7 @@
*/
public class NetProperties {
- static private Properties props = new Properties();
+ private static Properties props = new Properties();
static {
AccessController.doPrivileged(
new PrivilegedAction<Void>() {
@@ -56,7 +56,7 @@
* Loads the default networking system properties
* the file is in jre/lib/net.properties
*/
- static private void loadDefaultProperties() {
+ private static void loadDefaultProperties() {
String fname = System.getProperty("java.home");
if (fname == null) {
throw new Error("Can't find java.home ??");
@@ -86,7 +86,7 @@
* @return the <code>String</code> value for the property,
* or <code>null</code>
*/
- static public String get(String key) {
+ public static String get(String key) {
String def = props.getProperty(key);
try {
return System.getProperty(key, def);
@@ -108,7 +108,7 @@
* @return the <code>Integer</code> value for the property,
* or <code>null</code>
*/
- static public Integer getInteger(String key, int defval) {
+ public static Integer getInteger(String key, int defval) {
String val = null;
try {
@@ -137,7 +137,7 @@
* @return the <code>Boolean</code> value for the property,
* or <code>null</code>
*/
- static public Boolean getBoolean(String key) {
+ public static Boolean getBoolean(String key) {
String val = null;
try {
--- a/jdk/src/java.base/share/classes/sun/net/NetworkServer.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/net/NetworkServer.java Fri Sep 25 12:04:35 2015 -0700
@@ -62,7 +62,7 @@
return clientSocket != null;
}
- final public void run() {
+ public final void run() {
if (serverSocket != null) {
Thread.currentThread().setPriority(Thread.MAX_PRIORITY);
// System.out.print("Server starts " + serverSocket + "\n");
@@ -106,7 +106,7 @@
/** Start a server on port <i>port</i>. It will call serviceRequest()
for each new connection. */
- final public void startServer(int port) throws IOException {
+ public final void startServer(int port) throws IOException {
serverSocket = new ServerSocket(port, 50);
serverInstance = new ManagedLocalsThread(this);
serverInstance.start();
--- a/jdk/src/java.base/share/classes/sun/net/dns/ResolverConfiguration.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/net/dns/ResolverConfiguration.java Fri Sep 25 12:04:35 2015 -0700
@@ -84,7 +84,7 @@
* Options representing certain resolver variables of
* a {@link ResolverConfiguration}.
*/
- public static abstract class Options {
+ public abstract static class Options {
/**
* Returns the maximum number of attempts the resolver
--- a/jdk/src/java.base/share/classes/sun/net/spi/DefaultProxySelector.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/net/spi/DefaultProxySelector.java Fri Sep 25 12:04:35 2015 -0700
@@ -72,7 +72,7 @@
*
* Note that the socksProxy should *always* be the last on the list
*/
- final static String[][] props = {
+ static final String[][] props = {
/*
* protocol, Property prefix 1, Property prefix 2, ...
*/
@@ -353,7 +353,7 @@
}
}
- private native static boolean init();
+ private static native boolean init();
private synchronized native Proxy getSystemProxy(String protocol, String host);
/**
--- a/jdk/src/java.base/share/classes/sun/net/util/IPAddressUtil.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/net/util/IPAddressUtil.java Fri Sep 25 12:04:35 2015 -0700
@@ -26,9 +26,9 @@
package sun.net.util;
public class IPAddressUtil {
- private final static int INADDR4SZ = 4;
- private final static int INADDR16SZ = 16;
- private final static int INT16SZ = 2;
+ private static final int INADDR4SZ = 4;
+ private static final int INADDR16SZ = 16;
+ private static final int INT16SZ = 2;
/*
* Converts IPv4 address in its textual presentation form
--- a/jdk/src/java.base/share/classes/sun/net/www/ParseUtil.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/net/www/ParseUtil.java Fri Sep 25 12:04:35 2015 -0700
@@ -504,7 +504,7 @@
}
}
- private final static char[] hexDigits = {
+ private static final char[] hexDigits = {
'0', '1', '2', '3', '4', '5', '6', '7',
'8', '9', 'A', 'B', 'C', 'D', 'E', 'F'
};
--- a/jdk/src/java.base/share/classes/sun/net/www/URLConnection.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/net/www/URLConnection.java Fri Sep 25 12:04:35 2015 -0700
@@ -34,7 +34,7 @@
* @author James Gosling
*/
-abstract public class URLConnection extends java.net.URLConnection {
+public abstract class URLConnection extends java.net.URLConnection {
/** The URL that it is connected to */
@@ -236,11 +236,11 @@
private static HashMap<String,Void> proxiedHosts = new HashMap<>();
- public synchronized static void setProxiedHost(String host) {
+ public static synchronized void setProxiedHost(String host) {
proxiedHosts.put(host.toLowerCase(), null);
}
- public synchronized static boolean isProxiedHost(String host) {
+ public static synchronized boolean isProxiedHost(String host) {
return proxiedHosts.containsKey(host.toLowerCase());
}
}
--- a/jdk/src/java.base/share/classes/sun/net/www/http/ChunkedInputStream.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/net/www/http/ChunkedInputStream.java Fri Sep 25 12:04:35 2015 -0700
@@ -128,7 +128,7 @@
/*
* Maximum chunk header size of 2KB + 2 bytes for CRLF
*/
- private final static int MAX_CHUNK_HEADER_SIZE = 2050;
+ private static final int MAX_CHUNK_HEADER_SIZE = 2050;
/**
* State to indicate that next field should be :-
--- a/jdk/src/java.base/share/classes/sun/net/www/http/HttpClient.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/net/www/http/HttpClient.java Fri Sep 25 12:04:35 2015 -0700
@@ -70,7 +70,7 @@
/** return default port number (subclasses may override) */
protected int getDefaultPort () { return httpPortNumber; }
- static private int getDefaultPort(String proto) {
+ private static int getDefaultPort(String proto) {
if ("http".equalsIgnoreCase(proto))
return 80;
if ("https".equalsIgnoreCase(proto))
@@ -211,7 +211,7 @@
openServer();
}
- static protected Proxy newHttpProxy(String proxyHost, int proxyPort,
+ protected static Proxy newHttpProxy(String proxyHost, int proxyPort,
String proto) {
if (proxyHost == null || proto == null)
return Proxy.NO_PROXY;
--- a/jdk/src/java.base/share/classes/sun/net/www/protocol/http/AuthCacheValue.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/net/www/protocol/http/AuthCacheValue.java Fri Sep 25 12:04:35 2015 -0700
@@ -47,7 +47,7 @@
/**
* Caches authentication info entered by user. See cacheKey()
*/
- static protected AuthCache cache = new AuthCacheImpl();
+ protected static AuthCache cache = new AuthCacheImpl();
public static void setAuthCache (AuthCache map) {
cache = map;
--- a/jdk/src/java.base/share/classes/sun/net/www/protocol/http/AuthenticationInfo.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/net/www/protocol/http/AuthenticationInfo.java Fri Sep 25 12:04:35 2015 -0700
@@ -74,7 +74,7 @@
/* AuthCacheValue: */
- transient protected PasswordAuthentication pw;
+ protected transient PasswordAuthentication pw;
public PasswordAuthentication credentials() {
return pw;
@@ -113,13 +113,13 @@
* at the same time, then all but the first will block until
* the first completes its authentication.
*/
- static private HashMap<String,Thread> requests = new HashMap<>();
+ private static HashMap<String,Thread> requests = new HashMap<>();
/* check if a request for this destination is in progress
* return false immediately if not. Otherwise block until
* request is finished and return true
*/
- static private boolean requestIsInProgress (String key) {
+ private static boolean requestIsInProgress (String key) {
if (!serializeAuth) {
/* behavior is disabled. Revert to concurrent requests */
return false;
@@ -147,7 +147,7 @@
/* signal completion of an authentication (whether it succeeded or not)
* so that other threads can continue.
*/
- static private void requestCompleted (String key) {
+ private static void requestCompleted (String key) {
synchronized (requests) {
Thread thread = requests.get(key);
if (thread != null && thread == Thread.currentThread()) {
--- a/jdk/src/java.base/share/classes/sun/net/www/protocol/http/DigestAuthentication.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/net/www/protocol/http/DigestAuthentication.java Fri Sep 25 12:04:35 2015 -0700
@@ -54,7 +54,7 @@
private String authMethod;
- private final static String compatPropName = "http.auth.digest." +
+ private static final String compatPropName = "http.auth.digest." +
"quoteParameters";
// true if http.auth.digest.quoteParameters Net property is true
@@ -507,12 +507,12 @@
return finalHash;
}
- private final static char charArray[] = {
+ private static final char charArray[] = {
'0', '1', '2', '3', '4', '5', '6', '7',
'8', '9', 'a', 'b', 'c', 'd', 'e', 'f'
};
- private final static String zeroPad[] = {
+ private static final String zeroPad[] = {
// 0 1 2 3 4 5 6 7
"00000000", "0000000", "000000", "00000", "0000", "000", "00", "0"
};
--- a/jdk/src/java.base/share/classes/sun/net/www/protocol/http/HttpCallerInfo.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/net/www/protocol/http/HttpCallerInfo.java Fri Sep 25 12:04:35 2015 -0700
@@ -42,13 +42,13 @@
*
* 2. Schemed: With the scheme field filled, can be used in JGSS-API calls.
*/
-final public class HttpCallerInfo {
+public final class HttpCallerInfo {
// All info that an Authenticator needs.
- final public URL url;
- final public String host, protocol, prompt, scheme;
- final public int port;
- final public InetAddress addr;
- final public RequestorType authType;
+ public final URL url;
+ public final String host, protocol, prompt, scheme;
+ public final int port;
+ public final InetAddress addr;
+ public final RequestorType authType;
/**
* Create a schemed object based on an un-schemed one.
--- a/jdk/src/java.base/share/classes/sun/net/www/protocol/http/HttpURLConnection.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/net/www/protocol/http/HttpURLConnection.java Fri Sep 25 12:04:35 2015 -0700
@@ -106,11 +106,11 @@
static final boolean validateServer;
private StreamingOutputStream strOutputStream;
- private final static String RETRY_MSG1 =
+ private static final String RETRY_MSG1 =
"cannot retry due to proxy authentication, in streaming mode";
- private final static String RETRY_MSG2 =
+ private static final String RETRY_MSG2 =
"cannot retry due to server authentication, in streaming mode";
- private final static String RETRY_MSG3 =
+ private static final String RETRY_MSG3 =
"cannot retry due to redirection, in streaming mode";
/*
@@ -2857,8 +2857,8 @@
}
// constant strings represent set-cookie header names
- private final static String SET_COOKIE = "set-cookie";
- private final static String SET_COOKIE2 = "set-cookie2";
+ private static final String SET_COOKIE = "set-cookie";
+ private static final String SET_COOKIE2 = "set-cookie2";
/**
* Returns a filtered version of the given headers value.
--- a/jdk/src/java.base/share/classes/sun/net/www/protocol/http/NegotiateAuthentication.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/net/www/protocol/http/NegotiateAuthentication.java Fri Sep 25 12:04:35 2015 -0700
@@ -47,7 +47,7 @@
private static final long serialVersionUID = 100L;
private static final PlatformLogger logger = HttpURLConnection.getHttpLogger();
- final private HttpCallerInfo hci;
+ private final HttpCallerInfo hci;
// These maps are used to manage the GSS availability for diffrent
// hosts. The key for both maps is the host name.
--- a/jdk/src/java.base/share/classes/sun/net/www/protocol/https/DefaultHostnameVerifier.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/net/www/protocol/https/DefaultHostnameVerifier.java Fri Sep 25 12:04:35 2015 -0700
@@ -38,7 +38,7 @@
*
* @author Xuelei Fan
*/
-final public class DefaultHostnameVerifier implements HostnameVerifier {
+public final class DefaultHostnameVerifier implements HostnameVerifier {
public boolean verify(String hostname, SSLSession session) {
return false;
}
--- a/jdk/src/java.base/share/classes/sun/nio/ch/Net.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/nio/ch/Net.java Fri Sep 25 12:04:35 2015 -0700
@@ -460,9 +460,9 @@
throws IOException;
- public final static int SHUT_RD = 0;
- public final static int SHUT_WR = 1;
- public final static int SHUT_RDWR = 2;
+ public static final int SHUT_RD = 0;
+ public static final int SHUT_WR = 1;
+ public static final int SHUT_RDWR = 2;
static native void shutdown(FileDescriptor fd, int how) throws IOException;
--- a/jdk/src/java.base/share/classes/sun/nio/ch/SelectorImpl.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/nio/ch/SelectorImpl.java Fri Sep 25 12:04:35 2015 -0700
@@ -159,6 +159,6 @@
protected abstract void implDereg(SelectionKeyImpl ski) throws IOException;
- abstract public Selector wakeup();
+ public abstract Selector wakeup();
}
--- a/jdk/src/java.base/share/classes/sun/nio/ch/ThreadPool.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/nio/ch/ThreadPool.java Fri Sep 25 12:04:35 2015 -0700
@@ -91,7 +91,7 @@
}
private static class DefaultThreadPoolHolder {
- final static ThreadPool defaultThreadPool = createDefault();
+ static final ThreadPool defaultThreadPool = createDefault();
}
// return the default (system-wide) thread pool
--- a/jdk/src/java.base/share/classes/sun/nio/cs/CharsetMapping.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/nio/cs/CharsetMapping.java Fri Sep 25 12:04:35 2015 -0700
@@ -36,8 +36,8 @@
import java.security.*;
public class CharsetMapping {
- public final static char UNMAPPABLE_DECODING = '\uFFFD';
- public final static int UNMAPPABLE_ENCODING = 0xFFFD;
+ public static final char UNMAPPABLE_DECODING = '\uFFFD';
+ public static final int UNMAPPABLE_ENCODING = 0xFFFD;
char[] b2cSB; //singlebyte b->c
char[] b2cDB1; //dobulebyte b->c /db1
@@ -195,13 +195,13 @@
/*****************************************************************************/
// tags of different charset mapping tables
- private final static int MAP_SINGLEBYTE = 0x1; // 0..256 : c
- private final static int MAP_DOUBLEBYTE1 = 0x2; // min..max: c
- private final static int MAP_DOUBLEBYTE2 = 0x3; // min..max: c [DB2]
- private final static int MAP_SUPPLEMENT = 0x5; // db,c
- private final static int MAP_SUPPLEMENT_C2B = 0x6; // c,db
- private final static int MAP_COMPOSITE = 0x7; // db,base,cc
- private final static int MAP_INDEXC2B = 0x8; // index table of c->bb
+ private static final int MAP_SINGLEBYTE = 0x1; // 0..256 : c
+ private static final int MAP_DOUBLEBYTE1 = 0x2; // min..max: c
+ private static final int MAP_DOUBLEBYTE2 = 0x3; // min..max: c [DB2]
+ private static final int MAP_SUPPLEMENT = 0x5; // db,c
+ private static final int MAP_SUPPLEMENT_C2B = 0x6; // c,db
+ private static final int MAP_COMPOSITE = 0x7; // db,base,cc
+ private static final int MAP_INDEXC2B = 0x8; // index table of c->bb
private static final boolean readNBytes(InputStream in, byte[] bb, int N)
throws IOException
--- a/jdk/src/java.base/share/classes/sun/nio/cs/DoubleByte.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/nio/cs/DoubleByte.java Fri Sep 25 12:04:35 2015 -0700
@@ -102,7 +102,7 @@
public class DoubleByte {
- public final static char[] B2C_UNMAPPABLE;
+ public static final char[] B2C_UNMAPPABLE;
static {
B2C_UNMAPPABLE = new char[0x100];
Arrays.fill(B2C_UNMAPPABLE, UNMAPPABLE_DECODING);
--- a/jdk/src/java.base/share/classes/sun/nio/cs/SingleByte.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/nio/cs/SingleByte.java Fri Sep 25 12:04:35 2015 -0700
@@ -46,7 +46,7 @@
return cr;
}
- final public static class Decoder extends CharsetDecoder
+ public static final class Decoder extends CharsetDecoder
implements ArrayDecoder {
private final char[] b2c;
@@ -131,7 +131,7 @@
}
}
- final public static class Encoder extends CharsetEncoder
+ public static final class Encoder extends CharsetEncoder
implements ArrayEncoder {
private Surrogate.Parser sgp;
private final char[] c2b;
--- a/jdk/src/java.base/share/classes/sun/nio/cs/ThreadLocalCoders.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/nio/cs/ThreadLocalCoders.java Fri Sep 25 12:04:35 2015 -0700
@@ -37,7 +37,7 @@
private static final int CACHE_SIZE = 3;
- private static abstract class Cache {
+ private abstract static class Cache {
// Thread-local reference to array of cached objects, in LRU order
private ThreadLocal<Object[]> cache = new ThreadLocal<>();
--- a/jdk/src/java.base/share/classes/sun/reflect/UnsafeQualifiedStaticFieldAccessorImpl.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/reflect/UnsafeQualifiedStaticFieldAccessorImpl.java Fri Sep 25 12:04:35 2015 -0700
@@ -31,7 +31,7 @@
import sun.misc.Unsafe;
/** Base class for sun.misc.Unsafe-based FieldAccessors for final or
- volatile static fields. */
+ static volatile fields. */
abstract class UnsafeQualifiedStaticFieldAccessorImpl
extends UnsafeStaticFieldAccessorImpl
--- a/jdk/src/java.base/share/classes/sun/security/internal/spec/TlsRsaPremasterSecretParameterSpec.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/internal/spec/TlsRsaPremasterSecretParameterSpec.java Fri Sep 25 12:04:35 2015 -0700
@@ -50,14 +50,14 @@
* implementations) used to send the active negotiated version. The
* system property below allows to toggle the behavior.
*/
- private final static String PROP_NAME =
+ private static final String PROP_NAME =
"com.sun.net.ssl.rsaPreMasterSecretFix";
/*
* Default is "false" (old behavior) for compatibility reasons in
* SSLv3/TLSv1. Later protocols (TLSv1.1+) do not use this property.
*/
- private final static boolean rsaPreMasterSecretFix =
+ private static final boolean rsaPreMasterSecretFix =
AccessController.doPrivileged(new PrivilegedAction<Boolean>() {
public Boolean run() {
String value = System.getProperty(PROP_NAME);
--- a/jdk/src/java.base/share/classes/sun/security/jca/JCAUtil.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/jca/JCAUtil.java Fri Sep 25 12:04:35 2015 -0700
@@ -49,7 +49,7 @@
// size of the temporary arrays we use. Should fit into the CPU's 1st
// level cache and could be adjusted based on the platform
- private final static int ARRAY_SIZE = 4096;
+ private static final int ARRAY_SIZE = 4096;
/**
* Get the size of a temporary buffer array to use in order to be
--- a/jdk/src/java.base/share/classes/sun/security/jca/ProviderConfig.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/jca/ProviderConfig.java Fri Sep 25 12:04:35 2015 -0700
@@ -43,7 +43,7 @@
*/
final class ProviderConfig {
- private final static sun.security.util.Debug debug =
+ private static final sun.security.util.Debug debug =
sun.security.util.Debug.getInstance("jca", "ProviderConfig");
// suffix for identifying the SunPKCS11-Solaris provider
@@ -54,7 +54,7 @@
"${java.home}/conf/security/sunpkcs11-solaris.cfg";
// maximum number of times to try loading a provider before giving up
- private final static int MAX_LOAD_TRIES = 30;
+ private static final int MAX_LOAD_TRIES = 30;
// could be provider name (module) or provider class name (legacy)
private final String provName;
--- a/jdk/src/java.base/share/classes/sun/security/jca/ProviderList.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/jca/ProviderList.java Fri Sep 25 12:04:35 2015 -0700
@@ -55,12 +55,12 @@
*/
public final class ProviderList {
- final static sun.security.util.Debug debug =
+ static final sun.security.util.Debug debug =
sun.security.util.Debug.getInstance("jca", "ProviderList");
- private final static ProviderConfig[] PC0 = new ProviderConfig[0];
+ private static final ProviderConfig[] PC0 = new ProviderConfig[0];
- private final static Provider[] P0 = new Provider[0];
+ private static final Provider[] P0 = new Provider[0];
// constant for an ProviderList with no elements
static final ProviderList EMPTY = new ProviderList(PC0, true);
--- a/jdk/src/java.base/share/classes/sun/security/pkcs/PKCS9Attribute.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/pkcs/PKCS9Attribute.java Fri Sep 25 12:04:35 2015 -0700
@@ -186,7 +186,7 @@
*/
static final ObjectIdentifier[] PKCS9_OIDS = new ObjectIdentifier[18];
- private final static Class<?> BYTE_ARRAY_CLASS;
+ private static final Class<?> BYTE_ARRAY_CLASS;
static { // static initializer for PKCS9_OIDS
for (int i = 1; i < PKCS9_OIDS.length - 2; i++) {
--- a/jdk/src/java.base/share/classes/sun/security/pkcs12/PKCS12KeyStore.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/pkcs12/PKCS12KeyStore.java Fri Sep 25 12:04:35 2015 -0700
@@ -51,6 +51,8 @@
import java.util.*;
import java.security.AlgorithmParameters;
+import java.security.InvalidAlgorithmParameterException;
+import java.security.InvalidKeyException;
import javax.crypto.spec.PBEParameterSpec;
import javax.crypto.spec.PBEKeySpec;
import javax.crypto.spec.SecretKeySpec;
@@ -2060,7 +2062,7 @@
}
if (!MessageDigest.isEqual(macData.getDigest(), macResult)) {
- throw new SecurityException("Failed PKCS12" +
+ throw new UnrecoverableKeyException("Failed PKCS12" +
" integrity checking");
}
} catch (Exception e) {
--- a/jdk/src/java.base/share/classes/sun/security/provider/ByteArrayAccess.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/provider/ByteArrayAccess.java Fri Sep 25 12:04:35 2015 -0700
@@ -71,7 +71,7 @@
// implemented using a software trap and therefore very slow)
private static final boolean bigEndian;
- private final static int byteArrayOfs = unsafe.arrayBaseOffset(byte[].class);
+ private static final int byteArrayOfs = unsafe.arrayBaseOffset(byte[].class);
static {
boolean scaleOK = ((unsafe.arrayIndexScale(byte[].class) == 1)
--- a/jdk/src/java.base/share/classes/sun/security/provider/ConfigFile.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/provider/ConfigFile.java Fri Sep 25 12:04:35 2015 -0700
@@ -112,7 +112,7 @@
spi.engineRefresh();
}
- public final static class Spi extends ConfigurationSpi {
+ public static final class Spi extends ConfigurationSpi {
private URL url;
private boolean expandProp = true;
--- a/jdk/src/java.base/share/classes/sun/security/provider/MD2.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/provider/MD2.java Fri Sep 25 12:04:35 2015 -0700
@@ -109,7 +109,7 @@
}
// substitution table derived from Pi. Copied from the RFC.
- private final static int[] S = new int[] {
+ private static final int[] S = new int[] {
41, 46, 67, 201, 162, 216, 124, 1, 61, 54, 84, 161, 236, 240, 6,
19, 98, 167, 5, 243, 192, 199, 115, 140, 152, 147, 43, 217, 188,
76, 130, 202, 30, 155, 87, 60, 253, 212, 224, 22, 103, 66, 111, 24,
@@ -133,7 +133,7 @@
// digest padding. 17 element array.
// padding[0] is null
// padding[i] is an array of i time the byte value i (i = 1..16)
- private final static byte[][] PADDING;
+ private static final byte[][] PADDING;
static {
PADDING = new byte[17][];
--- a/jdk/src/java.base/share/classes/sun/security/provider/MD4.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/provider/MD4.java Fri Sep 25 12:04:35 2015 -0700
@@ -62,7 +62,7 @@
private static final int S33 = 11;
private static final int S34 = 15;
- private final static Provider md4Provider;
+ private static final Provider md4Provider;
static {
md4Provider = new Provider("MD4Provider", 1.9d, "MD4 MessageDigest") {
--- a/jdk/src/java.base/share/classes/sun/security/provider/ParameterCache.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/provider/ParameterCache.java Fri Sep 25 12:04:35 2015 -0700
@@ -50,10 +50,10 @@
}
// cache of DSA parameters
- private final static Map<Integer,DSAParameterSpec> dsaCache;
+ private static final Map<Integer,DSAParameterSpec> dsaCache;
// cache of DH parameters
- private final static Map<Integer,DHParameterSpec> dhCache;
+ private static final Map<Integer,DHParameterSpec> dhCache;
/**
* Return cached DSA parameters for the given length combination of
--- a/jdk/src/java.base/share/classes/sun/security/provider/SHA.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/provider/SHA.java Fri Sep 25 12:04:35 2015 -0700
@@ -104,10 +104,10 @@
}
// Constants for each round
- private final static int round1_kt = 0x5a827999;
- private final static int round2_kt = 0x6ed9eba1;
- private final static int round3_kt = 0x8f1bbcdc;
- private final static int round4_kt = 0xca62c1d6;
+ private static final int round1_kt = 0x5a827999;
+ private static final int round2_kt = 0x6ed9eba1;
+ private static final int round3_kt = 0x8f1bbcdc;
+ private static final int round4_kt = 0xca62c1d6;
/**
* Compute a the hash for the current block.
--- a/jdk/src/java.base/share/classes/sun/security/provider/SecureRandom.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/provider/SecureRandom.java Fri Sep 25 12:04:35 2015 -0700
@@ -148,7 +148,7 @@
* @param seed the seed.
*/
@Override
- synchronized public void engineSetSeed(byte[] seed) {
+ public synchronized void engineSetSeed(byte[] seed) {
if (state != null) {
digest.update(state);
for (int i = 0; i < state.length; i++) {
--- a/jdk/src/java.base/share/classes/sun/security/provider/SeedGenerator.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/provider/SeedGenerator.java Fri Sep 25 12:04:35 2015 -0700
@@ -141,7 +141,7 @@
/**
* Fill result with bytes from the queue. Wait for it if it isn't ready.
*/
- static public void generateSeed(byte[] result) {
+ public static void generateSeed(byte[] result) {
instance.getSeedBytes(result);
}
@@ -322,7 +322,7 @@
* pushes them into the queue.
*/
@Override
- final public void run() {
+ public final void run() {
try {
while (true) {
// Queue full? Wait till there's room.
@@ -466,7 +466,7 @@
*/
private static class BogusThread implements Runnable {
@Override
- final public void run() {
+ public final void run() {
try {
for (int i = 0; i < 5; i++) {
Thread.sleep(50);
--- a/jdk/src/java.base/share/classes/sun/security/provider/SunEntries.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/provider/SunEntries.java Fri Sep 25 12:04:35 2015 -0700
@@ -310,12 +310,12 @@
}
// name of the *System* property, takes precedence over PROP_RNDSOURCE
- private final static String PROP_EGD = "java.security.egd";
+ private static final String PROP_EGD = "java.security.egd";
// name of the *Security* property
- private final static String PROP_RNDSOURCE = "securerandom.source";
+ private static final String PROP_RNDSOURCE = "securerandom.source";
- final static String URL_DEV_RANDOM = "file:/dev/random";
- final static String URL_DEV_URANDOM = "file:/dev/urandom";
+ static final String URL_DEV_RANDOM = "file:/dev/random";
+ static final String URL_DEV_URANDOM = "file:/dev/urandom";
private static final String seedSource;
--- a/jdk/src/java.base/share/classes/sun/security/provider/certpath/AlgorithmChecker.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/provider/certpath/AlgorithmChecker.java Fri Sep 25 12:04:35 2015 -0700
@@ -68,16 +68,16 @@
* @see PKIXCertPathChecker
* @see PKIXParameters
*/
-final public class AlgorithmChecker extends PKIXCertPathChecker {
+public final class AlgorithmChecker extends PKIXCertPathChecker {
private final AlgorithmConstraints constraints;
private final PublicKey trustedPubKey;
private PublicKey prevPubKey;
- private final static Set<CryptoPrimitive> SIGNATURE_PRIMITIVE_SET =
+ private static final Set<CryptoPrimitive> SIGNATURE_PRIMITIVE_SET =
Collections.unmodifiableSet(EnumSet.of(CryptoPrimitive.SIGNATURE));
- private final static DisabledAlgorithmConstraints
+ private static final DisabledAlgorithmConstraints
certPathDefaultConstraints = new DisabledAlgorithmConstraints(
DisabledAlgorithmConstraints.PROPERTY_CERTPATH_DISABLED_ALGS);
--- a/jdk/src/java.base/share/classes/sun/security/provider/certpath/Builder.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/provider/certpath/Builder.java Fri Sep 25 12:04:35 2015 -0700
@@ -63,7 +63,7 @@
* Authority Information Access extension shall be enabled. Currently
* disabled by default for compatibility reasons.
*/
- final static boolean USE_AIA = AccessController.doPrivileged
+ static final boolean USE_AIA = AccessController.doPrivileged
(new GetBooleanAction("com.sun.security.enableAIAcaIssuers"));
/**
--- a/jdk/src/java.base/share/classes/sun/security/provider/certpath/ForwardBuilder.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/provider/certpath/ForwardBuilder.java Fri Sep 25 12:04:35 2015 -0700
@@ -433,7 +433,7 @@
*/
static class PKIXCertComparator implements Comparator<X509Certificate> {
- final static String METHOD_NME = "PKIXCertComparator.compare()";
+ static final String METHOD_NME = "PKIXCertComparator.compare()";
private final Set<X500Principal> trustedSubjectDNs;
--- a/jdk/src/java.base/share/classes/sun/security/provider/certpath/OCSPResponse.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/provider/certpath/OCSPResponse.java Fri Sep 25 12:04:35 2015 -0700
@@ -760,7 +760,7 @@
/*
* A class representing a single OCSP response.
*/
- public final static class SingleResponse implements OCSP.RevocationStatus {
+ public static final class SingleResponse implements OCSP.RevocationStatus {
private final CertId certId;
private final CertStatus certStatus;
private final Date thisUpdate;
--- a/jdk/src/java.base/share/classes/sun/security/provider/certpath/URICertStore.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/provider/certpath/URICertStore.java Fri Sep 25 12:04:35 2015 -0700
@@ -91,10 +91,10 @@
// interval between checks for update of cached Certificates/CRLs
// (30 seconds)
- private final static int CHECK_INTERVAL = 30 * 1000;
+ private static final int CHECK_INTERVAL = 30 * 1000;
// size of the cache (see Cache class for sizing recommendations)
- private final static int CACHE_SIZE = 185;
+ private static final int CACHE_SIZE = 185;
// X.509 certificate factory instance
private final CertificateFactory factory;
--- a/jdk/src/java.base/share/classes/sun/security/provider/certpath/UntrustedChecker.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/provider/certpath/UntrustedChecker.java Fri Sep 25 12:04:35 2015 -0700
@@ -41,7 +41,7 @@
* @see PKIXCertPathChecker
* @see PKIXParameters
*/
-final public class UntrustedChecker extends PKIXCertPathChecker {
+public final class UntrustedChecker extends PKIXCertPathChecker {
private static final Debug debug = Debug.getInstance("certpath");
--- a/jdk/src/java.base/share/classes/sun/security/provider/certpath/ssl/SSLServerCertStore.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/provider/certpath/ssl/SSLServerCertStore.java Fri Sep 25 12:04:35 2015 -0700
@@ -61,9 +61,9 @@
public final class SSLServerCertStore extends CertStoreSpi {
private final URI uri;
- private final static GetChainTrustManager trustManager;
- private final static SSLSocketFactory socketFactory;
- private final static HostnameVerifier hostnameVerifier;
+ private static final GetChainTrustManager trustManager;
+ private static final SSLSocketFactory socketFactory;
+ private static final HostnameVerifier hostnameVerifier;
static {
trustManager = new GetChainTrustManager();
--- a/jdk/src/java.base/share/classes/sun/security/rsa/RSACore.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/rsa/RSACore.java Fri Sep 25 12:04:35 2015 -0700
@@ -51,12 +51,12 @@
public final class RSACore {
// globally enable/disable use of blinding
- private final static boolean ENABLE_BLINDING = true;
+ private static final boolean ENABLE_BLINDING = true;
// cache for blinding parameters. Map<BigInteger, BlindingParameters>
// use a weak hashmap so that cached values are automatically cleared
// when the modulus is GC'ed
- private final static Map<BigInteger, BlindingParameters>
+ private static final Map<BigInteger, BlindingParameters>
blindingCache = new WeakHashMap<>();
private RSACore() {
@@ -311,7 +311,7 @@
*
* The total performance cost is small.
*/
- private final static class BlindingRandomPair {
+ private static final class BlindingRandomPair {
final BigInteger u;
final BigInteger v;
@@ -332,8 +332,8 @@
* since sharing moduli is fundamentally broken and insecure, this
* does not matter.
*/
- private final static class BlindingParameters {
- private final static BigInteger BIG_TWO = BigInteger.valueOf(2L);
+ private static final class BlindingParameters {
+ private static final BigInteger BIG_TWO = BigInteger.valueOf(2L);
// RSA public exponent
private final BigInteger e;
--- a/jdk/src/java.base/share/classes/sun/security/rsa/RSAKeyFactory.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/rsa/RSAKeyFactory.java Fri Sep 25 12:04:35 2015 -0700
@@ -60,18 +60,18 @@
*/
public final class RSAKeyFactory extends KeyFactorySpi {
- private final static Class<?> rsaPublicKeySpecClass =
+ private static final Class<?> rsaPublicKeySpecClass =
RSAPublicKeySpec.class;
- private final static Class<?> rsaPrivateKeySpecClass =
+ private static final Class<?> rsaPrivateKeySpecClass =
RSAPrivateKeySpec.class;
- private final static Class<?> rsaPrivateCrtKeySpecClass =
+ private static final Class<?> rsaPrivateCrtKeySpecClass =
RSAPrivateCrtKeySpec.class;
- private final static Class<?> x509KeySpecClass = X509EncodedKeySpec.class;
- private final static Class<?> pkcs8KeySpecClass = PKCS8EncodedKeySpec.class;
+ private static final Class<?> x509KeySpecClass = X509EncodedKeySpec.class;
+ private static final Class<?> pkcs8KeySpecClass = PKCS8EncodedKeySpec.class;
- public final static int MIN_MODLEN = 512;
- public final static int MAX_MODLEN = 16384;
+ public static final int MIN_MODLEN = 512;
+ public static final int MAX_MODLEN = 16384;
/*
* If the modulus length is above this value, restrict the size of
@@ -80,8 +80,8 @@
* this approach allows flexibility in case impls would like to use
* larger module and exponent values.
*/
- public final static int MAX_MODLEN_RESTRICT_EXP = 3072;
- public final static int MAX_RESTRICTED_EXPLEN = 64;
+ public static final int MAX_MODLEN_RESTRICT_EXP = 3072;
+ public static final int MAX_RESTRICTED_EXPLEN = 64;
private static final boolean restrictExpLen =
"true".equalsIgnoreCase(AccessController.doPrivileged(
@@ -89,7 +89,7 @@
"sun.security.rsa.restrictRSAExponent", "true")));
// instance used for static translateKey();
- private final static RSAKeyFactory INSTANCE = new RSAKeyFactory();
+ private static final RSAKeyFactory INSTANCE = new RSAKeyFactory();
public RSAKeyFactory() {
// empty
--- a/jdk/src/java.base/share/classes/sun/security/rsa/RSAPadding.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/rsa/RSAPadding.java Fri Sep 25 12:04:35 2015 -0700
@@ -85,13 +85,13 @@
// file. Do not change without coordinating the update
// PKCS#1 v1.5 padding, blocktype 1 (signing)
- public final static int PAD_BLOCKTYPE_1 = 1;
+ public static final int PAD_BLOCKTYPE_1 = 1;
// PKCS#1 v1.5 padding, blocktype 2 (encryption)
- public final static int PAD_BLOCKTYPE_2 = 2;
+ public static final int PAD_BLOCKTYPE_2 = 2;
// nopadding. Does not do anything, but allows simpler RSACipher code
- public final static int PAD_NONE = 3;
+ public static final int PAD_NONE = 3;
// PKCS#1 v2.1 OAEP padding
- public final static int PAD_OAEP_MGF1 = 4;
+ public static final int PAD_OAEP_MGF1 = 4;
// type, one of PAD_*
private final int type;
--- a/jdk/src/java.base/share/classes/sun/security/rsa/RSAPrivateCrtKeyImpl.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/rsa/RSAPrivateCrtKeyImpl.java Fri Sep 25 12:04:35 2015 -0700
@@ -63,7 +63,7 @@
private BigInteger coeff; // CRT coeffcient
// algorithmId used to identify RSA keys
- final static AlgorithmId rsaId =
+ static final AlgorithmId rsaId =
new AlgorithmId(AlgorithmId.RSAEncryption_oid);
/**
--- a/jdk/src/java.base/share/classes/sun/security/ssl/AppOutputStream.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/ssl/AppOutputStream.java Fri Sep 25 12:04:35 2015 -0700
@@ -49,7 +49,7 @@
* Write the data out, NOW.
*/
@Override
- synchronized public void write(byte[] b, int off, int len)
+ public synchronized void write(byte[] b, int off, int len)
throws IOException {
if (b == null) {
throw new NullPointerException();
@@ -76,7 +76,7 @@
* Write one byte now.
*/
@Override
- synchronized public void write(int i) throws IOException {
+ public synchronized void write(int i) throws IOException {
oneByte[0] = (byte)i;
write(oneByte, 0, 1);
}
--- a/jdk/src/java.base/share/classes/sun/security/ssl/Authenticator.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/ssl/Authenticator.java Fri Sep 25 12:04:35 2015 -0700
@@ -244,7 +244,7 @@
return copy;
}
- final static long toLong(byte[] recordEnS) {
+ static final long toLong(byte[] recordEnS) {
if (recordEnS != null && recordEnS.length == 8) {
return ((recordEnS[0] & 0xFFL) << 56) |
((recordEnS[1] & 0xFFL) << 48) |
--- a/jdk/src/java.base/share/classes/sun/security/ssl/BaseSSLSocketImpl.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/ssl/BaseSSLSocketImpl.java Fri Sep 25 12:04:35 2015 -0700
@@ -55,8 +55,8 @@
* recurse infinitely ... e.g. close() calling itself, or doing
* I/O in terms of our own streams.
*/
- final private Socket self;
- final private InputStream consumedInput;
+ private final Socket self;
+ private final InputStream consumedInput;
BaseSSLSocketImpl() {
super();
@@ -88,10 +88,10 @@
*
* The default is "false", i.e. tolerate the broken behavior.
*/
- private final static String PROP_NAME =
+ private static final String PROP_NAME =
"com.sun.net.ssl.requireCloseNotify";
- final static boolean requireCloseNotify =
+ static final boolean requireCloseNotify =
Debug.getBooleanProperty(PROP_NAME, false);
//
--- a/jdk/src/java.base/share/classes/sun/security/ssl/CipherBox.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/ssl/CipherBox.java Fri Sep 25 12:04:35 2015 -0700
@@ -93,7 +93,7 @@
final class CipherBox {
// A CipherBox that implements the identity operation
- final static CipherBox NULL = new CipherBox();
+ static final CipherBox NULL = new CipherBox();
/* Class and subclass dynamic debugging support */
private static final Debug debug = Debug.getInstance("ssl");
--- a/jdk/src/java.base/share/classes/sun/security/ssl/CipherSuite.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/ssl/CipherSuite.java Fri Sep 25 12:04:35 2015 -0700
@@ -72,27 +72,27 @@
final class CipherSuite implements Comparable<CipherSuite> {
// minimum priority for supported CipherSuites
- final static int SUPPORTED_SUITES_PRIORITY = 1;
+ static final int SUPPORTED_SUITES_PRIORITY = 1;
// minimum priority for default enabled CipherSuites
- final static int DEFAULT_SUITES_PRIORITY = 300;
+ static final int DEFAULT_SUITES_PRIORITY = 300;
// Flag indicating if CipherSuite availability can change dynamically.
// This is the case when we rely on a JCE cipher implementation that
// may not be available in the installed JCE providers.
// It is true because we might not have an ECC implementation.
- final static boolean DYNAMIC_AVAILABILITY = true;
+ static final boolean DYNAMIC_AVAILABILITY = true;
- private final static boolean ALLOW_ECC = Debug.getBooleanProperty
+ private static final boolean ALLOW_ECC = Debug.getBooleanProperty
("com.sun.net.ssl.enableECC", true);
// Map Integer(id) -> CipherSuite
// contains all known CipherSuites
- private final static Map<Integer,CipherSuite> idMap;
+ private static final Map<Integer,CipherSuite> idMap;
// Map String(name) -> CipherSuite
// contains only supported CipherSuites (i.e. allowed == true)
- private final static Map<String,CipherSuite> nameMap;
+ private static final Map<String,CipherSuite> nameMap;
// Protocol defined CipherSuite name, e.g. SSL_RSA_WITH_RC4_128_MD5
// we use TLS_* only for new CipherSuites, still SSL_* for old ones
@@ -474,7 +474,7 @@
B_AES_256_GCM(CIPHER_AES_GCM, AEAD_CIPHER, 32, 12, 4, true);
// Map BulkCipher -> Boolean(available)
- private final static Map<BulkCipher,Boolean> availableCache =
+ private static final Map<BulkCipher,Boolean> availableCache =
new HashMap<>(8);
// descriptive name including key size, e.g. AES/128
@@ -518,7 +518,7 @@
final int tagSize = 16;
// The secure random used to detect the cipher availability.
- private final static SecureRandom secureRandom;
+ private static final SecureRandom secureRandom;
static {
try {
@@ -1437,8 +1437,8 @@
}
// ciphersuite SSL_NULL_WITH_NULL_NULL
- final static CipherSuite C_NULL = CipherSuite.valueOf(0, 0);
+ static final CipherSuite C_NULL = CipherSuite.valueOf(0, 0);
// ciphersuite TLS_EMPTY_RENEGOTIATION_INFO_SCSV
- final static CipherSuite C_SCSV = CipherSuite.valueOf(0x00, 0xff);
+ static final CipherSuite C_SCSV = CipherSuite.valueOf(0x00, 0xff);
}
--- a/jdk/src/java.base/share/classes/sun/security/ssl/Ciphertext.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/ssl/Ciphertext.java Fri Sep 25 12:04:35 2015 -0700
@@ -32,7 +32,7 @@
* enumeration of record type
*/
final class Ciphertext {
- final static Ciphertext CIPHERTEXT_NULL = new Ciphertext();
+ static final Ciphertext CIPHERTEXT_NULL = new Ciphertext();
RecordType recordType;
long recordSN;
--- a/jdk/src/java.base/share/classes/sun/security/ssl/ClientHandshaker.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/ssl/ClientHandshaker.java Fri Sep 25 12:04:35 2015 -0700
@@ -60,8 +60,8 @@
final class ClientHandshaker extends Handshaker {
// constants for subject alt names of type DNS and IP
- private final static int ALTNAME_DNS = 2;
- private final static int ALTNAME_IP = 7;
+ private static final int ALTNAME_DNS = 2;
+ private static final int ALTNAME_IP = 7;
// the server's public key from its certificate.
private PublicKey serverKey;
@@ -98,7 +98,7 @@
private ProtocolVersion maxProtocolVersion;
// To switch off the SNI extension.
- private final static boolean enableSNIExtension =
+ private static final boolean enableSNIExtension =
Debug.getBooleanProperty("jsse.enableSNIExtension", true);
/*
@@ -144,11 +144,11 @@
* If the system property is set to "true" explicitly, the restriction on
* server certificate change in renegotiation is disabled.
*/
- private final static boolean allowUnsafeServerCertChange =
+ private static final boolean allowUnsafeServerCertChange =
Debug.getBooleanProperty("jdk.tls.allowUnsafeServerCertChange", false);
// To switch off the max_fragment_length extension.
- private final static boolean enableMFLExtension =
+ private static final boolean enableMFLExtension =
Debug.getBooleanProperty("jsse.enableMFLExtension", false);
private List<SNIServerName> requestedServerNames =
--- a/jdk/src/java.base/share/classes/sun/security/ssl/ClientKeyExchange.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/ssl/ClientKeyExchange.java Fri Sep 25 12:04:35 2015 -0700
@@ -44,17 +44,17 @@
}
@Override
- abstract public int messageLength();
+ public abstract int messageLength();
@Override
- abstract public void send(HandshakeOutStream s) throws IOException;
+ public abstract void send(HandshakeOutStream s) throws IOException;
@Override
- abstract public void print(PrintStream s) throws IOException;
+ public abstract void print(PrintStream s) throws IOException;
- abstract public SecretKey clientKeyExchange();
+ public abstract SecretKey clientKeyExchange();
- abstract public Principal getPeerPrincipal();
+ public abstract Principal getPeerPrincipal();
- abstract public Principal getLocalPrincipal();
+ public abstract Principal getLocalPrincipal();
}
--- a/jdk/src/java.base/share/classes/sun/security/ssl/DTLSInputRecord.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/ssl/DTLSInputRecord.java Fri Sep 25 12:04:35 2015 -0700
@@ -77,7 +77,7 @@
}
@Override
- synchronized public void close() throws IOException {
+ public synchronized void close() throws IOException {
if (!isClosed) {
prevReadCipher.dispose();
super.close();
--- a/jdk/src/java.base/share/classes/sun/security/ssl/EphemeralKeyManager.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/ssl/EphemeralKeyManager.java Fri Sep 25 12:04:35 2015 -0700
@@ -36,8 +36,8 @@
final class EphemeralKeyManager {
// indices for the keys array below
- private final static int INDEX_RSA512 = 0;
- private final static int INDEX_RSA1024 = 1;
+ private static final int INDEX_RSA512 = 0;
+ private static final int INDEX_RSA1024 = 1;
/*
* Current cached RSA KeyPairs. Elements are never null.
@@ -87,10 +87,10 @@
private static class EphemeralKeyPair {
// maximum number of times a KeyPair is used
- private final static int MAX_USE = 200;
+ private static final int MAX_USE = 200;
// maximum time interval in which the keypair is used (1 hour in ms)
- private final static long USE_INTERVAL = 3600*1000;
+ private static final long USE_INTERVAL = 3600*1000;
private KeyPair keyPair;
private int uses;
--- a/jdk/src/java.base/share/classes/sun/security/ssl/ExtensionType.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/ssl/ExtensionType.java Fri Sep 25 12:04:35 2015 -0700
@@ -62,46 +62,46 @@
}
// extensions defined in RFC 3546
- final static ExtensionType EXT_SERVER_NAME =
+ static final ExtensionType EXT_SERVER_NAME =
e(0x0000, "server_name"); // IANA registry value: 0
- final static ExtensionType EXT_MAX_FRAGMENT_LENGTH =
+ static final ExtensionType EXT_MAX_FRAGMENT_LENGTH =
e(0x0001, "max_fragment_length"); // IANA registry value: 1
- final static ExtensionType EXT_CLIENT_CERTIFICATE_URL =
+ static final ExtensionType EXT_CLIENT_CERTIFICATE_URL =
e(0x0002, "client_certificate_url"); // IANA registry value: 2
- final static ExtensionType EXT_TRUSTED_CA_KEYS =
+ static final ExtensionType EXT_TRUSTED_CA_KEYS =
e(0x0003, "trusted_ca_keys"); // IANA registry value: 3
- final static ExtensionType EXT_TRUNCATED_HMAC =
+ static final ExtensionType EXT_TRUNCATED_HMAC =
e(0x0004, "truncated_hmac"); // IANA registry value: 4
- final static ExtensionType EXT_STATUS_REQUEST =
+ static final ExtensionType EXT_STATUS_REQUEST =
e(0x0005, "status_request"); // IANA registry value: 5
// extensions defined in RFC 4681
- final static ExtensionType EXT_USER_MAPPING =
+ static final ExtensionType EXT_USER_MAPPING =
e(0x0006, "user_mapping"); // IANA registry value: 6
// extensions defined in RFC 5081
- final static ExtensionType EXT_CERT_TYPE =
+ static final ExtensionType EXT_CERT_TYPE =
e(0x0009, "cert_type"); // IANA registry value: 9
// extensions defined in RFC 4492 (ECC)
- final static ExtensionType EXT_ELLIPTIC_CURVES =
+ static final ExtensionType EXT_ELLIPTIC_CURVES =
e(0x000A, "elliptic_curves"); // IANA registry value: 10
- final static ExtensionType EXT_EC_POINT_FORMATS =
+ static final ExtensionType EXT_EC_POINT_FORMATS =
e(0x000B, "ec_point_formats"); // IANA registry value: 11
// extensions defined in RFC 5054
- final static ExtensionType EXT_SRP =
+ static final ExtensionType EXT_SRP =
e(0x000C, "srp"); // IANA registry value: 12
// extensions defined in RFC 5246
- final static ExtensionType EXT_SIGNATURE_ALGORITHMS =
+ static final ExtensionType EXT_SIGNATURE_ALGORITHMS =
e(0x000D, "signature_algorithms"); // IANA registry value: 13
// extensions defined in RFC 6961
- final static ExtensionType EXT_STATUS_REQUEST_V2 =
+ static final ExtensionType EXT_STATUS_REQUEST_V2 =
e(0x0011, "status_request_v2"); // IANA registry value: 17
// extensions defined in RFC 5746
- final static ExtensionType EXT_RENEGOTIATION_INFO =
+ static final ExtensionType EXT_RENEGOTIATION_INFO =
e(0xff01, "renegotiation_info"); // IANA registry value: 65281
}
--- a/jdk/src/java.base/share/classes/sun/security/ssl/HandshakeMessage.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/ssl/HandshakeMessage.java Fri Sep 25 12:04:35 2015 -0700
@@ -297,7 +297,7 @@
HelloExtensions extensions = new HelloExtensions();
- private final static byte[] NULL_COMPRESSION = new byte[] {0};
+ private static final byte[] NULL_COMPRESSION = new byte[] {0};
ClientHello(SecureRandom generator, ProtocolVersion protocolVersion,
SessionId sessionId, CipherSuiteList cipherSuites,
@@ -924,7 +924,7 @@
* exchange the premaster secret. That's how RSA_EXPORT often works,
* as well as how the DHE_* flavors work.
*/
-static abstract class ServerKeyExchange extends HandshakeMessage
+abstract static class ServerKeyExchange extends HandshakeMessage
{
@Override
int messageType() { return ht_server_key_exchange; }
@@ -1077,7 +1077,7 @@
class DH_ServerKeyExchange extends ServerKeyExchange
{
// Fix message encoding, see 4348279
- private final static boolean dhKeyExchangeFix =
+ private static final boolean dhKeyExchangeFix =
Debug.getBooleanProperty("com.sun.net.ssl.dhKeyExchangeFix", true);
private byte[] dh_p; // 1 to 2^16 - 1 bytes
@@ -1362,9 +1362,9 @@
class ECDH_ServerKeyExchange extends ServerKeyExchange {
// constants for ECCurveType
- private final static int CURVE_EXPLICIT_PRIME = 1;
- private final static int CURVE_EXPLICIT_CHAR2 = 2;
- private final static int CURVE_NAMED_CURVE = 3;
+ private static final int CURVE_EXPLICIT_PRIME = 1;
+ private static final int CURVE_EXPLICIT_CHAR2 = 2;
+ private static final int CURVE_NAMED_CURVE = 3;
// id of the curve we are using
private int curveId;
@@ -1660,8 +1660,8 @@
static final int cct_rsa_fixed_ecdh = 65;
static final int cct_ecdsa_fixed_ecdh = 66;
- private final static byte[] TYPES_NO_ECC = { cct_rsa_sign, cct_dss_sign };
- private final static byte[] TYPES_ECC =
+ private static final byte[] TYPES_NO_ECC = { cct_rsa_sign, cct_dss_sign };
+ private static final byte[] TYPES_ECC =
{ cct_rsa_sign, cct_dss_sign, cct_ecdsa_sign };
byte[] types; // 1 to 255 types
@@ -2119,8 +2119,8 @@
md.update(temp);
}
- private final static Class<?> delegate;
- private final static Field spiField;
+ private static final Class<?> delegate;
+ private static final Field spiField;
static {
try {
@@ -2143,12 +2143,12 @@
}
// ConcurrentHashMap does not allow null values, use this marker object
- private final static Object NULL_OBJECT = new Object();
+ private static final Object NULL_OBJECT = new Object();
// cache Method objects per Spi class
// Note that this will prevent the Spi classes from being GC'd. We assume
// that is not a problem.
- private final static Map<Class<?>,Object> methodCache =
+ private static final Map<Class<?>,Object> methodCache =
new ConcurrentHashMap<>();
private static void digestKey(MessageDigest md, SecretKey key) {
@@ -2241,10 +2241,10 @@
static final class Finished extends HandshakeMessage {
// constant for a Finished message sent by the client
- final static int CLIENT = 1;
+ static final int CLIENT = 1;
// constant for a Finished message sent by the server
- final static int SERVER = 2;
+ static final int SERVER = 2;
// enum Sender: "CLNT" and "SRVR"
private static final byte[] SSL_CLIENT = { 0x43, 0x4C, 0x4E, 0x54 };
--- a/jdk/src/java.base/share/classes/sun/security/ssl/HandshakeStateManager.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/ssl/HandshakeStateManager.java Fri Sep 25 12:04:35 2015 -0700
@@ -218,9 +218,9 @@
private boolean isDTLS;
- private final static boolean debugIsOn;
+ private static final boolean debugIsOn;
- private final static HashMap<Byte, String> handshakeTypes;
+ private static final HashMap<Byte, String> handshakeTypes;
static {
debugIsOn = (Handshaker.debug != null) &&
--- a/jdk/src/java.base/share/classes/sun/security/ssl/Handshaker.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/ssl/Handshaker.java Fri Sep 25 12:04:35 2015 -0700
@@ -585,7 +585,7 @@
*
* Does not check if the required server certificates are available.
*/
- final static boolean isNegotiable(CipherSuiteList proposed, CipherSuite s) {
+ static final boolean isNegotiable(CipherSuiteList proposed, CipherSuite s) {
return proposed.contains(s) && s.isNegotiable();
}
--- a/jdk/src/java.base/share/classes/sun/security/ssl/InputRecord.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/ssl/InputRecord.java Fri Sep 25 12:04:35 2015 -0700
@@ -123,7 +123,7 @@
* and flag the record as holding no data.
*/
@Override
- synchronized public void close() throws IOException {
+ public synchronized void close() throws IOException {
if (!isClosed) {
isClosed = true;
readCipher.dispose();
--- a/jdk/src/java.base/share/classes/sun/security/ssl/JsseJce.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/ssl/JsseJce.java Fri Sep 25 12:04:35 2015 -0700
@@ -53,7 +53,7 @@
*/
final class JsseJce {
- private final static ProviderList fipsProviderList;
+ private static final ProviderList fipsProviderList;
// Flag indicating whether EC crypto is available.
// If null, then we have not checked yet.
@@ -62,7 +62,7 @@
// Flag indicating whether Kerberos crypto is available.
// If true, then all the Kerberos-based crypto we need is available.
- private final static boolean kerberosAvailable;
+ private static final boolean kerberosAvailable;
static {
ClientKeyExchangeService p =
ClientKeyExchangeService.find("KRB5");
@@ -119,68 +119,68 @@
* JCE transformation string for RSA with PKCS#1 v1.5 padding.
* Can be used for encryption, decryption, signing, verifying.
*/
- final static String CIPHER_RSA_PKCS1 = "RSA/ECB/PKCS1Padding";
+ static final String CIPHER_RSA_PKCS1 = "RSA/ECB/PKCS1Padding";
/**
* JCE transformation string for the stream cipher RC4.
*/
- final static String CIPHER_RC4 = "RC4";
+ static final String CIPHER_RC4 = "RC4";
/**
* JCE transformation string for DES in CBC mode without padding.
*/
- final static String CIPHER_DES = "DES/CBC/NoPadding";
+ static final String CIPHER_DES = "DES/CBC/NoPadding";
/**
* JCE transformation string for (3-key) Triple DES in CBC mode
* without padding.
*/
- final static String CIPHER_3DES = "DESede/CBC/NoPadding";
+ static final String CIPHER_3DES = "DESede/CBC/NoPadding";
/**
* JCE transformation string for AES in CBC mode
* without padding.
*/
- final static String CIPHER_AES = "AES/CBC/NoPadding";
+ static final String CIPHER_AES = "AES/CBC/NoPadding";
/**
* JCE transformation string for AES in GCM mode
* without padding.
*/
- final static String CIPHER_AES_GCM = "AES/GCM/NoPadding";
+ static final String CIPHER_AES_GCM = "AES/GCM/NoPadding";
/**
* JCA identifier string for DSA, i.e. a DSA with SHA-1.
*/
- final static String SIGNATURE_DSA = "DSA";
+ static final String SIGNATURE_DSA = "DSA";
/**
* JCA identifier string for ECDSA, i.e. a ECDSA with SHA-1.
*/
- final static String SIGNATURE_ECDSA = "SHA1withECDSA";
+ static final String SIGNATURE_ECDSA = "SHA1withECDSA";
/**
* JCA identifier string for Raw DSA, i.e. a DSA signature without
* hashing where the application provides the SHA-1 hash of the data.
* Note that the standard name is "NONEwithDSA" but we use "RawDSA"
* for compatibility.
*/
- final static String SIGNATURE_RAWDSA = "RawDSA";
+ static final String SIGNATURE_RAWDSA = "RawDSA";
/**
* JCA identifier string for Raw ECDSA, i.e. a DSA signature without
* hashing where the application provides the SHA-1 hash of the data.
*/
- final static String SIGNATURE_RAWECDSA = "NONEwithECDSA";
+ static final String SIGNATURE_RAWECDSA = "NONEwithECDSA";
/**
* JCA identifier string for Raw RSA, i.e. a RSA PKCS#1 v1.5 signature
* without hashing where the application provides the hash of the data.
* Used for RSA client authentication with a 36 byte hash.
*/
- final static String SIGNATURE_RAWRSA = "NONEwithRSA";
+ static final String SIGNATURE_RAWRSA = "NONEwithRSA";
/**
* JCA identifier string for the SSL/TLS style RSA Signature. I.e.
* an signature using RSA with PKCS#1 v1.5 padding signing a
* concatenation of an MD5 and SHA-1 digest.
*/
- final static String SIGNATURE_SSLRSA = "MD5andSHA1withRSA";
+ static final String SIGNATURE_SSLRSA = "MD5andSHA1withRSA";
private JsseJce() {
// no instantiation of this class
}
- synchronized static boolean isEcAvailable() {
+ static synchronized boolean isEcAvailable() {
if (ecAvailable == null) {
try {
JsseJce.getSignature(SIGNATURE_ECDSA);
@@ -196,7 +196,7 @@
return ecAvailable;
}
- synchronized static void clearEcAvailable() {
+ static synchronized void clearEcAvailable() {
ecAvailable = null;
}
--- a/jdk/src/java.base/share/classes/sun/security/ssl/MAC.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/ssl/MAC.java Fri Sep 25 12:04:35 2015 -0700
@@ -49,7 +49,7 @@
*/
final class MAC extends Authenticator {
- final static MAC TLS_NULL = new MAC(false);
+ static final MAC TLS_NULL = new MAC(false);
// Value of the null MAC is fixed
private static final byte[] nullMAC = new byte[0];
--- a/jdk/src/java.base/share/classes/sun/security/ssl/OutputRecord.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/ssl/OutputRecord.java Fri Sep 25 12:04:35 2015 -0700
@@ -195,7 +195,7 @@
}
@Override
- synchronized public void close() throws IOException {
+ public synchronized void close() throws IOException {
if (!isClosed) {
isClosed = true;
writeCipher.dispose();
--- a/jdk/src/java.base/share/classes/sun/security/ssl/Plaintext.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/ssl/Plaintext.java Fri Sep 25 12:04:35 2015 -0700
@@ -32,7 +32,7 @@
* Plaintext
*/
final class Plaintext {
- final static Plaintext PLAINTEXT_NULL = new Plaintext();
+ static final Plaintext PLAINTEXT_NULL = new Plaintext();
byte contentType;
byte majorVersion;
--- a/jdk/src/java.base/share/classes/sun/security/ssl/ProtocolVersion.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/ssl/ProtocolVersion.java Fri Sep 25 12:04:35 2015 -0700
@@ -54,33 +54,33 @@
public final class ProtocolVersion implements Comparable<ProtocolVersion> {
// The limit of maximum protocol version
- final static int LIMIT_MAX_VALUE = 0xFFFF;
+ static final int LIMIT_MAX_VALUE = 0xFFFF;
// The limit of minimum protocol version
- final static int LIMIT_MIN_VALUE = 0x0000;
+ static final int LIMIT_MIN_VALUE = 0x0000;
// Dummy protocol version value for invalid SSLSession
- final static ProtocolVersion NONE = new ProtocolVersion(-1, "NONE");
+ static final ProtocolVersion NONE = new ProtocolVersion(-1, "NONE");
// If enabled, send/accept SSLv2 hello messages
- final static ProtocolVersion SSL20Hello =
+ static final ProtocolVersion SSL20Hello =
new ProtocolVersion(0x0002, "SSLv2Hello");
// SSL 3.0
- final static ProtocolVersion SSL30 = new ProtocolVersion(0x0300, "SSLv3");
+ static final ProtocolVersion SSL30 = new ProtocolVersion(0x0300, "SSLv3");
// TLS 1.0
- final static ProtocolVersion TLS10 = new ProtocolVersion(0x0301, "TLSv1");
+ static final ProtocolVersion TLS10 = new ProtocolVersion(0x0301, "TLSv1");
// TLS 1.1
- final static ProtocolVersion TLS11 = new ProtocolVersion(0x0302, "TLSv1.1");
+ static final ProtocolVersion TLS11 = new ProtocolVersion(0x0302, "TLSv1.1");
// TLS 1.2
- final static ProtocolVersion TLS12 = new ProtocolVersion(0x0303, "TLSv1.2");
+ static final ProtocolVersion TLS12 = new ProtocolVersion(0x0303, "TLSv1.2");
// DTLS 1.0
// {254, 255}, the version value of DTLS 1.0.
- final static ProtocolVersion DTLS10 =
+ static final ProtocolVersion DTLS10 =
new ProtocolVersion(0xFEFF, "DTLSv1.0");
// No DTLS 1.1, that version number was skipped in order to harmonize
@@ -88,30 +88,30 @@
// DTLS 1.2
// {254, 253}, the version value of DTLS 1.2.
- final static ProtocolVersion DTLS12 =
+ static final ProtocolVersion DTLS12 =
new ProtocolVersion(0xFEFD, "DTLSv1.2");
private static final boolean FIPS = SunJSSE.isFIPS();
// minimum version we implement (SSL 3.0)
- final static ProtocolVersion MIN = FIPS ? TLS10 : SSL30;
+ static final ProtocolVersion MIN = FIPS ? TLS10 : SSL30;
// maximum version we implement (TLS 1.2)
- final static ProtocolVersion MAX = TLS12;
+ static final ProtocolVersion MAX = TLS12;
// SSL/TLS ProtocolVersion to use by default (TLS 1.2)
- final static ProtocolVersion DEFAULT_TLS = TLS12;
+ static final ProtocolVersion DEFAULT_TLS = TLS12;
// DTLS ProtocolVersion to use by default (TLS 1.2)
- final static ProtocolVersion DEFAULT_DTLS = DTLS12;
+ static final ProtocolVersion DEFAULT_DTLS = DTLS12;
// Default version for hello messages (SSLv2Hello)
- final static ProtocolVersion DEFAULT_HELLO = FIPS ? TLS10 : SSL30;
+ static final ProtocolVersion DEFAULT_HELLO = FIPS ? TLS10 : SSL30;
// Available protocols
//
// Including all supported protocols except the disabled ones.
- final static Set<ProtocolVersion> availableProtocols;
+ static final Set<ProtocolVersion> availableProtocols;
// version in 16 bit MSB format as it appears in records and
// messages, i.e. 0x0301 for TLS 1.0
--- a/jdk/src/java.base/share/classes/sun/security/ssl/SSLAlgorithmConstraints.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/ssl/SSLAlgorithmConstraints.java Fri Sep 25 12:04:35 2015 -0700
@@ -47,11 +47,11 @@
*/
final class SSLAlgorithmConstraints implements AlgorithmConstraints {
- private final static AlgorithmConstraints tlsDisabledAlgConstraints =
+ private static final AlgorithmConstraints tlsDisabledAlgConstraints =
new DisabledAlgorithmConstraints(PROPERTY_TLS_DISABLED_ALGS,
new SSLAlgorithmDecomposer());
- private final static AlgorithmConstraints x509DisabledAlgConstraints =
+ private static final AlgorithmConstraints x509DisabledAlgConstraints =
new DisabledAlgorithmConstraints(PROPERTY_CERTPATH_DISABLED_ALGS,
new SSLAlgorithmDecomposer(true));
@@ -61,11 +61,11 @@
private boolean enabledX509DisabledAlgConstraints = true;
// the default algorithm constraints
- final static AlgorithmConstraints DEFAULT =
+ static final AlgorithmConstraints DEFAULT =
new SSLAlgorithmConstraints(null);
// the default SSL only algorithm constraints
- final static AlgorithmConstraints DEFAULT_SSL_ONLY =
+ static final AlgorithmConstraints DEFAULT_SSL_ONLY =
new SSLAlgorithmConstraints((SSLSocket)null, false);
SSLAlgorithmConstraints(AlgorithmConstraints algorithmConstraints) {
@@ -207,7 +207,7 @@
}
- static private class SupportedSignatureAlgorithmConstraints
+ private static class SupportedSignatureAlgorithmConstraints
implements AlgorithmConstraints {
// supported signature algorithms
private String[] supportedAlgorithms;
@@ -255,12 +255,12 @@
}
@Override
- final public boolean permits(Set<CryptoPrimitive> primitives, Key key) {
+ public final boolean permits(Set<CryptoPrimitive> primitives, Key key) {
return true;
}
@Override
- final public boolean permits(Set<CryptoPrimitive> primitives,
+ public final boolean permits(Set<CryptoPrimitive> primitives,
String algorithm, Key key, AlgorithmParameters parameters) {
if (algorithm == null || algorithm.length() == 0) {
--- a/jdk/src/java.base/share/classes/sun/security/ssl/SSLContextImpl.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/ssl/SSLContextImpl.java Fri Sep 25 12:04:35 2015 -0700
@@ -657,7 +657,7 @@
* @see SSLContext
*/
private static class CustomizedSSLProtocols {
- private final static String PROPERTY_NAME = "jdk.tls.client.protocols";
+ private static final String PROPERTY_NAME = "jdk.tls.client.protocols";
static IllegalArgumentException reservedException = null;
static ArrayList<ProtocolVersion>
customizedProtocols = new ArrayList<>();
@@ -1028,7 +1028,7 @@
* @see SSLContext
*/
public static final class DTLS10Context extends AbstractDTLSContext {
- private final static SSLParameters defaultClientSSLParams;
+ private static final SSLParameters defaultClientSSLParams;
static {
// candidates for available protocols
@@ -1053,7 +1053,7 @@
* @see SSLContext
*/
public static final class DTLS12Context extends AbstractDTLSContext {
- private final static SSLParameters defaultClientSSLParams;
+ private static final SSLParameters defaultClientSSLParams;
static {
// candidates for available protocols
@@ -1079,7 +1079,7 @@
* @see SSLContext
*/
private static class CustomizedDTLSContext extends AbstractDTLSContext {
- private final static SSLParameters defaultClientSSLParams;
+ private static final SSLParameters defaultClientSSLParams;
private static IllegalArgumentException reservedException = null;
// Don't want a java.lang.LinkageError for illegal system property.
--- a/jdk/src/java.base/share/classes/sun/security/ssl/SSLEngineImpl.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/ssl/SSLEngineImpl.java Fri Sep 25 12:04:35 2015 -0700
@@ -56,7 +56,7 @@
*
* @author Brad Wetmore
*/
-final public class SSLEngineImpl extends SSLEngine {
+public final class SSLEngineImpl extends SSLEngine {
//
// Fields and global comments
@@ -475,7 +475,7 @@
}
}
- synchronized private void checkTaskThrown() throws SSLException {
+ private synchronized void checkTaskThrown() throws SSLException {
if (handshaker != null) {
handshaker.checkThrown();
}
@@ -489,11 +489,11 @@
* Provides "this" synchronization for connection state.
* Otherwise, you can access it directly.
*/
- synchronized private int getConnectionState() {
+ private synchronized int getConnectionState() {
return connectionState;
}
- synchronized private void setConnectionState(int state) {
+ private synchronized void setConnectionState(int state) {
connectionState = state;
}
@@ -1513,7 +1513,7 @@
}
@Override
- synchronized public void closeOutbound() {
+ public synchronized void closeOutbound() {
/*
* Dump out a close_notify to the remote side
*/
@@ -1569,7 +1569,7 @@
* We do check for truncation attacks.
*/
@Override
- synchronized public void closeInbound() throws SSLException {
+ public synchronized void closeInbound() throws SSLException {
/*
* Currently closes the outbound side as well. The IETF TLS
* working group has expressed the opinion that 1/2 open
@@ -1602,7 +1602,7 @@
* Returns the network inbound data closure state
*/
@Override
- synchronized public boolean isInboundDone() {
+ public synchronized boolean isInboundDone() {
return inboundDone;
}
@@ -1620,12 +1620,12 @@
* entire login session for some user.
*/
@Override
- synchronized public SSLSession getSession() {
+ public synchronized SSLSession getSession() {
return sess;
}
@Override
- synchronized public SSLSession getHandshakeSession() {
+ public synchronized SSLSession getHandshakeSession() {
return handshakeSession;
}
@@ -1642,7 +1642,7 @@
* this <code>SSLEngine</code>.
*/
@Override
- synchronized public Runnable getDelegatedTask() {
+ public synchronized Runnable getDelegatedTask() {
if (handshaker != null) {
return handshaker.getTask();
}
@@ -1882,7 +1882,7 @@
* we will need to wait for the next handshake.
*/
@Override
- synchronized public void setEnableSessionCreation(boolean flag) {
+ public synchronized void setEnableSessionCreation(boolean flag) {
enableSessionCreation = flag;
if ((handshaker != null) && !handshaker.activated()) {
@@ -1895,7 +1895,7 @@
* sessions.
*/
@Override
- synchronized public boolean getEnableSessionCreation() {
+ public synchronized boolean getEnableSessionCreation() {
return enableSessionCreation;
}
@@ -1909,7 +1909,7 @@
* we will need to wait for the next handshake.
*/
@Override
- synchronized public void setNeedClientAuth(boolean flag) {
+ public synchronized void setNeedClientAuth(boolean flag) {
doClientAuth = (flag ?
ClientAuthType.CLIENT_AUTH_REQUIRED :
ClientAuthType.CLIENT_AUTH_NONE);
@@ -1922,7 +1922,7 @@
}
@Override
- synchronized public boolean getNeedClientAuth() {
+ public synchronized boolean getNeedClientAuth() {
return (doClientAuth == ClientAuthType.CLIENT_AUTH_REQUIRED);
}
@@ -1935,7 +1935,7 @@
* we will need to wait for the next handshake.
*/
@Override
- synchronized public void setWantClientAuth(boolean flag) {
+ public synchronized void setWantClientAuth(boolean flag) {
doClientAuth = (flag ?
ClientAuthType.CLIENT_AUTH_REQUESTED :
ClientAuthType.CLIENT_AUTH_NONE);
@@ -1948,7 +1948,7 @@
}
@Override
- synchronized public boolean getWantClientAuth() {
+ public synchronized boolean getWantClientAuth() {
return (doClientAuth == ClientAuthType.CLIENT_AUTH_REQUESTED);
}
@@ -1960,7 +1960,7 @@
*/
@Override
@SuppressWarnings("fallthrough")
- synchronized public void setUseClientMode(boolean flag) {
+ public synchronized void setUseClientMode(boolean flag) {
switch (connectionState) {
case cs_START:
@@ -2040,7 +2040,7 @@
}
@Override
- synchronized public boolean getUseClientMode() {
+ public synchronized boolean getUseClientMode() {
return !roleIsServer;
}
@@ -2070,7 +2070,7 @@
* @param suites Names of all the cipher suites to enable.
*/
@Override
- synchronized public void setEnabledCipherSuites(String[] suites) {
+ public synchronized void setEnabledCipherSuites(String[] suites) {
enabledCipherSuites = new CipherSuiteList(suites);
if ((handshaker != null) && !handshaker.activated()) {
handshaker.setEnabledCipherSuites(enabledCipherSuites);
@@ -2088,7 +2088,7 @@
* @return an array of cipher suite names
*/
@Override
- synchronized public String[] getEnabledCipherSuites() {
+ public synchronized String[] getEnabledCipherSuites() {
return enabledCipherSuites.toStringArray();
}
@@ -2113,7 +2113,7 @@
* named by the parameter is not supported.
*/
@Override
- synchronized public void setEnabledProtocols(String[] protocols) {
+ public synchronized void setEnabledProtocols(String[] protocols) {
enabledProtocols = new ProtocolList(protocols);
if ((handshaker != null) && !handshaker.activated()) {
handshaker.setEnabledProtocols(enabledProtocols);
@@ -2121,7 +2121,7 @@
}
@Override
- synchronized public String[] getEnabledProtocols() {
+ public synchronized String[] getEnabledProtocols() {
return enabledProtocols.toStringArray();
}
@@ -2129,7 +2129,7 @@
* Returns the SSLParameters in effect for this SSLEngine.
*/
@Override
- synchronized public SSLParameters getSSLParameters() {
+ public synchronized SSLParameters getSSLParameters() {
SSLParameters params = super.getSSLParameters();
// the super implementation does not handle the following parameters
@@ -2148,7 +2148,7 @@
* Applies SSLParameters to this engine.
*/
@Override
- synchronized public void setSSLParameters(SSLParameters params) {
+ public synchronized void setSSLParameters(SSLParameters params) {
super.setSSLParameters(params);
// the super implementation does not handle the following parameters
--- a/jdk/src/java.base/share/classes/sun/security/ssl/SSLEngineOutputRecord.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/ssl/SSLEngineOutputRecord.java Fri Sep 25 12:04:35 2015 -0700
@@ -54,7 +54,7 @@
}
@Override
- synchronized public void close() throws IOException {
+ public synchronized void close() throws IOException {
if (!isClosed) {
if (alertMemos != null && !alertMemos.isEmpty()) {
isCloseWaiting = true;
--- a/jdk/src/java.base/share/classes/sun/security/ssl/SSLServerSocketImpl.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/ssl/SSLServerSocketImpl.java Fri Sep 25 12:04:35 2015 -0700
@@ -184,7 +184,7 @@
* that the system defaults are in effect.
*/
@Override
- synchronized public String[] getEnabledCipherSuites() {
+ public synchronized String[] getEnabledCipherSuites() {
return enabledCipherSuites.toStringArray();
}
@@ -196,7 +196,7 @@
* means to accept system defaults.
*/
@Override
- synchronized public void setEnabledCipherSuites(String[] suites) {
+ public synchronized void setEnabledCipherSuites(String[] suites) {
enabledCipherSuites = new CipherSuiteList(suites);
}
@@ -215,12 +215,12 @@
* named by the parameter is not supported.
*/
@Override
- synchronized public void setEnabledProtocols(String[] protocols) {
+ public synchronized void setEnabledProtocols(String[] protocols) {
enabledProtocols = new ProtocolList(protocols);
}
@Override
- synchronized public String[] getEnabledProtocols() {
+ public synchronized String[] getEnabledProtocols() {
return enabledProtocols.toStringArray();
}
@@ -303,7 +303,7 @@
* Returns the SSLParameters in effect for newly accepted connections.
*/
@Override
- synchronized public SSLParameters getSSLParameters() {
+ public synchronized SSLParameters getSSLParameters() {
SSLParameters params = super.getSSLParameters();
// the super implementation does not handle the following parameters
@@ -320,7 +320,7 @@
* Applies SSLParameters to newly accepted connections.
*/
@Override
- synchronized public void setSSLParameters(SSLParameters params) {
+ public synchronized void setSSLParameters(SSLParameters params) {
super.setSSLParameters(params);
// the super implementation does not handle the following parameters
--- a/jdk/src/java.base/share/classes/sun/security/ssl/SSLSessionImpl.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/ssl/SSLSessionImpl.java Fri Sep 25 12:04:35 2015 -0700
@@ -677,7 +677,7 @@
* no connections will be able to rejoin this session.
*/
@Override
- synchronized public void invalidate() {
+ public synchronized void invalidate() {
//
// Can't invalidate the NULL session -- this would be
// attempted when we get a handshaking error on a brand
--- a/jdk/src/java.base/share/classes/sun/security/ssl/SSLSocketFactoryImpl.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/ssl/SSLSocketFactoryImpl.java Fri Sep 25 12:04:35 2015 -0700
@@ -41,7 +41,7 @@
*
* @author David Brownell
*/
-final public class SSLSocketFactoryImpl extends SSLSocketFactory {
+public final class SSLSocketFactoryImpl extends SSLSocketFactory {
private SSLContextImpl context;
--- a/jdk/src/java.base/share/classes/sun/security/ssl/SSLSocketImpl.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/ssl/SSLSocketImpl.java Fri Sep 25 12:04:35 2015 -0700
@@ -64,7 +64,7 @@
*
* @author David Brownell
*/
-final public class SSLSocketImpl extends BaseSSLSocketImpl {
+public final class SSLSocketImpl extends BaseSSLSocketImpl {
/*
* ERROR HANDLING GUIDELINES
@@ -281,9 +281,9 @@
* This is necessary so that processing of close_notify alerts
* from the peer are handled properly.
*/
- final private Object handshakeLock = new Object();
+ private final Object handshakeLock = new Object();
final ReentrantLock writeLock = new ReentrantLock();
- final private Object readLock = new Object();
+ private final Object readLock = new Object();
InputRecord inputRecord;
OutputRecord outputRecord;
@@ -673,11 +673,11 @@
initHandshaker();
}
- synchronized private int getConnectionState() {
+ private synchronized int getConnectionState() {
return connectionState;
}
- synchronized private void setConnectionState(int state) {
+ private synchronized void setConnectionState(int state) {
connectionState = state;
}
@@ -1802,7 +1802,7 @@
* reserved for exceptions like timeout; otherwise, the socket
* will be closed, no further communications could be done.
*/
- synchronized private void handleException(Exception e, boolean resumable)
+ private synchronized void handleException(Exception e, boolean resumable)
throws IOException {
if ((debug != null) && Debug.isOn("ssl")) {
System.out.println(Thread.currentThread().getName() +
@@ -2114,7 +2114,7 @@
// Please NOTE that this method MUST be called before calling to
// SSLSocket.setSSLParameters(). Otherwise, the {@code host} parameter
// may override SNIHostName in the customized server name indication.
- synchronized public void setHost(String host) {
+ public synchronized void setHost(String host) {
this.host = host;
this.serverNames =
Utilities.addToSNIServerNameList(this.serverNames, this.host);
@@ -2126,7 +2126,7 @@
* transit, and will usually have been confidentiality protected.
*/
@Override
- synchronized public InputStream getInputStream() throws IOException {
+ public synchronized InputStream getInputStream() throws IOException {
if (isClosed()) {
throw new SocketException("Socket is closed");
}
@@ -2148,7 +2148,7 @@
* will usually be confidentiality protected.
*/
@Override
- synchronized public OutputStream getOutputStream() throws IOException {
+ public synchronized OutputStream getOutputStream() throws IOException {
if (isClosed()) {
throw new SocketException("Socket is closed");
}
@@ -2192,7 +2192,7 @@
}
@Override
- synchronized public SSLSession getHandshakeSession() {
+ public synchronized SSLSession getHandshakeSession() {
return handshakeSession;
}
@@ -2213,7 +2213,7 @@
* we will need to wait for the next handshake.
*/
@Override
- synchronized public void setEnableSessionCreation(boolean flag) {
+ public synchronized void setEnableSessionCreation(boolean flag) {
enableSessionCreation = flag;
if ((handshaker != null) && !handshaker.activated()) {
@@ -2226,7 +2226,7 @@
* sessions.
*/
@Override
- synchronized public boolean getEnableSessionCreation() {
+ public synchronized boolean getEnableSessionCreation() {
return enableSessionCreation;
}
@@ -2240,7 +2240,7 @@
* we will need to wait for the next handshake.
*/
@Override
- synchronized public void setNeedClientAuth(boolean flag) {
+ public synchronized void setNeedClientAuth(boolean flag) {
doClientAuth = (flag ? ClientAuthType.CLIENT_AUTH_REQUIRED :
ClientAuthType.CLIENT_AUTH_NONE);
@@ -2252,7 +2252,7 @@
}
@Override
- synchronized public boolean getNeedClientAuth() {
+ public synchronized boolean getNeedClientAuth() {
return (doClientAuth == ClientAuthType.CLIENT_AUTH_REQUIRED);
}
@@ -2265,7 +2265,7 @@
* we will need to wait for the next handshake.
*/
@Override
- synchronized public void setWantClientAuth(boolean flag) {
+ public synchronized void setWantClientAuth(boolean flag) {
doClientAuth = (flag ? ClientAuthType.CLIENT_AUTH_REQUESTED :
ClientAuthType.CLIENT_AUTH_NONE);
@@ -2277,7 +2277,7 @@
}
@Override
- synchronized public boolean getWantClientAuth() {
+ public synchronized boolean getWantClientAuth() {
return (doClientAuth == ClientAuthType.CLIENT_AUTH_REQUESTED);
}
@@ -2289,7 +2289,7 @@
*/
@Override
@SuppressWarnings("fallthrough")
- synchronized public void setUseClientMode(boolean flag) {
+ public synchronized void setUseClientMode(boolean flag) {
switch (connectionState) {
case cs_START:
@@ -2363,7 +2363,7 @@
}
@Override
- synchronized public boolean getUseClientMode() {
+ public synchronized boolean getUseClientMode() {
return !roleIsServer;
}
@@ -2393,7 +2393,7 @@
* @param suites Names of all the cipher suites to enable.
*/
@Override
- synchronized public void setEnabledCipherSuites(String[] suites) {
+ public synchronized void setEnabledCipherSuites(String[] suites) {
enabledCipherSuites = new CipherSuiteList(suites);
if ((handshaker != null) && !handshaker.activated()) {
handshaker.setEnabledCipherSuites(enabledCipherSuites);
@@ -2411,7 +2411,7 @@
* @return an array of cipher suite names
*/
@Override
- synchronized public String[] getEnabledCipherSuites() {
+ public synchronized String[] getEnabledCipherSuites() {
return enabledCipherSuites.toStringArray();
}
@@ -2436,7 +2436,7 @@
* named by the parameter is not supported.
*/
@Override
- synchronized public void setEnabledProtocols(String[] protocols) {
+ public synchronized void setEnabledProtocols(String[] protocols) {
enabledProtocols = new ProtocolList(protocols);
if ((handshaker != null) && !handshaker.activated()) {
handshaker.setEnabledProtocols(enabledProtocols);
@@ -2444,7 +2444,7 @@
}
@Override
- synchronized public String[] getEnabledProtocols() {
+ public synchronized String[] getEnabledProtocols() {
return enabledProtocols.toStringArray();
}
@@ -2501,7 +2501,7 @@
* Returns the SSLParameters in effect for this SSLSocket.
*/
@Override
- synchronized public SSLParameters getSSLParameters() {
+ public synchronized SSLParameters getSSLParameters() {
SSLParameters params = super.getSSLParameters();
// the super implementation does not handle the following parameters
@@ -2521,7 +2521,7 @@
* Applies SSLParameters to this socket.
*/
@Override
- synchronized public void setSSLParameters(SSLParameters params) {
+ public synchronized void setSSLParameters(SSLParameters params) {
super.setSSLParameters(params);
// the super implementation does not handle the following parameters
--- a/jdk/src/java.base/share/classes/sun/security/ssl/ServerHandshaker.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/ssl/ServerHandshaker.java Fri Sep 25 12:04:35 2015 -0700
@@ -119,7 +119,7 @@
new SSLAlgorithmDecomposer());
// To switch off the status_request[_v2] extensions
- private final static boolean enableStatusRequestExtension =
+ private static final boolean enableStatusRequestExtension =
Debug.getBooleanProperty(
"jdk.tls.server.enableStatusRequestExtension", false);
private boolean staplingActive = false;
--- a/jdk/src/java.base/share/classes/sun/security/ssl/ServerNameExtension.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/ssl/ServerNameExtension.java Fri Sep 25 12:04:35 2015 -0700
@@ -68,7 +68,7 @@
// For backward compatibility, all future data structures associated with
// new NameTypes MUST begin with a 16-bit length field.
- final static int NAME_HEADER_LENGTH = 3; // NameType: 1 byte
+ static final int NAME_HEADER_LENGTH = 3; // NameType: 1 byte
// Name length: 2 bytes
private Map<Integer, SNIServerName> sniMap;
private int listLength; // ServerNameList length
--- a/jdk/src/java.base/share/classes/sun/security/ssl/SignatureAndHashAlgorithm.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/ssl/SignatureAndHashAlgorithm.java Fri Sep 25 12:04:35 2015 -0700
@@ -65,15 +65,15 @@
final class SignatureAndHashAlgorithm {
// minimum priority for default enabled algorithms
- final static int SUPPORTED_ALG_PRIORITY_MAX_NUM = 0x00F0;
+ static final int SUPPORTED_ALG_PRIORITY_MAX_NUM = 0x00F0;
// performance optimization
- private final static Set<CryptoPrimitive> SIGNATURE_PRIMITIVE_SET =
+ private static final Set<CryptoPrimitive> SIGNATURE_PRIMITIVE_SET =
Collections.unmodifiableSet(EnumSet.of(CryptoPrimitive.SIGNATURE));
// supported pairs of signature and hash algorithm
- private final static Map<Integer, SignatureAndHashAlgorithm> supportedMap;
- private final static Map<Integer, SignatureAndHashAlgorithm> priorityMap;
+ private static final Map<Integer, SignatureAndHashAlgorithm> supportedMap;
+ private static final Map<Integer, SignatureAndHashAlgorithm> priorityMap;
// the hash algorithm
private HashAlgorithm hash;
--- a/jdk/src/java.base/share/classes/sun/security/ssl/StatusRequestType.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/ssl/StatusRequestType.java Fri Sep 25 12:04:35 2015 -0700
@@ -61,6 +61,6 @@
}
// Status request types defined in RFC 6066 and 6961
- final static StatusRequestType OCSP = e(0x01, "ocsp");
- final static StatusRequestType OCSP_MULTI = e(0x02, "ocsp_multi");
+ static final StatusRequestType OCSP = e(0x01, "ocsp");
+ static final StatusRequestType OCSP_MULTI = e(0x02, "ocsp_multi");
}
--- a/jdk/src/java.base/share/classes/sun/security/ssl/SupportedEllipticCurvesExtension.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/ssl/SupportedEllipticCurvesExtension.java Fri Sep 25 12:04:35 2015 -0700
@@ -173,11 +173,11 @@
return null;
}
- private final static int ARBITRARY_PRIME = 0xff01;
- private final static int ARBITRARY_CHAR2 = 0xff02;
+ private static final int ARBITRARY_PRIME = 0xff01;
+ private static final int ARBITRARY_CHAR2 = 0xff02;
// See sun.security.util.NamedCurve for the OIDs
- private final static String[] NAMED_CURVE_OID_TABLE = new String[] {
+ private static final String[] NAMED_CURVE_OID_TABLE = new String[] {
null, // (0) unused
"1.3.132.0.1", // (1) sect163k1, NIST K-163
"1.3.132.0.2", // (2) sect163r1
@@ -206,7 +206,7 @@
"1.3.132.0.35", // (25) secp521r1, NIST P-521
};
- private final static Map<String,Integer> curveIndices;
+ private static final Map<String,Integer> curveIndices;
static {
curveIndices = new HashMap<String,Integer>();
--- a/jdk/src/java.base/share/classes/sun/security/ssl/SupportedEllipticPointFormatsExtension.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/ssl/SupportedEllipticPointFormatsExtension.java Fri Sep 25 12:04:35 2015 -0700
@@ -33,9 +33,9 @@
final class SupportedEllipticPointFormatsExtension extends HelloExtension {
- final static int FMT_UNCOMPRESSED = 0;
- final static int FMT_ANSIX962_COMPRESSED_PRIME = 1;
- final static int FMT_ANSIX962_COMPRESSED_CHAR2 = 2;
+ static final int FMT_UNCOMPRESSED = 0;
+ static final int FMT_ANSIX962_COMPRESSED_PRIME = 1;
+ static final int FMT_ANSIX962_COMPRESSED_CHAR2 = 2;
static final HelloExtension DEFAULT =
new SupportedEllipticPointFormatsExtension(
--- a/jdk/src/java.base/share/classes/sun/security/ssl/X509KeyManagerImpl.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/ssl/X509KeyManagerImpl.java Fri Sep 25 12:04:35 2015 -0700
@@ -62,7 +62,7 @@
private static final Debug debug = Debug.getInstance("ssl");
- private final static boolean useDebug =
+ private static final boolean useDebug =
(debug != null) && Debug.isOn("keymanager");
// for unit testing only, set via privileged reflection
--- a/jdk/src/java.base/share/classes/sun/security/timestamp/TSResponse.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/timestamp/TSResponse.java Fri Sep 25 12:04:35 2015 -0700
@@ -374,7 +374,7 @@
}
}
- final static class TimestampException extends IOException {
+ static final class TimestampException extends IOException {
private static final long serialVersionUID = -1631631794891940953L;
TimestampException(String message) {
--- a/jdk/src/java.base/share/classes/sun/security/util/Cache.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/util/Cache.java Fri Sep 25 12:04:35 2015 -0700
@@ -202,7 +202,7 @@
class NullCache<K,V> extends Cache<K,V> {
- final static Cache<Object,Object> INSTANCE = new NullCache<>();
+ static final Cache<Object,Object> INSTANCE = new NullCache<>();
private NullCache() {
// empty
@@ -244,10 +244,10 @@
class MemoryCache<K,V> extends Cache<K,V> {
- private final static float LOAD_FACTOR = 0.75f;
+ private static final float LOAD_FACTOR = 0.75f;
// XXXX
- private final static boolean DEBUG = false;
+ private static final boolean DEBUG = false;
private final Map<K, CacheEntry<K,V>> cacheMap;
private int maxSize;
--- a/jdk/src/java.base/share/classes/sun/security/util/CurveDB.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/util/CurveDB.java Fri Sep 25 12:04:35 2015 -0700
@@ -40,10 +40,10 @@
* @author Andreas Sterbenz
*/
public class CurveDB {
- private final static int P = 1; // prime curve
- private final static int B = 2; // binary curve
- private final static int PD = 5; // prime curve, mark as default
- private final static int BD = 6; // binary curve, mark as default
+ private static final int P = 1; // prime curve
+ private static final int B = 2; // binary curve
+ private static final int PD = 5; // prime curve, mark as default
+ private static final int BD = 6; // binary curve, mark as default
private static final Map<String,NamedCurve> oidMap =
new LinkedHashMap<String,NamedCurve>();
--- a/jdk/src/java.base/share/classes/sun/security/util/Debug.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/util/Debug.java Fri Sep 25 12:04:35 2015 -0700
@@ -293,7 +293,7 @@
return null;
}
- private final static char[] hexDigits = "0123456789abcdef".toCharArray();
+ private static final char[] hexDigits = "0123456789abcdef".toCharArray();
public static String toString(byte[] b) {
if (b == null) {
--- a/jdk/src/java.base/share/classes/sun/security/util/DerValue.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/util/DerValue.java Fri Sep 25 12:04:35 2015 -0700
@@ -84,52 +84,52 @@
*/
/** Tag value indicating an ASN.1 "BOOLEAN" value. */
- public final static byte tag_Boolean = 0x01;
+ public static final byte tag_Boolean = 0x01;
/** Tag value indicating an ASN.1 "INTEGER" value. */
- public final static byte tag_Integer = 0x02;
+ public static final byte tag_Integer = 0x02;
/** Tag value indicating an ASN.1 "BIT STRING" value. */
- public final static byte tag_BitString = 0x03;
+ public static final byte tag_BitString = 0x03;
/** Tag value indicating an ASN.1 "OCTET STRING" value. */
- public final static byte tag_OctetString = 0x04;
+ public static final byte tag_OctetString = 0x04;
/** Tag value indicating an ASN.1 "NULL" value. */
- public final static byte tag_Null = 0x05;
+ public static final byte tag_Null = 0x05;
/** Tag value indicating an ASN.1 "OBJECT IDENTIFIER" value. */
- public final static byte tag_ObjectId = 0x06;
+ public static final byte tag_ObjectId = 0x06;
/** Tag value including an ASN.1 "ENUMERATED" value */
- public final static byte tag_Enumerated = 0x0A;
+ public static final byte tag_Enumerated = 0x0A;
/** Tag value indicating an ASN.1 "UTF8String" value. */
- public final static byte tag_UTF8String = 0x0C;
+ public static final byte tag_UTF8String = 0x0C;
/** Tag value including a "printable" string */
- public final static byte tag_PrintableString = 0x13;
+ public static final byte tag_PrintableString = 0x13;
/** Tag value including a "teletype" string */
- public final static byte tag_T61String = 0x14;
+ public static final byte tag_T61String = 0x14;
/** Tag value including an ASCII string */
- public final static byte tag_IA5String = 0x16;
+ public static final byte tag_IA5String = 0x16;
/** Tag value indicating an ASN.1 "UTCTime" value. */
- public final static byte tag_UtcTime = 0x17;
+ public static final byte tag_UtcTime = 0x17;
/** Tag value indicating an ASN.1 "GeneralizedTime" value. */
- public final static byte tag_GeneralizedTime = 0x18;
+ public static final byte tag_GeneralizedTime = 0x18;
/** Tag value indicating an ASN.1 "GenerallString" value. */
- public final static byte tag_GeneralString = 0x1B;
+ public static final byte tag_GeneralString = 0x1B;
/** Tag value indicating an ASN.1 "UniversalString" value. */
- public final static byte tag_UniversalString = 0x1C;
+ public static final byte tag_UniversalString = 0x1C;
/** Tag value indicating an ASN.1 "BMPString" value. */
- public final static byte tag_BMPString = 0x1E;
+ public static final byte tag_BMPString = 0x1E;
// CONSTRUCTED seq/set
@@ -137,25 +137,25 @@
* Tag value indicating an ASN.1
* "SEQUENCE" (zero to N elements, order is significant).
*/
- public final static byte tag_Sequence = 0x30;
+ public static final byte tag_Sequence = 0x30;
/**
* Tag value indicating an ASN.1
* "SEQUENCE OF" (one to N elements, order is significant).
*/
- public final static byte tag_SequenceOf = 0x30;
+ public static final byte tag_SequenceOf = 0x30;
/**
* Tag value indicating an ASN.1
* "SET" (zero to N members, order does not matter).
*/
- public final static byte tag_Set = 0x31;
+ public static final byte tag_Set = 0x31;
/**
* Tag value indicating an ASN.1
* "SET OF" (one to N members, order does not matter).
*/
- public final static byte tag_SetOf = 0x31;
+ public static final byte tag_SetOf = 0x31;
/*
* These values are the high order bits for the other kinds of tags.
--- a/jdk/src/java.base/share/classes/sun/security/util/DisabledAlgorithmConstraints.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/util/DisabledAlgorithmConstraints.java Fri Sep 25 12:04:35 2015 -0700
@@ -46,16 +46,16 @@
public class DisabledAlgorithmConstraints extends AbstractAlgorithmConstraints {
// the known security property, jdk.certpath.disabledAlgorithms
- public final static String PROPERTY_CERTPATH_DISABLED_ALGS =
+ public static final String PROPERTY_CERTPATH_DISABLED_ALGS =
"jdk.certpath.disabledAlgorithms";
// the known security property, jdk.tls.disabledAlgorithms
- public final static String PROPERTY_TLS_DISABLED_ALGS =
+ public static final String PROPERTY_TLS_DISABLED_ALGS =
"jdk.tls.disabledAlgorithms";
- private final static Map<String, String[]> disabledAlgorithmsMap =
+ private static final Map<String, String[]> disabledAlgorithmsMap =
new HashMap<>();
- private final static Map<String, KeySizeConstraints> keySizeConstraintsMap =
+ private static final Map<String, KeySizeConstraints> keySizeConstraintsMap =
new HashMap<>();
private final String[] disabledAlgorithms;
@@ -80,7 +80,7 @@
}
@Override
- final public boolean permits(Set<CryptoPrimitive> primitives,
+ public final boolean permits(Set<CryptoPrimitive> primitives,
String algorithm, AlgorithmParameters parameters) {
if (primitives == null || primitives.isEmpty()) {
@@ -92,12 +92,12 @@
}
@Override
- final public boolean permits(Set<CryptoPrimitive> primitives, Key key) {
+ public final boolean permits(Set<CryptoPrimitive> primitives, Key key) {
return checkConstraints(primitives, "", key, null);
}
@Override
- final public boolean permits(Set<CryptoPrimitive> primitives,
+ public final boolean permits(Set<CryptoPrimitive> primitives,
String algorithm, Key key, AlgorithmParameters parameters) {
if (algorithm == null || algorithm.length() == 0) {
--- a/jdk/src/java.base/share/classes/sun/security/util/HostnameChecker.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/util/HostnameChecker.java Fri Sep 25 12:04:35 2015 -0700
@@ -48,18 +48,18 @@
public class HostnameChecker {
// Constant for a HostnameChecker for TLS
- public final static byte TYPE_TLS = 1;
- private final static HostnameChecker INSTANCE_TLS =
+ public static final byte TYPE_TLS = 1;
+ private static final HostnameChecker INSTANCE_TLS =
new HostnameChecker(TYPE_TLS);
// Constant for a HostnameChecker for LDAP
- public final static byte TYPE_LDAP = 2;
- private final static HostnameChecker INSTANCE_LDAP =
+ public static final byte TYPE_LDAP = 2;
+ private static final HostnameChecker INSTANCE_LDAP =
new HostnameChecker(TYPE_LDAP);
// constants for subject alt names of type DNS and IP
- private final static int ALTNAME_DNS = 2;
- private final static int ALTNAME_IP = 7;
+ private static final int ALTNAME_DNS = 2;
+ private static final int ALTNAME_IP = 7;
// the algorithm to follow to perform the check. Currently unused.
private final byte checkType;
--- a/jdk/src/java.base/share/classes/sun/security/util/KeyStoreDelegator.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/util/KeyStoreDelegator.java Fri Sep 25 12:04:35 2015 -0700
@@ -210,62 +210,60 @@
} else {
// First try the primary keystore then try the secondary keystore
- try (InputStream bufferedStream = new BufferedInputStream(stream)) {
- bufferedStream.mark(Integer.MAX_VALUE);
+ InputStream bufferedStream = new BufferedInputStream(stream);
+ bufferedStream.mark(Integer.MAX_VALUE);
+
+ try {
+ keystore = primaryKeyStore.newInstance();
+ type = primaryType;
+ keystore.engineLoad(bufferedStream, password);
+
+ } catch (Exception e) {
+
+ // incorrect password
+ if (e instanceof IOException &&
+ e.getCause() instanceof UnrecoverableKeyException) {
+ throw (IOException)e;
+ }
try {
- keystore = primaryKeyStore.newInstance();
- type = primaryType;
- keystore.engineLoad(bufferedStream, password);
-
- } catch (Exception e) {
-
- // incorrect password
- if (e instanceof IOException &&
- e.getCause() instanceof UnrecoverableKeyException) {
- throw (IOException)e;
+ // Ignore secondary keystore when no compatibility mode
+ if (!compatModeEnabled) {
+ throw e;
}
- try {
- // Ignore secondary keystore when no compatibility mode
- if (!compatModeEnabled) {
- throw e;
- }
+ keystore = secondaryKeyStore.newInstance();
+ type = secondaryType;
+ bufferedStream.reset();
+ keystore.engineLoad(bufferedStream, password);
- keystore = secondaryKeyStore.newInstance();
- type = secondaryType;
- bufferedStream.reset();
- keystore.engineLoad(bufferedStream, password);
+ if (debug != null) {
+ debug.println("WARNING: switching from " +
+ primaryType + " to " + secondaryType +
+ " keystore file format has altered the " +
+ "keystore security level");
+ }
- if (debug != null) {
- debug.println("WARNING: switching from " +
- primaryType + " to " + secondaryType +
- " keystore file format has altered the " +
- "keystore security level");
- }
+ } catch (InstantiationException |
+ IllegalAccessException e2) {
+ // can safely ignore
- } catch (InstantiationException |
- IllegalAccessException e2) {
- // can safely ignore
-
- } catch (IOException |
- NoSuchAlgorithmException |
- CertificateException e3) {
+ } catch (IOException |
+ NoSuchAlgorithmException |
+ CertificateException e3) {
- // incorrect password
- if (e3 instanceof IOException &&
- e3.getCause() instanceof
- UnrecoverableKeyException) {
- throw (IOException)e3;
- }
- // rethrow the outer exception
- if (e instanceof IOException) {
- throw (IOException)e;
- } else if (e instanceof CertificateException) {
- throw (CertificateException)e;
- } else if (e instanceof NoSuchAlgorithmException) {
- throw (NoSuchAlgorithmException)e;
- }
+ // incorrect password
+ if (e3 instanceof IOException &&
+ e3.getCause() instanceof UnrecoverableKeyException) {
+ throw (IOException)e3;
+ }
+ // rethrow the outer exception
+ if (e instanceof IOException) {
+ throw (IOException)e;
+ } else if (e instanceof CertificateException) {
+ throw (CertificateException)e;
+ } else if (e instanceof NoSuchAlgorithmException) {
+ throw (NoSuchAlgorithmException)e;
}
}
}
--- a/jdk/src/java.base/share/classes/sun/security/util/LegacyAlgorithmConstraints.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/util/LegacyAlgorithmConstraints.java Fri Sep 25 12:04:35 2015 -0700
@@ -39,10 +39,10 @@
public class LegacyAlgorithmConstraints extends AbstractAlgorithmConstraints {
// the known security property, jdk.tls.legacyAlgorithms
- public final static String PROPERTY_TLS_LEGACY_ALGS =
+ public static final String PROPERTY_TLS_LEGACY_ALGS =
"jdk.tls.legacyAlgorithms";
- private final static Map<String, String[]> legacyAlgorithmsMap =
+ private static final Map<String, String[]> legacyAlgorithmsMap =
new HashMap<>();
private final String[] legacyAlgorithms;
@@ -54,18 +54,18 @@
}
@Override
- final public boolean permits(Set<CryptoPrimitive> primitives,
+ public final boolean permits(Set<CryptoPrimitive> primitives,
String algorithm, AlgorithmParameters parameters) {
return checkAlgorithm(legacyAlgorithms, algorithm, decomposer);
}
@Override
- final public boolean permits(Set<CryptoPrimitive> primitives, Key key) {
+ public final boolean permits(Set<CryptoPrimitive> primitives, Key key) {
return true;
}
@Override
- final public boolean permits(Set<CryptoPrimitive> primitives,
+ public final boolean permits(Set<CryptoPrimitive> primitives,
String algorithm, Key key, AlgorithmParameters parameters) {
return checkAlgorithm(legacyAlgorithms, algorithm, decomposer);
}
--- a/jdk/src/java.base/share/classes/sun/security/util/ObjectIdentifier.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/util/ObjectIdentifier.java Fri Sep 25 12:04:35 2015 -0700
@@ -50,7 +50,7 @@
* @author Hemma Prafullchandra
*/
-final public
+public final
class ObjectIdentifier implements Serializable
{
/**
@@ -104,7 +104,7 @@
private int componentLen = -1; // how much is used.
// Is the components field calculated?
- transient private boolean componentsCalculated = false;
+ private transient boolean componentsCalculated = false;
private void readObject(ObjectInputStream is)
throws IOException, ClassNotFoundException {
--- a/jdk/src/java.base/share/classes/sun/security/validator/EndEntityChecker.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/validator/EndEntityChecker.java Fri Sep 25 12:04:35 2015 -0700
@@ -68,53 +68,53 @@
// extended key usage OIDs for TLS server, TLS client, code signing
// and any usage
- private final static String OID_EXTENDED_KEY_USAGE =
+ private static final String OID_EXTENDED_KEY_USAGE =
SimpleValidator.OID_EXTENDED_KEY_USAGE;
- private final static String OID_EKU_TLS_SERVER = "1.3.6.1.5.5.7.3.1";
+ private static final String OID_EKU_TLS_SERVER = "1.3.6.1.5.5.7.3.1";
- private final static String OID_EKU_TLS_CLIENT = "1.3.6.1.5.5.7.3.2";
+ private static final String OID_EKU_TLS_CLIENT = "1.3.6.1.5.5.7.3.2";
- private final static String OID_EKU_CODE_SIGNING = "1.3.6.1.5.5.7.3.3";
+ private static final String OID_EKU_CODE_SIGNING = "1.3.6.1.5.5.7.3.3";
- private final static String OID_EKU_TIME_STAMPING = "1.3.6.1.5.5.7.3.8";
+ private static final String OID_EKU_TIME_STAMPING = "1.3.6.1.5.5.7.3.8";
- private final static String OID_EKU_ANY_USAGE = "2.5.29.37.0";
+ private static final String OID_EKU_ANY_USAGE = "2.5.29.37.0";
// the Netscape Server-Gated-Cryptography EKU extension OID
- private final static String OID_EKU_NS_SGC = "2.16.840.1.113730.4.1";
+ private static final String OID_EKU_NS_SGC = "2.16.840.1.113730.4.1";
// the Microsoft Server-Gated-Cryptography EKU extension OID
- private final static String OID_EKU_MS_SGC = "1.3.6.1.4.1.311.10.3.3";
+ private static final String OID_EKU_MS_SGC = "1.3.6.1.4.1.311.10.3.3";
// the recognized extension OIDs
- private final static String OID_SUBJECT_ALT_NAME = "2.5.29.17";
+ private static final String OID_SUBJECT_ALT_NAME = "2.5.29.17";
- private final static String NSCT_SSL_CLIENT =
+ private static final String NSCT_SSL_CLIENT =
NetscapeCertTypeExtension.SSL_CLIENT;
- private final static String NSCT_SSL_SERVER =
+ private static final String NSCT_SSL_SERVER =
NetscapeCertTypeExtension.SSL_SERVER;
- private final static String NSCT_CODE_SIGNING =
+ private static final String NSCT_CODE_SIGNING =
NetscapeCertTypeExtension.OBJECT_SIGNING;
// bit numbers in the key usage extension
- private final static int KU_SIGNATURE = 0;
- private final static int KU_KEY_ENCIPHERMENT = 2;
- private final static int KU_KEY_AGREEMENT = 4;
+ private static final int KU_SIGNATURE = 0;
+ private static final int KU_KEY_ENCIPHERMENT = 2;
+ private static final int KU_KEY_AGREEMENT = 4;
// TLS key exchange algorithms requiring digitalSignature key usage
- private final static Collection<String> KU_SERVER_SIGNATURE =
+ private static final Collection<String> KU_SERVER_SIGNATURE =
Arrays.asList("DHE_DSS", "DHE_RSA", "ECDHE_ECDSA", "ECDHE_RSA",
"RSA_EXPORT", "UNKNOWN");
// TLS key exchange algorithms requiring keyEncipherment key usage
- private final static Collection<String> KU_SERVER_ENCRYPTION =
+ private static final Collection<String> KU_SERVER_ENCRYPTION =
Arrays.asList("RSA");
// TLS key exchange algorithms requiring keyAgreement key usage
- private final static Collection<String> KU_SERVER_KEY_AGREEMENT =
+ private static final Collection<String> KU_SERVER_KEY_AGREEMENT =
Arrays.asList("DH_DSS", "DH_RSA", "ECDH_ECDSA", "ECDH_RSA");
// variant of this end entity cert checker
--- a/jdk/src/java.base/share/classes/sun/security/validator/KeyStores.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/validator/KeyStores.java Fri Sep 25 12:04:35 2015 -0700
@@ -48,10 +48,10 @@
// in the future, all accesses to the system cacerts keystore should
// go through this class. but not right now.
/*
- private final static String javaHome =
+ private static final String javaHome =
(String)AccessController.doPrivileged(new GetPropertyAction("java.home"));
- private final static char SEP = File.separatorChar;
+ private static final char SEP = File.separatorChar;
private static KeyStore caCerts;
@@ -79,7 +79,7 @@
* The file is only opened once per JVM invocation and the contents
* cached subsequently.
*
- public synchronized static KeyStore getCaCerts() throws IOException {
+ public static synchronized KeyStore getCaCerts() throws IOException {
if (caCerts != null) {
return caCerts;
}
--- a/jdk/src/java.base/share/classes/sun/security/validator/PKIXValidator.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/validator/PKIXValidator.java Fri Sep 25 12:04:35 2015 -0700
@@ -56,7 +56,7 @@
* manager. Typically, this will only work if the PKIX implementation
* supports CRL distribution points as we do not manually setup CertStores.
*/
- private final static boolean checkTLSRevocation =
+ private static final boolean checkTLSRevocation =
AccessController.doPrivileged
(new GetBooleanAction("com.sun.net.ssl.checkRevocation"));
--- a/jdk/src/java.base/share/classes/sun/security/validator/SimpleValidator.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/validator/SimpleValidator.java Fri Sep 25 12:04:35 2015 -0700
@@ -59,23 +59,23 @@
// Constants for the OIDs we need
- final static String OID_BASIC_CONSTRAINTS = "2.5.29.19";
+ static final String OID_BASIC_CONSTRAINTS = "2.5.29.19";
- final static String OID_NETSCAPE_CERT_TYPE = "2.16.840.1.113730.1.1";
+ static final String OID_NETSCAPE_CERT_TYPE = "2.16.840.1.113730.1.1";
- final static String OID_KEY_USAGE = "2.5.29.15";
+ static final String OID_KEY_USAGE = "2.5.29.15";
- final static String OID_EXTENDED_KEY_USAGE = "2.5.29.37";
+ static final String OID_EXTENDED_KEY_USAGE = "2.5.29.37";
- final static String OID_EKU_ANY_USAGE = "2.5.29.37.0";
+ static final String OID_EKU_ANY_USAGE = "2.5.29.37.0";
- final static ObjectIdentifier OBJID_NETSCAPE_CERT_TYPE =
+ static final ObjectIdentifier OBJID_NETSCAPE_CERT_TYPE =
NetscapeCertTypeExtension.NetscapeCertType_Id;
- private final static String NSCT_SSL_CA =
+ private static final String NSCT_SSL_CA =
NetscapeCertTypeExtension.SSL_CA;
- private final static String NSCT_CODE_SIGNING_CA =
+ private static final String NSCT_CODE_SIGNING_CA =
NetscapeCertTypeExtension.OBJECT_SIGNING_CA;
/**
--- a/jdk/src/java.base/share/classes/sun/security/validator/Validator.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/validator/Validator.java Fri Sep 25 12:04:35 2015 -0700
@@ -86,62 +86,62 @@
*/
public abstract class Validator {
- final static X509Certificate[] CHAIN0 = {};
+ static final X509Certificate[] CHAIN0 = {};
/**
* Constant for a validator of type Simple.
* @see #getInstance
*/
- public final static String TYPE_SIMPLE = "Simple";
+ public static final String TYPE_SIMPLE = "Simple";
/**
* Constant for a validator of type PKIX.
* @see #getInstance
*/
- public final static String TYPE_PKIX = "PKIX";
+ public static final String TYPE_PKIX = "PKIX";
/**
* Constant for a Generic variant of a validator.
* @see #getInstance
*/
- public final static String VAR_GENERIC = "generic";
+ public static final String VAR_GENERIC = "generic";
/**
* Constant for a Code Signing variant of a validator.
* @see #getInstance
*/
- public final static String VAR_CODE_SIGNING = "code signing";
+ public static final String VAR_CODE_SIGNING = "code signing";
/**
* Constant for a JCE Code Signing variant of a validator.
* @see #getInstance
*/
- public final static String VAR_JCE_SIGNING = "jce signing";
+ public static final String VAR_JCE_SIGNING = "jce signing";
/**
* Constant for a TLS Client variant of a validator.
* @see #getInstance
*/
- public final static String VAR_TLS_CLIENT = "tls client";
+ public static final String VAR_TLS_CLIENT = "tls client";
/**
* Constant for a TLS Server variant of a validator.
* @see #getInstance
*/
- public final static String VAR_TLS_SERVER = "tls server";
+ public static final String VAR_TLS_SERVER = "tls server";
/**
* Constant for a TSA Server variant of a validator.
* @see #getInstance
*/
- public final static String VAR_TSA_SERVER = "tsa server";
+ public static final String VAR_TSA_SERVER = "tsa server";
/**
* Constant for a Code Signing variant of a validator for use by
* the J2SE Plugin/WebStart code.
* @see #getInstance
*/
- public final static String VAR_PLUGIN_CODE_SIGNING = "plugin code signing";
+ public static final String VAR_PLUGIN_CODE_SIGNING = "plugin code signing";
private final String type;
final EndEntityChecker endEntityChecker;
--- a/jdk/src/java.base/share/classes/sun/security/validator/ValidatorException.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/validator/ValidatorException.java Fri Sep 25 12:04:35 2015 -0700
@@ -37,28 +37,28 @@
private static final long serialVersionUID = -2836879718282292155L;
- public final static Object T_NO_TRUST_ANCHOR =
+ public static final Object T_NO_TRUST_ANCHOR =
"No trusted certificate found";
- public final static Object T_EE_EXTENSIONS =
+ public static final Object T_EE_EXTENSIONS =
"End entity certificate extension check failed";
- public final static Object T_CA_EXTENSIONS =
+ public static final Object T_CA_EXTENSIONS =
"CA certificate extension check failed";
- public final static Object T_CERT_EXPIRED =
+ public static final Object T_CERT_EXPIRED =
"Certificate expired";
- public final static Object T_SIGNATURE_ERROR =
+ public static final Object T_SIGNATURE_ERROR =
"Certificate signature validation failed";
- public final static Object T_NAME_CHAINING =
+ public static final Object T_NAME_CHAINING =
"Certificate chaining error";
- public final static Object T_ALGORITHM_DISABLED =
+ public static final Object T_ALGORITHM_DISABLED =
"Certificate signature algorithm disabled";
- public final static Object T_UNTRUSTED_CERT =
+ public static final Object T_UNTRUSTED_CERT =
"Untrusted certificate";
private Object type;
--- a/jdk/src/java.base/share/classes/sun/security/x509/AVA.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/x509/AVA.java Fri Sep 25 12:04:35 2015 -0700
@@ -72,15 +72,15 @@
* DEFAULT format allows both RFC1779 and RFC2253 syntax and
* additional keywords.
*/
- final static int DEFAULT = 1;
+ static final int DEFAULT = 1;
/**
* RFC1779 specifies format according to RFC1779.
*/
- final static int RFC1779 = 2;
+ static final int RFC1779 = 2;
/**
* RFC2253 specifies format according to RFC2253.
*/
- final static int RFC2253 = 3;
+ static final int RFC2253 = 3;
// currently not private, accessed directly from RDN
final ObjectIdentifier oid;
--- a/jdk/src/java.base/share/classes/sun/security/x509/DistributionPoint.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/x509/DistributionPoint.java Fri Sep 25 12:04:35 2015 -0700
@@ -97,14 +97,14 @@
// reason flag bits
// NOTE that these are NOT quite the same as the CRL reason code extension
- public final static int KEY_COMPROMISE = 1;
- public final static int CA_COMPROMISE = 2;
- public final static int AFFILIATION_CHANGED = 3;
- public final static int SUPERSEDED = 4;
- public final static int CESSATION_OF_OPERATION = 5;
- public final static int CERTIFICATE_HOLD = 6;
- public final static int PRIVILEGE_WITHDRAWN = 7;
- public final static int AA_COMPROMISE = 8;
+ public static final int KEY_COMPROMISE = 1;
+ public static final int CA_COMPROMISE = 2;
+ public static final int AFFILIATION_CHANGED = 3;
+ public static final int SUPERSEDED = 4;
+ public static final int CESSATION_OF_OPERATION = 5;
+ public static final int CERTIFICATE_HOLD = 6;
+ public static final int PRIVILEGE_WITHDRAWN = 7;
+ public static final int AA_COMPROMISE = 8;
private static final String[] REASON_STRINGS = {
null,
--- a/jdk/src/java.base/share/classes/sun/security/x509/IPAddressName.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/x509/IPAddressName.java Fri Sep 25 12:04:35 2015 -0700
@@ -183,7 +183,7 @@
* be 32 bytes long, otherwise 16.
* @throws IOException on error
*/
- private final static int MASKSIZE = 16;
+ private static final int MASKSIZE = 16;
private void parseIPv6(String name) throws IOException {
int slashNdx = name.indexOf('/');
--- a/jdk/src/java.base/share/classes/sun/security/x509/OIDMap.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/x509/OIDMap.java Fri Sep 25 12:04:35 2015 -0700
@@ -106,10 +106,10 @@
{ 2, 16, 840, 1, 113730, 1, 1 };
/** Map ObjectIdentifier(oid) -> OIDInfo(info) */
- private final static Map<ObjectIdentifier,OIDInfo> oidMap;
+ private static final Map<ObjectIdentifier,OIDInfo> oidMap;
/** Map String(friendly name) -> OIDInfo(info) */
- private final static Map<String,OIDInfo> nameMap;
+ private static final Map<String,OIDInfo> nameMap;
static {
oidMap = new HashMap<ObjectIdentifier,OIDInfo>();
--- a/jdk/src/java.base/share/classes/sun/security/x509/ReasonFlags.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/x509/ReasonFlags.java Fri Sep 25 12:04:35 2015 -0700
@@ -69,7 +69,7 @@
public static final String PRIVILEGE_WITHDRAWN = "privilege_withdrawn";
public static final String AA_COMPROMISE = "aa_compromise";
- private final static String[] NAMES = {
+ private static final String[] NAMES = {
UNUSED,
KEY_COMPROMISE,
CA_COMPROMISE,
--- a/jdk/src/java.base/share/classes/sun/security/x509/X509CRLEntryImpl.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/x509/X509CRLEntryImpl.java Fri Sep 25 12:04:35 2015 -0700
@@ -76,7 +76,7 @@
private byte[] revokedCert = null;
private X500Principal certIssuer;
- private final static boolean isExplicit = false;
+ private static final boolean isExplicit = false;
private static final long YR_2050 = 2524636800000L;
/**
--- a/jdk/src/java.base/share/classes/sun/security/x509/X509CRLImpl.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/x509/X509CRLImpl.java Fri Sep 25 12:04:35 2015 -0700
@@ -107,7 +107,7 @@
private Map<X509IssuerSerial,X509CRLEntry> revokedMap = new TreeMap<>();
private List<X509CRLEntry> revokedList = new LinkedList<>();
private CRLExtensions extensions = null;
- private final static boolean isExplicit = true;
+ private static final boolean isExplicit = true;
private static final long YR_2050 = 2524636800000L;
private boolean readOnly = false;
@@ -1286,7 +1286,7 @@
/**
* Immutable X.509 Certificate Issuer DN and serial number pair
*/
- private final static class X509IssuerSerial
+ private static final class X509IssuerSerial
implements Comparable<X509IssuerSerial> {
final X500Principal issuer;
final BigInteger serial;
--- a/jdk/src/java.base/share/classes/sun/text/CompactByteArray.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/text/CompactByteArray.java Fri Sep 25 12:04:35 2015 -0700
@@ -212,7 +212,7 @@
* @param len the length to compare.
* The start indices and start+len must be valid.
*/
- final static boolean arrayRegionMatches(byte[] source, int sourceStart,
+ static final boolean arrayRegionMatches(byte[] source, int sourceStart,
byte[] target, int targetStart,
int len)
{
--- a/jdk/src/java.base/share/classes/sun/text/normalizer/Norm2AllModes.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/text/normalizer/Norm2AllModes.java Fri Sep 25 12:04:35 2015 -0700
@@ -98,7 +98,7 @@
// Intermediate class:
// Has NormalizerImpl and does boilerplate argument checking and setup.
- public static abstract class Normalizer2WithImpl extends Normalizer2 {
+ public abstract static class Normalizer2WithImpl extends Normalizer2 {
public Normalizer2WithImpl(NormalizerImpl ni) {
impl=ni;
}
--- a/jdk/src/java.base/share/classes/sun/text/normalizer/NormalizerBase.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/text/normalizer/NormalizerBase.java Fri Sep 25 12:04:35 2015 -0700
@@ -249,7 +249,7 @@
* and any fields or methods should not be called or overridden by users.
* @stable ICU 2.8
*/
- public static abstract class Mode {
+ public abstract static class Mode {
/**
* Sole constructor
--- a/jdk/src/java.base/share/classes/sun/text/normalizer/Trie2.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/text/normalizer/Trie2.java Fri Sep 25 12:04:35 2015 -0700
@@ -193,7 +193,7 @@
* @param codePoint the code point
* @return the value
*/
- abstract public int get(int codePoint);
+ public abstract int get(int codePoint);
/**
* Get the trie value for a UTF-16 code unit.
@@ -230,7 +230,7 @@
* @param c the code point or lead surrogate value.
* @return the value
*/
- abstract public int getFromU16SingleLead(char c);
+ public abstract int getFromU16SingleLead(char c);
/**
* When iterating over the contents of a Trie2, Elements of this type are produced.
--- a/jdk/src/java.base/share/classes/sun/text/normalizer/UBiDiProps.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/text/normalizer/UBiDiProps.java Fri Sep 25 12:04:35 2015 -0700
@@ -108,7 +108,7 @@
}
// implement ICUBinary.Authenticate
- private final static class IsAcceptable implements ICUBinary.Authenticate {
+ private static final class IsAcceptable implements ICUBinary.Authenticate {
public boolean isDataVersionAcceptable(byte version[]) {
return version[0]==2;
}
--- a/jdk/src/java.base/share/classes/sun/text/normalizer/Utility.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/text/normalizer/Utility.java Fri Sep 25 12:04:35 2015 -0700
@@ -61,7 +61,7 @@
}
/* This map must be in ASCENDING ORDER OF THE ESCAPE CODE */
- static private final char[] UNESCAPE_MAP = {
+ private static final char[] UNESCAPE_MAP = {
/*" 0x22, 0x22 */
/*' 0x27, 0x27 */
/*? 0x3F, 0x3F */
@@ -207,7 +207,7 @@
/**
* Supplies a zero-padded hex representation of an integer (without 0x)
*/
- static public String hex(long i, int places) {
+ public static String hex(long i, int places) {
if (i == Long.MIN_VALUE) return "-8000000000000000";
boolean negative = i < 0;
if (negative) {
--- a/jdk/src/java.base/share/classes/sun/util/calendar/CalendarSystem.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/util/calendar/CalendarSystem.java Fri Sep 25 12:04:35 2015 -0700
@@ -76,7 +76,7 @@
/////////////////////// Calendar Factory Methods /////////////////////////
- private volatile static boolean initialized = false;
+ private static volatile boolean initialized = false;
// Map of calendar names and calendar class names
private static ConcurrentMap<String, String> names;
@@ -118,7 +118,7 @@
}
}
- private final static Gregorian GREGORIAN_INSTANCE = new Gregorian();
+ private static final Gregorian GREGORIAN_INSTANCE = new Gregorian();
/**
* Returns the singleton instance of the <code>Gregorian</code>
--- a/jdk/src/java.base/share/classes/sun/util/calendar/ZoneInfo.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/util/calendar/ZoneInfo.java Fri Sep 25 12:04:35 2015 -0700
@@ -170,7 +170,7 @@
/**
* True if the object has been modified after its instantiation.
*/
- transient private boolean dirty = false;
+ private transient boolean dirty = false;
private static final long serialVersionUID = 2653134537216586139L;
--- a/jdk/src/java.base/share/classes/sun/util/calendar/ZoneInfoFile.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/util/calendar/ZoneInfoFile.java Fri Sep 25 12:04:35 2015 -0700
@@ -206,7 +206,7 @@
}
private static String versionId;
- private final static Map<String, ZoneInfo> zones = new ConcurrentHashMap<>();
+ private static final Map<String, ZoneInfo> zones = new ConcurrentHashMap<>();
private static Map<String, String> aliases = new HashMap<>();
private static byte[][] ruleArray;
--- a/jdk/src/java.base/share/classes/sun/util/locale/provider/CalendarDataUtility.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/util/locale/provider/CalendarDataUtility.java Fri Sep 25 12:04:35 2015 -0700
@@ -39,8 +39,8 @@
* @author Naoto Sato
*/
public class CalendarDataUtility {
- public final static String FIRST_DAY_OF_WEEK = "firstDayOfWeek";
- public final static String MINIMAL_DAYS_IN_FIRST_WEEK = "minimalDaysInFirstWeek";
+ public static final String FIRST_DAY_OF_WEEK = "firstDayOfWeek";
+ public static final String MINIMAL_DAYS_IN_FIRST_WEEK = "minimalDaysInFirstWeek";
// No instantiation
private CalendarDataUtility() {
--- a/jdk/src/java.base/share/classes/sun/util/locale/provider/CollationRules.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/util/locale/provider/CollationRules.java Fri Sep 25 12:04:35 2015 -0700
@@ -47,7 +47,7 @@
* @author Helena Shih, Mark Davis
*/
final class CollationRules {
- final static String DEFAULTRULES =
+ static final String DEFAULTRULES =
"" // no FRENCH accent order by default, add in French Delta
// IGNORABLES (up to first < character)
// COMPLETELY IGNORE format characters
--- a/jdk/src/java.base/share/classes/sun/util/logging/PlatformLogger.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/util/logging/PlatformLogger.java Fri Sep 25 12:04:35 2015 -0700
@@ -408,7 +408,7 @@
/**
* Abstract base class for logging support, defining the API and common field.
*/
- private static abstract class LoggerProxy {
+ private abstract static class LoggerProxy {
final String name;
protected LoggerProxy(String name) {
--- a/jdk/src/java.base/share/classes/sun/util/resources/OpenListResourceBundle.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/util/resources/OpenListResourceBundle.java Fri Sep 25 12:04:35 2015 -0700
@@ -118,7 +118,7 @@
/**
* See ListResourceBundle class description.
*/
- abstract protected Object[][] getContents();
+ protected abstract Object[][] getContents();
/**
* Load lookup tables if they haven't been loaded already.
--- a/jdk/src/java.base/share/native/include/jvm.h Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/native/include/jvm.h Fri Sep 25 12:04:35 2015 -0700
@@ -557,48 +557,6 @@
JVM_SupportsCX8(void);
/*
- * jdk.internal.jimage
- */
-
-JNIEXPORT jlong JNICALL
-JVM_ImageOpen(JNIEnv *env, const char *nativePath, jboolean big_endian);
-
-JNIEXPORT void JNICALL
-JVM_ImageClose(JNIEnv *env, jlong id);
-
-JNIEXPORT jlong JNICALL
-JVM_ImageGetIndexAddress(JNIEnv *env, jlong id);
-
-JNIEXPORT jlong JNICALL
-JVM_ImageGetDataAddress(JNIEnv *env,jlong id);
-
-JNIEXPORT jboolean JNICALL
-JVM_ImageRead(JNIEnv *env, jlong id, jlong offset,
- unsigned char* uncompressedAddress, jlong uncompressed_size);
-
-JNIEXPORT jboolean JNICALL
-JVM_ImageReadCompressed(JNIEnv *env, jlong id, jlong offset,
- unsigned char* compressedBuffer, jlong compressed_size,
- unsigned char* uncompressedBuffer, jlong uncompressed_size);
-
-JNIEXPORT const char* JNICALL
-JVM_ImageGetStringBytes(JNIEnv *env, jlong id, jint offset);
-
-JNIEXPORT jlong* JNICALL
-JVM_ImageGetAttributes(JNIEnv *env, jlong* rawAttributes, jlong id, jint offset);
-
-JNIEXPORT jsize JNICALL
-JVM_ImageGetAttributesCount(JNIEnv *env);
-
-JNIEXPORT jlong* JNICALL
-JVM_ImageFindAttributes(JNIEnv *env, jlong* rawAttributes, jbyte* rawBytes, jsize size, jlong id);
-
-JNIEXPORT jint* JNICALL
-JVM_ImageAttributeOffsets(JNIEnv *env, jint* rawOffsets, unsigned int length, jlong id);
-
-JNIEXPORT unsigned int JNICALL
-JVM_ImageAttributeOffsetsLength(JNIEnv *env, jlong id);
-/*
* com.sun.dtrace.jsdt support
*/
--- a/jdk/src/java.base/share/native/libfdlibm/e_pow.c Thu Sep 17 16:53:42 2015 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,320 +0,0 @@
-
-/*
- * Copyright (c) 1998, 2004, Oracle and/or its affiliates. All rights reserved.
- * 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.
- */
-
-/* __ieee754_pow(x,y) return x**y
- *
- * n
- * Method: Let x = 2 * (1+f)
- * 1. Compute and return log2(x) in two pieces:
- * log2(x) = w1 + w2,
- * where w1 has 53-24 = 29 bit trailing zeros.
- * 2. Perform y*log2(x) = n+y' by simulating muti-precision
- * arithmetic, where |y'|<=0.5.
- * 3. Return x**y = 2**n*exp(y'*log2)
- *
- * Special cases:
- * 1. (anything) ** 0 is 1
- * 2. (anything) ** 1 is itself
- * 3. (anything) ** NAN is NAN
- * 4. NAN ** (anything except 0) is NAN
- * 5. +-(|x| > 1) ** +INF is +INF
- * 6. +-(|x| > 1) ** -INF is +0
- * 7. +-(|x| < 1) ** +INF is +0
- * 8. +-(|x| < 1) ** -INF is +INF
- * 9. +-1 ** +-INF is NAN
- * 10. +0 ** (+anything except 0, NAN) is +0
- * 11. -0 ** (+anything except 0, NAN, odd integer) is +0
- * 12. +0 ** (-anything except 0, NAN) is +INF
- * 13. -0 ** (-anything except 0, NAN, odd integer) is +INF
- * 14. -0 ** (odd integer) = -( +0 ** (odd integer) )
- * 15. +INF ** (+anything except 0,NAN) is +INF
- * 16. +INF ** (-anything except 0,NAN) is +0
- * 17. -INF ** (anything) = -0 ** (-anything)
- * 18. (-anything) ** (integer) is (-1)**(integer)*(+anything**integer)
- * 19. (-anything except 0 and inf) ** (non-integer) is NAN
- *
- * Accuracy:
- * pow(x,y) returns x**y nearly rounded. In particular
- * pow(integer,integer)
- * always returns the correct integer provided it is
- * representable.
- *
- * Constants :
- * The hexadecimal values are the intended ones for the following
- * constants. The decimal values may be used, provided that the
- * compiler will convert from decimal to binary accurately enough
- * to produce the hexadecimal values shown.
- */
-
-#include "fdlibm.h"
-
-#ifdef __STDC__
-static const double
-#else
-static double
-#endif
-bp[] = {1.0, 1.5,},
-dp_h[] = { 0.0, 5.84962487220764160156e-01,}, /* 0x3FE2B803, 0x40000000 */
-dp_l[] = { 0.0, 1.35003920212974897128e-08,}, /* 0x3E4CFDEB, 0x43CFD006 */
-zero = 0.0,
-one = 1.0,
-two = 2.0,
-two53 = 9007199254740992.0, /* 0x43400000, 0x00000000 */
-huge = 1.0e300,
-tiny = 1.0e-300,
- /* poly coefs for (3/2)*(log(x)-2s-2/3*s**3 */
-L1 = 5.99999999999994648725e-01, /* 0x3FE33333, 0x33333303 */
-L2 = 4.28571428578550184252e-01, /* 0x3FDB6DB6, 0xDB6FABFF */
-L3 = 3.33333329818377432918e-01, /* 0x3FD55555, 0x518F264D */
-L4 = 2.72728123808534006489e-01, /* 0x3FD17460, 0xA91D4101 */
-L5 = 2.30660745775561754067e-01, /* 0x3FCD864A, 0x93C9DB65 */
-L6 = 2.06975017800338417784e-01, /* 0x3FCA7E28, 0x4A454EEF */
-P1 = 1.66666666666666019037e-01, /* 0x3FC55555, 0x5555553E */
-P2 = -2.77777777770155933842e-03, /* 0xBF66C16C, 0x16BEBD93 */
-P3 = 6.61375632143793436117e-05, /* 0x3F11566A, 0xAF25DE2C */
-P4 = -1.65339022054652515390e-06, /* 0xBEBBBD41, 0xC5D26BF1 */
-P5 = 4.13813679705723846039e-08, /* 0x3E663769, 0x72BEA4D0 */
-lg2 = 6.93147180559945286227e-01, /* 0x3FE62E42, 0xFEFA39EF */
-lg2_h = 6.93147182464599609375e-01, /* 0x3FE62E43, 0x00000000 */
-lg2_l = -1.90465429995776804525e-09, /* 0xBE205C61, 0x0CA86C39 */
-ovt = 8.0085662595372944372e-0017, /* -(1024-log2(ovfl+.5ulp)) */
-cp = 9.61796693925975554329e-01, /* 0x3FEEC709, 0xDC3A03FD =2/(3ln2) */
-cp_h = 9.61796700954437255859e-01, /* 0x3FEEC709, 0xE0000000 =(float)cp */
-cp_l = -7.02846165095275826516e-09, /* 0xBE3E2FE0, 0x145B01F5 =tail of cp_h*/
-ivln2 = 1.44269504088896338700e+00, /* 0x3FF71547, 0x652B82FE =1/ln2 */
-ivln2_h = 1.44269502162933349609e+00, /* 0x3FF71547, 0x60000000 =24b 1/ln2*/
-ivln2_l = 1.92596299112661746887e-08; /* 0x3E54AE0B, 0xF85DDF44 =1/ln2 tail*/
-
-#ifdef __STDC__
- double __ieee754_pow(double x, double y)
-#else
- double __ieee754_pow(x,y)
- double x, y;
-#endif
-{
- double z,ax,z_h,z_l,p_h,p_l;
- double y1,t1,t2,r,s,t,u,v,w;
- int i0,i1,i,j,k,yisint,n;
- int hx,hy,ix,iy;
- unsigned lx,ly;
-
- i0 = ((*(int*)&one)>>29)^1; i1=1-i0;
- hx = __HI(x); lx = __LO(x);
- hy = __HI(y); ly = __LO(y);
- ix = hx&0x7fffffff; iy = hy&0x7fffffff;
-
- /* y==zero: x**0 = 1 */
- if((iy|ly)==0) return one;
-
- /* +-NaN return x+y */
- if(ix > 0x7ff00000 || ((ix==0x7ff00000)&&(lx!=0)) ||
- iy > 0x7ff00000 || ((iy==0x7ff00000)&&(ly!=0)))
- return x+y;
-
- /* determine if y is an odd int when x < 0
- * yisint = 0 ... y is not an integer
- * yisint = 1 ... y is an odd int
- * yisint = 2 ... y is an even int
- */
- yisint = 0;
- if(hx<0) {
- if(iy>=0x43400000) yisint = 2; /* even integer y */
- else if(iy>=0x3ff00000) {
- k = (iy>>20)-0x3ff; /* exponent */
- if(k>20) {
- j = ly>>(52-k);
- if((j<<(52-k))==ly) yisint = 2-(j&1);
- } else if(ly==0) {
- j = iy>>(20-k);
- if((j<<(20-k))==iy) yisint = 2-(j&1);
- }
- }
- }
-
- /* special value of y */
- if(ly==0) {
- if (iy==0x7ff00000) { /* y is +-inf */
- if(((ix-0x3ff00000)|lx)==0)
- return y - y; /* inf**+-1 is NaN */
- else if (ix >= 0x3ff00000)/* (|x|>1)**+-inf = inf,0 */
- return (hy>=0)? y: zero;
- else /* (|x|<1)**-,+inf = inf,0 */
- return (hy<0)?-y: zero;
- }
- if(iy==0x3ff00000) { /* y is +-1 */
- if(hy<0) return one/x; else return x;
- }
- if(hy==0x40000000) return x*x; /* y is 2 */
- if(hy==0x3fe00000) { /* y is 0.5 */
- if(hx>=0) /* x >= +0 */
- return sqrt(x);
- }
- }
-
- ax = fabs(x);
- /* special value of x */
- if(lx==0) {
- if(ix==0x7ff00000||ix==0||ix==0x3ff00000){
- z = ax; /*x is +-0,+-inf,+-1*/
- if(hy<0) z = one/z; /* z = (1/|x|) */
- if(hx<0) {
- if(((ix-0x3ff00000)|yisint)==0) {
- z = (z-z)/(z-z); /* (-1)**non-int is NaN */
- } else if(yisint==1)
- z = -1.0*z; /* (x<0)**odd = -(|x|**odd) */
- }
- return z;
- }
- }
-
- n = (hx>>31)+1;
-
- /* (x<0)**(non-int) is NaN */
- if((n|yisint)==0) return (x-x)/(x-x);
-
- s = one; /* s (sign of result -ve**odd) = -1 else = 1 */
- if((n|(yisint-1))==0) s = -one;/* (-ve)**(odd int) */
-
- /* |y| is huge */
- if(iy>0x41e00000) { /* if |y| > 2**31 */
- if(iy>0x43f00000){ /* if |y| > 2**64, must o/uflow */
- if(ix<=0x3fefffff) return (hy<0)? huge*huge:tiny*tiny;
- if(ix>=0x3ff00000) return (hy>0)? huge*huge:tiny*tiny;
- }
- /* over/underflow if x is not close to one */
- if(ix<0x3fefffff) return (hy<0)? s*huge*huge:s*tiny*tiny;
- if(ix>0x3ff00000) return (hy>0)? s*huge*huge:s*tiny*tiny;
- /* now |1-x| is tiny <= 2**-20, suffice to compute
- log(x) by x-x^2/2+x^3/3-x^4/4 */
- t = ax-one; /* t has 20 trailing zeros */
- w = (t*t)*(0.5-t*(0.3333333333333333333333-t*0.25));
- u = ivln2_h*t; /* ivln2_h has 21 sig. bits */
- v = t*ivln2_l-w*ivln2;
- t1 = u+v;
- __LO(t1) = 0;
- t2 = v-(t1-u);
- } else {
- double ss,s2,s_h,s_l,t_h,t_l;
- n = 0;
- /* take care subnormal number */
- if(ix<0x00100000)
- {ax *= two53; n -= 53; ix = __HI(ax); }
- n += ((ix)>>20)-0x3ff;
- j = ix&0x000fffff;
- /* determine interval */
- ix = j|0x3ff00000; /* normalize ix */
- if(j<=0x3988E) k=0; /* |x|<sqrt(3/2) */
- else if(j<0xBB67A) k=1; /* |x|<sqrt(3) */
- else {k=0;n+=1;ix -= 0x00100000;}
- __HI(ax) = ix;
-
- /* compute ss = s_h+s_l = (x-1)/(x+1) or (x-1.5)/(x+1.5) */
- u = ax-bp[k]; /* bp[0]=1.0, bp[1]=1.5 */
- v = one/(ax+bp[k]);
- ss = u*v;
- s_h = ss;
- __LO(s_h) = 0;
- /* t_h=ax+bp[k] High */
- t_h = zero;
- __HI(t_h)=((ix>>1)|0x20000000)+0x00080000+(k<<18);
- t_l = ax - (t_h-bp[k]);
- s_l = v*((u-s_h*t_h)-s_h*t_l);
- /* compute log(ax) */
- s2 = ss*ss;
- r = s2*s2*(L1+s2*(L2+s2*(L3+s2*(L4+s2*(L5+s2*L6)))));
- r += s_l*(s_h+ss);
- s2 = s_h*s_h;
- t_h = 3.0+s2+r;
- __LO(t_h) = 0;
- t_l = r-((t_h-3.0)-s2);
- /* u+v = ss*(1+...) */
- u = s_h*t_h;
- v = s_l*t_h+t_l*ss;
- /* 2/(3log2)*(ss+...) */
- p_h = u+v;
- __LO(p_h) = 0;
- p_l = v-(p_h-u);
- z_h = cp_h*p_h; /* cp_h+cp_l = 2/(3*log2) */
- z_l = cp_l*p_h+p_l*cp+dp_l[k];
- /* log2(ax) = (ss+..)*2/(3*log2) = n + dp_h + z_h + z_l */
- t = (double)n;
- t1 = (((z_h+z_l)+dp_h[k])+t);
- __LO(t1) = 0;
- t2 = z_l-(((t1-t)-dp_h[k])-z_h);
- }
-
- /* split up y into y1+y2 and compute (y1+y2)*(t1+t2) */
- y1 = y;
- __LO(y1) = 0;
- p_l = (y-y1)*t1+y*t2;
- p_h = y1*t1;
- z = p_l+p_h;
- j = __HI(z);
- i = __LO(z);
- if (j>=0x40900000) { /* z >= 1024 */
- if(((j-0x40900000)|i)!=0) /* if z > 1024 */
- return s*huge*huge; /* overflow */
- else {
- if(p_l+ovt>z-p_h) return s*huge*huge; /* overflow */
- }
- } else if((j&0x7fffffff)>=0x4090cc00 ) { /* z <= -1075 */
- if(((j-0xc090cc00)|i)!=0) /* z < -1075 */
- return s*tiny*tiny; /* underflow */
- else {
- if(p_l<=z-p_h) return s*tiny*tiny; /* underflow */
- }
- }
- /*
- * compute 2**(p_h+p_l)
- */
- i = j&0x7fffffff;
- k = (i>>20)-0x3ff;
- n = 0;
- if(i>0x3fe00000) { /* if |z| > 0.5, set n = [z+0.5] */
- n = j+(0x00100000>>(k+1));
- k = ((n&0x7fffffff)>>20)-0x3ff; /* new k for n */
- t = zero;
- __HI(t) = (n&~(0x000fffff>>k));
- n = ((n&0x000fffff)|0x00100000)>>(20-k);
- if(j<0) n = -n;
- p_h -= t;
- }
- t = p_l+p_h;
- __LO(t) = 0;
- u = t*lg2_h;
- v = (p_l-(t-p_h))*lg2+t*lg2_l;
- z = u+v;
- w = v-(z-u);
- t = z*z;
- t1 = z - t*(P1+t*(P2+t*(P3+t*(P4+t*P5))));
- r = (z*t1)/(t1-two)-(w+z*w);
- z = one-(r-z);
- j = __HI(z);
- j += (n<<20);
- if((j>>20)<=0) z = scalbn(z,n); /* subnormal output */
- else __HI(z) += (n<<20);
- return s*z;
-}
--- a/jdk/src/java.base/share/native/libfdlibm/fdlibm.h Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/native/libfdlibm/fdlibm.h Fri Sep 25 12:04:35 2015 -0700
@@ -133,7 +133,6 @@
extern double log10 __P((double));
extern double modf __P((double, double *));
-extern double pow __P((double, double));
extern double sqrt __P((double));
extern double ceil __P((double));
@@ -187,7 +186,6 @@
extern double __ieee754_exp __P((double));
extern double __ieee754_cosh __P((double));
extern double __ieee754_fmod __P((double,double));
-extern double __ieee754_pow __P((double,double));
extern double __ieee754_log10 __P((double));
extern double __ieee754_sinh __P((double));
extern double __ieee754_hypot __P((double,double));
--- a/jdk/src/java.base/share/native/libfdlibm/w_pow.c Thu Sep 17 16:53:42 2015 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,73 +0,0 @@
-
-
-/*
- * Copyright (c) 1998, 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. 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.
- */
-
-/*
- * wrapper pow(x,y) return x**y
- */
-
-#include "fdlibm.h"
-
-
-#ifdef __STDC__
- double pow(double x, double y) /* wrapper pow */
-#else
- double pow(x,y) /* wrapper pow */
- double x,y;
-#endif
-{
-#ifdef _IEEE_LIBM
- return __ieee754_pow(x,y);
-#else
- double z;
- z=__ieee754_pow(x,y);
- if(_LIB_VERSION == _IEEE_|| isnan(y)) return z;
- if(isnan(x)) {
- if(y==0.0)
- return __kernel_standard(x,y,42); /* pow(NaN,0.0) */
- else
- return z;
- }
- if(x==0.0){
- if(y==0.0)
- return __kernel_standard(x,y,20); /* pow(0.0,0.0) */
- if(finite(y)&&y<0.0)
- return __kernel_standard(x,y,23); /* pow(0.0,negative) */
- return z;
- }
- if(!finite(z)) {
- if(finite(x)&&finite(y)) {
- if(isnan(z))
- return __kernel_standard(x,y,24); /* pow neg**non-int */
- else
- return __kernel_standard(x,y,21); /* pow overflow */
- }
- }
- if(z==0.0&&finite(x)&&finite(y))
- return __kernel_standard(x,y,22); /* pow underflow */
- return z;
-#endif
-}
--- a/jdk/src/java.base/share/native/libjava/Image.c Thu Sep 17 16:53:42 2015 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,189 +0,0 @@
-/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
- * 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 <string.h>
-
-#include "jni.h"
-#include "jvm.h"
-#include "jdk_internal_jimage_ImageNativeSubstrate.h"
-
-JNIEXPORT jlong JNICALL
-Java_jdk_internal_jimage_ImageNativeSubstrate_openImage(JNIEnv *env,
- jclass cls, jstring path, jboolean big_endian) {
- const char *nativePath;
- jlong ret;
-
- nativePath = (*env)->GetStringUTFChars(env, path, NULL);
- ret = JVM_ImageOpen(env, nativePath, big_endian);
- (*env)->ReleaseStringUTFChars(env, path, nativePath);
- return ret;
-}
-
-JNIEXPORT void JNICALL
-Java_jdk_internal_jimage_ImageNativeSubstrate_closeImage(JNIEnv *env,
- jclass cls, jlong id) {
- JVM_ImageClose(env, id);
-}
-
-JNIEXPORT jlong JNICALL
-Java_jdk_internal_jimage_ImageNativeSubstrate_getIndexAddress(JNIEnv *env,
- jclass cls, jlong id) {
- return JVM_ImageGetIndexAddress(env, id);
-}
-
-JNIEXPORT jlong JNICALL
-Java_jdk_internal_jimage_ImageNativeSubstrate_getDataAddress(JNIEnv *env,
- jclass cls, jlong id) {
- return JVM_ImageGetDataAddress(env, id);
-}
-
-JNIEXPORT jboolean JNICALL
-Java_jdk_internal_jimage_ImageNativeSubstrate_read(JNIEnv *env,
- jclass cls, jlong id, jlong offset,
- jobject uncompressedBuffer, jlong uncompressed_size) {
- unsigned char* uncompressedAddress;
-
- uncompressedAddress = (unsigned char*) (*env)->GetDirectBufferAddress(env, uncompressedBuffer);
- if (uncompressedBuffer == NULL) {
- return JNI_FALSE;
- }
- return JVM_ImageRead(env, id, offset, uncompressedAddress, uncompressed_size);
-}
-
-JNIEXPORT jboolean JNICALL
-Java_jdk_internal_jimage_ImageNativeSubstrate_readCompressed(JNIEnv *env,
- jclass cls, jlong id, jlong offset,
- jobject compressedBuffer, jlong compressed_size,
- jobject uncompressedBuffer, jlong uncompressed_size) {
- // Get address of read direct buffer.
- unsigned char* compressedAddress;
- unsigned char* uncompressedAddress;
-
- compressedAddress = (unsigned char*) (*env)->GetDirectBufferAddress(env, compressedBuffer);
- // Get address of decompression direct buffer.
- uncompressedAddress = (unsigned char*) (*env)->GetDirectBufferAddress(env, uncompressedBuffer);
- if (uncompressedBuffer == NULL || compressedBuffer == NULL) {
- return JNI_FALSE;
- }
- return JVM_ImageReadCompressed(env, id, offset, compressedAddress, compressed_size,
- uncompressedAddress, uncompressed_size);
-}
-
-JNIEXPORT jbyteArray JNICALL
-Java_jdk_internal_jimage_ImageNativeSubstrate_getStringBytes(JNIEnv *env,
- jclass cls, jlong id, jint offset) {
- const char* data;
- size_t size;
- jbyteArray byteArray;
- jbyte* rawBytes;
-
- data = JVM_ImageGetStringBytes(env, id, offset);
- // Determine String length.
- size = strlen(data);
- // Allocate byte array.
- byteArray = (*env)->NewByteArray(env, (jsize) size);
- if (byteArray == NULL) {
- return NULL;
- }
- // Get array base address.
- rawBytes = (*env)->GetByteArrayElements(env, byteArray, NULL);
- // Copy bytes from image string table.
- memcpy(rawBytes, data, size);
- // Release byte array base address.
- (*env)->ReleaseByteArrayElements(env, byteArray, rawBytes, 0);
- return byteArray;
-}
-
-JNIEXPORT jlongArray JNICALL
-Java_jdk_internal_jimage_ImageNativeSubstrate_getAttributes(JNIEnv *env,
- jclass cls, jlong id, jint offset) {
- // Allocate a jlong large enough for all location attributes.
- jlongArray attributes;
- jlong* rawAttributes;
- jlong* ret;
-
- attributes = (*env)->NewLongArray(env, JVM_ImageGetAttributesCount(env));
- if (attributes == NULL) {
- return NULL;
- }
- // Get base address for jlong array.
- rawAttributes = (*env)->GetLongArrayElements(env, attributes, NULL);
- ret = JVM_ImageGetAttributes(env, rawAttributes, id, offset);
- // Release jlong array base address.
- (*env)->ReleaseLongArrayElements(env, attributes, rawAttributes, 0);
- return ret == NULL ? NULL : attributes;
-}
-
-JNIEXPORT jlongArray JNICALL
-Java_jdk_internal_jimage_ImageNativeSubstrate_findAttributes(JNIEnv *env,
- jclass cls, jlong id, jbyteArray utf8) {
- // Allocate a jlong large enough for all location attributes.
- jsize count;
- jlongArray attributes;
- jlong* rawAttributes;
- jsize size;
- jbyte* rawBytes;
- jlong* ret;
-
- count = JVM_ImageGetAttributesCount(env);
- attributes = (*env)->NewLongArray(env, JVM_ImageGetAttributesCount(env));
- if (attributes == NULL) {
- return NULL;
- }
- // Get base address for jlong array.
- rawAttributes = (*env)->GetLongArrayElements(env, attributes, NULL);
- size = (*env)->GetArrayLength(env, utf8);
- rawBytes = (*env)->GetByteArrayElements(env, utf8, NULL);
- ret = JVM_ImageFindAttributes(env, rawAttributes, rawBytes, size, id);
- (*env)->ReleaseByteArrayElements(env, utf8, rawBytes, 0);
- // Release jlong array base address.
- (*env)->ReleaseLongArrayElements(env, attributes, rawAttributes, 0);
- return ret == NULL ? NULL : attributes;
-
-}
-
-JNIEXPORT jintArray JNICALL
-Java_jdk_internal_jimage_ImageNativeSubstrate_attributeOffsets(JNIEnv *env,
- jclass cls, jlong id) {
- unsigned int length;
- jintArray offsets;
- jint* rawOffsets;
- jint* ret;
-
- length = JVM_ImageAttributeOffsetsLength(env, id);
- offsets = (*env)->NewIntArray(env, length);
- if (offsets == NULL) {
- return NULL;
- }
- // Get base address of result.
- rawOffsets = (*env)->GetIntArrayElements(env, offsets, NULL);
- ret = JVM_ImageAttributeOffsets(env, rawOffsets, length, id);
- if (length == 0) {
- return NULL;
- }
- // Release result base address.
- (*env)->ReleaseIntArrayElements(env, offsets, rawOffsets, 0);
- return ret == NULL ? NULL : offsets;
-}
--- a/jdk/src/java.base/share/native/libjava/StrictMath.c Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/share/native/libjava/StrictMath.c Fri Sep 25 12:04:35 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1994, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1994, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -101,12 +101,6 @@
}
JNIEXPORT jdouble JNICALL
-Java_java_lang_StrictMath_pow(JNIEnv *env, jclass unused, jdouble d1, jdouble d2)
-{
- return (jdouble) jpow((double)d1, (double)d2);
-}
-
-JNIEXPORT jdouble JNICALL
Java_java_lang_StrictMath_IEEEremainder(JNIEnv *env, jclass unused,
jdouble dividend,
jdouble divisor)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/java.base/share/native/libjimage/ImageNativeSubstrate.cpp Fri Sep 25 12:04:35 2015 -0700
@@ -0,0 +1,598 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * 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 <string.h>
+
+#include "jni.h"
+#include "jni_util.h"
+#include "jdk_util.h"
+#include "endian.hpp"
+#include "imageDecompressor.hpp"
+#include "imageFile.hpp"
+#include "inttypes.hpp"
+#include "jimage.hpp"
+#include "osSupport.hpp"
+
+#include "jdk_internal_jimage_ImageNativeSubstrate.h"
+
+extern bool MemoryMapImage;
+
+// jdk.internal.jimage /////////////////////////////////////////////////////////
+
+// Java entry to open an image file for sharing.
+
+static jlong JIMAGE_Open(JNIEnv *env, const char *nativePath, jboolean big_endian) {
+ // Open image file for reading.
+ ImageFileReader* reader = ImageFileReader::open(nativePath, big_endian != JNI_FALSE);
+ // Return image ID as a jlong.
+ return ImageFileReader::readerToID(reader);
+}
+
+// Java entry for closing a shared image file.
+
+static void JIMAGE_Close(JNIEnv *env, jlong id) {
+ // Convert image ID to image reader structure.
+ ImageFileReader* reader = ImageFileReader::idToReader(id);
+ // If valid reader the close.
+ if (reader != NULL) {
+ ImageFileReader::close(reader);
+ }
+}
+
+// Java entry for accessing the base address of the image index.
+
+static jlong JIMAGE_GetIndexAddress(JNIEnv *env, jlong id) {
+ // Convert image ID to image reader structure.
+ ImageFileReader* reader = ImageFileReader::idToReader(id);
+ // If valid reader return index base address (as jlong) else zero.
+ return reader != NULL ? (jlong) reader->get_index_address() : 0L;
+}
+
+// Java entry for accessing the base address of the image data.
+
+static jlong JIMAGE_GetDataAddress(JNIEnv *env, jlong id) {
+ // Convert image ID to image reader structure.
+ ImageFileReader* reader = ImageFileReader::idToReader(id);
+ // If valid reader return data base address (as jlong) else zero.
+ return MemoryMapImage && reader != NULL ? (jlong) reader->get_data_address() : 0L;
+}
+
+// Java entry for reading an uncompressed resource from the image.
+
+static jboolean JIMAGE_Read(JNIEnv *env, jlong id, jlong offset,
+ unsigned char* uncompressedAddress, jlong uncompressed_size) {
+ // Convert image ID to image reader structure.
+ ImageFileReader* reader = ImageFileReader::idToReader(id);\
+ // If not a valid reader the fail the read.
+ if (reader == NULL) return false;
+ // Get the file offset of resource data.
+ u8 file_offset = reader->get_index_size() + offset;
+ // Check validity of arguments.
+ if (offset < 0 ||
+ uncompressed_size < 0 ||
+ file_offset > reader->file_size() - uncompressed_size) {
+ return false;
+ }
+ // Read file content into buffer.
+ return (jboolean) reader->read_at((u1*) uncompressedAddress, uncompressed_size,
+ file_offset);
+}
+
+// Java entry for reading a compressed resource from the image.
+
+static jboolean JIMAGE_ReadCompressed(JNIEnv *env,
+ jlong id, jlong offset,
+ unsigned char* compressedAddress, jlong compressed_size,
+ unsigned char* uncompressedAddress, jlong uncompressed_size) {
+ // Convert image ID to image reader structure.
+ ImageFileReader* reader = ImageFileReader::idToReader(id);
+ // If not a valid reader the fail the read.
+ if (reader == NULL) return false;
+ // Get the file offset of resource data.
+ u8 file_offset = reader->get_index_size() + offset;
+ // Check validity of arguments.
+ if (offset < 0 ||
+ compressed_size < 0 ||
+ uncompressed_size < 0 ||
+ file_offset > reader->file_size() - compressed_size) {
+ return false;
+ }
+
+ // Read file content into buffer.
+ bool is_read = reader->read_at(compressedAddress, compressed_size,
+ file_offset);
+ // If successfully read then decompress.
+ if (is_read) {
+ const ImageStrings strings = reader->get_strings();
+ ImageDecompressor::decompress_resource(compressedAddress, uncompressedAddress,
+ (u4) uncompressed_size, &strings);
+ }
+ return (jboolean) is_read;
+}
+
+// Java entry for retrieving UTF-8 bytes from image string table.
+
+static const char* JIMAGE_GetStringBytes(JNIEnv *env, jlong id, jint offset) {
+ // Convert image ID to image reader structure.
+ ImageFileReader* reader = ImageFileReader::idToReader(id);
+ // Fail if not valid reader.
+ if (reader == NULL) return NULL;
+ // Manage image string table.
+ ImageStrings strings = reader->get_strings();
+ // Retrieve string adrress from table.
+ const char* data = strings.get(offset);
+ return data;
+}
+
+// Utility function to copy location information into a jlong array.
+// WARNING: This function is experimental and temporary during JDK 9 development
+// cycle. It will not be supported in the eventual JDK 9 release.
+
+static void image_expand_location(JNIEnv *env, jlong* rawAttributes, ImageLocation& location) {
+ // Copy attributes from location.
+ for (int kind = ImageLocation::ATTRIBUTE_END + 1;
+ kind < ImageLocation::ATTRIBUTE_COUNT;
+ kind++) {
+ rawAttributes[kind] = location.get_attribute(kind);
+ }
+}
+
+// Java entry for retrieving location attributes for attribute offset.
+
+static jlong* JIMAGE_GetAttributes(JNIEnv *env, jlong* rawAttributes, jlong id, jint offset) {
+ // Convert image ID to image reader structure.
+ ImageFileReader* reader = ImageFileReader::idToReader(id);
+ // Fail if not valid reader.
+ if (reader == NULL) return NULL;
+ // Retrieve first byte address of resource's location attribute stream.
+ u1* data = reader->get_location_offset_data(offset);
+ // Fail if not valid offset.
+ if (data == NULL) return NULL;
+ // Expand stream into array.
+ ImageLocation location(data);
+ image_expand_location(env, rawAttributes, location);
+ return rawAttributes;
+}
+
+// Java entry for retrieving location attributes count for attribute offset.
+
+static jsize JIMAGE_GetAttributesCount(JNIEnv *env) {
+ return ImageLocation::ATTRIBUTE_COUNT;
+}
+
+// Java entry for retrieving location attributes for named resource.
+
+static jlong* JIMAGE_FindAttributes(JNIEnv *env, jlong* rawAttributes, jbyte* rawBytes, jsize size, jlong id) {
+ // Convert image ID to image reader structure.
+ ImageFileReader* reader = ImageFileReader::idToReader(id);
+ // Fail if not valid reader.
+ if (reader == NULL) return NULL;
+ // Convert byte array to a cstring.
+ char* path = new char[size + 1];
+ memcpy(path, rawBytes, size);
+ path[size] = '\0';
+ // Locate resource location data.
+ ImageLocation location;
+ bool found = reader->find_location(path, location);
+ delete path;
+ // Resource not found.
+ if (!found) return NULL;
+ // Expand stream into array.
+ image_expand_location(env, rawAttributes, location);
+ return rawAttributes;
+}
+
+// Java entry for retrieving all the attribute stream offsets from an image.
+
+static jint* JIMAGE_AttributeOffsets(JNIEnv *env, jint* rawOffsets, unsigned int length, jlong id) {
+ // Convert image ID to image reader structure.
+ ImageFileReader* reader = ImageFileReader::idToReader(id);
+ // Fail if not valid reader.
+ if (reader == NULL) return NULL;
+ // Determine endian for reader.
+ Endian* endian = reader->endian();
+ // Get base address of attribute stream offsets table.
+ u4* offsets_table = reader->offsets_table();
+ // Allocate int array result.
+ // Copy values to result (converting endian.)
+ for (u4 i = 0; i < length; i++) {
+ rawOffsets[i] = endian->get(offsets_table[i]);
+ }
+ return rawOffsets;
+}
+
+// Java entry for retrieving all the attribute stream offsets length from an image.
+
+static unsigned int JIMAGE_AttributeOffsetsLength(JNIEnv *env, jlong id) {
+ // Convert image ID to image reader structure.
+ ImageFileReader* reader = ImageFileReader::idToReader(id);
+ // Fail if not valid reader.
+ if (reader == NULL) return 0;
+ // Get perfect hash table length.
+ u4 length = reader->table_length();
+ return (jint) length;
+}
+
+JNIEXPORT jint JNICALL
+JNI_OnLoad(JavaVM *vm, void *reserved) {
+ JNIEnv *env;
+
+ if (vm->GetEnv((void**) &env, JNI_VERSION_1_2) != JNI_OK) {
+ return JNI_EVERSION; /* JNI version not supported */
+ }
+
+ return JNI_VERSION_1_2;
+}
+
+JNIEXPORT jlong JNICALL
+Java_jdk_internal_jimage_ImageNativeSubstrate_openImage(JNIEnv *env,
+ jclass cls, jstring path, jboolean big_endian) {
+ const char *nativePath;
+ jlong ret;
+
+ nativePath = env->GetStringUTFChars(path, NULL);
+ ret = JIMAGE_Open(env, nativePath, big_endian);
+ env->ReleaseStringUTFChars(path, nativePath);
+ return ret;
+}
+
+JNIEXPORT void JNICALL
+Java_jdk_internal_jimage_ImageNativeSubstrate_closeImage(JNIEnv *env,
+ jclass cls, jlong id) {
+ JIMAGE_Close(env, id);
+}
+
+JNIEXPORT jlong JNICALL
+Java_jdk_internal_jimage_ImageNativeSubstrate_getIndexAddress(JNIEnv *env,
+ jclass cls, jlong id) {
+ return JIMAGE_GetIndexAddress(env, id);
+}
+
+JNIEXPORT jlong JNICALL
+Java_jdk_internal_jimage_ImageNativeSubstrate_getDataAddress(JNIEnv *env,
+ jclass cls, jlong id) {
+ return JIMAGE_GetDataAddress(env, id);
+}
+
+JNIEXPORT jboolean JNICALL
+Java_jdk_internal_jimage_ImageNativeSubstrate_read(JNIEnv *env,
+ jclass cls, jlong id, jlong offset,
+ jobject uncompressedBuffer, jlong uncompressed_size) {
+ unsigned char* uncompressedAddress;
+
+ uncompressedAddress = (unsigned char*) env->GetDirectBufferAddress(uncompressedBuffer);
+ if (uncompressedAddress == NULL) {
+ return JNI_FALSE;
+ }
+ return JIMAGE_Read(env, id, offset, uncompressedAddress, uncompressed_size);
+}
+
+JNIEXPORT jboolean JNICALL
+Java_jdk_internal_jimage_ImageNativeSubstrate_readCompressed(JNIEnv *env,
+ jclass cls, jlong id, jlong offset,
+ jobject compressedBuffer, jlong compressed_size,
+ jobject uncompressedBuffer, jlong uncompressed_size) {
+ // Get address of read direct buffer.
+ unsigned char* compressedAddress;
+ unsigned char* uncompressedAddress;
+
+ compressedAddress = (unsigned char*) env->GetDirectBufferAddress(compressedBuffer);
+ // Get address of decompression direct buffer.
+ uncompressedAddress = (unsigned char*) env->GetDirectBufferAddress(uncompressedBuffer);
+ if (compressedAddress == NULL || uncompressedAddress == NULL) {
+ return JNI_FALSE;
+ }
+ return JIMAGE_ReadCompressed(env, id, offset, compressedAddress, compressed_size,
+ uncompressedAddress, uncompressed_size);
+}
+
+JNIEXPORT jbyteArray JNICALL
+Java_jdk_internal_jimage_ImageNativeSubstrate_getStringBytes(JNIEnv *env,
+ jclass cls, jlong id, jint offset) {
+ const char* data;
+ size_t size;
+ jbyteArray byteArray;
+ jbyte* rawBytes;
+
+ data = JIMAGE_GetStringBytes(env, id, offset);
+ // Determine String length.
+ size = strlen(data);
+ // Allocate byte array.
+ byteArray = env->NewByteArray((jsize) size);
+ if (byteArray == NULL) {
+ return NULL;
+ }
+ // Get array base address.
+ rawBytes = env->GetByteArrayElements(byteArray, NULL);
+ // Copy bytes from image string table.
+ memcpy(rawBytes, data, size);
+ // Release byte array base address.
+ env->ReleaseByteArrayElements(byteArray, rawBytes, 0);
+ return byteArray;
+}
+
+JNIEXPORT jlongArray JNICALL
+Java_jdk_internal_jimage_ImageNativeSubstrate_getAttributes(JNIEnv *env,
+ jclass cls, jlong id, jint offset) {
+ // Allocate a jlong large enough for all location attributes.
+ jlongArray attributes;
+ jlong* rawAttributes;
+ jlong* ret;
+
+ attributes = env->NewLongArray(JIMAGE_GetAttributesCount(env));
+ if (attributes == NULL) {
+ return NULL;
+ }
+ // Get base address for jlong array.
+ rawAttributes = env->GetLongArrayElements(attributes, NULL);
+ ret = JIMAGE_GetAttributes(env, rawAttributes, id, offset);
+ // Release jlong array base address.
+ env->ReleaseLongArrayElements(attributes, rawAttributes, 0);
+ return ret == NULL ? NULL : attributes;
+}
+
+JNIEXPORT jlongArray JNICALL
+Java_jdk_internal_jimage_ImageNativeSubstrate_findAttributes(JNIEnv *env,
+ jclass cls, jlong id, jbyteArray utf8) {
+ // Allocate a jlong large enough for all location attributes.
+ jsize count;
+ jlongArray attributes;
+ jlong* rawAttributes;
+ jsize size;
+ jbyte* rawBytes;
+ jlong* ret;
+
+ count = JIMAGE_GetAttributesCount(env);
+ attributes = env->NewLongArray(JIMAGE_GetAttributesCount(env));
+ if (attributes == NULL) {
+ return NULL;
+ }
+ // Get base address for jlong array.
+ rawAttributes = env->GetLongArrayElements(attributes, NULL);
+ size = env->GetArrayLength(utf8);
+ rawBytes = env->GetByteArrayElements(utf8, NULL);
+ ret = JIMAGE_FindAttributes(env, rawAttributes, rawBytes, size, id);
+ env->ReleaseByteArrayElements(utf8, rawBytes, 0);
+ // Release jlong array base address.
+ env->ReleaseLongArrayElements(attributes, rawAttributes, 0);
+ return ret == NULL ? NULL : attributes;
+
+}
+
+JNIEXPORT jintArray JNICALL
+Java_jdk_internal_jimage_ImageNativeSubstrate_attributeOffsets(JNIEnv *env,
+ jclass cls, jlong id) {
+ unsigned int length;
+ jintArray offsets;
+ jint* rawOffsets;
+ jint* ret;
+
+ length = JIMAGE_AttributeOffsetsLength(env, id);
+ offsets = env->NewIntArray(length);
+ if (offsets == NULL) {
+ return NULL;
+ }
+ // Get base address of result.
+ rawOffsets = env->GetIntArrayElements(offsets, NULL);
+ ret = JIMAGE_AttributeOffsets(env, rawOffsets, length, id);
+ if (length == 0) {
+ return NULL;
+ }
+ // Release result base address.
+ env->ReleaseIntArrayElements(offsets, rawOffsets, 0);
+ return ret == NULL ? NULL : offsets;
+}
+
+/*
+ * Class: jdk_internal_jimage_ImageNativeSubstrate
+ * Method: JIMAGE_open
+ * Signature: (Ljava/lang/String;)J
+ */
+JNIEXPORT jlong JNICALL Java_jdk_internal_jimage_ImageNativeSubstrate_JIMAGE_1Open
+(JNIEnv *env, jclass, jstring path) {
+ const char *nativePath = env->GetStringUTFChars(path, NULL);
+ if (nativePath == NULL)
+ return 0; // Exception already thrown
+ jint error;
+ jlong ret = (jlong) JIMAGE_Open(nativePath, &error);
+ env->ReleaseStringUTFChars(path, nativePath);
+ return ret;
+}
+
+/*
+ * Class: jdk_internal_jimage_ImageNativeSubstrate
+ * Method: JIMAGE_Close
+ * Signature: (J)J
+ */
+JNIEXPORT void JNICALL Java_jdk_internal_jimage_ImageNativeSubstrate_JIMAGE_1Close
+(JNIEnv *env, jclass, jlong jimageHandle) {
+ JIMAGE_Close((JImageFile*) jimageHandle);
+}
+
+/*
+ * Class: jdk_internal_jimage_ImageNativeSubstrate
+ * Method: JIMAGE_FindResource
+ * Signature: (JLjava/lang/String;Ljava/lang/String;Ljava/lang/String;[J)J
+ */
+JNIEXPORT jlong JNICALL Java_jdk_internal_jimage_ImageNativeSubstrate_JIMAGE_1FindResource
+(JNIEnv *env, jclass, jlong jimageHandle, jstring moduleName,
+ jstring version, jstring path, jlongArray output_size) {
+ const char *native_module = NULL;
+ const char *native_version = NULL;
+ const char *native_path = NULL;
+ jlong * native_array = NULL;
+ jlong size = 0;
+ jlong ret = 0;
+
+ do {
+ native_module = env->GetStringUTFChars(moduleName, NULL);
+ if (native_module == NULL)
+ break;
+ native_version = env->GetStringUTFChars(version, NULL);
+ if (native_version == NULL)
+ break;
+ native_path = env->GetStringUTFChars(path, NULL);
+ if (native_path == NULL)
+ break;
+ if (env->GetArrayLength(output_size) < 1)
+ break;
+ // Get base address for jlong array.
+ native_array = env->GetLongArrayElements(output_size, NULL);
+ if (native_array == NULL)
+ break;
+
+ ret = (jlong) JIMAGE_FindResource((JImageFile *) jimageHandle,
+ native_module, native_version, native_path, &size);
+ if (ret != 0)
+ *native_array = size;
+ } while (0);
+
+ if (native_array != NULL)
+ env->ReleaseLongArrayElements(output_size, native_array, 0);
+ if (native_path != NULL)
+ env->ReleaseStringUTFChars(path, native_path);
+ if (native_version != NULL)
+ env->ReleaseStringUTFChars(path, native_version);
+ if (native_module != NULL)
+ env->ReleaseStringUTFChars(path, native_module);
+
+ return ret;
+}
+
+/*
+ * Class: jdk_internal_jimage_ImageNativeSubstrate
+ * Method: JIMAGE_GetResource
+ * Signature: (JJ[BJ)J
+ */
+JNIEXPORT jlong JNICALL Java_jdk_internal_jimage_ImageNativeSubstrate_JIMAGE_1GetResource
+(JNIEnv *env, jclass, jlong jimageHandle, jlong jlocationHandle, jbyteArray buffer, jlong size) {
+ jbyte * native_buffer = NULL;
+ jlong actual_size = 0;
+ do {
+ if (env->GetArrayLength(buffer) < size)
+ break;
+
+ native_buffer = env->GetByteArrayElements(buffer, NULL);
+ if (native_buffer == NULL)
+ break;
+
+ actual_size = JIMAGE_GetResource((JImageFile*) jimageHandle,
+ (JImageLocationRef) jlocationHandle,
+ (char *) native_buffer, size);
+ } while (0);
+ // Release byte array
+ if (native_buffer != NULL)
+ env->ReleaseByteArrayElements(buffer, native_buffer, 0);
+
+ return actual_size;
+}
+
+// Structure passed from iterator to a visitor to accumulate the results
+
+struct VisitorData {
+ JNIEnv *env;
+ int size; // current number of strings
+ int max; // Maximum number of strings
+ jobjectArray array; // String array to store the strings
+};
+
+// Visitor to accumulate fully qualified resource names
+
+static bool resourceVisitor(JImageFile* image,
+ const char* module, const char* version, const char* package,
+ const char* name, const char* extension, void* arg) {
+ struct VisitorData *vdata = (struct VisitorData *) arg;
+ JNIEnv* env = vdata->env;
+ if (vdata->size < vdata->max) {
+ // Store if there is room in the array
+ // Concatenate to get full path
+ char fullpath[IMAGE_MAX_PATH];
+ fullpath[0] = '\0';
+ if (*module != '\0') {
+ strncpy(fullpath, "/", IMAGE_MAX_PATH - 1);
+ strncat(fullpath, module, IMAGE_MAX_PATH - 1);
+ strncat(fullpath, "/", IMAGE_MAX_PATH - 1);
+ }
+ if (*package != '\0') {
+ strncat(fullpath, package, IMAGE_MAX_PATH - 1);
+ strncat(fullpath, "/", IMAGE_MAX_PATH - 1);
+ }
+ strncat(fullpath, name, IMAGE_MAX_PATH - 1);
+ if (*extension != '\0') {
+ strncat(fullpath, ".", IMAGE_MAX_PATH - 1);
+ strncat(fullpath, extension, IMAGE_MAX_PATH - 1);
+ }
+ jobject str = env->NewStringUTF(fullpath);
+ JNU_CHECK_EXCEPTION_RETURN(env, true);
+ env->SetObjectArrayElement(vdata->array, vdata->size, str);
+ JNU_CHECK_EXCEPTION_RETURN(env, true);
+ }
+ vdata->size++; // always count so the total size is returned
+ return true;
+}
+
+/*
+ * Class: jdk_internal_jimage_ImageNativeSubstrate
+ * Method: JIMAGE_Resources
+ * Signature: (J)V
+ */
+JNIEXPORT jint JNICALL Java_jdk_internal_jimage_ImageNativeSubstrate_JIMAGE_1Resources
+(JNIEnv *env, jclass, jlong jimageHandle,
+ jobjectArray outputNames) {
+ struct VisitorData vdata;
+ vdata.env = env;
+ vdata.max = 0;
+ vdata.size = 0;
+ vdata.array = outputNames;
+
+ vdata.max = (outputNames != NULL) ? env->GetArrayLength(outputNames) : 0;
+ JIMAGE_ResourceIterator((JImageFile*) jimageHandle, &resourceVisitor, &vdata);
+ return vdata.size;
+}
+
+/*
+ * Class: jdk_internal_jimage_ImageNativeSubstrate
+ * Method: JIMAGE_PackageToModule
+ * Signature: (JLjava/lang/String;)Ljava/lang/String;
+ */
+JNIEXPORT jstring JNICALL Java_jdk_internal_jimage_ImageNativeSubstrate_JIMAGE_1PackageToModule
+(JNIEnv *env, jclass, jlong jimageHandle, jstring package_name) {
+ const char *native_package = NULL;
+ const char *native_module = NULL;
+ jstring module = NULL;
+
+ native_package = env->GetStringUTFChars(package_name, NULL);
+ JNU_CHECK_EXCEPTION_RETURN(env, NULL);
+
+ native_module = JIMAGE_PackageToModule((JImageFile*) jimageHandle, native_package);
+ if (native_module != NULL) {
+ module = env->NewStringUTF(native_module);
+ }
+ env->ReleaseStringUTFChars(package_name, native_package);
+ return module;
+}
+
+JNIEXPORT void JNICALL JNI_OnUnload(JavaVM *vm, void *reserved) {
+ ImageDecompressor::image_decompressor_close();
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/java.base/share/native/libjimage/endian.cpp Fri Sep 25 12:04:35 2015 -0700
@@ -0,0 +1,102 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * 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 "endian.hpp"
+#include "inttypes.hpp"
+
+// Most modern compilers optimize the bswap routines to native instructions.
+inline static u2 bswap_16(u2 x) {
+ return ((x & 0xFF) << 8) |
+ ((x >> 8) & 0xFF);
+}
+
+inline static u4 bswap_32(u4 x) {
+ return ((x & 0xFF) << 24) |
+ ((x & 0xFF00) << 8) |
+ ((x >> 8) & 0xFF00) |
+ ((x >> 24) & 0xFF);
+}
+
+inline static u8 bswap_64(u8 x) {
+ return (u8)bswap_32((u4)x) << 32 |
+ (u8)bswap_32((u4)(x >> 32));
+}
+
+u2 NativeEndian::get(u2 x) { return x; }
+u4 NativeEndian::get(u4 x) { return x; }
+u8 NativeEndian::get(u8 x) { return x; }
+s2 NativeEndian::get(s2 x) { return x; }
+s4 NativeEndian::get(s4 x) { return x; }
+s8 NativeEndian::get(s8 x) { return x; }
+
+void NativeEndian::set(u2& x, u2 y) { x = y; }
+void NativeEndian::set(u4& x, u4 y) { x = y; }
+void NativeEndian::set(u8& x, u8 y) { x = y; }
+void NativeEndian::set(s2& x, s2 y) { x = y; }
+void NativeEndian::set(s4& x, s4 y) { x = y; }
+void NativeEndian::set(s8& x, s8 y) { x = y; }
+
+NativeEndian NativeEndian::_native;
+
+u2 SwappingEndian::get(u2 x) { return bswap_16(x); }
+u4 SwappingEndian::get(u4 x) { return bswap_32(x); }
+u8 SwappingEndian::get(u8 x) { return bswap_64(x); }
+s2 SwappingEndian::get(s2 x) { return bswap_16(x); }
+s4 SwappingEndian::get(s4 x) { return bswap_32(x); }
+s8 SwappingEndian::get(s8 x) { return bswap_64(x); }
+
+void SwappingEndian::set(u2& x, u2 y) { x = bswap_16(y); }
+void SwappingEndian::set(u4& x, u4 y) { x = bswap_32(y); }
+void SwappingEndian::set(u8& x, u8 y) { x = bswap_64(y); }
+void SwappingEndian::set(s2& x, s2 y) { x = bswap_16(y); }
+void SwappingEndian::set(s4& x, s4 y) { x = bswap_32(y); }
+void SwappingEndian::set(s8& x, s8 y) { x = bswap_64(y); }
+
+SwappingEndian SwappingEndian::_swapping;
+
+Endian* Endian::get_handler(bool big_endian) {
+ // If requesting little endian on a little endian machine or
+ // big endian on a big endian machine use native handler
+ if (big_endian == is_big_endian()) {
+ return NativeEndian::get_native();
+ } else {
+ // Use swapping handler.
+ return SwappingEndian::get_swapping();
+ }
+}
+
+// Return a platform u2 from an array in which Big Endian is applied.
+u2 Endian::get_java(u1* x) {
+ return (u2) (x[0]<<8 | x[1]);
+}
+
+// Add a platform u2 to the array as a Big Endian u2
+void Endian::set_java(u1* p, u2 x) {
+ p[0] = (x >> 8) & 0xff;
+ p[1] = x & 0xff;
+}
+
+Endian* Endian::get_native_handler() {
+ return NativeEndian::get_native();
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/java.base/share/native/libjimage/endian.hpp Fri Sep 25 12:04:35 2015 -0700
@@ -0,0 +1,124 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * 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.
+ *
+ */
+
+#ifndef LIBJIMAGE_ENDIAN_HPP
+#define LIBJIMAGE_ENDIAN_HPP
+
+#include "inttypes.hpp"
+
+// Selectable endian handling. Endian handlers are used when accessing values
+// that are of unknown (until runtime) endian. The only requirement of the values
+// accessed are that they are aligned to proper size boundaries (no misalignment.)
+// To select an endian handler, one should call Endian::get_handler(big_endian);
+// Where big_endian is true if big endian is required and false otherwise. The
+// native endian handler can be fetched with Endian::get_native_handler();
+// To retrieve a value using the approprate endian, use one of the overloaded
+// calls to get. To set a value, then use one of the overloaded set calls.
+// Ex.
+// s4 value; // Imported value;
+// ...
+// Endian* endian = Endian::get_handler(true); // Use big endian
+// s4 corrected = endian->get(value);
+// endian->set(value, 1);
+//
+class Endian {
+public:
+ virtual u2 get(u2 x) = 0;
+ virtual u4 get(u4 x) = 0;
+ virtual u8 get(u8 x) = 0;
+ virtual s2 get(s2 x) = 0;
+ virtual s4 get(s4 x) = 0;
+ virtual s8 get(s8 x) = 0;
+
+ virtual void set(u2& x, u2 y) = 0;
+ virtual void set(u4& x, u4 y) = 0;
+ virtual void set(u8& x, u8 y) = 0;
+ virtual void set(s2& x, s2 y) = 0;
+ virtual void set(s4& x, s4 y) = 0;
+ virtual void set(s8& x, s8 y) = 0;
+
+ // Quick little endian test.
+ static bool is_little_endian() { u4 x = 1; return *(u1 *)&x != 0; }
+
+ // Quick big endian test.
+ static bool is_big_endian() { return !is_little_endian(); }
+
+ // Select an appropriate endian handler.
+ static Endian* get_handler(bool big_endian);
+
+ // Return the native endian handler.
+ static Endian* get_native_handler();
+
+ // get platform u2 from Java Big endian
+ static u2 get_java(u1* x);
+ // set platform u2 to Java Big endian
+ static void set_java(u1* p, u2 x);
+};
+
+// Normal endian handling.
+class NativeEndian : public Endian {
+private:
+ static NativeEndian _native;
+
+public:
+ u2 get(u2 x);
+ u4 get(u4 x);
+ u8 get(u8 x);
+ s2 get(s2 x);
+ s4 get(s4 x);
+ s8 get(s8 x);
+
+ void set(u2& x, u2 y);
+ void set(u4& x, u4 y);
+ void set(u8& x, u8 y);
+ void set(s2& x, s2 y);
+ void set(s4& x, s4 y);
+ void set(s8& x, s8 y);
+
+ static Endian* get_native() { return &_native; }
+};
+
+// Swapping endian handling.
+class SwappingEndian : public Endian {
+private:
+ static SwappingEndian _swapping;
+
+public:
+ u2 get(u2 x);
+ u4 get(u4 x);
+ u8 get(u8 x);
+ s2 get(s2 x);
+ s4 get(s4 x);
+ s8 get(s8 x);
+
+ void set(u2& x, u2 y);
+ void set(u4& x, u4 y);
+ void set(u8& x, u8 y);
+ void set(s2& x, s2 y);
+ void set(s4& x, s4 y);
+ void set(s8& x, s8 y);
+
+ static Endian* get_swapping() { return &_swapping; }
+};
+#endif // LIBJIMAGE_ENDIAN_HPP
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/java.base/share/native/libjimage/imageDecompressor.cpp Fri Sep 25 12:04:35 2015 -0700
@@ -0,0 +1,332 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * 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 "jni.h"
+#include "imageDecompressor.hpp"
+#include "endian.hpp"
+#ifdef WIN32
+#include <windows.h>
+#else
+#include <dlfcn.h>
+#endif
+
+typedef jboolean (JNICALL *ZipInflateFully_t)(void *inBuf, jlong inLen, void *outBuf, jlong outLen, char **pmsg);
+static ZipInflateFully_t ZipInflateFully = NULL;
+
+#ifndef WIN32
+ #define JNI_LIB_PREFIX "lib"
+ #ifdef __APPLE__
+ #define JNI_LIB_SUFFIX ".dylib"
+ #else
+ #define JNI_LIB_SUFFIX ".so"
+ #endif
+#endif
+
+/**
+ * Return the address of the entry point named in the zip shared library.
+ * @param name - the name of the entry point
+ * @return the address of the entry point or NULL
+ */
+static void* findEntry(const char* name) {
+ void *addr = NULL;
+#ifdef WIN32
+ HMODULE handle = GetModuleHandle("zip.dll");
+ if (handle == NULL) {
+ return NULL;
+ }
+ addr = (void*) GetProcAddress(handle, name);
+ return addr;
+#else
+ addr = dlopen(JNI_LIB_PREFIX "zip" JNI_LIB_SUFFIX, RTLD_GLOBAL|RTLD_LAZY);
+ if (addr == NULL) {
+ return NULL;
+ }
+ addr = dlsym(addr, name);
+ return addr;
+#endif
+}
+
+/*
+ * Initialize the array of decompressors.
+ */
+int ImageDecompressor::_decompressors_num = 0;
+ImageDecompressor** ImageDecompressor::_decompressors = NULL;
+void ImageDecompressor::image_decompressor_init() {
+ if (_decompressors == NULL) {
+ ZipInflateFully = (ZipInflateFully_t) findEntry("ZIP_InflateFully");
+ assert(ZipInflateFully != NULL && "ZIP decompressor not found.");
+ _decompressors_num = 2;
+ _decompressors = new ImageDecompressor*[_decompressors_num];
+ _decompressors[0] = new ZipDecompressor("zip");
+ _decompressors[1] = new SharedStringDecompressor("compact-cp");
+ }
+}
+
+void ImageDecompressor::image_decompressor_close() {
+ delete _decompressors;
+}
+
+/*
+ * Locate decompressor.
+ */
+ImageDecompressor* ImageDecompressor::get_decompressor(const char * decompressor_name) {
+ image_decompressor_init();
+ for (int i = 0; i < _decompressors_num; i++) {
+ ImageDecompressor* decompressor = _decompressors[i];
+ assert(decompressor != NULL && "Decompressors not initialized.");
+ if (strcmp(decompressor->get_name(), decompressor_name) == 0) {
+ return decompressor;
+ }
+ }
+ assert(false && "No decompressor found.");
+ return NULL;
+}
+
+/*
+ * Decompression entry point. Called from ImageFileReader::get_resource.
+ */
+void ImageDecompressor::decompress_resource(u1* compressed, u1* uncompressed,
+ u4 uncompressed_size, const ImageStrings* strings) {
+ bool has_header = false;
+ u1* decompressed_resource = compressed;
+ u1* compressed_resource = compressed;
+
+ // Resource could have been transformed by a stack of decompressors.
+ // Iterate and decompress resources until there is no more header.
+ do {
+ ResourceHeader _header;
+ memcpy(&_header, compressed_resource, sizeof (ResourceHeader));
+ has_header = _header._magic == ResourceHeader::resource_header_magic;
+ if (has_header) {
+ // decompressed_resource array contains the result of decompression
+ decompressed_resource = new u1[_header._uncompressed_size];
+ // Retrieve the decompressor name
+ const char* decompressor_name = strings->get(_header._decompressor_name_offset);
+ assert(decompressor_name && "image decompressor not found");
+ // Retrieve the decompressor instance
+ ImageDecompressor* decompressor = get_decompressor(decompressor_name);
+ assert(decompressor && "image decompressor not found");
+ u1* compressed_resource_base = compressed_resource;
+ compressed_resource += ResourceHeader::resource_header_length;
+ // Ask the decompressor to decompress the compressed content
+ decompressor->decompress_resource(compressed_resource, decompressed_resource,
+ &_header, strings);
+ if (compressed_resource_base != compressed) {
+ delete compressed_resource_base;
+ }
+ compressed_resource = decompressed_resource;
+ }
+ } while (has_header);
+ memcpy(uncompressed, decompressed_resource, uncompressed_size);
+ delete decompressed_resource;
+}
+
+// Zip decompressor
+
+void ZipDecompressor::decompress_resource(u1* data, u1* uncompressed,
+ ResourceHeader* header, const ImageStrings* strings) {
+ char* msg = NULL;
+ jboolean res = ZipDecompressor::decompress(data, header->_size, uncompressed,
+ header->_uncompressed_size, &msg);
+ assert(res && "decompression failed");
+}
+
+jboolean ZipDecompressor::decompress(void *in, u8 inSize, void *out, u8 outSize, char **pmsg) {
+ return (*ZipInflateFully)(in, inSize, out, outSize, pmsg);
+}
+
+// END Zip Decompressor
+
+// Shared String decompressor
+
+// array index is the constant pool tag. value is size.
+// eg: array[5] = 8; means size of long is 8 bytes.
+const u1 SharedStringDecompressor::sizes[] = {0, 0, 0, 4, 4, 8, 8, 2, 2, 4, 4, 4, 4, 0, 0, 3, 2, 0, 4};
+/**
+ * Recreate the class by reconstructing the constant pool.
+ */
+void SharedStringDecompressor::decompress_resource(u1* data,
+ u1* uncompressed_resource,
+ ResourceHeader* header, const ImageStrings* strings) {
+ u1* uncompressed_base = uncompressed_resource;
+ u1* data_base = data;
+ int header_size = 8; // magic + major + minor
+ memcpy(uncompressed_resource, data, header_size + 2); //+ cp count
+ uncompressed_resource += header_size + 2;
+ data += header_size;
+ u2 cp_count = Endian::get_java(data);
+ data += 2;
+ for (int i = 1; i < cp_count; i++) {
+ u1 tag = *data;
+ data += 1;
+ switch (tag) {
+
+ case externalized_string:
+ { // String in Strings table
+ *uncompressed_resource = 1;
+ uncompressed_resource += 1;
+ int i = decompress_int(data);
+ const char * string = strings->get(i);
+ int str_length = (int) strlen(string);
+ Endian::set_java(uncompressed_resource, str_length);
+ uncompressed_resource += 2;
+ memcpy(uncompressed_resource, string, str_length);
+ uncompressed_resource += str_length;
+ break;
+ }
+ // Descriptor String has been split and types added to Strings table
+ case externalized_string_descriptor:
+ {
+ *uncompressed_resource = 1;
+ uncompressed_resource += 1;
+ int descriptor_index = decompress_int(data);
+ int indexes_length = decompress_int(data);
+ u1* length_address = uncompressed_resource;
+ uncompressed_resource += 2;
+ int desc_length = 0;
+ const char * desc_string = strings->get(descriptor_index);
+ if (indexes_length > 0) {
+ u1* indexes_base = data;
+ data += indexes_length;
+ char c = *desc_string;
+ do {
+ *uncompressed_resource = c;
+ uncompressed_resource++;
+ desc_length += 1;
+ /*
+ * Every L character is the marker we are looking at in order
+ * to reconstruct the descriptor. Each time an L is found, then
+ * we retrieve the couple token/token at the current index and
+ * add it to the descriptor.
+ * "(L;I)V" and "java/lang","String" couple of tokens,
+ * this becomes "(Ljava/lang/String;I)V"
+ */
+ if (c == 'L') {
+ int index = decompress_int(indexes_base);
+ const char * pkg = strings->get(index);
+ int str_length = (int) strlen(pkg);
+ // the case where we have a package.
+ // reconstruct the type full name
+ if (str_length > 0) {
+ int len = str_length + 1;
+ char* fullpkg = new char[len];
+ char* pkg_base = fullpkg;
+ memcpy(fullpkg, pkg, str_length);
+ fullpkg += str_length;
+ *fullpkg = '/';
+ memcpy(uncompressed_resource, pkg_base, len);
+ uncompressed_resource += len;
+ delete pkg_base;
+ desc_length += len;
+ } else { // Empty package
+ // Nothing to do.
+ }
+ int classIndex = decompress_int(indexes_base);
+ const char * clazz = strings->get(classIndex);
+ int clazz_length = (int) strlen(clazz);
+ memcpy(uncompressed_resource, clazz, clazz_length);
+ uncompressed_resource += clazz_length;
+ desc_length += clazz_length;
+ }
+ desc_string += 1;
+ c = *desc_string;
+ } while (c != '\0');
+ } else {
+ desc_length = (int) strlen(desc_string);
+ memcpy(uncompressed_resource, desc_string, desc_length);
+ uncompressed_resource += desc_length;
+ }
+ Endian::set_java(length_address, desc_length);
+ break;
+ }
+
+ case constant_utf8:
+ { // UTF-8
+ *uncompressed_resource = tag;
+ uncompressed_resource += 1;
+ u2 str_length = Endian::get_java(data);
+ int len = str_length + 2;
+ memcpy(uncompressed_resource, data, len);
+ uncompressed_resource += len;
+ data += len;
+ break;
+ }
+
+ case constant_long:
+ case constant_double:
+ {
+ i++;
+ }
+ default:
+ {
+ *uncompressed_resource = tag;
+ uncompressed_resource += 1;
+ int size = sizes[tag];
+ memcpy(uncompressed_resource, data, size);
+ uncompressed_resource += size;
+ data += size;
+ }
+ }
+ }
+ u4 remain = header->_size - (int)(data - data_base);
+ u4 computed = (u4)(uncompressed_resource - uncompressed_base) + remain;
+ if (header->_uncompressed_size != computed)
+ printf("Failure, expecting %d but getting %d\n", header->_uncompressed_size,
+ computed);
+ assert(header->_uncompressed_size == computed &&
+ "Constant Pool reconstruction failed");
+ memcpy(uncompressed_resource, data, remain);
+}
+
+/*
+ * Decompress integers. Compressed integers are negative.
+ * If positive, the integer is not decompressed.
+ * If negative, length extracted from the first byte, then reconstruct the integer
+ * from the following bytes.
+ * Example of compression: 1 is compressed on 1 byte: 10100001
+ */
+int SharedStringDecompressor::decompress_int(unsigned char*& value) {
+ int len = 4;
+ int res = 0;
+ char b1 = *value;
+ if (is_compressed((signed char)b1)) { // compressed
+ len = get_compressed_length(b1);
+ char clearedValue = b1 &= 0x1F;
+ if (len == 1) {
+ res = clearedValue;
+ } else {
+ res = (clearedValue & 0xFF) << 8 * (len - 1);
+ for (int i = 1; i < len; i++) {
+ res |= (value[i]&0xFF) << 8 * (len - i - 1);
+ }
+ }
+ } else {
+ res = (value[0] & 0xFF) << 24 | (value[1]&0xFF) << 16 |
+ (value[2]&0xFF) << 8 | (value[3]&0xFF);
+ }
+ value += len;
+ return res;
+}
+// END Shared String decompressor
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/java.base/share/native/libjimage/imageDecompressor.hpp Fri Sep 25 12:04:35 2015 -0700
@@ -0,0 +1,162 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * 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.
+ *
+ */
+
+#ifndef LIBJIMAGE_IMAGEDECOMPRESSOR_HPP
+#define LIBJIMAGE_IMAGEDECOMPRESSOR_HPP
+
+#include <assert.h>
+#include <string.h>
+
+#include "imageFile.hpp"
+#include "inttypes.hpp"
+#include "jni.h"
+
+/*
+ * Compressed resources located in image have an header.
+ * This header contains:
+ * - _magic: A magic u4, required to retrieved the header in the compressed content
+ * - _size: The size of the compressed resource.
+ * - _uncompressed_size: The uncompressed size of the compressed resource.
+ * - _decompressor_name_offset: The ImageDecompressor instance name StringsTable offset.
+ * - _decompressor_config_offset: StringsTable offset of configuration that could be needed by
+ * the decompressor in order to decompress.
+ * - _is_terminal: 1: the compressed content is terminal. Uncompressing it would
+ * create the actual resource. 0: the compressed content is not terminal. Uncompressing it
+ * will result in a compressed content to be decompressed (This occurs when a stack of compressors
+ * have been used to compress the resource.
+ */
+struct ResourceHeader {
+ /* Length of header, needed to retrieve content offset */
+ static const u1 resource_header_length = 21;
+ /* magic bytes that identifies a compressed resource header*/
+ static const u4 resource_header_magic = 0xCAFEFAFA;
+ u4 _magic; // Resource header
+ u4 _size; // Resource size
+ u4 _uncompressed_size; // Expected uncompressed size
+ u4 _decompressor_name_offset; // Strings table decompressor offset
+ u4 _decompressor_config_offset; // Strings table config offset
+ u1 _is_terminal; // Last decompressor 1, otherwise 0.
+};
+
+/*
+ * Resources located in jimage file can be compressed. Compression occurs at
+ * jimage file creation time. When compressed a resource is added an header that
+ * contains the name of the compressor that compressed it.
+ * Various compression strategies can be applied to compress a resource.
+ * The same resource can even be compressed multiple time by a stack of compressors.
+ * At runtime, a resource is decompressed in a loop until there is no more header
+ * meaning that the resource is equivalent to the not compressed resource.
+ * In each iteration, the name of the compressor located in the current header
+ * is used to retrieve the associated instance of ImageDecompressor.
+ * For example “zip” is the name of the compressor that compresses resources
+ * using the zip algorithm. The ZipDecompressor class name is also “zip”.
+ * ImageDecompressor instances are retrieved from a static array in which
+ * they are registered.
+ */
+class ImageDecompressor {
+
+private:
+ const char* _name;
+
+ /*
+ * Array of concrete decompressors. This array is used to retrieve the decompressor
+ * that can handle resource decompression.
+ */
+ static ImageDecompressor** _decompressors;
+ /**
+ * Num of decompressors
+ */
+ static int _decompressors_num;
+ /*
+ * Identifier of a decompressor. This name is the identification key to retrieve
+ * decompressor from a resource header.
+ */
+ inline const char* get_name() const { return _name; }
+
+
+protected:
+ ImageDecompressor(const char* name) : _name(name) {
+ }
+ virtual void decompress_resource(u1* data, u1* uncompressed,
+ ResourceHeader* header, const ImageStrings* strings) = 0;
+
+public:
+ static void image_decompressor_init();
+ static void image_decompressor_close();
+ static ImageDecompressor* get_decompressor(const char * decompressor_name) ;
+ static void decompress_resource(u1* compressed, u1* uncompressed,
+ u4 uncompressed_size, const ImageStrings* strings);
+};
+
+/**
+ * Zip decompressor.
+ */
+class ZipDecompressor : public ImageDecompressor {
+public:
+ ZipDecompressor(const char* sym) : ImageDecompressor(sym) { }
+ void decompress_resource(u1* data, u1* uncompressed, ResourceHeader* header,
+ const ImageStrings* strings);
+ static jboolean decompress(void *in, u8 inSize, void *out, u8 outSize, char **pmsg);
+};
+
+/*
+ * Shared Strings decompressor. This decompressor reconstruct the class
+ * constant pool UTF_U entries by retrieving strings stored in jimage strings table.
+ * In addition, if the UTF_8 entry is a descriptor, the descriptor has to be rebuilt,
+ * all java type having been removed from the descriptor and added to the sting table.
+ * eg: "(Ljava/lang/String;I)V" ==> "(L;I)V" and "java/lang", "String"
+ * stored in string table. offsets to the 2 strings are compressed and stored in the
+ * constantpool entry.
+ */
+class SharedStringDecompressor : public ImageDecompressor {
+private:
+ // the constant pool tag for UTF8 string located in strings table
+ static const int externalized_string = 23;
+ // the constant pool tag for UTF8 descriptors string located in strings table
+ static const int externalized_string_descriptor = 25;
+ // the constant pool tag for UTF8
+ static const int constant_utf8 = 1;
+ // the constant pool tag for long
+ static const int constant_long = 5;
+ // the constant pool tag for double
+ static const int constant_double = 6;
+ // array index is the constant pool tag. value is size.
+ // eg: array[5] = 8; means size of long is 8 bytes.
+ static const u1 sizes[];
+ // bit 5 and 6 are used to store the length of the compressed integer.
+ // size can be 1 (01), 2 (10), 3 (11).
+ // 0x60 ==> 0110000
+ static const int compressed_index_size_mask = 0x60;
+ /*
+ * mask the length bits (5 and 6) and move to the right 5 bits.
+ */
+ inline static int get_compressed_length(char c) { return ((char) (c & compressed_index_size_mask) >> 5); }
+ inline static bool is_compressed(signed char b1) { return b1 < 0; }
+ static int decompress_int(unsigned char*& value);
+public:
+ SharedStringDecompressor(const char* sym) : ImageDecompressor(sym){}
+ void decompress_resource(u1* data, u1* uncompressed, ResourceHeader* header,
+ const ImageStrings* strings);
+};
+#endif // LIBJIMAGE_IMAGEDECOMPRESSOR_HPP
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/java.base/share/native/libjimage/imageFile.cpp Fri Sep 25 12:04:35 2015 -0700
@@ -0,0 +1,682 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * 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 <assert.h>
+#include <string.h>
+#include <stdlib.h>
+
+#include "endian.hpp"
+#include "imageDecompressor.hpp"
+#include "imageFile.hpp"
+#include "inttypes.hpp"
+#include "jni.h"
+#include "osSupport.hpp"
+
+// Map the full jimage, only with 64 bit addressing.
+bool MemoryMapImage = sizeof(void *) == 8;
+
+#ifdef WIN32
+const char FileSeparator = '\\';
+#else
+const char FileSeparator = '/';
+#endif
+
+// Image files are an alternate file format for storing classes and resources. The
+// goal is to supply file access which is faster and smaller than the jar format.
+//
+// (More detailed nodes in the header.)
+//
+
+// Compute the Perfect Hashing hash code for the supplied UTF-8 string.
+s4 ImageStrings::hash_code(const char* string, s4 seed) {
+ // Access bytes as unsigned.
+ u1* bytes = (u1*)string;
+ // Compute hash code.
+ for (u1 byte = *bytes++; byte; byte = *bytes++) {
+ seed = (seed * HASH_MULTIPLIER) ^ byte;
+ }
+ // Ensure the result is not signed.
+ return seed & 0x7FFFFFFF;
+}
+
+// Match up a string in a perfect hash table.
+// Returns the index where the name should be.
+// Result still needs validation for precise match (false positive.)
+s4 ImageStrings::find(Endian* endian, const char* name, s4* redirect, u4 length) {
+ // If the table is empty, then short cut.
+ if (!redirect || !length) {
+ return NOT_FOUND;
+ }
+ // Compute the basic perfect hash for name.
+ s4 hash_code = ImageStrings::hash_code(name);
+ // Modulo table size.
+ s4 index = hash_code % length;
+ // Get redirect entry.
+ // value == 0 then not found
+ // value < 0 then -1 - value is true index
+ // value > 0 then value is seed for recomputing hash.
+ s4 value = endian->get(redirect[index]);
+ // if recompute is required.
+ if (value > 0 ) {
+ // Entry collision value, need to recompute hash.
+ hash_code = ImageStrings::hash_code(name, value);
+ // Modulo table size.
+ return hash_code % length;
+ } else if (value < 0) {
+ // Compute direct index.
+ return -1 - value;
+ }
+ // No entry found.
+ return NOT_FOUND;
+}
+
+// Test to see if UTF-8 string begins with the start UTF-8 string. If so,
+// return non-NULL address of remaining portion of string. Otherwise, return
+// NULL. Used to test sections of a path without copying from image string
+// table.
+const char* ImageStrings::starts_with(const char* string, const char* start) {
+ char ch1, ch2;
+ // Match up the strings the best we can.
+ while ((ch1 = *string) && (ch2 = *start)) {
+ if (ch1 != ch2) {
+ // Mismatch, return NULL.
+ return NULL;
+ }
+ // Next characters.
+ string++, start++;
+ }
+ // Return remainder of string.
+ return string;
+}
+
+// Inflates the attribute stream into individual values stored in the long
+// array _attributes. This allows an attribute value to be quickly accessed by
+// direct indexing. Unspecified values default to zero (from constructor.)
+void ImageLocation::set_data(u1* data) {
+ // Deflate the attribute stream into an array of attributes.
+ u1 byte;
+ // Repeat until end header is found.
+ while ((byte = *data)) {
+ // Extract kind from header byte.
+ u1 kind = attribute_kind(byte);
+ assert(kind < ATTRIBUTE_COUNT && "invalid image location attribute");
+ // Extract length of data (in bytes).
+ u1 n = attribute_length(byte);
+ // Read value (most significant first.)
+ _attributes[kind] = attribute_value(data + 1, n);
+ // Position to next attribute by skipping attribute header and data bytes.
+ data += n + 1;
+ }
+}
+
+// Zero all attribute values.
+void ImageLocation::clear_data() {
+ // Set defaults to zero.
+ memset(_attributes, 0, sizeof(_attributes));
+}
+
+// ImageModuleData constructor maps out sub-tables for faster access.
+ImageModuleData::ImageModuleData(const ImageFileReader* image_file,
+ const char* module_data_name) :
+ _image_file(image_file),
+ _endian(image_file->endian()),
+ _strings(image_file->get_strings()) {
+ // Retrieve the resource containing the module data for the image file.
+ ImageLocation location;
+ bool found = image_file->find_location(module_data_name, location);
+ if (found) {
+ u8 data_size = location.get_attribute(ImageLocation::ATTRIBUTE_UNCOMPRESSED);
+ _data = new u1[(size_t)data_size];
+ _image_file->get_resource(location, _data);
+ // Map out the header.
+ _header = (Header*)_data;
+ // Get the package to module entry count.
+ u4 ptm_count = _header->ptm_count(_endian);
+ // Get the module to package entry count.
+ u4 mtp_count = _header->mtp_count(_endian);
+ // Compute the offset of the package to module perfect hash redirect.
+ u4 ptm_redirect_offset = sizeof(Header);
+ // Compute the offset of the package to module data.
+ u4 ptm_data_offset = ptm_redirect_offset + ptm_count * sizeof(s4);
+ // Compute the offset of the module to package perfect hash redirect.
+ u4 mtp_redirect_offset = ptm_data_offset + ptm_count * sizeof(PTMData);
+ // Compute the offset of the module to package data.
+ u4 mtp_data_offset = mtp_redirect_offset + mtp_count * sizeof(s4);
+ // Compute the offset of the module to package tables.
+ u4 mtp_packages_offset = mtp_data_offset + mtp_count * sizeof(MTPData);
+ // Compute the address of the package to module perfect hash redirect.
+ _ptm_redirect = (s4*)(_data + ptm_redirect_offset);
+ // Compute the address of the package to module data.
+ _ptm_data = (PTMData*)(_data + ptm_data_offset);
+ // Compute the address of the module to package perfect hash redirect.
+ _mtp_redirect = (s4*)(_data + mtp_redirect_offset);
+ // Compute the address of the module to package data.
+ _mtp_data = (MTPData*)(_data + mtp_data_offset);
+ // Compute the address of the module to package tables.
+ _mtp_packages = (s4*)(_data + mtp_packages_offset);
+ } else {
+ // No module data present.
+ _data = NULL;
+ _header = NULL;
+ _ptm_redirect = NULL;
+ _ptm_data = NULL;
+ _mtp_redirect = NULL;
+ _mtp_data = NULL;
+ _mtp_packages = NULL;
+ }
+}
+
+// Release module data resource.
+ImageModuleData::~ImageModuleData() {
+ if (_data) {
+ delete _data;
+ }
+}
+
+// Return the name of the module data resource. Ex. "./lib/modules/file.jimage"
+// yields "file.jdata"
+void ImageModuleData::module_data_name(char* buffer, const char* image_file_name) {
+ // Locate the last slash in the file name path.
+ const char* slash = strrchr(image_file_name, FileSeparator);
+ // Trim the path to name and extension.
+ const char* name = slash ? slash + 1 : (char *)image_file_name;
+ // Locate the extension period.
+ const char* dot = strrchr(name, '.');
+ assert(dot && "missing extension on jimage name");
+ // Trim to only base name.
+ int length = (int)(dot - name);
+ strncpy(buffer, name, length);
+ buffer[length] = '\0';
+ // Append extension.
+ strcat(buffer, ".jdata");
+}
+
+// Return the module in which a package resides. Returns NULL if not found.
+const char* ImageModuleData::package_to_module(const char* package_name) {
+ // Test files may contain no module data.
+ if (_data != NULL) {
+ // Search the package to module table.
+ s4 index = ImageStrings::find(_endian, package_name, _ptm_redirect,
+ _header->ptm_count(_endian));
+ // If entry is found.
+ if (index != ImageStrings::NOT_FOUND) {
+ // Retrieve the package to module entry.
+ PTMData* data = _ptm_data + index;
+ // Verify that it is the correct data.
+ if (strcmp(package_name, get_string(data->name_offset(_endian))) != 0) {
+ return NULL;
+ }
+ // Return the module name.
+ return get_string(data->module_name_offset(_endian));
+ }
+ }
+ return NULL;
+}
+
+// Returns all the package names in a module in a NULL terminated array.
+// Returns NULL if module not found.
+const char** ImageModuleData::module_to_packages(const char* module_name) {
+ // Test files may contain no module data.
+ if (_data != NULL) {
+ // Search the module to package table.
+ s4 index = ImageStrings::find(_endian, module_name, _mtp_redirect,
+ _header->mtp_count(_endian));
+ // If entry is found.
+ if (index != ImageStrings::NOT_FOUND) {
+ // Retrieve the module to package entry.
+ MTPData* data = _mtp_data + index;
+ // Verify that it is the correct data.
+ if (strcmp(module_name, get_string(data->name_offset(_endian))) != 0) {
+ return NULL;
+ }
+ // Construct an array of all the package entries.
+ u4 count = data->package_count(_endian);
+ const char** packages = new const char*[count + 1];
+ s4 package_offset = data->package_offset(_endian);
+ for (u4 i = 0; i < count; i++) {
+ u4 package_name_offset = mtp_package(package_offset + i);
+ const char* package_name = get_string(package_name_offset);
+ packages[i] = package_name;
+ }
+ packages[count] = NULL;
+ return packages;
+ }
+ }
+ return NULL;
+}
+
+// Manage a table of open image files. This table allows multiple access points
+// to share an open image.
+ImageFileReaderTable::ImageFileReaderTable() : _count(0), _max(_growth) {
+ _table = new ImageFileReader*[_max];
+}
+
+ImageFileReaderTable::~ImageFileReaderTable() {
+ delete _table;
+}
+
+// Add a new image entry to the table.
+void ImageFileReaderTable::add(ImageFileReader* image) {
+ if (_count == _max) {
+ _max += _growth;
+ _table = static_cast<ImageFileReader**>(realloc(_table, _max * sizeof(ImageFileReader*)));
+ }
+ _table[_count++] = image;
+}
+
+// Remove an image entry from the table.
+void ImageFileReaderTable::remove(ImageFileReader* image) {
+ s4 last = _count - 1;
+ for (s4 i = 0; _count; i++) {
+ if (_table[i] == image) {
+ if (i != last) {
+ _table[i] = _table[last];
+ _count = last;
+ }
+ break;
+ }
+ }
+
+ if (_count != 0 && _count == _max - _growth) {
+ _max -= _growth;
+ _table = static_cast<ImageFileReader**>(realloc(_table, _max * sizeof(ImageFileReader*)));
+ }
+}
+
+// Determine if image entry is in table.
+bool ImageFileReaderTable::contains(ImageFileReader* image) {
+ for (s4 i = 0; _count; i++) {
+ if (_table[i] == image) {
+ return true;
+ }
+ }
+ return false;
+}
+
+// Table to manage multiple opens of an image file.
+ImageFileReaderTable ImageFileReader::_reader_table;
+
+SimpleCriticalSection _reader_table_lock;
+
+// Open an image file, reuse structure if file already open.
+ImageFileReader* ImageFileReader::open(const char* name, bool big_endian) {
+ {
+ // Lock out _reader_table.
+ SimpleCriticalSectionLock cs(&_reader_table_lock);
+ // Search for an exist image file.
+ for (u4 i = 0; i < _reader_table.count(); i++) {
+ // Retrieve table entry.
+ ImageFileReader* reader = _reader_table.get(i);
+ // If name matches, then reuse (bump up use count.)
+ if (strcmp(reader->name(), name) == 0) {
+ reader->inc_use();
+ return reader;
+ }
+ }
+ } // Unlock the mutex
+
+ // Need a new image reader.
+ ImageFileReader* reader = new ImageFileReader(name, big_endian);
+ bool opened = reader->open();
+ // If failed to open.
+ if (!opened) {
+ delete reader;
+ return NULL;
+ }
+
+ // Lock to update
+ SimpleCriticalSectionLock cs(&_reader_table_lock);
+ // Search for an exist image file.
+ for (u4 i = 0; i < _reader_table.count(); i++) {
+ // Retrieve table entry.
+ ImageFileReader* existing_reader = _reader_table.get(i);
+ // If name matches, then reuse (bump up use count.)
+ if (strcmp(existing_reader->name(), name) == 0) {
+ existing_reader->inc_use();
+ reader->close();
+ delete reader;
+ return existing_reader;
+ }
+ }
+ // Bump use count and add to table.
+ reader->inc_use();
+ _reader_table.add(reader);
+ return reader;
+}
+
+// Close an image file if the file is not in use elsewhere.
+void ImageFileReader::close(ImageFileReader *reader) {
+ // Lock out _reader_table.
+ SimpleCriticalSectionLock cs(&_reader_table_lock);
+ // If last use then remove from table and then close.
+ if (reader->dec_use()) {
+ _reader_table.remove(reader);
+ delete reader;
+ }
+}
+
+// Return an id for the specifed ImageFileReader.
+u8 ImageFileReader::readerToID(ImageFileReader *reader) {
+ // ID is just the cloaked reader address.
+ return (u8)reader;
+}
+
+// Validate the image id.
+bool ImageFileReader::idCheck(u8 id) {
+ // Make sure the ID is a managed (_reader_table) reader.
+ SimpleCriticalSectionLock cs(&_reader_table_lock);
+ return _reader_table.contains((ImageFileReader*)id);
+}
+
+// Return an id for the specifed ImageFileReader.
+ImageFileReader* ImageFileReader::idToReader(u8 id) {
+ assert(idCheck(id) && "invalid image id");
+ return (ImageFileReader*)id;
+}
+
+// Constructor intializes to a closed state.
+ImageFileReader::ImageFileReader(const char* name, bool big_endian) {
+ // Copy the image file name.
+ int len = (int) strlen(name) + 1;
+ _name = new char[len];
+ strncpy(_name, name, len);
+ // Initialize for a closed file.
+ _fd = -1;
+ _endian = Endian::get_handler(big_endian);
+ _index_data = NULL;
+}
+
+// Close image and free up data structures.
+ImageFileReader::~ImageFileReader() {
+ // Ensure file is closed.
+ close();
+ // Free up name.
+ if (_name) {
+ delete _name;
+ _name = NULL;
+ }
+}
+
+// Open image file for read access.
+bool ImageFileReader::open() {
+ char buffer[IMAGE_MAX_PATH];
+
+ // If file exists open for reading.
+ _fd = osSupport::openReadOnly(_name);
+ if (_fd == -1) {
+ return false;
+ }
+ // Retrieve the file size.
+ _file_size = osSupport::size(_name);
+ // Read image file header and verify it has a valid header.
+ size_t header_size = sizeof(ImageHeader);
+ if (_file_size < header_size ||
+ !read_at((u1*)&_header, header_size, 0) ||
+ _header.magic(_endian) != IMAGE_MAGIC ||
+ _header.major_version(_endian) != MAJOR_VERSION ||
+ _header.minor_version(_endian) != MINOR_VERSION) {
+ close();
+ return false;
+ }
+ // Size of image index.
+ _index_size = index_size();
+ // Make sure file is large enough to contain the index.
+ if (_file_size < _index_size) {
+ return false;
+ }
+ // Determine how much of the image is memory mapped.
+ size_t map_size = (size_t)(MemoryMapImage ? _file_size : _index_size);
+ // Memory map image (minimally the index.)
+ _index_data = (u1*)osSupport::map_memory(_fd, _name, 0, map_size);
+ assert(_index_data && "image file not memory mapped");
+ // Retrieve length of index perfect hash table.
+ u4 length = table_length();
+ // Compute offset of the perfect hash table redirect table.
+ u4 redirect_table_offset = (u4)header_size;
+ // Compute offset of index attribute offsets.
+ u4 offsets_table_offset = redirect_table_offset + length * sizeof(s4);
+ // Compute offset of index location attribute data.
+ u4 location_bytes_offset = offsets_table_offset + length * sizeof(u4);
+ // Compute offset of index string table.
+ u4 string_bytes_offset = location_bytes_offset + locations_size();
+ // Compute address of the perfect hash table redirect table.
+ _redirect_table = (s4*)(_index_data + redirect_table_offset);
+ // Compute address of index attribute offsets.
+ _offsets_table = (u4*)(_index_data + offsets_table_offset);
+ // Compute address of index location attribute data.
+ _location_bytes = _index_data + location_bytes_offset;
+ // Compute address of index string table.
+ _string_bytes = _index_data + string_bytes_offset;
+
+ // Initialize the module data
+ ImageModuleData::module_data_name(buffer, _name);
+ module_data = new ImageModuleData(this, buffer);
+ // Successful open.
+ return true;
+}
+
+// Close image file.
+void ImageFileReader::close() {
+ // Deallocate the index.
+ if (_index_data) {
+ osSupport::unmap_memory((char*)_index_data, _index_size);
+ _index_data = NULL;
+ }
+ // Close file.
+ if (_fd != -1) {
+ osSupport::close(_fd);
+ _fd = -1;
+ }
+}
+
+// Read directly from the file.
+bool ImageFileReader::read_at(u1* data, u8 size, u8 offset) const {
+ return (u8)osSupport::read(_fd, (char*)data, size, offset) == size;
+}
+
+// Find the location attributes associated with the path. Returns true if
+// the location is found, false otherwise.
+bool ImageFileReader::find_location(const char* path, ImageLocation& location) const {
+ // Locate the entry in the index perfect hash table.
+ s4 index = ImageStrings::find(_endian, path, _redirect_table, table_length());
+ // If is found.
+ if (index != ImageStrings::NOT_FOUND) {
+ // Get address of first byte of location attribute stream.
+ u1* data = get_location_data(index);
+ // Expand location attributes.
+ location.set_data(data);
+ // Make sure result is not a false positive.
+ return verify_location(location, path);
+ }
+ return false;
+}
+
+// Find the location index and size associated with the path.
+// Returns the location index and size if the location is found, 0 otherwise.
+u4 ImageFileReader::find_location_index(const char* path, u8 *size) const {
+ // Locate the entry in the index perfect hash table.
+ s4 index = ImageStrings::find(_endian, path, _redirect_table, table_length());
+ // If found.
+ if (index != ImageStrings::NOT_FOUND) {
+ // Get address of first byte of location attribute stream.
+ u4 offset = get_location_offset(index);
+ u1* data = get_location_offset_data(offset);
+ // Expand location attributes.
+ ImageLocation location(data);
+ // Make sure result is not a false positive.
+ if (verify_location(location, path)) {
+ *size = (jlong)location.get_attribute(ImageLocation::ATTRIBUTE_UNCOMPRESSED);
+ return offset;
+ }
+ }
+ return 0; // not found
+}
+
+// Assemble the location path from the string fragments indicated in the location attributes.
+void ImageFileReader::location_path(ImageLocation& location, char* path, size_t max) const {
+ // Manage the image string table.
+ ImageStrings strings(_string_bytes, _header.strings_size(_endian));
+ // Position to first character of the path buffer.
+ char* next = path;
+ // Temp for string length.
+ size_t length;
+ // Get module string.
+ const char* module = location.get_attribute(ImageLocation::ATTRIBUTE_MODULE, strings);
+ // If module string is not empty string.
+ if (*module != '\0') {
+ // Get length of module name.
+ length = strlen(module);
+ // Make sure there is no buffer overflow.
+ assert(next - path + length + 2 < max && "buffer overflow");
+ // Append '/module/'.
+ *next++ = '/';
+ strncpy(next, module, length); next += length;
+ *next++ = '/';
+ }
+ // Get parent (package) string.
+ const char* parent = location.get_attribute(ImageLocation::ATTRIBUTE_PARENT, strings);
+ // If parent string is not empty string.
+ if (*parent != '\0') {
+ // Get length of module string.
+ length = strlen(parent);
+ // Make sure there is no buffer overflow.
+ assert(next - path + length + 1 < max && "buffer overflow");
+ // Append 'patent/' .
+ strncpy(next, parent, length); next += length;
+ *next++ = '/';
+ }
+ // Get base name string.
+ const char* base = location.get_attribute(ImageLocation::ATTRIBUTE_BASE, strings);
+ // Get length of base name.
+ length = strlen(base);
+ // Make sure there is no buffer overflow.
+ assert(next - path + length < max && "buffer overflow");
+ // Append base name.
+ strncpy(next, base, length); next += length;
+ // Get extension string.
+ const char* extension = location.get_attribute(ImageLocation::ATTRIBUTE_EXTENSION, strings);
+ // If extension string is not empty string.
+ if (*extension != '\0') {
+ // Get length of extension string.
+ length = strlen(extension);
+ // Make sure there is no buffer overflow.
+ assert(next - path + length + 1 < max && "buffer overflow");
+ // Append '.extension' .
+ *next++ = '.';
+ strncpy(next, extension, length); next += length;
+ }
+ // Make sure there is no buffer overflow.
+ assert((size_t)(next - path) < max && "buffer overflow");
+ // Terminate string.
+ *next = '\0';
+}
+
+// Verify that a found location matches the supplied path (without copying.)
+bool ImageFileReader::verify_location(ImageLocation& location, const char* path) const {
+ // Manage the image string table.
+ ImageStrings strings(_string_bytes, _header.strings_size(_endian));
+ // Position to first character of the path string.
+ const char* next = path;
+ // Get module name string.
+ const char* module = location.get_attribute(ImageLocation::ATTRIBUTE_MODULE, strings);
+ // If module string is not empty.
+ if (*module != '\0') {
+ // Compare '/module/' .
+ if (*next++ != '/') return false;
+ if (!(next = ImageStrings::starts_with(next, module))) return false;
+ if (*next++ != '/') return false;
+ }
+ // Get parent (package) string
+ const char* parent = location.get_attribute(ImageLocation::ATTRIBUTE_PARENT, strings);
+ // If parent string is not empty string.
+ if (*parent != '\0') {
+ // Compare 'parent/' .
+ if (!(next = ImageStrings::starts_with(next, parent))) return false;
+ if (*next++ != '/') return false;
+ }
+ // Get base name string.
+ const char* base = location.get_attribute(ImageLocation::ATTRIBUTE_BASE, strings);
+ // Compare with basne name.
+ if (!(next = ImageStrings::starts_with(next, base))) return false;
+ // Get extension string.
+ const char* extension = location.get_attribute(ImageLocation::ATTRIBUTE_EXTENSION, strings);
+ // If extension is not empty.
+ if (*extension != '\0') {
+ // Compare '.extension' .
+ if (*next++ != '.') return false;
+ if (!(next = ImageStrings::starts_with(next, extension))) return false;
+ }
+ // True only if complete match and no more characters.
+ return *next == '\0';
+}
+
+// Return the resource for the supplied location offset.
+void ImageFileReader::get_resource(u4 offset, u1* uncompressed_data) const {
+ // Get address of first byte of location attribute stream.
+ u1* data = get_location_offset_data(offset);
+ // Expand location attributes.
+ ImageLocation location(data);
+ // Read the data
+ get_resource(location, uncompressed_data);
+}
+
+// Return the resource for the supplied location.
+void ImageFileReader::get_resource(ImageLocation& location, u1* uncompressed_data) const {
+ // Retrieve the byte offset and size of the resource.
+ u8 offset = location.get_attribute(ImageLocation::ATTRIBUTE_OFFSET);
+ u8 uncompressed_size = location.get_attribute(ImageLocation::ATTRIBUTE_UNCOMPRESSED);
+ u8 compressed_size = location.get_attribute(ImageLocation::ATTRIBUTE_COMPRESSED);
+ // If the resource is compressed.
+ if (compressed_size != 0) {
+ u1* compressed_data;
+ // If not memory mapped read in bytes.
+ if (!MemoryMapImage) {
+ // Allocate buffer for compression.
+ compressed_data = new u1[(u4)compressed_size];
+ // Read bytes from offset beyond the image index.
+ bool is_read = read_at(compressed_data, compressed_size, _index_size + offset);
+ assert(is_read && "error reading from image or short read");
+ } else {
+ compressed_data = get_data_address() + offset;
+ }
+ // Get image string table.
+ const ImageStrings strings = get_strings();
+ // Decompress resource.
+ ImageDecompressor::decompress_resource(compressed_data, uncompressed_data, (u4)uncompressed_size,
+ &strings);
+ // If not memory mapped then release temporary buffer.
+ if (!MemoryMapImage) {
+ delete compressed_data;
+ }
+ } else {
+ // Read bytes from offset beyond the image index.
+ bool is_read = read_at(uncompressed_data, uncompressed_size, _index_size + offset);
+ assert(is_read && "error reading from image or short read");
+ }
+}
+
+// Return the ImageModuleData for this image
+ImageModuleData * ImageFileReader::get_image_module_data() {
+ return module_data;
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/java.base/share/native/libjimage/imageFile.hpp Fri Sep 25 12:04:35 2015 -0700
@@ -0,0 +1,648 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * 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.
+ *
+ */
+
+#ifndef LIBJIMAGE_IMAGEFILE_HPP
+#define LIBJIMAGE_IMAGEFILE_HPP
+
+#include <assert.h>
+
+#include "endian.hpp"
+#include "inttypes.hpp"
+
+// Image files are an alternate file format for storing classes and resources. The
+// goal is to supply file access which is faster and smaller than the jar format.
+// It should be noted that unlike jars, information stored in an image is in native
+// endian format. This allows the image to be mapped into memory without endian
+// translation. This also means that images are platform dependent.
+//
+// Image files are structured as three sections;
+//
+// +-----------+
+// | Header |
+// +-----------+
+// | |
+// | Index |
+// | |
+// +-----------+
+// | |
+// | |
+// | Resources |
+// | |
+// | |
+// +-----------+
+//
+// The header contains information related to identification and description of
+// contents.
+//
+// +-------------------------+
+// | Magic (0xCAFEDADA) |
+// +------------+------------+
+// | Major Vers | Minor Vers |
+// +------------+------------+
+// | Flags |
+// +-------------------------+
+// | Resource Count |
+// +-------------------------+
+// | Table Length |
+// +-------------------------+
+// | Attributes Size |
+// +-------------------------+
+// | Strings Size |
+// +-------------------------+
+//
+// Magic - means of identifying validity of the file. This avoids requiring a
+// special file extension.
+// Major vers, minor vers - differences in version numbers indicate structural
+// changes in the image.
+// Flags - various image wide flags (future).
+// Resource count - number of resources in the file.
+// Table length - the length of lookup tables used in the index.
+// Attributes size - number of bytes in the region used to store location attribute
+// streams.
+// Strings size - the size of the region used to store strings used by the
+// index and meta data.
+//
+// The index contains information related to resource lookup. The algorithm
+// used for lookup is "A Practical Minimal Perfect Hashing Method"
+// (http://homepages.dcc.ufmg.br/~nivio/papers/wea05.pdf). Given a path string
+// in the form /<module>/<package>/<base>.<extension> return the resource location
+// information;
+//
+// redirectIndex = hash(path, DEFAULT_SEED) % table_length;
+// redirect = redirectTable[redirectIndex];
+// if (redirect == 0) return not found;
+// locationIndex = redirect < 0 ? -1 - redirect : hash(path, redirect) % table_length;
+// location = locationTable[locationIndex];
+// if (!verify(location, path)) return not found;
+// return location;
+//
+// Note: The hash function takes an initial seed value. A different seed value
+// usually returns a different result for strings that would otherwise collide with
+// other seeds. The verify function guarantees the found resource location is
+// indeed the resource we are looking for.
+//
+// The following is the format of the index;
+//
+// +-------------------+
+// | Redirect Table |
+// +-------------------+
+// | Attribute Offsets |
+// +-------------------+
+// | Attribute Data |
+// +-------------------+
+// | Strings |
+// +-------------------+
+//
+// Redirect Table - Array of 32-bit signed values representing actions that
+// should take place for hashed strings that map to that
+// value. Negative values indicate no hash collision and can be
+// quickly converted to indices into attribute offsets. Positive
+// values represent a new seed for hashing an index into attribute
+// offsets. Zero indicates not found.
+// Attribute Offsets - Array of 32-bit unsigned values representing offsets into
+// attribute data. Attribute offsets can be iterated to do a
+// full survey of resources in the image. Offset of zero
+// indicates no attributes.
+// Attribute Data - Bytes representing compact attribute data for locations. (See
+// comments in ImageLocation.)
+// Strings - Collection of zero terminated UTF-8 strings used by the index and
+// image meta data. Each string is accessed by offset. Each string is
+// unique. Offset zero is reserved for the empty string.
+//
+// Note that the memory mapped index assumes 32 bit alignment of each component
+// in the index.
+//
+// Endianness of an image.
+// An image booted by hotspot is always in native endian. However, it is possible
+// to read (by the JDK) in alternate endian format. Primarily, this is during
+// cross platform scenarios. Ex, where javac needs to read an embedded image
+// to access classes for crossing compilation.
+//
+
+class ImageFileReader; // forward declaration
+
+// Manage image file string table.
+class ImageStrings {
+private:
+ u1* _data; // Data bytes for strings.
+ u4 _size; // Number of bytes in the string table.
+public:
+ enum {
+ // Not found result from find routine.
+ NOT_FOUND = -1,
+ // Prime used to generate hash for Perfect Hashing.
+ HASH_MULTIPLIER = 0x01000193
+ };
+
+ ImageStrings(u1* data, u4 size) : _data(data), _size(size) {}
+
+ // Return the UTF-8 string beginning at offset.
+ inline const char* get(u4 offset) const {
+ assert(offset < _size && "offset exceeds string table size");
+ return (const char*)(_data + offset);
+ }
+
+ // Compute the Perfect Hashing hash code for the supplied UTF-8 string.
+ inline static u4 hash_code(const char* string) {
+ return hash_code(string, HASH_MULTIPLIER);
+ }
+
+ // Compute the Perfect Hashing hash code for the supplied string, starting at seed.
+ static s4 hash_code(const char* string, s4 seed);
+
+ // Match up a string in a perfect hash table. Result still needs validation
+ // for precise match.
+ static s4 find(Endian* endian, const char* name, s4* redirect, u4 length);
+
+ // Test to see if UTF-8 string begins with the start UTF-8 string. If so,
+ // return non-NULL address of remaining portion of string. Otherwise, return
+ // NULL. Used to test sections of a path without copying from image string
+ // table.
+ static const char* starts_with(const char* string, const char* start);
+
+ // Test to see if UTF-8 string begins with start char. If so, return non-NULL
+ // address of remaining portion of string. Otherwise, return NULL. Used
+ // to test a character of a path without copying.
+ inline static const char* starts_with(const char* string, const char ch) {
+ return *string == ch ? string + 1 : NULL;
+ }
+};
+
+// Manage image file location attribute data. Within an image, a location's
+// attributes are compressed into a stream of bytes. An attribute stream is
+// composed of individual attribute sequences. Each attribute sequence begins with
+// a header byte containing the attribute 'kind' (upper 5 bits of header) and the
+// 'length' less 1 (lower 3 bits of header) of bytes that follow containing the
+// attribute value. Attribute values present as most significant byte first.
+//
+// Ex. Container offset (ATTRIBUTE_OFFSET) 0x33562 would be represented as 0x22
+// (kind = 4, length = 3), 0x03, 0x35, 0x62.
+//
+// An attribute stream is terminated with a header kind of ATTRIBUTE_END (header
+// byte of zero.)
+//
+// ImageLocation inflates the stream into individual values stored in the long
+// array _attributes. This allows an attribute value can be quickly accessed by
+// direct indexing. Unspecified values default to zero.
+//
+// Notes:
+// - Even though ATTRIBUTE_END is used to mark the end of the attribute stream,
+// streams will contain zero byte values to represent lesser significant bits.
+// Thus, detecting a zero byte is not sufficient to detect the end of an attribute
+// stream.
+// - ATTRIBUTE_OFFSET represents the number of bytes from the beginning of the region
+// storing the resources. Thus, in an image this represents the number of bytes
+// after the index.
+// - Currently, compressed resources are represented by having a non-zero
+// ATTRIBUTE_COMPRESSED value. This represents the number of bytes stored in the
+// image, and the value of ATTRIBUTE_UNCOMPRESSED represents number of bytes of the
+// inflated resource in memory. If the ATTRIBUTE_COMPRESSED is zero then the value
+// of ATTRIBUTE_UNCOMPRESSED represents both the number of bytes in the image and
+// in memory. In the future, additional compression techniques will be used and
+// represented differently.
+// - Package strings include trailing slash and extensions include prefix period.
+//
+class ImageLocation {
+public:
+ enum {
+ ATTRIBUTE_END, // End of attribute stream marker
+ ATTRIBUTE_MODULE, // String table offset of module name
+ ATTRIBUTE_PARENT, // String table offset of resource path parent
+ ATTRIBUTE_BASE, // String table offset of resource path base
+ ATTRIBUTE_EXTENSION, // String table offset of resource path extension
+ ATTRIBUTE_OFFSET, // Container byte offset of resource
+ ATTRIBUTE_COMPRESSED, // In image byte size of the compressed resource
+ ATTRIBUTE_UNCOMPRESSED, // In memory byte size of the uncompressed resource
+ ATTRIBUTE_COUNT // Number of attribute kinds
+ };
+
+private:
+ // Values of inflated attributes.
+ u8 _attributes[ATTRIBUTE_COUNT];
+
+ // Return the attribute value number of bytes.
+ inline static u1 attribute_length(u1 data) {
+ return (data & 0x7) + 1;
+ }
+
+ // Return the attribute kind.
+ inline static u1 attribute_kind(u1 data) {
+ u1 kind = data >> 3;
+ assert(kind < ATTRIBUTE_COUNT && "invalid attribute kind");
+ return kind;
+ }
+
+ // Return the attribute length.
+ inline static u8 attribute_value(u1* data, u1 n) {
+ assert(0 < n && n <= 8 && "invalid attribute value length");
+ u8 value = 0;
+ // Most significant bytes first.
+ for (u1 i = 0; i < n; i++) {
+ value <<= 8;
+ value |= data[i];
+ }
+ return value;
+ }
+
+public:
+ ImageLocation() {
+ clear_data();
+ }
+
+ ImageLocation(u1* data) {
+ clear_data();
+ set_data(data);
+ }
+
+ // Inflates the attribute stream into individual values stored in the long
+ // array _attributes. This allows an attribute value to be quickly accessed by
+ // direct indexing. Unspecified values default to zero.
+ void set_data(u1* data);
+
+ // Zero all attribute values.
+ void clear_data();
+
+ // Retrieve an attribute value from the inflated array.
+ inline u8 get_attribute(u1 kind) const {
+ assert(ATTRIBUTE_END < kind && kind < ATTRIBUTE_COUNT && "invalid attribute kind");
+ return _attributes[kind];
+ }
+
+ // Retrieve an attribute string value from the inflated array.
+ inline const char* get_attribute(u4 kind, const ImageStrings& strings) const {
+ return strings.get((u4)get_attribute(kind));
+ }
+};
+
+//
+// NOTE: needs revision.
+// Each loader requires set of module meta data to identify which modules and
+// packages are managed by that loader. Currently, there is one image file per
+// builtin loader, so only one module meta data resource per file.
+//
+// Each element in the module meta data is a native endian 4 byte integer. Note
+// that entries with zero offsets for string table entries should be ignored (
+// padding for hash table lookup.)
+//
+// Format:
+// Count of package to module entries
+// Count of module to package entries
+// Perfect Hash redirect table[Count of package to module entries]
+// Package to module entries[Count of package to module entries]
+// Offset to package name in string table
+// Offset to module name in string table
+// Perfect Hash redirect table[Count of module to package entries]
+// Module to package entries[Count of module to package entries]
+// Offset to module name in string table
+// Count of packages in module
+// Offset to first package in packages table
+// Packages[]
+// Offset to package name in string table
+//
+// Manage the image module meta data.
+class ImageModuleData {
+ class Header {
+ private:
+ u4 _ptm_count; // Count of package to module entries
+ u4 _mtp_count; // Count of module to package entries
+ public:
+ inline u4 ptm_count(Endian* endian) const { return endian->get(_ptm_count); }
+ inline u4 mtp_count(Endian* endian) const { return endian->get(_mtp_count); }
+ };
+
+ // Hashtable entry
+ class HashData {
+ private:
+ u4 _name_offset; // Name offset in string table
+ public:
+ inline s4 name_offset(Endian* endian) const { return endian->get(_name_offset); }
+ };
+
+ // Package to module hashtable entry
+ class PTMData : public HashData {
+ private:
+ u4 _module_name_offset; // Module name offset in string table
+ public:
+ inline s4 module_name_offset(Endian* endian) const { return endian->get(_module_name_offset); }
+ };
+
+ // Module to package hashtable entry
+ class MTPData : public HashData {
+ private:
+ u4 _package_count; // Number of packages in module
+ u4 _package_offset; // Offset in package list
+ public:
+ inline u4 package_count(Endian* endian) const { return endian->get(_package_count); }
+ inline u4 package_offset(Endian* endian) const { return endian->get(_package_offset); }
+ };
+
+ const ImageFileReader* _image_file; // Source image file
+ Endian* _endian; // Endian handler
+ ImageStrings _strings; // Image file strings
+ u1* _data; // Module data resource data
+ u8 _data_size; // Size of resource data
+ Header* _header; // Module data header
+ s4* _ptm_redirect; // Package to module hashtable redirect
+ PTMData* _ptm_data; // Package to module data
+ s4* _mtp_redirect; // Module to packages hashtable redirect
+ MTPData* _mtp_data; // Module to packages data
+ s4* _mtp_packages; // Package data (name offsets)
+
+ // Return a string from the string table.
+ inline const char* get_string(u4 offset) {
+ return _strings.get(offset);
+ }
+
+ inline u4 mtp_package(u4 index) {
+ return _endian->get(_mtp_packages[index]);
+ }
+
+public:
+ ImageModuleData(const ImageFileReader* image_file, const char* module_data_name);
+ ~ImageModuleData();
+
+ // Return the name of the module data resource.
+ static void module_data_name(char* buffer, const char* image_file_name);
+
+ // Return the module in which a package resides. Returns NULL if not found.
+ const char* package_to_module(const char* package_name);
+
+ // Returns all the package names in a module in a NULL terminated array.
+ // Returns NULL if module not found.
+ const char** module_to_packages(const char* module_name);
+};
+
+// Image file header, starting at offset 0.
+class ImageHeader {
+private:
+ u4 _magic; // Image file marker
+ u4 _version; // Image file major version number
+ u4 _flags; // Image file flags
+ u4 _resource_count; // Number of resources in file
+ u4 _table_length; // Number of slots in index tables
+ u4 _locations_size; // Number of bytes in attribute table
+ u4 _strings_size; // Number of bytes in string table
+
+public:
+ u4 magic() const { return _magic; }
+ u4 magic(Endian* endian) const { return endian->get(_magic); }
+ void set_magic(Endian* endian, u4 magic) { return endian->set(_magic, magic); }
+
+ u4 major_version(Endian* endian) const { return endian->get(_version) >> 16; }
+ u4 minor_version(Endian* endian) const { return endian->get(_version) & 0xFFFF; }
+ void set_version(Endian* endian, u4 major_version, u4 minor_version) {
+ return endian->set(_version, major_version << 16 | minor_version);
+ }
+
+ u4 flags(Endian* endian) const { return endian->get(_flags); }
+ void set_flags(Endian* endian, u4 value) { return endian->set(_flags, value); }
+
+ u4 resource_count(Endian* endian) const { return endian->get(_resource_count); }
+ void set_resource_count(Endian* endian, u4 count) { return endian->set(_resource_count, count); }
+
+ u4 table_length(Endian* endian) const { return endian->get(_table_length); }
+ void set_table_length(Endian* endian, u4 count) { return endian->set(_table_length, count); }
+
+ u4 locations_size(Endian* endian) const { return endian->get(_locations_size); }
+ void set_locations_size(Endian* endian, u4 size) { return endian->set(_locations_size, size); }
+
+ u4 strings_size(Endian* endian) const { return endian->get(_strings_size); }
+ void set_strings_size(Endian* endian, u4 size) { return endian->set(_strings_size, size); }
+};
+
+// Max path length limit independent of platform. Windows max path is 1024,
+// other platforms use 4096. The JCK fails several tests when 1024 is used.
+#define IMAGE_MAX_PATH 4096
+
+class ImageFileReader;
+
+// Manage a table of open image files. This table allows multiple access points
+// to share an open image.
+class ImageFileReaderTable {
+private:
+ const static u4 _growth = 8; // Growth rate of the table
+ u4 _count; // Number of entries in the table
+ u4 _max; // Maximum number of entries allocated
+ ImageFileReader** _table; // Growable array of entries
+
+public:
+ ImageFileReaderTable();
+ ~ImageFileReaderTable();
+
+ // Return the number of entries.
+ inline u4 count() { return _count; }
+
+ // Return the ith entry from the table.
+ inline ImageFileReader* get(u4 i) { return _table[i]; }
+
+ // Add a new image entry to the table.
+ void add(ImageFileReader* image);
+
+ // Remove an image entry from the table.
+ void remove(ImageFileReader* image);
+
+ // Determine if image entry is in table.
+ bool contains(ImageFileReader* image);
+};
+
+// Manage the image file.
+// ImageFileReader manages the content of an image file.
+// Initially, the header of the image file is read for validation. If valid,
+// values in the header are used calculate the size of the image index. The
+// index is then memory mapped to allow load on demand and sharing. The
+// -XX:+MemoryMapImage flag determines if the entire file is loaded (server use.)
+// An image can be used by Hotspot and multiple reference points in the JDK, thus
+// it is desirable to share a reader. To accomodate sharing, a share table is
+// defined (see ImageFileReaderTable in imageFile.cpp) To track the number of
+// uses, ImageFileReader keeps a use count (_use). Use is incremented when
+// 'opened' by reference point and decremented when 'closed'. Use of zero
+// leads the ImageFileReader to be actually closed and discarded.
+class ImageFileReader {
+private:
+ // Manage a number of image files such that an image can be shared across
+ // multiple uses (ex. loader.)
+ static ImageFileReaderTable _reader_table;
+
+ char* _name; // Name of image
+ s4 _use; // Use count
+ int _fd; // File descriptor
+ Endian* _endian; // Endian handler
+ u8 _file_size; // File size in bytes
+ ImageHeader _header; // Image header
+ size_t _index_size; // Total size of index
+ u1* _index_data; // Raw index data
+ s4* _redirect_table; // Perfect hash redirect table
+ u4* _offsets_table; // Location offset table
+ u1* _location_bytes; // Location attributes
+ u1* _string_bytes; // String table
+ ImageModuleData *module_data; // The ImageModuleData for this image
+
+ ImageFileReader(const char* name, bool big_endian);
+ ~ImageFileReader();
+
+ // Compute number of bytes in image file index.
+ inline size_t index_size() {
+ return sizeof(ImageHeader) +
+ table_length() * sizeof(u4) * 2 + locations_size() + strings_size();
+ }
+
+public:
+ enum {
+ // Image file marker.
+ IMAGE_MAGIC = 0xCAFEDADA,
+ // Endian inverted Image file marker.
+ IMAGE_MAGIC_INVERT = 0xDADAFECA,
+ // Image file major version number.
+ MAJOR_VERSION = 1,
+ // Image file minor version number.
+ MINOR_VERSION = 0
+ };
+
+ // Open an image file, reuse structure if file already open.
+ static ImageFileReader* open(const char* name, bool big_endian = Endian::is_big_endian());
+
+ // Close an image file if the file is not in use elsewhere.
+ static void close(ImageFileReader *reader);
+
+ // Return an id for the specifed ImageFileReader.
+ static u8 readerToID(ImageFileReader *reader);
+
+ // Validate the image id.
+ static bool idCheck(u8 id);
+
+ // Return an id for the specifed ImageFileReader.
+ static ImageFileReader* idToReader(u8 id);
+
+ // Open image file for read access.
+ bool open();
+
+ // Close image file.
+ void close();
+
+ // Read directly from the file.
+ bool read_at(u1* data, u8 size, u8 offset) const;
+
+ inline Endian* endian() const { return _endian; }
+
+ // Retrieve name of image file.
+ inline const char* name() const {
+ return _name;
+ }
+
+ // Retrieve size of image file.
+ inline u8 file_size() const {
+ return _file_size;
+ }
+
+ // Return first address of index data.
+ inline u1* get_index_address() const {
+ return _index_data;
+ }
+
+ // Return first address of resource data.
+ inline u1* get_data_address() const {
+ return _index_data + _index_size;
+ }
+
+ // Get the size of the index data.
+ size_t get_index_size() const {
+ return _index_size;
+ }
+
+ inline u4 table_length() const {
+ return _header.table_length(_endian);
+ }
+
+ inline u4 locations_size() const {
+ return _header.locations_size(_endian);
+ }
+
+ inline u4 strings_size()const {
+ return _header.strings_size(_endian);
+ }
+
+ inline u4* offsets_table() const {
+ return _offsets_table;
+ }
+
+ // Increment use count.
+ inline void inc_use() {
+ _use++;
+ }
+
+ // Decrement use count.
+ inline bool dec_use() {
+ return --_use == 0;
+ }
+
+ // Return a string table accessor.
+ inline const ImageStrings get_strings() const {
+ return ImageStrings(_string_bytes, _header.strings_size(_endian));
+ }
+
+ // Return location attribute stream at offset.
+ inline u1* get_location_offset_data(u4 offset) const {
+ assert((u4)offset < _header.locations_size(_endian) &&
+ "offset exceeds location attributes size");
+ return offset != 0 ? _location_bytes + offset : NULL;
+ }
+
+ // Return location attribute stream for location i.
+ inline u1* get_location_data(u4 index) const {
+ return get_location_offset_data(get_location_offset(index));
+ }
+
+ // Return the location offset for index.
+ inline u4 get_location_offset(u4 index) const {
+ assert((u4)index < _header.table_length(_endian) &&
+ "index exceeds location count");
+ return _endian->get(_offsets_table[index]);
+ }
+
+ // Find the location attributes associated with the path. Returns true if
+ // the location is found, false otherwise.
+ bool find_location(const char* path, ImageLocation& location) const;
+
+ // Find the location index and size associated with the path.
+ // Returns the location index and size if the location is found,
+ // ImageFileReader::NOT_FOUND otherwise.
+ u4 find_location_index(const char* path, u8 *size) const;
+
+ // Assemble the location path.
+ void location_path(ImageLocation& location, char* path, size_t max) const;
+
+ // Verify that a found location matches the supplied path.
+ bool verify_location(ImageLocation& location, const char* path) const;
+
+ // Return the resource for the supplied location index.
+ void get_resource(u4 index, u1* uncompressed_data) const;
+
+ // Return the resource for the supplied path.
+ void get_resource(ImageLocation& location, u1* uncompressed_data) const;
+
+ // Return the ImageModuleData for this image
+ ImageModuleData * get_image_module_data();
+
+};
+#endif // LIBJIMAGE_IMAGEFILE_HPP
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/java.base/share/native/libjimage/inttypes.hpp Fri Sep 25 12:04:35 2015 -0700
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * 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.
+ *
+ */
+
+#ifndef LIBJIMAGE_INTTYPES_HPP
+#define LIBJIMAGE_INTTYPES_HPP
+
+typedef unsigned char u1;
+typedef char s1;
+typedef unsigned short u2;
+typedef short s2;
+typedef unsigned int u4;
+typedef int s4;
+#ifdef LP64
+typedef unsigned long u8;
+typedef long s8;
+#else
+typedef unsigned long long u8;
+typedef long long s8;
+#endif
+
+#endif // LIBJIMAGE_INTTYPES_HPP
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/java.base/share/native/libjimage/jimage.cpp Fri Sep 25 12:04:35 2015 -0700
@@ -0,0 +1,194 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * 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 <string.h>
+
+#include "jimage.hpp"
+
+#include "imageFile.hpp"
+
+#define BOOT_VERSION "9.0"
+
+/*
+ * JImageOpen - Given the supplied full path file name, open an image file. This
+ * function will also initialize tables and retrieve meta-data necessary to
+ * satisfy other functions in the API. If the image file has been previously
+ * open, a new open request will share memory and resources used by the previous
+ * open. A call to JImageOpen should be balanced by a call to JImageClose, to
+ * release memory and resources used. If the image file is not found or cannot
+ * be open, then NULL is returned and error will contain a reason for the
+ * failure; a positive value for a system error number, negative for a jimage
+ * specific error (see JImage Error Codes.)
+ *
+ * Ex.
+ * jint error;
+ * JImageFile* jimage = (*JImageOpen)(JAVA_HOME "lib/modules/bootmodules.jimage", &error);
+ * if (image == NULL) {
+ * tty->print_cr("JImage failed to open: %d", error);
+ * ...
+ * }
+ * ...
+ */
+extern "C" JImageFile* JIMAGE_Open(const char *name, jint* error) {
+ // TODO - return a meaningful error code
+ *error = 0;
+ ImageFileReader* jfile = ImageFileReader::open(name);
+ return (JImageFile*) jfile;
+}
+
+/*
+ * JImageClose - Given the supplied open image file (see JImageOpen), release
+ * memory and resources used by the open file and close the file. If the image
+ * file is shared by other uses, release and close is deferred until the last use
+ * is also closed.
+ *
+ * Ex.
+ * (*JImageClose)(image);
+ */
+extern "C" void JIMAGE_Close(JImageFile* image) {
+ ImageFileReader::close((ImageFileReader*) image);
+}
+
+/*
+ * JImagePackageToModule - Given an open image file (see JImageOpen) and the name
+ * of a package, return the name of module where the package resides. If the
+ * package does not exist in the image file, the function returns NULL.
+ * The resulting string does/should not have to be released. All strings are
+ * utf-8, zero byte terminated.
+ *
+ * Ex.
+ * const char* package = (*JImagePackageToModule)(image, "java/lang");
+ * tty->print_cr(package);
+ * —> java.base
+ */
+extern "C" const char* JIMAGE_PackageToModule(JImageFile* image, const char* package_name) {
+ return ((ImageFileReader*) image)->get_image_module_data()->package_to_module(package_name);
+}
+
+/*
+ * JImageFindResource - Given an open image file (see JImageOpen), a module
+ * name, a version string and the name of a class/resource, return location
+ * information describing the resource and its size. If no resource is found, the
+ * function returns JIMAGE_NOT_FOUND and the value of size is undefined.
+ * The version number should be "9.0" and is not used in locating the resource.
+ * The resulting location does/should not have to be released.
+ * All strings are utf-8, zero byte terminated.
+ *
+ * Ex.
+ * jlong size;
+ * JImageLocationRef location = (*JImageFindResource)(image, "java.base", "9.0", "java/lang/String.class", &size);
+ */
+extern "C" JImageLocationRef JIMAGE_FindResource(JImageFile* image,
+ const char* module_name, const char* version, const char* name,
+ jlong* size) {
+ if (strcmp(version, BOOT_VERSION) != 0) {
+ return (JImageLocationRef) 0;
+ }
+
+ ImageLocation location;
+ char fullpath[IMAGE_MAX_PATH];
+
+ // Concatenate to get full path
+ strncpy(fullpath, "/", IMAGE_MAX_PATH - 1);
+ strncat(fullpath, module_name, IMAGE_MAX_PATH - 1);
+ strncat(fullpath, "/", IMAGE_MAX_PATH - 1);
+ strncat(fullpath, name, IMAGE_MAX_PATH - 1);
+ JImageLocationRef loc =
+ (JImageLocationRef) ((ImageFileReader*) image)->find_location_index(fullpath, (u8*) size);
+ return loc;
+}
+
+/*
+ * JImageGetResource - Given an open image file (see JImageOpen), a resource’s
+ * location information (see JImageFindResource), a buffer of appropriate
+ * size and the size, retrieve the bytes associated with the
+ * resource. If the size is less than the resource size then the read is truncated.
+ * If the size is greater than the resource size then the remainder of the buffer
+ * is zero filled. The function will return the actual size of the resource.
+ *
+ * Ex.
+ * jlong size;
+ * JImageLocationRef* location = (*JImageFindResource)(image, "java.base", "9.0", "java/lang/String.class", &size);
+ * char* buffer = new char[size];
+ * (*JImageGetResource)(image, location, buffer, size);
+ */
+extern "C" jlong JIMAGE_GetResource(JImageFile* image, JImageLocationRef location,
+ char* buffer, jlong size) {
+ ((ImageFileReader*) image)->get_resource((u4) location, (u1*) buffer);
+ return size;
+}
+
+/*
+ * JImageResourceIterator - Given an open image file (see JImageOpen), a visitor
+ * function and a visitor argument, iterator through each of the image's resources.
+ * The visitor function is called with the image file, the module name, the
+ * package name, the base name, the extension and the visitor argument. The return
+ * value of the visitor function should be true, unless an early iteration exit is
+ * required. All strings are utf-8, zero byte terminated.file.
+ *
+ * Ex.
+ * bool ctw_visitor(JImageFile* jimage, const char* module_name, const char* version, const char* package, const char* name, const char* extension, void* arg) {
+ * if (strcmp(extension, “class”) == 0) {
+ * char path[JIMAGE_MAX_PATH];
+ * Thread* THREAD = Thread::current();
+ * jio_snprintf(path, JIMAGE_MAX_PATH - 1, "/%s/%s", package, name);
+ * ClassLoader::compile_the_world_in(path, (Handle)arg, THREAD);
+ * return !HAS_PENDING_EXCEPTION;
+ * }
+ * return true;
+ * }
+ * (*JImageResourceIterator)(image, ctw_visitor, loader);
+ */
+extern "C" void JIMAGE_ResourceIterator(JImageFile* image,
+ JImageResourceVisitor_t visitor, void* arg) {
+ ImageFileReader* imageFile = (ImageFileReader*) image;
+ u4 nEntries = imageFile->table_length();
+ const ImageStrings strings = imageFile->get_strings();
+ for (u4 i = 0; i < nEntries; i++) {
+ ImageLocation location(imageFile->get_location_data(i));
+
+ u4 moduleOffset = (u4) location.get_attribute(ImageLocation::ATTRIBUTE_MODULE);
+ if (moduleOffset == 0) {
+ continue; // skip non-modules
+ }
+ const char *module = strings.get(moduleOffset);
+ if (strcmp(module, "modules") == 0
+ || strcmp(module, "packages") == 0) {
+ continue; // always skip
+ }
+
+ u4 parentOffset = (u4) location.get_attribute(ImageLocation::ATTRIBUTE_PARENT);
+ const char *parent = strings.get(parentOffset);
+ u4 baseOffset = (u4) location.get_attribute(ImageLocation::ATTRIBUTE_BASE);
+ const char *base = strings.get(baseOffset);
+ u4 extOffset = (u4) location.get_attribute(ImageLocation::ATTRIBUTE_EXTENSION);
+ const char *extension = strings.get(extOffset);
+
+ if (!(*visitor)(image, module, "9", parent, base, extension, arg)) {
+ break;
+ }
+
+ }
+}
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/java.base/share/native/libjimage/jimage.hpp Fri Sep 25 12:04:35 2015 -0700
@@ -0,0 +1,176 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * 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 "jni.h"
+
+// Opaque reference to a JImage file.
+class JImageFile;
+// Opaque reference to an image file resource location.
+typedef jlong JImageLocationRef;
+
+// Max path length limit independent of platform. Windows max path is 1024,
+// other platforms use 4096. The JCK fails several tests when 1024 is used.
+#define JIMAGE_MAX_PATH 4096
+
+// JImage Error Codes
+
+// The image file is not prefixed with 0xCAFEDADA
+#define JIMAGE_BAD_MAGIC (-1)
+// The image file does not have a compatible (translatable) version
+#define JIMAGE_BAD_VERSION (-2)
+// The image file content is malformed
+#define JIMAGE_CORRUPTED (-3)
+
+/*
+ * JImageOpen - Given the supplied full path file name, open an image file. This
+ * function will also initialize tables and retrieve meta-data necessary to
+ * satisfy other functions in the API. If the image file has been previously
+ * open, a new open request will share memory and resources used by the previous
+ * open. A call to JImageOpen should be balanced by a call to JImageClose, to
+ * release memory and resources used. If the image file is not found or cannot
+ * be open, then NULL is returned and error will contain a reason for the
+ * failure; a positive value for a system error number, negative for a jimage
+ * specific error (see JImage Error Codes.)
+ *
+ * Ex.
+ * jint error;
+ * JImageFile* jimage = (*JImageOpen)(JAVA_HOME "lib/modules/bootmodules.jimage", &error);
+ * if (image == NULL) {
+ * tty->print_cr("JImage failed to open: %d", error);
+ * ...
+ * }
+ * ...
+ */
+
+extern "C" JImageFile* JIMAGE_Open(const char *name, jint* error);
+
+typedef JImageFile* (*JImageOpen_t)(const char *name, jint* error);
+
+/*
+ * JImageClose - Given the supplied open image file (see JImageOpen), release
+ * memory and resources used by the open file and close the file. If the image
+ * file is shared by other uses, release and close is deferred until the last use
+ * is also closed.
+ *
+ * Ex.
+ * (*JImageClose)(image);
+ */
+
+extern "C" void JIMAGE_Close(JImageFile* jimage);
+
+typedef void (*JImageClose_t)(JImageFile* jimage);
+
+
+/*
+ * JImagePackageToModule - Given an open image file (see JImageOpen) and the name
+ * of a package, return the name of module where the package resides. If the
+ * package does not exist in the image file, the function returns NULL.
+ * The resulting string does/should not have to be released. All strings are
+ * utf-8, zero byte terminated.
+ *
+ * Ex.
+ * const char* package = (*JImagePackageToModule)(image, "java/lang");
+ * tty->print_cr(package);
+ * —> java.base
+ */
+
+extern "C" const char * JIMAGE_PackageToModule(JImageFile* jimage, const char* package_name);
+
+typedef const char* (*JImagePackageToModule_t)(JImageFile* jimage, const char* package_name);
+
+
+/*
+ * JImageFindResource - Given an open image file (see JImageOpen), a module
+ * name, a version string and the name of a class/resource, return location
+ * information describing the resource and its size. If no resource is found, the
+ * function returns JIMAGE_NOT_FOUND and the value of size is undefined.
+ * The version number should be "9.0" and is not used in locating the resource.
+ * The resulting location does/should not have to be released.
+ * All strings are utf-8, zero byte terminated.
+ *
+ * Ex.
+ * jlong size;
+ * JImageLocationRef location = (*JImageFindResource)(image, "java.base", "9.0", "java/lang/String.class", &size);
+ */
+extern "C" JImageLocationRef JIMAGE_FindResource(JImageFile* jimage,
+ const char* module_name, const char* version, const char* name,
+ jlong* size);
+
+typedef JImageLocationRef(*JImageFindResource_t)(JImageFile* jimage,
+ const char* module_name, const char* version, const char* name,
+ jlong* size);
+
+
+/*
+ * JImageGetResource - Given an open image file (see JImageOpen), a resource’s
+ * location information (see JImageFindResource), a buffer of appropriate
+ * size and the size, retrieve the bytes associated with the
+ * resource. If the size is less than the resource size then the read is truncated.
+ * If the size is greater than the resource size then the remainder of the buffer
+ * is zero filled. The function will return the actual size of the resource.
+ *
+ * Ex.
+ * jlong size;
+ * JImageLocationRef location = (*JImageFindResource)(image, "java.base", "9.0", "java/lang/String.class", &size);
+ * char* buffer = new char[size];
+ * (*JImageGetResource)(image, location, buffer, size);
+ */
+extern "C" jlong JIMAGE_GetResource(JImageFile* jimage, JImageLocationRef location,
+ char* buffer, jlong size);
+
+typedef jlong(*JImageGetResource_t)(JImageFile* jimage, JImageLocationRef location,
+ char* buffer, jlong size);
+
+
+/*
+ * JImageResourceIterator - Given an open image file (see JImageOpen), a visitor
+ * function and a visitor argument, iterator through each of the image's resources.
+ * The visitor function is called with the image file, the module name, the
+ * package name, the base name, the extension and the visitor argument. The return
+ * value of the visitor function should be true, unless an early iteration exit is
+ * required. All strings are utf-8, zero byte terminated.file.
+ *
+ * Ex.
+ * bool ctw_visitor(JImageFile* jimage, const char* module_name, const char* version, const char* package, const char* name, const char* extension, void* arg) {
+ * if (strcmp(extension, “class”) == 0) {
+ * char path[JIMAGE_MAX_PATH];
+ * Thread* THREAD = Thread::current();
+ * jio_snprintf(path, JIMAGE_MAX_PATH - 1, "/%s/%s", package, name);
+ * ClassLoader::compile_the_world_in(path, (Handle)arg, THREAD);
+ * return !HAS_PENDING_EXCEPTION;
+ * }
+ * return true;
+ * }
+ * (*JImageResourceIterator)(image, ctw_visitor, loader);
+ */
+
+typedef bool (*JImageResourceVisitor_t)(JImageFile* jimage,
+ const char* module_name, const char* version, const char* package,
+ const char* name, const char* extension, void* arg);
+
+extern "C" void JIMAGE_ResourceIterator(JImageFile* jimage,
+ JImageResourceVisitor_t visitor, void *arg);
+
+typedef void (*JImageResourceIterator_t)(JImageFile* jimage,
+ JImageResourceVisitor_t visitor, void* arg);
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/java.base/share/native/libjimage/osSupport.hpp Fri Sep 25 12:04:35 2015 -0700
@@ -0,0 +1,109 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * 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.
+ *
+ */
+
+#ifndef LIBJIMAGE_OSSUPPORT_HPP
+#define LIBJIMAGE_OSSUPPORT_HPP
+
+#ifdef WIN32
+#include <Windows.h>
+#else
+#include <pthread.h>
+#endif
+
+class osSupport {
+public:
+ /**
+ * Open a regular file read-only.
+ * Return the file descriptor.
+ */
+ static jint openReadOnly(const char *path);
+
+ /**
+ * Close a file descriptor.
+ */
+ static jint close(jint fd);
+
+ /**
+ * Return the size of a regular file.
+ */
+ static jlong size(const char *path);
+
+ /**
+ * Read nBytes at offset into a buffer.
+ */
+ static jlong read(jint fd, char *buf, jlong nBytes, jlong offset);
+
+ /**
+ * Map nBytes at offset into memory and return the address.
+ * The system chooses the address.
+ */
+ static void* map_memory(jint fd, const char *filename, size_t file_offset, size_t bytes);
+
+ /**
+ * Unmap nBytes of memory at address.
+ */
+ static int unmap_memory(void* addr, size_t bytes);
+};
+
+/**
+ * A CriticalSection to protect a small section of code.
+ */
+class SimpleCriticalSection {
+ friend class SimpleCriticalSectionLock;
+private:
+ void enter();
+ void exit();
+public:
+ SimpleCriticalSection();
+ //~SimpleCriticalSection(); // Cretes a dependency on Solaris on a C++ exit registration
+
+private:
+#ifdef WIN32
+ CRITICAL_SECTION critical_section;
+#else
+ pthread_mutex_t mutex;
+#endif // WIN32
+};
+
+/**
+ * SimpleCriticalSectionLock instance.
+ * The constructor locks a SimpleCriticalSection and the
+ * destructor does the unlock.
+ */
+class SimpleCriticalSectionLock {
+private:
+ SimpleCriticalSection *lock;
+public:
+
+ SimpleCriticalSectionLock(SimpleCriticalSection *cslock) {
+ this->lock = cslock;
+ lock->enter();
+ }
+
+ ~SimpleCriticalSectionLock() {
+ lock->exit();
+ }
+};
+
+#endif // LIBJIMAGE_OSSUPPORT_HPP
--- a/jdk/src/java.base/unix/classes/java/lang/ProcessEnvironment.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/unix/classes/java/lang/ProcessEnvironment.java Fri Sep 25 12:04:35 2015 -0700
@@ -124,7 +124,7 @@
// A class hiding the byteArray-String duality of
// text data on Unixoid operating systems.
- private static abstract class ExternalData {
+ private abstract static class ExternalData {
protected final String str;
protected final byte[] bytes;
--- a/jdk/src/java.base/unix/classes/java/net/PlainDatagramSocketImpl.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/unix/classes/java/net/PlainDatagramSocketImpl.java Fri Sep 25 12:04:35 2015 -0700
@@ -135,5 +135,5 @@
/**
* Perform class load-time initializations.
*/
- private native static void init();
+ private static native void init();
}
--- a/jdk/src/java.base/unix/classes/sun/net/NetHooks.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/unix/classes/sun/net/NetHooks.java Fri Sep 25 12:04:35 2015 -0700
@@ -45,7 +45,7 @@
* <p> Concrete implementations of this class should define a zero-argument
* constructor and implement the abstract methods specified below.
*/
- public static abstract class Provider {
+ public abstract static class Provider {
/**
* Initializes a new instance of this class.
*/
--- a/jdk/src/java.base/unix/classes/sun/net/PortConfig.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/unix/classes/sun/net/PortConfig.java Fri Sep 25 12:04:35 2015 -0700
@@ -36,7 +36,7 @@
public final class PortConfig {
private static int defaultUpper, defaultLower;
- private final static int upper, lower;
+ private static final int upper, lower;
private PortConfig() {}
--- a/jdk/src/java.base/unix/classes/sun/nio/ch/UnixAsynchronousServerSocketChannelImpl.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/unix/classes/sun/nio/ch/UnixAsynchronousServerSocketChannelImpl.java Fri Sep 25 12:04:35 2015 -0700
@@ -43,7 +43,7 @@
extends AsynchronousServerSocketChannelImpl
implements Port.PollableChannel
{
- private final static NativeDispatcher nd = new SocketDispatcher();
+ private static final NativeDispatcher nd = new SocketDispatcher();
private final Port port;
private final int fdVal;
--- a/jdk/src/java.base/unix/classes/sun/nio/ch/UnixAsynchronousSocketChannelImpl.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/unix/classes/sun/nio/ch/UnixAsynchronousSocketChannelImpl.java Fri Sep 25 12:04:35 2015 -0700
@@ -42,7 +42,7 @@
class UnixAsynchronousSocketChannelImpl
extends AsynchronousSocketChannelImpl implements Port.PollableChannel
{
- private final static NativeDispatcher nd = new SocketDispatcher();
+ private static final NativeDispatcher nd = new SocketDispatcher();
private static enum OpType { CONNECT, READ, WRITE };
private static final boolean disableSynchronousRead;
--- a/jdk/src/java.base/unix/classes/sun/nio/fs/UnixUriUtils.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/unix/classes/sun/nio/fs/UnixUriUtils.java Fri Sep 25 12:04:35 2015 -0700
@@ -242,7 +242,7 @@
private static final long L_PATH = L_PCHAR | lowMask(";/");
private static final long H_PATH = H_PCHAR | highMask(";/");
- private final static char[] hexDigits = {
+ private static final char[] hexDigits = {
'0', '1', '2', '3', '4', '5', '6', '7',
'8', '9', 'A', 'B', 'C', 'D', 'E', 'F'
};
--- a/jdk/src/java.base/unix/classes/sun/security/provider/NativePRNG.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/unix/classes/sun/security/provider/NativePRNG.java Fri Sep 25 12:04:35 2015 -0700
@@ -331,10 +331,10 @@
// we buffer data we read from the "next" file for efficiency,
// but we limit the lifetime to avoid using stale bits
// lifetime in ms, currently 100 ms (0.1 s)
- private final static long MAX_BUFFER_TIME = 100;
+ private static final long MAX_BUFFER_TIME = 100;
// size of the "next" buffer
- private final static int BUFFER_SIZE = 32;
+ private static final int BUFFER_SIZE = 32;
// Holder for the seedFile. Used if we ever add seed material.
File seedFile;
--- a/jdk/src/java.base/unix/native/libjava/java_props_md.c Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/unix/native/libjava/java_props_md.c Fri Sep 25 12:04:35 2015 -0700
@@ -91,46 +91,6 @@
return 0;
}
-/* This function sets an environment variable using envstring.
- * The format of envstring is "name=value".
- * If the name has already existed, it will append value to the name.
- */
-static void
-setPathEnvironment(char *envstring)
-{
- char name[20], *value, *current;
-
- value = strchr(envstring, '='); /* locate name and value separator */
-
- if (! value)
- return; /* not a valid environment setting */
-
- /* copy first part as environment name */
- strncpy(name, envstring, value - envstring);
- name[value-envstring] = '\0';
-
- value++; /* set value point to value of the envstring */
-
- current = getenv(name);
- if (current) {
- if (! strstr(current, value)) {
- /* value is not found in current environment, append it */
- char *temp = malloc(strlen(envstring) + strlen(current) + 2);
- strcpy(temp, name);
- strcat(temp, "=");
- strcat(temp, current);
- strcat(temp, ":");
- strcat(temp, value);
- putenv(temp);
- }
- /* else the value has already been set, do nothing */
- }
- else {
- /* environment variable is not found */
- putenv(envstring);
- }
-}
-
#ifndef P_tmpdir
#define P_tmpdir "/var/tmp"
#endif
@@ -628,16 +588,6 @@
sprops.path_separator = ":";
sprops.line_separator = "\n";
-#if !defined(_ALLBSD_SOURCE)
- /* Append CDE message and resource search path to NLSPATH and
- * XFILESEARCHPATH, in order to pick localized message for
- * FileSelectionDialog window (Bug 4173641).
- */
- setPathEnvironment("NLSPATH=/usr/dt/lib/nls/msg/%L/%N.cat");
- setPathEnvironment("XFILESEARCHPATH=/usr/dt/app-defaults/%L/Dt");
-#endif
-
-
#ifdef MACOSX
setProxyProperties(&sprops);
#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/java.base/unix/native/libjimage/osSupport_unix.cpp Fri Sep 25 12:04:35 2015 -0700
@@ -0,0 +1,111 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * 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 <sys/types.h>
+#include <sys/stat.h>
+#include <sys/mman.h>
+#include <fcntl.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+#include "jni.h"
+#include "osSupport.hpp"
+
+/**
+ * Open a regular file read-only.
+ * Return the file descriptor.
+ */
+jint osSupport::openReadOnly(const char *path) {
+ return ::open(path, 0);
+}
+
+/**
+ * Close a file descriptor.
+ */
+jint osSupport::close(jint fd) {
+ return ::close(fd);
+}
+
+/**
+ * Return the size of a regular file.
+ */
+jlong osSupport::size(const char *path) {
+ struct stat statbuf;
+ if (stat(path, &statbuf) < 0 ||
+ (statbuf.st_mode & S_IFREG) != S_IFREG) {
+ return -1;
+ }
+ return (jsize) statbuf.st_size;
+}
+
+/**
+ * Read nBytes at offset into a buffer.
+ */
+jlong osSupport::read(jint fd, char *buf, jlong nBytes, jlong offset) {
+ return ::pread(fd, buf, nBytes, offset);
+}
+
+/**
+ * Map nBytes at offset into memory and return the address.
+ * The system chooses the address.
+ */
+void* osSupport::map_memory(int fd, const char *filename, size_t file_offset, size_t bytes) {
+ void* mapped_address = NULL;
+ mapped_address = (void*) mmap(NULL,
+ bytes, PROT_READ, MAP_SHARED,
+ fd, file_offset);
+ if (mapped_address == MAP_FAILED) {
+ return NULL;
+ }
+ return mapped_address;
+}
+
+/**
+ * Unmap nBytes of memory at address.
+ */
+int osSupport::unmap_memory(void *addr, size_t bytes) {
+ return munmap((char *) addr, bytes) == 0;
+}
+
+/**
+ * A CriticalSection to protect a small section of code.
+ */
+void SimpleCriticalSection::enter() {
+ pthread_mutex_lock(&mutex);
+}
+
+void SimpleCriticalSection::exit() {
+ pthread_mutex_unlock(&mutex);
+
+}
+
+SimpleCriticalSection::SimpleCriticalSection() {
+ pthread_mutex_init(&mutex, NULL);
+}
+
+//SimpleCriticalSection::~SimpleCriticalSection() {
+// pthread_mutex_destroy(&mutex);
+//}
+
--- a/jdk/src/java.base/unix/native/libnet/PlainDatagramSocketImpl.c Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/unix/native/libnet/PlainDatagramSocketImpl.c Fri Sep 25 12:04:35 2015 -0700
@@ -955,17 +955,23 @@
(char *)&arg, sizeof(arg)) < 0) {
JNU_ThrowByName(env, JNU_JAVANETPKG "SocketException",
strerror(errno));
+ close(fd);
return;
}
if (setsockopt(fd, SOL_SOCKET, SO_RCVBUF,
(char *)&arg, sizeof(arg)) < 0) {
JNU_ThrowByName(env, JNU_JAVANETPKG "SocketException",
strerror(errno));
+ close(fd);
return;
}
#endif /* __APPLE__ */
- setsockopt(fd, SOL_SOCKET, SO_BROADCAST, (char*) &t, sizeof(int));
+ if (setsockopt(fd, SOL_SOCKET, SO_BROADCAST, (char*) &t, sizeof (int)) < 0) {
+ JNU_ThrowByName(env, JNU_JAVANETPKG "SocketException", strerror(errno));
+ close(fd);
+ return;
+ }
#if defined(__linux__)
arg = 0;
@@ -986,8 +992,12 @@
*/
if (domain == AF_INET6) {
int ttl = 1;
- setsockopt(fd, IPPROTO_IPV6, IPV6_MULTICAST_HOPS, (char *)&ttl,
- sizeof(ttl));
+ if (setsockopt(fd, IPPROTO_IPV6, IPV6_MULTICAST_HOPS, (char *) &ttl,
+ sizeof (ttl)) < 0) {
+ JNU_ThrowByName(env, JNU_JAVANETPKG "SocketException", strerror(errno));
+ close(fd);
+ return;
+ }
}
#endif /* __linux__ */
--- a/jdk/src/java.base/windows/classes/java/net/DefaultDatagramSocketImplFactory.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/windows/classes/java/net/DefaultDatagramSocketImplFactory.java Fri Sep 25 12:04:35 2015 -0700
@@ -45,7 +45,7 @@
class DefaultDatagramSocketImplFactory
{
- private final static Class<?> prefixImplClass;
+ private static final Class<?> prefixImplClass;
/* the windows version. */
private static float version;
@@ -54,13 +54,13 @@
private static boolean preferIPv4Stack = false;
/* If the version supports a dual stack TCP implementation */
- private final static boolean useDualStackImpl;
+ private static final boolean useDualStackImpl;
/* sun.net.useExclusiveBind */
private static String exclBindProp;
/* True if exclusive binding is on for Windows */
- private final static boolean exclusiveBind;
+ private static final boolean exclusiveBind;
static {
Class<?> prefixImplClassLocal = null;
--- a/jdk/src/java.base/windows/classes/java/net/TwoStacksPlainDatagramSocketImpl.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/windows/classes/java/net/TwoStacksPlainDatagramSocketImpl.java Fri Sep 25 12:04:35 2015 -0700
@@ -212,5 +212,5 @@
/**
* Perform class load-time initializations.
*/
- private native static void init();
+ private static native void init();
}
--- a/jdk/src/java.base/windows/classes/sun/net/PortConfig.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/windows/classes/sun/net/PortConfig.java Fri Sep 25 12:04:35 2015 -0700
@@ -36,7 +36,7 @@
public final class PortConfig {
private static int defaultUpper, defaultLower;
- private final static int upper, lower;
+ private static final int upper, lower;
static {
AccessController.doPrivileged(
--- a/jdk/src/java.base/windows/classes/sun/net/www/protocol/http/ntlm/NTLMAuthSequence.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/windows/classes/sun/net/www/protocol/http/ntlm/NTLMAuthSequence.java Fri Sep 25 12:04:35 2015 -0700
@@ -87,7 +87,7 @@
return status.sequenceComplete;
}
- private native static void initFirst (Class<NTLMAuthSequence.Status> clazz);
+ private static native void initFirst (Class<NTLMAuthSequence.Status> clazz);
private native long getCredentialsHandle (String user, String domain, String password);
--- a/jdk/src/java.base/windows/classes/sun/nio/ch/WindowsSelectorImpl.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/windows/classes/sun/nio/ch/WindowsSelectorImpl.java Fri Sep 25 12:04:35 2015 -0700
@@ -54,7 +54,7 @@
private final int INIT_CAP = 8;
// Maximum number of sockets for select().
// Should be INIT_CAP times a power of 2
- private final static int MAX_SELECTABLE_FDS = 1024;
+ private static final int MAX_SELECTABLE_FDS = 1024;
// The list of SelectableChannels serviced by this Selector. Every mod
// MAX_SELECTABLE_FDS entry is bogus, to align this array with the poll
@@ -85,7 +85,7 @@
private Object closeLock = new Object();
// Maps file descriptors to their indices in pollArray
- private final static class FdMap extends HashMap<Integer, MapEntry> {
+ private static final class FdMap extends HashMap<Integer, MapEntry> {
static final long serialVersionUID = 0L;
private MapEntry get(int desc) {
return get(new Integer(desc));
@@ -103,7 +103,7 @@
}
// class for fdMap entries
- private final static class MapEntry {
+ private static final class MapEntry {
SelectionKeyImpl ski;
long updateCount = 0;
long clearedCount = 0;
--- a/jdk/src/java.base/windows/classes/sun/nio/fs/WindowsConstants.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/windows/classes/sun/nio/fs/WindowsConstants.java Fri Sep 25 12:04:35 2015 -0700
@@ -119,11 +119,11 @@
public static final int FILE_NOTIFY_CHANGE_SECURITY = 0x00000100;
// notify actions
- public final static int FILE_ACTION_ADDED = 0x00000001;
- public final static int FILE_ACTION_REMOVED = 0x00000002;
- public final static int FILE_ACTION_MODIFIED = 0x00000003;
- public final static int FILE_ACTION_RENAMED_OLD_NAME = 0x00000004;
- public final static int FILE_ACTION_RENAMED_NEW_NAME = 0x00000005;
+ public static final int FILE_ACTION_ADDED = 0x00000001;
+ public static final int FILE_ACTION_REMOVED = 0x00000002;
+ public static final int FILE_ACTION_MODIFIED = 0x00000003;
+ public static final int FILE_ACTION_RENAMED_OLD_NAME = 0x00000004;
+ public static final int FILE_ACTION_RENAMED_NEW_NAME = 0x00000005;
// copy flags
public static final int COPY_FILE_FAIL_IF_EXISTS = 0x00000001;
--- a/jdk/src/java.base/windows/classes/sun/nio/fs/WindowsWatchService.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/windows/classes/sun/nio/fs/WindowsWatchService.java Fri Sep 25 12:04:35 2015 -0700
@@ -48,7 +48,7 @@
class WindowsWatchService
extends AbstractWatchService
{
- private final static int WAKEUP_COMPLETION_KEY = 0;
+ private static final int WAKEUP_COMPLETION_KEY = 0;
// background thread to service I/O completion port
private final Poller poller;
@@ -242,7 +242,7 @@
* Background thread to service I/O completion port.
*/
private static class Poller extends AbstractPoller {
- private final static Unsafe UNSAFE = Unsafe.getUnsafe();
+ private static final Unsafe UNSAFE = Unsafe.getUnsafe();
/*
* typedef struct _OVERLAPPED {
--- a/jdk/src/java.base/windows/classes/sun/util/locale/provider/HostLocaleProviderAdapterImpl.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.base/windows/classes/sun/util/locale/provider/HostLocaleProviderAdapterImpl.java Fri Sep 25 12:04:35 2015 -0700
@@ -128,7 +128,7 @@
}
supportedLocaleSet = Collections.unmodifiableSet(tmpSet);
}
- private final static Locale[] supportedLocale = supportedLocaleSet.toArray(new Locale[0]);
+ private static final Locale[] supportedLocale = supportedLocaleSet.toArray(new Locale[0]);
public static DateFormatProvider getDateFormatProvider() {
return new DateFormatProvider() {
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/java.base/windows/native/libjimage/osSupport_windows.cpp Fri Sep 25 12:04:35 2015 -0700
@@ -0,0 +1,133 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * 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 <windows.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <io.h>
+#include <malloc.h>
+
+#include "jni.h"
+#include "osSupport.hpp"
+
+/**
+ * Open a regular file read-only.
+ * Return the file descriptor.
+ */
+jint osSupport::openReadOnly(const char *path) {
+ return ::open(path, 0, 0);
+}
+
+/**
+ * Close a file descriptor.
+ */
+jint osSupport::close(jint fd) {
+ return ::close(fd);
+}
+
+/**
+ * Return the size of a regular file.
+ */
+jlong osSupport::size(const char *path) {
+ struct stat statbuf;
+ if (stat(path, &statbuf) < 0 ||
+ (statbuf.st_mode & S_IFREG) != S_IFREG) {
+ return -1;
+ }
+ return (jlong) statbuf.st_size;
+}
+
+/**
+ * Read nBytes at offset into a buffer.
+ */
+jlong osSupport::read(jint fd, char *buf, jlong nBytes, jlong offset) {
+ OVERLAPPED ov;
+ DWORD nread;
+ BOOL result;
+
+ ZeroMemory(&ov, sizeof (ov));
+ ov.Offset = (DWORD) offset;
+ ov.OffsetHigh = (DWORD) (offset >> 32);
+
+ HANDLE h = (HANDLE)::_get_osfhandle(fd);
+
+ result = ReadFile(h, (LPVOID) buf, (DWORD) nBytes, &nread, &ov);
+
+ return result ? nread : 0;
+}
+
+/**
+ * Map nBytes at offset into memory and return the address.
+ * The system chooses the address.
+ */
+void* osSupport::map_memory(jint fd, const char *file_name, size_t file_offset, size_t bytes) {
+ HANDLE hFile;
+ char* base = NULL;
+
+ // Get a handle to the file
+ hFile = CreateFile(file_name, GENERIC_READ, FILE_SHARE_READ, NULL,
+ OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
+ if (hFile != NULL) {
+ // Create a file mapping handle
+ HANDLE hMap = CreateFileMapping(hFile, NULL, PAGE_READONLY, 0, 0,
+ NULL /* file_name */);
+ if (hMap != NULL) {
+ // Map the file into the address space at the offset
+ base = (char*) MapViewOfFileEx(hMap, FILE_MAP_READ, 0, (DWORD) file_offset,
+ (DWORD) bytes, NULL);
+ CloseHandle(hMap); // The mapping is no longer needed
+ }
+ CloseHandle(hFile); // The file handle is no longer needed
+ }
+ return base;
+}
+
+/**
+ * Unmap nBytes of memory at address.
+ */
+int osSupport::unmap_memory(void* addr, size_t bytes) {
+ BOOL result = UnmapViewOfFile(addr);
+ return result;
+}
+
+/**
+ * A CriticalSection to protect a small section of code.
+ */
+void SimpleCriticalSection::enter() {
+ EnterCriticalSection(&critical_section);
+}
+
+void SimpleCriticalSection::exit() {
+ LeaveCriticalSection(&critical_section);
+}
+
+SimpleCriticalSection::SimpleCriticalSection() {
+ InitializeCriticalSection(&critical_section);
+}
+
+//SimpleCriticalSection::~SimpleCriticalSection() {
+// DeleteCriticalSection(&critical_section);
+//}
+
--- a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaCaret.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaCaret.java Fri Sep 25 12:04:35 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
* 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,19 +36,27 @@
import javax.swing.text.*;
@SuppressWarnings("serial") // Superclass is not serializable across versions
-public class AquaCaret extends DefaultCaret implements UIResource, PropertyChangeListener {
- final boolean isMultiLineEditor;
- final JTextComponent c;
-
- boolean mFocused = false;
+public class AquaCaret extends DefaultCaret
+ implements UIResource, PropertyChangeListener {
- public AquaCaret(final Window inParentWindow, final JTextComponent inComponent) {
- super();
- c = inComponent;
- isMultiLineEditor = (c instanceof JTextArea || c instanceof JEditorPane);
- inComponent.addPropertyChangeListener(this);
+ private boolean isMultiLineEditor;
+ private boolean mFocused = false;
+ private boolean fPainting = false;
+
+ @Override
+ public void install(final JTextComponent c) {
+ super.install(c);
+ isMultiLineEditor = c instanceof JTextArea || c instanceof JEditorPane;
+ c.addPropertyChangeListener(this);
}
+ @Override
+ public void deinstall(final JTextComponent c) {
+ c.removePropertyChangeListener(this);
+ super.deinstall(c);
+ }
+
+ @Override
protected Highlighter.HighlightPainter getSelectionPainter() {
return AquaHighlighter.getInstance();
}
@@ -56,11 +64,13 @@
/**
* Only show the flashing caret if the selection range is zero
*/
+ @Override
public void setVisible(boolean e) {
if (e) e = getDot() == getMark();
super.setVisible(e);
}
+ @Override
protected void fireStateChanged() {
// If we have focus the caret should only flash if the range length is zero
if (mFocused) setVisible(getComponent().isEditable());
@@ -68,6 +78,7 @@
super.fireStateChanged();
}
+ @Override
public void propertyChange(final PropertyChangeEvent evt) {
final String propertyName = evt.getPropertyName();
@@ -87,6 +98,7 @@
// --- FocusListener methods --------------------------
private boolean shouldSelectAllOnFocus = true;
+ @Override
public void focusGained(final FocusEvent e) {
final JTextComponent component = getComponent();
if (!component.isEnabled() || !component.isEditable()) {
@@ -122,12 +134,13 @@
super.focusGained(e);
}
+ @Override
public void focusLost(final FocusEvent e) {
mFocused = false;
shouldSelectAllOnFocus = true;
if (isMultiLineEditor) {
setVisible(false);
- c.repaint();
+ getComponent().repaint();
} else {
super.focusLost(e);
}
@@ -136,6 +149,7 @@
// This fixes the problem where when on the mac you have to ctrl left click to
// get popup triggers the caret has code that only looks at button number.
// see radar # 3125390
+ @Override
public void mousePressed(final MouseEvent e) {
if (!e.isPopupTrigger()) {
super.mousePressed(e);
@@ -153,6 +167,7 @@
* @param r the current location of the caret
* @see #paint
*/
+ @Override
protected synchronized void damage(final Rectangle r) {
if (r == null || fPainting) return;
@@ -182,12 +197,12 @@
repaint();
}
- boolean fPainting = false;
-
- // See <rdar://problem/3833837> 1.4.2_05-141.3: JTextField performance with Aqua L&F
- // We are getting into a circular condition with the BasicCaret paint code since it doesn't know about the fact that our
- // damage routine above elminates the border. Sadly we can't easily change either one, so we will
- // add a painting flag and not damage during a repaint.
+ // See <rdar://problem/3833837> 1.4.2_05-141.3: JTextField performance with
+ // Aqua L&F. We are getting into a circular condition with the BasicCaret
+ // paint code since it doesn't know about the fact that our damage routine
+ // above elminates the border. Sadly we can't easily change either one, so
+ // we will add a painting flag and not damage during a repaint.
+ @Override
public void paint(final Graphics g) {
if (isVisible()) {
fPainting = true;
--- a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaEditorPaneUI.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaEditorPaneUI.java Fri Sep 25 12:04:35 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -39,6 +39,7 @@
}
boolean oldDragState = false;
+ @Override
protected void installDefaults(){
super.installDefaults();
if(!GraphicsEnvironment.isHeadless()){
@@ -47,6 +48,7 @@
}
}
+ @Override
protected void uninstallDefaults(){
if(!GraphicsEnvironment.isHeadless()){
getComponent().setDragEnabled(oldDragState);
@@ -55,12 +57,14 @@
}
FocusListener focusListener;
+ @Override
protected void installListeners(){
super.installListeners();
focusListener = createFocusListener();
getComponent().addFocusListener(focusListener);
}
+ @Override
protected void installKeyboardActions() {
super.installKeyboardActions();
AquaKeyBindings bindings = AquaKeyBindings.instance();
@@ -69,6 +73,7 @@
bindings.installAquaUpDownActions(c);
}
+ @Override
protected void uninstallListeners(){
getComponent().removeFocusListener(focusListener);
super.uninstallListeners();
@@ -78,12 +83,12 @@
return new AquaFocusHandler();
}
- protected Caret createCaret(){
- final Window owningWindow = SwingUtilities.getWindowAncestor(getComponent());
- final AquaCaret returnValue = new AquaCaret(owningWindow, getComponent());
- return returnValue;
+ @Override
+ protected Caret createCaret() {
+ return new AquaCaret();
}
+ @Override
protected Highlighter createHighlighter(){
return new AquaHighlighter();
}
--- a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaImageFactory.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaImageFactory.java Fri Sep 25 12:04:35 2015 -0700
@@ -46,7 +46,7 @@
import com.apple.laf.AquaIcon.SystemIcon;
import com.apple.laf.AquaUtils.RecyclableObject;
import com.apple.laf.AquaUtils.RecyclableSingleton;
-import sun.awt.image.MultiResolutionImage;
+import java.awt.image.MultiResolutionImage;
import sun.awt.image.MultiResolutionCachedImage;
public class AquaImageFactory {
--- a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaInternalFrameUI.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaInternalFrameUI.java Fri Sep 25 12:04:35 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -66,6 +66,7 @@
protected Color fNotSelectedTextColor;
AquaInternalFrameBorder fAquaBorder;
+ private ResizeBox resizeBox;
// for button tracking
boolean fMouseOverPressedButton;
@@ -96,6 +97,7 @@
}
/// Inherit (but be careful to check everything they call):
+ @Override
public void installUI(final JComponent c) {
// super.installUI(c); // Swing 1.1.1 has a bug in installUI - it doesn't check for null northPane
frame = (JInternalFrame)c;
@@ -125,12 +127,14 @@
c.setBorder(new CompoundUIBorder(fIsPallet ? paletteWindowShadow.get() : documentWindowShadow.get(), c.getBorder()));
}
+ @Override
protected void installDefaults() {
super.installDefaults();
fSelectedTextColor = UIManager.getColor("InternalFrame.activeTitleForeground");
fNotSelectedTextColor = UIManager.getColor("InternalFrame.inactiveTitleForeground");
}
+ @Override
public void setSouthPane(final JComponent c) {
if (southPane != null) {
frame.remove(southPane);
@@ -144,6 +148,7 @@
}
static final RecyclableSingleton<Icon> closeIcon = new RecyclableSingleton<Icon>() {
+ @Override
protected Icon getInstance() {
return new AquaInternalFrameButtonIcon(Widget.TITLE_BAR_CLOSE_BOX);
}
@@ -153,6 +158,7 @@
}
static final RecyclableSingleton<Icon> minimizeIcon = new RecyclableSingleton<Icon>() {
+ @Override
protected Icon getInstance() {
return new AquaInternalFrameButtonIcon(Widget.TITLE_BAR_COLLAPSE_BOX);
}
@@ -162,6 +168,7 @@
}
static final RecyclableSingleton<Icon> zoomIcon = new RecyclableSingleton<Icon>() {
+ @Override
protected Icon getInstance() {
return new AquaInternalFrameButtonIcon(Widget.TITLE_BAR_ZOOM_BOX);
}
@@ -175,6 +182,7 @@
painter.state.set(widget);
}
+ @Override
public void paintIcon(final Component c, final Graphics g, final int x, final int y) {
painter.state.set(getStateFor(c));
super.paintIcon(c, g, x, y);
@@ -184,28 +192,24 @@
return State.ROLLOVER;
}
+ @Override
public int getIconWidth() {
return 19;
}
+ @Override
public int getIconHeight() {
return 19;
}
}
+ @Override
protected void installKeyboardActions() {
} //$ Not Mac-ish - should we support?
- protected ResizeBox resizeBox;
+ @Override
protected void installComponents() {
final JLayeredPane layeredPane = frame.getLayeredPane();
- if (resizeBox != null) {
- resizeBox.removeListeners();
- layeredPane.removeComponentListener(resizeBox);
- layeredPane.remove(resizeBox);
- resizeBox = null;
- }
-
resizeBox = new ResizeBox(layeredPane);
resizeBox.repositionResizeBox();
@@ -218,6 +222,7 @@
}
/// Inherit all the listeners - that's the main reason we subclass Basic!
+ @Override
protected void installListeners() {
fPropertyListener = new PropertyListener();
frame.addPropertyChangeListener(fPropertyListener);
@@ -225,22 +230,36 @@
}
// uninstallDefaults
- // uninstallComponents
+
+ @Override
+ protected void uninstallComponents() {
+ super.uninstallComponents();
+ final JLayeredPane layeredPane = frame.getLayeredPane();
+ resizeBox.removeListeners();
+ layeredPane.removeComponentListener(resizeBox);
+ layeredPane.remove(resizeBox);
+ resizeBox = null;
+ }
+
+ @Override
protected void uninstallListeners() {
super.uninstallListeners();
frame.removePropertyChangeListener(fPropertyListener);
}
+ @Override
protected void uninstallKeyboardActions() {
}
// Called when a DesktopIcon replaces an InternalFrame & vice versa
//protected void replacePane(JComponent currentPane, JComponent newPane) {}
+ @Override
protected void installMouseHandlers(final JComponent c) {
c.addMouseListener(borderListener);
c.addMouseMotionListener(borderListener);
}
+ @Override
protected void deinstallMouseHandlers(final JComponent c) {
c.removeMouseListener(borderListener);
c.removeMouseMotionListener(borderListener);
@@ -256,6 +275,7 @@
return map;
}
+ @Override
public Dimension getPreferredSize(JComponent x) {
Dimension preferredSize = super.getPreferredSize(x);
Dimension minimumSize = frame.getMinimumSize();
@@ -268,6 +288,7 @@
return preferredSize;
}
+ @Override
public void setNorthPane(final JComponent c) {
replacePane(northPane, c);
northPane = c;
@@ -278,6 +299,7 @@
* and adds it to the frame.
* Reverse process for the <code>currentPane</code>.
*/
+ @Override
protected void replacePane(final JComponent currentPane, final JComponent newPane) {
if (currentPane != null) {
deinstallMouseHandlers(currentPane);
@@ -290,6 +312,7 @@
}
// Our "Border" listener is shared by the AquaDesktopIcon
+ @Override
protected MouseInputAdapter createBorderListener(final JInternalFrame w) {
return new AquaBorderListener();
}
@@ -374,6 +397,7 @@
protected final int RESIZE_NONE = 0;
private boolean discardRelease = false;
+ @Override
public void mouseClicked(final MouseEvent e) {
if (didForwardEvent(e)) return;
@@ -406,6 +430,7 @@
fAquaBorder.repaintButtonArea(frame);
}
+ @Override
public void mouseReleased(final MouseEvent e) {
if (didForwardEvent(e)) return;
@@ -461,6 +486,7 @@
resizeDir = RESIZE_NONE;
}
+ @Override
public void mousePressed(final MouseEvent e) {
if (didForwardEvent(e)) return;
@@ -527,6 +553,7 @@
return true;
}
+ @Override
public void mouseDragged(final MouseEvent e) {
// do not forward drags
// if (didForwardEvent(e)) return;
@@ -576,6 +603,7 @@
return;
}
+ @Override
public void mouseMoved(final MouseEvent e) {
if (didForwardEvent(e)) return;
updateRollover(e);
@@ -614,7 +642,11 @@
if (hitComponent == null || hitComponent == frame) return false;
final Point hitComponentPoint = SwingUtilities.convertPoint(pane, parentPoint, hitComponent);
- hitComponent.dispatchEvent(new MouseEvent(hitComponent, e.getID(), e.getWhen(), e.getModifiers(), hitComponentPoint.x, hitComponentPoint.y, e.getClickCount(), e.isPopupTrigger(), e.getButton()));
+ hitComponent.dispatchEvent(
+ new MouseEvent(hitComponent, e.getID(), e.getWhen(),
+ e.getModifiers(), hitComponentPoint.x,
+ hitComponentPoint.y, e.getClickCount(),
+ e.isPopupTrigger(), e.getButton()));
return true;
}
@@ -668,6 +700,7 @@
}
class PropertyListener implements PropertyChangeListener {
+ @Override
public void propertyChange(final PropertyChangeEvent e) {
final String name = e.getPropertyName();
if (FRAME_TYPE.equals(name)) {
@@ -704,14 +737,17 @@
} // end class PaletteListener
static final InternalFrameShadow documentWindowShadow = new InternalFrameShadow() {
+ @Override
Border getForegroundShadowBorder() {
return new AquaUtils.SlicedShadowBorder(new Painter() {
+ @Override
public void paint(final Graphics g, final int x, final int y, final int w, final int h) {
g.setColor(new Color(0, 0, 0, 196));
g.fillRoundRect(x, y, w, h, 16, 16);
g.fillRect(x, y + h - 16, w, 16);
}
}, new Painter() {
+ @Override
public void paint(final Graphics g, int x, int y, int w, int h) {
g.setColor(new Color(0, 0, 0, 64));
g.drawLine(x + 2, y - 8, x + w - 2, y - 8);
@@ -720,14 +756,17 @@
0, 7, 1.1f, 1.0f, 24, 51, 51, 25, 25, 25, 25);
}
+ @Override
Border getBackgroundShadowBorder() {
return new AquaUtils.SlicedShadowBorder(new Painter() {
+ @Override
public void paint(final Graphics g, final int x, final int y, final int w, final int h) {
g.setColor(new Color(0, 0, 0, 128));
g.fillRoundRect(x - 3, y - 8, w + 6, h, 16, 16);
g.fillRect(x - 3, y + h - 20, w + 6, 19);
}
}, new Painter() {
+ @Override
public void paint(final Graphics g, int x, int y, int w, int h) {
g.setColor(new Color(0, 0, 0, 32));
g.drawLine(x, y - 11, x + w - 1, y - 11);
@@ -738,8 +777,10 @@
};
static final InternalFrameShadow paletteWindowShadow = new InternalFrameShadow() {
+ @Override
Border getForegroundShadowBorder() {
return new AquaUtils.SlicedShadowBorder(new Painter() {
+ @Override
public void paint(final Graphics g, final int x, final int y, final int w, final int h) {
g.setColor(new Color(0, 0, 0, 128));
g.fillRect(x, y + 3, w, h - 3);
@@ -748,6 +789,7 @@
0, 3, 1.0f, 1.0f, 10, 25, 25, 12, 12, 12, 12);
}
+ @Override
Border getBackgroundShadowBorder() {
return getForegroundShadowBorder();
}
@@ -762,19 +804,23 @@
abstract Border getForegroundShadowBorder();
abstract Border getBackgroundShadowBorder();
+ @Override
protected Border getInstance() {
final Border fgShadow = getForegroundShadowBorder();
final Border bgShadow = getBackgroundShadowBorder();
return new Border() {
+ @Override
public Insets getBorderInsets(final Component c) {
return fgShadow.getBorderInsets(c);
}
+ @Override
public boolean isBorderOpaque() {
return false;
}
+ @Override
public void paintBorder(final Component c, final Graphics g, final int x, final int y, final int w, final int h) {
if (((JInternalFrame)c).isSelected()) {
fgShadow.paintBorder(c, g, x, y, w, h);
@@ -790,6 +836,7 @@
@Override
protected Icon getInstance() {
return new AquaIcon.ScalingJRSUIIcon(11, 11) {
+ @Override
public void initIconPainter(final AquaPainter<JRSUIState> iconState) {
iconState.state.set(Widget.GROW_BOX_TEXTURED);
iconState.state.set(WindowType.UTILITY);
@@ -799,12 +846,15 @@
};
@SuppressWarnings("serial") // Superclass is not serializable across versions
- class ResizeBox extends JLabel implements MouseListener, MouseMotionListener, MouseWheelListener, ComponentListener, PropertyChangeListener, UIResource {
- final JLayeredPane layeredPane;
- Dimension originalSize;
- Point originalLocation;
+ private final class ResizeBox extends JLabel
+ implements MouseListener, MouseMotionListener, MouseWheelListener,
+ ComponentListener, PropertyChangeListener, UIResource {
- public ResizeBox(final JLayeredPane layeredPane) {
+ private final JLayeredPane layeredPane;
+ private Dimension originalSize;
+ private Point originalLocation;
+
+ ResizeBox(final JLayeredPane layeredPane) {
super(RESIZE_ICON.get());
setSize(11, 11);
this.layeredPane = layeredPane;
@@ -895,14 +945,18 @@
return c;
}
+ @Override
public void mouseClicked(final MouseEvent e) {
forwardEventToFrame(e);
}
+ @Override
public void mouseEntered(final MouseEvent e) { }
+ @Override
public void mouseExited(final MouseEvent e) { }
+ @Override
public void mousePressed(final MouseEvent e) {
if (frame == null) return;
@@ -916,6 +970,7 @@
forwardEventToFrame(e);
}
+ @Override
public void mouseReleased(final MouseEvent e) {
if (originalLocation != null) {
resizeInternalFrame(e.getPoint());
@@ -927,13 +982,16 @@
forwardEventToFrame(e);
}
+ @Override
public void mouseDragged(final MouseEvent e) {
resizeInternalFrame(e.getPoint());
repositionResizeBox();
}
+ @Override
public void mouseMoved(final MouseEvent e) { }
+ @Override
public void mouseWheelMoved(final MouseWheelEvent e) {
final Point pt = new Point();
final Component c = getComponentToForwardTo(e, pt);
@@ -945,20 +1003,25 @@
e.getPreciseWheelRotation()));
}
+ @Override
public void componentResized(final ComponentEvent e) {
repositionResizeBox();
}
+ @Override
public void componentShown(final ComponentEvent e) {
repositionResizeBox();
}
+ @Override
public void componentMoved(final ComponentEvent e) {
repositionResizeBox();
}
+ @Override
public void componentHidden(final ComponentEvent e) { }
+ @Override
public void propertyChange(final PropertyChangeEvent evt) {
if (!"resizable".equals(evt.getPropertyName())) return;
setVisible(Boolean.TRUE.equals(evt.getNewValue()));
--- a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaSpinnerUI.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaSpinnerUI.java Fri Sep 25 12:04:35 2015 -0700
@@ -49,12 +49,14 @@
* so we can't subclass!
*/
public class AquaSpinnerUI extends SpinnerUI {
- private static final RecyclableSingleton<? extends PropertyChangeListener> propertyChangeListener = new RecyclableSingletonFromDefaultConstructor<PropertyChangeHandler>(PropertyChangeHandler.class);
+ private static final RecyclableSingleton<? extends PropertyChangeListener> propertyChangeListener
+ = new RecyclableSingletonFromDefaultConstructor<>(PropertyChangeHandler.class);
static PropertyChangeListener getPropertyChangeListener() {
return propertyChangeListener.get();
}
- private static final RecyclableSingleton<ArrowButtonHandler> nextButtonHandler = new RecyclableSingleton<ArrowButtonHandler>() {
+ private static final RecyclableSingleton<ArrowButtonHandler> nextButtonHandler
+ = new RecyclableSingleton<ArrowButtonHandler>() {
@Override
protected ArrowButtonHandler getInstance() {
return new ArrowButtonHandler("increment", true);
@@ -63,7 +65,8 @@
static ArrowButtonHandler getNextButtonHandler() {
return nextButtonHandler.get();
}
- private static final RecyclableSingleton<ArrowButtonHandler> previousButtonHandler = new RecyclableSingleton<ArrowButtonHandler>() {
+ private static final RecyclableSingleton<ArrowButtonHandler> previousButtonHandler
+ = new RecyclableSingleton<ArrowButtonHandler>() {
@Override
protected ArrowButtonHandler getInstance() {
return new ArrowButtonHandler("decrement", false);
@@ -73,8 +76,10 @@
return previousButtonHandler.get();
}
- JSpinner spinner;
- SpinPainter spinPainter;
+ private JSpinner spinner;
+ private SpinPainter spinPainter;
+ private TransparentButton next;
+ private TransparentButton prev;
public static ComponentUI createUI(final JComponent c) {
return new AquaSpinnerUI();
@@ -87,12 +92,13 @@
}
boolean wasOpaque;
+ @Override
public void installUI(final JComponent c) {
this.spinner = (JSpinner)c;
installDefaults();
installListeners();
- final TransparentButton next = createNextButton();
- final TransparentButton prev = createPreviousButton();
+ next = createNextButton();
+ prev = createPreviousButton();
spinPainter = new SpinPainter(next, prev);
maybeAdd(next, "Next");
@@ -111,11 +117,21 @@
spinner.setOpaque(false);
}
+ @Override
public void uninstallUI(final JComponent c) {
uninstallDefaults();
uninstallListeners();
spinner.setOpaque(wasOpaque);
+ spinPainter = null;
spinner = null;
+ // AquaButtonUI install some listeners to all parents, which means that
+ // we need to uninstall UI here to remove those listeners, because after
+ // we remove them from spinner we lost the latest reference to them,
+ // and our standard uninstallUI machinery will not call them.
+ next.getUI().uninstallUI(next);
+ prev.getUI().uninstallUI(prev);
+ next = null;
+ prev = null;
c.removeAll();
}
@@ -164,6 +180,7 @@
/**
* {@inheritDoc}
*/
+ @Override
public int getBaseline(JComponent c, int width, int height) {
super.getBaseline(c, width, height);
JComponent editor = spinner.getEditor();
@@ -182,6 +199,7 @@
/**
* {@inheritDoc}
*/
+ @Override
public Component.BaselineResizeBehavior getBaselineResizeBehavior(
JComponent c) {
super.getBaselineResizeBehavior(c);
@@ -200,8 +218,10 @@
interceptRepaints = true;
}
+ @Override
public void paint(final Graphics g) {}
+ @Override
public void repaint() {
// only intercept repaints if we are after this has been initialized
// otherwise we can't talk to our containing class
@@ -315,6 +335,7 @@
return (src instanceof JSpinner) ? (JSpinner)src : null;
}
+ @Override
public void actionPerformed(final ActionEvent e) {
if (!(e.getSource() instanceof javax.swing.Timer)) {
// Most likely resulting from being in ActionMap.
@@ -423,6 +444,7 @@
return -1;
}
+ @Override
public void mousePressed(final MouseEvent e) {
if (!SwingUtilities.isLeftMouseButton(e) || !e.getComponent().isEnabled()) return;
spinner = eventToSpinner(e);
@@ -431,13 +453,17 @@
focusSpinnerIfNecessary();
}
+ @Override
public void mouseReleased(final MouseEvent e) {
autoRepeatTimer.stop();
spinner = null;
}
+ @Override
public void mouseClicked(final MouseEvent e) {}
+ @Override
public void mouseEntered(final MouseEvent e) {}
+ @Override
public void mouseExited(final MouseEvent e) {}
/**
@@ -485,6 +511,7 @@
}
}
+ @Override
public void paint(final Graphics g) {
if (spinner.isOpaque()) {
g.setColor(spinner.getBackground());
@@ -511,6 +538,7 @@
painter.paint(g, spinner, 0, 0, bounds.width, bounds.height);
}
+ @Override
public Dimension getPreferredSize() {
final Size size = AquaUtilControlSize.getUserSizeFrom(this);
@@ -533,6 +561,7 @@
private Component editor = null;
private Component painter = null;
+ @Override
public void addLayoutComponent(final String name, final Component c) {
if ("Next".equals(name)) {
nextButton = c;
@@ -545,6 +574,7 @@
}
}
+ @Override
public void removeLayoutComponent(Component c) {
if (c == nextButton) {
c = null;
@@ -561,6 +591,7 @@
return (c == null) ? new Dimension(0, 0) : c.getPreferredSize();
}
+ @Override
public Dimension preferredLayoutSize(final Container parent) {
// Dimension nextD = preferredSize(nextButton);
// Dimension previousD = preferredSize(previousButton);
@@ -579,6 +610,7 @@
return size;
}
+ @Override
public Dimension minimumLayoutSize(final Container parent) {
return preferredLayoutSize(parent);
}
@@ -589,6 +621,7 @@
}
}
+ @Override
public void layoutContainer(final Container parent) {
final Insets insets = parent.getInsets();
final int availWidth = parent.getWidth() - (insets.left + insets.right);
@@ -629,6 +662,7 @@
* property changes are delegated to protected methods.
*/
static class PropertyChangeHandler implements PropertyChangeListener {
+ @Override
public void propertyChange(final PropertyChangeEvent e) {
final String propertyName = e.getPropertyName();
final JSpinner spinner = (JSpinner)(e.getSource());
--- a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaTabbedPaneUI.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaTabbedPaneUI.java Fri Sep 25 12:04:35 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -95,6 +95,17 @@
super.assureRectsCreated(tabCount);
}
+ @Override
+ protected void uninstallListeners() {
+ // We're not just a mouseListener, we're a mouseMotionListener
+ if (mouseListener instanceof MouseHandler) {
+ final MouseHandler mh = (MouseHandler) mouseListener;
+ mh.dispose();
+ tabPane.removeMouseMotionListener(mh);
+ }
+ super.uninstallListeners();
+ }
+
protected void uninstallDefaults() {
contentDrawingInsets.set(0, 0, 0, 0);
}
@@ -409,7 +420,15 @@
paintTabNormalFromRect(g, tabPlacement, rects[tabIndex], tabIndex, fIconRect, fTextRect, active, frameActive, isLeftToRight);
}
- protected void paintTabNormalFromRect(final Graphics g, final int tabPlacement, final Rectangle tabRect, final int nonRectIndex, final Rectangle iconRect, final Rectangle textRect, final boolean active, final boolean frameActive, final boolean isLeftToRight) {
+ protected void paintTabNormalFromRect(final Graphics g,
+ final int tabPlacement,
+ final Rectangle tabRect,
+ final int nonRectIndex,
+ final Rectangle iconRect,
+ final Rectangle textRect,
+ final boolean active,
+ final boolean frameActive,
+ final boolean isLeftToRight) {
final int selectedIndex = tabPane.getSelectedIndex();
final boolean isSelected = selectedIndex == nonRectIndex;
@@ -420,7 +439,12 @@
paintContents(g, tabPlacement, nonRectIndex, tabRect, iconRect, textRect, isSelected);
}
- protected void paintCUITab(final Graphics g, final int tabPlacement, final Rectangle tabRect, final boolean isSelected, final boolean frameActive, final boolean isLeftToRight, final int nonRectIndex) {
+ protected void paintCUITab(final Graphics g, final int tabPlacement,
+ final Rectangle tabRect,
+ final boolean isSelected,
+ final boolean frameActive,
+ final boolean isLeftToRight,
+ final int nonRectIndex) {
final int tabCount = tabPane.getTabCount();
final boolean needsLeftScrollTab = visibleTabState.needsLeftScrollTab();
@@ -835,14 +859,20 @@
}
}
- public class MouseHandler extends MouseInputAdapter implements ActionListener {
- protected int trackingTab = -3;
- protected Timer popupTimer = new Timer(500, this);
+ class MouseHandler extends MouseInputAdapter implements ActionListener {
+
+ int trackingTab = -3;
+ private final Timer popupTimer = new Timer(500, this);
- public MouseHandler() {
+ MouseHandler() {
popupTimer.setRepeats(false);
}
+ void dispose (){
+ popupTimer.removeActionListener(this);
+ popupTimer.stop();
+ }
+
public void mousePressed(final MouseEvent e) {
final JTabbedPane pane = (JTabbedPane)e.getSource();
if (!pane.isEnabled()) {
--- a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaTextAreaUI.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaTextAreaUI.java Fri Sep 25 12:04:35 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
* 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 @@
}
AquaFocusHandler handler;
+ @Override
protected void installListeners() {
super.installListeners();
@@ -53,6 +54,7 @@
AquaUtilControlSize.addSizePropertyListener(c);
}
+ @Override
protected void uninstallListeners() {
final JTextComponent c = getComponent();
@@ -66,6 +68,7 @@
}
boolean oldDragState = false;
+ @Override
protected void installDefaults() {
if (!GraphicsEnvironment.isHeadless()) {
oldDragState = getComponent().getDragEnabled();
@@ -74,6 +77,7 @@
super.installDefaults();
}
+ @Override
protected void uninstallDefaults() {
if (!GraphicsEnvironment.isHeadless()) {
getComponent().setDragEnabled(oldDragState);
@@ -81,7 +85,9 @@
super.uninstallDefaults();
}
- // Install a default keypress action which handles Cmd and Option keys properly
+ // Install a default keypress action which handles Cmd and Option keys
+ // properly
+ @Override
protected void installKeyboardActions() {
super.installKeyboardActions();
AquaKeyBindings bindings = AquaKeyBindings.instance();
@@ -90,13 +96,12 @@
bindings.installAquaUpDownActions(c);
}
+ @Override
protected Caret createCaret() {
- final JTextComponent c = getComponent();
- final Window owningWindow = SwingUtilities.getWindowAncestor(c);
- final AquaCaret returnValue = new AquaCaret(owningWindow, c);
- return returnValue;
+ return new AquaCaret();
}
+ @Override
protected Highlighter createHighlighter() {
return new AquaHighlighter();
}
--- a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaTextFieldUI.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaTextFieldUI.java Fri Sep 25 12:04:35 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
* 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 @@
protected JComponentPainter delegate;
protected AquaFocusHandler handler;
+ @Override
protected void installListeners() {
super.installListeners();
@@ -55,6 +56,7 @@
AquaTextFieldSearch.installSearchFieldListener(c);
}
+ @Override
protected void uninstallListeners() {
final JTextComponent c = getComponent();
AquaTextFieldSearch.uninstallSearchFieldListener(c);
@@ -67,6 +69,7 @@
}
boolean oldDragState = false;
+ @Override
protected void installDefaults() {
if (!GraphicsEnvironment.isHeadless()) {
oldDragState = getComponent().getDragEnabled();
@@ -76,6 +79,7 @@
super.installDefaults();
}
+ @Override
protected void uninstallDefaults() {
super.uninstallDefaults();
@@ -84,12 +88,15 @@
}
}
- // Install a default keypress action which handles Cmd and Option keys properly
+ // Install a default keypress action which handles Cmd and Option keys
+ // properly
+ @Override
protected void installKeyboardActions() {
super.installKeyboardActions();
AquaKeyBindings.instance().setDefaultAction(getKeymapName());
}
+ @Override
protected Rectangle getVisibleEditorRect() {
final Rectangle rect = super.getVisibleEditorRect();
if (rect == null) return null;
@@ -102,6 +109,7 @@
return rect;
}
+ @Override
protected void paintSafely(final Graphics g) {
paintBackgroundSafely(g);
super.paintSafely(g);
@@ -149,20 +157,23 @@
// the common case
final int shrinkage = AquaTextFieldBorder.getShrinkageFor(c, height);
- g.fillRect(insets.left - 2, insets.top - shrinkage - 1, width - insets.right - insets.left + 4, height - insets.bottom - insets.top + shrinkage * 2 + 2);
+ g.fillRect(insets.left - 2, insets.top - shrinkage - 1,
+ width - insets.right - insets.left + 4,
+ height - insets.bottom - insets.top + shrinkage * 2 + 2);
}
+ @Override
protected void paintBackground(final Graphics g) {
// we have already ensured that the background is painted to our liking
// by paintBackgroundSafely(), called from paintSafely().
}
+ @Override
protected Caret createCaret() {
- final JTextComponent c = getComponent();
- final Window owningWindow = SwingUtilities.getWindowAncestor(c);
- return new AquaCaret(owningWindow, c);
+ return new AquaCaret();
}
+ @Override
protected Highlighter createHighlighter() {
return new AquaHighlighter();
}
--- a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaTextPaneUI.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaTextPaneUI.java Fri Sep 25 12:04:35 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
* 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,6 +43,7 @@
}
AquaFocusHandler handler;
+ @Override
protected void installListeners() {
super.installListeners();
final JComponent c = getComponent();
@@ -52,6 +53,7 @@
AquaUtilControlSize.addSizePropertyListener(c);
}
+ @Override
protected void uninstallListeners() {
final JComponent c = getComponent();
AquaUtilControlSize.removeSizePropertyListener(c);
@@ -62,6 +64,7 @@
}
boolean oldDragState = false;
+ @Override
protected void installDefaults() {
final JTextComponent c = getComponent();
if (!GraphicsEnvironment.isHeadless()) {
@@ -71,6 +74,7 @@
super.installDefaults();
}
+ @Override
protected void uninstallDefaults() {
if (!GraphicsEnvironment.isHeadless()) {
getComponent().setDragEnabled(oldDragState);
@@ -78,7 +82,9 @@
super.uninstallDefaults();
}
- // Install a default keypress action which handles Cmd and Option keys properly
+ // Install a default keypress action which handles Cmd and Option keys
+ // properly
+ @Override
protected void installKeyboardActions() {
super.installKeyboardActions();
AquaKeyBindings bindings = AquaKeyBindings.instance();
@@ -88,12 +94,12 @@
bindings.installAquaUpDownActions(c);
}
+ @Override
protected Caret createCaret() {
- final JTextComponent c = getComponent();
- final Window owningWindow = SwingUtilities.getWindowAncestor(c);
- return new AquaCaret(owningWindow, c);
+ return new AquaCaret();
}
+ @Override
protected Highlighter createHighlighter() {
return new AquaHighlighter();
}
--- a/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CImage.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CImage.java Fri Sep 25 12:04:35 2015 -0700
@@ -31,7 +31,7 @@
import java.util.Arrays;
import java.util.List;
-import sun.awt.image.MultiResolutionImage;
+import java.awt.image.MultiResolutionImage;
import sun.awt.image.MultiResolutionCachedImage;
import sun.awt.image.SunWritableRaster;
--- a/jdk/src/java.desktop/share/classes/com/sun/media/sound/SoftMidiAudioFileReader.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.desktop/share/classes/com/sun/media/sound/SoftMidiAudioFileReader.java Fri Sep 25 12:04:35 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved.
* 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,8 @@
package com.sun.media.sound;
-import java.io.File;
import java.io.IOException;
import java.io.InputStream;
-import java.net.URL;
import javax.sound.midi.InvalidMidiDataException;
import javax.sound.midi.MetaMessage;
@@ -44,28 +42,27 @@
import javax.sound.sampled.AudioFormat;
import javax.sound.sampled.AudioInputStream;
import javax.sound.sampled.UnsupportedAudioFileException;
-import javax.sound.sampled.spi.AudioFileReader;
/**
* MIDI File Audio Renderer/Reader.
*
* @author Karl Helgason
*/
-public final class SoftMidiAudioFileReader extends AudioFileReader {
+public final class SoftMidiAudioFileReader extends SunFileReader {
+
+ private static final Type MIDI = new Type("MIDI", "mid");
- public static final Type MIDI = new Type("MIDI", "mid");
- private static AudioFormat format = new AudioFormat(44100, 16, 2, true, false);
+ private static final AudioFormat format = new AudioFormat(44100, 16, 2,
+ true, false);
- public AudioFileFormat getAudioFileFormat(Sequence seq)
- throws UnsupportedAudioFileException, IOException {
-
+ private static AudioFileFormat getAudioFileFormat(final Sequence seq) {
long totallen = seq.getMicrosecondLength() / 1000000;
long len = (long) (format.getFrameRate() * (totallen + 4));
return new AudioFileFormat(MIDI, format, (int) len);
}
- public AudioInputStream getAudioInputStream(Sequence seq)
- throws UnsupportedAudioFileException, IOException {
+ private AudioInputStream getAudioInputStream(final Sequence seq)
+ throws InvalidMidiDataException {
AudioSynthesizer synth = (AudioSynthesizer) new SoftSynthesizer();
AudioInputStream stream;
Receiver recv;
@@ -73,7 +70,7 @@
stream = synth.openStream(format, null);
recv = synth.getReceiver();
} catch (MidiUnavailableException e) {
- throw new IOException(e.toString());
+ throw new InvalidMidiDataException(e.toString());
}
float divtype = seq.getDivisionType();
Track[] tracks = seq.getTracks();
@@ -111,7 +108,7 @@
if (((MetaMessage) msg).getType() == 0x51) {
byte[] data = ((MetaMessage) msg).getData();
if (data.length < 3) {
- throw new UnsupportedAudioFileException();
+ throw new InvalidMidiDataException();
}
mpq = ((data[0] & 0xff) << 16)
| ((data[1] & 0xff) << 8) | (data[2] & 0xff);
@@ -128,91 +125,25 @@
return stream;
}
- public AudioInputStream getAudioInputStream(InputStream inputstream)
+ @Override
+ public AudioInputStream getAudioInputStream(final InputStream stream)
throws UnsupportedAudioFileException, IOException {
-
- inputstream.mark(200);
- Sequence seq;
+ stream.mark(200);
try {
- seq = MidiSystem.getSequence(inputstream);
- } catch (InvalidMidiDataException e) {
- inputstream.reset();
- throw new UnsupportedAudioFileException();
- } catch (IOException e) {
- inputstream.reset();
+ return getAudioInputStream(MidiSystem.getSequence(stream));
+ } catch (final InvalidMidiDataException ignored) {
+ stream.reset();
throw new UnsupportedAudioFileException();
}
- return getAudioInputStream(seq);
- }
-
- public AudioFileFormat getAudioFileFormat(URL url)
- throws UnsupportedAudioFileException, IOException {
- Sequence seq;
- try {
- seq = MidiSystem.getSequence(url);
- } catch (InvalidMidiDataException e) {
- throw new UnsupportedAudioFileException();
- } catch (IOException e) {
- throw new UnsupportedAudioFileException();
- }
- return getAudioFileFormat(seq);
- }
-
- public AudioFileFormat getAudioFileFormat(File file)
- throws UnsupportedAudioFileException, IOException {
- Sequence seq;
- try {
- seq = MidiSystem.getSequence(file);
- } catch (InvalidMidiDataException e) {
- throw new UnsupportedAudioFileException();
- } catch (IOException e) {
- throw new UnsupportedAudioFileException();
- }
- return getAudioFileFormat(seq);
}
- public AudioInputStream getAudioInputStream(URL url)
+ @Override
+ AudioFileFormat getAudioFileFormatImpl(final InputStream stream)
throws UnsupportedAudioFileException, IOException {
- Sequence seq;
try {
- seq = MidiSystem.getSequence(url);
- } catch (InvalidMidiDataException e) {
- throw new UnsupportedAudioFileException();
- } catch (IOException e) {
+ return getAudioFileFormat(MidiSystem.getSequence(stream));
+ } catch (final InvalidMidiDataException ignored) {
throw new UnsupportedAudioFileException();
}
- return getAudioInputStream(seq);
- }
-
- public AudioInputStream getAudioInputStream(File file)
- throws UnsupportedAudioFileException, IOException {
- if (!file.getName().toLowerCase().endsWith(".mid"))
- throw new UnsupportedAudioFileException();
- Sequence seq;
- try {
- seq = MidiSystem.getSequence(file);
- } catch (InvalidMidiDataException e) {
- throw new UnsupportedAudioFileException();
- } catch (IOException e) {
- throw new UnsupportedAudioFileException();
- }
- return getAudioInputStream(seq);
- }
-
- public AudioFileFormat getAudioFileFormat(InputStream inputstream)
- throws UnsupportedAudioFileException, IOException {
-
- inputstream.mark(200);
- Sequence seq;
- try {
- seq = MidiSystem.getSequence(inputstream);
- } catch (InvalidMidiDataException e) {
- inputstream.reset();
- throw new UnsupportedAudioFileException();
- } catch (IOException e) {
- inputstream.reset();
- throw new UnsupportedAudioFileException();
- }
- return getAudioFileFormat(seq);
}
}
--- a/jdk/src/java.desktop/share/classes/com/sun/media/sound/SunFileReader.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.desktop/share/classes/com/sun/media/sound/SunFileReader.java Fri Sep 25 12:04:35 2015 -0700
@@ -52,10 +52,6 @@
try {
return getAudioFileFormatImpl(stream);
} finally {
- // According to specification the following is not strictly
- // necessary, if we got correct format. But it was implemented like
- // that in 1.3.0 - 1.8. So I leave it as it was, but it seems
- // specification should be updated.
stream.reset();
}
}
--- a/jdk/src/java.desktop/share/classes/java/awt/EventQueue.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.desktop/share/classes/java/awt/EventQueue.java Fri Sep 25 12:04:35 2015 -0700
@@ -899,11 +899,13 @@
}
}
- // Wake up EDT waiting in getNextEvent(), so it can
- // pick up a new EventQueue. Post the waking event before
- // topQueue.nextQueue is assigned, otherwise the event would
- // go newEventQueue
- topQueue.postEventPrivate(new InvocationEvent(topQueue, dummyRunnable));
+ if (topQueue.dispatchThread != null) {
+ // Wake up EDT waiting in getNextEvent(), so it can
+ // pick up a new EventQueue. Post the waking event before
+ // topQueue.nextQueue is assigned, otherwise the event would
+ // go newEventQueue
+ topQueue.postEventPrivate(new InvocationEvent(topQueue, dummyRunnable));
+ }
newEventQueue.previousQueue = topQueue;
topQueue.nextQueue = newEventQueue;
--- a/jdk/src/java.desktop/share/classes/java/awt/Font.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.desktop/share/classes/java/awt/Font.java Fri Sep 25 12:04:35 2015 -0700
@@ -128,7 +128,9 @@
* <p>
* For a discussion of the relative advantages and disadvantages of using
* physical or logical fonts, see the
- * <a href="http://www.oracle.com/technetwork/java/javase/tech/faq-jsp-138165.html">Internationalization FAQ</a>
+ * <a href="https://docs.oracle.com/javase/tutorial/2d/text/fonts.html#advantages-and-disadvantages">
+ * Physical and Logical Fonts</a>
+ * in <a href="https://docs.oracle.com/javase/tutorial/index.html">The Java Tutorials</a>
* document.
*
* <h3>Font Faces and Names</h3>
--- a/jdk/src/java.desktop/share/classes/java/awt/RenderingHints.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.desktop/share/classes/java/awt/RenderingHints.java Fri Sep 25 12:04:35 2015 -0700
@@ -955,6 +955,64 @@
SunHints.VALUE_STROKE_PURE;
/**
+ * Image resolution variant hint key.
+ * The {@code RESOLUTION_VARIANT} hint controls which image resolution
+ * variant should be chosen for image drawing.
+ *
+ * <ul>
+ * <li>{@link #VALUE_RESOLUTION_VARIANT_DEFAULT}
+ * <li>{@link #VALUE_RESOLUTION_VARIANT_BASE}
+ * <li>{@link #VALUE_RESOLUTION_VARIANT_SIZE_FIT}
+ * <li>{@link #VALUE_RESOLUTION_VARIANT_DPI_FIT}
+ * </ul>
+ * @since 1.9
+ */
+ public static final Key KEY_RESOLUTION_VARIANT =
+ SunHints.KEY_RESOLUTION_VARIANT;
+
+ /**
+ * Image resolution variant hint value -- an image resolution variant is
+ * chosen based on a default heuristic which may depend on the policies
+ * of the platform
+ *
+ * @see #KEY_RESOLUTION_VARIANT
+ * @since 1.9
+ */
+ public static final Object VALUE_RESOLUTION_VARIANT_DEFAULT =
+ SunHints.VALUE_RESOLUTION_VARIANT_DEFAULT;
+
+ /**
+ * Image resolution variant hint value -- the standard resolution of an image
+ * is always used.
+ *
+ * @see #KEY_RESOLUTION_VARIANT
+ * @since 1.9
+ */
+ public static final Object VALUE_RESOLUTION_VARIANT_BASE =
+ SunHints.VALUE_RESOLUTION_VARIANT_BASE;
+
+ /**
+ * Image resolution variant hint value -- an image resolution variant is
+ * chosen based on the DPI of the screen and the transform in the Graphics2D
+ * context.
+ *
+ * @see #KEY_RESOLUTION_VARIANT
+ * @since 1.9
+ */
+ public static final Object VALUE_RESOLUTION_VARIANT_SIZE_FIT =
+ SunHints.VALUE_RESOLUTION_VARIANT_SIZE_FIT;
+
+ /**
+ * Image resolution variant hint value -- an image resolution variant is
+ * chosen based only on the DPI of the screen.
+ *
+ * @see #KEY_RESOLUTION_VARIANT
+ * @since 1.9
+ */
+ public static final Object VALUE_RESOLUTION_VARIANT_DPI_FIT =
+ SunHints.VALUE_RESOLUTION_VARIANT_DPI_FIT;
+
+ /**
* Constructs a new object with keys and values initialized
* from the specified Map object which may be null.
* @param init a map of key/value pairs to initialize the hints
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/java.desktop/share/classes/java/awt/image/AbstractMultiResolutionImage.java Fri Sep 25 12:04:35 2015 -0700
@@ -0,0 +1,102 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * 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.awt.image;
+
+import java.awt.Graphics;
+import java.awt.Image;
+
+/**
+ * This class provides default implementations of several {@code Image} methods
+ * for classes that want to implement the {@MultiResolutionImage} interface.
+ *
+ * For example,
+ * <pre> {@code
+ * public class CustomMultiResolutionImage extends AbstractMultiResolutionImage {
+ *
+ * final Image[] resolutionVariants;
+ *
+ * public CustomMultiResolutionImage(Image... resolutionVariants) {
+ * this.resolutionVariants = resolutionVariants;
+ * }
+ *
+ * public Image getResolutionVariant(
+ * double destImageWidth, double destImageHeight) {
+ * // return a resolution variant based on the given destination image size
+ * }
+ *
+ * public List<Image> getResolutionVariants() {
+ * return Collections.unmodifiableList(Arrays.asList(resolutionVariants));
+ * }
+ *
+ * protected Image getBaseImage() {
+ * return resolutionVariants[0];
+ * }
+ * }
+ * } </pre>
+ *
+ * @see java.awt.Image
+ * @see java.awt.image.MultiResolutionImage
+ *
+ * @since 1.9
+ */
+public abstract class AbstractMultiResolutionImage extends java.awt.Image
+ implements MultiResolutionImage {
+
+ @Override
+ public int getWidth(ImageObserver observer) {
+ return getBaseImage().getWidth(observer);
+ }
+
+ @Override
+ public int getHeight(ImageObserver observer) {
+ return getBaseImage().getHeight(observer);
+ }
+
+ @Override
+ public ImageProducer getSource() {
+ return getBaseImage().getSource();
+ }
+
+ @Override
+ public Graphics getGraphics() {
+ throw new UnsupportedOperationException("getGraphics() not supported"
+ + " on Multi-Resolution Images");
+ }
+
+ @Override
+ public Object getProperty(String name, ImageObserver observer) {
+ return getBaseImage().getProperty(name, observer);
+ }
+
+ /**
+ * Return the base image representing the best version of the image for
+ * rendering at the default width and height.
+ *
+ * @return the base image of the set of multi-resolution images
+ *
+ * @since 1.9
+ */
+ protected abstract Image getBaseImage();
+}
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/java.desktop/share/classes/java/awt/image/BaseMultiResolutionImage.java Fri Sep 25 12:04:35 2015 -0700
@@ -0,0 +1,150 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * 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.awt.image;
+
+import java.awt.Image;
+import java.util.List;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Objects;
+
+/**
+ * This class is an array-based implementation of
+ * the {@code AbstractMultiResolutionImage} class.
+ *
+ * This class will implement the
+ * {@code getResolutionVariant(double destImageWidth, double destImageHeight)}
+ * method using a simple algorithm which will return the first image variant
+ * in the array that is large enough to satisfy the rendering request. The
+ * last image in the array will be returned if no suitable image is found
+ * that is as large as the rendering request.
+ * <p>
+ * For best effect the array of images should be sorted with each image being
+ * both wider and taller than the previous image. The base image need not be
+ * the first image in the array. No exception will be thrown if the images
+ * are not sorted as suggested.
+ *
+ * @see java.awt.Image
+ * @see java.awt.image.MultiResolutionImage
+ * @see java.awt.image.AbstractMultiResolutionImage
+ *
+ * @since 1.9
+ */
+public class BaseMultiResolutionImage extends AbstractMultiResolutionImage {
+
+ private final int baseImageIndex;
+ private final Image[] resolutionVariants;
+
+ /**
+ * Creates a multi-resolution image with the given resolution variants.
+ * The first resolution variant is used as the base image.
+ *
+ * @param resolutionVariants array of resolution variants sorted by image size
+ * @throws IllegalArgumentException if null or zero-length array is passed
+ * @throws NullPointerException if the specified {@code resolutionVariants}
+ * contains one or more null elements
+ *
+ * @since 1.9
+ */
+ public BaseMultiResolutionImage(Image... resolutionVariants) {
+ this(0, resolutionVariants);
+ }
+
+ /**
+ * Creates a multi-resolution image with the given base image index and
+ * resolution variants.
+ *
+ * @param baseImageIndex the index of base image in the resolution variants
+ * array
+ * @param resolutionVariants array of resolution variants sorted by image size
+ * @throws IllegalArgumentException if null or zero-length array is passed
+ * @throws NullPointerException if the specified {@code resolutionVariants}
+ * contains one or more null elements
+ * @throws IndexOutOfBoundsException if {@code baseImageIndex} is
+ * negative or greater than or equal to {@code resolutionVariants}
+ * length.
+ *
+ * @since 1.9
+ */
+ public BaseMultiResolutionImage(int baseImageIndex,
+ Image... resolutionVariants) {
+
+ if (resolutionVariants == null || resolutionVariants.length == 0) {
+ throw new IllegalArgumentException(
+ "Null or zero-length array is passed");
+ }
+
+ if (baseImageIndex < 0 || baseImageIndex >= resolutionVariants.length) {
+ throw new IndexOutOfBoundsException("Invalid base image index: "
+ + baseImageIndex);
+ }
+
+ this.baseImageIndex = baseImageIndex;
+ this.resolutionVariants = Arrays.copyOf(resolutionVariants,
+ resolutionVariants.length);
+
+ for (Image resolutionVariant : this.resolutionVariants) {
+ Objects.requireNonNull(resolutionVariant,
+ "Resolution variant can't be null");
+ }
+ }
+
+ @Override
+ public Image getResolutionVariant(double destImageWidth,
+ double destImageHeight) {
+
+ checkSize(destImageWidth, destImageHeight);
+
+ for (Image rvImage : resolutionVariants) {
+ if (destImageWidth <= rvImage.getWidth(null)
+ && destImageHeight <= rvImage.getHeight(null)) {
+ return rvImage;
+ }
+ }
+ return resolutionVariants[resolutionVariants.length - 1];
+ }
+
+ private static void checkSize(double width, double height) {
+ if (width <= 0 || height <= 0) {
+ throw new IllegalArgumentException(String.format(
+ "Width (%s) or height (%s) cannot be <= 0", width, height));
+ }
+
+ if (!Double.isFinite(width) || !Double.isFinite(height)) {
+ throw new IllegalArgumentException(String.format(
+ "Width (%s) or height (%s) is not finite", width, height));
+ }
+ }
+
+ @Override
+ public List<Image> getResolutionVariants() {
+ return Collections.unmodifiableList(Arrays.asList(resolutionVariants));
+ }
+
+ @Override
+ protected Image getBaseImage() {
+ return resolutionVariants[baseImageIndex];
+ }
+}
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/java.desktop/share/classes/java/awt/image/MultiResolutionImage.java Fri Sep 25 12:04:35 2015 -0700
@@ -0,0 +1,84 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * 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.awt.image;
+
+import java.awt.Image;
+import java.util.List;
+
+/**
+ * This interface is designed to be an optional additional API supported by
+ * some implementations of {@link java.awt.Image} to allow them to provide
+ * alternate images for various rendering resolutions. The various
+ * {@code Graphics.drawImage(...)} variant methods will consult the methods
+ * of this interface if it is implemented on the argument {@code Image} object
+ * in order to choose the best representation to use for each rendering operation.
+ * <p>
+ * The {@code MultiResolutionImage} interface should be implemented by any
+ * subclass of {@code java.awt.Image} whose instances are intended to provide
+ * image resolution variants according to the given image width and height.
+ * For convenience, toolkit images obtained from
+ * {@code Toolkit.getImage(String name)} and {@code Toolkit.getImage(URL url)}
+ * will implement this interface on platforms that support naming conventions
+ * for resolution variants of stored image media and the
+ * {@code AbstractMultiResolutionImage} and {@code BaseMultiResolutionImage}
+ * classes are provided to facilitate easy construction of custom multi-resolution
+ * images from a list of related images.
+ *
+ * @see java.awt.Image
+ * @see java.awt.image.AbstractMultiResolutionImage
+ * @see java.awt.image.BaseMultiResolutionImage
+ * @see java.awt.Toolkit#getImage(java.lang.String filename)
+ * @see java.awt.Toolkit#getImage(java.net.URL url)
+ *
+ * @since 1.9
+ */
+public interface MultiResolutionImage {
+
+ /**
+ * Gets a specific image that is the best variant to represent
+ * this logical image at the indicated size.
+ *
+ * @param destImageWidth the width of the destination image, in pixels.
+ * @param destImageHeight the height of the destination image, in pixels.
+ * @return image resolution variant.
+ * @throws IllegalArgumentException if {@code destImageWidth} or
+ * {@code destImageHeight} is less than or equal to zero, infinity,
+ * or NaN.
+ *
+ * @since 1.9
+ */
+ Image getResolutionVariant(double destImageWidth, double destImageHeight);
+
+ /**
+ * Gets a readable list of all resolution variants.
+ * The list must be nonempty and contain at least one resolution variant.
+ * <p>
+ * Note that many implementations might return an unmodifiable list.
+ * <p>
+ * @return list of resolution variants.
+ * @since 1.9
+ */
+ public List<Image> getResolutionVariants();
+}
\ No newline at end of file
--- a/jdk/src/java.desktop/share/classes/java/beans/XMLEncoder.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.desktop/share/classes/java/beans/XMLEncoder.java Fri Sep 25 12:04:35 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -614,10 +614,12 @@
}
if (isArgument && target instanceof Field && methodName.equals("get")) {
- Field f = (Field)target;
- writeln("<object class=" + quote(f.getDeclaringClass().getName()) +
- " field=" + quote(f.getName()) + "/>");
- return;
+ Field f = (Field) target;
+ if (Modifier.isStatic(f.getModifiers())) {
+ writeln("<object class=" + quote(f.getDeclaringClass().getName()) +
+ " field=" + quote(f.getName()) + "/>");
+ return;
+ }
}
Class<?> primitiveType = primitiveTypeFor(value.getClass());
--- a/jdk/src/java.desktop/share/classes/javax/sound/sampled/AudioSystem.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.desktop/share/classes/javax/sound/sampled/AudioSystem.java Fri Sep 25 12:04:35 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -912,9 +912,9 @@
* must point to valid audio file data. The implementation of this method
* may require multiple parsers to examine the stream to determine whether
* they support it. These parsers must be able to mark the stream, read
- * enough data to determine whether they support the stream, and, if not,
- * reset the stream's read pointer to its original position. If the input
- * stream does not support these operations, this method may fail with an
+ * enough data to determine whether they support the stream, and reset the
+ * stream's read pointer to its original position. If the input stream does
+ * not support these operations, this method may fail with an
* {@code IOException}.
*
* @param stream the input stream from which file format information should
@@ -1025,9 +1025,9 @@
* must point to valid audio file data. The implementation of this method
* may require multiple parsers to examine the stream to determine whether
* they support it. These parsers must be able to mark the stream, read
- * enough data to determine whether they support the stream, and, if not,
- * reset the stream's read pointer to its original position. If the input
- * stream does not support these operation, this method may fail with an
+ * enough data to determine whether they support the stream, and reset the
+ * stream's read pointer to its original position. If the input stream does
+ * not support these operation, this method may fail with an
* {@code IOException}.
*
* @param stream the input stream from which the {@code AudioInputStream}
--- a/jdk/src/java.desktop/share/classes/javax/sound/sampled/spi/AudioFileReader.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.desktop/share/classes/javax/sound/sampled/spi/AudioFileReader.java Fri Sep 25 12:04:35 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -49,9 +49,9 @@
* must point to valid audio file data. In general, audio file readers may
* need to read some data from the stream before determining whether they
* support it. These parsers must be able to mark the stream, read enough
- * data to determine whether they support the stream, and, if not, reset the
- * stream's read pointer to its original position. If the input stream does
- * not support this, this method may fail with an {@code IOException}.
+ * data to determine whether they support the stream, and reset the stream's
+ * read pointer to its original position. If the input stream does not
+ * support this, this method may fail with an {@code IOException}.
*
* @param stream the input stream from which file format information should
* be extracted
@@ -101,9 +101,9 @@
* must point to valid audio file data. In general, audio file readers may
* need to read some data from the stream before determining whether they
* support it. These parsers must be able to mark the stream, read enough
- * data to determine whether they support the stream, and, if not, reset the
- * stream's read pointer to its original position. If the input stream does
- * not support this, this method may fail with an {@code IOException}.
+ * data to determine whether they support the stream, and reset the stream's
+ * read pointer to its original position. If the input stream does not
+ * support this, this method may fail with an {@code IOException}.
*
* @param stream the input stream from which the {@code AudioInputStream}
* should be constructed
--- a/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTableHeaderUI.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTableHeaderUI.java Fri Sep 25 12:04:35 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -403,6 +403,7 @@
protected void uninstallListeners() {
header.removeMouseListener(mouseInputListener);
header.removeMouseMotionListener(mouseInputListener);
+ header.removeFocusListener(focusListener);
mouseInputListener = null;
}
--- a/jdk/src/java.desktop/share/classes/javax/swing/text/DefaultCaret.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.desktop/share/classes/javax/swing/text/DefaultCaret.java Fri Sep 25 12:04:35 2015 -0700
@@ -860,6 +860,7 @@
Highlighter.HighlightPainter p = getSelectionPainter();
try {
selectionTag = h.addHighlight(p0, p1, p);
+ updateOwnsSelection();
} catch (BadLocationException bl) {
selectionTag = null;
}
@@ -870,6 +871,7 @@
Highlighter h = component.getHighlighter();
h.removeHighlight(selectionTag);
selectionTag = null;
+ updateOwnsSelection();
}
}
}
@@ -1110,6 +1112,7 @@
if (selectionTag != null) {
h.removeHighlight(selectionTag);
selectionTag = null;
+ updateOwnsSelection();
}
// otherwise, change or add the highlight
} else {
@@ -1120,6 +1123,7 @@
Highlighter.HighlightPainter p = getSelectionPainter();
selectionTag = h.addHighlight(p0, p1, p);
}
+ updateOwnsSelection();
} catch (BadLocationException e) {
throw new StateInvariantError("Bad caret position");
}
@@ -1170,6 +1174,7 @@
if (this.dot != dot || this.dotBias != dotBias ||
selectionTag != null || forceCaretPositionChange) {
changeCaretPosition(dot, dotBias);
+ updateOwnsSelection();
}
this.markBias = this.dotBias;
this.markLTR = dotLTR;
@@ -1177,6 +1182,7 @@
if ((h != null) && (selectionTag != null)) {
h.removeHighlight(selectionTag);
selectionTag = null;
+ updateOwnsSelection();
}
}
@@ -1925,6 +1931,13 @@
}
}
+ /**
+ * Updates ownsSelection based on text selection in the caret.
+ */
+ private void updateOwnsSelection() {
+ ownsSelection = (selectionTag != null)
+ && SwingUtilities2.canAccessSystemClipboard();
+ }
private class DefaultFilterBypass extends NavigationFilter.FilterBypass {
public Caret getCaret() {
--- a/jdk/src/java.desktop/share/classes/sun/awt/SunHints.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.desktop/share/classes/sun/awt/SunHints.java Fri Sep 25 12:04:35 2015 -0700
@@ -257,8 +257,10 @@
*/
@Native public static final int INTKEY_RESOLUTION_VARIANT = 9;
@Native public static final int INTVAL_RESOLUTION_VARIANT_DEFAULT = 0;
- @Native public static final int INTVAL_RESOLUTION_VARIANT_OFF = 1;
- @Native public static final int INTVAL_RESOLUTION_VARIANT_ON = 2;
+ @Native public static final int INTVAL_RESOLUTION_VARIANT_BASE = 1;
+ @Native public static final int INTVAL_RESOLUTION_VARIANT_SIZE_FIT = 2;
+ @Native public static final int INTVAL_RESOLUTION_VARIANT_DPI_FIT = 3;
+
/**
* LCD text contrast control hint key.
* Value is "100" to make discontiguous with the others which
@@ -466,15 +468,23 @@
public static final Object VALUE_RESOLUTION_VARIANT_DEFAULT =
new SunHints.Value(KEY_RESOLUTION_VARIANT,
SunHints.INTVAL_RESOLUTION_VARIANT_DEFAULT,
- "Choose image resolutions based on a default heuristic");
- public static final Object VALUE_RESOLUTION_VARIANT_OFF =
+ "Choose image resolutions based on a default"
+ + "heuristic");
+ public static final Object VALUE_RESOLUTION_VARIANT_BASE =
new SunHints.Value(KEY_RESOLUTION_VARIANT,
- SunHints.INTVAL_RESOLUTION_VARIANT_OFF,
+ SunHints.INTVAL_RESOLUTION_VARIANT_BASE,
"Use only the standard resolution of an image");
- public static final Object VALUE_RESOLUTION_VARIANT_ON =
+ public static final Object VALUE_RESOLUTION_VARIANT_SIZE_FIT =
new SunHints.Value(KEY_RESOLUTION_VARIANT,
- SunHints.INTVAL_RESOLUTION_VARIANT_ON,
- "Always use resolution-specific variants of images");
+ SunHints.INTVAL_RESOLUTION_VARIANT_SIZE_FIT,
+ "Choose image resolutions based on the DPI"
+ + "of the screen and transform"
+ + "in the Graphics2D context");
+ public static final Object VALUE_RESOLUTION_VARIANT_DPI_FIT =
+ new SunHints.Value(KEY_RESOLUTION_VARIANT,
+ SunHints.INTVAL_RESOLUTION_VARIANT_DPI_FIT,
+ "Choose image resolutions based only on the DPI"
+ + " of the screen");
public static class LCDContrastKey extends Key {
--- a/jdk/src/java.desktop/share/classes/sun/awt/SunToolkit.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.desktop/share/classes/sun/awt/SunToolkit.java Fri Sep 25 12:04:35 2015 -0700
@@ -60,7 +60,7 @@
import sun.awt.image.ByteArrayImageSource;
import sun.awt.image.FileImageSource;
import sun.awt.image.ImageRepresentation;
-import sun.awt.image.MultiResolutionImage;
+import java.awt.image.MultiResolutionImage;
import sun.awt.image.MultiResolutionToolkitImage;
import sun.awt.image.ToolkitImage;
import sun.awt.image.URLImageSource;
--- a/jdk/src/java.desktop/share/classes/sun/awt/image/AbstractMultiResolutionImage.java Thu Sep 17 16:53:42 2015 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,123 +0,0 @@
-/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package sun.awt.image;
-
-import java.awt.Graphics;
-import java.awt.Image;
-import java.awt.image.*;
-
-/**
- * This class provides default implementations for the
- * <code>MultiResolutionImage</code> interface. The developer needs only
- * to subclass this abstract class and define the <code>getResolutionVariant</code>,
- * <code>getResolutionVariants</code>, and <code>getBaseImage</code> methods.
- *
- *
- * For example,
- * {@code
- * public class CustomMultiResolutionImage extends AbstractMultiResolutionImage {
- *
- * int baseImageIndex;
- * Image[] resolutionVariants;
- *
- * public CustomMultiResolutionImage(int baseImageIndex,
- * Image... resolutionVariants) {
- * this.baseImageIndex = baseImageIndex;
- * this.resolutionVariants = resolutionVariants;
- * }
- *
- * @Override
- * public Image getResolutionVariant(float logicalDPIX, float logicalDPIY,
- * float baseImageWidth, float baseImageHeight,
- * float destImageWidth, float destImageHeight) {
- * // return a resolution variant based on the given logical DPI,
- * // base image size, or destination image size
- * }
- *
- * @Override
- * public List<Image> getResolutionVariants() {
- * return Arrays.asList(resolutionVariants);
- * }
- *
- * protected Image getBaseImage() {
- * return resolutionVariants[baseImageIndex];
- * }
- * }
- * }
- *
- * @see java.awt.Image
- * @see java.awt.image.MultiResolutionImage
- *
- * @since 1.9
- */
-public abstract class AbstractMultiResolutionImage extends java.awt.Image
- implements MultiResolutionImage {
-
- /**
- * @inheritDoc
- */
- @Override
- public int getWidth(ImageObserver observer) {
- return getBaseImage().getWidth(null);
- }
-
- /**
- * @inheritDoc
- */
- @Override
- public int getHeight(ImageObserver observer) {
- return getBaseImage().getHeight(null);
- }
-
- /**
- * @inheritDoc
- */
- @Override
- public ImageProducer getSource() {
- return getBaseImage().getSource();
- }
-
- /**
- * @inheritDoc
- */
- @Override
- public Graphics getGraphics() {
- return getBaseImage().getGraphics();
-
- }
-
- /**
- * @inheritDoc
- */
- @Override
- public Object getProperty(String name, ImageObserver observer) {
- return getBaseImage().getProperty(name, observer);
- }
-
- /**
- * @return base image
- */
- protected abstract Image getBaseImage();
-}
--- a/jdk/src/java.desktop/share/classes/sun/awt/image/MultiResolutionCachedImage.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.desktop/share/classes/sun/awt/image/MultiResolutionCachedImage.java Fri Sep 25 12:04:35 2015 -0700
@@ -33,6 +33,7 @@
import java.util.function.Function;
import java.util.function.BiFunction;
import java.util.stream.Collectors;
+import java.awt.image.AbstractMultiResolutionImage;
public class MultiResolutionCachedImage extends AbstractMultiResolutionImage {
@@ -58,7 +59,10 @@
}
@Override
- public Image getResolutionVariant(int width, int height) {
+ public Image getResolutionVariant(double destWidth, double destHeight) {
+ checkSize(destWidth, destHeight);
+ int width = (int) Math.ceil(destWidth);
+ int height = (int) Math.ceil(destHeight);
ImageCache cache = ImageCache.getInstance();
ImageCacheKey key = new ImageCacheKey(this, width, height);
Image resolutionVariant = cache.getImage(key);
@@ -70,11 +74,23 @@
return resolutionVariant;
}
+ private static void checkSize(double width, double height) {
+ if (width <= 0 || height <= 0) {
+ throw new IllegalArgumentException(String.format(
+ "Width (%s) or height (%s) cannot be <= 0", width, height));
+ }
+
+ if (!Double.isFinite(width) || !Double.isFinite(height)) {
+ throw new IllegalArgumentException(String.format(
+ "Width (%s) or height (%s) is not finite", width, height));
+ }
+ }
+
@Override
public List<Image> getResolutionVariants() {
return Arrays.stream(sizes).map((Function<Dimension2D, Image>) size
- -> getResolutionVariant((int) size.getWidth(),
- (int) size.getHeight())).collect(Collectors.toList());
+ -> getResolutionVariant(size.getWidth(), size.getHeight()))
+ .collect(Collectors.toList());
}
public MultiResolutionCachedImage map(Function<Image, Image> mapper) {
--- a/jdk/src/java.desktop/share/classes/sun/awt/image/MultiResolutionImage.java Thu Sep 17 16:53:42 2015 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,83 +0,0 @@
-/*
- * 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.awt.image;
-
-import java.awt.Image;
-import java.util.List;
-
-/**
- * This interface is designed to provide a set of images at various resolutions.
- *
- * The <code>MultiResolutionImage</code> interface should be implemented by any
- * class whose instances are intended to provide image resolution variants
- * according to the given image width and height.
- *
- * For example,
- * <pre>
- * {@code
- * public class ScaledImage extends BufferedImage
- * implements MultiResolutionImage {
- *
- * @Override
- * public Image getResolutionVariant(int width, int height) {
- * return ((width <= getWidth() && height <= getHeight()))
- * ? this : highResolutionImage;
- * }
- *
- * @Override
- * public List<Image> getResolutionVariants() {
- * return Arrays.asList(this, highResolutionImage);
- * }
- * }
- * }</pre>
- *
- * It is recommended to cache image variants for performance reasons.
- *
- * <b>WARNING</b>: This class is an implementation detail. This API may change
- * between update release, and it may even be removed or be moved in some other
- * package(s)/class(es).
- */
-public interface MultiResolutionImage {
-
- /**
- * Provides an image with necessary resolution which best fits to the given
- * image width and height.
- *
- * @param width the desired image resolution width.
- * @param height the desired image resolution height.
- * @return image resolution variant.
- *
- * @since 1.8
- */
- public Image getResolutionVariant(int width, int height);
-
- /**
- * Gets list of all resolution variants including the base image
- *
- * @return list of resolution variants.
- * @since 1.8
- */
- public List<Image> getResolutionVariants();
-}
--- a/jdk/src/java.desktop/share/classes/sun/awt/image/MultiResolutionToolkitImage.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.desktop/share/classes/sun/awt/image/MultiResolutionToolkitImage.java Fri Sep 25 12:04:35 2015 -0700
@@ -26,6 +26,7 @@
import java.awt.Image;
import java.awt.image.ImageObserver;
+import java.awt.image.MultiResolutionImage;
import java.util.Arrays;
import java.util.List;
import sun.misc.SoftCache;
@@ -40,11 +41,24 @@
}
@Override
- public Image getResolutionVariant(int width, int height) {
- return ((width <= getWidth() && height <= getHeight()))
+ public Image getResolutionVariant(double destWidth, double destHeight) {
+ checkSize(destWidth, destHeight);
+ return ((destWidth <= getWidth() && destHeight <= getHeight()))
? this : resolutionVariant;
}
+ private static void checkSize(double width, double height) {
+ if (width <= 0 || height <= 0) {
+ throw new IllegalArgumentException(String.format(
+ "Width (%s) or height (%s) cannot be <= 0", width, height));
+ }
+
+ if (!Double.isFinite(width) || !Double.isFinite(height)) {
+ throw new IllegalArgumentException(String.format(
+ "Width (%s) or height (%s) is not finite", width, height));
+ }
+ }
+
public Image getResolutionVariant() {
return resolutionVariant;
}
--- a/jdk/src/java.desktop/share/classes/sun/java2d/SunGraphics2D.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.desktop/share/classes/sun/java2d/SunGraphics2D.java Fri Sep 25 12:04:35 2015 -0700
@@ -94,7 +94,7 @@
import sun.misc.PerformanceLogger;
import java.lang.annotation.Native;
-import sun.awt.image.MultiResolutionImage;
+import java.awt.image.MultiResolutionImage;
import static java.awt.geom.AffineTransform.TYPE_FLIP;
import static java.awt.geom.AffineTransform.TYPE_MASK_SCALE;
@@ -3087,9 +3087,8 @@
// end of text rendering methods
private boolean isHiDPIImage(final Image img) {
- return (SurfaceManager.getImageScale(img) != 1) ||
- (resolutionVariantHint != SunHints.INTVAL_RESOLUTION_VARIANT_OFF
- && img instanceof MultiResolutionImage);
+ return (SurfaceManager.getImageScale(img) != 1)
+ || img instanceof MultiResolutionImage;
}
private boolean drawHiDPIImage(Image img, int dx1, int dy1, int dx2,
@@ -3175,25 +3174,42 @@
int type = transform.getType();
int dw = dx2 - dx1;
int dh = dy2 - dy1;
- double destRegionWidth;
- double destRegionHeight;
-
- if ((type & ~(TYPE_TRANSLATION | TYPE_FLIP)) == 0) {
- destRegionWidth = dw;
- destRegionHeight = dh;
- } else if ((type & ~(TYPE_TRANSLATION | TYPE_FLIP | TYPE_MASK_SCALE)) == 0) {
- destRegionWidth = dw * transform.getScaleX();
- destRegionHeight = dh * transform.getScaleY();
+
+ double destImageWidth;
+ double destImageHeight;
+
+ if (resolutionVariantHint == SunHints.INTVAL_RESOLUTION_VARIANT_BASE) {
+ destImageWidth = srcWidth;
+ destImageHeight = srcHeight;
+ } else if (resolutionVariantHint == SunHints.INTVAL_RESOLUTION_VARIANT_DPI_FIT) {
+ AffineTransform configTransform = getDefaultTransform();
+ if (configTransform.isIdentity()) {
+ destImageWidth = srcWidth;
+ destImageHeight = srcHeight;
+ } else {
+ destImageWidth = srcWidth * configTransform.getScaleX();
+ destImageHeight = srcHeight * configTransform.getScaleY();
+ }
} else {
- destRegionWidth = dw * Math.hypot(
- transform.getScaleX(), transform.getShearY());
- destRegionHeight = dh * Math.hypot(
- transform.getShearX(), transform.getScaleY());
+ double destRegionWidth;
+ double destRegionHeight;
+
+ if ((type & ~(TYPE_TRANSLATION | TYPE_FLIP)) == 0) {
+ destRegionWidth = dw;
+ destRegionHeight = dh;
+ } else if ((type & ~(TYPE_TRANSLATION | TYPE_FLIP | TYPE_MASK_SCALE)) == 0) {
+ destRegionWidth = dw * transform.getScaleX();
+ destRegionHeight = dh * transform.getScaleY();
+ } else {
+ destRegionWidth = dw * Math.hypot(
+ transform.getScaleX(), transform.getShearY());
+ destRegionHeight = dh * Math.hypot(
+ transform.getShearX(), transform.getScaleY());
+ }
+ destImageWidth = Math.abs(srcWidth * destRegionWidth / sw);
+ destImageHeight = Math.abs(srcHeight * destRegionHeight / sh);
}
- int destImageWidth = (int) Math.abs(srcWidth * destRegionWidth / sw);
- int destImageHeight = (int) Math.abs(srcHeight * destRegionHeight / sh);
-
Image resolutionVariant
= img.getResolutionVariant(destImageWidth, destImageHeight);
--- a/jdk/src/java.management/share/classes/com/sun/jmx/remote/internal/IIOPHelper.java Thu Sep 17 16:53:42 2015 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,190 +0,0 @@
-/*
- * Copyright (c) 2009, 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.jmx.remote.internal;
-
-import java.util.Properties;
-import java.io.IOException;
-import java.rmi.Remote;
-import java.rmi.NoSuchObjectException;
-
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-
-/**
- * A helper class for RMI-IIOP and CORBA APIs.
- */
-
-public final class IIOPHelper {
- private IIOPHelper() { }
-
- // loads IIOPProxy implementation class if available
- private static final String IMPL_CLASS =
- "com.sun.jmx.remote.protocol.iiop.IIOPProxyImpl";
- private static final IIOPProxy proxy =
- AccessController.doPrivileged(new PrivilegedAction<IIOPProxy>() {
- public IIOPProxy run() {
- try {
- Class<?> c = Class.forName(IMPL_CLASS, true,
- IIOPHelper.class.getClassLoader());
- return (IIOPProxy)c.newInstance();
- } catch (ClassNotFoundException cnf) {
- return null;
- } catch (InstantiationException e) {
- throw new AssertionError(e);
- } catch (IllegalAccessException e) {
- throw new AssertionError(e);
- }
- }});
-
- /**
- * Returns true if RMI-IIOP and CORBA is available.
- */
- public static boolean isAvailable() {
- return proxy != null;
- }
-
- private static void ensureAvailable() {
- if (proxy == null)
- throw new AssertionError("Should not here");
- }
-
- /**
- * Returns true if the given object is a Stub.
- */
- public static boolean isStub(Object obj) {
- return (proxy == null) ? false : proxy.isStub(obj);
- }
-
- /**
- * Returns the Delegate to which the given Stub delegates.
- */
- public static Object getDelegate(Object stub) {
- ensureAvailable();
- return proxy.getDelegate(stub);
- }
-
- /**
- * Sets the Delegate for a given Stub.
- */
- public static void setDelegate(Object stub, Object delegate) {
- ensureAvailable();
- proxy.setDelegate(stub, delegate);
- }
-
- /**
- * Returns the ORB associated with the given stub
- *
- * @throws UnsupportedOperationException
- * if the object does not support the operation that
- * was invoked
- */
- public static Object getOrb(Object stub) {
- ensureAvailable();
- return proxy.getOrb(stub);
- }
-
- /**
- * Connects the Stub to the given ORB.
- */
- public static void connect(Object stub, Object orb)
- throws IOException
- {
- if (proxy == null)
- throw new IOException("Connection to ORB failed, RMI/IIOP not available");
- proxy.connect(stub, orb);
- }
-
- /**
- * Returns true if the given object is an ORB.
- */
- public static boolean isOrb(Object obj) {
- return (proxy == null) ? false : proxy.isOrb(obj);
- }
-
- /**
- * Creates, and returns, a new ORB instance.
- */
- public static Object createOrb(String[] args, Properties props)
- throws IOException
- {
- if (proxy == null)
- throw new IOException("ORB initialization failed, RMI/IIOP not available");
- return proxy.createOrb(args, props);
- }
-
- /**
- * Converts a string, produced by the object_to_string method, back
- * to a CORBA object reference.
- */
- public static Object stringToObject(Object orb, String str) {
- ensureAvailable();
- return proxy.stringToObject(orb, str);
- }
-
- /**
- * Converts the given CORBA object reference to a string.
- */
- public static String objectToString(Object orb, Object obj) {
- ensureAvailable();
- return proxy.objectToString(orb, obj);
- }
-
- /**
- * Checks to ensure that an object of a remote or abstract interface
- * type can be cast to a desired type.
- */
- public static <T> T narrow(Object narrowFrom, Class<T> narrowTo) {
- ensureAvailable();
- return proxy.narrow(narrowFrom, narrowTo);
- }
-
- /**
- * Makes a server object ready to receive remote calls
- */
- public static void exportObject(Remote obj) throws IOException {
- if (proxy == null)
- throw new IOException("RMI object cannot be exported, RMI/IIOP not available");
- proxy.exportObject(obj);
- }
-
- /**
- * Deregisters a server object from the runtime.
- */
- public static void unexportObject(Remote obj) throws IOException {
- if (proxy == null)
- throw new NoSuchObjectException("Object not exported");
- proxy.unexportObject(obj);
- }
-
- /**
- * Returns a stub for the given server object.
- */
- public static Remote toStub(Remote obj) throws IOException {
- if (proxy == null)
- throw new NoSuchObjectException("Object not exported");
- return proxy.toStub(obj);
- }
-}
--- a/jdk/src/java.management/share/classes/com/sun/jmx/remote/internal/IIOPProxy.java Thu Sep 17 16:53:42 2015 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,110 +0,0 @@
-/*
- * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
- * 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.jmx.remote.internal;
-
-import java.util.Properties;
-import java.rmi.Remote;
-import java.rmi.RemoteException;
-import java.rmi.NoSuchObjectException;
-
-/**
- * An interface to a subset of the RMI-IIOP and CORBA APIs to avoid a
- * static dependencies on the types defined by these APIs.
- */
-
-public interface IIOPProxy {
-
- /**
- * Returns true if the given object is a Stub.
- */
- boolean isStub(Object obj);
-
- /**
- * Returns the Delegate to which the given Stub delegates.
- */
- Object getDelegate(Object stub);
-
- /**
- * Sets the Delegate for a given Stub.
- */
- void setDelegate(Object stub, Object delegate);
-
- /**
- * Returns the ORB associated with the given stub
- *
- * @throws UnsupportedOperationException
- * if the object does not support the operation that
- * was invoked
- */
- Object getOrb(Object stub);
-
- /**
- * Connects the Stub to the given ORB.
- */
- void connect(Object stub, Object orb) throws RemoteException;
-
- /**
- * Returns true if the given object is an ORB.
- */
- boolean isOrb(Object obj);
-
- /**
- * Creates, and returns, a new ORB instance.
- */
- Object createOrb(String[] args, Properties props);
-
- /**
- * Converts a string, produced by the object_to_string method, back
- * to a CORBA object reference.
- */
- Object stringToObject(Object orb, String str);
-
- /**
- * Converts the given CORBA object reference to a string.
- */
- String objectToString(Object orb, Object obj);
-
- /**
- * Checks to ensure that an object of a remote or abstract interface
- * type can be cast to a desired type.
- */
- <T> T narrow(Object narrowFrom, Class<T> narrowTo);
-
- /**
- * Makes a server object ready to receive remote calls
- */
- void exportObject(Remote obj) throws RemoteException;
-
- /**
- * Deregisters a server object from the runtime.
- */
- void unexportObject(Remote obj) throws NoSuchObjectException;
-
- /**
- * Returns a stub for the given server object.
- */
- Remote toStub(Remote obj) throws NoSuchObjectException;
-}
--- a/jdk/src/java.management/share/classes/com/sun/jmx/remote/protocol/iiop/ClientProvider.java Thu Sep 17 16:53:42 2015 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved.
- * 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.jmx.remote.protocol.iiop;
-
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.util.Map;
-
-import javax.management.remote.JMXConnectorProvider;
-import javax.management.remote.JMXConnector;
-import javax.management.remote.JMXServiceURL;
-import javax.management.remote.rmi.RMIConnector;
-
-public class ClientProvider implements JMXConnectorProvider {
-
- public JMXConnector newJMXConnector(JMXServiceURL serviceURL,
- Map<String,?> environment)
- throws IOException {
- if (!serviceURL.getProtocol().equals("iiop")) {
- throw new MalformedURLException("Protocol not iiop: " +
- serviceURL.getProtocol());
- }
- return new RMIConnector(serviceURL, environment);
- }
-}
--- a/jdk/src/java.management/share/classes/com/sun/jmx/remote/protocol/iiop/IIOPProxyImpl.java Thu Sep 17 16:53:42 2015 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,157 +0,0 @@
-/*
- * 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
- * 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.jmx.remote.protocol.iiop;
-
-import org.omg.CORBA.ORB;
-import org.omg.CORBA.portable.Delegate;
-import javax.rmi.PortableRemoteObject;
-import javax.rmi.CORBA.Stub;
-
-import java.util.Properties;
-import java.rmi.Remote;
-import java.rmi.RemoteException;
-import java.rmi.NoSuchObjectException;
-
-import com.sun.jmx.remote.internal.IIOPProxy;
-import java.io.SerializablePermission;
-import java.security.AccessControlContext;
-import java.security.AccessController;
-import java.security.Permissions;
-import java.security.PrivilegedActionException;
-import java.security.PrivilegedExceptionAction;
-import java.security.ProtectionDomain;
-
-/**
- * An implementation of IIOPProxy that simply delegates to the appropriate
- * RMI-IIOP and CORBA APIs.
- */
-
-public class IIOPProxyImpl implements IIOPProxy {
- // special ACC used to initialize the IIOP stub
- // the only allowed privilege is SerializablePermission("enableSubclassImplementation")
- private static final AccessControlContext STUB_ACC;
-
- static {
- Permissions p = new Permissions();
- p.add(new SerializablePermission("enableSubclassImplementation"));
- STUB_ACC = new AccessControlContext(
- new ProtectionDomain[]{
- new ProtectionDomain(null, p)
- }
- );
- }
-
- public IIOPProxyImpl() { }
-
- @Override
- public boolean isStub(Object obj) {
- return (obj instanceof Stub);
- }
-
- @Override
- public Object getDelegate(Object stub) {
- return ((Stub)stub)._get_delegate();
- }
-
- @Override
- public void setDelegate(Object stub, Object delegate) {
- ((Stub)stub)._set_delegate((Delegate)delegate);
- }
-
- @Override
- public Object getOrb(Object stub) {
- try {
- return ((Stub)stub)._orb();
- } catch (org.omg.CORBA.BAD_OPERATION x) {
- throw new UnsupportedOperationException(x);
- }
- }
-
- @Override
- public void connect(Object stub, Object orb)
- throws RemoteException
- {
- ((Stub)stub).connect((ORB)orb);
- }
-
- @Override
- public boolean isOrb(Object obj) {
- return (obj instanceof ORB);
- }
-
- @Override
- public Object createOrb(String[] args, Properties props) {
- return ORB.init(args, props);
- }
-
- @Override
- public Object stringToObject(Object orb, String str) {
- return ((ORB)orb).string_to_object(str);
- }
-
- @Override
- public String objectToString(Object orb, Object obj) {
- return ((ORB)orb).object_to_string((org.omg.CORBA.Object)obj);
- }
-
- @Override
- @SuppressWarnings("unchecked")
- public <T> T narrow(Object narrowFrom, Class<T> narrowTo) {
- return (T)PortableRemoteObject.narrow(narrowFrom, narrowTo);
- }
-
- @Override
- public void exportObject(Remote obj) throws RemoteException {
- PortableRemoteObject.exportObject(obj);
- }
-
- @Override
- public void unexportObject(Remote obj) throws NoSuchObjectException {
- PortableRemoteObject.unexportObject(obj);
- }
-
- @Override
- public Remote toStub(final Remote obj) throws NoSuchObjectException {
- if (System.getSecurityManager() == null) {
- return PortableRemoteObject.toStub(obj);
- } else {
- try {
- return AccessController.doPrivileged(new PrivilegedExceptionAction<Remote>() {
-
- @Override
- public Remote run() throws Exception {
- return PortableRemoteObject.toStub(obj);
- }
- }, STUB_ACC);
- } catch (PrivilegedActionException e) {
- if (e.getException() instanceof NoSuchObjectException) {
- throw (NoSuchObjectException)e.getException();
- }
- throw new RuntimeException("Unexpected exception type", e.getException());
- }
- }
- }
-}
--- a/jdk/src/java.management/share/classes/com/sun/jmx/remote/protocol/iiop/ProxyInputStream.java Thu Sep 17 16:53:42 2015 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,241 +0,0 @@
-/*
- * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.jmx.remote.protocol.iiop;
-
-import java.io.IOException;
-import java.io.Serializable;
-import java.math.BigDecimal;
-
-import org.omg.CORBA.Any;
-import org.omg.CORBA.Context;
-import org.omg.CORBA.NO_IMPLEMENT;
-import org.omg.CORBA.ORB;
-import org.omg.CORBA.TypeCode;
-import org.omg.CORBA.portable.BoxedValueHelper;
-
-@SuppressWarnings({"deprecation", "rawtypes"})
-public class ProxyInputStream extends org.omg.CORBA_2_3.portable.InputStream {
- public ProxyInputStream(org.omg.CORBA.portable.InputStream in) {
- this.in = in;
- }
-
- public boolean read_boolean() {
- return in.read_boolean();
- }
-
- public char read_char() {
- return in.read_char();
- }
-
- public char read_wchar() {
- return in.read_wchar();
- }
-
- public byte read_octet() {
- return in.read_octet();
- }
-
- public short read_short() {
- return in.read_short();
- }
-
- public short read_ushort() {
- return in.read_ushort();
- }
-
- public int read_long() {
- return in.read_long();
- }
-
- public int read_ulong() {
- return in.read_ulong();
- }
-
- public long read_longlong() {
- return in.read_longlong();
- }
-
- public long read_ulonglong() {
- return in.read_ulonglong();
- }
-
- public float read_float() {
- return in.read_float();
- }
-
- public double read_double() {
- return in.read_double();
- }
-
- public String read_string() {
- return in.read_string();
- }
-
- public String read_wstring() {
- return in.read_wstring();
- }
-
- public void read_boolean_array(boolean[] value, int offset, int length) {
- in.read_boolean_array(value, offset, length);
- }
-
- public void read_char_array(char[] value, int offset, int length) {
- in.read_char_array(value, offset, length);
- }
-
- public void read_wchar_array(char[] value, int offset, int length) {
- in.read_wchar_array(value, offset, length);
- }
-
- public void read_octet_array(byte[] value, int offset, int length) {
- in.read_octet_array(value, offset, length);
- }
-
- public void read_short_array(short[] value, int offset, int length) {
- in.read_short_array(value, offset, length);
- }
-
- public void read_ushort_array(short[] value, int offset, int length) {
- in.read_ushort_array(value, offset, length);
- }
-
- public void read_long_array(int[] value, int offset, int length) {
- in.read_long_array(value, offset, length);
- }
-
- public void read_ulong_array(int[] value, int offset, int length) {
- in.read_ulong_array(value, offset, length);
- }
-
- public void read_longlong_array(long[] value, int offset, int length) {
- in.read_longlong_array(value, offset, length);
- }
-
- public void read_ulonglong_array(long[] value, int offset, int length) {
- in.read_ulonglong_array(value, offset, length);
- }
-
- public void read_float_array(float[] value, int offset, int length) {
- in.read_float_array(value, offset, length);
- }
-
- public void read_double_array(double[] value, int offset, int length) {
- in.read_double_array(value, offset, length);
- }
-
- public org.omg.CORBA.Object read_Object() {
- return in.read_Object();
- }
-
- public TypeCode read_TypeCode() {
- return in.read_TypeCode();
- }
-
- public Any read_any() {
- return in.read_any();
- }
-
- /**
- * @deprecated
- */
- @Override
- @Deprecated
- public org.omg.CORBA.Principal read_Principal() {
- return in.read_Principal();
- }
-
- @Override
- public int read() throws IOException {
- return in.read();
- }
-
- @Override
- public BigDecimal read_fixed() {
- return in.read_fixed();
- }
-
- @Override
- public Context read_Context() {
- return in.read_Context();
- }
-
- @Override
- public org.omg.CORBA.Object read_Object(java.lang.Class clz) {
- return in.read_Object(clz);
- }
-
- @Override
- public ORB orb() {
- return in.orb();
- }
-
- @Override
- public Serializable read_value() {
- return narrow().read_value();
- }
-
- @Override
- public Serializable read_value(Class clz) {
- return narrow().read_value(clz);
- }
-
- @Override
- public Serializable read_value(BoxedValueHelper factory) {
- return narrow().read_value(factory);
- }
-
- @Override
- public Serializable read_value(String rep_id) {
- return narrow().read_value(rep_id);
- }
-
- @Override
- public Serializable read_value(Serializable value) {
- return narrow().read_value(value);
- }
-
- @Override
- public Object read_abstract_interface() {
- return narrow().read_abstract_interface();
- }
-
- @Override
- public Object read_abstract_interface(Class clz) {
- return narrow().read_abstract_interface(clz);
- }
-
- protected org.omg.CORBA_2_3.portable.InputStream narrow() {
- if (in instanceof org.omg.CORBA_2_3.portable.InputStream)
- return (org.omg.CORBA_2_3.portable.InputStream) in;
- throw new NO_IMPLEMENT();
- }
-
- public org.omg.CORBA.portable.InputStream getProxiedInputStream() {
- return in;
- }
-
- protected final org.omg.CORBA.portable.InputStream in;
-}
--- a/jdk/src/java.management/share/classes/com/sun/jmx/remote/protocol/iiop/ServerProvider.java Thu Sep 17 16:53:42 2015 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved.
- * 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.jmx.remote.protocol.iiop;
-
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.util.Map;
-
-import javax.management.MBeanServer;
-import javax.management.remote.JMXConnectorServer;
-import javax.management.remote.JMXConnectorServerProvider;
-import javax.management.remote.JMXServiceURL;
-import javax.management.remote.rmi.RMIConnectorServer;
-
-public class ServerProvider implements JMXConnectorServerProvider {
-
- public JMXConnectorServer newJMXConnectorServer(JMXServiceURL serviceURL,
- Map<String,?> environment,
- MBeanServer mbeanServer)
- throws IOException {
- if (!serviceURL.getProtocol().equals("iiop")) {
- throw new MalformedURLException("Protocol not iiop: " +
- serviceURL.getProtocol());
- }
- return new RMIConnectorServer(serviceURL, environment, mbeanServer);
- }
-
-}
--- a/jdk/src/java.management/share/classes/javax/management/remote/JMXConnectorFactory.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.management/share/classes/javax/management/remote/JMXConnectorFactory.java Fri Sep 25 12:04:35 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -140,9 +140,7 @@
*
* <p>Every implementation must support the RMI connector protocol with
* the default RMI transport, specified with string <code>rmi</code>.
- * An implementation may optionally support the RMI connector protocol
- * with the RMI/IIOP transport, specified with the string
- * <code>iiop</code>.</p>
+ * </p>
*
* <p>Once a provider is found, the result of the
* <code>newJMXConnector</code> method is the result of calling {@link
--- a/jdk/src/java.management/share/classes/javax/management/remote/JMXConnectorServerFactory.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.management/share/classes/javax/management/remote/JMXConnectorServerFactory.java Fri Sep 25 12:04:35 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -131,9 +131,7 @@
*
* <p>Every implementation must support the RMI connector protocol with
* the default RMI transport, specified with string <code>rmi</code>.
- * An implementation may optionally support the RMI connector protocol
- * with the RMI/IIOP transport, specified with the string
- * <code>iiop</code>.</p>
+ * </p>
*
* <p>Once a provider is found, the result of the
* <code>newJMXConnectorServer</code> method is the result of calling
--- a/jdk/src/java.management/share/classes/javax/management/remote/rmi/NoCallStackClassLoader.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.management/share/classes/javax/management/remote/rmi/NoCallStackClassLoader.java Fri Sep 25 12:04:35 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -31,12 +31,11 @@
<p>A class loader that only knows how to define a limited number
of classes, and load a limited number of other classes through
delegation to another loader. It is used to get around a problem
- with Serialization, in particular as used by RMI (including
- RMI/IIOP). The JMX Remote API defines exactly what class loader
- must be used to deserialize arguments on the server, and return
- values on the client. We communicate this class loader to RMI by
- setting it as the context class loader. RMI uses the context
- class loader to load classes as it deserializes, which is what we
+ with Serialization, in particular as used by RMI. The JMX Remote API
+ defines exactly what class loader must be used to deserialize arguments on
+ the server, and return values on the client. We communicate this class
+ loader to RMI by setting it as the context class loader. RMI uses the
+ context class loader to load classes as it deserializes, which is what we
want. However, before consulting the context class loader, it
looks up the call stack for a class with a non-null class loader,
and uses that if it finds one. So, in the standalone version of
--- a/jdk/src/java.management/share/classes/javax/management/remote/rmi/RMIConnectionImpl.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.management/share/classes/javax/management/remote/rmi/RMIConnectionImpl.java Fri Sep 25 12:04:35 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -76,11 +76,10 @@
/**
* Constructs a new {@link RMIConnection}. This connection can be
- * used with either the JRMP or IIOP transport. This object does
+ * used with the JRMP transport. This object does
* not export itself: it is the responsibility of the caller to
* export it appropriately (see {@link
- * RMIJRMPServerImpl#makeClient(String,Subject)} and {@link
- * RMIIIOPServerImpl#makeClient(String,Subject)}.
+ * RMIJRMPServerImpl#makeClient(String,Subject)}).
*
* @param rmiServer The RMIServerImpl object for which this
* connection is created. The behavior is unspecified if this
--- a/jdk/src/java.management/share/classes/javax/management/remote/rmi/RMIConnector.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.management/share/classes/javax/management/remote/rmi/RMIConnector.java Fri Sep 25 12:04:35 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
* 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,25 +30,21 @@
import com.sun.jmx.remote.internal.ClientListenerInfo;
import com.sun.jmx.remote.internal.ClientNotifForwarder;
import com.sun.jmx.remote.internal.ProxyRef;
-import com.sun.jmx.remote.internal.IIOPHelper;
import com.sun.jmx.remote.util.ClassLogger;
import com.sun.jmx.remote.util.EnvHelp;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InvalidObjectException;
-import java.io.NotSerializableException;
import java.io.ObjectInputStream;
import java.io.ObjectStreamClass;
import java.io.Serializable;
-import java.io.WriteAbortedException;
import java.lang.ref.WeakReference;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Proxy;
import java.net.MalformedURLException;
-import java.rmi.MarshalException;
import java.rmi.MarshalledObject;
import java.rmi.NoSuchObjectException;
import java.rmi.Remote;
@@ -61,13 +57,12 @@
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.security.PrivilegedExceptionAction;
-import java.security.PrivilegedActionException;
import java.security.ProtectionDomain;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
+import java.util.Hashtable;
import java.util.Map;
-import java.util.Properties;
import java.util.Set;
import java.util.WeakHashMap;
import javax.management.Attribute;
@@ -146,22 +141,20 @@
* the RMI connector server with the given address.</p>
*
* <p>The address can refer directly to the connector server,
- * using one of the following syntaxes:</p>
+ * using the following syntax:</p>
*
* <pre>
* service:jmx:rmi://<em>[host[:port]]</em>/stub/<em>encoded-stub</em>
- * service:jmx:iiop://<em>[host[:port]]</em>/ior/<em>encoded-IOR</em>
* </pre>
*
* <p>(Here, the square brackets {@code []} are not part of the
* address but indicate that the host and port are optional.)</p>
*
* <p>The address can instead indicate where to find an RMI stub
- * through JNDI, using one of the following syntaxes:</p>
+ * through JNDI, using the following syntax:</p>
*
* <pre>
* service:jmx:rmi://<em>[host[:port]]</em>/jndi/<em>jndi-name</em>
- * service:jmx:iiop://<em>[host[:port]]</em>/jndi/<em>jndi-name</em>
* </pre>
*
* <p>An implementation may also recognize additional address
@@ -242,8 +235,7 @@
/**
* @throws IOException if the connection could not be made because of a
- * communication problem, or in the case of the {@code iiop} protocol,
- * that RMI/IIOP is not supported
+ * communication problem
*/
public void connect() throws IOException {
connect(null);
@@ -251,8 +243,7 @@
/**
* @throws IOException if the connection could not be made because of a
- * communication problem, or in the case of the {@code iiop} protocol,
- * that RMI/IIOP is not supported
+ * communication problem
*/
public synchronized void connect(Map<String,?> environment)
throws IOException {
@@ -294,9 +285,7 @@
if (checkStub) checkStub(stub, rmiServerImplStubClass);
- // Connect IIOP Stub if needed.
if (tracing) logger.trace("connect",idstr + " connecting stub...");
- stub = connectStub(stub,usemap);
idstr = (tracing?"["+this.toString()+"]":null);
// Calling newClient on the RMIServer stub.
@@ -307,18 +296,6 @@
try {
connection = getConnection(stub, credentials, checkStub);
} catch (java.rmi.RemoteException re) {
- if (jmxServiceURL != null) {
- final String pro = jmxServiceURL.getProtocol();
- final String path = jmxServiceURL.getURLPath();
-
- if ("rmi".equals(pro) &&
- path.startsWith("/jndi/iiop:")) {
- MalformedURLException mfe = new MalformedURLException(
- "Protocol is rmi but JNDI scheme is iiop: " + jmxServiceURL);
- mfe.initCause(re);
- throw mfe;
- }
- }
throw re;
}
@@ -1413,13 +1390,6 @@
if (ioe instanceof UnmarshalException) {
throw ioe; // the fix of 6937053 made ClientNotifForwarder.fetchNotifs
// fetch one by one with UnmarshalException
- } else if (ioe instanceof MarshalException) {
- // IIOP will throw MarshalException wrapping a NotSerializableException
- // when a server fails to serialize a response.
- MarshalException me = (MarshalException)ioe;
- if (me.detail instanceof NotSerializableException) {
- throw (NotSerializableException)me.detail;
- }
}
// Not serialization problem, return.
@@ -1654,9 +1624,6 @@
throw new IOException("Failed to get a RMI stub: "+ne);
}
- // Connect IIOP Stub if needed.
- stub = connectStub(stub,env);
-
// Calling newClient on the RMIServer stub.
Object credentials = env.get(CREDENTIALS);
connection = stub.newClient(credentials);
@@ -1694,103 +1661,6 @@
// Private stuff - Serialization
//--------------------------------------------------------------------
/**
- * <p>In order to be usable, an IIOP stub must be connected to an ORB.
- * The stub is automatically connected to the ORB if:
- * <ul>
- * <li> It was returned by the COS naming</li>
- * <li> Its server counterpart has been registered in COS naming
- * through JNDI.</li>
- * </ul>
- * Otherwise, it is not connected. A stub which is deserialized
- * from Jini is not connected. A stub which is obtained from a
- * non registered RMIIIOPServerImpl is not a connected.<br>
- * A stub which is not connected can't be serialized, and thus
- * can't be registered in Jini. A stub which is not connected can't
- * be used to invoke methods on the server.
- * <p>
- * In order to palliate this, this method will connect the
- * given stub if it is not yet connected. If the given
- * <var>RMIServer</var> is not an instance of
- * {@link javax.rmi.CORBA.Stub javax.rmi.CORBA.Stub}, then the
- * method do nothing and simply returns that stub. Otherwise,
- * this method will attempt to connect the stub to an ORB as
- * follows:
- * <ul>
- * <li>This method looks in the provided <var>environment</var> for
- * the "java.naming.corba.orb" property. If it is found, the
- * referenced object (an {@link org.omg.CORBA.ORB ORB}) is used to
- * connect the stub. Otherwise, a new org.omg.CORBA.ORB is created
- * by calling {@link
- * org.omg.CORBA.ORB#init(String[], Properties)
- * org.omg.CORBA.ORB.init((String[])null,(Properties)null)}</li>
- * <li>The new created ORB is kept in a static
- * {@link WeakReference} and can be reused for connecting other
- * stubs. However, no reference is ever kept on the ORB provided
- * in the <var>environment</var> map, if any.</li>
- * </ul>
- * @param rmiServer A RMI Server Stub.
- * @param environment An environment map, possibly containing an ORB.
- * @return the given stub.
- * @exception IllegalArgumentException if the
- * {@code java.naming.corba.orb} property is specified and
- * does not point to an {@link org.omg.CORBA.ORB ORB}.
- * @exception IOException if the connection to the ORB failed.
- **/
- static RMIServer connectStub(RMIServer rmiServer,
- Map<String, ?> environment)
- throws IOException {
- if (IIOPHelper.isStub(rmiServer)) {
- try {
- IIOPHelper.getOrb(rmiServer);
- } catch (UnsupportedOperationException x) {
- // BAD_OPERATION
- IIOPHelper.connect(rmiServer, resolveOrb(environment));
- }
- }
- return rmiServer;
- }
-
- /**
- * Get the ORB specified by <var>environment</var>, or create a
- * new one.
- * <p>This method looks in the provided <var>environment</var> for
- * the "java.naming.corba.orb" property. If it is found, the
- * referenced object (an {@link org.omg.CORBA.ORB ORB}) is
- * returned. Otherwise, a new org.omg.CORBA.ORB is created
- * by calling {@link
- * org.omg.CORBA.ORB#init(String[], java.util.Properties)
- * org.omg.CORBA.ORB.init((String[])null,(Properties)null)}
- * <p>The new created ORB is kept in a static
- * {@link WeakReference} and can be reused for connecting other
- * stubs. However, no reference is ever kept on the ORB provided
- * in the <var>environment</var> map, if any.
- * @param environment An environment map, possibly containing an ORB.
- * @return An ORB.
- * @exception IllegalArgumentException if the
- * {@code java.naming.corba.orb} property is specified and
- * does not point to an {@link org.omg.CORBA.ORB ORB}.
- * @exception IOException if the ORB initialization failed.
- **/
- static Object resolveOrb(Map<String, ?> environment)
- throws IOException {
- if (environment != null) {
- final Object orb = environment.get(EnvHelp.DEFAULT_ORB);
- if (orb != null && !(IIOPHelper.isOrb(orb)))
- throw new IllegalArgumentException(EnvHelp.DEFAULT_ORB +
- " must be an instance of org.omg.CORBA.ORB.");
- if (orb != null) return orb;
- }
- final Object orb =
- (RMIConnector.orb==null)?null:RMIConnector.orb.get();
- if (orb != null) return orb;
-
- final Object newOrb =
- IIOPHelper.createOrb((String[])null, (Properties)null);
- RMIConnector.orb = new WeakReference<Object>(newOrb);
- return newOrb;
- }
-
- /**
* Read RMIConnector fields from an {@link java.io.ObjectInputStream
* ObjectInputStream}.
* Calls {@code s.defaultReadObject()} and then initializes
@@ -1846,7 +1716,6 @@
throws IOException {
if (rmiServer == null && jmxServiceURL == null) throw new
InvalidObjectException("rmiServer and jmxServiceURL both null.");
- connectStub(this.rmiServer,env);
s.defaultWriteObject();
}
@@ -1911,24 +1780,15 @@
private RMIServer findRMIServer(JMXServiceURL directoryURL,
Map<String, Object> environment)
throws NamingException, IOException {
- final boolean isIiop = RMIConnectorServer.isIiopURL(directoryURL,true);
- if (isIiop) {
- // Make sure java.naming.corba.orb is in the Map.
- environment.put(EnvHelp.DEFAULT_ORB,resolveOrb(environment));
- }
String path = directoryURL.getURLPath();
int end = path.indexOf(';');
if (end < 0) end = path.length();
if (path.startsWith("/jndi/"))
- return findRMIServerJNDI(path.substring(6,end), environment, isIiop);
+ return findRMIServerJNDI(path.substring(6,end), environment);
else if (path.startsWith("/stub/"))
- return findRMIServerJRMP(path.substring(6,end), environment, isIiop);
- else if (path.startsWith("/ior/")) {
- if (!IIOPHelper.isAvailable())
- throw new IOException("iiop protocol not available");
- return findRMIServerIIOP(path.substring(5,end), environment, isIiop);
- } else {
+ return findRMIServerJRMP(path.substring(6,end), environment);
+ else {
final String msg = "URL path must begin with /jndi/ or /stub/ " +
"or /ior/: " + path;
throw new MalformedURLException(msg);
@@ -1940,16 +1800,13 @@
* @param jndiURL A JNDI URL indicating the location of the Stub
* (see {@link javax.management.remote.rmi}), e.g.:
* <ul><li>{@code rmi://registry-host:port/rmi-stub-name}</li>
- * <li>or {@code iiop://cosnaming-host:port/iiop-stub-name}</li>
* <li>or {@code ldap://ldap-host:port/java-container-dn}</li>
* </ul>
* @param env the environment Map passed to the connector.
- * @param isIiop true if the stub is expected to be an IIOP stub.
* @return The retrieved RMIServer stub.
* @exception NamingException if the stub couldn't be found.
**/
- private RMIServer findRMIServerJNDI(String jndiURL, Map<String, ?> env,
- boolean isIiop)
+ private RMIServer findRMIServerJNDI(String jndiURL, Map<String, ?> env)
throws NamingException {
InitialContext ctx = new InitialContext(EnvHelp.mapToHashtable(env));
@@ -1957,10 +1814,7 @@
Object objref = ctx.lookup(jndiURL);
ctx.close();
- if (isIiop)
- return narrowIIOPServer(objref);
- else
- return narrowJRMPServer(objref);
+ return narrowJRMPServer(objref);
}
private static RMIServer narrowJRMPServer(Object objref) {
@@ -1968,28 +1822,8 @@
return (RMIServer) objref;
}
- private static RMIServer narrowIIOPServer(Object objref) {
- try {
- return IIOPHelper.narrow(objref, RMIServer.class);
- } catch (ClassCastException e) {
- if (logger.traceOn())
- logger.trace("narrowIIOPServer","Failed to narrow objref=" +
- objref + ": " + e);
- if (logger.debugOn()) logger.debug("narrowIIOPServer",e);
- return null;
- }
- }
-
- private RMIServer findRMIServerIIOP(String ior, Map<String, ?> env, boolean isIiop) {
- // could forbid "rmi:" URL here -- but do we need to?
- final Object orb = env.get(EnvHelp.DEFAULT_ORB);
- final Object stub = IIOPHelper.stringToObject(orb, ior);
- return IIOPHelper.narrow(stub, RMIServer.class);
- }
-
- private RMIServer findRMIServerJRMP(String base64, Map<String, ?> env, boolean isIiop)
+ private RMIServer findRMIServerJRMP(String base64, Map<String, ?> env)
throws IOException {
- // could forbid "iiop:" URL here -- but do we need to?
final byte[] serialized;
try {
serialized = base64ToByteArray(base64);
@@ -2203,228 +2037,6 @@
return proxyStub;
}
- /*
- The following code performs a similar trick for RMI/IIOP to the
- one described above for RMI/JRMP. Unlike JRMP, though, we
- can't easily insert an object between the RMIConnection stub
- and the RMI/IIOP deserialization code, as explained below.
-
- A method in an RMI/IIOP stub does the following. It makes an
- org.omg.CORBA_2_3.portable.OutputStream for each request, and
- writes the parameters to it. Then it calls
- _invoke(OutputStream) which it inherits from CORBA's
- ObjectImpl. That returns an
- org.omg.CORBA_2_3.portable.InputStream. The return value is
- read from this InputStream. So the stack during
- deserialization looks like this:
-
- MBeanServerConnection.getAttribute (or whatever)
- -> _RMIConnection_Stub.getAttribute
- -> Util.readAny (a CORBA method)
- -> InputStream.read_any
- -> internal CORBA stuff
-
- What we would have *liked* to have done would be the same thing
- as for RMI/JRMP. We create a "ProxyDelegate" that is an
- org.omg.CORBA.portable.Delegate that simply forwards every
- operation to the real original Delegate from the RMIConnection
- stub, except that the InputStream returned by _invoke is
- wrapped by a "ProxyInputStream" that is loaded by our
- NoCallStackClassLoader.
-
- Unfortunately, this doesn't work, at least with Sun's J2SE
- 1.4.2, because the CORBA code is not designed to allow you to
- change Delegates arbitrarily. You get a ClassCastException
- from code that expects the Delegate to implement an internal
- interface.
-
- So instead we do the following. We create a subclass of the
- stub that overrides the _invoke method so as to wrap the
- returned InputStream in a ProxyInputStream. We create a
- subclass of ProxyInputStream using the NoCallStackClassLoader
- and override its read_any and read_value(Class) methods.
- (These are the only methods called during deserialization of
- MBeanServerConnection return values.) We extract the Delegate
- from the original stub and insert it into our subclass stub,
- and away we go. The state of a stub consists solely of its
- Delegate.
-
- We also need to catch ApplicationException, which will encode
- any exceptions declared in the throws clause of the called
- method. Its InputStream needs to be wrapped in a
- ProxyInputSteam too.
-
- We override _releaseReply in the stub subclass so that it
- replaces a ProxyInputStream argument with the original
- InputStream. This avoids problems if the implementation of
- _releaseReply ends up casting this InputStream to an
- implementation-specific interface (which in Sun's J2SE 5 it
- does).
-
- It is not strictly necessary for the stub subclass to be loaded
- by a NoCallStackClassLoader, since the call-stack search stops
- at the ProxyInputStream subclass. However, it is convenient
- for two reasons. One is that it means that the
- ProxyInputStream subclass can be accessed directly, without
- using reflection. The other is that it avoids build problems,
- since usually stubs are created after other classes are
- compiled, so we can't access them from this class without,
- again, using reflection.
-
- The strings below encode the following two Java classes,
- compiled using javac -g:none.
-
- package com.sun.jmx.remote.protocol.iiop;
-
- import org.omg.stub.javax.management.remote.rmi._RMIConnection_Stub;
-
- import org.omg.CORBA.portable.ApplicationException;
- import org.omg.CORBA.portable.InputStream;
- import org.omg.CORBA.portable.OutputStream;
- import org.omg.CORBA.portable.RemarshalException;
-
- public class ProxyStub extends _RMIConnection_Stub {
- public InputStream _invoke(OutputStream out)
- throws ApplicationException, RemarshalException {
- try {
- return new PInputStream(super._invoke(out));
- } catch (ApplicationException e) {
- InputStream pis = new PInputStream(e.getInputStream());
- throw new ApplicationException(e.getId(), pis);
- }
- }
-
- public void _releaseReply(InputStream in) {
- if (in != null)
- in = ((PInputStream)in).getProxiedInputStream();
- super._releaseReply(in);
- }
- }
-
- package com.sun.jmx.remote.protocol.iiop;
-
- public class PInputStream extends ProxyInputStream {
- public PInputStream(org.omg.CORBA.portable.InputStream in) {
- super(in);
- }
-
- public org.omg.CORBA.Any read_any() {
- return in.read_any();
- }
-
- public java.io.Serializable read_value(Class clz) {
- return narrow().read_value(clz);
- }
- }
-
-
- */
- private static final String iiopConnectionStubClassName =
- "org.omg.stub.javax.management.remote.rmi._RMIConnection_Stub";
- private static final String proxyStubClassName =
- "com.sun.jmx.remote.protocol.iiop.ProxyStub";
- private static final String ProxyInputStreamClassName =
- "com.sun.jmx.remote.protocol.iiop.ProxyInputStream";
- private static final String pInputStreamClassName =
- "com.sun.jmx.remote.protocol.iiop.PInputStream";
- private static final Class<?> proxyStubClass;
- static {
- final String proxyStubByteCodeString =
- "\312\376\272\276\0\0\0\63\0+\12\0\14\0\30\7\0\31\12\0\14\0\32\12"+
- "\0\2\0\33\7\0\34\12\0\5\0\35\12\0\5\0\36\12\0\5\0\37\12\0\2\0 "+
- "\12\0\14\0!\7\0\"\7\0#\1\0\6<init>\1\0\3()V\1\0\4Code\1\0\7_in"+
- "voke\1\0K(Lorg/omg/CORBA/portable/OutputStream;)Lorg/omg/CORBA"+
- "/portable/InputStream;\1\0\15StackMapTable\7\0\34\1\0\12Except"+
- "ions\7\0$\1\0\15_releaseReply\1\0'(Lorg/omg/CORBA/portable/Inp"+
- "utStream;)V\14\0\15\0\16\1\0-com/sun/jmx/remote/protocol/iiop/"+
- "PInputStream\14\0\20\0\21\14\0\15\0\27\1\0+org/omg/CORBA/porta"+
- "ble/ApplicationException\14\0%\0&\14\0'\0(\14\0\15\0)\14\0*\0&"+
- "\14\0\26\0\27\1\0*com/sun/jmx/remote/protocol/iiop/ProxyStub\1"+
- "\0<org/omg/stub/javax/management/remote/rmi/_RMIConnection_Stu"+
- "b\1\0)org/omg/CORBA/portable/RemarshalException\1\0\16getInput"+
- "Stream\1\0&()Lorg/omg/CORBA/portable/InputStream;\1\0\5getId\1"+
- "\0\24()Ljava/lang/String;\1\09(Ljava/lang/String;Lorg/omg/CORB"+
- "A/portable/InputStream;)V\1\0\25getProxiedInputStream\0!\0\13\0"+
- "\14\0\0\0\0\0\3\0\1\0\15\0\16\0\1\0\17\0\0\0\21\0\1\0\1\0\0\0\5"+
- "*\267\0\1\261\0\0\0\0\0\1\0\20\0\21\0\2\0\17\0\0\0G\0\4\0\4\0\0"+
- "\0'\273\0\2Y*+\267\0\3\267\0\4\260M\273\0\2Y,\266\0\6\267\0\4N"+
- "\273\0\5Y,\266\0\7-\267\0\10\277\0\1\0\0\0\14\0\15\0\5\0\1\0\22"+
- "\0\0\0\6\0\1M\7\0\23\0\24\0\0\0\6\0\2\0\5\0\25\0\1\0\26\0\27\0"+
- "\1\0\17\0\0\0'\0\2\0\2\0\0\0\22+\306\0\13+\300\0\2\266\0\11L*+"+
- "\267\0\12\261\0\0\0\1\0\22\0\0\0\3\0\1\14\0\0";
- final String pInputStreamByteCodeString =
- "\312\376\272\276\0\0\0\63\0\36\12\0\7\0\17\11\0\6\0\20\12\0\21"+
- "\0\22\12\0\6\0\23\12\0\24\0\25\7\0\26\7\0\27\1\0\6<init>\1\0'("+
- "Lorg/omg/CORBA/portable/InputStream;)V\1\0\4Code\1\0\10read_an"+
- "y\1\0\25()Lorg/omg/CORBA/Any;\1\0\12read_value\1\0)(Ljava/lang"+
- "/Class;)Ljava/io/Serializable;\14\0\10\0\11\14\0\30\0\31\7\0\32"+
- "\14\0\13\0\14\14\0\33\0\34\7\0\35\14\0\15\0\16\1\0-com/sun/jmx"+
- "/remote/protocol/iiop/PInputStream\1\0\61com/sun/jmx/remote/pr"+
- "otocol/iiop/ProxyInputStream\1\0\2in\1\0$Lorg/omg/CORBA/portab"+
- "le/InputStream;\1\0\"org/omg/CORBA/portable/InputStream\1\0\6n"+
- "arrow\1\0*()Lorg/omg/CORBA_2_3/portable/InputStream;\1\0&org/o"+
- "mg/CORBA_2_3/portable/InputStream\0!\0\6\0\7\0\0\0\0\0\3\0\1\0"+
- "\10\0\11\0\1\0\12\0\0\0\22\0\2\0\2\0\0\0\6*+\267\0\1\261\0\0\0"+
- "\0\0\1\0\13\0\14\0\1\0\12\0\0\0\24\0\1\0\1\0\0\0\10*\264\0\2\266"+
- "\0\3\260\0\0\0\0\0\1\0\15\0\16\0\1\0\12\0\0\0\25\0\2\0\2\0\0\0"+
- "\11*\266\0\4+\266\0\5\260\0\0\0\0\0\0";
- final byte[] proxyStubByteCode =
- NoCallStackClassLoader.stringToBytes(proxyStubByteCodeString);
- final byte[] pInputStreamByteCode =
- NoCallStackClassLoader.stringToBytes(pInputStreamByteCodeString);
- final String[] classNames={proxyStubClassName, pInputStreamClassName};
- final byte[][] byteCodes = {proxyStubByteCode, pInputStreamByteCode};
- final String[] otherClassNames = {
- iiopConnectionStubClassName,
- ProxyInputStreamClassName,
- };
- if (IIOPHelper.isAvailable()) {
- PrivilegedExceptionAction<Class<?>> action =
- new PrivilegedExceptionAction<Class<?>>() {
- public Class<?> run() throws Exception {
- Class<RMIConnector> thisClass = RMIConnector.class;
- ClassLoader thisLoader = thisClass.getClassLoader();
- ProtectionDomain thisProtectionDomain =
- thisClass.getProtectionDomain();
- ClassLoader cl =
- new NoCallStackClassLoader(classNames,
- byteCodes,
- otherClassNames,
- thisLoader,
- thisProtectionDomain);
- return cl.loadClass(proxyStubClassName);
- }
- };
- Class<?> stubClass;
- try {
- stubClass = AccessController.doPrivileged(action);
- } catch (Exception e) {
- logger.error("<clinit>",
- "Unexpected exception making shadow IIOP stub class: "+e);
- logger.debug("<clinit>",e);
- stubClass = null;
- }
- proxyStubClass = stubClass;
- } else {
- proxyStubClass = null;
- }
- }
-
- private static RMIConnection shadowIiopStub(Object stub)
- throws InstantiationException, IllegalAccessException {
- Object proxyStub = null;
- try {
- proxyStub = AccessController.doPrivileged(new PrivilegedExceptionAction<Object>() {
- public Object run() throws Exception {
- return proxyStubClass.newInstance();
- }
- });
- } catch (PrivilegedActionException e) {
- throw new InternalError();
- }
- IIOPHelper.setDelegate(proxyStub, IIOPHelper.getDelegate(stub));
- return (RMIConnection) proxyStub;
- }
private static RMIConnection getConnection(RMIServer server,
Object credentials,
boolean checkStub)
@@ -2434,8 +2046,6 @@
try {
if (c.getClass() == rmiConnectionImplStubClass)
return shadowJrmpStub((RemoteObject) c);
- if (c.getClass().getName().equals(iiopConnectionStubClassName))
- return shadowIiopStub(c);
logger.trace("getConnection",
"Did not wrap " + c.getClass() + " to foil " +
"stack search for classes: class loading semantics " +
--- a/jdk/src/java.management/share/classes/javax/management/remote/rmi/RMIConnectorServer.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.management/share/classes/javax/management/remote/rmi/RMIConnectorServer.java Fri Sep 25 12:04:35 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -27,7 +27,6 @@
import com.sun.jmx.remote.security.MBeanServerFileAccessController;
-import com.sun.jmx.remote.internal.IIOPHelper;
import com.sun.jmx.remote.util.ClassLogger;
import com.sun.jmx.remote.util.EnvHelp;
@@ -117,8 +116,8 @@
*
* @exception MalformedURLException if <code>url</code> does not
* conform to the syntax for an RMI connector, or if its protocol
- * is not recognized by this implementation. Only "rmi" and "iiop"
- * are valid when this constructor is used.
+ * is not recognized by this implementation. Only "rmi" is valid when
+ * this constructor is used.
*
* @exception IOException if the connector server cannot be created
* for some reason or if it is inevitable that its {@link #start()
@@ -151,8 +150,8 @@
*
* @exception MalformedURLException if <code>url</code> does not
* conform to the syntax for an RMI connector, or if its protocol
- * is not recognized by this implementation. Only "rmi" and "iiop"
- * are valid when this constructor is used.
+ * is not recognized by this implementation. Only "rmi" is valid
+ * when this constructor is used.
*
* @exception IOException if the connector server cannot be created
* for some reason or if it is inevitable that its {@link #start()
@@ -179,7 +178,7 @@
* consistent with the protocol type specified in <var>url</var>.
* If this parameter is non null, the protocol type specified by
* <var>url</var> is not constrained, and is assumed to be valid.
- * Otherwise, only "rmi" and "iiop" will be recognized.
+ * Otherwise, only "rmi" will be recognized.
*
* @param mbeanServer the MBean server to which the new connector
* server is attached, or null if it will be attached by being
@@ -189,8 +188,8 @@
*
* @exception MalformedURLException if <code>url</code> does not
* conform to the syntax for an RMI connector, or if its protocol
- * is not recognized by this implementation. Only "rmi" and "iiop"
- * are recognized when <var>rmiServerImpl</var> is null.
+ * is not recognized by this implementation. Only "rmi" is recognized
+ * when <var>rmiServerImpl</var> is null.
*
* @exception IOException if the connector server cannot be created
* for some reason or if it is inevitable that its {@link #start()
@@ -208,7 +207,7 @@
IllegalArgumentException("Null JMXServiceURL");
if (rmiServerImpl == null) {
final String prt = url.getProtocol();
- if (prt == null || !(prt.equals("rmi") || prt.equals("iiop"))) {
+ if (prt == null || !(prt.equals("rmi"))) {
final String msg = "Invalid protocol type: " + prt;
throw new MalformedURLException(msg);
}
@@ -298,11 +297,6 @@
* <li>If an <code>RMIServerImpl</code> was supplied to the
* constructor, it is used.
*
- * <li>Otherwise, if the protocol part of the
- * <code>JMXServiceURL</code> supplied to the constructor was
- * <code>iiop</code>, an object of type {@link RMIIIOPServerImpl}
- * is created.
- *
* <li>Otherwise, if the <code>JMXServiceURL</code>
* was null, or its protocol part was <code>rmi</code>, an object
* of type {@link RMIJRMPServerImpl} is created.
@@ -324,21 +318,19 @@
* will not be bound to a directory. Instead, a reference to it
* will be encoded in the URL path of the RMIConnectorServer
* address (returned by {@link #getAddress()}). The encodings for
- * <code>rmi</code> and <code>iiop</code> are described in the
- * package documentation for {@link
- * javax.management.remote.rmi}.</p>
+ * <code>rmi</code> are described in the package documentation for
+ * {@link javax.management.remote.rmi}.</p>
*
* <p>The behavior when the URL path is neither empty nor a JNDI
- * directory URL, or when the protocol is neither <code>rmi</code>
- * nor <code>iiop</code>, is implementation defined, and may
- * include throwing {@link MalformedURLException} when the
- * connector server is created or when it is started.</p>
+ * directory URL, or when the protocol is not <code>rmi</code>,
+ * is implementation defined, and may include throwing
+ * {@link MalformedURLException} when the connector server is created
+ * or when it is started.</p>
*
* @exception IllegalStateException if the connector server has
* not been attached to an MBean server.
* @exception IOException if the connector server cannot be
- * started, or in the case of the {@code iiop} protocol, that
- * RMI/IIOP is not supported.
+ * started.
*/
public synchronized void start() throws IOException {
final boolean tracing = logger.traceOn();
@@ -649,16 +641,13 @@
* Creates a new RMIServerImpl.
**/
RMIServerImpl newServer() throws IOException {
- final boolean iiop = isIiopURL(address,true);
final int port;
if (address == null)
port = 0;
else
port = address.getPort();
- if (iiop)
- return newIIOPServer(attributes);
- else
- return newJRMPServer(attributes, port);
+
+ return newJRMPServer(attributes, port);
}
/**
@@ -675,10 +664,7 @@
final int port;
if (address == null) {
- if (IIOPHelper.isStub(rmiServer))
- protocol = "iiop";
- else
- protocol = "rmi";
+ protocol = "rmi";
host = null; // will default to local host name
port = 0;
} else {
@@ -692,31 +678,12 @@
address = new JMXServiceURL(protocol, host, port, urlPath);
}
- static boolean isIiopURL(JMXServiceURL directoryURL, boolean strict)
- throws MalformedURLException {
- String protocol = directoryURL.getProtocol();
- if (protocol.equals("rmi"))
- return false;
- else if (protocol.equals("iiop"))
- return true;
- else if (strict) {
-
- throw new MalformedURLException("URL must have protocol " +
- "\"rmi\" or \"iiop\": \"" +
- protocol + "\"");
- }
- return false;
- }
-
/**
* Returns the IOR of the given rmiServer.
**/
static String encodeStub(
RMIServer rmiServer, Map<String, ?> env) throws IOException {
- if (IIOPHelper.isStub(rmiServer))
- return "/ior/" + encodeIIOPStub(rmiServer, env);
- else
- return "/stub/" + encodeJRMPStub(rmiServer, env);
+ return "/stub/" + encodeJRMPStub(rmiServer, env);
}
static String encodeJRMPStub(
@@ -730,17 +697,6 @@
return byteArrayToBase64(bytes);
}
- static String encodeIIOPStub(
- RMIServer rmiServer, Map<String, ?> env)
- throws IOException {
- try {
- Object orb = IIOPHelper.getOrb(rmiServer);
- return IIOPHelper.objectToString(orb, rmiServer);
- } catch (RuntimeException x) {
- throw newIOException(x.getMessage(), x);
- }
- }
-
/**
* Object that we will bind to the registry.
* This object is a stub connected to our RMIServerImpl.
@@ -748,8 +704,7 @@
private static RMIServer objectToBind(
RMIServerImpl rmiServer, Map<String, ?> env)
throws IOException {
- return RMIConnector.
- connectStub((RMIServer)rmiServer.toStub(),env);
+ return (RMIServer)rmiServer.toStub();
}
private static RMIServerImpl newJRMPServer(Map<String, ?> env, int port)
@@ -761,11 +716,6 @@
return new RMIJRMPServerImpl(port, csf, ssf, env);
}
- private static RMIServerImpl newIIOPServer(Map<String, ?> env)
- throws IOException {
- return new RMIIIOPServerImpl(env);
- }
-
private static String byteArrayToBase64(byte[] a) {
int aLen = a.length;
int numFullGroups = aLen/3;
--- a/jdk/src/java.management/share/classes/javax/management/remote/rmi/RMIIIOPServerImpl.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.management/share/classes/javax/management/remote/rmi/RMIIIOPServerImpl.java Fri Sep 25 12:04:35 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -27,16 +27,9 @@
import java.io.IOException;
import java.rmi.Remote;
-import java.security.AccessControlContext;
-import java.security.AccessController;
-import java.security.PrivilegedActionException;
-import java.security.PrivilegedExceptionAction;
import java.util.Map;
-import java.util.Collections;
import javax.security.auth.Subject;
-import com.sun.jmx.remote.internal.IIOPHelper;
-
/**
* <p>An {@link RMIServerImpl} that is exported through IIOP and that
* creates client connections as RMI objects exported through IIOP.
@@ -45,120 +38,59 @@
* @see RMIServerImpl
*
* @since 1.5
+ * @deprecated This transport is no longer supported.
*/
+@Deprecated
public class RMIIIOPServerImpl extends RMIServerImpl {
/**
- * <p>Creates a new {@link RMIServerImpl}.</p>
+ * Throws {@linkplain UnsupportedOperationException}
*
* @param env the environment containing attributes for the new
* <code>RMIServerImpl</code>. Can be null, which is equivalent
* to an empty Map.
*
- * @exception IOException if the RMI object cannot be created.
+ * @throws IOException if the RMI object cannot be created.
*/
public RMIIIOPServerImpl(Map<String,?> env)
throws IOException {
super(env);
- this.env = (env == null) ? Collections.<String, Object>emptyMap() : env;
-
- callerACC = AccessController.getContext();
+ throw new UnsupportedOperationException();
}
+ @Override
protected void export() throws IOException {
- IIOPHelper.exportObject(this);
+ throw new UnsupportedOperationException("Method not supported. JMX RMI-IIOP is deprecated");
}
+ @Override
protected String getProtocol() {
return "iiop";
}
- /**
- * <p>Returns an IIOP stub.</p>
- * The stub might not yet be connected to the ORB. The stub will
- * be serializable only if it is connected to the ORB.
- * @return an IIOP stub.
- * @exception IOException if the stub cannot be created - e.g the
- * RMIIIOPServerImpl has not been exported yet.
- **/
+ @Override
public Remote toStub() throws IOException {
- // javax.rmi.CORBA.Stub stub =
- // (javax.rmi.CORBA.Stub) PortableRemoteObject.toStub(this);
- final Remote stub = IIOPHelper.toStub(this);
- // java.lang.System.out.println("NON CONNECTED STUB " + stub);
- // org.omg.CORBA.ORB orb =
- // org.omg.CORBA.ORB.init((String[])null, (Properties)null);
- // stub.connect(orb);
- // java.lang.System.out.println("CONNECTED STUB " + stub);
- return stub;
+ throw new UnsupportedOperationException();
}
- /**
- * <p>Creates a new client connection as an RMI object exported
- * through IIOP.
- *
- * @param connectionId the ID of the new connection. Every
- * connection opened by this connector server will have a
- * different ID. The behavior is unspecified if this parameter is
- * null.
- *
- * @param subject the authenticated subject. Can be null.
- *
- * @return the newly-created <code>RMIConnection</code>.
- *
- * @exception IOException if the new client object cannot be
- * created or exported.
- */
+ @Override
protected RMIConnection makeClient(String connectionId, Subject subject)
throws IOException {
-
- if (connectionId == null)
- throw new NullPointerException("Null connectionId");
-
- RMIConnection client =
- new RMIConnectionImpl(this, connectionId, getDefaultClassLoader(),
- subject, env);
- IIOPHelper.exportObject(client);
- return client;
+ throw new UnsupportedOperationException();
}
+ @Override
protected void closeClient(RMIConnection client) throws IOException {
- IIOPHelper.unexportObject(client);
+ throw new UnsupportedOperationException();
}
- /**
- * <p>Called by {@link #close()} to close the connector server by
- * unexporting this object. After returning from this method, the
- * connector server must not accept any new connections.</p>
- *
- * @exception IOException if the attempt to close the connector
- * server failed.
- */
+ @Override
protected void closeServer() throws IOException {
- IIOPHelper.unexportObject(this);
+ throw new UnsupportedOperationException();
}
@Override
RMIConnection doNewClient(final Object credentials) throws IOException {
- if (callerACC == null) {
- throw new SecurityException("AccessControlContext cannot be null");
- }
- try {
- return AccessController.doPrivileged(
- new PrivilegedExceptionAction<RMIConnection>() {
- public RMIConnection run() throws IOException {
- return superDoNewClient(credentials);
- }
- }, callerACC);
- } catch (PrivilegedActionException pae) {
- throw (IOException) pae.getCause();
- }
+ throw new UnsupportedOperationException();
}
-
- RMIConnection superDoNewClient(Object credentials) throws IOException {
- return super.doNewClient(credentials);
- }
-
- private final Map<String, ?> env;
- private final AccessControlContext callerACC;
}
--- a/jdk/src/java.management/share/classes/javax/management/remote/rmi/RMIServerImpl.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.management/share/classes/javax/management/remote/rmi/RMIServerImpl.java Fri Sep 25 12:04:35 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -61,8 +61,7 @@
* or by instantiating {@link RMIConnector}.</p>
*
* <p>This is an abstract class. Concrete subclasses define the
- * details of the client connection objects, such as whether they use
- * JRMP or IIOP.</p>
+ * details of the client connection objects.</p>
*
* @since 1.5
*/
@@ -307,7 +306,7 @@
/**
* <p>Returns the protocol string for this object. The string is
- * <code>rmi</code> for RMI/JRMP and <code>iiop</code> for RMI/IIOP.
+ * <code>rmi</code> for RMI/JRMP.
*
* @return the protocol string for this object.
*/
--- a/jdk/src/java.management/share/classes/javax/management/remote/rmi/package.html Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.management/share/classes/javax/management/remote/rmi/package.html Fri Sep 25 12:04:35 2015 -0700
@@ -2,7 +2,7 @@
<head>
<title>RMI connector</title>
<!--
-Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
+Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
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,16 +36,14 @@
that different implementations of the RMI connector can
interoperate.</p>
- <p>The RMI connector supports the JRMP transport for RMI, and
- optionally the IIOP transport.</p>
+ <p>The RMI connector supports the JRMP transport for RMI.</p>
<p>Like most connectors in the JMX Remote API, an RMI connector
usually has an address, which
is a {@link javax.management.remote.JMXServiceURL
JMXServiceURL}. The protocol part of this address is
<code>rmi</code> for a connector that uses the default RMI
- transport (JRMP), or <code>iiop</code> for a connector that
- uses RMI/IIOP.</p>
+ transport (JRMP).</p>
<p>There are two forms for RMI connector addresses:</p>
@@ -65,10 +63,9 @@
information needed to connect to the connector server. When
using RMI/JRMP, the encoded form is the serialized RMI stub
for the server object, encoded using BASE64 without embedded
- newlines. When using RMI/IIOP, the encoded form is the CORBA
- IOR for the server object.
+ newlines.
</ul>
-
+
<p>Addresses are covered in more detail below.</p>
@@ -91,9 +88,8 @@
<h4>Choosing the RMI transport</h4>
- <p>You can choose the RMI transport (JRMP or IIOP) by specifying
- <code>rmi</code> or <code>iiop</code> in the
- <code><em>protocol</em></code> part of the
+ <p>You can choose the RMI transport by specifying
+ <code>rmi</code> in the <code><em>protocol</em></code> part of the
<code>serviceURL</code> when creating the connector server. You
can also create specialized connector servers by instantiating
an appropriate subclass of {@link
@@ -132,33 +128,9 @@
stub for the generated object, encoded in BASE64 without
newlines.</p>
- <li><p>If the <code>serviceURL</code> looks like:</p>
-
- <pre>
- <code>service:jmx:iiop://<em>host</em>:<em>port</em></code>
- </pre>
-
- <p>then the connector server will generate an {@link
- javax.management.remote.rmi.RMIIIOPServerImpl
- RMIIIOPServerImpl} and the returned
- <code>JMXServiceURL</code> looks like:</p>
-
- <pre>
- <code>service:jmx:iiop://<em>host</em>:<em>port</em>/ior/IOR:<em>XXXX</em></code>
- </pre>
-
- <p>where <code>IOR:<em>XXXX</em></code> is the standard CORBA
- encoding of the Interoperable Object Reference for the
- generated object.</p>
-
<li><p>If there is no <code>serviceURL</code>, there must be a
- user-provided <code>RMIServerImpl</code>. If the {@link
- javax.management.remote.rmi.RMIServerImpl#toStub toStub}
- method on this object returns an instance of {@link
- javax.rmi.CORBA.Stub}, then the connector server will generate
- a <code>JMXServiceURL</code> using the <code>iiop</code>
- form above. Otherwise, it will generate a
- <code>JMXServiceURL</code> using the <code>rmi</code>
+ user-provided <code>RMIServerImpl</code>. The connector server
+ will generate a <code>JMXServiceURL</code> using the <code>rmi</code>
form.</p>
</ul>
@@ -195,12 +167,10 @@
stub. This directory address is then used by both client and
server.</p>
- <p>In this case, the <code>serviceURL</code> has one of these two
- forms:</p>
+ <p>In this case, the <code>serviceURL</code> has the following form:</p>
<pre>
<code>service:jmx:rmi://<em>host</em>:<em>port</em>/jndi/<em>jndi-name</em></code>
- <code>service:jmx:iiop://<em>host</em>:<em>port</em>/jndi/<em>jndi-name</em></code>
</pre>
<p>Here, <code><em>jndi-name</em></code> is a string that can be
@@ -212,8 +182,7 @@
<p>The connector server will generate an
<code>RMIServerImpl</code> based on the protocol
- (<code>rmi</code> or <code>iiop</code>) and, for
- <code>rmi</code>, the <code><em>port</em></code> if any. When
+ (<code>rmi</code>) and the <code><em>port</em></code> if any. When
the connector server is started, it will derive a stub from this
object using its {@link
javax.management.remote.rmi.RMIServerImpl#toStub toStub} method
@@ -250,11 +219,11 @@
<p>As another example, if the <code>JMXServiceURL</code> is:
<pre>
- <code>service:jmx:iiop://ignoredhost/jndi/ldap://dirhost:9999/cn=this,ou=that</code>
+ <code>service:jmx:rmi://ignoredhost/jndi/ldap://dirhost:9999/cn=this,ou=that</code>
</pre>
then the connector server will generate an
- <code>RMIIIOPServerImpl</code> and store its stub using the JNDI
+ <code>RMIJRMPServerImpl</code> and store its stub using the JNDI
name
<pre>
@@ -267,11 +236,11 @@
<p>If the <code>JMXServiceURL</code> is:
<pre>
- <code>service:jmx:iiop://ignoredhost/jndi/cn=this,ou=that</code>
+ <code>service:jmx:rmi://ignoredhost/jndi/cn=this,ou=that</code>
</pre>
then the connector server will generate an
- <code>RMIIIOPServerImpl</code> and store its stub using the JNDI
+ <code>RMIJRMPServerImpl</code> and store its stub using the JNDI
name
<pre>
@@ -287,7 +256,7 @@
omitted, for example:</p>
<pre>
- <code>service:jmx:iiop:///jndi/cn=this,ou=that</code>
+ <code>service:jmx:rmi:///jndi/cn=this,ou=that</code>
</pre>
<p>However, it is good practice to use the name of the host
@@ -313,8 +282,7 @@
<p>An RMI connector client is usually constructed using {@link
javax.management.remote.JMXConnectorFactory}, with a
- <code>JMXServiceURL</code> that has <code>rmi</code> or
- <code>iiop</code> as its protocol.</p>
+ <code>JMXServiceURL</code> that has <code>rmi</code> as its protocol.</p>
<p>If the <code>JMXServiceURL</code> was generated by the server,
as described above under <a href="#servergen">"connector
@@ -343,37 +311,6 @@
constructor of {@link javax.management.remote.rmi.RMIConnector
RMIConnector}.</p>
-
- <h3>Specifying an ORB for the RMI/IIOP connector</h3>
-
- <p>When using the IIOP transport, the client and server can
- specify what ORB to use
- with the attribute <code>java.naming.corba.orb</code>.
- Connection to the ORB happens at {@link
- javax.management.remote.rmi.RMIConnectorServer#start() start} time
- for the connector server, and at {@link
- javax.management.remote.rmi.RMIConnector#connect(java.util.Map)
- connect} time for the connector client.
- If the <code>java.naming.corba.orb</code> attribute is contained
- in the environment Map, then its value (an {@link
- org.omg.CORBA.ORB ORB}), is used to connect the IIOP Stubs.
- Otherwise, a new org.omg.CORBA.ORB is created by calling {@link
- org.omg.CORBA.ORB
- org.omg.CORBA.ORB.init((String[])null,(Properties)null)}. A
- later RMI connector client or server in the same JVM can reuse
- this ORB, or it can create another one in the same way.</p>
-
- <p>If the <code>java.naming.corba.orb</code> attribute is
- specified and does not point to an {@link org.omg.CORBA.ORB ORB},
- then an <code>{@link java.lang.IllegalArgumentException}</code>
- will be thrown.</p>
-
- <p>The mechanism described here does not apply when the IIOP
- Remote objects (Stubs or Servers) are created and connected to
- an ORB manually before being passed to the RMIConnector and
- RMIConnectorServer.</p>
-
-
<h3>Dynamic code downloading</h3>
<p>If an RMI connector client or server receives from its peer an
@@ -385,7 +322,7 @@
code downloading using Java RMI</em></a> explains this in more
detail.</p>
-
+
@see <a href="{@docRoot}/../technotes/guides/rmi/index.html">
Java™ Remote Method
Invocation (RMI)</a>
--- a/jdk/src/java.naming/share/classes/com/sun/jndi/ldap/LdapClient.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/java.naming/share/classes/com/sun/jndi/ldap/LdapClient.java Fri Sep 25 12:04:35 2015 -0700
@@ -494,16 +494,14 @@
*/
void processConnectionClosure() {
// Notify listeners
- synchronized (unsolicited) {
- if (unsolicited.size() > 0) {
- String msg;
- if (conn != null) {
- msg = conn.host + ":" + conn.port + " connection closed";
- } else {
- msg = "Connection closed";
- }
- notifyUnsolicited(new CommunicationException(msg));
+ if (unsolicited.size() > 0) {
+ String msg;
+ if (conn != null) {
+ msg = conn.host + ":" + conn.port + " connection closed";
+ } else {
+ msg = "Connection closed";
}
+ notifyUnsolicited(new CommunicationException(msg));
}
// Remove from pool
@@ -1499,13 +1497,8 @@
if (debug > 0) {
System.err.println("LdapClient.removeUnsolicited" + ctx);
}
- synchronized (unsolicited) {
- if (unsolicited.size() == 0) {
- return;
- }
unsolicited.removeElement(ctx);
}
- }
// NOTE: Cannot be synchronized because this is called asynchronously
// by the reader thread in Connection. Instead, sync on 'unsolicited' Vector.
@@ -1513,30 +1506,35 @@
if (debug > 0) {
System.err.println("LdapClient.processUnsolicited");
}
- synchronized (unsolicited) {
- try {
- // Parse the response
- LdapResult res = new LdapResult();
+ try {
+ // Parse the response
+ LdapResult res = new LdapResult();
+
+ ber.parseSeq(null); // init seq
+ ber.parseInt(); // msg id; should be 0; ignored
+ if (ber.parseByte() != LDAP_REP_EXTENSION) {
+ throw new IOException(
+ "Unsolicited Notification must be an Extended Response");
+ }
+ ber.parseLength();
+ parseExtResponse(ber, res);
- ber.parseSeq(null); // init seq
- ber.parseInt(); // msg id; should be 0; ignored
- if (ber.parseByte() != LDAP_REP_EXTENSION) {
- throw new IOException(
- "Unsolicited Notification must be an Extended Response");
- }
- ber.parseLength();
- parseExtResponse(ber, res);
+ if (DISCONNECT_OID.equals(res.extensionId)) {
+ // force closing of connection
+ forceClose(pooled);
+ }
- if (DISCONNECT_OID.equals(res.extensionId)) {
- // force closing of connection
- forceClose(pooled);
- }
+ LdapCtx first = null;
+ UnsolicitedNotification notice = null;
+ synchronized (unsolicited) {
if (unsolicited.size() > 0) {
+ first = unsolicited.elementAt(0);
+
// Create an UnsolicitedNotification using the parsed data
// Need a 'ctx' object because we want to use the context's
// list of provider control factories.
- UnsolicitedNotification notice = new UnsolicitedResponseImpl(
+ notice = new UnsolicitedResponseImpl(
res.extensionId,
res.extensionValue,
res.referrals,
@@ -1544,42 +1542,45 @@
res.errorMessage,
res.matchedDN,
(res.resControls != null) ?
- unsolicited.elementAt(0).convertControls(res.resControls) :
+ first.convertControls(res.resControls) :
null);
-
- // Fire UnsolicitedNotification events to listeners
- notifyUnsolicited(notice);
-
- // If "disconnect" notification,
- // notify unsolicited listeners via NamingException
- if (DISCONNECT_OID.equals(res.extensionId)) {
- notifyUnsolicited(
- new CommunicationException("Connection closed"));
- }
}
- } catch (IOException e) {
- if (unsolicited.size() == 0)
- return; // no one registered; ignore
+ }
+
+ if (notice != null) {
+ // Fire UnsolicitedNotification events to listeners
+ notifyUnsolicited(notice);
- NamingException ne = new CommunicationException(
- "Problem parsing unsolicited notification");
- ne.setRootCause(e);
+ // If "disconnect" notification,
+ // notify unsolicited listeners via NamingException
+ if (DISCONNECT_OID.equals(res.extensionId)) {
+ notifyUnsolicited(
+ new CommunicationException("Connection closed"));
+ }
+ }
+ } catch (IOException e) {
+ NamingException ne = new CommunicationException(
+ "Problem parsing unsolicited notification");
+ ne.setRootCause(e);
- notifyUnsolicited(ne);
+ notifyUnsolicited(ne);
- } catch (NamingException e) {
- notifyUnsolicited(e);
- }
+ } catch (NamingException e) {
+ notifyUnsolicited(e);
}
}
private void notifyUnsolicited(Object e) {
- for (int i = 0; i < unsolicited.size(); i++) {
- unsolicited.elementAt(i).fireUnsolicited(e);
+ Vector<LdapCtx> unsolicitedCopy;
+ synchronized (unsolicited) {
+ unsolicitedCopy = new Vector<>(unsolicited);
+ if (e instanceof NamingException) {
+ unsolicited.setSize(0); // no more listeners after exception
+ }
}
- if (e instanceof NamingException) {
- unsolicited.setSize(0); // no more listeners after exception
+ for (int i = 0; i < unsolicitedCopy.size(); i++) {
+ unsolicitedCopy.elementAt(i).fireUnsolicited(e);
}
}
--- a/jdk/src/jdk.crypto.pkcs11/share/classes/sun/security/pkcs11/P11KeyStore.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/jdk.crypto.pkcs11/share/classes/sun/security/pkcs11/P11KeyStore.java Fri Sep 25 12:04:35 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -750,6 +750,21 @@
} else {
login(new PasswordCallbackHandler(password));
}
+ } catch(LoginException e) {
+ Throwable cause = e.getCause();
+ if (cause instanceof PKCS11Exception) {
+ PKCS11Exception pe = (PKCS11Exception) cause;
+ if (pe.getErrorCode() == CKR_PIN_INCORRECT) {
+ // if password is wrong, the cause of the IOException
+ // should be an UnrecoverableKeyException
+ throw new IOException("load failed",
+ new UnrecoverableKeyException().initCause(e));
+ }
+ }
+ throw new IOException("load failed", e);
+ }
+
+ try {
if (mapLabels() == true) {
// CKA_LABELs are shared by multiple certs
writeDisabled = true;
@@ -757,7 +772,7 @@
if (debug != null) {
dumpTokenMap();
}
- } catch (LoginException | KeyStoreException | PKCS11Exception e) {
+ } catch (KeyStoreException | PKCS11Exception e) {
throw new IOException("load failed", e);
}
}
--- a/jdk/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/GCMParameters.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/GCMParameters.java Fri Sep 25 12:04:35 2015 -0700
@@ -90,7 +90,8 @@
return paramSpec.cast(new GCMParameterSpec(tLen*8, iv.clone()));
} else {
throw new InvalidParameterSpecException
- ("Inappropriate parameter specification");
+ ("Inappropriate parameter specification. Received " +
+ paramSpec.getClass().getName());
}
}
@@ -98,7 +99,8 @@
throws InvalidParameterSpecException {
if (!(paramSpec instanceof GCMParameterSpec)) {
throw new InvalidParameterSpecException
- ("Inappropriate parameter specification");
+ ("Inappropriate parameter specification. Received " +
+ paramSpec.getClass().getName());
}
GCMParameterSpec gcmSpec = (GCMParameterSpec) paramSpec;
try {
@@ -114,7 +116,8 @@
val.data.reset();
setValues(val.data.getOctetString(), val.data.getInteger());
} else {
- throw new IOException("GCM parameter parsing error: SEQ tag expected");
+ throw new IOException("GCM parameter parsing error: SEQ tag expected." +
+ " Received: " + val.tag);
}
}
--- a/jdk/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/NativeCipher.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/NativeCipher.java Fri Sep 25 12:04:35 2015 -0700
@@ -274,13 +274,14 @@
if (params != null) {
if (!(params instanceof IvParameterSpec)) {
throw new InvalidAlgorithmParameterException
- ("IvParameterSpec required");
+ ("IvParameterSpec required. Received: " +
+ params.getClass().getName());
} else {
ivBytes = ((IvParameterSpec) params).getIV();
if (ivBytes.length != blockSize) {
throw new InvalidAlgorithmParameterException
("Wrong IV length: must be " + blockSize +
- " bytes long");
+ " bytes long. Received length:" + ivBytes.length);
}
}
} else {
@@ -442,12 +443,13 @@
if (fixedKeySize == -1) {
// all 3 AES key lengths are allowed
if (keyLen != 16 && keyLen != 24 && keyLen != 32) {
- throw new InvalidKeyException("Key size is not valid");
+ throw new InvalidKeyException("Key size is not valid." +
+ " Got key length of: " + keyLen);
}
} else {
if (keyLen != fixedKeySize) {
throw new InvalidKeyException("Only " + fixedKeySize +
- "-byte keys are accepted");
+ "-byte keys are accepted. Got: " + keyLen);
}
}
// return the validated key length in bytes
--- a/jdk/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/NativeCipherWithJavaPadding.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/NativeCipherWithJavaPadding.java Fri Sep 25 12:04:35 2015 -0700
@@ -184,7 +184,7 @@
if (padValue < 1 || padValue > blockSize) {
UcryptoProvider.debug("PKCS5Padding: unpad, lastData: " + Arrays.toString(lastData));
UcryptoProvider.debug("PKCS5Padding: unpad, padValue=" + padValue);
- throw new BadPaddingException("Invalid pad value!");
+ throw new BadPaddingException("Invalid pad value: " + padValue);
}
// sanity check padding bytes
@@ -388,7 +388,7 @@
out = Arrays.copyOf(out, actualOut);
}
} catch (ShortBufferException sbe) {
- throw new UcryptoException("Internal Error");
+ throw new UcryptoException("Internal Error", sbe);
} finally {
reset();
}
@@ -404,7 +404,8 @@
int estimatedOutLen = engineGetOutputSize(inLen);
if (out.length - outOfs < estimatedOutLen) {
- throw new ShortBufferException();
+ throw new ShortBufferException("Actual: " + (out.length - outOfs) +
+ ". Estimated Out Length: " + estimatedOutLen);
}
try {
if (nc.encrypt) {
--- a/jdk/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/NativeDigest.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/NativeDigest.java Fri Sep 25 12:04:35 2015 -0700
@@ -131,7 +131,8 @@
try {
int len = engineDigest(digest, 0, digestLen);
if (len != digestLen) {
- throw new UcryptoException("Digest length mismatch");
+ throw new UcryptoException("Digest length mismatch." +
+ " Len: " + len + ". digestLen: " + digestLen);
}
return digest;
} catch (DigestException de) {
@@ -144,10 +145,11 @@
throws DigestException {
if (len < digestLen) {
throw new DigestException("Output buffer must be at least " +
- digestLen + " bytes long");
+ digestLen + " bytes long. Got: " + len);
}
if ((ofs < 0) || (len < 0) || (ofs > out.length - len)) {
- throw new DigestException("Buffer too short to store digest");
+ throw new DigestException("Buffer too short to store digest. " +
+ "ofs: " + ofs + ". len: " + len + ". out.length: " + out.length);
}
if (pCtxt == null) {
@@ -177,7 +179,8 @@
return;
}
if ((ofs < 0) || (len < 0) || (ofs > in.length - len)) {
- throw new ArrayIndexOutOfBoundsException();
+ throw new ArrayIndexOutOfBoundsException("ofs: " + ofs + ". len: "
+ + len + ". in.length: " + in.length);
}
if (pCtxt == null) {
pCtxt = new DigestContextRef(this, nativeInit(mech), mech);
--- a/jdk/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/NativeGCMCipher.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/NativeGCMCipher.java Fri Sep 25 12:04:35 2015 -0700
@@ -188,7 +188,8 @@
byte[] ivBytes = null;
if (params != null) {
if (!(params instanceof GCMParameterSpec)) {
- throw new InvalidAlgorithmParameterException("GCMParameterSpec required");
+ throw new InvalidAlgorithmParameterException("GCMParameterSpec required." +
+ " Received: " + params.getClass().getName());
} else {
tagLen = ((GCMParameterSpec) params).getTLen();
ivBytes = ((GCMParameterSpec) params).getIV();
@@ -264,9 +265,9 @@
int outOfs) throws ShortBufferException {
int len = getOutputSizeByOperation(inLen, false);
if (out.length - outOfs < len) {
- throw new ShortBufferException("Output buffer must be "
- + "(at least) " + len
- + " bytes long");
+ throw new ShortBufferException("Output buffer must be " +
+ "(at least) " + len + " bytes long. Got: " +
+ (out.length - outOfs));
}
if (aadBuffer != null && aadBuffer.size() > 0) {
// init again with AAD data
@@ -365,8 +366,8 @@
int len = getOutputSizeByOperation(inLen, true);
if (out.length - outOfs < len) {
throw new ShortBufferException("Output buffer must be "
- + "(at least) " + len
- + " bytes long");
+ + "(at least) " + len + " bytes long. Got: " +
+ (out.length - outOfs));
}
if (aadBuffer != null && aadBuffer.size() > 0) {
// init again with AAD data
@@ -385,7 +386,8 @@
if (inLen < tagLen/8) {
// Otherwise, Solaris lib will error out w/ CRYPTO_BUFFER_TOO_SMALL
// when ucrypto_decrypt_final() is called
- throw new AEADBadTagException("Input too short - need tag");
+ throw new AEADBadTagException("Input too short - need tag." +
+ " inLen: " + inLen + ". tagLen: " + tagLen);
}
// refresh 'in' to all buffered-up bytes
in = ibuffer.toByteArray();
--- a/jdk/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/NativeKey.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/NativeKey.java Fri Sep 25 12:04:35 2015 -0700
@@ -94,7 +94,8 @@
pKey = nativeInit(NativeKey.getMagnitude(mod),
NativeKey.getMagnitude(privateExp));
} else {
- throw new InvalidKeySpecException("Only supports RSAPrivateKeySpec");
+ throw new InvalidKeySpecException("Only supports RSAPrivateKeySpec." +
+ " Received: " + keySpec.getClass().getName());
}
if (pKey == 0L) {
throw new UcryptoException("Error constructing RSA PrivateKey");
@@ -141,7 +142,8 @@
NativeKey.getMagnitude(primeExpQ),
NativeKey.getMagnitude(crtCoeff));
} else {
- throw new InvalidKeySpecException("Only supports RSAPrivateCrtKeySpec");
+ throw new InvalidKeySpecException("Only supports RSAPrivateCrtKeySpec."
+ + " Received: " + keySpec.getClass().getName());
}
if (pKey == 0L) {
throw new UcryptoException("Error constructing RSA PrivateCrtKey");
@@ -184,7 +186,8 @@
pKey = nativeInit(NativeKey.getMagnitude(mod),
NativeKey.getMagnitude(publicExp));
} else {
- throw new InvalidKeySpecException("Only supports RSAPublicKeySpec");
+ throw new InvalidKeySpecException("Only supports RSAPublicKeySpec." +
+ " Received: " + keySpec.getClass().getName());
}
if (pKey == 0L) {
throw new UcryptoException("Error constructing RSA PublicKey");
--- a/jdk/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/NativeRSACipher.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/NativeRSACipher.java Fri Sep 25 12:04:35 2015 -0700
@@ -159,7 +159,8 @@
@Override
protected int engineGetKeySize(Key key) throws InvalidKeyException {
if (!(key instanceof RSAKey)) {
- throw new InvalidKeyException("RSAKey required");
+ throw new InvalidKeyException("RSAKey required. Got: " +
+ key.getClass().getName());
}
int n = ((RSAKey)key).getModulus().bitLength();
// strip off the leading extra 0x00 byte prefix
@@ -206,9 +207,11 @@
// Make sure the proper opmode uses the proper key
if (doEncrypt && (!(newKey instanceof RSAPublicKey))) {
- throw new InvalidKeyException("RSAPublicKey required for encryption");
+ throw new InvalidKeyException("RSAPublicKey required for encryption." +
+ " Received: " + newKey.getClass().getName());
} else if (!doEncrypt && (!(newKey instanceof RSAPrivateKey))) {
- throw new InvalidKeyException("RSAPrivateKey required for decryption");
+ throw new InvalidKeyException("RSAPrivateKey required for decryption." +
+ " Received: " + newKey.getClass().getName());
}
NativeKey nativeKey = null;
@@ -237,13 +240,14 @@
privateKey.getPrimeExponentP(),
privateKey.getPrimeExponentQ(),
privateKey.getCrtCoefficient()));
- } else if (newKey instanceof RSAPrivateKey) {
+ } else if (newKey instanceof RSAPrivateKey) {
RSAPrivateKey privateKey = (RSAPrivateKey) newKey;
nativeKey = (NativeKey) keyFactory.engineGeneratePrivate
(new RSAPrivateKeySpec(privateKey.getModulus(),
privateKey.getPrivateExponent()));
} else {
- throw new InvalidKeyException("Unsupported type of RSAPrivateKey");
+ throw new InvalidKeyException("Unsupported type of RSAPrivateKey." +
+ " Received: " + newKey.getClass().getName());
}
} catch (InvalidKeySpecException ikse) {
throw new InvalidKeyException(ikse);
@@ -282,7 +286,8 @@
protected synchronized int engineUpdate(byte[] in, int inOfs, int inLen, byte[] out,
int outOfs) throws ShortBufferException {
if (out.length - outOfs < outputSize) {
- throw new ShortBufferException("Output buffer too small");
+ throw new ShortBufferException("Output buffer too small. outputSize: " +
+ outputSize + ". out.length: " + out.length + ". outOfs: " + outOfs);
}
if (inLen > 0) {
update(in, inOfs, inLen);
@@ -332,7 +337,9 @@
"the key to be wrapped");
}
if (encodedKey.length > buffer.length) {
- throw new InvalidKeyException("Key is too long for wrapping");
+ throw new InvalidKeyException("Key is too long for wrapping. " +
+ "encodedKey.length: " + encodedKey.length +
+ ". buffer.length: " + buffer.length);
}
return engineDoFinal(encodedKey, 0, encodedKey.length);
} catch (BadPaddingException e) {
@@ -349,7 +356,9 @@
throws InvalidKeyException, NoSuchAlgorithmException {
if (wrappedKey.length > buffer.length) {
- throw new InvalidKeyException("Key is too long for unwrapping");
+ throw new InvalidKeyException("Key is too long for unwrapping." +
+ " wrappedKey.length: " + wrappedKey.length +
+ ". buffer.length: " + buffer.length);
}
boolean isTlsRsaPremasterSecret =
--- a/jdk/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/NativeRSAKeyFactory.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/NativeRSAKeyFactory.java Fri Sep 25 12:04:35 2015 -0700
@@ -56,7 +56,8 @@
} else if (keySpec instanceof RSAPrivateKeySpec) {
return new NativeKey.RSAPrivate(keySpec);
} else {
- throw new InvalidKeySpecException("Unsupported key spec");
+ throw new InvalidKeySpecException("Unsupported key spec." +
+ " Received: " + keySpec.getClass().getName());
}
}
--- a/jdk/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/NativeRSASignature.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/NativeRSASignature.java Fri Sep 25 12:04:35 2015 -0700
@@ -192,7 +192,8 @@
// Need to check RSA key length whenever a new private key is set
if (privateKey != key) {
if (!(privateKey instanceof RSAPrivateKey)) {
- throw new InvalidKeyException("RSAPrivateKey required");
+ throw new InvalidKeyException("RSAPrivateKey required. " +
+ "Received: " + privateKey.getClass().getName());
}
RSAPrivateKey rsaPrivKey = (RSAPrivateKey) privateKey;
BigInteger mod = rsaPrivKey.getModulus();
@@ -242,7 +243,8 @@
throw new InvalidKeyException(ikse);
}
} else {
- throw new InvalidKeyException("RSAPublicKey required");
+ throw new InvalidKeyException("RSAPublicKey required. " +
+ "Received: " + publicKey.getClass().getName());
}
}
init(false, newKey, newSigLength);
@@ -269,7 +271,8 @@
throws SignatureException {
if (outbuf == null || (offset < 0) || (outbuf.length < (offset + sigLength))
|| (len < sigLength)) {
- throw new SignatureException("Invalid output buffer");
+ throw new SignatureException("Invalid output buffer. offset: " +
+ offset + ". len: " + len + ". sigLength: " + sigLength);
}
int rv = doFinal(outbuf, offset, sigLength);
if (rv < 0) {
@@ -328,7 +331,8 @@
throws SignatureException {
if (sigBytes == null || (sigOfs < 0) || (sigBytes.length < (sigOfs + this.sigLength))
|| (sigLen < this.sigLength)) {
- throw new SignatureException("Invalid signature buffer");
+ throw new SignatureException("Invalid signature buffer. sigOfs: " +
+ sigOfs + ". sigLen: " + sigLen + ". this.sigLength: " + this.sigLength);
}
int rv = doFinal(sigBytes, sigOfs, sigLen);
@@ -405,7 +409,8 @@
// returns 0 (success) or negative (ucrypto error occurred)
private int update(byte[] in, int inOfs, int inLen) {
if (inOfs < 0 || inOfs + inLen > in.length) {
- throw new ArrayIndexOutOfBoundsException();
+ throw new ArrayIndexOutOfBoundsException("inOfs :" + inOfs +
+ ". inLen: " + inLen + ". in.length: " + in.length);
}
ensureInitialized();
int k = nativeUpdate(pCtxt.id, sign, in, inOfs, inLen);
@@ -442,7 +447,8 @@
int maxDataSize = keySize - PKCS1PADDING_LEN;
if (maxDataSize < encodedLen) {
throw new InvalidKeyException
- ("Key is too short for this signature algorithm");
+ ("Key is too short for this signature algorithm. maxDataSize: " +
+ maxDataSize + ". encodedLen: " + encodedLen);
}
return keySize;
}
--- a/jdk/test/TEST.ROOT Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/TEST.ROOT Fri Sep 25 12:04:35 2015 -0700
@@ -23,5 +23,8 @@
# Group definitions
groups=TEST.groups [closed/TEST.groups]
+# Allow querying of sun.arch.data.model in @requires clauses
+requires.properties=sun.arch.data.model
+
# Tests using jtreg 4.1 b11 features
requiredVersion=4.1 b11
--- a/jdk/test/TEST.groups Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/TEST.groups Fri Sep 25 12:04:35 2015 -0700
@@ -67,6 +67,7 @@
sun/misc \
sun/reflect \
jdk/lambda \
+ jdk/internal/jimage \
vm
# All of the java.util package
@@ -210,13 +211,13 @@
# java launcher specific tests, Note: do not include this group into any groups
# that potentially could be included into a jprt test rule, as the complementary
-# closed group includes awt SplashScreen and these tests may not run
-# satisfacotorily on all platforms and profiles thus this group must always
+# closed group includes awt SplashScreen and these tests may not run
+# satisfactorily on all platforms and profiles thus this group must always
# be a stand-alone group
jdk_launcher = \
tools/launcher \
sun/tools
-
+
#
# Tool (and tool API) tests are split into core and svc groups
#
@@ -473,7 +474,7 @@
sun/reflect/CallerSensitive/MissingCallerSensitive.java \
sun/security/util/Resources/NewNamesFormat.java \
vm/verifier/defaultMethods/DefaultMethodRegressionTestsRun.java \
- javax/xml/ws/clientjar/TestWsImport.java
+ javax/xml/ws/clientjar/TestWsImport.java
# JRE adds further tests to compact3
#
--- a/jdk/test/com/oracle/security/ucrypto/CipherSignNotSupported.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/com/oracle/security/ucrypto/CipherSignNotSupported.java Fri Sep 25 12:04:35 2015 -0700
@@ -23,7 +23,7 @@
/**
* @test
- * @bug 8029849 8132082
+ * @bug 8029849 8132082 8133535
* @summary Make sure signing via encrypt and verifying via decrypt are not
* supported by OracleUcrypto provider.
* @author Anthony Scarpino
@@ -89,8 +89,7 @@
ct = c.doFinal(pt);
throw new RuntimeException("Encrypt operation should have failed.");
} catch (InvalidKeyException e) {
- if (e.getMessage().compareTo("RSAPublicKey required for " +
- "encryption") != 0) {
+ if (!e.getMessage().contains("RSAPublicKey required for encryption")) {
System.out.println("Wrong exception thrown.");
throw e;
}
@@ -103,8 +102,7 @@
c.doFinal(ct);
throw new RuntimeException("Decrypt operation should have failed.");
} catch (InvalidKeyException e) {
- if (e.getMessage().compareTo("RSAPrivateKey required for " +
- "decryption") != 0) {
+ if (!e.getMessage().contains("RSAPrivateKey required for decryption")) {
System.out.println("Wrong exception thrown.");
throw e;
}
--- a/jdk/test/com/sun/corba/cachedSocket/7056731.sh Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/com/sun/corba/cachedSocket/7056731.sh Fri Sep 25 12:04:35 2015 -0700
@@ -64,12 +64,12 @@
sleep 2 #give orbd time to start
echo "started orb"
echo "starting server"
-${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -cp . HelloServer -ORBInitialPort $PORT -ORBInitialHost localhost &
+${JAVA} ${TESTVMOPTS} -cp . HelloServer -ORBInitialPort $PORT -ORBInitialHost localhost &
SERVER_PROC=$!
sleep 2 #give server time to start
echo "started server"
echo "starting client (debug mode)"
-${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -cp . -agentlib:jdwp=transport=dt_socket,server=y,address=8000 HelloClient -ORBInitialPort $PORT -ORBInitialHost localhost > client.$$ 2>&1 &
+${JAVA} ${TESTVMOPTS} -cp . -agentlib:jdwp=transport=dt_socket,server=y,address=8000 HelloClient -ORBInitialPort $PORT -ORBInitialHost localhost > client.$$ 2>&1 &
JVM_PROC=$!
sleep 2 #give jvm/debugger/client time to start
@@ -97,7 +97,7 @@
echo "clear com.sun.corba.se.impl.protocol.CorbaClientRequestDispatcherImpl.unregisterWaiter"
sleep 2;
echo "resume 1";
-)| ${TESTJAVA}${FS}bin${FS}jdb -connect com.sun.jdi.SocketAttach:hostname=localhost,port=8000
+)| ${COMPILEJAVA}${FS}bin${FS}jdb -connect com.sun.jdi.SocketAttach:hostname=localhost,port=8000
sleep 5 # give time for Client to throw exception
--- a/jdk/test/java/awt/Choice/UnfocusableToplevel/UnfocusableToplevel.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/awt/Choice/UnfocusableToplevel/UnfocusableToplevel.java Fri Sep 25 12:04:35 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2015 Oracle and/or its affiliates. All rights reserved.
* 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 6566434
+ @bug 6566434 8039467
@library ../../regtesthelpers
@build Util Sysout AbstractTest
@summary Choice in unfocusable window responds to keyboard
@@ -63,6 +63,18 @@
w.setLayout(new FlowLayout());
w.setSize(200, 200);
+ // Note that Window w is non focusable. Key press events will not be
+ // consumed by w, but by any previously focused window & this can
+ // disturb the environment. So creating tempFrameToHoldFocus frame,
+ // to consume key press events.
+ Frame tempFrameToHoldFocus = new Frame();
+ tempFrameToHoldFocus.setVisible(true);
+ Util.waitForIdle(robot);
+
+ tempFrameToHoldFocus.requestFocus();
+ Util.clickOnComp(tempFrameToHoldFocus, robot);
+ Util.waitForIdle(robot);
+
ch.addKeyListener(new KeyAdapter(){
public void keyTyped(KeyEvent e){
traceEvent("keytyped", e);
@@ -94,6 +106,10 @@
testKeys();
Util.waitForIdle(robot);
+
+ tempFrameToHoldFocus.dispose();
+ w.dispose();
+ f.dispose();
}
private static void testKeys(){
--- a/jdk/test/java/awt/Cursor/MultiResolutionCursorTest/MultiResolutionCursorTest.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/awt/Cursor/MultiResolutionCursorTest/MultiResolutionCursorTest.java Fri Sep 25 12:04:35 2015 -0700
@@ -25,19 +25,16 @@
import java.awt.Cursor;
import java.awt.Dialog;
import java.awt.Frame;
-import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Image;
import java.awt.Label;
import java.awt.Point;
import java.awt.TextArea;
import java.awt.Toolkit;
+import java.awt.image.BaseMultiResolutionImage;
import java.awt.image.BufferedImage;
-import java.util.LinkedList;
-import java.util.List;
import javax.swing.JApplet;
import jdk.testlibrary.OSInfo;
-import sun.awt.image.MultiResolutionImage;
/**
* @test
@@ -52,7 +49,7 @@
public class MultiResolutionCursorTest extends JApplet {
//Declare things used in the test, like buttons and labels here
- static final int sizes[] = {16, 32, 128};
+ static final int sizes[] = {8, 16, 32, 128};
static final Color colors[] = {Color.WHITE, Color.RED, Color.GREEN, Color.BLUE};
public void init() {
@@ -87,7 +84,12 @@
setVisible(true);
validate();
- final Image image = new MultiResolutionCursor();
+ final Image image = new BaseMultiResolutionImage(
+ createResolutionVariant(0),
+ createResolutionVariant(1),
+ createResolutionVariant(2),
+ createResolutionVariant(3)
+ );
int center = sizes[0] / 2;
Cursor cursor = Toolkit.getDefaultToolkit().createCustomCursor(
@@ -101,53 +103,14 @@
frame.setVisible(true);
}// start()
-
- static class MultiResolutionCursor extends BufferedImage implements MultiResolutionImage {
-
- List<Image> highResolutionImages;
-
- public MultiResolutionCursor() {
- super(sizes[0], sizes[0], BufferedImage.TYPE_INT_RGB);
-
- draw(getGraphics(), 0);
- highResolutionImages = new LinkedList<>();
- highResolutionImages.add(this);
-
- for (int i = 1; i < sizes.length; i++) {
- BufferedImage highResolutionImage =
- new BufferedImage(sizes[i], sizes[i], BufferedImage.TYPE_INT_RGB);
- draw(highResolutionImage.getGraphics(), i);
- highResolutionImages.add(highResolutionImage);
- }
- }
-
- @Override
- public Image getResolutionVariant(int width, int height) {
-
- for (int i = 0; i < sizes.length; i++) {
- Image image = highResolutionImages.get(i);
- int w = image.getWidth(null);
- int h = image.getHeight(null);
-
- if (width <= w && height <= h) {
- return image;
- }
- }
-
- return highResolutionImages.get(highResolutionImages.size() - 1);
- }
-
- void draw(Graphics graphics, int index) {
- Graphics2D g2 = (Graphics2D) graphics;
- Color color = colors[index];
- g2.setColor(color);
- g2.fillRect(0, 0, sizes[index], sizes[index]);
- }
-
- @Override
- public List<Image> getResolutionVariants() {
- return highResolutionImages;
- }
+ static BufferedImage createResolutionVariant(int i) {
+ BufferedImage resolutionVariant = new BufferedImage(sizes[i], sizes[i],
+ BufferedImage.TYPE_INT_RGB);
+ Graphics2D g2 = resolutionVariant.createGraphics();
+ g2.setColor(colors[i]);
+ g2.fillRect(0, 0, sizes[i], sizes[i]);
+ g2.dispose();
+ return resolutionVariant;
}
}// class BlockedWindowTest
--- a/jdk/test/java/awt/Focus/RequestOnCompWithNullParent/RequestOnCompWithNullParent1.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/awt/Focus/RequestOnCompWithNullParent/RequestOnCompWithNullParent1.java Fri Sep 25 12:04:35 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2015, Oracle and/or its affiliates. All rights reserved.
* 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,19 +24,14 @@
/*
@test
@bug 6418028
- @summary java/awt/Focus/RequestOnCompWithNullParent/RequestOnCompWithNullParent_Barrier.java fails
@author oleg.sukhodolsky: area=awt.focus
@library ../../regtesthelpers
+ @modules java.desktop/java.awt.peer
+ java.desktop/sun.awt
@build Util
@run main RequestOnCompWithNullParent1
*/
-/**
- * RequestOnCompWithNullParent1.java
- *
- * summary: java/awt/Focus/RequestOnCompWithNullParent/RequestOnCompWithNullParent_Barrier.java fails
- */
-
import java.awt.*;
import java.awt.event.*;
import java.awt.peer.ButtonPeer;
@@ -46,26 +41,21 @@
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
-import test.java.awt.regtesthelpers.Util;
-//*** global search and replace RequestOnCompWithNullParent1 with name of the test ***
+import sun.awt.AWTAccessor;
-public class RequestOnCompWithNullParent1
-{
+public class RequestOnCompWithNullParent1 {
- private static void init() {
- //*** Create instructions for the user here ***
- String[] instructions =
- {
- "This is an AUTOMATIC test, simply wait until it is done.",
- "The result (passed or failed) will be shown in the",
- "message window below."
- };
- Sysout.createDialog( );
- Sysout.printInstructions( instructions );
+ public static void main(final String[] args) throws Exception {
+ Frame frame = new Frame("test for 6418028");
+ try {
+ test(frame);
+ } finally {
+ frame.dispose();
+ }
+ }
-
- Frame frame = new Frame("test for 6418028");
+ private static void test(final Frame frame) throws Exception {
frame.setLayout(new FlowLayout());
Button btn1 = new Button("Button1");
frame.add(btn1);
@@ -80,153 +70,26 @@
});
frame.setVisible(true);
- Util.waitForIdle(null);
+ new Robot().waitForIdle();
btn2.instrumentPeer();
btn2.requestFocusInWindow();
btn2.restorePeer();
- frame.dispose();
- RequestOnCompWithNullParent1.pass();
- }//End init()
-
-
-
- /*****************************************************
- * Standard Test Machinery Section
- * DO NOT modify anything in this section -- it's a
- * standard chunk of code which has all of the
- * synchronisation necessary for the test harness.
- * By keeping it the same in all tests, it is easier
- * to read and understand someone else's test, as
- * well as insuring that all tests behave correctly
- * with the test harness.
- * There is a section following this for test-
- * classes
- ******************************************************/
- private static boolean theTestPassed = false;
- private static boolean testGeneratedInterrupt = false;
- private static String failureMessage = "";
-
- private static Thread mainThread = null;
-
- private static int sleepTime = 300000;
-
- // Not sure about what happens if multiple of this test are
- // instantiated in the same VM. Being static (and using
- // static vars), it aint gonna work. Not worrying about
- // it for now.
- public static void main( String args[] ) throws InterruptedException
- {
- mainThread = Thread.currentThread();
- try
- {
- init();
- }
- catch( TestPassedException e )
- {
- //The test passed, so just return from main and harness will
- // interepret this return as a pass
- return;
- }
- //At this point, neither test pass nor test fail has been
- // called -- either would have thrown an exception and ended the
- // test, so we know we have multiple threads.
-
- //Test involves other threads, so sleep and wait for them to
- // called pass() or fail()
- try
- {
- Thread.sleep( sleepTime );
- //Timed out, so fail the test
- throw new RuntimeException( "Timed out after " + sleepTime/1000 + " seconds" );
- }
- catch (InterruptedException e)
- {
- //The test harness may have interrupted the test. If so, rethrow the exception
- // so that the harness gets it and deals with it.
- if( ! testGeneratedInterrupt ) throw e;
-
- //reset flag in case hit this code more than once for some reason (just safety)
- testGeneratedInterrupt = false;
-
- if ( theTestPassed == false )
- {
- throw new RuntimeException( failureMessage );
- }
- }
-
- }//main
-
- public static synchronized void setTimeoutTo( int seconds )
- {
- sleepTime = seconds * 1000;
}
-
- public static synchronized void pass()
- {
- Sysout.println( "The test passed." );
- Sysout.println( "The test is over, hit Ctl-C to stop Java VM" );
- //first check if this is executing in main thread
- if ( mainThread == Thread.currentThread() )
- {
- //Still in the main thread, so set the flag just for kicks,
- // and throw a test passed exception which will be caught
- // and end the test.
- theTestPassed = true;
- throw new TestPassedException();
- }
- theTestPassed = true;
- testGeneratedInterrupt = true;
- mainThread.interrupt();
- }//pass()
-
- public static synchronized void fail()
- {
- //test writer didn't specify why test failed, so give generic
- fail( "it just plain failed! :-)" );
- }
-
- public static synchronized void fail( String whyFailed )
- {
- Sysout.println( "The test failed: " + whyFailed );
- Sysout.println( "The test is over, hit Ctl-C to stop Java VM" );
- //check if this called from main thread
- if ( mainThread == Thread.currentThread() )
- {
- //If main thread, fail now 'cause not sleeping
- throw new RuntimeException( whyFailed );
- }
- theTestPassed = false;
- testGeneratedInterrupt = true;
- failureMessage = whyFailed;
- mainThread.interrupt();
- }//fail()
-
-}// class RequestOnCompWithNullParent1
-
-//This exception is used to exit from any level of call nesting
-// when it's determined that the test has passed, and immediately
-// end the test.
-class TestPassedException extends RuntimeException
-{
}
-//*********** End Standard Test Machinery Section **********
-
-
-//************ Begin classes defined for the test ****************
-
class TestButton extends Button {
ButtonPeer origPeer;
ButtonPeer proxiedPeer;
/** Creates a new instance of TestButton */
- public TestButton(String text) {
+ TestButton(String text) {
super(text);
}
public void instrumentPeer() {
- origPeer = (ButtonPeer) getPeer();
+ origPeer = AWTAccessor.getComponentAccessor().getPeer(this);
+
InvocationHandler handler = new InvocationHandler() {
public Object invoke(Object proxy, Method method, Object[] args) {
if (method.getName().equals("requestFocus")) {
@@ -248,7 +111,9 @@
}
};
- proxiedPeer = (ButtonPeer) Proxy.newProxyInstance(ButtonPeer.class.getClassLoader(), new Class[] {ButtonPeer.class}, handler);
+ proxiedPeer = (ButtonPeer) Proxy.newProxyInstance(
+ ButtonPeer.class.getClassLoader(),
+ new Class[] {ButtonPeer.class}, handler);
setPeer(proxiedPeer);
}
@@ -275,145 +140,3 @@
}
}
}
-//************** End classes defined for the test *******************
-
-
-
-
-/****************************************************
- Standard Test Machinery
- DO NOT modify anything below -- it's a standard
- chunk of code whose purpose is to make user
- interaction uniform, and thereby make it simpler
- to read and understand someone else's test.
- ****************************************************/
-
-/**
- This is part of the standard test machinery.
- It creates a dialog (with the instructions), and is the interface
- for sending text messages to the user.
- To print the instructions, send an array of strings to Sysout.createDialog
- WithInstructions method. Put one line of instructions per array entry.
- To display a message for the tester to see, simply call Sysout.println
- with the string to be displayed.
- This mimics System.out.println but works within the test harness as well
- as standalone.
- */
-
-class Sysout
-{
- private static TestDialog dialog;
-
- public static void createDialogWithInstructions( String[] instructions )
- {
- dialog = new TestDialog( new Frame(), "Instructions" );
- dialog.printInstructions( instructions );
- dialog.setVisible(true);
- println( "Any messages for the tester will display here." );
- }
-
- public static void createDialog( )
- {
- dialog = new TestDialog( new Frame(), "Instructions" );
- String[] defInstr = { "Instructions will appear here. ", "" } ;
- dialog.printInstructions( defInstr );
- dialog.setVisible(true);
- println( "Any messages for the tester will display here." );
- }
-
-
- public static void printInstructions( String[] instructions )
- {
- dialog.printInstructions( instructions );
- }
-
-
- public static void println( String messageIn )
- {
- dialog.displayMessage( messageIn );
- System.out.println(messageIn);
- }
-
-}// Sysout class
-
-/**
- This is part of the standard test machinery. It provides a place for the
- test instructions to be displayed, and a place for interactive messages
- to the user to be displayed.
- To have the test instructions displayed, see Sysout.
- To have a message to the user be displayed, see Sysout.
- Do not call anything in this dialog directly.
- */
-class TestDialog extends Dialog
-{
-
- TextArea instructionsText;
- TextArea messageText;
- int maxStringLength = 80;
-
- //DO NOT call this directly, go through Sysout
- public TestDialog( Frame frame, String name )
- {
- super( frame, name );
- int scrollBoth = TextArea.SCROLLBARS_BOTH;
- instructionsText = new TextArea( "", 15, maxStringLength, scrollBoth );
- add( "North", instructionsText );
-
- messageText = new TextArea( "", 5, maxStringLength, scrollBoth );
- add("Center", messageText);
-
- pack();
-
- setVisible(true);
- }// TestDialog()
-
- //DO NOT call this directly, go through Sysout
- public void printInstructions( String[] instructions )
- {
- //Clear out any current instructions
- instructionsText.setText( "" );
-
- //Go down array of instruction strings
-
- String printStr, remainingStr;
- for( int i=0; i < instructions.length; i++ )
- {
- //chop up each into pieces maxSringLength long
- remainingStr = instructions[ i ];
- while( remainingStr.length() > 0 )
- {
- //if longer than max then chop off first max chars to print
- if( remainingStr.length() >= maxStringLength )
- {
- //Try to chop on a word boundary
- int posOfSpace = remainingStr.
- lastIndexOf( ' ', maxStringLength - 1 );
-
- if( posOfSpace <= 0 ) posOfSpace = maxStringLength - 1;
-
- printStr = remainingStr.substring( 0, posOfSpace + 1 );
- remainingStr = remainingStr.substring( posOfSpace + 1 );
- }
- //else just print
- else
- {
- printStr = remainingStr;
- remainingStr = "";
- }
-
- instructionsText.append( printStr + "\n" );
-
- }// while
-
- }// for
-
- }//printInstructions()
-
- //DO NOT call this directly, go through Sysout
- public void displayMessage( String messageIn )
- {
- messageText.append( messageIn + "\n" );
- System.out.println(messageIn);
- }
-
-}// TestDialog class
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Modal/InvisibleParentTest/InvisibleParentTest.html Fri Sep 25 12:04:35 2015 -0700
@@ -0,0 +1,45 @@
+<!--
+ Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
+ 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.
+-->
+
+<html>
+<!--
+ @test
+ @bug 6401700 6412803
+ @requires (os.family != "windows")
+ @summary Tests that modal dialog is shown on the screen and
+iconified/restored correctly if its parent window is invisible
+ @author artem.ananiev: area=awt.modal
+ @run applet/manual=yesno InvisibleParentTest.html
+ -->
+<head>
+<title> InvisibleParentTest </title>
+</head>
+<body>
+
+<h1>InvisibleParentTest<br>Bug ID: 6401700, 6412803</h1>
+
+<p> See the dialog box (usually in upper left corner) for instructions</p>
+
+<APPLET CODE="InvisibleParentTest.class" WIDTH=200 HEIGHT=200></APPLET>
+</body>
+</html>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Modal/InvisibleParentTest/InvisibleParentTest.java Fri Sep 25 12:04:35 2015 -0700
@@ -0,0 +1,235 @@
+/*
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
+ * 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 6401700 6412803
+ @summary Tests that modal dialog is shown on the screen and
+iconified/restored correctly if some of its blocked windows are invisible
+ @author artem.ananiev: area=awt.modal
+ @run applet/manual=yesno InvisibleParentTest.html
+*/
+
+import java.applet.Applet;
+import java.awt.BorderLayout;
+import java.awt.Button;
+import java.awt.Component;
+import java.awt.Dialog;
+import java.awt.Frame;
+import java.awt.TextArea;
+import java.awt.Window;
+
+public class InvisibleParentTest extends Applet
+{
+ public void init()
+ {
+ setLayout(new BorderLayout());
+
+ String[] instructions =
+ {
+ "If your system is Windows, press PASS button.",
+ "When the test starts two windows should appear: frame G1 and",
+ " dialog D1. Another one frame F1 should be minimized.",
+ " If the dialog is not shown (minimizied), press FAIL button.",
+ "Then minimize frame G1 and restore F1. If the dialog D1 is not",
+ " restored together with F1, press FAIL, else PASS"
+ };
+ Sysout.createDialogWithInstructions( instructions );
+ }
+
+ public void start ()
+ {
+ Button b;
+
+ setSize (200,200);
+ setVisible(true);
+ validate();
+
+ Component c = this;
+ while ((c != null) && !(c instanceof Window))
+ {
+ c = c.getParent();
+ }
+ if (c != null)
+ {
+ ((Window)c).setModalExclusionType(Dialog.ModalExclusionType.APPLICATION_EXCLUDE);
+ }
+
+ Frame f1 = new Frame("F1");
+ f1.setBounds(100, 300, 100, 100);
+ f1.setVisible(true);
+ f1.setExtendedState(Frame.ICONIFIED);
+
+ Frame g1 = new Frame("G1");
+ g1.setBounds(150, 350, 100, 100);
+ g1.setVisible(true);
+
+ final Dialog d1 = new Dialog((Frame)null, "D1", Dialog.ModalityType.APPLICATION_MODAL);
+ d1.setBounds(200, 400, 100, 100);
+ new Thread(new Runnable()
+ {
+ public void run()
+ {
+ d1.setVisible(true);
+ }
+ }).start();
+ }
+}
+
+/****************************************************
+ Standard Test Machinery
+ DO NOT modify anything below -- it's a standard
+ chunk of code whose purpose is to make user
+ interaction uniform, and thereby make it simpler
+ to read and understand someone else's test.
+ ****************************************************/
+
+/**
+ This is part of the standard test machinery.
+ It creates a dialog (with the instructions), and is the interface
+ for sending text messages to the user.
+ To print the instructions, send an array of strings to Sysout.createDialog
+ WithInstructions method. Put one line of instructions per array entry.
+ To display a message for the tester to see, simply call Sysout.println
+ with the string to be displayed.
+ This mimics System.out.println but works within the test harness as well
+ as standalone.
+ */
+
+class Sysout
+{
+ private static TestDialog dialog;
+
+ public static void createDialogWithInstructions( String[] instructions )
+ {
+ dialog = new TestDialog( new Frame(), "Instructions" );
+ dialog.printInstructions( instructions );
+ dialog.setVisible(true);
+ println( "Any messages for the tester will display here." );
+ }
+
+ public static void createDialog( )
+ {
+ dialog = new TestDialog( new Frame(), "Instructions" );
+ String[] defInstr = { "Instructions will appear here. ", "" } ;
+ dialog.printInstructions( defInstr );
+ dialog.setVisible(true);
+ println( "Any messages for the tester will display here." );
+ }
+
+
+ public static void printInstructions( String[] instructions )
+ {
+ dialog.printInstructions( instructions );
+ }
+
+
+ public static void println( String messageIn )
+ {
+ dialog.displayMessage( messageIn );
+ }
+
+}// Sysout class
+
+/**
+ This is part of the standard test machinery. It provides a place for the
+ test instructions to be displayed, and a place for interactive messages
+ to the user to be displayed.
+ To have the test instructions displayed, see Sysout.
+ To have a message to the user be displayed, see Sysout.
+ Do not call anything in this dialog directly.
+ */
+class TestDialog extends Dialog
+{
+
+ TextArea instructionsText;
+ TextArea messageText;
+ int maxStringLength = 80;
+
+ //DO NOT call this directly, go through Sysout
+ public TestDialog( Frame frame, String name )
+ {
+ super( frame, name );
+ setModalExclusionType(Dialog.ModalExclusionType.APPLICATION_EXCLUDE);
+ int scrollBoth = TextArea.SCROLLBARS_BOTH;
+ instructionsText = new TextArea( "", 15, maxStringLength, scrollBoth );
+ add( "North", instructionsText );
+
+ messageText = new TextArea( "", 5, maxStringLength, scrollBoth );
+ add("Center", messageText);
+
+ pack();
+
+ setVisible(true);
+ }// TestDialog()
+
+ //DO NOT call this directly, go through Sysout
+ public void printInstructions( String[] instructions )
+ {
+ //Clear out any current instructions
+ instructionsText.setText( "" );
+
+ //Go down array of instruction strings
+
+ String printStr, remainingStr;
+ for( int i=0; i < instructions.length; i++ )
+ {
+ //chop up each into pieces maxSringLength long
+ remainingStr = instructions[ i ];
+ while( remainingStr.length() > 0 )
+ {
+ //if longer than max then chop off first max chars to print
+ if( remainingStr.length() >= maxStringLength )
+ {
+ //Try to chop on a word boundary
+ int posOfSpace = remainingStr.
+ lastIndexOf( ' ', maxStringLength - 1 );
+
+ if( posOfSpace <= 0 ) posOfSpace = maxStringLength - 1;
+
+ printStr = remainingStr.substring( 0, posOfSpace + 1 );
+ remainingStr = remainingStr.substring( posOfSpace + 1 );
+ }
+ //else just print
+ else
+ {
+ printStr = remainingStr;
+ remainingStr = "";
+ }
+
+ instructionsText.append( printStr + "\n" );
+
+ }// while
+
+ }// for
+
+ }//printInstructions()
+
+ //DO NOT call this directly, go through Sysout
+ public void displayMessage( String messageIn )
+ {
+ messageText.append( messageIn + "\n" );
+ System.out.println(messageIn);
+ }
+
+}// TestDialog class
--- a/jdk/test/java/awt/PrintJob/Text/StringWidth.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/awt/PrintJob/Text/StringWidth.java Fri Sep 25 12:04:35 2015 -0700
@@ -23,7 +23,6 @@
import java.awt.*;
import java.util.Properties;
-import sun.awt.*;
public class StringWidth extends Frame {
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Toolkit/AutoShutdown/EventQueuePush/EventQueuePushAutoshutdown.java Fri Sep 25 12:04:35 2015 -0700
@@ -0,0 +1,75 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * 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 8081485
+ @summary tests that a program terminates automatically after EventQueue.push()
+ @author Anton Nashatyrev : area=toolkit
+*/
+
+import java.awt.*;
+
+public class EventQueuePushAutoshutdown implements Runnable {
+ private volatile int status = 2;
+
+ public EventQueuePushAutoshutdown() throws Exception {
+ Runtime.getRuntime().addShutdownHook(new Thread(this));
+ Thread thread = new Thread() {
+ @Override
+ public void run() {
+ status = 0;
+ try {
+ Thread.sleep(10000);
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ } finally {
+ status = 1;
+ System.exit(status);
+ }
+ }
+ };
+ thread.setDaemon(true);
+ thread.start();
+
+ System.setProperty("java.awt.headless", "true");
+ final EventQueue systemQueue = Toolkit.getDefaultToolkit().getSystemEventQueue();
+ systemQueue.push(new EventQueue());
+ EventQueue.invokeAndWait(new Runnable() {
+ @Override
+ public void run() {
+ System.out.println("Activated EDT");
+ }
+ });
+ System.out.println("After EDT activation");
+ }
+
+ public static void main(String[] args) throws Exception {
+ new EventQueuePushAutoshutdown();
+ }
+
+ @Override
+ public void run() {
+ Runtime.getRuntime().halt(status);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Toolkit/AutoShutdown/EventQueuePush/EventQueuePushAutoshutdown.sh Fri Sep 25 12:04:35 2015 -0700
@@ -0,0 +1,159 @@
+#!/bin/ksh -p
+
+#
+# Copyright (c) 20015, Oracle and/or its affiliates. All rights reserved.
+# 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 EventQueuePushAutoshutdown.sh
+# @bug 8081485
+# @summary tests that a program terminates automatically
+# after EventQueue.push()
+# @author Anton Nashatyrev : area=toolkit
+#
+# @compile EventQueuePushAutoshutdown.java
+# @run shell EventQueuePushAutoshutdown.sh
+
+
+# Beginning of subroutines:
+status=1
+
+#Call this from anywhere to fail the test with an error message
+# usage: fail "reason why the test failed"
+fail()
+ { echo "The test failed :-("
+ echo "$*" 1>&2
+ echo "exit status was $status"
+ exit $status
+ } #end of fail()
+
+#Call this from anywhere to pass the test with a message
+# usage: pass "reason why the test passed if applicable"
+pass()
+ { echo "The test passed!!!"
+ echo "$*" 1>&2
+ exit 0
+ } #end of pass()
+
+# end of subroutines
+
+
+# The beginning of the script proper
+OS=`uname -s`
+case "$OS" in
+ SunOS | Linux | Darwin | CYGWIN* )
+ FILESEP="/"
+ ;;
+
+ Windows_95 | Windows_98 | Windows_NT | Windows_ME )
+ FILESEP="\\"
+ ;;
+
+ # catch all other OSs
+ * )
+ echo "Unrecognized system! $OS"
+ fail "Unrecognized system! $OS"
+ ;;
+esac
+
+
+# Want this test to run standalone as well as in the harness, so do the
+# following to copy the test's directory into the harness's scratch directory
+# and set all appropriate variables:
+
+if [ -z "${TESTJAVA}" ] ; then
+ # TESTJAVA is not set, so the test is running stand-alone.
+ # TESTJAVA holds the path to the root directory of the build of the JDK
+ # to be tested. That is, any java files run explicitly in this shell
+ # should use TESTJAVA in the path to the java interpreter.
+ # So, we'll set this to the JDK spec'd on the command line. If none
+ # is given on the command line, tell the user that and use a cheesy
+ # default.
+ # THIS IS THE JDK BEING TESTED.
+ if [ -n "$1" ] ;
+ then TESTJAVA=$1
+ else fail "no JDK specified on command line!"
+ fi
+ TESTSRC=.
+ TESTCLASSES=.
+ STANDALONE=1;
+fi
+echo "JDK under test is: $TESTJAVA"
+
+#Deal with .class files:
+if [ -n "${STANDALONE}" ] ;
+ then
+ #if standalone, remind user to cd to dir. containing test before running it
+ echo "Just a reminder: cd to the dir containing this test when running it"
+ # then compile all .java files (if there are any) into .class files
+ if [ -a *.java ] ;
+ then echo "Reminder, this test should be in its own directory with all"
+ echo "supporting files it needs in the directory with it."
+ ${TESTJAVA}/bin/javac ./*.java ;
+ fi
+ # else in harness so copy all the class files from where jtreg put them
+ # over to the scratch directory this test is running in.
+ else cp ${TESTCLASSES}/*.class . ;
+fi
+
+#if in test harness, then copy the entire directory that the test is in over
+# to the scratch directory. This catches any support files needed by the test.
+if [ -z "${STANDALONE}" ] ;
+ then cp ${TESTSRC}/* .
+fi
+
+#Just before executing anything, make sure it has executable permission!
+chmod 777 ./*
+
+############### YOUR TEST CODE HERE!!!!!!! #############
+
+#All files required for the test should be in the same directory with
+# this file. If converting a standalone test to run with the harness,
+# as long as all files are in the same directory and it returns 0 for
+# pass, you should be able to cut and paste it into here and it will
+# run with the test harness.
+
+${TESTJAVA}/bin/java EventQueuePushAutoshutdown
+
+############### END YOUR TEST CODE !!!!! ############
+#Be sure the last command executed above this line returns 0 for success,
+# something non-zero for failure.
+status=$?
+
+# pass or fail the test based on status of the command
+case "$status" in
+ 0 )
+ pass ""
+ ;;
+
+ 1 )
+ fail "The program didn't automatically shut down"
+ ;;
+
+ * )
+ fail "The program terminated unexpectedly!"
+ ;;
+esac
+
+#For additional examples of how to write platform independent KSH scripts,
+# see the jtreg file itself. It is a KSH script for both Solaris and Win32
+
--- a/jdk/test/java/awt/image/MultiResolutionImage/NSImageToMultiResolutionImageTest.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/awt/image/MultiResolutionImage/NSImageToMultiResolutionImageTest.java Fri Sep 25 12:04:35 2015 -0700
@@ -23,15 +23,17 @@
import java.awt.Image;
import java.awt.Toolkit;
-import sun.awt.OSInfo;
-import sun.awt.image.MultiResolutionImage;
+import java.awt.image.MultiResolutionImage;
+import jdk.testlibrary.OSInfo;
+
/*
* @test
* @bug 8033534 8035069
* @summary [macosx] Get MultiResolution image from native system
* @author Alexander Scherbatiy
- * @modules java.desktop/sun.awt
- * java.desktop/sun.awt.image
+ * @modules java.desktop/sun.awt.image
+ * @library /lib/testlibrary
+ * @build jdk.testlibrary.OSInfo
* @run main NSImageToMultiResolutionImageTest
*/
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/image/MultiResolutionImageCommonTest.java Fri Sep 25 12:04:35 2015 -0700
@@ -0,0 +1,207 @@
+/*
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
+ * 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.awt.Color;
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+import java.awt.Image;
+import java.awt.RenderingHints;
+import java.awt.image.BufferedImage;
+import sun.awt.SunHints;
+import java.awt.geom.AffineTransform;
+import java.util.Arrays;
+import java.util.List;
+import java.awt.image.MultiResolutionImage;
+
+/**
+ * @test @bug 8011059
+ * @author Alexander Scherbatiy
+ * @summary Test MultiResolution image loading and painting with various scaling
+ * combinations
+ * @modules java.desktop/sun.awt
+ * java.desktop/sun.awt.image
+ */
+public class MultiResolutionImageCommonTest {
+
+ private static final int IMAGE_WIDTH = 300;
+ private static final int IMAGE_HEIGHT = 200;
+ private static final Color COLOR_1X = Color.GREEN;
+ private static final Color COLOR_2X = Color.BLUE;
+
+ public static void main(String[] args) throws Exception {
+ testCustomMultiResolutionImage();
+ System.out.println("Test passed.");
+ }
+
+ public static void testCustomMultiResolutionImage() {
+ testCustomMultiResolutionImage(false);
+ testCustomMultiResolutionImage(true);
+ }
+
+ public static void testCustomMultiResolutionImage(
+ boolean enableImageScaling) {
+
+ Image image = new MultiResolutionBufferedImage();
+
+ // Same image size
+ BufferedImage bufferedImage = new BufferedImage(
+ IMAGE_WIDTH, IMAGE_HEIGHT, BufferedImage.TYPE_INT_RGB);
+ Graphics2D g2d = (Graphics2D) bufferedImage.getGraphics();
+ setImageScalingHint(g2d, enableImageScaling);
+ g2d.drawImage(image, 0, 0, null);
+ checkColor(bufferedImage.getRGB(
+ 3 * IMAGE_WIDTH / 4, 3 * IMAGE_HEIGHT / 4), false);
+
+ // Twice image size
+ bufferedImage = new BufferedImage(2 * IMAGE_WIDTH, 2 * IMAGE_HEIGHT,
+ BufferedImage.TYPE_INT_RGB);
+ g2d = (Graphics2D) bufferedImage.getGraphics();
+ setImageScalingHint(g2d, enableImageScaling);
+ g2d.drawImage(image, 0, 0, 2 * IMAGE_WIDTH,
+ 2 * IMAGE_HEIGHT, 0, 0, IMAGE_WIDTH, IMAGE_HEIGHT, null);
+ checkColor(bufferedImage.getRGB(3 * IMAGE_WIDTH / 2,
+ 3 * IMAGE_HEIGHT / 2), enableImageScaling);
+
+ // Scale 2x
+ bufferedImage = new BufferedImage(
+ 2 * IMAGE_WIDTH, 2 * IMAGE_HEIGHT, BufferedImage.TYPE_INT_RGB);
+ g2d = (Graphics2D) bufferedImage.getGraphics();
+ setImageScalingHint(g2d, enableImageScaling);
+ g2d.scale(2, 2);
+ g2d.drawImage(image, 0, 0, IMAGE_WIDTH, IMAGE_HEIGHT, null);
+ checkColor(bufferedImage.getRGB(
+ 3 * IMAGE_WIDTH / 2, 3 * IMAGE_HEIGHT / 2), enableImageScaling);
+
+ // Rotate
+ bufferedImage = new BufferedImage(IMAGE_WIDTH, IMAGE_HEIGHT,
+ BufferedImage.TYPE_INT_RGB);
+ g2d = (Graphics2D) bufferedImage.getGraphics();
+ setImageScalingHint(g2d, enableImageScaling);
+ g2d.drawImage(image, 0, 0, null);
+ g2d.rotate(Math.PI / 4);
+ checkColor(bufferedImage.getRGB(
+ 3 * IMAGE_WIDTH / 4, 3 * IMAGE_HEIGHT / 4), false);
+
+ // Scale 2x and Rotate
+ bufferedImage = new BufferedImage(
+ 2 * IMAGE_WIDTH, 2 * IMAGE_HEIGHT, BufferedImage.TYPE_INT_RGB);
+ g2d = (Graphics2D) bufferedImage.getGraphics();
+ setImageScalingHint(g2d, enableImageScaling);
+ g2d.scale(-2, 2);
+ g2d.rotate(-Math.PI / 10);
+ g2d.drawImage(image, -IMAGE_WIDTH, 0, IMAGE_WIDTH, IMAGE_HEIGHT, null);
+ checkColor(bufferedImage.getRGB(
+ 3 * IMAGE_WIDTH / 2, 3 * IMAGE_HEIGHT / 2), enableImageScaling);
+
+ // General Transform
+ bufferedImage = new BufferedImage(
+ 2 * IMAGE_WIDTH, 2 * IMAGE_HEIGHT, BufferedImage.TYPE_INT_RGB);
+ g2d = (Graphics2D) bufferedImage.getGraphics();
+ setImageScalingHint(g2d, enableImageScaling);
+ float delta = 0.05f;
+ float cos = 1 - delta * delta / 2;
+ float sin = 1 + delta;
+ AffineTransform transform
+ = new AffineTransform(2 * cos, 0.1, 0.3, -2 * sin, 10, -5);
+ g2d.setTransform(transform);
+ g2d.drawImage(image, 0, -IMAGE_HEIGHT, IMAGE_WIDTH, IMAGE_HEIGHT, null);
+ checkColor(bufferedImage.getRGB(
+ 3 * IMAGE_WIDTH / 2, 3 * IMAGE_HEIGHT / 2), enableImageScaling);
+
+ int D = 10;
+ // From Source to small Destination region
+ bufferedImage = new BufferedImage(
+ IMAGE_WIDTH, IMAGE_HEIGHT, BufferedImage.TYPE_INT_RGB);
+ g2d = (Graphics2D) bufferedImage.getGraphics();
+ setImageScalingHint(g2d, enableImageScaling);
+ g2d.drawImage(image, IMAGE_WIDTH / 2, IMAGE_HEIGHT / 2,
+ IMAGE_WIDTH - D, IMAGE_HEIGHT - D,
+ D, D, IMAGE_WIDTH - D, IMAGE_HEIGHT - D, null);
+ checkColor(bufferedImage.getRGB(
+ 3 * IMAGE_WIDTH / 4, 3 * IMAGE_HEIGHT / 4), false);
+
+ // From Source to large Destination region
+ bufferedImage = new BufferedImage(
+ 2 * IMAGE_WIDTH, 2 * IMAGE_HEIGHT, BufferedImage.TYPE_INT_RGB);
+ g2d = (Graphics2D) bufferedImage.getGraphics();
+ setImageScalingHint(g2d, enableImageScaling);
+ g2d.drawImage(image, D, D, 2 * IMAGE_WIDTH - D, 2 * IMAGE_HEIGHT - D,
+ IMAGE_WIDTH / 2, IMAGE_HEIGHT / 2,
+ IMAGE_WIDTH - D, IMAGE_HEIGHT - D, null);
+ checkColor(bufferedImage.getRGB(
+ 3 * IMAGE_WIDTH / 2, 3 * IMAGE_HEIGHT / 2), enableImageScaling);
+ }
+
+ static class MultiResolutionBufferedImage extends BufferedImage
+ implements MultiResolutionImage {
+
+ Image highResolutionImage;
+
+ public MultiResolutionBufferedImage() {
+ super(IMAGE_WIDTH, IMAGE_HEIGHT, BufferedImage.TYPE_INT_RGB);
+ highResolutionImage = new BufferedImage(
+ 2 * IMAGE_WIDTH, 2 * IMAGE_HEIGHT,
+ BufferedImage.TYPE_INT_RGB);
+ draw(getGraphics(), 1);
+ draw(highResolutionImage.getGraphics(), 2);
+ }
+
+ final void draw(Graphics graphics, float resolution) {
+ Graphics2D g2 = (Graphics2D) graphics;
+ g2.scale(resolution, resolution);
+ g2.setColor((resolution == 1) ? COLOR_1X : COLOR_2X);
+ g2.fillRect(0, 0, IMAGE_WIDTH, IMAGE_HEIGHT);
+ }
+
+ @Override
+ public Image getResolutionVariant(
+ double destImageWidth, double destImageHeight) {
+ return ((destImageWidth <= getWidth() && destImageHeight <= getHeight()))
+ ? this : highResolutionImage;
+ }
+
+ @Override
+ public List<Image> getResolutionVariants() {
+ return Arrays.asList(this, highResolutionImage);
+ }
+ }
+
+ static void setImageScalingHint(
+ Graphics2D g2d, boolean enableImageScaling) {
+ g2d.setRenderingHint(SunHints.KEY_RESOLUTION_VARIANT, enableImageScaling
+ ? RenderingHints.VALUE_RESOLUTION_VARIANT_DEFAULT
+ : RenderingHints.VALUE_RESOLUTION_VARIANT_BASE);
+ }
+
+ static void checkColor(int rgb, boolean isImageScaled) {
+
+ if (!isImageScaled && COLOR_1X.getRGB() != rgb) {
+ throw new RuntimeException("Wrong 1x color: " + new Color(rgb));
+ }
+
+ if (isImageScaled && COLOR_2X.getRGB() != rgb) {
+ throw new RuntimeException("Wrong 2x color" + new Color(rgb));
+ }
+ }
+
+}
--- a/jdk/test/java/awt/image/MultiResolutionImageTest.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/awt/image/MultiResolutionImageTest.java Fri Sep 25 12:04:35 2015 -0700
@@ -31,25 +31,24 @@
import java.lang.reflect.Method;
import java.net.URL;
import javax.imageio.ImageIO;
-import sun.awt.OSInfo;
import sun.awt.SunHints;
import java.awt.MediaTracker;
-import java.awt.geom.AffineTransform;
+import java.awt.RenderingHints;
import java.awt.image.ImageObserver;
-import java.util.Arrays;
-import java.util.List;
import javax.swing.JPanel;
-import sun.awt.SunToolkit;
-import sun.awt.image.MultiResolutionImage;
+import jdk.testlibrary.Platform;
+import java.awt.image.MultiResolutionImage;
/**
- * @test
- * @bug 8011059
+ * @test @bug 8011059
* @author Alexander Scherbatiy
* @summary [macosx] Make JDK demos look perfect on retina displays
+ * @library /lib/testlibrary/
+ * @build jdk.testlibrary.Platform
+ * @requires (os.family == "mac")
* @modules java.desktop/sun.awt
* java.desktop/sun.awt.image
- * @run main MultiResolutionImageTest CUSTOM
+ * java.desktop/sun.lwawt.macosx
* @run main MultiResolutionImageTest TOOLKIT_PREPARE
* @run main MultiResolutionImageTest TOOLKIT_LOAD
* @run main MultiResolutionImageTest TOOLKIT
@@ -70,149 +69,29 @@
if (args.length == 0) {
throw new RuntimeException("Not found a test");
}
-
String test = args[0];
-
System.out.println("TEST: " + test);
- System.out.println("CHECK OS: " + checkOS());
-
- if ("CUSTOM".equals(test)) {
- testCustomMultiResolutionImage();
- } else if (checkOS()) {
- switch (test) {
- case "CUSTOM":
- break;
- case "TOOLKIT_PREPARE":
- testToolkitMultiResolutionImagePrepare();
- break;
- case "TOOLKIT_LOAD":
- testToolkitMultiResolutionImageLoad();
- break;
- case "TOOLKIT":
- testToolkitMultiResolutionImage();
- testImageNameTo2xParsing();
- break;
- default:
- throw new RuntimeException("Unknown test: " + test);
- }
- }
- }
-
- static boolean checkOS() {
- return OSInfo.getOSType() == OSInfo.OSType.MACOSX;
- }
-
- public static void testCustomMultiResolutionImage() {
- testCustomMultiResolutionImage(false);
- testCustomMultiResolutionImage(true);
- }
-
- public static void testCustomMultiResolutionImage(boolean enableImageScaling) {
-
- Image image = new MultiResolutionBufferedImage();
-
- // Same image size
- BufferedImage bufferedImage = new BufferedImage(IMAGE_WIDTH, IMAGE_HEIGHT,
- BufferedImage.TYPE_INT_RGB);
- Graphics2D g2d = (Graphics2D) bufferedImage.getGraphics();
- setImageScalingHint(g2d, enableImageScaling);
- g2d.drawImage(image, 0, 0, null);
- checkColor(bufferedImage.getRGB(3 * IMAGE_WIDTH / 4, 3 * IMAGE_HEIGHT / 4), false);
-
- // Twice image size
- bufferedImage = new BufferedImage(2 * IMAGE_WIDTH, 2 * IMAGE_HEIGHT,
- BufferedImage.TYPE_INT_RGB);
- g2d = (Graphics2D) bufferedImage.getGraphics();
- setImageScalingHint(g2d, enableImageScaling);
- g2d.drawImage(image, 0, 0, 2 * IMAGE_WIDTH, 2 * IMAGE_HEIGHT, 0, 0, IMAGE_WIDTH, IMAGE_HEIGHT, null);
- checkColor(bufferedImage.getRGB(3 * IMAGE_WIDTH / 2, 3 * IMAGE_HEIGHT / 2), enableImageScaling);
-
- // Scale 2x
- bufferedImage = new BufferedImage(2 * IMAGE_WIDTH, 2 * IMAGE_HEIGHT, BufferedImage.TYPE_INT_RGB);
- g2d = (Graphics2D) bufferedImage.getGraphics();
- setImageScalingHint(g2d, enableImageScaling);
- g2d.scale(2, 2);
- g2d.drawImage(image, 0, 0, IMAGE_WIDTH, IMAGE_HEIGHT, null);
- checkColor(bufferedImage.getRGB(3 * IMAGE_WIDTH / 2, 3 * IMAGE_HEIGHT / 2), enableImageScaling);
- // Rotate
- bufferedImage = new BufferedImage(IMAGE_WIDTH, IMAGE_HEIGHT,
- BufferedImage.TYPE_INT_RGB);
- g2d = (Graphics2D) bufferedImage.getGraphics();
- setImageScalingHint(g2d, enableImageScaling);
- g2d.drawImage(image, 0, 0, null);
- g2d.rotate(Math.PI / 4);
- checkColor(bufferedImage.getRGB(3 * IMAGE_WIDTH / 4, 3 * IMAGE_HEIGHT / 4), false);
-
- // Scale 2x and Rotate
- bufferedImage = new BufferedImage(2 * IMAGE_WIDTH, 2 * IMAGE_HEIGHT, BufferedImage.TYPE_INT_RGB);
- g2d = (Graphics2D) bufferedImage.getGraphics();
- setImageScalingHint(g2d, enableImageScaling);
- g2d.scale(-2, 2);
- g2d.rotate(-Math.PI / 10);
- g2d.drawImage(image, -IMAGE_WIDTH, 0, IMAGE_WIDTH, IMAGE_HEIGHT, null);
- checkColor(bufferedImage.getRGB(3 * IMAGE_WIDTH / 2, 3 * IMAGE_HEIGHT / 2), enableImageScaling);
-
- // General Transform
- bufferedImage = new BufferedImage(2 * IMAGE_WIDTH, 2 * IMAGE_HEIGHT, BufferedImage.TYPE_INT_RGB);
- g2d = (Graphics2D) bufferedImage.getGraphics();
- setImageScalingHint(g2d, enableImageScaling);
- float delta = 0.05f;
- float cos = 1 - delta * delta / 2;
- float sin = 1 + delta;
- AffineTransform transform = new AffineTransform(2 * cos, 0.1, 0.3, -2 * sin, 10, -5);
- g2d.setTransform(transform);
- g2d.drawImage(image, 0, -IMAGE_HEIGHT, IMAGE_WIDTH, IMAGE_HEIGHT, null);
- checkColor(bufferedImage.getRGB(3 * IMAGE_WIDTH / 2, 3 * IMAGE_HEIGHT / 2), enableImageScaling);
-
- int D = 10;
- // From Source to small Destination region
- bufferedImage = new BufferedImage(IMAGE_WIDTH, IMAGE_HEIGHT, BufferedImage.TYPE_INT_RGB);
- g2d = (Graphics2D) bufferedImage.getGraphics();
- setImageScalingHint(g2d, enableImageScaling);
- g2d.drawImage(image, IMAGE_WIDTH / 2, IMAGE_HEIGHT / 2, IMAGE_WIDTH - D, IMAGE_HEIGHT - D,
- D, D, IMAGE_WIDTH - D, IMAGE_HEIGHT - D, null);
- checkColor(bufferedImage.getRGB(3 * IMAGE_WIDTH / 4, 3 * IMAGE_HEIGHT / 4), false);
-
- // From Source to large Destination region
- bufferedImage = new BufferedImage(2 * IMAGE_WIDTH, 2 * IMAGE_HEIGHT, BufferedImage.TYPE_INT_RGB);
- g2d = (Graphics2D) bufferedImage.getGraphics();
- setImageScalingHint(g2d, enableImageScaling);
- g2d.drawImage(image, D, D, 2 * IMAGE_WIDTH - D, 2 * IMAGE_HEIGHT - D,
- IMAGE_WIDTH / 2, IMAGE_HEIGHT / 2, IMAGE_WIDTH - D, IMAGE_HEIGHT - D, null);
- checkColor(bufferedImage.getRGB(3 * IMAGE_WIDTH / 2, 3 * IMAGE_HEIGHT / 2), enableImageScaling);
- }
-
- static class MultiResolutionBufferedImage extends BufferedImage
- implements MultiResolutionImage {
-
- Image highResolutionImage;
-
- public MultiResolutionBufferedImage() {
- super(IMAGE_WIDTH, IMAGE_HEIGHT, BufferedImage.TYPE_INT_RGB);
- highResolutionImage = new BufferedImage(
- 2 * IMAGE_WIDTH, 2 * IMAGE_HEIGHT, BufferedImage.TYPE_INT_RGB);
- draw(getGraphics(), 1);
- draw(highResolutionImage.getGraphics(), 2);
+ // To automatically pass the test if the test is not run using JTReg.
+ if (!Platform.isOSX()) {
+ System.out.println("Non-Mac platform detected. Passing the test");
+ return;
}
-
- void draw(Graphics graphics, float resolution) {
- Graphics2D g2 = (Graphics2D) graphics;
- g2.scale(resolution, resolution);
- g2.setColor((resolution == 1) ? COLOR_1X : COLOR_2X);
- g2.fillRect(0, 0, IMAGE_WIDTH, IMAGE_HEIGHT);
+ switch (test) {
+ case "TOOLKIT_PREPARE":
+ testToolkitMultiResolutionImagePrepare();
+ break;
+ case "TOOLKIT_LOAD":
+ testToolkitMultiResolutionImageLoad();
+ break;
+ case "TOOLKIT":
+ testToolkitMultiResolutionImage();
+ testImageNameTo2xParsing();
+ break;
+ default:
+ throw new RuntimeException("Unknown test: " + test);
}
-
- @Override
- public Image getResolutionVariant(int width, int height) {
- return ((width <= getWidth() && height <= getHeight()))
- ? this : highResolutionImage;
- }
-
- @Override
- public List<Image> getResolutionVariants() {
- return Arrays.asList(this, highResolutionImage);
- }
+ System.out.println("Test passed.");
}
static void testToolkitMultiResolutionImagePrepare() throws Exception {
@@ -224,8 +103,9 @@
Image image = Toolkit.getDefaultToolkit().getImage(fileName);
- SunToolkit toolkit = (SunToolkit) Toolkit.getDefaultToolkit();
- toolkit.prepareImage(image, IMAGE_WIDTH, IMAGE_HEIGHT, new LoadImageObserver(image));
+ Toolkit toolkit = Toolkit.getDefaultToolkit();
+ toolkit.prepareImage(image, IMAGE_WIDTH, IMAGE_HEIGHT,
+ new LoadImageObserver(image));
testToolkitMultiResolutionImageLoad(image);
}
@@ -240,7 +120,8 @@
testToolkitMultiResolutionImageLoad(image);
}
- static void testToolkitMultiResolutionImageLoad(Image image) throws Exception {
+ static void testToolkitMultiResolutionImageLoad(Image image)
+ throws Exception {
MediaTracker tracker = new MediaTracker(new JPanel());
tracker.addImage(image, 0);
@@ -256,7 +137,7 @@
int h = image.getHeight(null);
Image resolutionVariant = ((MultiResolutionImage) image)
- .getResolutionVariant(2 * w, 2 * h);
+ .getResolutionVariant(2 * w, 2 * h);
if (image == resolutionVariant) {
throw new RuntimeException("Resolution variant is not loaded");
@@ -267,9 +148,10 @@
static void testImageLoaded(Image image) {
- SunToolkit toolkit = (SunToolkit) Toolkit.getDefaultToolkit();
+ Toolkit toolkit = Toolkit.getDefaultToolkit();
- int flags = toolkit.checkImage(image, IMAGE_WIDTH, IMAGE_WIDTH, new SilentImageObserver());
+ int flags = toolkit.checkImage(image, IMAGE_WIDTH, IMAGE_WIDTH,
+ new SilentImageObserver());
if ((flags & (ImageObserver.FRAMEBITS | ImageObserver.ALLBITS)) == 0) {
throw new RuntimeException("Image is not loaded!");
}
@@ -278,7 +160,8 @@
static class SilentImageObserver implements ImageObserver {
@Override
- public boolean imageUpdate(Image img, int infoflags, int x, int y, int width, int height) {
+ public boolean imageUpdate(Image img, int infoflags, int x, int y,
+ int width, int height) {
throw new RuntimeException("Observer should not be called!");
}
}
@@ -292,21 +175,25 @@
}
@Override
- public boolean imageUpdate(Image img, int infoflags, int x, int y, int width, int height) {
+ public boolean imageUpdate(Image img, int infoflags, int x, int y,
+ int width, int height) {
if (image != img) {
- throw new RuntimeException("Original image is not passed to the observer");
+ throw new RuntimeException("Original image is not passed "
+ + "to the observer");
}
if ((infoflags & ImageObserver.WIDTH) != 0) {
if (width != IMAGE_WIDTH) {
- throw new RuntimeException("Original width is not passed to the observer");
+ throw new RuntimeException("Original width is not passed "
+ + "to the observer");
}
}
if ((infoflags & ImageObserver.HEIGHT) != 0) {
if (height != IMAGE_HEIGHT) {
- throw new RuntimeException("Original height is not passed to the observer");
+ throw new RuntimeException("Original height is not passed "
+ + "to the observer");
}
}
@@ -335,7 +222,8 @@
testToolkitMultiResolutionImage(image, true);
}
- static void testToolkitMultiResolutionImageChache(String fileName, URL url) {
+ static void testToolkitMultiResolutionImageChache(String fileName,
+ URL url) {
Image img1 = Toolkit.getDefaultToolkit().getImage(fileName);
if (!(img1 instanceof MultiResolutionImage)) {
@@ -358,8 +246,8 @@
}
}
- static void testToolkitMultiResolutionImage(Image image, boolean enableImageScaling)
- throws Exception {
+ static void testToolkitMultiResolutionImage(Image image,
+ boolean enableImageScaling) throws Exception {
MediaTracker tracker = new MediaTracker(new JPanel());
tracker.addImage(image, 0);
@@ -368,15 +256,16 @@
throw new RuntimeException("Error during image loading");
}
- final BufferedImage bufferedImage1x = new BufferedImage(IMAGE_WIDTH, IMAGE_HEIGHT,
- BufferedImage.TYPE_INT_RGB);
+ final BufferedImage bufferedImage1x = new BufferedImage(IMAGE_WIDTH,
+ IMAGE_HEIGHT, BufferedImage.TYPE_INT_RGB);
Graphics2D g1x = (Graphics2D) bufferedImage1x.getGraphics();
setImageScalingHint(g1x, false);
g1x.drawImage(image, 0, 0, null);
- checkColor(bufferedImage1x.getRGB(3 * IMAGE_WIDTH / 4, 3 * IMAGE_HEIGHT / 4), false);
+ checkColor(bufferedImage1x.getRGB(3 * IMAGE_WIDTH / 4,
+ 3 * IMAGE_HEIGHT / 4), false);
Image resolutionVariant = ((MultiResolutionImage) image).
- getResolutionVariant(2 * IMAGE_WIDTH, 2 * IMAGE_HEIGHT);
+ getResolutionVariant(2 * IMAGE_WIDTH, 2 * IMAGE_HEIGHT);
if (resolutionVariant == null) {
throw new RuntimeException("Resolution variant is null");
@@ -390,23 +279,28 @@
}
final BufferedImage bufferedImage2x = new BufferedImage(2 * IMAGE_WIDTH,
- 2 * IMAGE_HEIGHT, BufferedImage.TYPE_INT_RGB);
+ 2 * IMAGE_HEIGHT, BufferedImage.TYPE_INT_RGB);
Graphics2D g2x = (Graphics2D) bufferedImage2x.getGraphics();
setImageScalingHint(g2x, enableImageScaling);
- g2x.drawImage(image, 0, 0, 2 * IMAGE_WIDTH, 2 * IMAGE_HEIGHT, 0, 0, IMAGE_WIDTH, IMAGE_HEIGHT, null);
- checkColor(bufferedImage2x.getRGB(3 * IMAGE_WIDTH / 2, 3 * IMAGE_HEIGHT / 2), enableImageScaling);
+ g2x.drawImage(image, 0, 0, 2 * IMAGE_WIDTH,
+ 2 * IMAGE_HEIGHT, 0, 0, IMAGE_WIDTH, IMAGE_HEIGHT, null);
+ checkColor(bufferedImage2x.getRGB(3 * IMAGE_WIDTH / 2,
+ 3 * IMAGE_HEIGHT / 2), enableImageScaling);
if (!(image instanceof MultiResolutionImage)) {
throw new RuntimeException("Not a MultiResolutionImage");
}
- MultiResolutionImage multiResolutionImage = (MultiResolutionImage) image;
+ MultiResolutionImage multiResolutionImage
+ = (MultiResolutionImage) image;
- Image image1x = multiResolutionImage.getResolutionVariant(IMAGE_WIDTH, IMAGE_HEIGHT);
- Image image2x = multiResolutionImage.getResolutionVariant(2 * IMAGE_WIDTH, 2 * IMAGE_HEIGHT);
+ Image image1x = multiResolutionImage.getResolutionVariant(
+ IMAGE_WIDTH, IMAGE_HEIGHT);
+ Image image2x = multiResolutionImage.getResolutionVariant(
+ 2 * IMAGE_WIDTH, 2 * IMAGE_HEIGHT);
if (image1x.getWidth(null) * 2 != image2x.getWidth(null)
- || image1x.getHeight(null) * 2 != image2x.getHeight(null)) {
+ || image1x.getHeight(null) * 2 != image2x.getHeight(null)) {
throw new RuntimeException("Wrong resolution variant size");
}
}
@@ -416,13 +310,15 @@
ImageObserver observer = new ImageObserver() {
@Override
- public boolean imageUpdate(Image img, int infoflags, int x, int y, int width, int height) {
+ public boolean imageUpdate(Image img, int infoflags, int x, int y,
+ int width, int height) {
if (img != image) {
throw new RuntimeException("Wrong image in observer");
}
- if ((infoflags & (ImageObserver.ERROR | ImageObserver.ABORT)) != 0) {
+ if ((infoflags & (ImageObserver.ERROR | ImageObserver.ABORT))
+ != 0) {
throw new RuntimeException("Error during image loading");
}
@@ -432,18 +328,20 @@
};
final BufferedImage bufferedImage2x = new BufferedImage(2 * IMAGE_WIDTH,
- 2 * IMAGE_HEIGHT, BufferedImage.TYPE_INT_RGB);
+ 2 * IMAGE_HEIGHT, BufferedImage.TYPE_INT_RGB);
Graphics2D g2x = (Graphics2D) bufferedImage2x.getGraphics();
setImageScalingHint(g2x, true);
- g2x.drawImage(image, 0, 0, 2 * IMAGE_WIDTH, 2 * IMAGE_HEIGHT, 0, 0, IMAGE_WIDTH, IMAGE_HEIGHT, observer);
+ g2x.drawImage(image, 0, 0, 2 * IMAGE_WIDTH, 2 * IMAGE_HEIGHT, 0, 0,
+ IMAGE_WIDTH, IMAGE_HEIGHT, observer);
}
- static void setImageScalingHint(Graphics2D g2d, boolean enableImageScaling) {
+ static void setImageScalingHint(Graphics2D g2d,
+ boolean enableImageScaling) {
g2d.setRenderingHint(SunHints.KEY_RESOLUTION_VARIANT, enableImageScaling
- ? SunHints.VALUE_RESOLUTION_VARIANT_ON
- : SunHints.VALUE_RESOLUTION_VARIANT_OFF);
+ ? RenderingHints.VALUE_RESOLUTION_VARIANT_DEFAULT
+ : RenderingHints.VALUE_RESOLUTION_VARIANT_BASE);
}
static void checkColor(int rgb, boolean isImageScaled) {
@@ -468,8 +366,9 @@
}
static void generateImage(int scale) throws Exception {
- BufferedImage image = new BufferedImage(scale * IMAGE_WIDTH, scale * IMAGE_HEIGHT,
- BufferedImage.TYPE_INT_RGB);
+ BufferedImage image = new BufferedImage(
+ scale * IMAGE_WIDTH, scale * IMAGE_HEIGHT,
+ BufferedImage.TYPE_INT_RGB);
Graphics g = image.getGraphics();
g.setColor(scale == 1 ? COLOR_1X : COLOR_2X);
g.fillRect(0, 0, scale * IMAGE_WIDTH, scale * IMAGE_HEIGHT);
@@ -493,7 +392,7 @@
}
throw new RuntimeException("Test name " + testName
- + ", result name: " + resultName);
+ + ", result name: " + resultName);
}
for (URL[] testURLs : TEST_URLS) {
@@ -510,7 +409,7 @@
}
throw new RuntimeException("Test url: " + testURL
- + ", result url: " + resultURL);
+ + ", result url: " + resultURL);
}
}
@@ -521,19 +420,22 @@
}
static String getTestScaledImageName(String name) throws Exception {
- Method method = getScalableImageMethod("getScaledImageName", String.class);
+ Method method = getScalableImageMethod(
+ "getScaledImageName", String.class);
return (String) method.invoke(null, name);
}
private static boolean isValidPath(String path) {
return !path.isEmpty() && !path.endsWith("/") && !path.endsWith(".")
- && !path.contains("@2x");
+ && !path.contains("@2x");
}
private static Method getScalableImageMethod(String name,
- Class... parameterTypes) throws Exception {
+ Class... parameterTypes) throws Exception {
Toolkit toolkit = Toolkit.getDefaultToolkit();
- Method method = toolkit.getClass().getDeclaredMethod(name, parameterTypes);
+ Method method = toolkit.getClass()
+ .
+ getDeclaredMethod(name, parameterTypes);
method.setAccessible(true);
return method;
}
@@ -604,9 +506,11 @@
{new URL("jar:file:/dir/Java2D.jar!/images/image.ext"),
new URL("jar:file:/dir/Java2D.jar!/images/image@2x.ext")},
{new URL("jar:file:/aaa.bbb/Java2D.jar!/images/image.ext"),
- new URL("jar:file:/aaa.bbb/Java2D.jar!/images/image@2x.ext")},
+ new URL("jar:file:/aaa.bbb/Java2D.jar!/"
+ + "images/image@2x.ext")},
{new URL("jar:file:/dir/Java2D.jar!/aaa.bbb/image.ext"),
- new URL("jar:file:/dir/Java2D.jar!/aaa.bbb/image@2x.ext")},};
+ new URL("jar:file:/dir/Java2D.jar!/"
+ + "aaa.bbb/image@2x.ext")},};
} catch (Exception e) {
throw new RuntimeException(e);
}
@@ -615,7 +519,8 @@
static class PreloadedImageObserver implements ImageObserver {
@Override
- public boolean imageUpdate(Image img, int infoflags, int x, int y, int width, int height) {
+ public boolean imageUpdate(Image img, int infoflags, int x, int y,
+ int width, int height) {
throw new RuntimeException("Image should be already preloaded");
}
}
--- a/jdk/test/java/awt/image/RescaleOp/RescaleAlphaTest.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/awt/image/RescaleOp/RescaleAlphaTest.java Fri Sep 25 12:04:35 2015 -0700
@@ -22,8 +22,8 @@
*/
/**
* @test
- * @bug 8080287
- * @run RescaleAlphaTest
+ * @bug 8080287 8136354
+ * @run main RescaleAlphaTest
* @summary RescaleOp with scaleFactor/alpha should copy alpha to destination
* channel
*/
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/image/multiresolution/BaseMultiResolutionImageTest.java Fri Sep 25 12:04:35 2015 -0700
@@ -0,0 +1,204 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * 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.awt.Dimension;
+import java.awt.Image;
+import java.awt.image.BufferedImage;
+import java.awt.image.BaseMultiResolutionImage;
+import java.awt.image.MultiResolutionImage;
+import java.util.List;
+
+/**
+ * @test
+ * @bug 8029339
+ * @author Alexander Scherbatiy
+ * @summary Custom MultiResolution image support on HiDPI displays
+ * @run main BaseMultiResolutionImageTest
+ */
+public class BaseMultiResolutionImageTest {
+
+ public static void main(String[] args) {
+ testZeroRVIMages();
+ testNullRVIMages();
+ testNullRVIMage();
+ testIOOBException();
+ testRVSizes();
+ testBaseMRImage();
+ }
+
+ static void testZeroRVIMages() {
+ try {
+ new BaseMultiResolutionImage();
+ } catch (IllegalArgumentException ignored) {
+ return;
+ }
+ throw new RuntimeException("IllegalArgumentException is not thrown!");
+ }
+
+ static void testNullRVIMages() {
+ try {
+ new BaseMultiResolutionImage(null);
+ } catch (IllegalArgumentException ignored) {
+ return;
+ }
+ throw new RuntimeException("IllegalArgumentException is not thrown!");
+ }
+
+ static void testNullRVIMage() {
+
+ Image baseImage = new BufferedImage(10, 10, BufferedImage.TYPE_INT_RGB);
+
+ try {
+ new BaseMultiResolutionImage(baseImage, null);
+ } catch (NullPointerException ignored) {
+ return;
+ }
+ throw new RuntimeException("NullPointerException is not thrown!");
+ }
+
+ static void testIOOBException() {
+
+ for (int baseImageIndex : new int[]{-3, 2, 4}) {
+ try {
+ new BaseMultiResolutionImage(baseImageIndex,
+ createRVImage(0), createRVImage(1));
+ } catch (IndexOutOfBoundsException ignored) {
+ continue;
+ }
+
+ throw new RuntimeException("IndexOutOfBoundsException is not thrown!");
+ }
+ }
+
+ static void testRVSizes() {
+
+ int imageSize = getSize(1);
+
+ double[][] sizeArray = {
+ {-imageSize, imageSize},
+ {2 * imageSize, -2 * imageSize},
+ {Double.POSITIVE_INFINITY, imageSize},
+ {Double.POSITIVE_INFINITY, -imageSize},
+ {imageSize, Double.NEGATIVE_INFINITY},
+ {-imageSize, Double.NEGATIVE_INFINITY},
+ {Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY},
+ {Double.NaN, imageSize},
+ {imageSize, Double.NaN},
+ {Double.NaN, Double.NaN},
+ {Double.POSITIVE_INFINITY, Double.NaN}
+ };
+
+ for (double[] sizes : sizeArray) {
+ try {
+ MultiResolutionImage mrImage = new BaseMultiResolutionImage(
+ 0, createRVImage(0), createRVImage(1));
+ mrImage.getResolutionVariant(sizes[0], sizes[1]);
+ } catch (IllegalArgumentException ignored) {
+ continue;
+ }
+
+ throw new RuntimeException("IllegalArgumentException is not thrown!");
+ }
+ }
+
+ static void testBaseMRImage() {
+ int baseIndex = 1;
+ int length = 3;
+ BufferedImage[] resolutionVariants = new BufferedImage[length];
+ for (int i = 0; i < length; i++) {
+ resolutionVariants[i] = createRVImage(i);
+ }
+
+ BaseMultiResolutionImage mrImage = new BaseMultiResolutionImage(baseIndex,
+ resolutionVariants);
+
+ List<Image> rvImageList = mrImage.getResolutionVariants();
+ if (rvImageList.size() != length) {
+ throw new RuntimeException("Wrong size of resolution variants list!");
+ }
+
+ for (int i = 0; i < length; i++) {
+ int imageSize = getSize(i);
+ Image testRVImage = mrImage.getResolutionVariant(imageSize, imageSize);
+
+ if (testRVImage != resolutionVariants[i]) {
+ throw new RuntimeException("Wrong resolution variant!");
+ }
+
+ if (rvImageList.get(i) != resolutionVariants[i]) {
+ throw new RuntimeException("Wrong resolution variant!");
+ }
+ }
+
+ BufferedImage baseImage = resolutionVariants[baseIndex];
+
+ if (baseImage.getWidth() != mrImage.getWidth(null)
+ || baseImage.getHeight() != mrImage.getHeight(null)) {
+ throw new RuntimeException("Base image is wrong!");
+ }
+
+ boolean passed = false;
+
+ try {
+ rvImageList.set(0, createRVImage(10));
+ } catch (Exception e) {
+ passed = true;
+ }
+
+ if (!passed) {
+ throw new RuntimeException("Resolution variants list is modifiable!");
+ }
+
+ passed = false;
+
+ try {
+ rvImageList.remove(0);
+ } catch (Exception e) {
+ passed = true;
+ }
+
+ if (!passed) {
+ throw new RuntimeException("Resolution variants list is modifiable!");
+ }
+
+ passed = false;
+
+ try {
+ rvImageList.add(0, createRVImage(10));
+ } catch (Exception e) {
+ passed = true;
+ }
+
+ if (!passed) {
+ throw new RuntimeException("Resolution variants list is modifiable!");
+ }
+ }
+
+ private static int getSize(int i) {
+ return 8 * (i + 1);
+ }
+
+ private static BufferedImage createRVImage(int i) {
+ return new BufferedImage(getSize(i), getSize(i),
+ BufferedImage.TYPE_INT_RGB);
+ }
+}
--- a/jdk/test/java/awt/image/multiresolution/MultiResolutionCachedImageTest.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/awt/image/multiresolution/MultiResolutionCachedImageTest.java Fri Sep 25 12:04:35 2015 -0700
@@ -98,7 +98,7 @@
}
@Override
- public Image getResolutionVariant(int width, int height) {
+ public Image getResolutionVariant(double width, double height) {
if (width == size || height == size) {
throw new RuntimeException("Base image is requested!");
}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/image/multiresolution/MultiResolutionRenderingHintsTest.java Fri Sep 25 12:04:35 2015 -0700
@@ -0,0 +1,218 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * 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.awt.Color;
+import java.awt.Graphics;
+import java.awt.GraphicsConfiguration;
+import java.awt.GraphicsDevice;
+import java.awt.Image;
+import java.awt.Rectangle;
+import java.awt.image.BufferedImage;
+import java.awt.image.BaseMultiResolutionImage;
+import static java.awt.RenderingHints.KEY_RESOLUTION_VARIANT;
+import static java.awt.RenderingHints.VALUE_RESOLUTION_VARIANT_BASE;
+import static java.awt.RenderingHints.VALUE_RESOLUTION_VARIANT_DPI_FIT;
+import static java.awt.RenderingHints.VALUE_RESOLUTION_VARIANT_SIZE_FIT;
+import static java.awt.RenderingHints.VALUE_RESOLUTION_VARIANT_DEFAULT;
+import java.awt.geom.AffineTransform;
+import java.awt.image.ColorModel;
+import java.awt.image.Raster;
+import sun.java2d.StateTrackable;
+import sun.java2d.SunGraphics2D;
+import sun.java2d.SurfaceData;
+import sun.java2d.loops.SurfaceType;
+
+/**
+ * @test
+ * @bug 8029339
+ * @author Alexander Scherbatiy
+ * @summary Custom MultiResolution image support on HiDPI displays
+ * @modules java.desktop/sun.java2d
+ * @run main MultiResolutionRenderingHintsTest
+ */
+public class MultiResolutionRenderingHintsTest {
+
+ private static final int BASE_SIZE = 200;
+ private static final Color[] COLORS = {
+ Color.CYAN, Color.GREEN, Color.BLUE, Color.ORANGE, Color.RED, Color.PINK
+ };
+
+ public static void main(String[] args) throws Exception {
+
+ int length = COLORS.length;
+ BufferedImage[] resolutionVariants = new BufferedImage[length];
+ for (int i = 0; i < length; i++) {
+ resolutionVariants[i] = createRVImage(getSize(i), COLORS[i]);
+ }
+
+ BaseMultiResolutionImage mrImage = new BaseMultiResolutionImage(
+ resolutionVariants);
+
+ // base
+ Color color = getImageColor(VALUE_RESOLUTION_VARIANT_BASE, mrImage, 2, 3);
+ if (!getColorForScale(1).equals(color)) {
+ throw new RuntimeException("Wrong base resolution variant!");
+ }
+
+ // dpi fit
+ color = getImageColor(VALUE_RESOLUTION_VARIANT_DPI_FIT, mrImage, 2, 3);
+ if (!getColorForScale(2).equals(color)) {
+ throw new RuntimeException("Resolution variant is not based on dpi!");
+ }
+
+ // size fit
+ color = getImageColor(VALUE_RESOLUTION_VARIANT_SIZE_FIT, mrImage, 2, 3);
+ if (!getColorForScale(6).equals(color)) {
+ throw new RuntimeException("Resolution variant is not based on"
+ + " rendered size!");
+ }
+
+ // default
+ // depends on the policies of the platform
+ // just check that exception is not thrown
+ getImageColor(VALUE_RESOLUTION_VARIANT_DEFAULT, mrImage, 2, 3);
+ }
+
+ private static Color getColorForScale(int scale) {
+ return COLORS[scale - 1];
+ }
+
+ private static Color getImageColor(final Object renderingHint, Image image,
+ double configScale, double graphicsScale) {
+
+ int width = image.getWidth(null);
+ int height = image.getHeight(null);
+
+ TestSurfaceData surface = new TestSurfaceData(width, height, configScale);
+ SunGraphics2D g2d = new SunGraphics2D(surface,
+ Color.BLACK, Color.BLACK, null);
+ g2d.setRenderingHint(KEY_RESOLUTION_VARIANT, renderingHint);
+ g2d.scale(graphicsScale, graphicsScale);
+ g2d.drawImage(image, 0, 0, null);
+ g2d.dispose();
+ return surface.getColor(width / 2, height / 2);
+ }
+
+ private static int getSize(int i) {
+ return (i + 1) * BASE_SIZE;
+ }
+
+ private static BufferedImage createRVImage(int size, Color color) {
+ BufferedImage image = new BufferedImage(size, size, BufferedImage.TYPE_INT_RGB);
+ Graphics g = image.createGraphics();
+ g.setColor(Color.BLACK);
+ g.fillRect(0, 0, size, size);
+ g.setColor(color);
+ g.fillOval(0, 0, size, size);
+ g.dispose();
+ return image;
+ }
+
+ static class TestGraphicsConfig extends GraphicsConfiguration {
+
+ private final double scale;
+
+ TestGraphicsConfig(double scale) {
+ this.scale = scale;
+ }
+
+ @Override
+ public GraphicsDevice getDevice() {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public ColorModel getColorModel() {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public ColorModel getColorModel(int transparency) {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public AffineTransform getDefaultTransform() {
+ return AffineTransform.getScaleInstance(scale, scale);
+ }
+
+ @Override
+ public AffineTransform getNormalizingTransform() {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public Rectangle getBounds() {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+ }
+
+ static class TestSurfaceData extends SurfaceData {
+
+ private final int width;
+ private final int height;
+ private final GraphicsConfiguration gc;
+ private final BufferedImage buffImage;
+ private final double scale;
+
+ public TestSurfaceData(int width, int height, double scale) {
+ super(StateTrackable.State.DYNAMIC, SurfaceType.Custom, ColorModel.getRGBdefault());
+ this.scale = scale;
+ gc = new TestGraphicsConfig(scale);
+ this.width = (int) Math.ceil(scale * width);
+ this.height = (int) Math.ceil(scale * height);
+ buffImage = new BufferedImage(this.width, this.height,
+ BufferedImage.TYPE_INT_RGB);
+ }
+
+ Color getColor(int x, int y) {
+ int sx = (int) Math.ceil(x * scale);
+ int sy = (int) Math.ceil(y * scale);
+ return new Color(buffImage.getRGB(sx, sy));
+ }
+
+ @Override
+ public SurfaceData getReplacement() {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public GraphicsConfiguration getDeviceConfiguration() {
+ return gc;
+ }
+
+ @Override
+ public Raster getRaster(int x, int y, int w, int h) {
+ return buffImage.getRaster();
+ }
+
+ @Override
+ public Rectangle getBounds() {
+ return new Rectangle(0, 0, width, height);
+ }
+
+ @Override
+ public Object getDestination() {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/beans/XMLEncoder/ReferenceToNonStaticField.java Fri Sep 25 12:04:35 2015 -0700
@@ -0,0 +1,164 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * 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.awt.font.TextAttribute;
+
+/**
+ * @test
+ * @bug 8060027
+ */
+public final class ReferenceToNonStaticField
+ extends AbstractTest<ReferenceToNonStaticField.TestValue> {
+
+ public static final class TestValue {
+
+ // reference to static field
+ public TextAttribute font_default = TextAttribute.FONT;
+ public TextAttribute family_default = TextAttribute.FAMILY;
+ public TextAttribute family_set1; // will be set to the same as default
+ public TextAttribute family_set2; // will be set to the same as default
+ public TextAttribute family_set3; // will be set to the same as default
+
+ // primitive small
+ public int int_1_default = 1;
+ public int int_10_default = 10;
+ public int int_10_set1; // will be set to the same as default
+ public int int_10_set2; // will be set to the same as default
+ public int int_10_set3; // will be set to the same as default
+
+ // primitive big
+ public int int_1000_default = 1000;
+ public int int_2000_default = 2000;
+ public int int_2000_set1; // will be set to the same as default
+ public int int_2000_set2; // will be set to the same as default
+ public int int_2000_set3; // will be set to the same as default
+
+ // wrappers
+ public Integer integer_1_default = new Integer(1);
+ public Integer integer_10_default = new Integer(10);
+ public Integer integer_10_set1; // will be set to the same as default
+ public Integer integer_10_set2; // will be set to the same as default
+ public Integer integer_10_set3; // will be set to the same as default
+
+ public TestValue() {
+ }
+
+ public TestValue(final Object ignored) {
+ // set some fields to non-default values, so they will be saved
+ family_set1 = family_default;
+ family_set3 = family_default;
+ family_set2 = family_default;
+ int_10_set1 = int_10_default;
+ int_10_set2 = int_10_default;
+ int_10_set3 = int_10_default;
+ int_2000_set1 = int_2000_default;
+ int_2000_set2 = int_2000_default;
+ int_2000_set3 = int_2000_default;
+ integer_10_set1 = integer_10_default;
+ integer_10_set2 = integer_10_default;
+ integer_10_set3 = integer_10_default;
+ }
+ }
+
+ public static void main(final String[] args) {
+ new ReferenceToNonStaticField().test(true);
+ }
+
+ protected TestValue getObject() {
+ return new TestValue(new Object());
+ }
+
+ @Override
+ protected void validate(final TestValue before,final TestValue after) {
+ super.validate(before, after);
+ validate(before);
+ validate(after);
+ }
+
+ private static void validate(final TestValue object) {
+ // reference to static field
+ if (object.font_default != TextAttribute.FONT) {
+ throw new Error("Wrong font_default: " + object.font_default);
+ }
+ if (object.family_default != TextAttribute.FAMILY) {
+ throw new Error("Wrong family_default: " + object.family_default);
+ }
+ if (object.family_set1 != object.family_default) {
+ throw new Error("Wrong family_set1: " + object.family_set1);
+ }
+ if (object.family_set2 != object.family_default) {
+ throw new Error("Wrong family_set2: " + object.family_set2);
+ }
+ if (object.family_set3 != object.family_default) {
+ throw new Error("Wrong family_set3: " + object.family_set3);
+ }
+ // primitive small
+ if (object.int_1_default != 1) {
+ throw new Error("Wrong int_1_default: " + object.int_1_default);
+ }
+ if (object.int_10_default != 10) {
+ throw new Error("Wrong int_10_default: " + object.int_10_default);
+ }
+ if (object.int_10_set1 != object.int_10_default) {
+ throw new Error("Wrong int_10_set1: " + object.int_10_set1);
+ }
+ if (object.int_10_set2 != object.int_10_default) {
+ throw new Error("Wrong int_10_set2: " + object.int_10_set2);
+ }
+ if (object.int_10_set3 != object.int_10_default) {
+ throw new Error("Wrong int_10_set3: " + object.int_10_set3);
+ }
+ // primitive big
+ if (object.int_1000_default != 1000) {
+ throw new Error("Wrong int_1000_default: " + object.int_1000_default);
+ }
+ if (object.int_2000_default != 2000) {
+ throw new Error("Wrong int_2000_default: " + object.int_2000_default);
+ }
+ if (object.int_2000_set1 != object.int_2000_default) {
+ throw new Error("Wrong int_2000_set1: " + object.int_2000_set1);
+ }
+ if (object.int_2000_set2 != object.int_2000_default) {
+ throw new Error("Wrong int_2000_set2: " + object.int_2000_set2);
+ }
+ if (object.int_2000_set3 != object.int_2000_default) {
+ throw new Error("Wrong int_2000_set3: " + object.int_2000_set3);
+ }
+ // wrappers
+ if (!object.integer_1_default.equals(new Integer(1))) {
+ throw new Error("Wrong integer_1_default: " + object.integer_1_default);
+ }
+ if (!object.integer_10_default.equals(new Integer(10))) {
+ throw new Error("Wrong integer_10_default: " + object.integer_10_default);
+ }
+ if (object.integer_10_set1 != object.integer_10_default) {
+ throw new Error("Wrong integer_10_set1: " + object.integer_10_set1);
+ }
+ if (object.integer_10_set2 != object.integer_10_default) {
+ throw new Error("Wrong integer_10_set2: " + object.integer_10_set2);
+ }
+ if (object.integer_10_set3 != object.integer_10_default) {
+ throw new Error("Wrong integer_10_set3: " + object.integer_10_set3);
+ }
+ }
+}
--- a/jdk/test/java/io/File/MaxPathLength.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/io/File/MaxPathLength.java Fri Sep 25 12:04:35 2015 -0700
@@ -39,7 +39,7 @@
"areallylongfilenamethatsforsur";
private static boolean isWindows = false;
- private final static int MAX_LENGTH = 256;
+ private static final int MAX_LENGTH = 256;
private static int counter = 0;
--- a/jdk/test/java/io/File/SymLinks.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/io/File/SymLinks.java Fri Sep 25 12:04:35 2015 -0700
@@ -34,22 +34,22 @@
import static java.nio.file.LinkOption.*;
public class SymLinks {
- final static PrintStream out = System.out;
+ static final PrintStream out = System.out;
- final static File top = new File(System.getProperty("test.dir", "."));
+ static final File top = new File(System.getProperty("test.dir", "."));
// files used by the test
- final static File file = new File(top, "foofile");
- final static File link2file = new File(top, "link2file");
- final static File link2link2file = new File(top, "link2link2file");
+ static final File file = new File(top, "foofile");
+ static final File link2file = new File(top, "link2file");
+ static final File link2link2file = new File(top, "link2link2file");
- final static File dir = new File(top, "foodir");
- final static File link2dir = new File(top, "link2dir");
- final static File link2link2dir = new File(top, "link2link2dir");
+ static final File dir = new File(top, "foodir");
+ static final File link2dir = new File(top, "link2dir");
+ static final File link2link2dir = new File(top, "link2link2dir");
- final static File link2nobody = new File(top, "link2nobody");
- final static File link2link2nobody = new File(top, "link2link2nobody");
+ static final File link2nobody = new File(top, "link2nobody");
+ static final File link2link2nobody = new File(top, "link2link2nobody");
/**
* Setup files, directories, and sym links used by test.
--- a/jdk/test/java/io/FileDescriptor/Sharing.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/io/FileDescriptor/Sharing.java Fri Sep 25 12:04:35 2015 -0700
@@ -35,8 +35,8 @@
public class Sharing {
- final static int numFiles = 10;
- volatile static boolean fail;
+ static final int numFiles = 10;
+ static volatile boolean fail;
public static void main(String[] args) throws Exception {
TestFinalizer();
--- a/jdk/test/java/io/IOException/LastErrorString.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/io/IOException/LastErrorString.java Fri Sep 25 12:04:35 2015 -0700
@@ -65,7 +65,7 @@
}
- static abstract class Test {
+ abstract static class Test {
String name;
@@ -73,7 +73,7 @@
this.name = name;
}
- abstract public void run() throws IOException;
+ public abstract void run() throws IOException;
public void go() throws IOException {
try {
@@ -88,7 +88,7 @@
}
- static abstract class ClosedFISTest extends Test {
+ abstract static class ClosedFISTest extends Test {
FileInputStream in;
@@ -104,7 +104,7 @@
}
- static abstract class ClosedFOSTest extends Test {
+ abstract static class ClosedFOSTest extends Test {
FileOutputStream out;
@@ -120,7 +120,7 @@
}
- static abstract class ClosedRAFTest extends Test {
+ abstract static class ClosedRAFTest extends Test {
RandomAccessFile raf;
@@ -136,7 +136,7 @@
}
- static abstract class ReadOnlyRAFTest extends Test {
+ abstract static class ReadOnlyRAFTest extends Test {
RandomAccessFile raf;
--- a/jdk/test/java/io/InputStreamReader/One.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/io/InputStreamReader/One.java Fri Sep 25 12:04:35 2015 -0700
@@ -32,7 +32,7 @@
public class One {
- private static abstract class Test {
+ private abstract static class Test {
InputStreamReader isr;
StringBuffer sb;
--- a/jdk/test/java/io/PrintStream/OversynchronizedTest.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/io/PrintStream/OversynchronizedTest.java Fri Sep 25 12:04:35 2015 -0700
@@ -87,7 +87,7 @@
System.out.println("In test().");
}
- synchronized public String toString() {
+ public synchronized String toString() {
System.out.println("Calling toString\n");
return mStr;
}
--- a/jdk/test/java/io/PrintWriter/OversynchronizedTest.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/io/PrintWriter/OversynchronizedTest.java Fri Sep 25 12:04:35 2015 -0700
@@ -87,7 +87,7 @@
writer.println("In test().");
}
- synchronized public String toString() {
+ public synchronized String toString() {
writer.println("Calling toString\n");
return mStr;
}
--- a/jdk/test/java/io/Serializable/defaulted/GetFieldRead.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/io/Serializable/defaulted/GetFieldRead.java Fri Sep 25 12:04:35 2015 -0700
@@ -35,7 +35,7 @@
private static final long serialVersionUID=5748652654655279289L;
// Fields to be serialized.
- private final static ObjectStreamField[] serialPersistentFields = {
+ private static final ObjectStreamField[] serialPersistentFields = {
new ObjectStreamField("objectI", Integer.class),
new ObjectStreamField("primitiveI", Integer.TYPE),
new ObjectStreamField("foo", Foo.class)
--- a/jdk/test/java/io/Serializable/defaulted/GetFieldWrite.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/io/Serializable/defaulted/GetFieldWrite.java Fri Sep 25 12:04:35 2015 -0700
@@ -42,7 +42,7 @@
private static final long serialVersionUID = 5748652654655279289L;
// Fields to be serialized.
- private final static ObjectStreamField[] serialPersistentFields = {
+ private static final ObjectStreamField[] serialPersistentFields = {
new ObjectStreamField("objectI", Integer.class)};
Integer objectI;
--- a/jdk/test/java/io/Serializable/evolution/RenamePackage/extension/ExtendedObjectInputStream.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/io/Serializable/evolution/RenamePackage/extension/ExtendedObjectInputStream.java Fri Sep 25 12:04:35 2015 -0700
@@ -28,7 +28,7 @@
public class ExtendedObjectInputStream extends ObjectInputStream {
- static private Hashtable renamedClassMap;
+ private static Hashtable renamedClassMap;
public ExtendedObjectInputStream(InputStream si)
throws IOException, StreamCorruptedException
@@ -49,7 +49,7 @@
return super.resolveClass(v);
}
- static public void addRenamedClassName(String oldName, String newName)
+ public static void addRenamedClassName(String oldName, String newName)
throws ClassNotFoundException
{
Class cl = null;
--- a/jdk/test/java/io/Serializable/oldTests/CheckingEquality.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/io/Serializable/oldTests/CheckingEquality.java Fri Sep 25 12:04:35 2015 -0700
@@ -181,7 +181,7 @@
private static int seven[];
protected byte eight = (byte)9;
- final static byte dcare = (byte) 128;
+ static final byte dcare = (byte) 128;
private short nine = 8888;
long ten;
java.util.Enumeration zero;
--- a/jdk/test/java/io/Serializable/subclass/AbstractObjectInputStream.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/io/Serializable/subclass/AbstractObjectInputStream.java Fri Sep 25 12:04:35 2015 -0700
@@ -143,7 +143,7 @@
* @see java.io.ext.AbstractObjectOutputStream
* @since JDK1.2
*/
-abstract public class AbstractObjectInputStream extends ObjectInputStream
+public abstract class AbstractObjectInputStream extends ObjectInputStream
{
protected InputStream in;
/**
@@ -167,7 +167,7 @@
this.in = in;
}
- abstract public void close() throws IOException;
+ public abstract void close() throws IOException;
/***************************************************************/
/* Read an object from the stream. */
@@ -230,7 +230,7 @@
* @exception ClassNotFoundException if no corresponding local class can be
* found in the local JVM.
*/
- abstract public void defaultReadObject()
+ public abstract void defaultReadObject()
throws IOException, ClassNotFoundException, NotActiveException;
/**
@@ -252,7 +252,7 @@
* <STRONG>ofClass</STRONG>.
* @exception InstantiationException TBD.
*/
- final protected native Object
+ protected final native Object
allocateNewObject(Class ofClass, Class ctorClass)
throws InstantiationException, IllegalAccessException;
@@ -270,7 +270,7 @@
* @exception IllegalAccessException TBD.
* @exception InstantiationException TBD.
*/
- final protected native Object
+ protected final native Object
allocateNewArray(Class componentClass, int length)
throws InstantiationException, IllegalAccessException;
@@ -283,12 +283,12 @@
* @exception IOException if an I/O error occurs.
* @exception NotActiveException if readObject() is not currently active.
*/
- abstract public ObjectInputStream.GetField readFields()
+ public abstract ObjectInputStream.GetField readFields()
throws IOException, ClassNotFoundException, NotActiveException;
- abstract protected boolean enableResolveObject(boolean enable) throws SecurityException;
+ protected abstract boolean enableResolveObject(boolean enable) throws SecurityException;
- abstract public void registerValidation(ObjectInputValidation obj,
+ public abstract void registerValidation(ObjectInputValidation obj,
int prio)
throws NotActiveException, InvalidObjectException;
@@ -297,25 +297,25 @@
/* Use DataInput methods to read primitive data from the stream. */
- abstract public int read() throws IOException;
- abstract public int read(byte[] data, int offset, int length)
+ public abstract int read() throws IOException;
+ public abstract int read(byte[] data, int offset, int length)
throws IOException;
- abstract public boolean readBoolean() throws IOException;
- abstract public byte readByte() throws IOException;
- abstract public int readUnsignedByte() throws IOException;
- abstract public short readShort() throws IOException;
- abstract public int readUnsignedShort() throws IOException;
- abstract public char readChar() throws IOException;
- abstract public int readInt() throws IOException;
- abstract public long readLong() throws IOException;
- abstract public float readFloat() throws IOException;
- abstract public double readDouble() throws IOException;
- abstract public void readFully(byte[] data) throws IOException;
- abstract public void readFully(byte[] data, int offset, int size) throws IOException;
- abstract public String readUTF() throws IOException;
- abstract public int available() throws IOException;
- abstract public int skipBytes(int len) throws IOException;
+ public abstract boolean readBoolean() throws IOException;
+ public abstract byte readByte() throws IOException;
+ public abstract int readUnsignedByte() throws IOException;
+ public abstract short readShort() throws IOException;
+ public abstract int readUnsignedShort() throws IOException;
+ public abstract char readChar() throws IOException;
+ public abstract int readInt() throws IOException;
+ public abstract long readLong() throws IOException;
+ public abstract float readFloat() throws IOException;
+ public abstract double readDouble() throws IOException;
+ public abstract void readFully(byte[] data) throws IOException;
+ public abstract void readFully(byte[] data, int offset, int size) throws IOException;
+ public abstract String readUTF() throws IOException;
+ public abstract int available() throws IOException;
+ public abstract int skipBytes(int len) throws IOException;
/* @deprecated */
- abstract public String readLine() throws IOException;
+ public abstract String readLine() throws IOException;
};
--- a/jdk/test/java/io/Serializable/subclass/AbstractObjectOutputStream.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/io/Serializable/subclass/AbstractObjectOutputStream.java Fri Sep 25 12:04:35 2015 -0700
@@ -134,7 +134,7 @@
*
* @since JDK1.2
*/
-abstract public class AbstractObjectOutputStream extends ObjectOutputStream
+public abstract class AbstractObjectOutputStream extends ObjectOutputStream
{
protected OutputStream out;
/* Stream Management Methods. */
@@ -156,9 +156,9 @@
this.out = out;
}
- abstract public void reset() throws IOException;
- abstract protected void drain() throws IOException;
- abstract public void close() throws IOException;
+ public abstract void reset() throws IOException;
+ protected abstract void drain() throws IOException;
+ public abstract void close() throws IOException;
/*******************************************************************/
@@ -214,14 +214,14 @@
* @exception NotActiveException Thrown if a writeObject method is not
* active.
*/
- abstract public void defaultWriteObject() throws IOException;
+ public abstract void defaultWriteObject() throws IOException;
/*************************************************************/
/* Use the methods of PutField to map between Serializable fields
* and actual fields of a Serializable class.
*/
- abstract public ObjectOutputStream.PutField putFields() throws IOException;
+ public abstract ObjectOutputStream.PutField putFields() throws IOException;
/**
* Note: The PutField being serialized is not passed to this method.
@@ -229,25 +229,25 @@
* the state of the last putFields call and
* only allowed this method to be invoked for that PutFields object.
*/
- abstract public void writeFields() throws IOException;
+ public abstract void writeFields() throws IOException;
- abstract protected boolean enableReplaceObject(boolean enable) throws SecurityException;
+ protected abstract boolean enableReplaceObject(boolean enable) throws SecurityException;
/*******************************************************************/
/* Write Primitive Data to stream. DataOutput methods. */
- abstract public void write(int data) throws IOException;
- abstract public void write(byte b[]) throws IOException;
- abstract public void write(byte b[], int off, int len) throws IOException;
- abstract public void writeBoolean(boolean data) throws IOException;
- abstract public void writeByte(int data) throws IOException;
- abstract public void writeShort(int data) throws IOException;
- abstract public void writeChar(int data) throws IOException;
- abstract public void writeInt(int data) throws IOException;
- abstract public void writeLong(long data) throws IOException;
- abstract public void writeFloat(float data) throws IOException;
- abstract public void writeDouble(double data) throws IOException;
- abstract public void writeBytes(String data) throws IOException;
- abstract public void writeChars(String data) throws IOException;
- abstract public void writeUTF(String data) throws IOException;
+ public abstract void write(int data) throws IOException;
+ public abstract void write(byte b[]) throws IOException;
+ public abstract void write(byte b[], int off, int len) throws IOException;
+ public abstract void writeBoolean(boolean data) throws IOException;
+ public abstract void writeByte(int data) throws IOException;
+ public abstract void writeShort(int data) throws IOException;
+ public abstract void writeChar(int data) throws IOException;
+ public abstract void writeInt(int data) throws IOException;
+ public abstract void writeLong(long data) throws IOException;
+ public abstract void writeFloat(float data) throws IOException;
+ public abstract void writeDouble(double data) throws IOException;
+ public abstract void writeBytes(String data) throws IOException;
+ public abstract void writeChars(String data) throws IOException;
+ public abstract void writeUTF(String data) throws IOException;
};
--- a/jdk/test/java/io/Serializable/subclass/Test.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/io/Serializable/subclass/Test.java Fri Sep 25 12:04:35 2015 -0700
@@ -49,7 +49,7 @@
*/
class B implements Serializable {
public int publicIntField;
- static public int numWriteObjectCalled = 0;
+ public static int numWriteObjectCalled = 0;
B(int v) {
publicIntField = v;
}
@@ -73,7 +73,7 @@
class C implements Serializable {
public int xx1;
public int xx2;
- final static ObjectStreamField[] serialPersistentFields = {
+ static final ObjectStreamField[] serialPersistentFields = {
new ObjectStreamField("x1", Integer.TYPE),
new ObjectStreamField("x2", Integer.TYPE),
new ObjectStreamField("x3", Integer.TYPE),
@@ -112,7 +112,7 @@
};
public class Test {
- static public void main(String argv[])
+ public static void main(String argv[])
throws IOException, ClassNotFoundException
{
boolean expectSecurityException = false;
--- a/jdk/test/java/io/Serializable/subclass/XObjectInputStream.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/io/Serializable/subclass/XObjectInputStream.java Fri Sep 25 12:04:35 2015 -0700
@@ -37,12 +37,12 @@
dis = new DataInputStream(in);
}
- final public void defaultReadObject()
+ public final void defaultReadObject()
throws IOException, ClassNotFoundException, NotActiveException
{
}
- final protected Object readObjectOverride()
+ protected final Object readObjectOverride()
throws OptionalDataException, ClassNotFoundException, IOException {
Object readResult = null;
@@ -256,7 +256,7 @@
* Set the accessible flag on it here. ObjectOutputStream
* will call it as necessary.
*/
- static public Method getReadObjectMethod(final Class cl) {
+ public static Method getReadObjectMethod(final Class cl) {
Method readObjectMethod = (Method)
java.security.AccessController.doPrivileged
@@ -286,7 +286,7 @@
/*************************************************************/
/* taken verbatim from ObjectInputStream. */
- static private void invokeMethod(final Object obj, final Method m,
+ private static void invokeMethod(final Object obj, final Method m,
final Object[] argList)
throws IOException
{
--- a/jdk/test/java/io/Serializable/subclass/XObjectOutputStream.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/io/Serializable/subclass/XObjectOutputStream.java Fri Sep 25 12:04:35 2015 -0700
@@ -53,7 +53,7 @@
super.writeStreamHeader();
}
- final protected void writeObjectOverride(Object obj) throws IOException {
+ protected final void writeObjectOverride(Object obj) throws IOException {
Object prevCurrentObject = currentObject;
currentObject = obj;
System.out.println("writeObjectOverride(" + obj.toString() + ")");
@@ -300,7 +300,7 @@
* Set the accessible flag on it here.
* Subclass of AbstractObjectOutputStream will call it as necessary.
*/
- static public Method getWriteObjectMethod(final Class cl) {
+ public static Method getWriteObjectMethod(final Class cl) {
Method writeObjectMethod = (Method)
java.security.AccessController.doPrivileged
@@ -330,7 +330,7 @@
/*************************************************************/
/* CODE LIFTED FROM ObjectOutputStream. */
- static private void invokeMethod(final Object obj, final Method m,
+ private static void invokeMethod(final Object obj, final Method m,
final Object[] argList)
throws IOException
{
--- a/jdk/test/java/io/Serializable/typeSafeEnum/TypeSafeEnum.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/io/Serializable/typeSafeEnum/TypeSafeEnum.java Fri Sep 25 12:04:35 2015 -0700
@@ -39,9 +39,9 @@
this.value = value;
}
- final public static TypeSafeEnum FIRST = new TypeSafeEnum("First");
- final public static TypeSafeEnum SECOND = new TypeSafeEnum("Second");
- final public static TypeSafeEnum THIRD = new TypeSafeEnum("Third");
+ public static final TypeSafeEnum FIRST = new TypeSafeEnum("First");
+ public static final TypeSafeEnum SECOND = new TypeSafeEnum("Second");
+ public static final TypeSafeEnum THIRD = new TypeSafeEnum("Third");
static int numReadResolve = 0;
static int numWriteReplace = 0;
static boolean verbose = false;
--- a/jdk/test/java/io/StreamTokenizer/ReadAhead.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/io/StreamTokenizer/ReadAhead.java Fri Sep 25 12:04:35 2015 -0700
@@ -39,7 +39,7 @@
/* An InputStream subclass that cannot read past a given limit */
- static private class LimitedInputStream extends InputStream {
+ private static class LimitedInputStream extends InputStream {
private String input;
private int limit; /* Do not allow input[limit] to be read */
@@ -60,7 +60,7 @@
/* A Reader subclass that cannot read past a given limit */
- static private class LimitedReader extends Reader {
+ private static class LimitedReader extends Reader {
private String input;
private int limit; /* Do not allow input[limit] to be read */
@@ -95,11 +95,11 @@
/* Interface for objects that can create new StreamTokenizers
with a given limited input */
- static private interface StreamTokenizerMaker {
+ private static interface StreamTokenizerMaker {
public StreamTokenizer create(String input, int limit);
}
- static private void fail(String why) throws Exception {
+ private static void fail(String why) throws Exception {
throw new Exception(why);
}
--- a/jdk/test/java/lang/Class/getDeclaredField/ClassDeclaredFieldsTest.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/lang/Class/getDeclaredField/ClassDeclaredFieldsTest.java Fri Sep 25 12:04:35 2015 -0700
@@ -135,7 +135,7 @@
}
// A Helper class to build a set of permissions.
- final static class PermissionsBuilder {
+ static final class PermissionsBuilder {
final Permissions perms;
public PermissionsBuilder() {
this(new Permissions());
--- a/jdk/test/java/lang/Class/getDeclaredField/FieldSetAccessibleTest.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/lang/Class/getDeclaredField/FieldSetAccessibleTest.java Fri Sep 25 12:04:35 2015 -0700
@@ -301,7 +301,7 @@
}
// A Helper class to build a set of permissions.
- final static class PermissionsBuilder {
+ static final class PermissionsBuilder {
final Permissions perms;
public PermissionsBuilder() {
this(new Permissions());
--- a/jdk/test/java/lang/Enum/ValueOf.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/lang/Enum/ValueOf.java Fri Sep 25 12:04:35 2015 -0700
@@ -219,7 +219,7 @@
FOO {
public void foo() {}
};
- abstract public void foo();
+ public abstract void foo();
};
}
--- a/jdk/test/java/lang/Math/PowTests.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/lang/Math/PowTests.java Fri Sep 25 12:04:35 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved.
* 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 4984407 5033578
+ * @bug 4984407 5033578 8134795
* @summary Tests for {Math, StrictMath}.pow
* @author Joseph D. Darcy
*/
@@ -88,12 +88,19 @@
/* > -oo */ -Double.MAX_VALUE,
/**/ (double)Long.MIN_VALUE,
/**/ (double) -((1L<<53)+2L),
+ -0x1.0p65,
+ -0x1.0000000000001p64,
+ -0x1.0p64,
/**/ (double) -((1L<<53)),
/**/ (double) -((1L<<53)-1L),
/**/ -((double)Integer.MAX_VALUE + 4.0),
/**/ (double)Integer.MIN_VALUE - 1.0,
/**/ (double)Integer.MIN_VALUE,
/**/ (double)Integer.MIN_VALUE + 1.0,
+ -0x1.0p31 + 2.0,
+ -0x1.0p31 + 1.0,
+ -0x1.0000000000001p31,
+ -0x1.0p31,
/**/ -Math.PI,
/**/ -3.0,
/**/ -Math.E,
@@ -103,6 +110,8 @@
-1.0,
/* > -1.0 */ -0.9999999999999999, // nextAfter(-1.0, +oo)
/* > -1.0 */ -0.9999999999999998,
+ -0x1.fffffp-1,
+ -0x1.ffffeffffffffp-1,
/**/ -0.5,
/**/ -1.0/3.0,
/* < 0.0 */ -Double.MIN_VALUE,
@@ -111,6 +120,8 @@
/* > 0.0 */ +Double.MIN_VALUE,
/**/ +1.0/3.0,
/**/ +0.5,
+ +0x1.ffffeffffffffp-1,
+ +0x1.fffffp-1,
/**/ +0.9999999999999998,
/* < +1.0 */ +0.9999999999999999, // nextAfter(-1.0, +oo)
+1.0,
@@ -120,6 +131,10 @@
/**/ +Math.E,
/**/ +3.0,
/**/ +Math.PI,
+ 0x1.0p31,
+ 0x1.0000000000001p31,
+ 0x1.0p31 + 1.0,
+ 0x1.0p31 + 2.0,
/**/ -(double)Integer.MIN_VALUE - 1.0,
/**/ -(double)Integer.MIN_VALUE,
/**/ -(double)Integer.MIN_VALUE + 1.0,
@@ -127,6 +142,9 @@
/**/ (double) ((1L<<53)-1L),
/**/ (double) ((1L<<53)),
/**/ (double) ((1L<<53)+2L),
+ 0x1.0p64,
+ 0x1.0000000000001p64,
+ 0x1.0p65,
/**/ -(double)Long.MIN_VALUE,
/* < oo */ Double.MAX_VALUE,
Double.POSITIVE_INFINITY,
@@ -257,7 +275,7 @@
}
static boolean isFinite(double a) {
- return (0.0*a == 0);
+ return (0.0 * a == 0);
}
/**
--- a/jdk/test/java/lang/ProcessBuilder/Basic.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/lang/ProcessBuilder/Basic.java Fri Sep 25 12:04:35 2015 -0700
@@ -653,7 +653,7 @@
}
static class EnglishUnix {
- private final static Boolean is =
+ private static final Boolean is =
(! Windows.is() && isEnglish("LANG") && isEnglish("LC_ALL"));
private static boolean isEnglish(String envvar) {
--- a/jdk/test/java/lang/ProcessHandle/OnExitTest.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/lang/ProcessHandle/OnExitTest.java Fri Sep 25 12:04:35 2015 -0700
@@ -96,8 +96,6 @@
ConcurrentHashMap<ProcessHandle, ProcessHandle> processes = new ConcurrentHashMap<>();
List<ProcessHandle> children = getChildren(ProcessHandle.current());
children.forEach(ProcessUtil::printProcess);
- Assert.assertEquals(children.size(), 0,
- "Expected to start with zero children; " + children);
JavaChild proc = JavaChild.spawnJavaChild("stdin");
procHandle = proc.toHandle();
@@ -186,10 +184,6 @@
children.forEach(p -> printProcess(p, "after onExit:"));
Assert.assertEquals(proc.isAlive(), false, "destroyed process is alive:: %s%n" + proc);
-
- List<ProcessHandle> children2 = getAllChildren(procHandle);
- printf(" children2: %s%n", children2.toString());
- Assert.assertEquals(children2.size(), 0, "After onExit, expected no children");
} catch (IOException | InterruptedException ex) {
Assert.fail(ex.getMessage());
} finally {
--- a/jdk/test/java/lang/ProcessHandle/TreeTest.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/lang/ProcessHandle/TreeTest.java Fri Sep 25 12:04:35 2015 -0700
@@ -29,6 +29,7 @@
import java.util.Arrays;
import java.util.List;
import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
import java.util.stream.Stream;
@@ -67,8 +68,6 @@
printf("self pid: %d%n", self.getPid());
printDeep(self, "");
- long count = getChildren(self).size();
- Assert.assertEquals(count, 0, "Start with zero children");
for (int i = 0; i < MAXCHILDREN; i++) {
// spawn and wait for instructions
@@ -124,8 +123,10 @@
spawned.stream()
.map(Process::toHandle)
.filter(ProcessHandle::isAlive)
- .forEach(ph -> printDeep(ph, "test1 cleanup: "));
- destroyProcessTree(ProcessHandle.current());
+ .forEach(ph -> {
+ printDeep(ph, "test1 cleanup: ");
+ ph.destroyForcibly();
+ });
}
}
@@ -135,18 +136,29 @@
@Test
public static void test2() {
try {
+ ConcurrentHashMap<ProcessHandle, ProcessHandle> processes = new ConcurrentHashMap<>();
+
ProcessHandle self = ProcessHandle.current();
List<ProcessHandle> initialChildren = getChildren(self);
long count = initialChildren.size();
if (count > 0) {
initialChildren.forEach(p -> printDeep(p, "test2 initial unexpected: "));
- Assert.assertEquals(count, 0, "Start with zero children (except Windows conhost.exe)");
}
JavaChild p1 = JavaChild.spawnJavaChild("stdin");
ProcessHandle p1Handle = p1.toHandle();
printf(" p1 pid: %d%n", p1.getPid());
+ // Gather the PIDs from the output of the spawing process
+ p1.forEachOutputLine((s) -> {
+ String[] split = s.trim().split(" ");
+ if (split.length == 3 && split[1].equals("spawn")) {
+ Long child = Long.valueOf(split[2]);
+ Long parent = Long.valueOf(split[0].split(":")[0]);
+ processes.put(ProcessHandle.of(child).get(), ProcessHandle.of(parent).get());
+ }
+ });
+
int spawnNew = 3;
p1.sendAction("spawn", spawnNew, "stdin");
@@ -160,18 +172,33 @@
int spawnNewSub = 2;
p1.sendAction("child", "spawn", spawnNewSub, "stdin");
- // For each spawned child, wait for its children
- for (ProcessHandle p : subprocesses) {
- List<ProcessHandle> grandChildren = waitForChildren(p, spawnNewSub);
+ // Poll until all 9 child processes exist or the timeout is reached
+ int expected = 9;
+ long timeout = jdk.testlibrary.Utils.adjustTimeout(10L);
+ Instant endTimeout = Instant.now().plusSeconds(timeout);
+ do {
+ Thread.sleep(200L);
+ printf(" subprocess count: %d, waiting for %d%n", processes.size(), expected);
+ } while (processes.size() < expected &&
+ Instant.now().isBefore(endTimeout));
+
+ if (processes.size() < expected) {
+ printf("WARNING: not all children have been started. Can't complete test.%n");
+ printf(" You can try to increase the timeout or%n");
+ printf(" you can try to use a faster VM (i.e. not a debug version).%n");
}
+ // show the complete list of children (for debug)
List<ProcessHandle> allChildren = getAllChildren(p1Handle);
printf(" allChildren: %s%n",
allChildren.stream().map(p -> p.getPid())
.collect(Collectors.toList()));
- for (ProcessHandle ph : allChildren) {
- Assert.assertEquals(ph.isAlive(), true, "Child should be alive: " + ph);
- }
+
+ // Verify that all spawned children show up in the allChildrenList
+ processes.forEach((p, parent) -> {
+ Assert.assertEquals(p.isAlive(), true, "Child should be alive: " + p);
+ Assert.assertTrue(allChildren.contains(p), "Spawned child should be listed in allChildren: " + p);
+ });
// Closing JavaChild's InputStream will cause all children to exit
p1.getOutputStream().close();
@@ -185,15 +212,12 @@
}
p1.waitFor(); // wait for spawned process to exit
- List<ProcessHandle> remaining = getChildren(self);
- remaining.forEach(ph -> Assert.assertFalse(ph.isAlive(),
+ // Verify spawned processes are no longer alive
+ processes.forEach((ph, parent) -> Assert.assertFalse(ph.isAlive(),
"process should not be alive: " + ph));
} catch (IOException | InterruptedException t) {
t.printStackTrace();
throw new RuntimeException(t);
- } finally {
- // Cleanup any left over processes
- destroyProcessTree(ProcessHandle.current());
}
}
@@ -202,6 +226,8 @@
*/
@Test
public static void test3() {
+ ConcurrentHashMap<ProcessHandle, ProcessHandle> processes = new ConcurrentHashMap<>();
+
try {
ProcessHandle self = ProcessHandle.current();
@@ -209,44 +235,53 @@
ProcessHandle p1Handle = p1.toHandle();
printf(" p1: %s%n", p1.getPid());
- List<ProcessHandle> subprocesses = getChildren(self);
- long count = subprocesses.size();
- Assert.assertEquals(count, 1, "Wrong number of spawned children");
-
int newChildren = 3;
// Spawn children and have them wait
p1.sendAction("spawn", newChildren, "stdin");
+ // Gather the PIDs from the output of the spawing process
+ p1.forEachOutputLine((s) -> {
+ String[] split = s.trim().split(" ");
+ if (split.length == 3 && split[1].equals("spawn")) {
+ Long child = Long.valueOf(split[2]);
+ Long parent = Long.valueOf(split[0].split(":")[0]);
+ processes.put(ProcessHandle.of(child).get(), ProcessHandle.of(parent).get());
+ }
+ });
+
// Wait for the new processes and save the list
- subprocesses = waitForAllChildren(p1Handle, newChildren);
- Assert.assertEquals(subprocesses.size(), newChildren, "Wrong number of children");
-
- p1.children().filter(TreeTest::isNotWindowsConsole)
- .forEach(ProcessHandle::destroyForcibly);
+ List<ProcessHandle> allChildren = waitForAllChildren(p1Handle, newChildren);
- self.children().filter(TreeTest::isNotWindowsConsole)
- .forEach(ProcessHandle::destroyForcibly);
+ // Verify that all spawned children are alive, show up in the allChildren list
+ // then destroy them
+ processes.forEach((p, parent) -> {
+ Assert.assertEquals(p.isAlive(), true, "Child should be alive: " + p);
+ Assert.assertTrue(allChildren.contains(p), "Spawned child should be listed in allChildren: " + p);
+ p.destroyForcibly();
+ });
- for (ProcessHandle p : subprocesses) {
+ processes.forEach((p, parent) -> {
while (p.isAlive()) {
- Thread.sleep(100L); // It will happen but don't burn the cpu
+ try {
+ Thread.sleep(100L); // It will happen but don't burn the cpu
+ } catch (InterruptedException ie) {
+ // try again
+ }
}
- }
+ });
+ p1.destroyForcibly();
+ p1.waitFor();
List<ProcessHandle> remaining = getAllChildren(self);
- remaining.retainAll(subprocesses);
- if (remaining.size() > 0) {
- remaining.forEach(p -> printProcess(p, " remaining: "));
- Assert.fail("Subprocess(es) should have exited");
- }
+ remaining = remaining.stream().filter(processes::contains).collect(Collectors.toList());
+ Assert.assertEquals(remaining.size(), 0, "Subprocess(es) should have exited: " + remaining);
} catch (IOException ioe) {
Assert.fail("Spawn of subprocess failed", ioe);
} catch (InterruptedException inte) {
Assert.fail("InterruptedException", inte);
} finally {
- // Cleanup any left over processes
- destroyProcessTree(ProcessHandle.current());
+ processes.forEach((p, parent) -> p.destroyForcibly());
}
}
@@ -302,9 +337,10 @@
@Test
public static void test5() {
int factor = 2;
+ JavaChild p1 = null;
Instant start = Instant.now();
try {
- JavaChild p1 = JavaChild.spawnJavaChild("stdin");
+ p1 = JavaChild.spawnJavaChild("stdin");
ProcessHandle p1Handle = p1.toHandle();
printf("Spawning %d x %d x %d processes, pid: %d%n",
@@ -340,7 +376,9 @@
Assert.fail("Unexpected Exception", ex);
} finally {
printf("Duration: %s%n", Duration.between(start, Instant.now()));
- destroyProcessTree(ProcessHandle.current());
+ if (p1 != null) {
+ p1.destroyForcibly();
+ }
}
}
--- a/jdk/test/java/lang/Runtime/exec/ExitValue.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/lang/Runtime/exec/ExitValue.java Fri Sep 25 12:04:35 2015 -0700
@@ -72,7 +72,7 @@
expectedExitValue);
}
- final static int EXIT_CODE = 5;
+ static final int EXIT_CODE = 5;
public static void main(String[] args) throws Exception {
if (! UnixCommands.isUnix) {
--- a/jdk/test/java/lang/SecurityManager/CheckPackageMatching.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/lang/SecurityManager/CheckPackageMatching.java Fri Sep 25 12:04:35 2015 -0700
@@ -55,7 +55,7 @@
* PackageMatcher implements a state machine that matches package
* names against packages parsed from the package access list.
*/
- private static abstract class PackageMatcher {
+ private abstract static class PackageMatcher {
// For each state, chars[state] contains the chars that matches.
private final char[][] chars;
// For each state, states[state][i] contains the next state to go
--- a/jdk/test/java/lang/String/StringContentEqualsBug.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/lang/String/StringContentEqualsBug.java Fri Sep 25 12:04:35 2015 -0700
@@ -28,7 +28,7 @@
*/
public class StringContentEqualsBug {
- static abstract class Task extends Thread {
+ abstract static class Task extends Thread {
volatile StringBuffer sb;
volatile Exception exception;
--- a/jdk/test/java/lang/String/StringJoinTest.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/lang/String/StringJoinTest.java Fri Sep 25 12:04:35 2015 -0700
@@ -34,17 +34,17 @@
@Test(groups = {"unit","string","lang","libs"})
public class StringJoinTest {
- private final static String DASH = "-";
- private final static String BEGIN = "Hi there";
- private final static String JIM = "Jim";
- private final static String JOHN = "John";
- private final static String AND_JOE = "and Joe";
- private final static String BILL = "Bill";
- private final static String BOB = "Bob";
- private final static String AND_BO = "and Bo";
- private final static String ZEKE = "Zeke";
- private final static String ZACK = "Zack";
- private final static String AND_ZOE = "and Zoe";
+ private static final String DASH = "-";
+ private static final String BEGIN = "Hi there";
+ private static final String JIM = "Jim";
+ private static final String JOHN = "John";
+ private static final String AND_JOE = "and Joe";
+ private static final String BILL = "Bill";
+ private static final String BOB = "Bob";
+ private static final String AND_BO = "and Bo";
+ private static final String ZEKE = "Zeke";
+ private static final String ZACK = "Zack";
+ private static final String AND_ZOE = "and Zoe";
/**
* Tests the join() methods on String
--- a/jdk/test/java/lang/StringBuffer/BufferForwarding.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/lang/StringBuffer/BufferForwarding.java Fri Sep 25 12:04:35 2015 -0700
@@ -32,10 +32,10 @@
import java.util.List;
public class BufferForwarding {
- private final static String A_STRING_BUFFER_VAL = "aStringBuffer";
- private final static String A_STRING_BUILDER_VAL = "aStringBuilder";
- private final static String A_STRING_VAL = "aString";
- private final static String NON_EMPTY_VAL = "NonEmpty";
+ private static final String A_STRING_BUFFER_VAL = "aStringBuffer";
+ private static final String A_STRING_BUILDER_VAL = "aStringBuilder";
+ private static final String A_STRING_VAL = "aString";
+ private static final String NON_EMPTY_VAL = "NonEmpty";
public BufferForwarding() {
System.out.println( "Starting BufferForwarding");
--- a/jdk/test/java/lang/StringBuilder/BuilderForwarding.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/lang/StringBuilder/BuilderForwarding.java Fri Sep 25 12:04:35 2015 -0700
@@ -32,10 +32,10 @@
import java.util.List;
public class BuilderForwarding {
- private final static String A_STRING_BUFFER_VAL = "aStringBuffer";
- private final static String A_STRING_BUILDER_VAL = "aStringBuilder";
- private final static String A_STRING_VAL = "aString";
- private final static String NON_EMPTY_VAL = "NonEmpty";
+ private static final String A_STRING_BUFFER_VAL = "aStringBuffer";
+ private static final String A_STRING_BUILDER_VAL = "aStringBuilder";
+ private static final String A_STRING_VAL = "aString";
+ private static final String NON_EMPTY_VAL = "NonEmpty";
public BuilderForwarding() {
System.out.println( "Starting BuilderForwarding");
--- a/jdk/test/java/lang/System/finalization/FinThreads.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/lang/System/finalization/FinThreads.java Fri Sep 25 12:04:35 2015 -0700
@@ -44,7 +44,7 @@
/* Instances are only created in an auxiliary thread, in order to
guard against stray references from the current thread's stack
*/
- static public void create(final boolean catchFinalizer)
+ public static void create(final boolean catchFinalizer)
throws InterruptedException
{
Thread t = new Thread(new Runnable() {
--- a/jdk/test/java/lang/Thread/GenerifyStackTraces.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/lang/Thread/GenerifyStackTraces.java Fri Sep 25 12:04:35 2015 -0700
@@ -120,7 +120,7 @@
}
- static private void waitForDump() {
+ private static void waitForDump() {
synchronized(go) {
try {
go.wait();
@@ -130,7 +130,7 @@
}
}
- static private void finishDump() {
+ private static void finishDump() {
synchronized(go) {
try {
go.notifyAll();
--- a/jdk/test/java/lang/ThreadLocal/ImmutableLocal.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/lang/ThreadLocal/ImmutableLocal.java Fri Sep 25 12:04:35 2015 -0700
@@ -32,13 +32,13 @@
/**
* {@link ThreadLocal} guaranteed to always return the same reference.
*/
- abstract public static class ImmutableThreadLocal extends ThreadLocal {
+ public abstract static class ImmutableThreadLocal extends ThreadLocal {
public void set(final Object value) {
throw new RuntimeException("ImmutableThreadLocal set called");
}
// force override
- abstract protected Object initialValue();
+ protected abstract Object initialValue();
}
private static final ThreadLocal cache = new ImmutableThreadLocal() {
--- a/jdk/test/java/lang/annotation/typeAnnotations/GetAnnotatedInterfaces.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/lang/annotation/typeAnnotations/GetAnnotatedInterfaces.java Fri Sep 25 12:04:35 2015 -0700
@@ -76,5 +76,5 @@
interface If {}
- static abstract class Clz {}
+ abstract static class Clz {}
}
--- a/jdk/test/java/lang/annotation/typeAnnotations/GetAnnotatedSuperclass.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/lang/annotation/typeAnnotations/GetAnnotatedSuperclass.java Fri Sep 25 12:04:35 2015 -0700
@@ -94,5 +94,5 @@
interface If {}
- static abstract class Clz {}
+ abstract static class Clz {}
}
--- a/jdk/test/java/lang/instrument/ATestCaseScaffold.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/lang/instrument/ATestCaseScaffold.java Fri Sep 25 12:04:35 2015 -0700
@@ -169,7 +169,7 @@
assertEquals("Expected equality", expected, actual);
}
- public final static class
+ public static final class
TestCaseScaffoldException extends RuntimeException {
public
TestCaseScaffoldException() {
--- a/jdk/test/java/lang/invoke/6998541/Test6998541.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/lang/invoke/6998541/Test6998541.java Fri Sep 25 12:04:35 2015 -0700
@@ -136,7 +136,7 @@
throw new AssertionError();
}
- private final static MethodHandles.Lookup lookup = MethodHandles.lookup();
+ private static final MethodHandles.Lookup lookup = MethodHandles.lookup();
private static MethodHandle mh(Class ret, Class... args) {
try {
@@ -191,14 +191,14 @@
private static MethodHandle mh_z(Class ret) { return mh(ret, boolean.class); }
- private final static MethodHandle mh_zz = mh_z(boolean.class);
- private final static MethodHandle mh_bz = mh_z(byte.class );
- private final static MethodHandle mh_cz = mh_z(char.class );
- private final static MethodHandle mh_sz = mh_z(short.class );
- private final static MethodHandle mh_iz = mh_z(int.class );
- private final static MethodHandle mh_jz = mh_z(long.class );
- private final static MethodHandle mh_fz = mh_z(float.class );
- private final static MethodHandle mh_dz = mh_z(double.class );
+ private static final MethodHandle mh_zz = mh_z(boolean.class);
+ private static final MethodHandle mh_bz = mh_z(byte.class );
+ private static final MethodHandle mh_cz = mh_z(char.class );
+ private static final MethodHandle mh_sz = mh_z(short.class );
+ private static final MethodHandle mh_iz = mh_z(int.class );
+ private static final MethodHandle mh_jz = mh_z(long.class );
+ private static final MethodHandle mh_fz = mh_z(float.class );
+ private static final MethodHandle mh_dz = mh_z(double.class );
private static void boolean2prim(boolean x) throws Throwable {
int i = x ? 1 : 0;
@@ -225,14 +225,14 @@
private static MethodHandle mh_b(Class ret) { return mh(ret, byte.class); }
- private final static MethodHandle mh_zb = mh_b(boolean.class);
- private final static MethodHandle mh_bb = mh_b(byte.class );
- private final static MethodHandle mh_cb = mh_b(char.class );
- private final static MethodHandle mh_sb = mh_b(short.class );
- private final static MethodHandle mh_ib = mh_b(int.class );
- private final static MethodHandle mh_jb = mh_b(long.class );
- private final static MethodHandle mh_fb = mh_b(float.class );
- private final static MethodHandle mh_db = mh_b(double.class );
+ private static final MethodHandle mh_zb = mh_b(boolean.class);
+ private static final MethodHandle mh_bb = mh_b(byte.class );
+ private static final MethodHandle mh_cb = mh_b(char.class );
+ private static final MethodHandle mh_sb = mh_b(short.class );
+ private static final MethodHandle mh_ib = mh_b(int.class );
+ private static final MethodHandle mh_jb = mh_b(long.class );
+ private static final MethodHandle mh_fb = mh_b(float.class );
+ private static final MethodHandle mh_db = mh_b(double.class );
private static void byte2prim(byte x) throws Throwable {
assertEquals((byte) x, (byte) mh_bb.invokeExact(x)); // byte -> byte
@@ -254,14 +254,14 @@
private static MethodHandle mh_c(Class ret) { return mh(ret, char.class); }
- private final static MethodHandle mh_zc = mh_c(boolean.class);
- private final static MethodHandle mh_bc = mh_c(byte.class );
- private final static MethodHandle mh_cc = mh_c(char.class );
- private final static MethodHandle mh_sc = mh_c(short.class );
- private final static MethodHandle mh_ic = mh_c(int.class );
- private final static MethodHandle mh_jc = mh_c(long.class );
- private final static MethodHandle mh_fc = mh_c(float.class );
- private final static MethodHandle mh_dc = mh_c(double.class );
+ private static final MethodHandle mh_zc = mh_c(boolean.class);
+ private static final MethodHandle mh_bc = mh_c(byte.class );
+ private static final MethodHandle mh_cc = mh_c(char.class );
+ private static final MethodHandle mh_sc = mh_c(short.class );
+ private static final MethodHandle mh_ic = mh_c(int.class );
+ private static final MethodHandle mh_jc = mh_c(long.class );
+ private static final MethodHandle mh_fc = mh_c(float.class );
+ private static final MethodHandle mh_dc = mh_c(double.class );
private static void char2prim(char x) throws Throwable {
assertEquals((char) x, (char) mh_cc.invokeExact(x)); // char -> char
@@ -284,14 +284,14 @@
private static MethodHandle mh_s(Class ret) { return mh(ret, short.class); }
- private final static MethodHandle mh_zs = mh_s(boolean.class);
- private final static MethodHandle mh_bs = mh_s(byte.class );
- private final static MethodHandle mh_cs = mh_s(char.class );
- private final static MethodHandle mh_ss = mh_s(short.class );
- private final static MethodHandle mh_is = mh_s(int.class );
- private final static MethodHandle mh_js = mh_s(long.class );
- private final static MethodHandle mh_fs = mh_s(float.class );
- private final static MethodHandle mh_ds = mh_s(double.class );
+ private static final MethodHandle mh_zs = mh_s(boolean.class);
+ private static final MethodHandle mh_bs = mh_s(byte.class );
+ private static final MethodHandle mh_cs = mh_s(char.class );
+ private static final MethodHandle mh_ss = mh_s(short.class );
+ private static final MethodHandle mh_is = mh_s(int.class );
+ private static final MethodHandle mh_js = mh_s(long.class );
+ private static final MethodHandle mh_fs = mh_s(float.class );
+ private static final MethodHandle mh_ds = mh_s(double.class );
private static void short2prim(short x) throws Throwable {
assertEquals((short) x, (short) mh_ss.invokeExact(x)); // short -> short
@@ -314,14 +314,14 @@
private static MethodHandle mh_i(Class ret) { return mh(ret, int.class); }
- private final static MethodHandle mh_zi = mh_i(boolean.class);
- private final static MethodHandle mh_bi = mh_i(byte.class );
- private final static MethodHandle mh_ci = mh_i(char.class );
- private final static MethodHandle mh_si = mh_i(short.class );
- private final static MethodHandle mh_ii = mh_i(int.class );
- private final static MethodHandle mh_ji = mh_i(long.class );
- private final static MethodHandle mh_fi = mh_i(float.class );
- private final static MethodHandle mh_di = mh_i(double.class );
+ private static final MethodHandle mh_zi = mh_i(boolean.class);
+ private static final MethodHandle mh_bi = mh_i(byte.class );
+ private static final MethodHandle mh_ci = mh_i(char.class );
+ private static final MethodHandle mh_si = mh_i(short.class );
+ private static final MethodHandle mh_ii = mh_i(int.class );
+ private static final MethodHandle mh_ji = mh_i(long.class );
+ private static final MethodHandle mh_fi = mh_i(float.class );
+ private static final MethodHandle mh_di = mh_i(double.class );
private static void int2prim(int x) throws Throwable {
assertEquals((int) x, (int) mh_ii.invokeExact(x)); // int -> int
@@ -345,14 +345,14 @@
private static MethodHandle mh_j(Class ret) { return mh(ret, long.class); }
- private final static MethodHandle mh_zj = mh_j(boolean.class);
- private final static MethodHandle mh_bj = mh_j(byte.class );
- private final static MethodHandle mh_cj = mh_j(char.class );
- private final static MethodHandle mh_sj = mh_j(short.class );
- private final static MethodHandle mh_ij = mh_j(int.class );
- private final static MethodHandle mh_jj = mh_j(long.class );
- private final static MethodHandle mh_fj = mh_j(float.class );
- private final static MethodHandle mh_dj = mh_j(double.class );
+ private static final MethodHandle mh_zj = mh_j(boolean.class);
+ private static final MethodHandle mh_bj = mh_j(byte.class );
+ private static final MethodHandle mh_cj = mh_j(char.class );
+ private static final MethodHandle mh_sj = mh_j(short.class );
+ private static final MethodHandle mh_ij = mh_j(int.class );
+ private static final MethodHandle mh_jj = mh_j(long.class );
+ private static final MethodHandle mh_fj = mh_j(float.class );
+ private static final MethodHandle mh_dj = mh_j(double.class );
private static void long2prim(long x) throws Throwable {
assertEquals((long) x, (long) mh_jj.invokeExact(x)); // long -> long
@@ -377,14 +377,14 @@
private static MethodHandle mh_f(Class ret) { return mh(ret, float.class); }
- private final static MethodHandle mh_zf = mh_f(boolean.class);
- private final static MethodHandle mh_bf = mh_f(byte.class );
- private final static MethodHandle mh_cf = mh_f(char.class );
- private final static MethodHandle mh_sf = mh_f(short.class );
- private final static MethodHandle mh_if = mh_f(int.class );
- private final static MethodHandle mh_jf = mh_f(long.class );
- private final static MethodHandle mh_ff = mh_f(float.class );
- private final static MethodHandle mh_df = mh_f(double.class );
+ private static final MethodHandle mh_zf = mh_f(boolean.class);
+ private static final MethodHandle mh_bf = mh_f(byte.class );
+ private static final MethodHandle mh_cf = mh_f(char.class );
+ private static final MethodHandle mh_sf = mh_f(short.class );
+ private static final MethodHandle mh_if = mh_f(int.class );
+ private static final MethodHandle mh_jf = mh_f(long.class );
+ private static final MethodHandle mh_ff = mh_f(float.class );
+ private static final MethodHandle mh_df = mh_f(double.class );
private static void float2prim(float x) throws Throwable {
assertEquals((float) x, (float) mh_ff.invokeExact(x)); // float -> float
@@ -410,14 +410,14 @@
private static MethodHandle mh_d(Class ret) { return mh(ret, double.class); }
- private final static MethodHandle mh_zd = mh_d(boolean.class);
- private final static MethodHandle mh_bd = mh_d(byte.class );
- private final static MethodHandle mh_cd = mh_d(char.class );
- private final static MethodHandle mh_sd = mh_d(short.class );
- private final static MethodHandle mh_id = mh_d(int.class );
- private final static MethodHandle mh_jd = mh_d(long.class );
- private final static MethodHandle mh_fd = mh_d(float.class );
- private final static MethodHandle mh_dd = mh_d(double.class );
+ private static final MethodHandle mh_zd = mh_d(boolean.class);
+ private static final MethodHandle mh_bd = mh_d(byte.class );
+ private static final MethodHandle mh_cd = mh_d(char.class );
+ private static final MethodHandle mh_sd = mh_d(short.class );
+ private static final MethodHandle mh_id = mh_d(int.class );
+ private static final MethodHandle mh_jd = mh_d(long.class );
+ private static final MethodHandle mh_fd = mh_d(float.class );
+ private static final MethodHandle mh_dd = mh_d(double.class );
private static void double2prim(double x) throws Throwable {
assertEquals((double) x, (double) mh_dd.invokeExact(x)); // double -> double
@@ -442,14 +442,14 @@
try { float y = (float) mh_fd.invokeExact(x); fail(); } catch (ClassCastException expected) {} // double -> float
}
- private final static MethodHandle mh_zv = mh(boolean.class);
- private final static MethodHandle mh_bv = mh(byte.class );
- private final static MethodHandle mh_cv = mh(char.class );
- private final static MethodHandle mh_sv = mh(short.class );
- private final static MethodHandle mh_iv = mh(int.class );
- private final static MethodHandle mh_jv = mh(long.class );
- private final static MethodHandle mh_fv = mh(float.class );
- private final static MethodHandle mh_dv = mh(double.class );
+ private static final MethodHandle mh_zv = mh(boolean.class);
+ private static final MethodHandle mh_bv = mh(byte.class );
+ private static final MethodHandle mh_cv = mh(char.class );
+ private static final MethodHandle mh_sv = mh(short.class );
+ private static final MethodHandle mh_iv = mh(int.class );
+ private static final MethodHandle mh_jv = mh(long.class );
+ private static final MethodHandle mh_fv = mh(float.class );
+ private static final MethodHandle mh_dv = mh(double.class );
private static void void2prim(int i) throws Throwable {
assertEquals( false, (boolean) mh_zv.invokeExact()); // void -> boolean
@@ -468,14 +468,14 @@
private static MethodHandle mh_v(Class arg) { return mh(void.class, arg); }
- private final static MethodHandle mh_vz = mh_v(boolean.class);
- private final static MethodHandle mh_vb = mh_v(byte.class );
- private final static MethodHandle mh_vc = mh_v(char.class );
- private final static MethodHandle mh_vs = mh_v(short.class );
- private final static MethodHandle mh_vi = mh_v(int.class );
- private final static MethodHandle mh_vj = mh_v(long.class );
- private final static MethodHandle mh_vf = mh_v(float.class );
- private final static MethodHandle mh_vd = mh_v(double.class );
+ private static final MethodHandle mh_vz = mh_v(boolean.class);
+ private static final MethodHandle mh_vb = mh_v(byte.class );
+ private static final MethodHandle mh_vc = mh_v(char.class );
+ private static final MethodHandle mh_vs = mh_v(short.class );
+ private static final MethodHandle mh_vi = mh_v(int.class );
+ private static final MethodHandle mh_vj = mh_v(long.class );
+ private static final MethodHandle mh_vf = mh_v(float.class );
+ private static final MethodHandle mh_vd = mh_v(double.class );
private static void prim2void(int x) throws Throwable {
boolean z = ((x & 1) != 0);
--- a/jdk/test/java/lang/invoke/7157574/Test7157574.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/lang/invoke/7157574/Test7157574.java Fri Sep 25 12:04:35 2015 -0700
@@ -50,8 +50,8 @@
import static java.lang.invoke.MethodType.*;
public class Test7157574 {
interface Intf { void ig1(); void ig2(); void ig3(); void ig4(); void m1(); }
- static abstract class Super implements Intf { public abstract void m2(); public int f2; }
- static abstract class Sub extends Super { }
+ abstract static class Super implements Intf { public abstract void m2(); public int f2; }
+ abstract static class Sub extends Super { }
public static void main(String... av) throws Throwable {
MethodHandle m1 = lookup().findVirtual(Sub.class, "m1", methodType(void.class));
System.out.println(m1);
--- a/jdk/test/java/lang/invoke/7196190/ClassForNameTest.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/lang/invoke/7196190/ClassForNameTest.java Fri Sep 25 12:04:35 2015 -0700
@@ -35,7 +35,7 @@
import java.util.Arrays;
public class ClassForNameTest {
- final static String NAME = ClassForNameTest.class.getName();
+ static final String NAME = ClassForNameTest.class.getName();
public static void main(String[] args) throws Throwable {
{
--- a/jdk/test/java/lang/invoke/7196190/GetUnsafeTest.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/lang/invoke/7196190/GetUnsafeTest.java Fri Sep 25 12:04:35 2015 -0700
@@ -35,7 +35,7 @@
import java.util.Arrays;
public class GetUnsafeTest {
- final static String NAME = "sun.misc.Unsafe";
+ static final String NAME = "sun.misc.Unsafe";
private static boolean isTestFailed = false;
--- a/jdk/test/java/lang/invoke/AccessControlTest.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/lang/invoke/AccessControlTest.java Fri Sep 25 12:04:35 2015 -0700
@@ -459,29 +459,29 @@
static Lookup lookup_in_self() {
return MethodHandles.lookup();
}
- static public void pub_in_self() { }
- static protected void pro_in_self() { }
+ public static void pub_in_self() { }
+ protected static void pro_in_self() { }
static /*package*/ void pkg_in_self() { }
- static private void pri_in_self() { }
+ private static void pri_in_self() { }
static class Inner_nestmate {
static Lookup lookup_in_nestmate() {
return MethodHandles.lookup();
}
- static public void pub_in_nestmate() { }
- static protected void pro_in_nestmate() { }
+ public static void pub_in_nestmate() { }
+ protected static void pro_in_nestmate() { }
static /*package*/ void pkg_in_nestmate() { }
- static private void pri_in_nestmate() { }
+ private static void pri_in_nestmate() { }
}
}
class AccessControlTest_sibling {
static Lookup lookup_in_sibling() {
return MethodHandles.lookup();
}
- static public void pub_in_sibling() { }
- static protected void pro_in_sibling() { }
+ public static void pub_in_sibling() { }
+ protected static void pro_in_sibling() { }
static /*package*/ void pkg_in_sibling() { }
- static private void pri_in_sibling() { }
+ private static void pri_in_sibling() { }
}
// This guy tests access from outside the package:
--- a/jdk/test/java/lang/invoke/AccessControlTest_subpkg/Acquaintance_remote.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/lang/invoke/AccessControlTest_subpkg/Acquaintance_remote.java Fri Sep 25 12:04:35 2015 -0700
@@ -16,27 +16,27 @@
public static Lookup lookup_in_remote() {
return MethodHandles.lookup();
}
- static public void pub_in_remote() { }
- static protected void pro_in_remote() { }
+ public static void pub_in_remote() { }
+ protected static void pro_in_remote() { }
static /*package*/ void pkg_in_remote() { }
- static private void pri_in_remote() { }
+ private static void pri_in_remote() { }
- static public class Remote_subclass extends AccessControlTest {
+ public static class Remote_subclass extends AccessControlTest {
static Lookup lookup_in_subclass() {
return MethodHandles.lookup();
}
- static public void pub_in_subclass() { }
- static protected void pro_in_subclass() { }
+ public static void pub_in_subclass() { }
+ protected static void pro_in_subclass() { }
static /*package*/ void pkg_in_subclass() { }
- static private void pri_in_subclass() { }
+ private static void pri_in_subclass() { }
}
static /*package*/ class Remote_hidden {
static Lookup lookup_in_hidden() {
return MethodHandles.lookup();
}
- static public void pub_in_hidden() { }
- static protected void pro_in_hidden() { }
+ public static void pub_in_hidden() { }
+ protected static void pro_in_hidden() { }
static /*package*/ void pkg_in_hidden() { }
- static private void pri_in_hidden() { }
+ private static void pri_in_hidden() { }
}
}
--- a/jdk/test/java/lang/invoke/CallSiteTest.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/lang/invoke/CallSiteTest.java Fri Sep 25 12:04:35 2015 -0700
@@ -43,7 +43,7 @@
import static java.lang.invoke.MethodType.*;
public class CallSiteTest {
- private final static Class<?> CLASS = CallSiteTest.class;
+ private static final Class<?> CLASS = CallSiteTest.class;
private static CallSite mcs;
private static CallSite vcs;
@@ -66,9 +66,9 @@
testVolatileCallSite();
}
- private final static int N = Integer.MAX_VALUE / 100;
- private final static int RESULT1 = 762786192;
- private final static int RESULT2 = -21474836;
+ private static final int N = Integer.MAX_VALUE / 100;
+ private static final int RESULT1 = 762786192;
+ private static final int RESULT2 = -21474836;
private static void assertEquals(int expected, int actual) {
if (expected != actual)
--- a/jdk/test/java/lang/invoke/JavaDocExamplesTest.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/lang/invoke/JavaDocExamplesTest.java Fri Sep 25 12:04:35 2015 -0700
@@ -75,14 +75,14 @@
{}
-static final private Lookup LOOKUP = lookup();
+private static final Lookup LOOKUP = lookup();
// static final private MethodHandle CONCAT_1 = LOOKUP.findVirtual(String.class,
// "concat", methodType(String.class, String.class));
// static final private MethodHandle HASHCODE_1 = LOOKUP.findVirtual(Object.class,
// "hashCode", methodType(int.class));
// form required if ReflectiveOperationException is intercepted:
- static final private MethodHandle CONCAT_2, HASHCODE_2, ADD_2, SUB_2;
+ private static final MethodHandle CONCAT_2, HASHCODE_2, ADD_2, SUB_2;
static {
try {
Class<?> THIS_CLASS = LOOKUP.lookupClass();
--- a/jdk/test/java/lang/invoke/LFCaching/LambdaFormTestCase.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/lang/invoke/LFCaching/LambdaFormTestCase.java Fri Sep 25 12:04:35 2015 -0700
@@ -50,9 +50,9 @@
* Reflection link to {@code j.l.i.MethodHandle.internalForm} method. It is
* used to get a lambda form from a method handle.
*/
- protected final static Method INTERNAL_FORM;
- protected final static Field DEBUG_NAME;
- protected final static Field REF_FIELD;
+ protected static final Method INTERNAL_FORM;
+ protected static final Field DEBUG_NAME;
+ protected static final Field REF_FIELD;
private static final List<GarbageCollectorMXBean> gcInfo;
private static long gcCount() {
--- a/jdk/test/java/lang/invoke/MethodHandles/TestCatchException.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/lang/invoke/MethodHandles/TestCatchException.java Fri Sep 25 12:04:35 2015 -0700
@@ -35,8 +35,8 @@
import static org.junit.Assert.*;
public class TestCatchException {
- final static MethodHandles.Lookup LOOKUP = MethodHandles.lookup();
- final static MethodType M_TYPE = MethodType.methodType(int.class, Object.class, Object.class, int.class, int.class, int.class, int.class, int.class, int.class, int.class);
+ static final MethodHandles.Lookup LOOKUP = MethodHandles.lookup();
+ static final MethodType M_TYPE = MethodType.methodType(int.class, Object.class, Object.class, int.class, int.class, int.class, int.class, int.class, int.class, int.class);
private static int noThrow(Object o1, Object o2, int i1, int i2, int i3, int i4, int i5, int i6, int i7) {
return 42;
@@ -72,8 +72,8 @@
assertEquals(x, 17);
}
- final static Object masterParam = new Object();
- final static Object[] masterTail = new Object[] { "str" };
+ static final Object masterParam = new Object();
+ static final Object[] masterTail = new Object[] { "str" };
static Exception masterEx = new Exception();
public static Object m1(Object o1, Object o2, Object o3, Object o4, Object o5,
--- a/jdk/test/java/lang/invoke/MethodHandlesTest.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/lang/invoke/MethodHandlesTest.java Fri Sep 25 12:04:35 2015 -0700
@@ -497,7 +497,7 @@
}
/** Is findVirtual (etc.) of "<init<" supposed to elicit a NoSuchMethodException? */
- final static boolean INIT_REF_CAUSES_NSME = true;
+ static final boolean INIT_REF_CAUSES_NSME = true;
@Test
public void testFindStatic() throws Throwable {
--- a/jdk/test/java/lang/invoke/indify/Indify.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/lang/invoke/indify/Indify.java Fri Sep 25 12:04:35 2015 -0700
@@ -1220,7 +1220,7 @@
for (Object x : data) writeOutput(out, x);
}
- public static abstract class Outer {
+ public abstract static class Outer {
public abstract List<? extends Inner> inners();
protected void linkInners() {
for (Inner i : inners()) {
@@ -1250,7 +1250,7 @@
}
}
public interface Inner { Outer outer(); void linkOuter(Outer o); }
- public static abstract class InnerOuter extends Outer implements Inner {
+ public abstract static class InnerOuter extends Outer implements Inner {
public Outer outer;
public Outer outer() { return outer; }
public void linkOuter(Outer o) { assert(outer == null); outer = o; }
--- a/jdk/test/java/lang/management/MemoryMXBean/GetMBeanInfo.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/lang/management/MemoryMXBean/GetMBeanInfo.java Fri Sep 25 12:04:35 2015 -0700
@@ -35,7 +35,7 @@
import javax.management.*;
public class GetMBeanInfo {
- private final static int EXPECTED_NOTIF_TYPES = 2;
+ private static final int EXPECTED_NOTIF_TYPES = 2;
private static int count = 0;
public static void main(String argv[]) throws Exception {
--- a/jdk/test/java/lang/management/MemoryMXBean/Pending.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/lang/management/MemoryMXBean/Pending.java Fri Sep 25 12:04:35 2015 -0700
@@ -39,9 +39,9 @@
import java.lang.management.*;
public class Pending {
- final static int NO_REF_COUNT = 600;
- final static int REF_COUNT = 500;
- final static int TOTAL_FINALIZABLE = (NO_REF_COUNT + REF_COUNT);
+ static final int NO_REF_COUNT = 600;
+ static final int REF_COUNT = 500;
+ static final int TOTAL_FINALIZABLE = (NO_REF_COUNT + REF_COUNT);
private static int finalized = 0;
private static MemoryMXBean mbean
= ManagementFactory.getMemoryMXBean();
--- a/jdk/test/java/lang/management/RuntimeMXBean/UpTime.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/lang/management/RuntimeMXBean/UpTime.java Fri Sep 25 12:04:35 2015 -0700
@@ -32,9 +32,9 @@
import java.lang.management.*;
public class UpTime {
- final static long DELAY = 5; // Seconds
- final static long TIMEOUT = 30; // Minutes
- final static long MULTIPLIER = 1000; // millisecond ticks
+ static final long DELAY = 5; // Seconds
+ static final long TIMEOUT = 30; // Minutes
+ static final long MULTIPLIER = 1000; // millisecond ticks
private static final RuntimeMXBean metrics
= ManagementFactory.getRuntimeMXBean();
--- a/jdk/test/java/lang/management/ThreadMXBean/AllThreadIds.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/lang/management/ThreadMXBean/AllThreadIds.java Fri Sep 25 12:04:35 2015 -0700
@@ -57,9 +57,9 @@
}
}
- final static int DAEMON_THREADS = 20;
- final static int USER_THREADS = 5;
- final static int ALL_THREADS = DAEMON_THREADS + USER_THREADS;
+ static final int DAEMON_THREADS = 20;
+ static final int USER_THREADS = 5;
+ static final int ALL_THREADS = DAEMON_THREADS + USER_THREADS;
private static final boolean live[] = new boolean[ALL_THREADS];
private static final Thread allThreads[] = new Thread[ALL_THREADS];
private static final ThreadMXBean mbean = ManagementFactory.getThreadMXBean();
--- a/jdk/test/java/lang/management/ThreadMXBean/ThreadBlockedCount.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/lang/management/ThreadMXBean/ThreadBlockedCount.java Fri Sep 25 12:04:35 2015 -0700
@@ -35,8 +35,8 @@
import java.util.concurrent.Phaser;
public class ThreadBlockedCount {
- final static long EXPECTED_BLOCKED_COUNT = 3;
- final static int DEPTH = 10;
+ static final long EXPECTED_BLOCKED_COUNT = 3;
+ static final int DEPTH = 10;
private static final ThreadMXBean mbean
= ManagementFactory.getThreadMXBean();
--- a/jdk/test/java/lang/management/ThreadMXBean/ThreadCounts.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/lang/management/ThreadMXBean/ThreadCounts.java Fri Sep 25 12:04:35 2015 -0700
@@ -37,11 +37,11 @@
import java.lang.management.*;
public class ThreadCounts {
- final static int DAEMON_THREADS = 21;
- final static int USER_THREADS_1 = 11;
- final static int USER_THREADS_2 = 9;
- final static int USER_THREADS = USER_THREADS_1 + USER_THREADS_2;
- final static int ALL_THREADS = DAEMON_THREADS + USER_THREADS;
+ static final int DAEMON_THREADS = 21;
+ static final int USER_THREADS_1 = 11;
+ static final int USER_THREADS_2 = 9;
+ static final int USER_THREADS = USER_THREADS_1 + USER_THREADS_2;
+ static final int ALL_THREADS = DAEMON_THREADS + USER_THREADS;
private static volatile boolean live[] = new boolean[ALL_THREADS];
private ThreadMXBean mbean = ManagementFactory.getThreadMXBean();
private static boolean testFailed = false;
--- a/jdk/test/java/lang/ref/ReferenceEnqueuePending.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/lang/ref/ReferenceEnqueuePending.java Fri Sep 25 12:04:35 2015 -0700
@@ -38,9 +38,9 @@
}
}
- final static boolean debug = System.getProperty("test.debug") != null;
- final static int iterations = 1000;
- final static int gc_trigger = 99;
+ static final boolean debug = System.getProperty("test.debug") != null;
+ static final int iterations = 1000;
+ static final int gc_trigger = 99;
static int[] a = new int[2 * iterations];
// Keep all weak references alive with the following array.
static NumberedWeakReference[] b = new NumberedWeakReference[iterations];
--- a/jdk/test/java/lang/ref/SoftReference/Bash.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/lang/ref/SoftReference/Bash.java Fri Sep 25 12:04:35 2015 -0700
@@ -49,8 +49,8 @@
}
- final static int NUM_BLOCKS = 2048;
- final static int BLOCK_SIZE = 32768;
+ static final int NUM_BLOCKS = 2048;
+ static final int BLOCK_SIZE = 32768;
public static void main(String[] args) throws Exception {
--- a/jdk/test/java/lang/ref/SoftReference/Pin.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/lang/ref/SoftReference/Pin.java Fri Sep 25 12:04:35 2015 -0700
@@ -34,8 +34,8 @@
public class Pin {
- final static int NUM_BLOCKS = 128;
- final static int BLOCK_SIZE = 32768;
+ static final int NUM_BLOCKS = 128;
+ static final int BLOCK_SIZE = 32768;
public static void main(String[] args) throws Exception {
--- a/jdk/test/java/lang/reflect/Field/GenericStringTest.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/lang/reflect/Field/GenericStringTest.java Fri Sep 25 12:04:35 2015 -0700
@@ -64,7 +64,7 @@
int field1;
@ExpectedString("private static java.lang.String TestClass1.field2")
- static private String field2;
+ private static String field2;
}
class TestClass2<E> {
--- a/jdk/test/java/lang/reflect/Method/defaultMethodModeling/DefaultMethodModeling.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/lang/reflect/Method/defaultMethodModeling/DefaultMethodModeling.java Fri Sep 25 12:04:35 2015 -0700
@@ -145,7 +145,7 @@
abstract class Base {
@ExpectedModel(modifiers=PUBLIC|ABSTRACT, declaringClass=Base.class)
- abstract public void baz();
+ public abstract void baz();
@ExpectedModel(declaringClass=Base.class)
public void quux() {;}
--- a/jdk/test/java/lang/reflect/Proxy/nonPublicProxy/NonPublicProxyClass.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/lang/reflect/Proxy/nonPublicProxy/NonPublicProxyClass.java Fri Sep 25 12:04:35 2015 -0700
@@ -127,7 +127,7 @@
return policy.grant;
}
- private final static String NEW_PROXY_IN_PKG = "newProxyInPackage.";
+ private static final String NEW_PROXY_IN_PKG = "newProxyInPackage.";
private void newProxyInstance() {
// expect newProxyInstance to succeed if it's in the same runtime package
int i = proxyClass.getName().lastIndexOf('.');
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/security/KeyStore/CheckInputStream.java Fri Sep 25 12:04:35 2015 -0700
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * 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 8136534
+ * @summary The input stream supplied to KeyStore.load should remain open.
+ */
+
+import java.io.*;
+import java.security.*;
+
+public class CheckInputStream {
+ private final static String DIR = System.getProperty("test.src", ".");
+ private static final char[] PASSWORD = "passphrase".toCharArray();
+ private static final String KEYSTORE = DIR + "/keystore.jks";
+
+ public static final void main(String[] args) throws Exception {
+
+ KeyStore keystore = KeyStore.getInstance("JKS");
+ try (FileInputStream inStream = new FileInputStream(KEYSTORE)) {
+ System.out.println("Loading JKS keystore: " + KEYSTORE);
+ keystore.load(inStream, PASSWORD);
+ // check that the stream is still open
+ inStream.available();
+ System.out.println("OK");
+ }
+ }
+}
--- a/jdk/test/java/security/KeyStore/TestKeyStoreBasic.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/security/KeyStore/TestKeyStoreBasic.java Fri Sep 25 12:04:35 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -21,36 +21,97 @@
* questions.
*/
-import static java.lang.System.out;
-
+import java.io.BufferedInputStream;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
+import java.io.InputStream;
+import java.security.KeyFactory;
import java.security.KeyStore;
import java.security.KeyStoreException;
-import java.security.Provider;
-import java.security.Security;
-import javax.crypto.SecretKey;
-import javax.crypto.spec.SecretKeySpec;
+import java.security.NoSuchProviderException;
+import java.security.PrivateKey;
+import java.security.UnrecoverableKeyException;
+import java.security.cert.Certificate;
+import java.security.cert.CertificateFactory;
+import java.security.spec.KeySpec;
+import java.security.spec.PKCS8EncodedKeySpec;
+import java.util.Base64;
/*
* @test
- * @bug 8048621
- * @summary Test the basic operations of KeyStore, provided by SunJCE (jceks),
- * and SunPKCS11-Solaris(PKCS11KeyStore)
+ * @bug 8048621 8133090
+ * @summary Test basic operations with keystores (jks, jceks, pkcs12)
* @author Yu-Ching Valerie PENG
*/
+public class TestKeyStoreBasic {
-public class TestKeyStoreBasic {
+ private static final String PRIVATE_KEY_PKCS8_BASE64 = ""
+ + "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCpyz97liuWPDYcLH9TX8BiT78o"
+ + "lCmAfmevvch6ncXUVuCzbdaKuKXwn4EVbDszsVJLoK5zdtP+X3iDhutj+IgKmLhuczF3M9VIcWr+"
+ + "JJUyTH4+3h/RT8cjCDZOmk9iXkb5ifruVsLqzb9g+Vp140Oz7leikne7KmclHvTfvFd0WDI7Gb9v"
+ + "o4f5rT717BXJ/n+M6pNk8DLpLiEu6eziYvXRv5x+t5Go3x0eCXdaxEQUf2j876Wfr2qHRJK7lDfF"
+ + "e1DDsMg/KpKGiILYZ+g2qtVMZSxtp5BZEtfB5qV/IE5kWO+mCIAGpXSZIdbERR6pZUq8GLEe1T9e"
+ + "+sO6H24w2F19AgMBAAECggEBAId/12187dO6wUPCjumuJA1QrrBnbKdKONyai36uoc1Od4s5QFj7"
+ + "+hEIeS7rbGNYQuBvnkgusAbzkW0FIpxpHce3EJez/emux6pEOKoP77BwMt9gy+txyu0+BHi91FQg"
+ + "AGvrnQDO5EYVY4Cz/WjOsJzKu8zVLg+DS0Toa2qRFwmUe9mVAXPNOCZ3Oae/Q6tCDsaINNw0fmjj"
+ + "jn6uohPbS+n6xENG3FkQXB36getXy310xTGED2J27cmAQH6gLR6Kl2iROzNPbbpBqbuemI9kbcld"
+ + "EwBS1jRfZWeaPstYA1niVrE9UgUBzemnoh4TDkG076sYthHMr5QFGjPswnwtJ4ECgYEA0sURQ5+v"
+ + "baH4tdaemI3qpnknXTlzSpuZZmAoyvY0Id0mlduwKwmZ3Y5989wHfnnhFfyNO4IkTKjI2Wp97qP5"
+ + "4eqUNpA7FtNU7KUzMcFDTtwtNZuRYMrKlqo2lLbA+gVrAYpYZFL4b7tcwtX4DnYorDsmude6W8sG"
+ + "4Mx2VdFJC9UCgYEAzjsdXCYH5doWUHb0dvn9ID7IikffEMRM720MRjrnnnVbpzx6ACntkPDNZg7p"
+ + "TRE/mx7iBz81ZaUWE+V0wd0JvCHEdpAz3mksyvDFhU4Bgs6xzf2pSul5muhsx3hHcvvPezz5Bnxs"
+ + "faJlzkxfwotyGmvWN15GA/pyfsZjsbbTpwkCgYAO6NnbysQCIV8SnegCKqfatt9N/O5m7LLhRxQb"
+ + "p2bwrlA4cZ34rWkw/w9x3LK7A6wkfgUPnJkswxPSLXJTG05l6M4rPfCwIKr1Qopojp9QSMr569NQ"
+ + "4YeLOOc7heIIzbFQHpU6I5Rncv2Q2sn9W+ZsqJKIuvX34FjQNiZ406EzMQKBgHSxOGS61D84DuZK"
+ + "2Ps1awhC3kB4eHzJRms3vflDPWoJJ+pSKwpKrzUTPHXiPBqyhtYkPGszVeiE6CAr9sv3YZnFVaBs"
+ + "6hyQUJsob+uE/w/gGvXe8VsFDx0bJOodYfhrCbTHBHWqE81nBcocpxayxsayfAzqWB3KKd0YLrMR"
+ + "K2PZAoGAcZa8915R2m0KZ6HVJUt/JDR85jCbN71kcVDFY2XSFkOJvOdFoHNfRckfLzjq9Y2MSSTV"
+ + "+QDWbDo2doUQCejJUTaN8nP79tfyir24X5uVPvQaeVoGTKYb+LfUqK0F60lStmjuddIGSZH55y3v"
+ + "+9XjmxbVERtd1lqgQg3VlmKlEXY=";
+
+ /*
+ * Certificate:
+ * Data:
+ * Version: 3 (0x2)
+ * Serial Number: 7 (0x7)
+ * Signature Algorithm: sha512WithRSAEncryption
+ * Issuer: CN=Root
+ * Validity
+ * Not Before: Sep 1 18:03:59 2015 GMT
+ * Not After : Jan 17 18:03:59 2043 GMT
+ * Subject: CN=EE
+ */
+ private static final String CERTIFICATE = ""
+ + "-----BEGIN CERTIFICATE-----\n"
+ + "MIIDHTCCAgWgAwIBAgIBBzANBgkqhkiG9w0BAQ0FADAPMQ0wCwYDVQQDDARSb290\n"
+ + "MB4XDTE1MDkwMTE4MDM1OVoXDTQzMDExNzE4MDM1OVowDTELMAkGA1UEAwwCRUUw\n"
+ + "ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCpyz97liuWPDYcLH9TX8Bi\n"
+ + "T78olCmAfmevvch6ncXUVuCzbdaKuKXwn4EVbDszsVJLoK5zdtP+X3iDhutj+IgK\n"
+ + "mLhuczF3M9VIcWr+JJUyTH4+3h/RT8cjCDZOmk9iXkb5ifruVsLqzb9g+Vp140Oz\n"
+ + "7leikne7KmclHvTfvFd0WDI7Gb9vo4f5rT717BXJ/n+M6pNk8DLpLiEu6eziYvXR\n"
+ + "v5x+t5Go3x0eCXdaxEQUf2j876Wfr2qHRJK7lDfFe1DDsMg/KpKGiILYZ+g2qtVM\n"
+ + "ZSxtp5BZEtfB5qV/IE5kWO+mCIAGpXSZIdbERR6pZUq8GLEe1T9e+sO6H24w2F19\n"
+ + "AgMBAAGjgYUwgYIwNAYDVR0fBC0wKzApoCegJYYjbGRhcDovL2xkYXAuaG9zdC5m\n"
+ + "b3IuY3JsZHAvbWFpbi5jcmwwSgYIKwYBBQUHAQEEPjA8MDoGCCsGAQUFBzAChi5s\n"
+ + "ZGFwOi8vbGRhcC5ob3N0LmZvci5haWEvZGM9Um9vdD9jQUNlcnRpZmljYXRlMA0G\n"
+ + "CSqGSIb3DQEBDQUAA4IBAQBWDfZHpuUx0yn5d3+BuztFqoks1MkGdk+USlH0TB1/\n"
+ + "gWWBd+4S4PCKlpSur0gj2rMW4fP5HQfNlHci8JV8/bG4KuKRAXW56dg1818Hl3pc\n"
+ + "iIrUSRn8uUjH3p9qb+Rb/u3mmVQRyJjN2t/zceNsO8/+Dd808OB9aEwGs8lMT0nn\n"
+ + "ZYaaAqYz1GIY/Ecyx1vfEZEQ1ljo6i/r70C3igbypBUShxSiGsleiVTLOGNA+MN1\n"
+ + "/a/Qh0bkaQyTGqK3bwvzzMeQVqWu2EWTBD/PmND5ExkpRICdv8LBVXfLnpoBr4lL\n"
+ + "hnxn9+e0Ah+t8dS5EKfn44w5bI5PCu2bqxs6RCTxNjcY\n"
+ + "-----END CERTIFICATE-----\n";
+
private static final char[] PASSWD2 = new char[] {
'b', 'o', 'r', 'e', 'd'
};
- private static final char[] PASSWDK = new String("cannot be null")
+ private static final char[] PASSWDK = "cannot be null"
.toCharArray();
private static final String[] KS_Type = {
"jks", "jceks", "pkcs12", "PKCS11KeyStore"
};
- private static final String[] PRO_TYPE = {
+ private static final String[] PROVIDERS = {
"SUN", "SunJCE", "SunJSSE", "SunPKCS11-Solaris"
};
private static final String ALIAS_HEAD = "test";
@@ -61,41 +122,58 @@
}
public void run() throws Exception {
- Provider[] providers = Security.getProviders();
- for (Provider p: providers) {
- String prvName = p.getName();
- if (prvName.startsWith("SunJCE")
- || prvName.startsWith("SunPKCS11-Solaris")) {
- try {
- runTest(p);
- out.println("Test with provider " + p.getName() + ""
- + " passed");
- } catch (java.security.KeyStoreException e) {
- if (prvName.startsWith("SunPKCS11-Solaris")) {
- out.println("KeyStoreException is expected "
- + "PKCS11KeyStore is invalid keystore type.");
- e.printStackTrace();
- } else {
- throw e;
- }
+ for (String provider : PROVIDERS) {
+ try {
+ runTest(provider);
+ System.out.println("Test with provider " + provider + "passed");
+ } catch (java.security.KeyStoreException e) {
+ if (provider.equals("SunPKCS11-Solaris")) {
+ System.out.println("KeyStoreException is expected: "
+ + "PKCS11KeyStore is invalid keystore type: " + e);
+ } else {
+ throw e;
+ }
+ } catch (NoSuchProviderException e) {
+ String osName = System.getProperty("os.name");
+ if (provider.equals("SunPKCS11-Solaris")
+ && !osName.equals("SunOS")) {
+ System.out.println("Skip SunPKCS11-Solaris provider on "
+ + osName);
+ } else {
+ throw e;
}
}
}
}
- public void runTest(Provider p) throws Exception {
- SecretKey key = new SecretKeySpec(
- new String("No one knows").getBytes(), "PBE");
+ public void runTest(String provider) throws Exception {
+
+ // load private key
+ // all keystore types should support private keys
+ KeySpec spec = new PKCS8EncodedKeySpec(
+ Base64.getMimeDecoder().decode(PRIVATE_KEY_PKCS8_BASE64));
+ PrivateKey privateKey = KeyFactory.getInstance("RSA")
+ .generatePrivate(spec);
+
+ // load x509 certificate
+ Certificate cert;
+ try (InputStream is = new BufferedInputStream(
+ new ByteArrayInputStream(CERTIFICATE.getBytes()))) {
+ cert = CertificateFactory.getInstance("X.509")
+ .generateCertificate(is);
+ }
+
int numEntries = 5;
- String proName = p.getName();
String type = null;
- for (int i = 0; i < PRO_TYPE.length; i++) {
- if (proName.compareTo(PRO_TYPE[i]) == 0) {
+ for (int i = 0; i < PROVIDERS.length; i++) {
+ if (provider.compareTo(PROVIDERS[i]) == 0) {
type = KS_Type[i];
break;
}
}
- KeyStore ks = KeyStore.getInstance(type, p);
+
+ System.out.printf("Test %s provider and %s keystore%n", provider, type);
+ KeyStore ks = KeyStore.getInstance(type, provider);
KeyStore ks2 = KeyStore.getInstance(type, ks.getProvider().getName());
// create an empty key store
@@ -103,7 +181,8 @@
// store the secret keys
for (int j = 0; j < numEntries; j++) {
- ks.setKeyEntry(ALIAS_HEAD + j, key, PASSWDK, null);
+ ks.setKeyEntry(ALIAS_HEAD + j, privateKey, PASSWDK,
+ new Certificate[] { cert });
}
// initialize the 2nd key store object with the 1st one
@@ -134,13 +213,18 @@
throw new RuntimeException(
"ERROR: passed the loading with incorrect password");
} catch (IOException ex) {
+ System.out.println("Expected exception: " + ex);
+ if (!causedBy(ex, UnrecoverableKeyException.class)) {
+ ex.printStackTrace(System.out);
+ throw new RuntimeException("Unexpected cause");
+ }
+ System.out.println("Expected cause: "
+ + UnrecoverableKeyException.class.getName());
+
bais.reset();
ks.load(bais, PASSWD2);
bais.reset();
ks.load(bais, null);
- } finally {
- bais.close();
- baos.close();
}
// check key store type
@@ -158,7 +242,6 @@
private void checkType(KeyStore obj, String type) {
if (!obj.getType().equals(type)) {
throw new RuntimeException("ERROR: wrong key store type");
-
}
}
@@ -168,7 +251,6 @@
if (!obj.containsAlias(ALIAS_HEAD + k)) {
throw new RuntimeException("ERROR: alias (" + k
+ ") should exist");
-
}
}
}
@@ -176,16 +258,25 @@
// compare the creation dates - true if all the same
private void compareCreationDate(KeyStore o1, KeyStore o2, int range)
throws KeyStoreException {
- boolean result = true;
- String alias = null;
+ String alias;
for (int k = 0; k < range; k++) {
alias = ALIAS_HEAD + k;
if (!o1.getCreationDate(alias).equals(o2.getCreationDate(alias))) {
throw new RuntimeException("ERROR: entry creation time (" + k
+ ") differs");
-
}
}
}
+ // checks if an exception was caused by specified exception class
+ private static boolean causedBy(Exception e, Class klass) {
+ Throwable cause = e;
+ while ((cause = cause.getCause()) != null) {
+ if (cause.getClass().equals(klass)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/security/cert/CertPathEncodingTest.java Fri Sep 25 12:04:35 2015 -0700
@@ -0,0 +1,253 @@
+/*
+ * Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved.
+ * 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.ByteArrayInputStream;
+import java.security.cert.CertPath;
+import java.security.cert.Certificate;
+import java.security.cert.CertificateFactory;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Base64;
+import java.util.List;
+
+/*
+ * @test
+ * @bug 8074931
+ * @summary CertPathEncodingTest tests the ability of the CertPath and
+ * CertificateFactory to encode and decode CertPaths.
+ */
+public final class CertPathEncodingTest {
+ /*
+ Certificate:
+ Data:
+ Version: 3 (0x2)
+ Serial Number: 935438132 (0x37c1a734)
+ Signature Algorithm: dsaWithSHA1
+ Issuer: C=us, O=sun, OU=east, OU=bcn, CN=yassir
+ Validity
+ Not Before: Aug 23 19:55:32 1999 GMT
+ Not After : Aug 22 19:55:32 2000 GMT
+ Subject: C=us, O=sun, OU=east, OU=bcn
+ Subject Public Key Info:
+ Public Key Algorithm: dsaEncryption
+ pub:
+ 63:47:4f:f6:29:e5:98:a2:21:fd:da:97:9e:3f:ca:
+ b0:17:49:8d:8a:a7:06:0d:a6:78:97:39:59:33:72:
+ a2:a5:74:d5:3a:ef:e6:7c:07:d7:8e:8e:d1:66:73:
+ 99:14:04:96:f5:31:d6:72:ee:d2:53:f8:90:b5:f3:
+ c3:f1:64:ba:1a:9e:c0:0a:da:92:48:c5:d3:84:7e:
+ 48:09:66:d9:51:ba:74:56:5a:77:8a:8c:9a:9c:f6:
+ 84:12:61:12:51:dc:c6:4f:84:94:ec:cb:78:51:83:
+ 8c:20:8a:53:7b:d2:b6:36:df:50:35:95:1f:cb:50:
+ 55:8b:3f:fb:e2:77:cb
+ P:
+ 00:fd:7f:53:81:1d:75:12:29:52:df:4a:9c:2e:ec:
+ e4:e7:f6:11:b7:52:3c:ef:44:00:c3:1e:3f:80:b6:
+ 51:26:69:45:5d:40:22:51:fb:59:3d:8d:58:fa:bf:
+ c5:f5:ba:30:f6:cb:9b:55:6c:d7:81:3b:80:1d:34:
+ 6f:f2:66:60:b7:6b:99:50:a5:a4:9f:9f:e8:04:7b:
+ 10:22:c2:4f:bb:a9:d7:fe:b7:c6:1b:f8:3b:57:e7:
+ c6:a8:a6:15:0f:04:fb:83:f6:d3:c5:1e:c3:02:35:
+ 54:13:5a:16:91:32:f6:75:f3:ae:2b:61:d7:2a:ef:
+ f2:22:03:19:9d:d1:48:01:c7
+ Q:
+ 00:97:60:50:8f:15:23:0b:cc:b2:92:b9:82:a2:eb:
+ 84:0b:f0:58:1c:f5
+ G:
+ 00:f7:e1:a0:85:d6:9b:3d:de:cb:bc:ab:5c:36:b8:
+ 57:b9:79:94:af:bb:fa:3a:ea:82:f9:57:4c:0b:3d:
+ 07:82:67:51:59:57:8e:ba:d4:59:4f:e6:71:07:10:
+ 81:80:b4:49:16:71:23:e8:4c:28:16:13:b7:cf:09:
+ 32:8c:c8:a6:e1:3c:16:7a:8b:54:7c:8d:28:e0:a3:
+ ae:1e:2b:b3:a6:75:91:6e:a3:7f:0b:fa:21:35:62:
+ f1:fb:62:7a:01:24:3b:cc:a4:f1:be:a8:51:90:89:
+ a8:83:df:e1:5a:e5:9f:06:92:8b:66:5e:80:7b:55:
+ 25:64:01:4c:3b:fe:cf:49:2a
+ X509v3 extensions:
+ X509v3 Key Usage: critical
+ Digital Signature, Key Encipherment, Certificate Sign
+ Signature Algorithm: dsaWithSHA1
+ r:
+ 52:80:52:2b:2c:3d:02:66:58:b4:dc:ef:52:26:70:
+ 1b:53:ca:b3:7d
+ s:
+ 62:03:b2:ab:3e:18:2a:66:09:b6:ce:d4:05:a5:8e:
+ a5:7a:0d:55:67
+ */
+ private static final String cert1 =
+ "-----BEGIN CERTIFICATE-----\n" +
+ "MIICzTCCAougAwIBAgIEN8GnNDALBgcqhkjOOAQDBQAwSTELMAkGA1UEBhMCdXMx\n" +
+ "DDAKBgNVBAoTA3N1bjENMAsGA1UECxMEZWFzdDEMMAoGA1UECxMDYmNuMQ8wDQYD\n" +
+ "VQQDEwZ5YXNzaXIwHhcNOTkwODIzMTk1NTMyWhcNMDAwODIyMTk1NTMyWjA4MQsw\n" +
+ "CQYDVQQGEwJ1czEMMAoGA1UEChMDc3VuMQ0wCwYDVQQLEwRlYXN0MQwwCgYDVQQL\n" +
+ "EwNiY24wggG1MIIBLAYHKoZIzjgEATCCAR8CgYEA/X9TgR11EilS30qcLuzk5/YR\n" +
+ "t1I870QAwx4/gLZRJmlFXUAiUftZPY1Y+r/F9bow9subVWzXgTuAHTRv8mZgt2uZ\n" +
+ "UKWkn5/oBHsQIsJPu6nX/rfGG/g7V+fGqKYVDwT7g/bTxR7DAjVUE1oWkTL2dfOu\n" +
+ "K2HXKu/yIgMZndFIAccCFQCXYFCPFSMLzLKSuYKi64QL8Fgc9QKBgQD34aCF1ps9\n" +
+ "3su8q1w2uFe5eZSvu/o66oL5V0wLPQeCZ1FZV4661FlP5nEHEIGAtEkWcSPoTCgW\n" +
+ "E7fPCTKMyKbhPBZ6i1R8jSjgo64eK7OmdZFuo38L+iE1YvH7YnoBJDvMpPG+qFGQ\n" +
+ "iaiD3+Fa5Z8GkotmXoB7VSVkAUw7/s9JKgOBggACf2NHT/Yp5ZiiIf3al54/yrAX\n" +
+ "SY2KpwYNpniXOVkzcqKldNU67+Z8B9eOjtFmc5kUBJb1MdZy7tJT+JC188PxZLoa\n" +
+ "nsAK2pJIxdOEfkgJZtlRunRWWneKjJqc9oQSYRJR3MZPhJTsy3hRg4wgilN70rY2\n" +
+ "31A1lR/LUFWLP/vid8ujEzARMA8GA1UdDwEB/wQFAwMHpAAwCwYHKoZIzjgEAwUA\n" +
+ "Ay8AMCwCFFKAUissPQJmWLTc71ImcBtTyrN9AhRiA7KrPhgqZgm2ztQFpY6leg1V\n" +
+ "Zw==\n" +
+ "-----END CERTIFICATE-----\n" +
+ "";
+
+ /*
+ Certificate:
+ Data:
+ Version: 3 (0x2)
+ Serial Number: 935095671 (0x37bc6d77)
+ Signature Algorithm: dsaWithSHA1
+ Issuer: C=us, O=sun, OU=east, OU=bcn, CN=yassir
+ Validity
+ Not Before: Aug 19 20:47:51 1999 GMT
+ Not After : Aug 18 20:47:51 2000 GMT
+ Subject: C=us, O=sun, OU=east, OU=bcn, CN=yassir
+ Subject Public Key Info:
+ Public Key Algorithm: dsaEncryption
+ pub:
+ 0a:cc:a4:ec:d6:88:45:c2:24:6b:0d:78:f1:82:f3:
+ 5e:3e:31:5d:fb:64:d5:06:5e:39:16:f1:0a:85:d1:
+ ff:d1:a4:74:c5:e6:b0:ba:93:1c:ee:69:51:be:3b:
+ a6:66:44:50:b4:f0:5e:0e:dd:9f:08:71:fe:a1:91:
+ 2e:d4:9e:6b:b2:c0:82:3c:91:6c:18:b0:d9:bc:a3:
+ 48:91:3f:8b:59:01:61:00:02:ab:22:31:bc:7c:6c:
+ 0d:9f:ed:be:33:e6:5c:44:9e:62:30:95:f8:6d:22:
+ d7:e5:85:4c:b0:98:6e:ad:cc:ca:3b:ad:cb:fa:f7:
+ 9f:37:13:f7:ca:e2:22:ba
+ P:
+ 00:fd:7f:53:81:1d:75:12:29:52:df:4a:9c:2e:ec:
+ e4:e7:f6:11:b7:52:3c:ef:44:00:c3:1e:3f:80:b6:
+ 51:26:69:45:5d:40:22:51:fb:59:3d:8d:58:fa:bf:
+ c5:f5:ba:30:f6:cb:9b:55:6c:d7:81:3b:80:1d:34:
+ 6f:f2:66:60:b7:6b:99:50:a5:a4:9f:9f:e8:04:7b:
+ 10:22:c2:4f:bb:a9:d7:fe:b7:c6:1b:f8:3b:57:e7:
+ c6:a8:a6:15:0f:04:fb:83:f6:d3:c5:1e:c3:02:35:
+ 54:13:5a:16:91:32:f6:75:f3:ae:2b:61:d7:2a:ef:
+ f2:22:03:19:9d:d1:48:01:c7
+ Q:
+ 00:97:60:50:8f:15:23:0b:cc:b2:92:b9:82:a2:eb:
+ 84:0b:f0:58:1c:f5
+ G:
+ 00:f7:e1:a0:85:d6:9b:3d:de:cb:bc:ab:5c:36:b8:
+ 57:b9:79:94:af:bb:fa:3a:ea:82:f9:57:4c:0b:3d:
+ 07:82:67:51:59:57:8e:ba:d4:59:4f:e6:71:07:10:
+ 81:80:b4:49:16:71:23:e8:4c:28:16:13:b7:cf:09:
+ 32:8c:c8:a6:e1:3c:16:7a:8b:54:7c:8d:28:e0:a3:
+ ae:1e:2b:b3:a6:75:91:6e:a3:7f:0b:fa:21:35:62:
+ f1:fb:62:7a:01:24:3b:cc:a4:f1:be:a8:51:90:89:
+ a8:83:df:e1:5a:e5:9f:06:92:8b:66:5e:80:7b:55:
+ 25:64:01:4c:3b:fe:cf:49:2a
+ X509v3 extensions:
+ X509v3 Key Usage: critical
+ Digital Signature, Key Encipherment, Certificate Sign
+ X509v3 Basic Constraints: critical
+ CA:TRUE, pathlen:5
+ Signature Algorithm: dsaWithSHA1
+ r:
+ 2f:88:46:37:94:92:b2:02:07:5b:8d:76:e5:81:23:
+ 85:7f:bc:8d:b9
+ s:
+ 00:8b:d7:41:fa:11:c7:ab:27:92:5d:0a:03:98:56:
+ 36:42:5f:f5:1f:9d
+ */
+ private static final String cert2 =
+ "-----BEGIN CERTIFICATE-----\n" +
+ "MIIC9TCCArKgAwIBAgIEN7xtdzALBgcqhkjOOAQDBQAwSTELMAkGA1UEBhMCdXMx\n" +
+ "DDAKBgNVBAoTA3N1bjENMAsGA1UECxMEZWFzdDEMMAoGA1UECxMDYmNuMQ8wDQYD\n" +
+ "VQQDEwZ5YXNzaXIwHhcNOTkwODE5MjA0NzUxWhcNMDAwODE4MjA0NzUxWjBJMQsw\n" +
+ "CQYDVQQGEwJ1czEMMAoGA1UEChMDc3VuMQ0wCwYDVQQLEwRlYXN0MQwwCgYDVQQL\n" +
+ "EwNiY24xDzANBgNVBAMTBnlhc3NpcjCCAbcwggEsBgcqhkjOOAQBMIIBHwKBgQD9\n" +
+ "f1OBHXUSKVLfSpwu7OTn9hG3UjzvRADDHj+AtlEmaUVdQCJR+1k9jVj6v8X1ujD2\n" +
+ "y5tVbNeBO4AdNG/yZmC3a5lQpaSfn+gEexAiwk+7qdf+t8Yb+DtX58aophUPBPuD\n" +
+ "9tPFHsMCNVQTWhaRMvZ1864rYdcq7/IiAxmd0UgBxwIVAJdgUI8VIwvMspK5gqLr\n" +
+ "hAvwWBz1AoGBAPfhoIXWmz3ey7yrXDa4V7l5lK+7+jrqgvlXTAs9B4JnUVlXjrrU\n" +
+ "WU/mcQcQgYC0SRZxI+hMKBYTt88JMozIpuE8FnqLVHyNKOCjrh4rs6Z1kW6jfwv6\n" +
+ "ITVi8ftiegEkO8yk8b6oUZCJqIPf4VrlnwaSi2ZegHtVJWQBTDv+z0kqA4GEAAKB\n" +
+ "gArMpOzWiEXCJGsNePGC814+MV37ZNUGXjkW8QqF0f/RpHTF5rC6kxzuaVG+O6Zm\n" +
+ "RFC08F4O3Z8Icf6hkS7UnmuywII8kWwYsNm8o0iRP4tZAWEAAqsiMbx8bA2f7b4z\n" +
+ "5lxEnmIwlfhtItflhUywmG6tzMo7rcv69583E/fK4iK6oycwJTAPBgNVHQ8BAf8E\n" +
+ "BQMDB6QAMBIGA1UdEwEB/wQIMAYBAf8CAQUwCwYHKoZIzjgEAwUAAzAAMC0CFC+I\n" +
+ "RjeUkrICB1uNduWBI4V/vI25AhUAi9dB+hHHqyeSXQoDmFY2Ql/1H50=\n" +
+ "-----END CERTIFICATE-----\n" +
+ "";
+
+ private static final String pkcs7path =
+ "MIIF9QYJKoZIhvcNAQcCoIIF5jCCBeICAQExADALBgkqhkiG9w0BBwGgggXKMIICzTCCAougAwIB\n" +
+ "AgIEN8GnNDALBgcqhkjOOAQDBQAwSTELMAkGA1UEBhMCdXMxDDAKBgNVBAoTA3N1bjENMAsGA1UE\n" +
+ "CxMEZWFzdDEMMAoGA1UECxMDYmNuMQ8wDQYDVQQDEwZ5YXNzaXIwHhcNOTkwODIzMTk1NTMyWhcN\n" +
+ "MDAwODIyMTk1NTMyWjA4MQswCQYDVQQGEwJ1czEMMAoGA1UEChMDc3VuMQ0wCwYDVQQLEwRlYXN0\n" +
+ "MQwwCgYDVQQLEwNiY24wggG1MIIBLAYHKoZIzjgEATCCAR8CgYEA/X9TgR11EilS30qcLuzk5/YR\n" +
+ "t1I870QAwx4/gLZRJmlFXUAiUftZPY1Y+r/F9bow9subVWzXgTuAHTRv8mZgt2uZUKWkn5/oBHsQ\n" +
+ "IsJPu6nX/rfGG/g7V+fGqKYVDwT7g/bTxR7DAjVUE1oWkTL2dfOuK2HXKu/yIgMZndFIAccCFQCX\n" +
+ "YFCPFSMLzLKSuYKi64QL8Fgc9QKBgQD34aCF1ps93su8q1w2uFe5eZSvu/o66oL5V0wLPQeCZ1FZ\n" +
+ "V4661FlP5nEHEIGAtEkWcSPoTCgWE7fPCTKMyKbhPBZ6i1R8jSjgo64eK7OmdZFuo38L+iE1YvH7\n" +
+ "YnoBJDvMpPG+qFGQiaiD3+Fa5Z8GkotmXoB7VSVkAUw7/s9JKgOBggACf2NHT/Yp5ZiiIf3al54/\n" +
+ "yrAXSY2KpwYNpniXOVkzcqKldNU67+Z8B9eOjtFmc5kUBJb1MdZy7tJT+JC188PxZLoansAK2pJI\n" +
+ "xdOEfkgJZtlRunRWWneKjJqc9oQSYRJR3MZPhJTsy3hRg4wgilN70rY231A1lR/LUFWLP/vid8uj\n" +
+ "EzARMA8GA1UdDwEB/wQFAwMHpAAwCwYHKoZIzjgEAwUAAy8AMCwCFFKAUissPQJmWLTc71ImcBtT\n" +
+ "yrN9AhRiA7KrPhgqZgm2ztQFpY6leg1VZzCCAvUwggKyoAMCAQICBDe8bXcwCwYHKoZIzjgEAwUA\n" +
+ "MEkxCzAJBgNVBAYTAnVzMQwwCgYDVQQKEwNzdW4xDTALBgNVBAsTBGVhc3QxDDAKBgNVBAsTA2Jj\n" +
+ "bjEPMA0GA1UEAxMGeWFzc2lyMB4XDTk5MDgxOTIwNDc1MVoXDTAwMDgxODIwNDc1MVowSTELMAkG\n" +
+ "A1UEBhMCdXMxDDAKBgNVBAoTA3N1bjENMAsGA1UECxMEZWFzdDEMMAoGA1UECxMDYmNuMQ8wDQYD\n" +
+ "VQQDEwZ5YXNzaXIwggG3MIIBLAYHKoZIzjgEATCCAR8CgYEA/X9TgR11EilS30qcLuzk5/YRt1I8\n" +
+ "70QAwx4/gLZRJmlFXUAiUftZPY1Y+r/F9bow9subVWzXgTuAHTRv8mZgt2uZUKWkn5/oBHsQIsJP\n" +
+ "u6nX/rfGG/g7V+fGqKYVDwT7g/bTxR7DAjVUE1oWkTL2dfOuK2HXKu/yIgMZndFIAccCFQCXYFCP\n" +
+ "FSMLzLKSuYKi64QL8Fgc9QKBgQD34aCF1ps93su8q1w2uFe5eZSvu/o66oL5V0wLPQeCZ1FZV466\n" +
+ "1FlP5nEHEIGAtEkWcSPoTCgWE7fPCTKMyKbhPBZ6i1R8jSjgo64eK7OmdZFuo38L+iE1YvH7YnoB\n" +
+ "JDvMpPG+qFGQiaiD3+Fa5Z8GkotmXoB7VSVkAUw7/s9JKgOBhAACgYAKzKTs1ohFwiRrDXjxgvNe\n" +
+ "PjFd+2TVBl45FvEKhdH/0aR0xeawupMc7mlRvjumZkRQtPBeDt2fCHH+oZEu1J5rssCCPJFsGLDZ\n" +
+ "vKNIkT+LWQFhAAKrIjG8fGwNn+2+M+ZcRJ5iMJX4bSLX5YVMsJhurczKO63L+vefNxP3yuIiuqMn\n" +
+ "MCUwDwYDVR0PAQH/BAUDAwekADASBgNVHRMBAf8ECDAGAQH/AgEFMAsGByqGSM44BAMFAAMwADAt\n" +
+ "AhQviEY3lJKyAgdbjXblgSOFf7yNuQIVAIvXQfoRx6snkl0KA5hWNkJf9R+dMQA=\n" +
+ "";
+
+ // Runs test of CertPath encoding and decoding.
+ public static void main(String[] args) throws Exception {
+ // Make the CertPath whose encoded form has already been stored
+ CertificateFactory certFac = CertificateFactory.getInstance("X509");
+
+ final List<Certificate> certs = new ArrayList<>();
+ certs.add(certFac.generateCertificate(new ByteArrayInputStream(cert1.getBytes())));
+ certs.add(certFac.generateCertificate(new ByteArrayInputStream(cert2.getBytes())));
+
+ CertPath cp = certFac.generateCertPath(certs);
+
+ // Get the encoded form of the CertPath we made
+ byte[] encoded = cp.getEncoded("PKCS7");
+
+ // check if it matches the encoded value
+ if (!Arrays.equals(encoded, Base64.getMimeDecoder().decode(pkcs7path.getBytes()))) {
+ throw new RuntimeException("PKCS#7 encoding doesn't match stored value");
+ }
+
+ // Generate a CertPath from the encoded value and check if it equals
+ // the CertPath generated from the certificates
+ CertPath decodedCP = certFac.generateCertPath(new ByteArrayInputStream(encoded), "PKCS7");
+ if (!decodedCP.equals(cp)) {
+ throw new RuntimeException("CertPath decoded from PKCS#7 isn't equal to original");
+ }
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/security/cert/X509CertSelectorTest.java Fri Sep 25 12:04:35 2015 -0700
@@ -0,0 +1,538 @@
+/*
+ * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
+ * 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 static sun.security.x509.GeneralNameInterface.NAME_DIRECTORY;
+import static sun.security.x509.NameConstraintsExtension.EXCLUDED_SUBTREES;
+import static sun.security.x509.NameConstraintsExtension.PERMITTED_SUBTREES;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.math.BigInteger;
+import java.security.GeneralSecurityException;
+import java.security.KeyFactory;
+import java.security.PublicKey;
+import java.security.cert.CertificateException;
+import java.security.cert.CertificateFactory;
+import java.security.cert.X509CertSelector;
+import java.security.cert.X509Certificate;
+import java.security.spec.X509EncodedKeySpec;
+import java.util.Base64;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+
+import sun.security.util.DerInputStream;
+import sun.security.util.DerOutputStream;
+import sun.security.util.DerValue;
+import sun.security.util.ObjectIdentifier;
+import sun.security.x509.AlgorithmId;
+import sun.security.x509.AuthorityKeyIdentifierExtension;
+import sun.security.x509.CertificatePoliciesExtension;
+import sun.security.x509.DNSName;
+import sun.security.x509.GeneralName;
+import sun.security.x509.GeneralNameInterface;
+import sun.security.x509.GeneralNames;
+import sun.security.x509.GeneralSubtree;
+import sun.security.x509.GeneralSubtrees;
+import sun.security.x509.KeyIdentifier;
+import sun.security.x509.NameConstraintsExtension;
+import sun.security.x509.PolicyInformation;
+import sun.security.x509.PrivateKeyUsageExtension;
+import sun.security.x509.SubjectAlternativeNameExtension;
+import sun.security.x509.X500Name;
+
+/*
+ * @test
+ * @bug 8074931
+ * @summary This class tests the X509CertSelector. The tests check particular criteria
+ * by setting them to a value that should match our test certificate and
+ * ensuring that they do match, then setting them to a value that should not
+ * match our test certificate and ensuring that they do not match.
+ * @modules java.base/sun.security.x509
+ * java.base/sun.security.util
+ */
+public class X509CertSelectorTest {
+ /*
+ Certificate:
+ Data:
+ Version: 3 (0x2)
+ Serial Number: 954172088 (0x38df82b8)
+ Signature Algorithm: dsaWithSHA1
+ Issuer: C=us, O=sun, OU=testing
+ Validity
+ Not Before: Mar 27 15:48:08 2000 GMT
+ Not After : Jun 25 14:48:08 2000 GMT
+ Subject: C=us, O=sun, OU=testing, CN=mullan
+ Subject Public Key Info:
+ Public Key Algorithm: dsaEncryption
+ pub: 0
+ P: 0
+ Q: 0
+ G: 0
+ X509v3 extensions:
+ X509v3 Name Constraints: critical
+ 0D.B0@.>1.0...U....us1.0
+ ..U.
+ ..sun1.0...U....testing1.0
+ ..U....mullan
+ X509v3 Subject Key Identifier:
+ 56:E8:88:AE:9D:B5:3F:2B:CB:A0:4C:4B:E2:87:53:07:33:77:1B:DF
+ X509v3 Authority Key Identifier:
+ keyid:8E:DD:AF:6F:EE:02:12:F4:61:E9:2F:E3:64:1A:6F:71:32:25:20:C0
+
+ X509v3 Subject Alternative Name:
+ email:mullan@east.sun.com
+ X509v3 Private Key Usage Period:
+ Not Before: Jan 1 05:00:00 2000 GMT, Not After: Jan 1 05:00:00 2001 GMT
+ X509v3 Key Usage: critical
+ Digital Signature
+ X509v3 Certificate Policies:
+ 0$0\..*...0.0...+.......0..
+ Testing...
+ Signature Algorithm: dsaWithSHA1
+ r:
+ 44:c7:35:40:5d:6c:28:75:7f:73:b2:f8:0d:72:6c:
+ 09:65:b8:81:14
+ s:
+ 76:79:f5:c7:37:3b:0d:9b:db:70:2f:20:80:36:e3:
+ 80:e8:a6:c6:71
+ */
+ private static final String testCert =
+ "-----BEGIN CERTIFICATE-----\n" +
+ "MIICLjCCAeygAwIBAgIEON+CuDALBgcqhkjOOAQDBQAwLTELMAkGA1UEBhMCdXMx\n" +
+ "DDAKBgNVBAoTA3N1bjEQMA4GA1UECxMHdGVzdGluZzAeFw0wMDAzMjcxNTQ4MDha\n" +
+ "Fw0wMDA2MjUxNDQ4MDhaMD4xCzAJBgNVBAYTAnVzMQwwCgYDVQQKEwNzdW4xEDAO\n" +
+ "BgNVBAsTB3Rlc3RpbmcxDzANBgNVBAMTBm11bGxhbjAcMBQGByqGSM44BAEwCQIB\n" +
+ "AAIBAAIBAAMEAAIBAKOCASMwggEfMFAGA1UdHgEB/wRGMESgQjBApD4xCzAJBgNV\n" +
+ "BAYTAnVzMQwwCgYDVQQKEwNzdW4xEDAOBgNVBAsTB3Rlc3RpbmcxDzANBgNVBAMT\n" +
+ "Bm11bGxhbjAdBgNVHQ4EFgQUVuiIrp21PyvLoExL4odTBzN3G98wHwYDVR0jBBgw\n" +
+ "FoAUjt2vb+4CEvRh6S/jZBpvcTIlIMAwHgYDVR0RBBcwFYETbXVsbGFuQGVhc3Qu\n" +
+ "c3VuLmNvbTArBgNVHRAEJDAigA8yMDAwMDEwMTA1MDAwMFqBDzIwMDEwMTAxMDUw\n" +
+ "MDAwWjAPBgNVHQ8BAf8EBQMDB4AAMC0GA1UdIAQmMCQwIgYEKoSAADAaMBgGCCsG\n" +
+ "AQUFBwICMAwSClRlc3RpbmcuLi4wCwYHKoZIzjgEAwUAAy8AMCwCFETHNUBdbCh1\n" +
+ "f3Oy+A1ybAlluIEUAhR2efXHNzsNm9twLyCANuOA6KbGcQ==\n" +
+ "-----END CERTIFICATE-----\n" +
+ "";
+
+ private static final String testKey =
+ "MIIBtjCCASsGByqGSM44BAEwggEeAoGBAIVWPEkcxbxhQRCqVzg55tNqbP5j0K4kdu4bkmXvfqC5\n" +
+ "+qA75DvnfzsOJseb+9AuKXWk/DvCzFDmrY1YaU3scZC3OQEO9lEO3F4VDKOaudY6OT1SI22pAIwz\n" +
+ "j5pvq+i7zOp4xUqkQUeh/4iQSfxOT5UrFGjkcbnbpVkCXD/GxAz7AhUAjtnm3dVIddUUHl6wxpZ7\n" +
+ "GcA6gSsCgYAf/PXzQtemgIDjpFrNNSgTEKkLposBXKatAM+gUKlMUjf8SQvquqPxDtRrscGjXkoL\n" +
+ "oTkaR7/akULYFpBvUcFkeIFiCnJg8M9XhCWdLvn9MPt+jR2oxookvCb9xLtD6WvIM/wd/nZ1iK4u\n" +
+ "iY1+q85xvns/Awbtwl7oZDAwE2TUKAOBhAACgYBDc9UZ+3xsZubUZvRG5cpyJceYpJp2exOPVJXn\n" +
+ "jR4CcR+cT9bAJpFSxqE/8KtNHXxHdu4f3DU67IMOVDpugzihyzXJvNm3w2H9x+6xczHG2wjvAJeh\n" +
+ "X62EWbUatxPXFAoVKZWuUbaYaZzdWBDtNRrCuKKsLo0GFy8g2BZISuD3jw==\n" +
+ "";
+
+ // Certificate to run tests on
+ private final X509Certificate cert;
+
+ public static void main(String[] args) throws Exception {
+ X509CertSelectorTest test = new X509CertSelectorTest();
+ test.doTest();
+ }
+
+ public X509CertSelectorTest() throws CertificateException, IOException {
+ cert = (X509Certificate) CertificateFactory.getInstance("X.509")
+ .generateCertificate(new ByteArrayInputStream(testCert.getBytes()));
+ }
+
+ // Runs the test.
+ private void doTest() throws Exception {
+ System.out.println("START OF TESTS FOR " + "X509CertSelector");
+
+ testSerialNumber();
+ testIssuer();
+ testSubjectKeyIdentifier();
+ testAuthorityKeyIdentifier();
+ testCertificateValid();
+ testPrivateKeyValid();
+ testSubjectPublicKeyAlgID();
+ testKeyUsage();
+ testSubjectAltName();
+ testPolicy();
+ testPathToName();
+ testSubject();
+ testSubjectPublicKey();
+ testNameConstraints();
+ testBasicConstraints();
+ testCertificate();
+ }
+
+ // Tests matching on the serial number contained in the certificate.
+ private void testSerialNumber() {
+ System.out.println("X.509 Certificate Match on serialNumber");
+ // bad match
+ X509CertSelector selector = new X509CertSelector();
+ selector.setSerialNumber(new BigInteger("999999999"));
+ checkMatch(selector, cert, false);
+
+ // good match
+ selector.setSerialNumber(cert.getSerialNumber());
+ checkMatch(selector, cert, true);
+ }
+
+ // Tests matching on the issuer name contained in the certificate.
+ private void testIssuer() throws IOException {
+ System.out.println("X.509 Certificate Match on issuer");
+ // bad match
+ X509CertSelector selector = new X509CertSelector();
+ selector.setIssuer("ou=bogus,ou=east,o=sun,c=us");
+ checkMatch(selector, cert, false);
+
+ // good match
+ selector.setIssuer((cert.getIssuerX500Principal()).getName("RFC2253"));
+ checkMatch(selector, cert, true);
+ }
+
+ /*
+ * Tests matching on the subject key identifier contained in the
+ * certificate.
+ */
+ private void testSubjectKeyIdentifier() throws IOException {
+ System.out.println("X.509 Certificate Match on subjectKeyIdentifier");
+ // bad match
+ X509CertSelector selector = new X509CertSelector();
+ byte[] b = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
+ selector.setSubjectKeyIdentifier(b);
+ checkMatch(selector, cert, false);
+
+ // good match
+ DerInputStream in = new DerInputStream(cert.getExtensionValue("2.5.29.14"));
+ byte[] encoded = in.getOctetString();
+ selector.setSubjectKeyIdentifier(encoded);
+ checkMatch(selector, cert, true);
+ }
+
+ /*
+ * Tests matching on the authority key identifier contained in the
+ * certificate.
+ */
+ private void testAuthorityKeyIdentifier() throws IOException {
+ System.out.println("X.509 Certificate Match on authorityKeyIdentifier");
+ // bad match
+ X509CertSelector selector = new X509CertSelector();
+ byte[] b = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
+ AuthorityKeyIdentifierExtension a = new AuthorityKeyIdentifierExtension(new KeyIdentifier(b), null, null);
+ selector.setAuthorityKeyIdentifier(a.getExtensionValue());
+ checkMatch(selector, cert, false);
+
+ // good match
+ DerInputStream in = new DerInputStream(cert.getExtensionValue("2.5.29.35"));
+ byte[] encoded = in.getOctetString();
+ selector.setAuthorityKeyIdentifier(encoded);
+ checkMatch(selector, cert, true);
+ }
+
+ /*
+ * Tests matching on the certificate validity component contained in the
+ * certificate.
+ */
+ private void testCertificateValid() {
+ System.out.println("X.509 Certificate Match on certificateValid");
+ // bad match
+ X509CertSelector selector = new X509CertSelector();
+ Calendar cal = Calendar.getInstance();
+ cal.set(1968, 12, 31);
+ selector.setCertificateValid(cal.getTime());
+ checkMatch(selector, cert, false);
+
+ // good match
+ selector.setCertificateValid(cert.getNotBefore());
+ checkMatch(selector, cert, true);
+ }
+
+ /*
+ * Tests matching on the private key validity component contained in the
+ * certificate.
+ */
+ private void testPrivateKeyValid() throws IOException, CertificateException {
+ System.out.println("X.509 Certificate Match on privateKeyValid");
+ // bad match
+ X509CertSelector selector = new X509CertSelector();
+ Calendar cal = Calendar.getInstance();
+ cal.set(1968, 12, 31);
+ selector.setPrivateKeyValid(cal.getTime());
+ checkMatch(selector, cert, false);
+
+ // good match
+ DerInputStream in = new DerInputStream(cert.getExtensionValue("2.5.29.16"));
+ byte[] encoded = in.getOctetString();
+ PrivateKeyUsageExtension ext = new PrivateKeyUsageExtension(false, encoded);
+ Date validDate = (Date) ext.get(PrivateKeyUsageExtension.NOT_BEFORE);
+ selector.setPrivateKeyValid(validDate);
+ checkMatch(selector, cert, true);
+
+ }
+
+ private ObjectIdentifier getCertPubKeyAlgOID(X509Certificate xcert) throws IOException {
+ byte[] encodedKey = xcert.getPublicKey().getEncoded();
+ DerValue val = new DerValue(encodedKey);
+ if (val.tag != DerValue.tag_Sequence) {
+ throw new RuntimeException("invalid key format");
+ }
+
+ return AlgorithmId.parse(val.data.getDerValue()).getOID();
+ }
+
+ /*
+ * Tests matching on the subject public key algorithm ID component contained
+ * in the certificate.
+ */
+ private void testSubjectPublicKeyAlgID() throws IOException {
+ System.out.println("X.509 Certificate Match on subjectPublicKeyAlgID");
+ // bad match
+ X509CertSelector selector = new X509CertSelector();
+ selector.setSubjectPublicKeyAlgID("2.5.29.14");
+ checkMatch(selector, cert, false);
+
+ // good match
+ selector.setSubjectPublicKeyAlgID(getCertPubKeyAlgOID(cert).toString());
+ checkMatch(selector, cert, true);
+
+ }
+
+ // Tests matching on the key usage extension contained in the certificate.
+ private void testKeyUsage() {
+ System.out.println("X.509 Certificate Match on keyUsage");
+ // bad match
+ X509CertSelector selector = new X509CertSelector();
+ boolean[] keyUsage = { true, false, true, false, true, false, true, false };
+ selector.setKeyUsage(keyUsage);
+ System.out.println("Selector = " + selector.toString());
+ checkMatch(selector, cert, false);
+
+ // good match
+ selector.setKeyUsage(cert.getKeyUsage());
+ System.out.println("Selector = " + selector.toString());
+ checkMatch(selector, cert, true);
+ }
+
+ /*
+ * Tests matching on the subject alternative name extension contained in the
+ * certificate.
+ */
+ private void testSubjectAltName() throws IOException {
+ System.out.println("X.509 Certificate Match on subjectAltName");
+ // bad match
+ X509CertSelector selector = new X509CertSelector();
+ GeneralNameInterface dnsName = new DNSName("foo.com");
+ DerOutputStream tmp = new DerOutputStream();
+ dnsName.encode(tmp);
+ selector.addSubjectAlternativeName(2, tmp.toByteArray());
+ checkMatch(selector, cert, false);
+
+ // good match
+ DerInputStream in = new DerInputStream(cert.getExtensionValue("2.5.29.17"));
+ byte[] encoded = in.getOctetString();
+ SubjectAlternativeNameExtension ext = new SubjectAlternativeNameExtension(false, encoded);
+ GeneralNames names = (GeneralNames) ext.get(SubjectAlternativeNameExtension.SUBJECT_NAME);
+ GeneralName name = (GeneralName) names.get(0);
+ selector.setSubjectAlternativeNames(null);
+ DerOutputStream tmp2 = new DerOutputStream();
+ name.getName().encode(tmp2);
+ selector.addSubjectAlternativeName(name.getType(), tmp2.toByteArray());
+ checkMatch(selector, cert, true);
+
+ // good match 2 (matches at least one)
+ selector.setMatchAllSubjectAltNames(false);
+ selector.addSubjectAlternativeName(2, "foo.com");
+ checkMatch(selector, cert, true);
+ }
+
+ /*
+ * Tests matching on the policy constraints extension contained in the
+ * certificate.
+ */
+ private void testPolicy() throws IOException {
+ System.out.println("X.509 Certificate Match on certificatePolicies");
+ // test encoding of CertificatePoliciesExtension because we wrote the
+ // code
+ // bad match
+ X509CertSelector selector = new X509CertSelector();
+ Set<String> s = new HashSet<>();
+ s.add(new String("1.2.5.7.68"));
+ selector.setPolicy(s);
+ checkMatch(selector, cert, false);
+
+ // good match
+ DerInputStream in = new DerInputStream(cert.getExtensionValue("2.5.29.32"));
+ CertificatePoliciesExtension ext = new CertificatePoliciesExtension(false, in.getOctetString());
+ List<PolicyInformation> policies = ext.get(CertificatePoliciesExtension.POLICIES);
+ // match on the first policy id
+ PolicyInformation policyInfo = (PolicyInformation) policies.get(0);
+ s.clear();
+ s.add(policyInfo.getPolicyIdentifier().getIdentifier().toString());
+ selector.setPolicy(s);
+ checkMatch(selector, cert, true);
+ }
+
+ /*
+ * Tests matching on the name constraints extension contained in the
+ * certificate.
+ */
+ private void testPathToName() throws IOException {
+ System.out.println("X.509 Certificate Match on pathToName");
+
+ X509CertSelector selector = null;
+ DerInputStream in = new DerInputStream(cert.getExtensionValue("2.5.29.30"));
+ byte[] encoded = in.getOctetString();
+ NameConstraintsExtension ext = new NameConstraintsExtension(false, encoded);
+ GeneralSubtrees permitted = (GeneralSubtrees) ext.get(PERMITTED_SUBTREES);
+ GeneralSubtrees excluded = (GeneralSubtrees) ext.get(EXCLUDED_SUBTREES);
+
+ // bad matches on pathToName within excluded subtrees
+ if (excluded != null) {
+ Iterator<GeneralSubtree> e = excluded.iterator();
+ while (e.hasNext()) {
+ GeneralSubtree tree = e.next();
+ if (tree.getName().getType() == NAME_DIRECTORY) {
+ X500Name excludedDN1 = new X500Name(tree.getName().toString());
+ X500Name excludedDN2 = new X500Name("CN=Bogus, " + tree.getName().toString());
+ DerOutputStream derDN1 = new DerOutputStream();
+ DerOutputStream derDN2 = new DerOutputStream();
+ excludedDN1.encode(derDN1);
+ excludedDN2.encode(derDN2);
+ selector = new X509CertSelector();
+ selector.addPathToName(NAME_DIRECTORY, derDN1.toByteArray());
+ checkMatch(selector, cert, false);
+ selector.setPathToNames(null);
+ selector.addPathToName(NAME_DIRECTORY, derDN2.toByteArray());
+ checkMatch(selector, cert, false);
+ }
+ }
+ }
+
+ // good matches on pathToName within permitted subtrees
+ if (permitted != null) {
+ Iterator<GeneralSubtree> e = permitted.iterator();
+ while (e.hasNext()) {
+ GeneralSubtree tree = e.next();
+ if (tree.getName().getType() == NAME_DIRECTORY) {
+ X500Name permittedDN1 = new X500Name(tree.getName().toString());
+ X500Name permittedDN2 = new X500Name("CN=good, " + tree.getName().toString());
+ DerOutputStream derDN1 = new DerOutputStream();
+ DerOutputStream derDN2 = new DerOutputStream();
+ permittedDN1.encode(derDN1);
+ permittedDN2.encode(derDN2);
+ selector = new X509CertSelector();
+ selector.addPathToName(NAME_DIRECTORY, derDN1.toByteArray());
+ checkMatch(selector, cert, true);
+ selector.setPathToNames(null);
+ selector.addPathToName(NAME_DIRECTORY, derDN2.toByteArray());
+ checkMatch(selector, cert, true);
+ }
+ }
+ }
+ }
+
+ // Tests matching on the subject name contained in the certificate.
+ private void testSubject() throws IOException {
+ System.out.println("X.509 Certificate Match on subject");
+ // bad match
+ X509CertSelector selector = new X509CertSelector();
+ selector.setSubject("ou=bogus,ou=east,o=sun,c=us");
+ checkMatch(selector, cert, false);
+
+ // good match
+ selector.setSubject(cert.getSubjectX500Principal().getName("RFC2253"));
+ checkMatch(selector, cert, true);
+ }
+
+ // Tests matching on the subject public key contained in the certificate.
+ private void testSubjectPublicKey() throws IOException, GeneralSecurityException {
+ System.out.println("X.509 Certificate Match on subject public key");
+ // bad match
+ X509CertSelector selector = new X509CertSelector();
+ X509EncodedKeySpec keySpec = new X509EncodedKeySpec(
+ Base64.getMimeDecoder().decode(testKey.getBytes()));
+ KeyFactory keyFactory = KeyFactory.getInstance("DSA");
+ PublicKey pubKey = keyFactory.generatePublic(keySpec);
+ selector.setSubjectPublicKey(pubKey);
+ checkMatch(selector, cert, false);
+
+ // good match
+ selector.setSubjectPublicKey(cert.getPublicKey());
+ checkMatch(selector, cert, true);
+ }
+
+ // Tests matching on the name constraints contained in the certificate.
+ private void testNameConstraints() throws IOException {
+ System.out.println("X.509 Certificate Match on name constraints");
+ // bad match
+ GeneralSubtrees subjectTree = new GeneralSubtrees();
+ subjectTree.add(getGeneralSubtree((X500Name) cert.getSubjectDN()));
+ NameConstraintsExtension ext = new NameConstraintsExtension((GeneralSubtrees) null, subjectTree);
+ X509CertSelector selector = new X509CertSelector();
+ selector.setNameConstraints(ext.getExtensionValue());
+ checkMatch(selector, cert, false);
+
+ // good match
+ ext = new NameConstraintsExtension(subjectTree, null);
+ selector.setNameConstraints(ext.getExtensionValue());
+ checkMatch(selector, cert, true);
+ }
+
+ // Tests matching on basic constraints.
+ private void testBasicConstraints() {
+ System.out.println("X.509 Certificate Match on basic constraints");
+ // bad match
+ X509CertSelector selector = new X509CertSelector();
+ int mpl = cert.getBasicConstraints();
+ selector.setBasicConstraints(0);
+ checkMatch(selector, cert, false);
+
+ // good match
+ selector.setBasicConstraints(mpl);
+ checkMatch(selector, cert, true);
+ }
+
+ // Tests certificateEquals criterion
+ private void testCertificate() {
+ System.out.println("X.509 Certificate Match on certificateEquals criterion");
+
+ X509CertSelector selector = new X509CertSelector();
+ // good match
+ selector.setCertificate(cert);
+ checkMatch(selector, cert, true);
+ }
+
+ private void checkMatch(X509CertSelector selector, X509Certificate cert, boolean match) {
+ boolean result = selector.match(cert);
+ if (match != result)
+ throw new RuntimeException(selector + " match " + cert + " is " + result + ", but expect " + match);
+ }
+
+ private static GeneralSubtree getGeneralSubtree(GeneralNameInterface gni) {
+ // Create a new GeneralSubtree with the specified name, 0 base, and
+ // unlimited length
+ GeneralName gn = new GeneralName(gni);
+ GeneralSubtree subTree = new GeneralSubtree(gn, 0, -1);
+ return subTree;
+ }
+}
--- a/jdk/test/java/util/Arrays/ParallelPrefix.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/util/Arrays/ParallelPrefix.java Fri Sep 25 12:04:35 2015 -0700
@@ -43,18 +43,18 @@
public class ParallelPrefix {
//Array size less than MIN_PARTITION
- private final static int SMALL_ARRAY_SIZE = 1 << 3;
+ private static final int SMALL_ARRAY_SIZE = 1 << 3;
//Array size equals MIN_PARTITION
- private final static int THRESHOLD_ARRAY_SIZE = 1 << 4;
+ private static final int THRESHOLD_ARRAY_SIZE = 1 << 4;
//Array size greater than MIN_PARTITION
- private final static int MEDIUM_ARRAY_SIZE = 1 << 8;
+ private static final int MEDIUM_ARRAY_SIZE = 1 << 8;
//Array size much greater than MIN_PARTITION
- private final static int LARGE_ARRAY_SIZE = 1 << 14;
+ private static final int LARGE_ARRAY_SIZE = 1 << 14;
- private final static int[] ARRAY_SIZE_COLLECTION = new int[]{
+ private static final int[] ARRAY_SIZE_COLLECTION = new int[]{
SMALL_ARRAY_SIZE,
THRESHOLD_ARRAY_SIZE,
MEDIUM_ARRAY_SIZE,
--- a/jdk/test/java/util/Calendar/Bug8007038.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/util/Calendar/Bug8007038.java Fri Sep 25 12:04:35 2015 -0700
@@ -36,14 +36,14 @@
import sun.util.locale.provider.CalendarDataUtility;
public class Bug8007038 {
- private final static String[] calTypes = {
+ private static final String[] calTypes = {
"gregory",
"buddhist",
"japanese",
"roc",
"islamic",
};
- private final static int[][] eraMinMax = {
+ private static final int[][] eraMinMax = {
{GregorianCalendar.BC, GregorianCalendar.AD},
{0, 1},
{0, 4},
@@ -51,7 +51,7 @@
{0, 1},
{0, 1},
};
- private final static Locale[] testLocs = {
+ private static final Locale[] testLocs = {
Locale.ROOT,
Locale.forLanguageTag("ja-JP-u-ca-japanese"),
Locale.forLanguageTag("th-TH"),
--- a/jdk/test/java/util/Collection/BiggernYours.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/util/Collection/BiggernYours.java Fri Sep 25 12:04:35 2015 -0700
@@ -82,9 +82,9 @@
s2.tailSet(Integer.MIN_VALUE));
}
- static abstract class MapFrobber { abstract void frob(Map m); }
- static abstract class SetFrobber { abstract void frob(Set s); }
- static abstract class ColFrobber { abstract void frob(Collection c); }
+ abstract static class MapFrobber { abstract void frob(Map m); }
+ abstract static class SetFrobber { abstract void frob(Set s); }
+ abstract static class ColFrobber { abstract void frob(Collection c); }
static ColFrobber adder(final int i) {
return new ColFrobber() {void frob(Collection c) { c.add(i); }};
@@ -236,7 +236,7 @@
try {realMain(args);} catch (Throwable t) {unexpected(t);}
System.out.printf("%nPassed = %d, failed = %d%n%n", passed, failed);
if (failed > 0) throw new AssertionError("Some tests failed");}
- private static abstract class CheckedThread extends Thread {
+ private abstract static class CheckedThread extends Thread {
abstract void realRun() throws Throwable;
public void run() {
try {realRun();} catch (Throwable t) {unexpected(t);}}}
--- a/jdk/test/java/util/Collection/HotPotatoes.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/util/Collection/HotPotatoes.java Fri Sep 25 12:04:35 2015 -0700
@@ -99,7 +99,7 @@
try {realMain(args);} catch (Throwable t) {unexpected(t);}
System.out.printf("%nPassed = %d, failed = %d%n%n", passed, failed);
if (failed > 0) throw new AssertionError("Some tests failed");}
- private static abstract class CheckedThread extends Thread {
+ private abstract static class CheckedThread extends Thread {
public abstract void realRun() throws Throwable;
public void run() {
try { realRun(); } catch (Throwable t) { unexpected(t); }}}
--- a/jdk/test/java/util/Collections/AddAll.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/util/Collections/AddAll.java Fri Sep 25 12:04:35 2015 -0700
@@ -32,7 +32,7 @@
import java.util.*;
public class AddAll {
- final static int N = 100;
+ static final int N = 100;
public static void main(String args[]) {
test(new ArrayList<Integer>());
test(new LinkedList<Integer>());
--- a/jdk/test/java/util/Collections/Disjoint.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/util/Collections/Disjoint.java Fri Sep 25 12:04:35 2015 -0700
@@ -32,7 +32,7 @@
import java.util.*;
public class Disjoint {
- final static int N = 20;
+ static final int N = 20;
public static void main(String args[]) {
// Make an array of lists each of which shares a single element
--- a/jdk/test/java/util/Collections/Frequency.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/util/Collections/Frequency.java Fri Sep 25 12:04:35 2015 -0700
@@ -31,7 +31,7 @@
import java.util.*;
public class Frequency {
- final static int N = 100;
+ static final int N = 100;
public static void main(String args[]) {
test(new ArrayList<Integer>());
test(new LinkedList<Integer>());
--- a/jdk/test/java/util/Collections/RacingCollections.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/util/Collections/RacingCollections.java Fri Sep 25 12:04:35 2015 -0700
@@ -38,15 +38,15 @@
* Turn this up to some higher value like 1000 for stress testing:
* java -Dmillis=1000 RacingCollections
*/
- final static long defaultWorkTimeMillis = Long.getLong("millis", 10L);
+ static final long defaultWorkTimeMillis = Long.getLong("millis", 10L);
/**
* Whether to print debug information.
*/
- final static boolean debug = Boolean.getBoolean("debug");
+ static final boolean debug = Boolean.getBoolean("debug");
- final static Integer one = 1;
- final static Integer two = 2;
+ static final Integer one = 1;
+ static final Integer two = 2;
/**
* A thread that mutates an object forever, alternating between
@@ -340,7 +340,7 @@
try {realMain(args);} catch (Throwable t) {unexpected(t);}
System.out.printf("%nPassed = %d, failed = %d%n%n", passed, failed);
if (failed > 0) throw new AssertionError("Some tests failed");}
- private static abstract class CheckedThread extends Thread {
+ private abstract static class CheckedThread extends Thread {
abstract void realRun() throws Throwable;
public void run() {
try { realRun(); } catch (Throwable t) { unexpected(t); }}}
--- a/jdk/test/java/util/Collections/ReverseOrder2.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/util/Collections/ReverseOrder2.java Fri Sep 25 12:04:35 2015 -0700
@@ -32,7 +32,7 @@
import java.io.*;
public class ReverseOrder2 {
- final static int N = 100;
+ static final int N = 100;
static void realMain(String[] args) throws Throwable {
check(Collections.reverseOrder()
@@ -75,7 +75,7 @@
}
};
- private final static List<String> golden = new ArrayList<String>(N);
+ private static final List<String> golden = new ArrayList<String>(N);
static {
for (int i = N-1; i >= 0; i--)
golden.add(String.valueOf(i));
@@ -89,7 +89,7 @@
equal(list, golden2);
}
- private final static List<Integer> golden2 = new ArrayList<Integer>(N);
+ private static final List<Integer> golden2 = new ArrayList<Integer>(N);
static {
for (int i = N-1; i >= 0; i--)
golden2.add(i);
--- a/jdk/test/java/util/Deque/ChorusLine.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/util/Deque/ChorusLine.java Fri Sep 25 12:04:35 2015 -0700
@@ -36,7 +36,7 @@
void run(Deque<Integer> deq);
}
- private final static Tweaker[] tweakers = {
+ private static final Tweaker[] tweakers = {
new Tweaker() { public void run(Deque<Integer> deq) {
for (int i = 0; i < 7; i++)
deq.addLast(i);
--- a/jdk/test/java/util/LinkedHashMap/Basic.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/util/LinkedHashMap/Basic.java Fri Sep 25 12:04:35 2015 -0700
@@ -32,8 +32,8 @@
import java.io.*;
public class Basic {
- final static Random rnd = new Random(666);
- final static Integer nil = new Integer(0);
+ static final Random rnd = new Random(666);
+ static final Integer nil = new Integer(0);
public static void main(String[] args) throws Exception {
int numItr = 500;
--- a/jdk/test/java/util/Locale/tools/EquivMapsGenerator.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/util/Locale/tools/EquivMapsGenerator.java Fri Sep 25 12:04:35 2015 -0700
@@ -205,7 +205,7 @@
System.out.println();
}
- private final static String headerText =
+ private static final String headerText =
"final class LocaleEquivalentMaps {\n\n"
+ " static final Map<String, String> singleEquivMap;\n"
+ " static final Map<String, String[]> multiEquivsMap;\n"
@@ -216,7 +216,7 @@
+ " regionVariantEquivMap = new HashMap<>();\n\n"
+ " // This is an auto-generated file and should not be manually edited.\n";
- private final static String footerText =
+ private static final String footerText =
" }\n\n"
+ "}";
--- a/jdk/test/java/util/Map/Collisions.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/util/Map/Collisions.java Fri Sep 25 12:04:35 2015 -0700
@@ -39,7 +39,7 @@
*/
private static final int TEST_SIZE = 5000;
- final static class HashableInteger implements Comparable<HashableInteger> {
+ static final class HashableInteger implements Comparable<HashableInteger> {
final int value;
final int hashmask; //yes duplication
--- a/jdk/test/java/util/Map/FunctionalCMEs.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/util/Map/FunctionalCMEs.java Fri Sep 25 12:04:35 2015 -0700
@@ -43,7 +43,7 @@
* @run testng FunctionalCMEs
*/
public class FunctionalCMEs {
- final static String KEY = "key";
+ static final String KEY = "key";
@DataProvider(name = "Maps", parallel = true)
private static Iterator<Object[]> makeMaps() {
--- a/jdk/test/java/util/Map/InPlaceOpsCollisions.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/util/Map/InPlaceOpsCollisions.java Fri Sep 25 12:04:35 2015 -0700
@@ -38,7 +38,7 @@
*/
private static final int TEST_SIZE = 5000;
- final static class HashableInteger implements Comparable<HashableInteger> {
+ static final class HashableInteger implements Comparable<HashableInteger> {
final int value;
final int hashmask; //yes duplication
--- a/jdk/test/java/util/Map/MapBinToFromTreeTest.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/util/Map/MapBinToFromTreeTest.java Fri Sep 25 12:04:35 2015 -0700
@@ -186,7 +186,7 @@
}
}
- final static class HashCodeInteger implements Comparable<HashCodeInteger> {
+ static final class HashCodeInteger implements Comparable<HashCodeInteger> {
final int value;
final int hashcode;
--- a/jdk/test/java/util/NavigableMap/LockStep.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/util/NavigableMap/LockStep.java Fri Sep 25 12:04:35 2015 -0700
@@ -534,8 +534,8 @@
}
}
- static abstract class MapFrobber { abstract void frob(NavigableMap m); }
- static abstract class SetFrobber { abstract void frob(NavigableSet m); }
+ abstract static class MapFrobber { abstract void frob(NavigableMap m); }
+ abstract static class SetFrobber { abstract void frob(NavigableSet m); }
static MapFrobber randomAdder(NavigableMap m) {
final Integer k = unusedKey(m);
--- a/jdk/test/java/util/ResourceBundle/Bug6190861.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/util/ResourceBundle/Bug6190861.java Fri Sep 25 12:04:35 2015 -0700
@@ -31,7 +31,7 @@
public class Bug6190861 {
- static public void main(String[] args) {
+ public static void main(String[] args) {
Locale reservedLocale = Locale.getDefault();
try {
Locale.setDefault(new Locale("en", "US"));
--- a/jdk/test/java/util/ResourceBundle/Bug6204853.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/util/ResourceBundle/Bug6204853.java Fri Sep 25 12:04:35 2015 -0700
@@ -79,7 +79,7 @@
return keyValueArray;
}
- public final static void main(String[] args) {
+ public static final void main(String[] args) {
new Bug6204853();
}
}
--- a/jdk/test/java/util/ResourceBundle/Bug6355009.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/util/ResourceBundle/Bug6355009.java Fri Sep 25 12:04:35 2015 -0700
@@ -32,7 +32,7 @@
public final strictfp class Bug6355009 {
private final ResourceBundle bundle = ResourceBundle.getBundle(Bug6355009.class.getName());
- public final static void main(String[] args) {
+ public static final void main(String[] args) {
try {
new Bug6355009();
} catch (MissingResourceException e) {
--- a/jdk/test/java/util/ResourceBundle/Bug6356571.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/util/ResourceBundle/Bug6356571.java Fri Sep 25 12:04:35 2015 -0700
@@ -41,7 +41,7 @@
}
}
- public final static void main(String[] args) {
+ public static final void main(String[] args) {
new Bug6356571().check();
}
}
--- a/jdk/test/java/util/ResourceBundle/Control/StressTest.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/util/ResourceBundle/Control/StressTest.java Fri Sep 25 12:04:35 2015 -0700
@@ -51,7 +51,7 @@
"U.S.A.", // StressOut_en_CA.properties is empty.
"Korea"
};
- final static long startTime = System.currentTimeMillis();
+ static final long startTime = System.currentTimeMillis();
// increment each element when one getBundle call is done.
static AtomicIntegerArray counters;
--- a/jdk/test/java/util/ResourceBundle/Test4300693.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/util/ResourceBundle/Test4300693.java Fri Sep 25 12:04:35 2015 -0700
@@ -37,9 +37,9 @@
public class Test4300693 {
- static private ResourceBundle rb = ResourceBundle.getBundle("Test4300693RB");
+ private static ResourceBundle rb = ResourceBundle.getBundle("Test4300693RB");
- static public void main(String[] args) {
+ public static void main(String[] args) {
System.out.println(rb.getString("test result"));
}
--- a/jdk/test/java/util/ResourceBundle/getBaseBundleName/TestGetBaseBundleName.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/util/ResourceBundle/getBaseBundleName/TestGetBaseBundleName.java Fri Sep 25 12:04:35 2015 -0700
@@ -37,8 +37,8 @@
*/
public class TestGetBaseBundleName {
- final static String PROPERTY_BUNDLE_NAME = "resources/PropertyBundle";
- final static String LIST_BUNDLE_NAME = "resources.ListBundle";
+ static final String PROPERTY_BUNDLE_NAME = "resources/PropertyBundle";
+ static final String LIST_BUNDLE_NAME = "resources.ListBundle";
public static String getBaseName(ResourceBundle bundle) {
return bundle == null ? null : bundle.getBaseBundleName();
--- a/jdk/test/java/util/Scanner/ScanTest.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/util/Scanner/ScanTest.java Fri Sep 25 12:04:35 2015 -0700
@@ -24,25 +24,30 @@
/**
* @test
* @bug 4313885 4926319 4927634 5032610 5032622 5049968 5059533 6223711 6277261 6269946 6288823
+ * 8072722
* @summary Basic tests of java.util.Scanner methods
* @key randomness
* @run main/othervm ScanTest
*/
-import java.util.*;
+import java.io.*;
+import java.math.*;
+import java.nio.*;
import java.text.*;
-import java.io.*;
-import java.nio.*;
+import java.util.*;
+import java.util.function.Consumer;
import java.util.regex.*;
-import java.math.*;
+import java.util.stream.*;
public class ScanTest {
private static boolean failure = false;
private static int failCount = 0;
private static int NUM_SOURCE_TYPES = 2;
+ private static File inputFile = new File(System.getProperty("test.src", "."), "input.txt");
public static void main(String[] args) throws Exception {
+
Locale reservedLocale = Locale.getDefault();
String lang = reservedLocale.getLanguage();
try {
@@ -70,8 +75,10 @@
cacheTest2();
nonASCIITest();
resetTest();
+ streamCloseTest();
+ streamComodTest();
- for (int j=0; j<NUM_SOURCE_TYPES; j++) {
+ for (int j = 0; j < NUM_SOURCE_TYPES; j++) {
hasNextTest(j);
nextTest(j);
hasNextPatternTest(j);
@@ -115,149 +122,147 @@
}
public static void useCase1() throws Exception {
- File f = new File(System.getProperty("test.src", "."), "input.txt");
- Scanner sc = new Scanner(f);
- sc.findWithinHorizon("usage case 1", 0);
- String[] names = new String[4];
- for (int i=0; i<4; i++) {
- while(sc.hasNextFloat())
- sc.nextFloat();
- names[i] = sc.next();
- sc.nextLine();
+ try (Scanner sc = new Scanner(inputFile)) {
+ sc.findWithinHorizon("usage case 1", 0);
+ String[] names = new String[4];
+ for (int i=0; i<4; i++) {
+ while (sc.hasNextFloat())
+ sc.nextFloat();
+ names[i] = sc.next();
+ sc.nextLine();
+ }
+ if (!names[0].equals("Frank"))
+ failCount++;
+ if (!names[1].equals("Joe"))
+ failCount++;
+ if (!names[2].equals("Mary"))
+ failCount++;
+ if (!names[3].equals("Michelle"))
+ failCount++;
}
- if (!names[0].equals("Frank"))
- failCount++;
- if (!names[1].equals("Joe"))
- failCount++;
- if (!names[2].equals("Mary"))
- failCount++;
- if (!names[3].equals("Michelle"))
- failCount++;
- sc.close();
report("Use case 1");
}
public static void useCase2() throws Exception {
- File f = new File(System.getProperty("test.src", "."), "input.txt");
- Scanner sc = new Scanner(f).useDelimiter("-");
- String testDataTag = sc.findWithinHorizon("usage case 2\n", 0);
- if (!testDataTag.equals("usage case 2\n"))
- failCount++;
- if (!sc.next().equals("cat"))
- failCount++;
- if (sc.nextInt() != 9)
- failCount++;
- if (!sc.next().equals("dog"))
- failCount++;
- if (sc.nextInt() != 6)
- failCount++;
- if (!sc.next().equals("pig"))
- failCount++;
- if (sc.nextInt() != 2)
- failCount++;
- if (!sc.next().equals(""))
- failCount++;
- if (sc.nextInt() != 5)
- failCount++;
- sc.close();
+ try (Scanner sc = new Scanner(inputFile).useDelimiter("-")) {
+ String testDataTag = sc.findWithinHorizon("usage case 2\n", 0);
+ if (!testDataTag.equals("usage case 2\n"))
+ failCount++;
+ if (!sc.next().equals("cat"))
+ failCount++;
+ if (sc.nextInt() != 9)
+ failCount++;
+ if (!sc.next().equals("dog"))
+ failCount++;
+ if (sc.nextInt() != 6)
+ failCount++;
+ if (!sc.next().equals("pig"))
+ failCount++;
+ if (sc.nextInt() != 2)
+ failCount++;
+ if (!sc.next().equals(""))
+ failCount++;
+ if (sc.nextInt() != 5)
+ failCount++;
+ }
report("Use case 2");
}
public static void useCase3() throws Exception {
- File f = new File(System.getProperty("test.src", "."), "input.txt");
- Scanner sc = new Scanner(f);
- String testDataTag = sc.findWithinHorizon("usage case 3\n", 0);
- if (!testDataTag.equals("usage case 3\n"))
- failCount++;
- Pattern tagPattern = Pattern.compile("@[a-z]+");
- Pattern endPattern = Pattern.compile("\\*\\/");
- String tag;
- String end = sc.findInLine(endPattern);
+ try (Scanner sc = new Scanner(inputFile)) {
+ String testDataTag = sc.findWithinHorizon("usage case 3\n", 0);
+ if (!testDataTag.equals("usage case 3\n"))
+ failCount++;
+ Pattern tagPattern = Pattern.compile("@[a-z]+");
+ Pattern endPattern = Pattern.compile("\\*\\/");
+ String tag;
+ String end = sc.findInLine(endPattern);
- while (end == null) {
- if ((tag = sc.findInLine(tagPattern)) != null) {
- String text = sc.nextLine();
- text = text.substring(0, text.length() - 1);
- //System.out.println(text);
- } else {
- sc.nextLine();
+ while (end == null) {
+ if ((tag = sc.findInLine(tagPattern)) != null) {
+ String text = sc.nextLine();
+ text = text.substring(0, text.length() - 1);
+ //System.out.println(text);
+ } else {
+ sc.nextLine();
+ }
+ end = sc.findInLine(endPattern);
}
- end = sc.findInLine(endPattern);
}
report("Use case 3");
}
public static void useCase4() throws Exception {
- File f = new File(System.getProperty("test.src", "."), "input.txt");
- Scanner sc = new Scanner(f);
- String testDataTag = sc.findWithinHorizon("usage case 4\n", 0);
- if (!testDataTag.equals("usage case 4\n"))
- failCount++;
+ try (Scanner sc = new Scanner(inputFile)) {
+ String testDataTag = sc.findWithinHorizon("usage case 4\n", 0);
+ if (!testDataTag.equals("usage case 4\n"))
+ failCount++;
- // Read some text parts of four hrefs
- String[] expected = { "Diffs", "Sdiffs", "Old", "New" };
- for (int i=0; i<4; i++) {
- sc.findWithinHorizon("<a href", 1000);
- sc.useDelimiter("[<>\n]+");
- sc.next();
- String textOfRef = sc.next();
- if (!textOfRef.equals(expected[i]))
+ // Read some text parts of four hrefs
+ String[] expected = { "Diffs", "Sdiffs", "Old", "New" };
+ for (int i=0; i<4; i++) {
+ sc.findWithinHorizon("<a href", 1000);
+ sc.useDelimiter("[<>\n]+");
+ sc.next();
+ String textOfRef = sc.next();
+ if (!textOfRef.equals(expected[i]))
+ failCount++;
+ }
+ // Read some html tags using < and > as delimiters
+ if (!sc.next().equals("/a"))
failCount++;
- }
- // Read some html tags using < and > as delimiters
- if (!sc.next().equals("/a"))
- failCount++;
- if (!sc.next().equals("b"))
- failCount++;
+ if (!sc.next().equals("b"))
+ failCount++;
- // Scan some html tags using skip and next
- Pattern nonTagStart = Pattern.compile("[^<]+");
- Pattern tag = Pattern.compile("<[^>]+?>");
- Pattern spotAfterTag = Pattern.compile("(?<=>)");
- String[] expected2 = { "</b>", "<p>", "<ul>", "<li>" };
- sc.useDelimiter(spotAfterTag);
- int tagsFound = 0;
- while(tagsFound < 4) {
- if (!sc.hasNext(tag)) {
- // skip text between tags
- sc.skip(nonTagStart);
+ // Scan some html tags using skip and next
+ Pattern nonTagStart = Pattern.compile("[^<]+");
+ Pattern tag = Pattern.compile("<[^>]+?>");
+ Pattern spotAfterTag = Pattern.compile("(?<=>)");
+ String[] expected2 = { "</b>", "<p>", "<ul>", "<li>" };
+ sc.useDelimiter(spotAfterTag);
+ int tagsFound = 0;
+ while (tagsFound < 4) {
+ if (!sc.hasNext(tag)) {
+ // skip text between tags
+ sc.skip(nonTagStart);
+ }
+ String tagContents = sc.next(tag);
+ if (!tagContents.equals(expected2[tagsFound]))
+ failCount++;
+ tagsFound++;
}
- String tagContents = sc.next(tag);
- if (!tagContents.equals(expected2[tagsFound]))
- failCount++;
- tagsFound++;
}
report("Use case 4");
}
public static void useCase5() throws Exception {
- File f = new File(System.getProperty("test.src", "."), "input.txt");
- Scanner sc = new Scanner(f);
- String testDataTag = sc.findWithinHorizon("usage case 5\n", 0);
- if (!testDataTag.equals("usage case 5\n"))
- failCount++;
+ try (Scanner sc = new Scanner(inputFile)) {
+ String testDataTag = sc.findWithinHorizon("usage case 5\n", 0);
+ if (!testDataTag.equals("usage case 5\n"))
+ failCount++;
- sc.findWithinHorizon("Share Definitions", 0);
- sc.nextLine();
- sc.next("\\[([a-z]+)\\]");
- String shareName = sc.match().group(1);
- if (!shareName.equals("homes"))
- failCount++;
+ sc.findWithinHorizon("Share Definitions", 0);
+ sc.nextLine();
+ sc.next("\\[([a-z]+)\\]");
+ String shareName = sc.match().group(1);
+ if (!shareName.equals("homes"))
+ failCount++;
- String[] keys = { "comment", "browseable", "writable", "valid users" };
- String[] vals = { "Home Directories", "no", "yes", "%S" };
- for (int i=0; i<4; i++) {
- sc.useDelimiter("=");
- String key = sc.next().trim();
- if (!key.equals(keys[i]))
- failCount++;
- sc.skip("[ =]+");
- sc.useDelimiter("\n");
- String value = sc.next();
- if (!value.equals(vals[i]))
- failCount++;
- sc.nextLine();
+ String[] keys = { "comment", "browseable", "writable", "valid users" };
+ String[] vals = { "Home Directories", "no", "yes", "%S" };
+ for (int i=0; i<4; i++) {
+ sc.useDelimiter("=");
+ String key = sc.next().trim();
+ if (!key.equals(keys[i]))
+ failCount++;
+ sc.skip("[ =]+");
+ sc.useDelimiter("\n");
+ String value = sc.next();
+ if (!value.equals(vals[i]))
+ failCount++;
+ sc.nextLine();
+ }
}
report("Use case 5");
@@ -445,12 +450,12 @@
if (sc.hasNextLine()) failCount++;
// Go through all the lines in a file
- File f = new File(System.getProperty("test.src", "."), "input.txt");
- sc = new Scanner(f);
- String lastLine = "blah";
- while(sc.hasNextLine())
- lastLine = sc.nextLine();
- if (!lastLine.equals("# Data for usage case 6")) failCount++;
+ try (Scanner sc2 = new Scanner(inputFile)) {
+ String lastLine = "blah";
+ while (sc2.hasNextLine())
+ lastLine = sc2.nextLine();
+ if (!lastLine.equals("# Data for usage case 6")) failCount++;
+ }
report("Has next line test");
}
@@ -629,48 +634,47 @@
sc.delimiter();
sc.useDelimiter("blah");
sc.useDelimiter(Pattern.compile("blah"));
- for (int i=0; i<NUM_METHODS; i++) {
+
+ for (Consumer<Scanner> method : methodList) {
try {
- methodCall(sc, i);
+ method.accept(sc);
failCount++;
} catch (IllegalStateException ise) {
// Correct
}
}
+
report("Close test");
}
- private static int NUM_METHODS = 23;
-
- private static void methodCall(Scanner sc, int i) {
- switch(i) {
- case 0: sc.hasNext(); break;
- case 1: sc.next(); break;
- case 2: sc.hasNext(Pattern.compile("blah")); break;
- case 3: sc.next(Pattern.compile("blah")); break;
- case 4: sc.hasNextBoolean(); break;
- case 5: sc.nextBoolean(); break;
- case 6: sc.hasNextByte(); break;
- case 7: sc.nextByte(); break;
- case 8: sc.hasNextShort(); break;
- case 9: sc.nextShort(); break;
- case 10: sc.hasNextInt(); break;
- case 11: sc.nextInt(); break;
- case 12: sc.hasNextLong(); break;
- case 13: sc.nextLong(); break;
- case 14: sc.hasNextFloat(); break;
- case 15: sc.nextFloat(); break;
- case 16: sc.hasNextDouble(); break;
- case 17: sc.nextDouble(); break;
- case 18: sc.hasNextBigInteger(); break;
- case 19: sc.nextBigInteger(); break;
- case 20: sc.hasNextBigDecimal(); break;
- case 21: sc.nextBigDecimal(); break;
- case 22: sc.hasNextLine(); break;
- default:
- break;
- }
- }
+ static List<Consumer<Scanner>> methodList = Arrays.asList(
+ Scanner::hasNext,
+ Scanner::next,
+ sc -> sc.hasNext(Pattern.compile("blah")),
+ sc -> sc.next(Pattern.compile("blah")),
+ Scanner::hasNextBoolean,
+ Scanner::nextBoolean,
+ Scanner::hasNextByte,
+ Scanner::nextByte,
+ Scanner::hasNextShort,
+ Scanner::nextShort,
+ Scanner::hasNextInt,
+ Scanner::nextInt,
+ Scanner::hasNextLong,
+ Scanner::nextLong,
+ Scanner::hasNextFloat,
+ Scanner::nextFloat,
+ Scanner::hasNextDouble,
+ Scanner::nextDouble,
+ Scanner::hasNextBigInteger,
+ Scanner::nextBigInteger,
+ Scanner::hasNextBigDecimal,
+ Scanner::nextBigDecimal,
+ Scanner::hasNextLine,
+ Scanner::tokens,
+ sc -> sc.findAll(Pattern.compile("blah")),
+ sc -> sc.findAll("blah")
+ );
public static void removeTest() throws Exception {
Scanner sc = new Scanner("testing");
@@ -864,19 +868,20 @@
public static void fromFileTest() throws Exception {
File f = new File(System.getProperty("test.src", "."), "input.txt");
- Scanner sc = new Scanner(f).useDelimiter("\n+");
- String testDataTag = sc.findWithinHorizon("fromFileTest", 0);
- if (!testDataTag.equals("fromFileTest"))
- failCount++;
+ try (Scanner sc = new Scanner(f)) {
+ sc.useDelimiter("\n+");
+ String testDataTag = sc.findWithinHorizon("fromFileTest", 0);
+ if (!testDataTag.equals("fromFileTest"))
+ failCount++;
- int count = 0;
- while (sc.hasNextLong()) {
- long blah = sc.nextLong();
- count++;
+ int count = 0;
+ while (sc.hasNextLong()) {
+ long blah = sc.nextLong();
+ count++;
+ }
+ if (count != 7)
+ failCount++;
}
- if (count != 7)
- failCount++;
- sc.close();
report("From file");
}
@@ -884,7 +889,7 @@
Scanner s = new Scanner("1 fish 2 fish red fish blue fish");
s.useDelimiter("\\s*fish\\s*");
List <String> results = new ArrayList<String>();
- while(s.hasNext())
+ while (s.hasNext())
results.add(s.next());
System.out.println(results);
}
@@ -1472,14 +1477,112 @@
report("Reset test");
}
+ /*
+ * Test that closing the stream also closes the underlying Scanner.
+ * The cases of attempting to open streams on a closed Scanner are
+ * covered by closeTest().
+ */
+ public static void streamCloseTest() throws Exception {
+ Scanner sc;
+
+ Scanner sc1 = new Scanner("xyzzy");
+ sc1.tokens().close();
+ try {
+ sc1.hasNext();
+ failCount++;
+ } catch (IllegalStateException ise) {
+ // Correct result
+ }
+
+ Scanner sc2 = new Scanner("a b c d e f");
+ try {
+ sc2.tokens()
+ .peek(s -> sc2.close())
+ .count();
+ } catch (IllegalStateException ise) {
+ // Correct result
+ }
+
+ Scanner sc3 = new Scanner("xyzzy");
+ sc3.findAll("q").close();
+ try {
+ sc3.hasNext();
+ failCount++;
+ } catch (IllegalStateException ise) {
+ // Correct result
+ }
+
+ try (Scanner sc4 = new Scanner(inputFile)) {
+ sc4.findAll("[0-9]+")
+ .peek(s -> sc4.close())
+ .count();
+ failCount++;
+ } catch (IllegalStateException ise) {
+ // Correct result
+ }
+
+ report("Streams Close test");
+ }
+
+ /*
+ * Test ConcurrentModificationException
+ */
+ public static void streamComodTest() {
+ try {
+ Scanner sc = new Scanner("a b c d e f");
+ sc.tokens()
+ .peek(s -> sc.hasNext())
+ .count();
+ failCount++;
+ } catch (ConcurrentModificationException cme) {
+ // Correct result
+ }
+
+ try {
+ Scanner sc = new Scanner("a b c d e f");
+ Iterator<String> it = sc.tokens().iterator();
+ it.next();
+ sc.next();
+ it.next();
+ failCount++;
+ } catch (ConcurrentModificationException cme) {
+ // Correct result
+ }
+
+ try {
+ String input = IntStream.range(0, 100)
+ .mapToObj(String::valueOf)
+ .collect(Collectors.joining(" "));
+ Scanner sc = new Scanner(input);
+ sc.findAll("[0-9]+")
+ .peek(s -> sc.hasNext())
+ .count();
+ failCount++;
+ } catch (ConcurrentModificationException cme) {
+ // Correct result
+ }
+
+ try {
+ String input = IntStream.range(0, 100)
+ .mapToObj(String::valueOf)
+ .collect(Collectors.joining(" "));
+ Scanner sc = new Scanner(input);
+ Iterator<MatchResult> it = sc.findAll("[0-9]+").iterator();
+ it.next();
+ sc.next();
+ it.next();
+ failCount++;
+ } catch (ConcurrentModificationException cme) {
+ // Correct result
+ }
+
+ report("Streams Comod test");
+ }
+
private static void report(String testName) {
- int spacesToAdd = 30 - testName.length();
- StringBuffer paddedNameBuffer = new StringBuffer(testName);
- for (int i=0; i<spacesToAdd; i++)
- paddedNameBuffer.append(" ");
- String paddedName = paddedNameBuffer.toString();
- System.err.println(paddedName + ": " +
- (failCount==0 ? "Passed":"Failed("+failCount+")"));
+ System.err.printf("%-30s: %s%n", testName,
+ (failCount == 0) ? "Passed" : String.format("Failed(%d)", failCount));
+
if (failCount > 0)
failure = true;
failCount = 0;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/util/Scanner/ScannerStreamTest.java Fri Sep 25 12:04:35 2015 -0700
@@ -0,0 +1,125 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * 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 org.testng.annotations.DataProvider;
+import org.testng.annotations.Test;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.UncheckedIOException;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Scanner;
+import java.util.function.Consumer;
+import java.util.function.Supplier;
+import java.util.regex.MatchResult;
+import java.util.regex.Pattern;
+import java.util.stream.LambdaTestHelpers;
+import java.util.stream.OpTestCase;
+import java.util.stream.Stream;
+import java.util.stream.TestData;
+
+import static org.testng.Assert.*;
+
+/**
+ * @test
+ * @bug 8072722
+ * @summary Tests of stream support in java.util.Scanner
+ * @library ../stream/bootlib
+ * @build java.util.stream.OpTestCase
+ * @run testng/othervm ScannerStreamTest
+ */
+
+@Test
+public class ScannerStreamTest extends OpTestCase {
+
+ static File inputFile = new File(System.getProperty("test.src", "."), "input.txt");
+
+ @DataProvider(name = "Patterns")
+ public static Object[][] makeStreamTestData() {
+ // each inner array is [String description, String input, String delimiter]
+ // delimiter may be null
+ List<Object[]> data = new ArrayList<>();
+
+ data.add(new Object[] { "default delimiter", "abc def ghi", null });
+ data.add(new Object[] { "fixed delimiter", "abc,def,,ghi", "," });
+ data.add(new Object[] { "regexp delimiter", "###abc##def###ghi###j", "#+" });
+
+ return data.toArray(new Object[0][]);
+ }
+
+ Scanner makeScanner(String input, String delimiter) {
+ Scanner sc = new Scanner(input);
+ if (delimiter != null) {
+ sc.useDelimiter(delimiter);
+ }
+ return sc;
+ }
+
+ @Test(dataProvider = "Patterns")
+ public void tokensTest(String description, String input, String delimiter) {
+ // derive expected result by using conventional loop
+ Scanner sc = makeScanner(input, delimiter);
+ List<String> expected = new ArrayList<>();
+ while (sc.hasNext()) {
+ expected.add(sc.next());
+ }
+
+ Supplier<Stream<String>> ss = () -> makeScanner(input, delimiter).tokens();
+ withData(TestData.Factory.ofSupplier(description, ss))
+ .stream(LambdaTestHelpers.identity())
+ .expectedResult(expected)
+ .exercise();
+ }
+
+ Scanner makeFileScanner(File file) {
+ try {
+ return new Scanner(file, "UTF-8");
+ } catch (IOException ioe) {
+ throw new UncheckedIOException(ioe);
+ }
+ }
+
+ public void findAllTest() {
+ // derive expected result by using conventional loop
+ Pattern pat = Pattern.compile("[A-Z]{7,}");
+ List<String> expected = new ArrayList<>();
+
+ try (Scanner sc = makeFileScanner(inputFile)) {
+ String match;
+ while ((match = sc.findWithinHorizon(pat, 0)) != null) {
+ expected.add(match);
+ }
+ }
+
+ Supplier<Stream<String>> ss =
+ () -> makeFileScanner(inputFile).findAll(pat).map(MatchResult::group);
+
+ withData(TestData.Factory.ofSupplier("findAllTest", ss))
+ .stream(LambdaTestHelpers.identity())
+ .expectedResult(expected)
+ .exercise();
+ }
+
+}
--- a/jdk/test/java/util/ServiceLoader/Basic.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/util/ServiceLoader/Basic.java Fri Sep 25 12:04:35 2015 -0700
@@ -44,7 +44,7 @@
eq, s1, s2));
}
- static abstract class TestLoader {
+ abstract static class TestLoader {
String name;
TestLoader(String name) { this.name = name; }
--- a/jdk/test/java/util/ServiceLoader/NPE.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/util/ServiceLoader/NPE.java Fri Sep 25 12:04:35 2015 -0700
@@ -30,7 +30,7 @@
import java.util.Arrays;
public final class NPE {
- static abstract class Test {
+ abstract static class Test {
String name;
Test(String name) { this.name = name; }
--- a/jdk/test/java/util/Spliterator/SpliteratorCollisions.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/util/Spliterator/SpliteratorCollisions.java Fri Sep 25 12:04:35 2015 -0700
@@ -165,7 +165,7 @@
return spliteratorDataProviderWithNull = data.toArray(new Object[0][]);
}
- final static class HashableInteger implements Comparable<HashableInteger> {
+ static final class HashableInteger implements Comparable<HashableInteger> {
final int value;
final int hashmask; //yes duplication
--- a/jdk/test/java/util/StringJoiner/MergeTest.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/util/StringJoiner/MergeTest.java Fri Sep 25 12:04:35 2015 -0700
@@ -36,8 +36,8 @@
@Test
public class MergeTest {
- private final static String[] PREFIXES = {"", "{", "@#$%"};
- private final static String[] SUFFIXES = {"", "}", "*&%$"};
+ private static final String[] PREFIXES = {"", "{", "@#$%"};
+ private static final String[] SUFFIXES = {"", "}", "*&%$"};
private static class Fixes {
public String pre0, suf0;
--- a/jdk/test/java/util/TreeMap/ContainsValue.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/util/TreeMap/ContainsValue.java Fri Sep 25 12:04:35 2015 -0700
@@ -30,7 +30,7 @@
import java.util.*;
public class ContainsValue {
- static public void main (String[] args) {
+ public static void main (String[] args) {
Map map = new TreeMap();
if (map.containsValue ("gemutlichkeit"))
--- a/jdk/test/java/util/concurrent/BlockingQueue/OfferDrainToLoops.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/util/concurrent/BlockingQueue/OfferDrainToLoops.java Fri Sep 25 12:04:35 2015 -0700
@@ -93,7 +93,7 @@
protected boolean quittingTime(long i) {
return (i % 1024) == 0 && quittingTime();
}
- abstract protected void realRun();
+ protected abstract void realRun();
public void run() {
try { realRun(); } catch (Throwable t) { unexpected(t); }
}
--- a/jdk/test/java/util/concurrent/ConcurrentQueues/OfferRemoveLoops.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/util/concurrent/ConcurrentQueues/OfferRemoveLoops.java Fri Sep 25 12:04:35 2015 -0700
@@ -89,7 +89,7 @@
protected boolean quittingTime(long i) {
return (i % 1024) == 0 && quittingTime();
}
- abstract protected void realRun();
+ protected abstract void realRun();
public void run() {
try { realRun(); } catch (Throwable t) { unexpected(t); }
}
--- a/jdk/test/java/util/concurrent/FutureTask/DoneTimedGetLoops.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/util/concurrent/FutureTask/DoneTimedGetLoops.java Fri Sep 25 12:04:35 2015 -0700
@@ -44,7 +44,7 @@
final long testDurationMillis;
static class PublicFutureTask extends FutureTask<Boolean> {
- final static Runnable noop = new Runnable() { public void run() {} };
+ static final Runnable noop = new Runnable() { public void run() {} };
PublicFutureTask() { super(noop, null); }
public void set(Boolean v) { super.set(v); }
public void setException(Throwable t) { super.setException(t); }
@@ -81,7 +81,7 @@
protected boolean quittingTime(long i) {
return (i % 1024) == 0 && quittingTime();
}
- abstract protected void realRun() throws Exception;
+ protected abstract void realRun() throws Exception;
public void run() {
try { realRun(); } catch (Throwable t) { unexpected(t); }
}
--- a/jdk/test/java/util/concurrent/Phaser/Basic.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/util/concurrent/Phaser/Basic.java Fri Sep 25 12:04:35 2015 -0700
@@ -111,7 +111,7 @@
// Convenience methods for creating threads that call arrive,
// awaitAdvance, arriveAndAwaitAdvance, awaitAdvanceInterruptibly
//----------------------------------------------------------------
- private static abstract class Arriver extends Thread {
+ private abstract static class Arriver extends Thread {
static AtomicInteger count = new AtomicInteger(1);
Arriver() {
@@ -131,7 +131,7 @@
public int phase() { return this.phase; }
}
- private static abstract class Awaiter extends Arriver {
+ private abstract static class Awaiter extends Arriver {
Awaiter() { super("Awaiter"); }
Awaiter(String name) { super(name); }
}
--- a/jdk/test/java/util/concurrent/locks/StampedLock/Basic.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/util/concurrent/locks/StampedLock/Basic.java Fri Sep 25 12:04:35 2015 -0700
@@ -75,7 +75,7 @@
}
}
- static abstract class Locker extends Thread {
+ abstract static class Locker extends Thread {
static AtomicInteger count = new AtomicInteger(1);
private volatile Throwable thrown;
private volatile long stamp;;
@@ -94,7 +94,7 @@
}
}
- static abstract class Reader extends Locker {
+ abstract static class Reader extends Locker {
Reader() { super("Reader"); }
Reader(String name) { super(name); }
}
@@ -173,7 +173,7 @@
: interruptibleReader(sl, timeout, unit, gate);
}
- static abstract class Writer extends Locker {
+ abstract static class Writer extends Locker {
Writer() { super("Writer"); }
Writer(String name) { super(name); }
}
--- a/jdk/test/java/util/jar/JarEntry/GetMethodsReturnClones.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/util/jar/JarEntry/GetMethodsReturnClones.java Fri Sep 25 12:04:35 2015 -0700
@@ -36,7 +36,7 @@
public class GetMethodsReturnClones {
- private final static String BASE = System.getProperty("test.src", ".") +
+ private static final String BASE = System.getProperty("test.src", ".") +
System.getProperty("file.separator");
public static void main(String[] args) throws Exception {
--- a/jdk/test/java/util/jar/TestExtra.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/util/jar/TestExtra.java Fri Sep 25 12:04:35 2015 -0700
@@ -42,13 +42,13 @@
* TestJarExtra checks JAR files.
*/
public class TestExtra {
- final static int JAR_MAGIC = 0xcafe; // private IN JarOutputStream.java
- final static int TEST_HEADER = 0xbabe;
+ static final int JAR_MAGIC = 0xcafe; // private IN JarOutputStream.java
+ static final int TEST_HEADER = 0xbabe;
- final static Charset ascii = Charset.forName("ASCII");
+ static final Charset ascii = Charset.forName("ASCII");
// ZipEntry extra data
- final static byte[][] extra = new byte[][] {
+ static final byte[][] extra = new byte[][] {
ascii.encode("hello, world").array(),
ascii.encode("foo bar").array()
};
--- a/jdk/test/java/util/logging/AnonymousLogger/TestAnonymousLogger.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/util/logging/AnonymousLogger/TestAnonymousLogger.java Fri Sep 25 12:04:35 2015 -0700
@@ -43,7 +43,7 @@
*/
public class TestAnonymousLogger {
- final public static class TestHandler extends Handler {
+ public static final class TestHandler extends Handler {
@Override
public void publish(LogRecord record) {
System.out.println(new SimpleFormatter().format(record));
@@ -58,14 +58,14 @@
}
}
- final public static class TestFilter implements Filter {
+ public static final class TestFilter implements Filter {
@Override
public boolean isLoggable(LogRecord record) {
return true;
}
}
- final public static class TestBundle extends ResourceBundle {
+ public static final class TestBundle extends ResourceBundle {
Set<String> keys = Collections.synchronizedSet(new LinkedHashSet<>());
@Override
protected Object handleGetObject(String key) {
--- a/jdk/test/java/util/logging/DrainFindDeadlockTest.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/util/logging/DrainFindDeadlockTest.java Fri Sep 25 12:04:35 2015 -0700
@@ -47,14 +47,14 @@
*/
public class DrainFindDeadlockTest {
private LogManager mgr = LogManager.getLogManager();
- private final static int MAX_ITERATIONS = 100;
+ private static final int MAX_ITERATIONS = 100;
// Get a ThreadMXBean so we can check for deadlock. N.B. this may
// not be supported on all platforms, which means we will have to
// resort to the traditional test timeout method. However, if
// we have the support we'll get the deadlock details if one
// is detected.
- private final static ThreadMXBean threadMXBean =
+ private static final ThreadMXBean threadMXBean =
ManagementFactory.getThreadMXBean();
private final boolean threadMXBeanDeadlockSupported =
threadMXBean.isSynchronizerUsageSupported();
--- a/jdk/test/java/util/logging/FileHandlerLongLimit.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/util/logging/FileHandlerLongLimit.java Fri Sep 25 12:04:35 2015 -0700
@@ -441,7 +441,7 @@
}
- final static class PermissionsBuilder {
+ static final class PermissionsBuilder {
final Permissions perms;
public PermissionsBuilder() {
this(new Permissions());
--- a/jdk/test/java/util/logging/FileHandlerPath.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/util/logging/FileHandlerPath.java Fri Sep 25 12:04:35 2015 -0700
@@ -77,11 +77,11 @@
// Use a random name provided by UUID to avoid collision with other tests
- final static String logFile = FileHandlerPath.class.getSimpleName() + "_"
+ static final String logFile = FileHandlerPath.class.getSimpleName() + "_"
+ UUID.randomUUID().toString() + ".log";
- final static String tmpLogFile;
- final static String userDir = System.getProperty("user.dir");
- final static String tmpDir = System.getProperty("java.io.tmpdir");
+ static final String tmpLogFile;
+ static final String userDir = System.getProperty("user.dir");
+ static final String tmpDir = System.getProperty("java.io.tmpdir");
private static final List<Properties> properties;
static {
tmpLogFile = new File(tmpDir, logFile).toString();
@@ -241,7 +241,7 @@
}
- final static class PermissionsBuilder {
+ static final class PermissionsBuilder {
final Permissions perms;
public PermissionsBuilder() {
this(new Permissions());
--- a/jdk/test/java/util/logging/FileHandlerPatternExceptions.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/util/logging/FileHandlerPatternExceptions.java Fri Sep 25 12:04:35 2015 -0700
@@ -265,7 +265,7 @@
}
- final static class PermissionsBuilder {
+ static final class PermissionsBuilder {
final Permissions perms;
public PermissionsBuilder() {
this(new Permissions());
--- a/jdk/test/java/util/logging/HigherResolutionTimeStamps/SerializeLogRecord.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/util/logging/HigherResolutionTimeStamps/SerializeLogRecord.java Fri Sep 25 12:04:35 2015 -0700
@@ -137,7 +137,7 @@
* different java version can be deserialized in the current java version.
* (see Jdk8SerializedLog and Jdk9SerializedLog below)
*/
- public static abstract class SerializedLog {
+ public abstract static class SerializedLog {
public abstract String getBase64();
public abstract String getString();
--- a/jdk/test/java/util/logging/HigherResolutionTimeStamps/XmlFormatterNanos.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/util/logging/HigherResolutionTimeStamps/XmlFormatterNanos.java Fri Sep 25 12:04:35 2015 -0700
@@ -121,7 +121,7 @@
}
}
- final static List<Properties> properties;
+ static final List<Properties> properties;
static {
Properties props1 = new Properties();
props1.setProperty("test.name", "with XML nano element (default)");
--- a/jdk/test/java/util/logging/LogManager/Configuration/ParentLoggerWithHandlerGC.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/util/logging/LogManager/Configuration/ParentLoggerWithHandlerGC.java Fri Sep 25 12:04:35 2015 -0700
@@ -451,7 +451,7 @@
}
- final static class PermissionsBuilder {
+ static final class PermissionsBuilder {
final Permissions perms;
public PermissionsBuilder() {
this(new Permissions());
--- a/jdk/test/java/util/logging/LogManager/Configuration/TestConfigurationLock.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/util/logging/LogManager/Configuration/TestConfigurationLock.java Fri Sep 25 12:04:35 2015 -0700
@@ -197,7 +197,7 @@
}
}
- final static class ResetConf extends Thread {
+ static final class ResetConf extends Thread {
public ResetConf() {
setDaemon(true);
@@ -228,7 +228,7 @@
}
}
- final static class ReadConf extends Thread {
+ static final class ReadConf extends Thread {
public ReadConf() {
setDaemon(true);
@@ -259,7 +259,7 @@
}
}
- final static class AddLogger extends Thread {
+ static final class AddLogger extends Thread {
public AddLogger() {
setDaemon(true);
@@ -293,7 +293,7 @@
}
}
- final static class DeadlockDetector extends Thread {
+ static final class DeadlockDetector extends Thread {
@Override
public void run() {
--- a/jdk/test/java/util/logging/LogManagerAppContextDeadlock.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/util/logging/LogManagerAppContextDeadlock.java Fri Sep 25 12:04:35 2015 -0700
@@ -63,7 +63,7 @@
// Emulate AppContext
static class FakeAppContext {
- final static AtomicInteger numAppContexts = new AtomicInteger(0);
+ static final AtomicInteger numAppContexts = new AtomicInteger(0);
static final class FakeAppContextLock {}
static final FakeAppContextLock lock = new FakeAppContextLock();
static volatile FakeAppContext appContext;
@@ -220,7 +220,7 @@
}
// A thread that detect deadlocks.
- final static class DeadlockDetector extends Thread {
+ static final class DeadlockDetector extends Thread {
public DeadlockDetector() {
this.setDaemon(true);
@@ -302,7 +302,7 @@
}
// A Helper class to build a set of permissions.
- final static class PermissionsBuilder {
+ static final class PermissionsBuilder {
final Permissions perms;
public PermissionsBuilder() {
this(new Permissions());
--- a/jdk/test/java/util/logging/Logger/entering/LoggerEnteringWithParams.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/util/logging/Logger/entering/LoggerEnteringWithParams.java Fri Sep 25 12:04:35 2015 -0700
@@ -43,7 +43,7 @@
*/
public class LoggerEnteringWithParams {
- final static Object[] data = {
+ static final Object[] data = {
"one", "two", "three", "four", "five", "six", "seven", "eight"
};
--- a/jdk/test/java/util/logging/Logger/getGlobal/TestGetGlobal.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/util/logging/Logger/getGlobal/TestGetGlobal.java Fri Sep 25 12:04:35 2015 -0700
@@ -45,7 +45,7 @@
*/
public class TestGetGlobal {
- final static String[] messages = {
+ static final String[] messages = {
"1. This message should not appear on the console.",
"2. This message should appear on the console.",
"3. This message should now appear on the console too."
--- a/jdk/test/java/util/logging/Logger/getGlobal/TestGetGlobalByName.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/util/logging/Logger/getGlobal/TestGetGlobalByName.java Fri Sep 25 12:04:35 2015 -0700
@@ -45,7 +45,7 @@
*/
public class TestGetGlobalByName {
- final static String[] messages = {
+ static final String[] messages = {
"1. This message should not appear on the console.",
"2. This message should appear on the console.",
"3. This message should now appear on the console too."
--- a/jdk/test/java/util/logging/Logger/getGlobal/TestGetGlobalConcurrent.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/util/logging/Logger/getGlobal/TestGetGlobalConcurrent.java Fri Sep 25 12:04:35 2015 -0700
@@ -46,7 +46,7 @@
*/
public class TestGetGlobalConcurrent {
- final static String[] messages = {
+ static final String[] messages = {
"1. This message should not appear on the console.",
"2. This message should appear on the console.",
"3. This message should now appear on the console too.",
@@ -135,16 +135,16 @@
}
}
- final static class Run1 implements Runnable {
+ static final class Run1 implements Runnable {
public void run() { test1(); }
}
- final static class Run2 implements Runnable {
+ static final class Run2 implements Runnable {
public void run() { test2(); }
}
- final static class Run3 implements Runnable {
+ static final class Run3 implements Runnable {
public void run() { test3(); }
}
- final static class Run4 implements Runnable {
+ static final class Run4 implements Runnable {
public void run() { test4(); }
}
--- a/jdk/test/java/util/logging/Logger/getGlobal/testgetglobal/HandlerImpl.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/util/logging/Logger/getGlobal/testgetglobal/HandlerImpl.java Fri Sep 25 12:04:35 2015 -0700
@@ -33,7 +33,7 @@
*/
public class HandlerImpl extends ConsoleHandler {
- public final static List<String> received = new CopyOnWriteArrayList<>();
+ public static final List<String> received = new CopyOnWriteArrayList<>();
public HandlerImpl() {
}
--- a/jdk/test/java/util/logging/Logger/logrb/TestLogrbResourceBundle.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/util/logging/Logger/logrb/TestLogrbResourceBundle.java Fri Sep 25 12:04:35 2015 -0700
@@ -40,8 +40,8 @@
*/
public class TestLogrbResourceBundle {
- final static String LIST_BUNDLE_NAME = "resources.ListBundle";
- final static String PROPERTY_BUNDLE_NAME = "resources.PropertyBundle";
+ static final String LIST_BUNDLE_NAME = "resources.ListBundle";
+ static final String PROPERTY_BUNDLE_NAME = "resources.PropertyBundle";
/**
* A dummy handler class that we can use to check the bundle/bundle name
--- a/jdk/test/java/util/logging/Logger/setResourceBundle/TestSetResourceBundle.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/util/logging/Logger/setResourceBundle/TestSetResourceBundle.java Fri Sep 25 12:04:35 2015 -0700
@@ -49,8 +49,8 @@
*/
public class TestSetResourceBundle {
- final static String LIST_BUNDLE_NAME = "resources.ListBundle";
- final static String PROPERTY_BUNDLE_NAME = "resources.PropertyBundle";
+ static final String LIST_BUNDLE_NAME = "resources.ListBundle";
+ static final String PROPERTY_BUNDLE_NAME = "resources.PropertyBundle";
/**
* A dummy handler class that we can use to check the bundle/bundle name
--- a/jdk/test/java/util/logging/LoggerResourceBundleRace.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/util/logging/LoggerResourceBundleRace.java Fri Sep 25 12:04:35 2015 -0700
@@ -38,17 +38,17 @@
public class LoggerResourceBundleRace extends RacingThreadsTest {
- private final static int N_LOOPS = 500000; // # of race loops
- private final static int N_SECS = 15; // # of secs to run test
+ private static final int N_LOOPS = 500000; // # of race loops
+ private static final int N_SECS = 15; // # of secs to run test
// # of parallel threads; must match number of MyResources inner classes
- private final static int N_THREADS = 3;
+ private static final int N_THREADS = 3;
- private final static String LOGGER_PREFIX = "myLogger-";
- private final static String RESOURCE_PREFIX
+ private static final String LOGGER_PREFIX = "myLogger-";
+ private static final String RESOURCE_PREFIX
= "LoggerResourceBundleRace$MyResources";
// these counters are AtomicInteger since any worker thread can increment
- private final static AtomicInteger iaeCnt = new AtomicInteger();
- private final static AtomicInteger worksCnt = new AtomicInteger();
+ private static final AtomicInteger iaeCnt = new AtomicInteger();
+ private static final AtomicInteger worksCnt = new AtomicInteger();
Logger dummy; // dummy Logger
@@ -156,7 +156,7 @@
// N_THREADS above must match number of MyResources inner classes
//
public static class MyResources0 extends ListResourceBundle {
- final static Object[][] contents = {
+ static final Object[][] contents = {
{"sample1", "translation #1 for sample1"},
{"sample2", "translation #1 for sample2"},
};
@@ -167,7 +167,7 @@
}
public static class MyResources1 extends ListResourceBundle {
- final static Object[][] contents = {
+ static final Object[][] contents = {
{"sample1", "translation #2 for sample1"},
{"sample2", "translation #2 for sample2"},
};
@@ -178,7 +178,7 @@
}
public static class MyResources2 extends ListResourceBundle {
- final static Object[][] contents = {
+ static final Object[][] contents = {
{"sample1", "translation #3 for sample1"},
{"sample2", "translation #3 for sample2"},
};
--- a/jdk/test/java/util/logging/RootLogger/RootLevelInConfigFile.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/util/logging/RootLogger/RootLevelInConfigFile.java Fri Sep 25 12:04:35 2015 -0700
@@ -49,7 +49,7 @@
*/
public class RootLevelInConfigFile {
- public final static String CONFIG_FILE_KEY = "java.util.logging.config.file";
+ public static final String CONFIG_FILE_KEY = "java.util.logging.config.file";
public static void main(String[] args) throws IOException {
System.setProperty(CONFIG_FILE_KEY,
--- a/jdk/test/java/util/logging/TestAppletLoggerContext.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/util/logging/TestAppletLoggerContext.java Fri Sep 25 12:04:35 2015 -0700
@@ -116,7 +116,7 @@
public Object getAppletContext() { return active ? exc : null; }
}
- final static JavaAWTAccessStub javaAwtAccess = new JavaAWTAccessStub();
+ static final JavaAWTAccessStub javaAwtAccess = new JavaAWTAccessStub();
public static void init() {
SharedSecrets.setJavaAWTAccess(javaAwtAccess);
if (System.getProperty("test.security", "on").equals("on")) {
--- a/jdk/test/java/util/logging/TestConfigurationListeners.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/util/logging/TestConfigurationListeners.java Fri Sep 25 12:04:35 2015 -0700
@@ -429,7 +429,7 @@
}
- final static class PermissionsBuilder {
+ static final class PermissionsBuilder {
final Permissions perms;
public PermissionsBuilder() {
this(new Permissions());
--- a/jdk/test/java/util/logging/TestLogConfigurationDeadLock.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/util/logging/TestLogConfigurationDeadLock.java Fri Sep 25 12:04:35 2015 -0700
@@ -148,7 +148,7 @@
}
- final static class ReadConf extends Thread {
+ static final class ReadConf extends Thread {
@Override
public void run() {
while (goOn) {
@@ -163,7 +163,7 @@
}
}
- final static class AddLogger extends Thread {
+ static final class AddLogger extends Thread {
@Override
public void run() {
try {
@@ -184,7 +184,7 @@
}
}
- final static class DeadlockDetector extends Thread {
+ static final class DeadlockDetector extends Thread {
@Override
public void run() {
--- a/jdk/test/java/util/logging/TestLogConfigurationDeadLockWithConf.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/util/logging/TestLogConfigurationDeadLockWithConf.java Fri Sep 25 12:04:35 2015 -0700
@@ -219,7 +219,7 @@
}
}
- final static class ReadConf extends DaemonThread {
+ static final class ReadConf extends DaemonThread {
@Override
public void run() {
while (goOn) {
@@ -234,7 +234,7 @@
}
}
- final static class AddLogger extends DaemonThread {
+ static final class AddLogger extends DaemonThread {
@Override
public void run() {
try {
@@ -254,7 +254,7 @@
}
}
- final static class DeadlockDetector extends Thread {
+ static final class DeadlockDetector extends Thread {
final Set<Long> deadlocked = Collections.synchronizedSet(new HashSet<Long>());
--- a/jdk/test/java/util/logging/TestLoggerBundleSync.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/util/logging/TestLoggerBundleSync.java Fri Sep 25 12:04:35 2015 -0700
@@ -192,7 +192,7 @@
}
- final static class GetRB extends Thread {
+ static final class GetRB extends Thread {
final class MyHandler extends Handler {
volatile ResourceBundle rb;
volatile String rbName;
@@ -327,10 +327,10 @@
}
}
- final static class SetRB extends Thread {
+ static final class SetRB extends Thread {
final Class<? extends ResourceBundle> type;
- final static ExecutorService executor = Executors.newSingleThreadExecutor();
- final static class CheckRBTask implements Callable<Exception> {
+ static final ExecutorService executor = Executors.newSingleThreadExecutor();
+ static final class CheckRBTask implements Callable<Exception> {
final Logger logger;
volatile String rbName;
volatile ResourceBundle rb;
@@ -431,11 +431,11 @@
}
}
- final static class SetRBName extends Thread {
+ static final class SetRBName extends Thread {
int nexti = 0;
final Class<? extends ResourceBundle> type;
- final static ExecutorService executor = Executors.newSingleThreadExecutor();
- final static class CheckRBNameTask implements Callable<Exception> {
+ static final ExecutorService executor = Executors.newSingleThreadExecutor();
+ static final class CheckRBNameTask implements Callable<Exception> {
final Logger logger;
volatile String rbName;
@@ -535,7 +535,7 @@
}
}
- final static class DeadlockDetector extends Thread {
+ static final class DeadlockDetector extends Thread {
@Override
public void run() {
--- a/jdk/test/java/util/logging/bundlesearch/IndirectlyLoadABundle.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/util/logging/bundlesearch/IndirectlyLoadABundle.java Fri Sep 25 12:04:35 2015 -0700
@@ -38,7 +38,7 @@
*/
public class IndirectlyLoadABundle {
- private final static String rbName = "CallerSearchableResource";
+ private static final String rbName = "CallerSearchableResource";
public boolean loadAndTest() throws Throwable {
// Make sure we can find it via the URLClassLoader
--- a/jdk/test/java/util/logging/bundlesearch/LoadItUp2.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/util/logging/bundlesearch/LoadItUp2.java Fri Sep 25 12:04:35 2015 -0700
@@ -34,7 +34,7 @@
*/
public class LoadItUp2 {
- private final static boolean DEBUG = false;
+ private static final boolean DEBUG = false;
public Boolean test(String rbName) throws Exception {
// we should not be able to find the resource in this directory via
--- a/jdk/test/java/util/logging/bundlesearch/ResourceBundleSearchTest.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/util/logging/bundlesearch/ResourceBundleSearchTest.java Fri Sep 25 12:04:35 2015 -0700
@@ -47,11 +47,11 @@
*/
public class ResourceBundleSearchTest {
- private final static boolean DEBUG = false;
- private final static String LOGGER_PREFIX = "myLogger.";
+ private static final boolean DEBUG = false;
+ private static final String LOGGER_PREFIX = "myLogger.";
private static int loggerNum = 0;
- private final static String PROP_RB_NAME = "ClassPathTestBundle";
- private final static String TCCL_TEST_BUNDLE = "ContextClassLoaderTestBundle";
+ private static final String PROP_RB_NAME = "ClassPathTestBundle";
+ private static final String TCCL_TEST_BUNDLE = "ContextClassLoaderTestBundle";
private static int numPass = 0;
private static int numFail = 0;
--- a/jdk/test/java/util/logging/bundlesearch/TwiceIndirectlyLoadABundle.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/util/logging/bundlesearch/TwiceIndirectlyLoadABundle.java Fri Sep 25 12:04:35 2015 -0700
@@ -37,7 +37,7 @@
*/
public class TwiceIndirectlyLoadABundle {
- private final static String rbName = "StackSearchableResource";
+ private static final String rbName = "StackSearchableResource";
public boolean loadAndTest() throws Throwable {
// Find out where we are running from so we can setup the URLClassLoader URLs
--- a/jdk/test/java/util/regex/POSIX_Unicode.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/util/regex/POSIX_Unicode.java Fri Sep 25 12:04:35 2015 -0700
@@ -24,7 +24,7 @@
import java.util.HashMap;
import java.util.Locale;
-final public class POSIX_Unicode {
+public final class POSIX_Unicode {
public static boolean isAlpha(int ch) {
return Character.isAlphabetic(ch);
--- a/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/CollectorsTest.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/CollectorsTest.java Fri Sep 25 12:04:35 2015 -0700
@@ -77,7 +77,7 @@
*/
public class CollectorsTest extends OpTestCase {
- private static abstract class CollectorAssertion<T, U> {
+ private abstract static class CollectorAssertion<T, U> {
abstract void assertValue(U value,
Supplier<Stream<T>> source,
boolean ordered) throws ReflectiveOperationException;
--- a/jdk/test/java/util/zip/ChecksumBase.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/util/zip/ChecksumBase.java Fri Sep 25 12:04:35 2015 -0700
@@ -31,7 +31,7 @@
public class ChecksumBase {
- private final static byte[] BYTES_123456789 = "123456789".getBytes(StandardCharsets.US_ASCII);
+ private static final byte[] BYTES_123456789 = "123456789".getBytes(StandardCharsets.US_ASCII);
public static void testAll(Checksum checksum, long expected) {
testBytes(checksum, expected);
--- a/jdk/test/java/util/zip/FlaterCriticalArray.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/util/zip/FlaterCriticalArray.java Fri Sep 25 12:04:35 2015 -0700
@@ -71,7 +71,7 @@
/*
* Base class for individual test cases
*/
- abstract static private class TestCase {
+ private abstract static class TestCase {
protected String name; // For information in debug messages
protected byte data[]; // Data to be deflated and subsequently inflated
protected int level; // Compression level for deflater
@@ -110,9 +110,9 @@
debug(name, inOut, duration, length);
}
- abstract protected byte[] deflate(byte data[], int level) throws Throwable;
+ protected abstract byte[] deflate(byte data[], int level) throws Throwable;
- abstract protected byte[] inflate(byte deflated[]) throws Throwable;
+ protected abstract byte[] inflate(byte deflated[]) throws Throwable;
}
/*
--- a/jdk/test/java/util/zip/FlaterTest.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/util/zip/FlaterTest.java Fri Sep 25 12:04:35 2015 -0700
@@ -92,7 +92,7 @@
new FlaterTest().go(numThreads);
}
- synchronized private void go(int numThreads) throws Throwable {
+ private synchronized void go(int numThreads) throws Throwable {
int deflatedLength = getDeflatedLength();
long time = System.currentTimeMillis();
--- a/jdk/test/java/util/zip/ZipFile/FinalizeZipFile.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/java/util/zip/ZipFile/FinalizeZipFile.java Fri Sep 25 12:04:35 2015 -0700
@@ -34,7 +34,7 @@
public class FinalizeZipFile {
- private final static CountDownLatch finalizersDone = new CountDownLatch(3);
+ private static final CountDownLatch finalizersDone = new CountDownLatch(3);
private static class InstrumentedZipFile extends ZipFile {
--- a/jdk/test/javax/management/remote/mandatory/connection/CloseableTest.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/javax/management/remote/mandatory/connection/CloseableTest.java Fri Sep 25 12:04:35 2015 -0700
@@ -40,7 +40,6 @@
import javax.management.remote.rmi.RMIConnectionImpl;
import javax.management.remote.rmi.RMIConnectionImpl_Stub;
import javax.management.remote.rmi.RMIConnector;
-import javax.management.remote.rmi.RMIIIOPServerImpl;
import javax.management.remote.rmi.RMIJRMPServerImpl;
import javax.management.remote.rmi.RMIServerImpl;
@@ -52,7 +51,6 @@
RMIConnectionImpl.class,
RMIConnectionImpl_Stub.class,
RMIServerImpl.class,
- RMIIIOPServerImpl.class,
RMIJRMPServerImpl.class
};
--- a/jdk/test/javax/management/remote/mandatory/connection/NoIIOP.java Thu Sep 17 16:53:42 2015 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,142 +0,0 @@
-/*
- * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
- * 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 8004502
- * @summary Sanity check that attempts to use the IIOP transport or
- * RMIIIOPServerImpl when RMI/IIOP not present throws the expected exceptions
- * @modules java.management
- */
-
-import javax.management.MBeanServer;
-import javax.management.MBeanServerFactory;
-import javax.management.remote.*;
-import javax.management.remote.rmi.*;
-import java.net.MalformedURLException;
-import java.io.IOException;
-import javax.security.auth.Subject;
-import java.rmi.NoSuchObjectException;
-import javax.management.remote.JMXConnectorFactory;
-import javax.management.remote.JMXConnectorServerFactory;
-
-public class NoIIOP {
-
- /**
- * RMIIIOPServerImpl implementation for testing purposes (methods are
- * overridden to be public to allow for testing)
- */
- static class MyRMIIIOPServerImpl extends RMIIIOPServerImpl {
- MyRMIIIOPServerImpl() throws IOException {
- super(null);
- }
- @Override
- public void export() throws IOException {
- super.export();
- }
- @Override
- public String getProtocol() {
- return super.getProtocol();
- }
- @Override
- public RMIConnection makeClient(String connectionId, Subject subject)
- throws IOException
- {
- return super.makeClient(connectionId, subject);
- }
- @Override
- public void closeClient(RMIConnection client) throws IOException {
- super.closeClient(client);
- }
- @Override
- public void closeServer() throws IOException {
- super.closeServer();
- }
- }
-
-
- public static void main(String[] args) throws Exception {
- try {
- Class.forName("javax.management.remote.rmi._RMIConnectionImpl_Tie");
- System.out.println("RMI/IIOP appears to be supported, test skipped");
- return;
- } catch (ClassNotFoundException okay) { }
-
- JMXServiceURL url = new JMXServiceURL("service:jmx:iiop://");
- MBeanServer mbs = MBeanServerFactory.createMBeanServer();
-
-
- // test JMXConnectorFactory/JMXConnectorServerFactory
-
- try {
- JMXConnectorFactory.connect(url);
- throw new RuntimeException("connect did not throw MalformedURLException");
- } catch (MalformedURLException expected) { }
-
- try {
- JMXConnectorServerFactory.newJMXConnectorServer(url, null, null);
- throw new RuntimeException("newJMXConnectorServer did not throw MalformedURLException");
- } catch (MalformedURLException expected) { }
-
-
- // test RMIConnector/RMIConnectorServer
-
- RMIConnector connector = new RMIConnector(url, null);
- try {
- connector.connect();
- throw new RuntimeException("connect did not throw IOException");
- } catch (IOException expected) { }
-
- RMIConnectorServer server = new RMIConnectorServer(url, null, mbs);
- try {
- server.start();
- throw new RuntimeException("start did not throw IOException");
- } catch (IOException expected) { }
-
-
- // test RMIIIOPServerImpl
-
- MyRMIIIOPServerImpl impl = new MyRMIIIOPServerImpl();
- impl.setMBeanServer(mbs);
- System.out.println(impl.getProtocol());
-
- try {
- impl.export();
- throw new RuntimeException("export did not throw IOException");
- } catch (IOException expected) { }
-
- try {
- impl.newClient(null);
- throw new RuntimeException("newClient did not throw IOException");
- } catch (IOException expected) { }
-
- try {
- impl.toStub();
- throw new RuntimeException("toStub did not throw NoSuchObjectException");
- } catch (NoSuchObjectException expected) { }
-
- try {
- impl.closeServer();
- throw new RuntimeException("closeServer did not throw NoSuchObjectException");
- } catch (NoSuchObjectException expected) { }
- }
-}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/sound/sampled/FileReader/RepeatedFormatReader.java Fri Sep 25 12:04:35 2015 -0700
@@ -0,0 +1,86 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * 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.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+
+import javax.sound.sampled.AudioSystem;
+import javax.sound.sampled.UnsupportedAudioFileException;
+
+/**
+ * @test
+ * @bug 8133677
+ * @summary Subsequent read from the same stream should work
+ */
+public final class RepeatedFormatReader {
+
+ // Stubs
+
+ private static byte[] headerMIDI = {0x4d, 0x54, 0x68, 0x64, // MThd
+ 0, 0, 0, 6, // read header length
+ 0, 0, // type
+ 0, 0, // numtracks
+ 0, 1, // timing
+ };
+
+ private static byte[] headerAU = {0x2e, 0x73, 0x6e, 0x64, // AU_SUN_MAGIC
+ 0, 0, 0, 0, // headerSize
+ 0, 0, 0, 0, // dataSize
+ 0, 0, 0, 1, // encoding
+ 0, 0, 0, 0, // sampleRate
+ 0, 0, 0, 1 // channels
+ };
+
+ private static byte[] headerWAV = {0x52, 0x49, 0x46, 0x46, // RIFF_MAGIC
+ 1, 1, 1, 1, // fileLength
+ 0x57, 0x41, 0x56, 0x45, // waveMagic
+ 0x66, 0x6d, 0x74, 0x20, // FMT_MAGIC
+ 3, 0, 0, 0, // length
+ 1, 0, // wav_type WAVE_FORMAT_PCM
+ 0, 1, // channels
+ 0, 0, 0, 0, // sampleRate
+ 0, 0, 0, 0, // avgBytesPerSec
+ 0, 0, // blockAlign
+ 1, 0, // sampleSizeInBits
+ 0x64, 0x61, 0x74, 0x61, // DATA_MAGIC
+ 0, 0, 0, 0, // dataLength
+ };
+
+ private static final byte[][] data = {headerMIDI, headerAU, headerWAV};
+
+ public static void main(final String[] args)
+ throws IOException, UnsupportedAudioFileException {
+ for (final byte[] bytes : data) {
+ test(bytes);
+ }
+ }
+
+ private static void test(final byte[] buffer)
+ throws IOException, UnsupportedAudioFileException {
+ final InputStream is = new ByteArrayInputStream(buffer);
+ for (int i = 0; i < 10; ++i) {
+ AudioSystem.getAudioFileFormat(is);
+ }
+ }
+}
--- a/jdk/test/javax/swing/JInternalFrame/8020708/bug8020708.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/javax/swing/JInternalFrame/8020708/bug8020708.java Fri Sep 25 12:04:35 2015 -0700
@@ -35,7 +35,7 @@
/**
* @test
- * @bug 8020708
+ * @bug 8020708 8032568
* @author Alexander Scherbatiy
* @summary NLS: mnemonics missing in SwingSet2/JInternalFrame demo
* @library ../../regtesthelpers
@@ -111,8 +111,14 @@
Util.hitKeys(robot, KeyEvent.VK_CONTROL, KeyEvent.VK_SPACE);
robot.waitForIdle();
-
- Util.hitKeys(robot, KeyEvent.VK_C);
+ int keyCode = KeyEvent.VK_C;
+ String mnemonic = UIManager
+ .getString("InternalFrameTitlePane.closeButton.mnemonic");
+ try {
+ keyCode = Integer.parseInt(mnemonic);
+ } catch (NumberFormatException e) {
+ }
+ Util.hitKeys(robot, keyCode);
robot.waitForIdle();
robot.delay(500);
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/swing/JTableHeader/6442918/bug6442918a.java Fri Sep 25 12:04:35 2015 -0700
@@ -0,0 +1,87 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * 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 6442918 8005914
+ @summary Ensures that empty table headers do not show "..."
+ @author Shannon Hickey
+ @library ../../regtesthelpers
+ @build Util
+ @run main/manual bug6442918a
+ @requires os.family == "windows"
+*/
+
+import java.awt.BorderLayout;
+import java.awt.Dimension;
+import javax.swing.JDialog;
+import javax.swing.JFrame;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import javax.swing.JTable;
+import javax.swing.JTextArea;
+import javax.swing.SwingUtilities;
+import javax.swing.UIManager;
+import javax.swing.table.DefaultTableCellRenderer;
+
+
+public class bug6442918a {
+
+ public static void main(String[] args) throws Throwable, Exception {
+ SwingUtilities.invokeAndWait(new Runnable() {
+ public void run() {
+ try {
+ UIManager.setLookAndFeel("com.sun.java.swing.plaf"
+ + ".windows.WindowsLookAndFeel");
+ } catch (Exception e) {
+ // test is for Windows look and feel
+ throw new RuntimeException("Test is only for WLaF."
+ + e.getMessage());
+ }
+ runTest();
+ }
+ });
+ }
+
+ private static void runTest() {
+ JDialog dialog = Util
+ .createModalDialogWithPassFailButtons("Empty header showing \"...\"");
+ String[] columnNames = {"", "", "", "", "Testing"};
+ String[][] data = {{"1", "2", "3", "4", "5"}};
+ JTable table = new JTable(data, columnNames);
+ DefaultTableCellRenderer renderer = new DefaultTableCellRenderer();
+ int tableCellWidth = renderer.getFontMetrics(renderer.getFont())
+ .stringWidth("test");
+ table.setPreferredScrollableViewportSize(new Dimension(
+ 5 * tableCellWidth, 50));
+ JPanel p = new JPanel();
+ p.add(new JScrollPane(table));
+ dialog.add(p, BorderLayout.NORTH);
+ JTextArea area = new JTextArea();
+ String txt = "\nInstructions:\n\n";
+ txt += "Only the last column header should show \"...\".";
+ area.setText(txt);
+ dialog.add(new JScrollPane(area), BorderLayout.CENTER);
+ dialog.pack();
+ dialog.setVisible(true);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/swing/JTextPane/bug8025082.java Fri Sep 25 12:04:35 2015 -0700
@@ -0,0 +1,108 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * 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 8025082
+ * @summary The behaviour of the highlight will be lost after clicking the set
+ * button.
+ * @run main bug8025082
+ */
+import java.awt.*;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.InputEvent;
+import javax.swing.*;
+
+public class bug8025082 {
+
+ private static JButton button;
+ private static JFrame frame;
+
+ public static void main(String[] args) throws Exception {
+ Robot robo = new Robot();
+ robo.delay(500);
+
+ SwingUtilities.invokeAndWait(new Runnable() {
+ public void run() {
+ createUI();
+ }
+ });
+
+ robo.waitForIdle();
+ Point point = getButtonLocationOnScreen();
+ robo.mouseMove(point.x, point.y);
+ robo.mousePress(InputEvent.BUTTON1_MASK);
+ robo.mouseRelease(InputEvent.BUTTON1_MASK);
+ robo.waitForIdle();
+
+ SwingUtilities.invokeAndWait(new Runnable() {
+ public void run() {
+ frame.dispose();
+ }
+ });
+ }
+
+ private static void createUI() {
+ frame = new JFrame();
+ frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+ frame.setSize(500, 500);
+ JTextPane textpane = new JTextPane();
+ textpane.setText("Select Me");
+ textpane.selectAll();
+
+ JPanel panel = new JPanel(new BorderLayout());
+ panel.add(textpane, BorderLayout.CENTER);
+ button = new JButton("Press Me");
+ panel.add(button, BorderLayout.SOUTH);
+
+ button.addActionListener(new ActionListener() {
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ if (!textpane.getCaret().isSelectionVisible()) {
+ throw new RuntimeException("Highlight removed after "
+ + "button click");
+ }
+ }
+ });
+
+ frame.getContentPane().add(panel);
+ frame.setLocationRelativeTo(null);
+ frame.setVisible(true);
+ }
+
+ private static Point getButtonLocationOnScreen() throws Exception {
+ final Point[] result = new Point[1];
+
+ SwingUtilities.invokeAndWait(new Runnable() {
+ @Override
+ public void run() {
+ Point point = button.getLocationOnScreen();
+ point.x += button.getWidth() / 2;
+ point.y += button.getHeight() / 2;
+ result[0] = point;
+ }
+ });
+ return result[0];
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/swing/UI/UnninstallUIMemoryLeaks/UnninstallUIMemoryLeaks.java Fri Sep 25 12:04:35 2015 -0700
@@ -0,0 +1,132 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * 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.awt.EventQueue;
+import java.awt.FlowLayout;
+
+import javax.swing.*;
+import javax.swing.UIManager.LookAndFeelInfo;
+
+import static javax.swing.UIManager.getInstalledLookAndFeels;
+
+/**
+ * @test
+ * @bug 8134947
+ * @author Sergey Bylokhov
+ * @run main/timeout=300/othervm -Xmx12m -XX:+HeapDumpOnOutOfMemoryError UnninstallUIMemoryLeaks
+ */
+public final class UnninstallUIMemoryLeaks {
+
+ private static JFrame frame;
+
+ public static void main(final String[] args) throws Exception {
+ try {
+ createGUI();
+ for (final LookAndFeelInfo laf : getInstalledLookAndFeels()) {
+ final String name = laf.getName();
+ if (name.contains("OS X") || name.contains("Metal")) {
+ SwingUtilities.invokeAndWait(() -> setLookAndFeel(laf));
+ SwingUtilities.invokeAndWait(() -> {
+ for (int i = 0; i < 4000; ++i) {
+ SwingUtilities.updateComponentTreeUI(frame);
+ }
+ });
+ }
+ }
+ } finally {
+ EventQueue.invokeAndWait(() -> frame.dispose());
+ }
+ }
+
+ private static void createGUI() throws Exception {
+ EventQueue.invokeAndWait(() -> {
+ frame = new JFrame();
+ frame.setLayout(new FlowLayout());
+
+ frame.add(new JButton("JButton"));
+ frame.add(new JCheckBox("JCheckBox"));
+ frame.add(new JComboBox<>());
+ frame.add(new JEditorPane());
+ frame.add(new JFormattedTextField("JFormattedTextField"));
+ frame.add(new JLabel("label"));
+ frame.add(new JPanel());
+ frame.add(new JPasswordField("JPasswordField"));
+ frame.add(new JProgressBar());
+ frame.add(new JRadioButton("JRadioButton"));
+ frame.add(new JScrollBar());
+ frame.add(new JScrollPane());
+ frame.add(new JSeparator());
+ frame.add(new JSlider());
+ frame.add(new JSpinner());
+ frame.add(new JSplitPane());
+ frame.add(new JTabbedPane());
+ frame.add(new JTable());
+ frame.add(new JTextArea("JTextArea"));
+ frame.add(new JTextField("JTextField"));
+ frame.add(new JTextPane());
+ frame.add(new JToggleButton());
+ frame.add(new JToolBar());
+ frame.add(new JToolTip());
+ frame.add(new JTree());
+ frame.add(new JViewport());
+
+ final JMenuBar bar = new JMenuBar();
+ final JMenu menu1 = new JMenu("menu1");
+ final JMenu menu2 = new JMenu("menu2");
+ menu1.add(new JMenuItem("menuitem"));
+ menu2.add(new JCheckBoxMenuItem("JCheckBoxMenuItem"));
+ menu2.add(new JRadioButtonMenuItem("JRadioButtonMenuItem"));
+ bar.add(menu1);
+ bar.add(menu2);
+ frame.setJMenuBar(bar);
+
+ final String[] data = {"one", "two", "three", "four"};
+ final JList<String> list = new JList<>(data);
+ frame.add(list);
+
+ final JDesktopPane pane = new JDesktopPane();
+ final JInternalFrame internalFrame = new JInternalFrame();
+ internalFrame.setBounds(10, 10, 130, 130);
+ internalFrame.setVisible(true);
+ pane.add(internalFrame);
+ pane.setSize(150, 150);
+
+ frame.add(pane);
+ frame.pack();
+ frame.setSize(600, 600);
+ frame.setLocationRelativeTo(null);
+ // Commented to prevent a reference from RepaintManager
+ // frame.setVisible(true);
+ });
+ }
+
+ private static void setLookAndFeel(final LookAndFeelInfo laf) {
+ try {
+ UIManager.setLookAndFeel(laf.getClassName());
+ System.out.println("LookAndFeel: " + laf.getClassName());
+ } catch (ClassNotFoundException | InstantiationException |
+ UnsupportedLookAndFeelException | IllegalAccessException e) {
+ throw new RuntimeException(e);
+ }
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/swing/plaf/basic/BasicHTML/4960629/bug4960629.java Fri Sep 25 12:04:35 2015 -0700
@@ -0,0 +1,96 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * 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 4960629 7124238
+ @summary Tests if font for html text on widgets in correct.
+ @author Denis Sharypov
+ @run main bug4960629
+*/
+
+import java.awt.Font;
+import java.lang.reflect.InvocationTargetException;
+import javax.swing.JFrame;
+import javax.swing.JLabel;
+import javax.swing.SwingUtilities;
+import javax.swing.UIManager;
+import javax.swing.plaf.basic.BasicHTML;
+import javax.swing.text.AttributeSet;
+import javax.swing.text.View;
+import javax.swing.text.html.StyleSheet;
+import javax.swing.text.html.HTMLDocument;
+
+public class bug4960629 {
+ private boolean passed = false;
+ private JLabel label = null;
+ private JFrame f = null;
+
+ public void createAndShowGUI() throws Exception {
+ try {
+ UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName());
+ label = new JLabel("<html><P>This is a test of the</P></html>");
+ System.out.println("UIManager.getLookAndFeel()"
+ + UIManager.getLookAndFeel().getClass());
+ f = new JFrame();
+ f.getContentPane().add(label);
+ f.pack();
+ f.setVisible(true);
+ test();
+ } finally {
+ f.dispose();
+ }
+ }
+
+ bug4960629() throws InvocationTargetException, InterruptedException {
+ SwingUtilities.invokeAndWait(new Runnable() {
+ @Override
+ public void run() {
+ try {
+ createAndShowGUI();
+ } catch (Exception e) {
+ throw new RuntimeException("Exception "
+ + e.getMessage());
+ }
+ }
+ });
+ }
+
+ private void test() {
+ View root = ((View)label.getClientProperty(BasicHTML.propertyKey))
+ .getView(0);
+ int n = root.getViewCount();
+ View v = root.getView(n - 1);
+ AttributeSet attrs = v.getAttributes();
+ StyleSheet ss = ((HTMLDocument) v.getDocument()).getStyleSheet();
+ Font font = ss.getFont(attrs);
+ System.out.println(font.getSize());
+ passed = (font.getSize() == 12);
+ if(!passed) {
+ throw new RuntimeException("Test failed.");
+ }
+ }
+
+ public static void main(String args[]) throws Throwable {
+ new bug4960629();
+ }
+}
--- a/jdk/test/javax/swing/regtesthelpers/Util.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/javax/swing/regtesthelpers/Util.java Fri Sep 25 12:04:35 2015 -0700
@@ -41,6 +41,7 @@
*/
public class Util {
+
/**
* Convert a rectangle from coordinate system of Component c to
* screen coordinate system.
@@ -266,4 +267,42 @@
result.add(KeyEvent.VK_ALT);
return result;
}
+
+ /**
+ * Creates and returns a JDialog with two button, one that says pass,
+ * another that says fail. The fail button is wired to call
+ * <code>uiTestFailed</code> with <code>failString</code> and the pass
+ * button is wired to invoked <code>uiTestPassed</code>.
+ * <p>The content pane of the JDialog uses a BorderLayout with the
+ * buttons inside a horizontal box with filler between them and the
+ * pass button on the left.
+ * <p>The returned Dialog has not been packed, or made visible, it is
+ * up to the caller to do that (after putting in some useful components).
+ */
+ public static JDialog createModalDialogWithPassFailButtons(final String failString) {
+ JDialog retDialog = new JDialog();
+ Box buttonBox = Box.createHorizontalBox();
+ JButton passButton = new JButton("Pass");
+ JButton failButton = new JButton("Fail");
+
+ passButton.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent ae) {
+ retDialog.dispose();
+ }
+ });
+ failButton.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent ae) {
+ retDialog.dispose();
+ throw new RuntimeException("Test failed. " + failString);
+ }
+ });
+ retDialog.setTitle("Test");
+ retDialog.setModalityType(Dialog.ModalityType.APPLICATION_MODAL);
+ buttonBox.add(passButton);
+ buttonBox.add(Box.createGlue());
+ buttonBox.add(failButton);
+ retDialog.getContentPane().add(buttonBox, BorderLayout.SOUTH);
+ retDialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
+ return retDialog;
+ }
}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/jdk/internal/jimage/JImageReadTest.java Fri Sep 25 12:04:35 2015 -0700
@@ -0,0 +1,377 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * 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.
+ */
+
+/*
+ * @modules java.base/jdk.internal.jimage
+ * @summary Unit test for libjimage JIMAGE_Open/Read/Close
+ */
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.nio.ByteBuffer;
+import java.util.Arrays;
+
+import jdk.internal.jimage.BasicImageReader;
+import jdk.internal.jimage.ImageNativeSubstrate;
+
+import org.testng.annotations.DataProvider;
+import org.testng.annotations.Optional;
+import org.testng.annotations.Parameters;
+import org.testng.annotations.Test;
+import org.testng.Assert;
+import org.testng.TestNG;
+
+@Test
+public class JImageReadTest {
+
+ static String javaHome = System.getProperty("java.home");
+ static String imageFile = javaHome + File.separator + "lib"
+ + File.separator + "modules" + File.separator
+ + "bootmodules.jimage";
+
+ @DataProvider(name="classes")
+ static Object[][] loadClasses() {
+ return new Object[][] {
+ {"java.base", "java/lang/String.class"},
+ {"java.base", "java/lang/Object.class"},
+ {"java.base", "sun/reflect/generics/tree/TypeArgument.class"},
+ {"jdk.jdeps", "com/sun/tools/javap/StackMapWriter$StackMapBuilder.class"},
+ {"jdk.hotspot.agent", "sa.properties"},
+ {"java.logging", "java/util/logging/Logger.class"},
+ {"java.base", "java/NOSUCHCLASS/yyy.class"}, // non-existent
+ {"NOSUCHMODULE", "java/lang/Class.class"}, // non-existent
+ };
+ }
+
+
+ @DataProvider(name="packages")
+ static Object[][] loadPackages() {
+ return new Object[][] {
+ {"java.base", "java/lang"},
+ {"java.base", "java/io"},
+ {"java.logging", "java/util/logging"},
+ };
+ }
+
+ /**
+ * Test a class is correctly accessible from the image in a module.
+ *
+ * @param moduleName the module name
+ * @param className the classname
+ * @throws Exception is thrown if there is a test error
+ */
+ @Test(dataProvider="classes")
+ public static void test1_ReadClasses(String moduleName, String className) throws Exception {
+ final int classMagic = 0xCAFEBABE;
+ final long NOT_FOUND = 0L;
+
+ if (!(new File(imageFile)).exists()) {
+ System.out.printf("Test skipped; no jimage file");
+ return;
+ }
+
+ long jimageHandle = ImageNativeSubstrate.JIMAGE_Open(imageFile);
+ Assert.assertTrue(jimageHandle != 0, "JIMAGE_Open failed: id: " + jimageHandle);
+
+ long[] sizeArray = new long[1];
+ long locationHandle =
+ ImageNativeSubstrate.JIMAGE_FindResource(jimageHandle,
+ moduleName, "9.0", className, sizeArray);
+ long size = sizeArray[0];
+ System.out.printf("reading: module: %s, path: %s, handle: %16x, " +
+ "location: %d, size: %d%n",
+ moduleName, className, jimageHandle, locationHandle, size);
+ if (moduleName.contains("NOSUCH") || className.contains("NOSUCH")) {
+ Assert.assertEquals(locationHandle, NOT_FOUND,
+ "location found for non-existing module: "
+ + moduleName
+ + ", or class: " + className);
+ return; // no more to test for non-existing class
+ } else {
+ Assert.assertTrue(locationHandle != NOT_FOUND, "location not found: " + className);
+ Assert.assertTrue(size > 0, "size of should be > 0: " + className);
+ }
+
+ // positive: read whole class
+ ByteBuffer buffer = ByteBuffer.allocate((int)size);
+ long actual = ImageNativeSubstrate.JIMAGE_GetResource(jimageHandle,
+ locationHandle, buffer.array(), size);
+ Assert.assertEquals(actual, size, "bytes read not equal bytes requested");
+
+ if (className.endsWith(".class")) {
+ int m = buffer.getInt();
+ Assert.assertEquals(m, classMagic, "Classfile has bad magic number");
+ }
+
+ // Read less than the size of the artifact
+ buffer.rewind();
+ Arrays.fill(buffer.array(), (byte)0xc0);
+ long sizeExpected = size - 10;
+ actual = ImageNativeSubstrate.JIMAGE_GetResource(jimageHandle,
+ locationHandle, buffer.array(), sizeExpected);
+ Assert.assertEquals(actual, sizeExpected, "bytes read not equal bytes requested");
+
+ if (className.endsWith(".class")) {
+ int m1 = buffer.getInt();
+ Assert.assertEquals(m1, classMagic, "Read operation succeeded but has bad magic number");
+ }
+
+ ImageNativeSubstrate.JIMAGE_Close(jimageHandle);
+ }
+
+ /**
+ * For all the resource names, check the name and approximate count.
+ *
+ * @throws IOException thrown if an error occurs
+ */
+ @Test
+ static void test2_ImageResources() throws IOException {
+ if (!(new File(imageFile)).exists()) {
+ System.out.printf("Test skipped; no jimage file");
+ return;
+ }
+
+ long jimageHandle = ImageNativeSubstrate.JIMAGE_Open(imageFile);
+ Assert.assertTrue(jimageHandle != 0, "JIMAGE_Open failed: id: " + jimageHandle);
+
+ String[] names = new String[4096];
+ int max = ImageNativeSubstrate.JIMAGE_Resources(jimageHandle,
+ names);
+
+ // Repeat with count available
+ names = new String[max + 1];
+ int count = ImageNativeSubstrate.JIMAGE_Resources(jimageHandle,
+ names);
+ System.out.printf(" count: %d, a class: %s\n", count, names[0]);
+ Assert.assertTrue(max > 31000,
+ "missing entries, should be more than 31000, reported: " + count);
+ Assert.assertTrue(count == max,
+ "unexpected count of entries, count: " + count
+ + ", max: " + max);
+ for (int i = 0; i < count; i++) {
+ checkFullName(names[i]);
+ }
+
+ ImageNativeSubstrate.JIMAGE_Close(jimageHandle);
+ }
+
+ /**
+ * Tests that a package exists and correctly mapped to the module.
+ *
+ * @param moduleName the module name
+ * @param packageName the package name
+ * @throws IOException thrown if an error occurs
+ */
+ @Test(dataProvider="packages")
+ static void test3_PackageToModule(String moduleName, String packageName) throws IOException {
+ if (!(new File(imageFile)).exists()) {
+ System.out.printf("Test skipped; no jimage file");
+ return;
+ }
+
+ long jimageHandle = ImageNativeSubstrate.JIMAGE_Open(imageFile);
+ Assert.assertTrue(jimageHandle != 0, "JIMAGE_Open failed: id: " + jimageHandle);
+
+ String result = ImageNativeSubstrate.JIMAGE_PackageToModule(jimageHandle, packageName);
+ System.out.printf(" package: %s, module: %s%n", packageName, result);
+ Assert.assertEquals(result, moduleName, "wrong module for package: " + packageName);
+
+ ImageNativeSubstrate.JIMAGE_Close(jimageHandle);
+ }
+
+
+ static void checkFullName(String path) {
+ int next = 0;
+ String m = null;
+ String p = null;
+ String b = null;
+ String e = null;
+ if (path.startsWith("/")) {
+ next = path.indexOf('/', 1);
+ m = path.substring(1, next);
+ next = next + 1;
+ }
+ int lastSlash = path.lastIndexOf('/');
+ if (lastSlash > next) {
+ // has a parent
+ p = path.substring(next, lastSlash);
+ next = lastSlash + 1;
+ }
+ int period = path.indexOf('.', next);
+ if (period > next) {
+ b = path.substring(next, period);
+ e = path.substring(period + 1);
+ } else {
+ b = path.substring(next);
+ }
+ Assert.assertNotNull(m, "module must be non-empty");
+ Assert.assertNotNull(b, "base name must be non-empty");
+ }
+
+ /**
+ * Verify that all of the resource names from BasicImageReader
+ * match those returned from the native JIMAGE_Resources iterator.
+ * Names that start with /modules, /packages, and bootmodules.jdata
+ * must appear in the names from JIMAGE_Resource iterator;
+ * from the BasicImageReader they are ignored.
+ */
+ @Test
+ static void test4_verifyNames() {
+ if (!(new File(imageFile)).exists()) {
+ System.out.printf("Test skipped; no jimage file");
+ return;
+ }
+
+ try {
+ String[] names = BasicImageReader_Names();
+ //writeNames("/tmp/basic-names.txt", names); // debug
+
+ // Read all the names from the native JIMAGE API
+ String[] nativeNames = JIMAGE_Names();
+ //writeNames("/tmp/native-names.txt", nativeNames); // debug
+
+
+ int modCount = 0;
+ int pkgCount = 0;
+ int otherCount = 0;
+ for (String n : nativeNames) {
+ if (n.startsWith("/modules/")) {
+ modCount++;
+ } else if (n.startsWith("/packages/")) {
+ pkgCount++;
+ } else {
+ otherCount++;
+ }
+ }
+ System.out.printf("native name count: %d, modCount: %d, pkgCount: %d, otherCount: %d%n",
+ names.length, modCount, pkgCount, otherCount);
+
+ Assert.assertEquals(modCount, 0, "JIMAGE_ResourceIterator should not return any '/modules' paths");
+ Assert.assertEquals(pkgCount, 0, "JIMAGE_ResourceIterator should not return any '/packages' paths");
+
+ // Sort and merge the two arrays. Every name should appear exactly twice.
+ Arrays.sort(names);
+ Arrays.sort(nativeNames);
+ String[] combined = Arrays.copyOf(names, nativeNames.length + names.length);
+ System.arraycopy(nativeNames,0, combined, names.length, nativeNames.length);
+ Arrays.sort(combined);
+ int missing = 0;
+ for (int i = 0; i < combined.length; i++) {
+ String s = combined[i];
+ if (isMetaName(s)) {
+ // Ignore /modules and /packages in BasicImageReader names
+ continue;
+ }
+
+ if (i < combined.length - 1 && s.equals(combined[i + 1])) {
+ i++; // string appears in both java and native
+ continue;
+ }
+
+ missing++;
+ int ndx = Arrays.binarySearch(names, s);
+ String which = (ndx >= 0) ? "java BasicImageReader" : "native JIMAGE_Resources";
+ System.out.printf("Missing Resource: %s found only via %s%n", s, which);
+ }
+ Assert.assertEquals(missing, 0, "Resources missing");
+
+ } catch (IOException ioe) {
+ Assert.fail("I/O exception", ioe);
+ }
+ }
+
+ /**
+ * Return true if the name is one of the meta-data names
+ * @param name a name
+ * @return return true if starts with either /packages or /modules
+ */
+ static boolean isMetaName(String name) {
+ return name.startsWith("/modules")
+ || name.startsWith("/packages")
+ || name.equals("bootmodules.jdata");
+ }
+
+ /**
+ * Return all of the names from BasicImageReader.
+ * @return the names returned from BasicImageReader
+ */
+ static String[] BasicImageReader_Names() throws IOException {
+ String[] names = null;
+ try (BasicImageReader reader = BasicImageReader.open(imageFile)) {
+ names = reader.getEntryNames();
+ } catch (IOException ioe) {
+ Assert.fail("I/O exception", ioe);
+ }
+ return names;
+ }
+
+ /**
+ * Returns an array of all of the names returned from JIMAGE_Resources
+ */
+ static String[] JIMAGE_Names() throws IOException {
+
+ long jimageHandle = ImageNativeSubstrate.JIMAGE_Open(imageFile);
+ Assert.assertTrue(jimageHandle != 0, "JIMAGE_Open failed: id: " + jimageHandle);
+
+ String[] names = new String[50000];
+ int max = ImageNativeSubstrate.JIMAGE_Resources(jimageHandle, names);
+
+ if (max > names.length) {
+ // Not all names fit, repeat with correct size
+ names = new String[max];
+ max = ImageNativeSubstrate.JIMAGE_Resources(jimageHandle, names);
+ } else {
+ names = Arrays.copyOf(names, max);
+ }
+
+ ImageNativeSubstrate.JIMAGE_Close(jimageHandle);
+ return names;
+ }
+
+ // Write an array of names to a file for debugging
+ static void writeNames(String fname, String[] names) throws IOException {
+ try (FileWriter wr = new FileWriter(new File(fname))) {
+ for (String s : names) {
+ wr.write(s);
+ wr.write("\n");
+ }
+
+ }
+ System.out.printf(" %s: %d names%n", fname, names.length);
+ }
+
+ // main method to run standalone from jtreg
+
+ @Test(enabled=false)
+ @Parameters({"x"})
+ @SuppressWarnings("raw_types")
+ public static void main(@Optional String[] args) {
+ Class<?>[] testclass = { JImageReadTest.class};
+ TestNG testng = new TestNG();
+ testng.setTestClasses(testclass);
+ testng.run();
+ }
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/sun/java2d/OpenGL/CopyAreaOOB.java Fri Sep 25 12:04:35 2015 -0700
@@ -0,0 +1,146 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * 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 6430601
+ * @summary Verifies that copyArea() works properly when the
+ * destination parameters are outside the destination bounds.
+ * @run main/othervm CopyAreaOOB
+ * @run main/othervm -Dsun.java2d.opengl=True CopyAreaOOB
+ * @author campbelc
+ */
+
+import java.awt.*;
+import java.awt.image.*;
+
+public class CopyAreaOOB extends Canvas {
+
+ private static boolean done;
+
+ public void paint(Graphics g) {
+ synchronized (this) {
+ if (done) {
+ return;
+ }
+ }
+
+ int w = getWidth();
+ int h = getHeight();
+
+ Graphics2D g2d = (Graphics2D)g;
+ g2d.setColor(Color.black);
+ g2d.fillRect(0, 0, w, h);
+
+ g2d.setColor(Color.green);
+ g2d.fillRect(0, 0, w, 10);
+
+ g2d.setColor(Color.red);
+ g2d.fillRect(0, 10, 50, h-10);
+
+ // copy the region such that part of it goes below the bottom of the
+ // destination surface
+ g2d.copyArea(0, 10, 50, h-10, 60, 10);
+
+ Toolkit.getDefaultToolkit().sync();
+
+ synchronized (this) {
+ done = true;
+ notifyAll();
+ }
+ }
+
+ public Dimension getPreferredSize() {
+ return new Dimension(400, 400);
+ }
+
+ private static void testRegion(BufferedImage bi, String name,
+ int x1, int y1, int x2, int y2,
+ int expected)
+ {
+ for (int y = y1; y < y2; y++) {
+ for (int x = x1; x < x2; x++) {
+ int actual = bi.getRGB(x, y);
+ if (actual != expected) {
+ throw new RuntimeException("Test failed for " + name +
+ " region at x="+x+" y="+y+
+ " (expected="+
+ Integer.toHexString(expected) +
+ " actual="+
+ Integer.toHexString(actual) +
+ ")");
+ }
+ }
+ }
+ }
+
+ public static void main(String[] args) {
+ boolean show = (args.length == 1) && ("-show".equals(args[0]));
+
+ CopyAreaOOB test = new CopyAreaOOB();
+ Frame frame = new Frame();
+ frame.setUndecorated(true);
+ frame.add(test);
+ frame.pack();
+ frame.setLocationRelativeTo(null);
+ frame.setVisible(true);
+
+ // Wait until the component's been painted
+ synchronized (test) {
+ while (!done) {
+ try {
+ test.wait();
+ } catch (InterruptedException e) {
+ throw new RuntimeException("Failed: Interrupted");
+ }
+ }
+ }
+
+ try {
+ Thread.sleep(2000);
+ } catch (InterruptedException ex) {}
+
+ // Grab the screen region
+ BufferedImage capture = null;
+ try {
+ Robot robot = new Robot();
+ Point pt1 = test.getLocationOnScreen();
+ Rectangle rect = new Rectangle(pt1.x, pt1.y, 400, 400);
+ capture = robot.createScreenCapture(rect);
+ } catch (Exception e) {
+ throw new RuntimeException("Problems creating Robot");
+ } finally {
+ if (!show) {
+ frame.dispose();
+ }
+ }
+
+ // Test pixels
+ testRegion(capture, "green", 0, 0, 400, 10, 0xff00ff00);
+ testRegion(capture, "original red", 0, 10, 50, 400, 0xffff0000);
+ testRegion(capture, "background", 50, 10, 60, 400, 0xff000000);
+ testRegion(capture, "in-between", 60, 10, 110, 20, 0xff000000);
+ testRegion(capture, "copied red", 60, 20, 110, 400, 0xffff0000);
+ testRegion(capture, "background", 110, 10, 400, 400, 0xff000000);
+ }
+}
--- a/jdk/test/sun/security/pkcs11/PKCS11Test.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/sun/security/pkcs11/PKCS11Test.java Fri Sep 25 12:04:35 2015 -0700
@@ -33,6 +33,8 @@
public abstract class PKCS11Test {
+ static final String PKCS11 = "PKCS11";
+
// directory of the test source
static final String BASE = System.getProperty("test.src", ".");
@@ -644,4 +646,12 @@
return "";
}
}
+
+ static byte[] generateData(int length) {
+ byte data[] = new byte[length];
+ for (int i=0; i<data.length; i++) {
+ data[i] = (byte) (i % 256);
+ }
+ return data;
+ }
}
--- a/jdk/test/sun/security/pkcs11/Secmod/AddPrivateKey.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/sun/security/pkcs11/Secmod/AddPrivateKey.java Fri Sep 25 12:04:35 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -28,7 +28,6 @@
* @author Andreas Sterbenz
* @library ..
* @run main/othervm AddPrivateKey
- * @key randomness
*/
import java.io.*;
@@ -43,6 +42,13 @@
// all providers.
public class AddPrivateKey extends SecmodTest {
+ private static final String ALIAS1 = "entry1";
+ private static final String ALIAS2 = "entry2";
+ private static final String ALIAS3 = "entry3";
+ private static final int MAX_LINE = 85;
+ private static final int DATA_LENGTH = 4096;
+ private static final byte[] DATA = generateData(DATA_LENGTH);
+
public static void main(String[] args) throws Exception {
if (initSecmod() == false) {
return;
@@ -57,7 +63,7 @@
System.out.println();
Security.addProvider(p);
- KeyStore ks = KeyStore.getInstance("PKCS11", p);
+ KeyStore ks = KeyStore.getInstance(PKCS11, p);
ks.load(null, password);
for (String alias : aliases(ks)) {
System.out.println("Deleting: " + alias);
@@ -65,25 +71,28 @@
}
KeyStore jks = KeyStore.getInstance("JKS");
- InputStream in = new FileInputStream(new File(BASE, "keystore.jks"));
- char[] jkspass = "passphrase".toCharArray();
- jks.load(in, jkspass);
- List<PrivateKeyEntry> entries = new ArrayList<PrivateKeyEntry>();
- for (String alias : Collections.list(jks.aliases())) {
- if (jks.entryInstanceOf(alias, PrivateKeyEntry.class)) {
- PrivateKeyEntry entry = (PrivateKeyEntry)jks.getEntry(alias, new PasswordProtection(jkspass));
- String algorithm = entry.getPrivateKey().getAlgorithm();
- System.out.println("-Entry " + alias + " (" + algorithm + ")");
- if ((supportsEC == false) && algorithm.equals("EC")) {
- System.out.println("EC not supported by provider, skipping");
- continue;
- }
- if ((supportsEC == false) && algorithm.equals("DSA")) {
- System.out.println("Provider does not appear to have CKA_NETSCAPE_DB fix, skipping");
- continue;
- }
- test(p, entry);
- } // else ignore
+ try (InputStream in = new FileInputStream(BASE + SEP + "keystore.jks")) {
+ char[] jkspass = "passphrase".toCharArray();
+ jks.load(in, jkspass);
+ for (String alias : Collections.list(jks.aliases())) {
+ if (jks.entryInstanceOf(alias, PrivateKeyEntry.class)) {
+ PrivateKeyEntry entry = (PrivateKeyEntry)jks.getEntry(alias,
+ new PasswordProtection(jkspass));
+ String algorithm = entry.getPrivateKey().getAlgorithm();
+ System.out.printf("-Entry %s (%s)%n", alias, algorithm);
+ if ((supportsEC == false) && algorithm.equals("EC")) {
+ System.out.println("EC not supported by provider, "
+ + "skipping");
+ continue;
+ }
+ if ((supportsEC == false) && algorithm.equals("DSA")) {
+ System.out.println("Provider does not appear to have "
+ + "CKA_NETSCAPE_DB fix, skipping");
+ continue;
+ }
+ test(p, entry);
+ } // else ignore
+ }
}
System.out.println("OK");
}
@@ -92,10 +101,6 @@
return Collections.list(ks.aliases());
}
- private final static String ALIAS1 = "entry1";
- private final static String ALIAS2 = "entry2";
- private final static String ALIAS3 = "entry3";
-
private static void test(Provider p, PrivateKeyEntry entry) throws Exception {
PrivateKey key = entry.getPrivateKey();
X509Certificate[] chain = (X509Certificate[])entry.getCertificateChain();
@@ -122,11 +127,8 @@
PrivateKey key2 = (PrivateKey)ks.getKey(ALIAS1, null);
System.out.println(toString(key2));
- X509Certificate[] chain2 = (X509Certificate[])ks.getCertificateChain(ALIAS1);
- // NSS makes token keys always sensitive, skip this check
-// if (key.equals(key2) == false) {
-// throw new Exception("key mismatch");
-// }
+ X509Certificate[] chain2 =
+ (X509Certificate[]) ks.getCertificateChain(ALIAS1);
if (Arrays.equals(chain, chain2) == false) {
throw new Exception("chain mismatch");
}
@@ -154,7 +156,8 @@
PrivateKey key4 = (PrivateKey)ks.getKey(ALIAS2, null);
System.out.println(toString(key4));
- X509Certificate[] chain4 = (X509Certificate[])ks.getCertificateChain(ALIAS2);
+ X509Certificate[] chain4 = (X509Certificate[])
+ ks.getCertificateChain(ALIAS2);
if (Arrays.equals(chain, chain4) == false) {
throw new Exception("chain mismatch");
}
@@ -172,7 +175,8 @@
PrivateKey key5 = (PrivateKey)ks.getKey(ALIAS3, null);
System.out.println(toString(key5));
- X509Certificate[] chain5 = (X509Certificate[])ks.getCertificateChain(ALIAS3);
+ X509Certificate[] chain5 = (X509Certificate[])
+ ks.getCertificateChain(ALIAS3);
if (Arrays.equals(chain, chain5) == false) {
throw new Exception("chain mismatch");
}
@@ -186,24 +190,22 @@
System.out.println("OK");
}
- private final static byte[] DATA = new byte[4096];
-
- static {
- Random random = new Random();
- random.nextBytes(DATA);
- }
-
- private static void sign(Provider p, PrivateKey privateKey, PublicKey publicKey) throws Exception {
+ private static void sign(Provider p, PrivateKey privateKey,
+ PublicKey publicKey) throws Exception {
String keyAlg = privateKey.getAlgorithm();
String alg;
- if (keyAlg.equals("RSA")) {
- alg = "SHA1withRSA";
- } else if (keyAlg.equals("DSA")) {
- alg = "SHA1withDSA";
- } else if (keyAlg.equals("EC")) {
- alg = "SHA1withECDSA";
- } else {
- throw new Exception("Unknown algorithm " + keyAlg);
+ switch (keyAlg) {
+ case "RSA":
+ alg = "SHA1withRSA";
+ break;
+ case "DSA":
+ alg = "SHA1withDSA";
+ break;
+ case "EC":
+ alg = "SHA1withECDSA";
+ break;
+ default:
+ throw new Exception("Unknown algorithm " + keyAlg);
}
Signature s = Signature.getInstance(alg, p);
s.initSign(privateKey);
@@ -217,8 +219,6 @@
}
}
- private final static int MAX_LINE = 85;
-
private static String toString(Object o) {
String s = String.valueOf(o).split("\n")[0];
return (s.length() <= MAX_LINE) ? s : s.substring(0, MAX_LINE);
--- a/jdk/test/sun/security/pkcs11/Secmod/AddTrustedCert.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/sun/security/pkcs11/Secmod/AddTrustedCert.java Fri Sep 25 12:04:35 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
* 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,29 +44,47 @@
return;
}
- InputStream in = new FileInputStream(BASE + SEP + "anchor.cer");
- CertificateFactory factory = CertificateFactory.getInstance("X.509");
- X509Certificate cert = (X509Certificate)factory.generateCertificate(in);
- in.close();
-// System.out.println(cert);
+ X509Certificate cert;
+ try (InputStream in = new FileInputStream(BASE + SEP + "anchor.cer")) {
+ CertificateFactory factory =
+ CertificateFactory.getInstance("X.509");
+ cert = (X509Certificate)factory.generateCertificate(in);
+ }
String configName = BASE + SEP + "nss.cfg";
Provider p = getSunPKCS11(configName);
System.out.println(p);
Security.addProvider(p);
- KeyStore ks = KeyStore.getInstance("PKCS11", p);
+ KeyStore ks = KeyStore.getInstance(PKCS11, p);
ks.load(null, password);
- Collection<String> aliases = new TreeSet<String>(Collections.list(ks.aliases()));
+ Collection<String> aliases = new TreeSet<>(Collections.list(
+ ks.aliases()));
System.out.println("entries: " + aliases.size());
System.out.println(aliases);
int size1 = aliases.size();
String alias = "anchor";
- ks.setCertificateEntry(alias, cert);
+ if (ks.containsAlias(alias)) {
+ throw new Exception("Alias exists: " + alias);
+ }
+
ks.setCertificateEntry(alias, cert);
+ KeyStore.Entry first = ks.getEntry(alias, null);
+ System.out.println("first entry = " + first);
+ if (!ks.entryInstanceOf(alias, TrustedCertificateEntry.class)) {
+ throw new Exception("Unexpected first entry type: " + first);
+ }
- aliases = new TreeSet<String>(Collections.list(ks.aliases()));
+ ks.setCertificateEntry(alias, cert);
+ KeyStore.Entry second = ks.getEntry(alias, null);
+ System.out.println("second entry = " + second);
+ if (!ks.entryInstanceOf(alias, TrustedCertificateEntry.class)) {
+ throw new Exception("Unexpected second entry type: "
+ + second);
+ }
+
+ aliases = new TreeSet<>(Collections.list(ks.aliases()));
System.out.println("entries: " + aliases.size());
System.out.println(aliases);
int size2 = aliases.size();
@@ -79,8 +97,12 @@
throw new Exception("KeyStore returned incorrect certificate");
}
+ ks.deleteEntry(alias);
+ if (ks.containsAlias(alias)) {
+ throw new Exception("Alias still exists: " + alias);
+ }
+
System.out.println("OK");
-
}
}
--- a/jdk/test/sun/security/pkcs11/Secmod/Crypto.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/sun/security/pkcs11/Secmod/Crypto.java Fri Sep 25 12:04:35 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -28,11 +28,8 @@
* @author Andreas Sterbenz
* @library ..
* @run main/othervm Crypto
- * @key randomness
*/
-import java.util.*;
-
import java.security.*;
public class Crypto extends SecmodTest {
@@ -51,9 +48,7 @@
System.out.println(kp.getPublic());
System.out.println(kp.getPrivate());
- SecureRandom random = new SecureRandom();
- byte[] data = new byte[2048];
- random.nextBytes(data);
+ byte[] data = generateData(2048);
Signature sig = Signature.getInstance("SHA1withRSA", p);
sig.initSign(kp.getPrivate());
--- a/jdk/test/sun/security/pkcs11/Secmod/GetPrivateKey.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/sun/security/pkcs11/Secmod/GetPrivateKey.java Fri Sep 25 12:04:35 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
* 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,11 +24,11 @@
/**
* @test
* @bug 6273877 6322208 6275523
- * @summary make sure we can access the NSS softtoken KeyStore and use a private key
+ * @summary make sure we can access the NSS softtoken KeyStore
+ * and use a private key
* @author Andreas Sterbenz
* @library ..
* @run main/othervm GetPrivateKey
- * @key randomness
*/
import java.util.*;
@@ -49,18 +49,17 @@
System.out.println(p);
Security.addProvider(p);
- KeyStore ks = KeyStore.getInstance("PKCS11", p);
+ KeyStore ks = KeyStore.getInstance(PKCS11, p);
ks.load(null, password);
- Collection<String> aliases = new TreeSet<String>(Collections.list(ks.aliases()));
+ Collection<String> aliases = new TreeSet<>(
+ Collections.list(ks.aliases()));
System.out.println("entries: " + aliases.size());
System.out.println(aliases);
PrivateKey privateKey = (PrivateKey)ks.getKey(keyAlias, password);
System.out.println(privateKey);
- byte[] data = new byte[1024];
- Random random = new Random();
- random.nextBytes(data);
+ byte[] data = generateData(1024);
System.out.println("Signing...");
Signature signature = Signature.getInstance("MD5withRSA");
@@ -68,7 +67,8 @@
signature.update(data);
byte[] sig = signature.sign();
- X509Certificate[] chain = (X509Certificate[])ks.getCertificateChain(keyAlias);
+ X509Certificate[] chain =
+ (X509Certificate[]) ks.getCertificateChain(keyAlias);
signature.initVerify(chain[0].getPublicKey());
signature.update(data);
boolean ok = signature.verify(sig);
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/sun/security/pkcs11/Secmod/LoadKeystore.java Fri Sep 25 12:04:35 2015 -0700
@@ -0,0 +1,94 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * 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.IOException;
+import java.security.KeyStore;
+import java.security.KeyStoreException;
+import java.security.Provider;
+import java.security.Security;
+import java.security.UnrecoverableKeyException;
+import java.util.Collections;
+
+/*
+ * @test
+ * @bug 8048622 8134232
+ * @summary Checks that PKCS#11 keystore can't be loaded with wrong password
+ * @library ../
+ * @run main/othervm LoadKeystore
+ */
+public class LoadKeystore extends SecmodTest {
+
+ public static void main(String[] args) throws Exception {
+ if (!initSecmod()) {
+ return;
+ }
+
+ String configName = BASE + SEP + "nss.cfg";
+ Provider p = getSunPKCS11(configName);
+
+ System.out.println("Add provider " + p);
+ System.out.println();
+ Security.addProvider(p);
+
+ try {
+ System.out.println("Load keystore with wrong type");
+ KeyStore.getInstance("unknown", p);
+ throw new RuntimeException("Expected exception not thrown");
+ } catch(KeyStoreException e) {
+ System.out.println("Expected exception: " + e);
+ }
+
+ KeyStore ks = KeyStore.getInstance("PKCS11", p);
+ if (!"PKCS11".equals(ks.getType())) {
+ throw new RuntimeException("Unexpected keystore type: "
+ + ks.getType());
+ }
+ if (!p.equals(ks.getProvider())) {
+ throw new RuntimeException("Unexpected keystore provider: "
+ + ks.getProvider());
+ }
+
+ try {
+ System.out.println("Load keystore with wrong password");
+ ks.load(null, "wrong".toCharArray());
+ throw new RuntimeException("Expected exception not thrown");
+ } catch(IOException e) {
+ System.out.println("Expected exception: " + e);
+ Throwable cause = e.getCause();
+ if (!(cause instanceof UnrecoverableKeyException)) {
+ e.printStackTrace(System.out);
+ throw new RuntimeException("Unexpected cause: " + cause);
+ }
+ System.out.println("Expected cause: " + cause);
+ }
+
+ System.out.println("Load keystore with correct password");
+ ks.load(null, password);
+ for (String alias : Collections.list(ks.aliases())) {
+ System.out.println("Alias: " + alias);
+ }
+
+ System.out.println("Test passed");
+ }
+
+}
--- a/jdk/test/sun/security/provider/KeyStore/DKSTest.java Thu Sep 17 16:53:42 2015 +0200
+++ b/jdk/test/sun/security/provider/KeyStore/DKSTest.java Fri Sep 25 12:04:35 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -60,8 +60,38 @@
new KeyStore.PasswordProtection("passphrase".toCharArray()));
}};
+ private static final Map<String, KeyStore.ProtectionParameter>
+ WRONG_PASSWORDS = new HashMap<String, KeyStore.ProtectionParameter>() {{
+ put("policy_keystore",
+ new KeyStore.PasswordProtection(
+ "wrong".toCharArray()));
+ put("pw_keystore",
+ new KeyStore.PasswordProtection("wrong".toCharArray()));
+ put("eckeystore1",
+ new KeyStore.PasswordProtection("wrong".toCharArray()));
+ put("eckeystore2",
+ new KeyStore.PasswordProtection("wrong".toCharArray()));
+ }};
+
public static void main(String[] args) throws Exception {
/*
+ * domain keystore: keystores with wrong passwords
+ */
+ try {
+ URI config = new URI(CONFIG + "#keystores");
+ KeyStore ks = KeyStore.getInstance("DKS");
+ ks.load(new DomainLoadStoreParameter(config, WRONG_PASSWORDS));
+ throw new RuntimeException("Expected exception not thrown");
+ } catch (IOException e) {
+ System.out.println("Expected exception: " + e);
+ if (!causedBy(e, UnrecoverableKeyException.class)) {
+ e.printStackTrace(System.out);
+ throw new RuntimeException("Unexpected cause");
+ }
+ System.out.println("Expected cause: " + e);
+ }
+
+ /*
* domain keystore: system
*/
URI config = new URI(CONFIG + "#system");
@@ -182,4 +212,15 @@
return factory.generateCertificate(certStream);
}
}
+
+ // checks if an exception was caused by specified exception class
+ private static boolean causedBy(Exception e, Class klass) {
+ Throwable cause = e;
+ while ((cause = cause.getCause()) != null) {
+ if (cause.getClass().equals(klass)) {
+ return true;
+ }
+ }
+ return false;
+ }
}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/sun/security/tools/jarsigner/warning.sh Fri Sep 25 12:04:35 2015 -0700
@@ -0,0 +1,117 @@
+#
+# 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 8024302
+# @bug 8026037
+# @summary Clarify jar verifications
+#
+
+if [ "${TESTJAVA}" = "" ] ; then
+ JAVAC_CMD=`which javac`
+ TESTJAVA=`dirname $JAVAC_CMD`/..
+fi
+
+# set platform-dependent variables
+OS=`uname -s`
+case "$OS" in
+ Windows_* )
+ FS="\\"
+ ;;
+ * )
+ FS="/"
+ ;;
+esac
+
+KS=warnings.jks
+JFILE=warnings.jar
+
+KT="$TESTJAVA${FS}bin${FS}keytool ${TESTTOOLVMOPTS} -storepass changeit -keypass changeit \
+ -keystore $KS"
+JAR="$TESTJAVA${FS}bin${FS}jar ${TESTTOOLVMOPTS}"
+JARSIGNER="$TESTJAVA${FS}bin${FS}jarsigner ${TESTTOOLVMOPTS} -keystore $KS -storepass changeit"
+
+rm $KS 2> /dev/null
+
+LANG=C
+export LANG
+
+echo 12345 > file
+
+ERR=""
+
+# Normal signer expiring on 2100-01-01
+$KT -alias s1 -dname CN=s1 -genkey -startdate 2000/01/01 -validity 36525 || ERR="$ERR keytool s1,"
+# Cert expiring soon, informational warning
+$KT -alias s2 -dname CN=s2 -genkey -validity 100 || ERR="$ERR keytool s2,"
+# Cert expired, severe warning
+$KT -alias s3 -dname CN=s3 -genkey -startdate -200d -validity 100 || ERR="$ERR keytool s3,"
+
+# noTimestamp is informatiional warning and includes a date
+$JAR cvf $JFILE file
+$JARSIGNER $JFILE s1 > output1 || ERR="$ERR jarsigner s1,"
+$JARSIGNER -strict $JFILE s1 >> output1 || ERR="$ERR jarsigner s1 strict,"
+$JARSIGNER -verify $JFILE s1 >> output1 || ERR="$ERR jarsigner s1,"
+$JARSIGNER -verify -strict $JFILE s1 >> output1 || ERR="$ERR jarsigner s1 strict,"
+
+cat output1 | grep Warning || ERR="$ERR s1 warning,"
+cat output1 | grep Error && ERR="$ERR s1 error,"
+cat output1 | grep timestamp | grep 2100-01-01 || ERR="$ERR s1 timestamp,"
+cat output1 | grep "with signer errors" && ERR="$ERR s1 err,"
+
+# hasExpiringCert is informatiional warning
+$JAR cvf $JFILE file
+$JARSIGNER $JFILE s2 > output2 || ERR="$ERR jarsigner s2,"
+$JARSIGNER -strict $JFILE s2 >> output2 || ERR="$ERR jarsigner s2 strict,"
+$JARSIGNER -verify $JFILE s2 >> output2 || ERR="$ERR jarsigner s2,"
+$JARSIGNER -verify -strict $JFILE s2 >> output2 || ERR="$ERR jarsigner s2 strict,"
+
+cat output2 | grep Warning || ERR="$ERR s2 warning,"
+cat output2 | grep Error && ERR="$ERR s2 error,"
+cat output2 | grep timestamp || ERR="$ERR s2 timestamp,"
+cat output2 | grep "will expire" || ERR="$ERR s2 expiring,"
+cat output2 | grep "with signer errors" && ERR="$ERR s2 err,"
+
+# hasExpiredCert is severe warning
+$JAR cvf $JFILE file
+$JARSIGNER $JFILE s3 > output3 || ERR="$ERR jarsigner s3,"
+$JARSIGNER -strict $JFILE s3 > output3s && ERR="$ERR jarsigner s3 strict,"
+$JARSIGNER -verify $JFILE s3 >> output3 || ERR="$ERR jarsigner s3,"
+$JARSIGNER -verify -strict $JFILE s3 >> output3s && ERR="$ERR jarsigner s3 strict,"
+
+# warning without -strict
+cat output3 | grep Warning || ERR="$ERR s3 warning,"
+cat output3 | grep Error && ERR="$ERR s3 error,"
+cat output3 | grep "with signer errors" && ERR="$ERR s3 err,"
+
+# error with -strict
+cat output3s | grep Warning || ERR="$ERR s3s warning,"
+cat output3s | grep Error || ERR="$ERR s3s error,"
+cat output3s | grep "with signer errors" || ERR="$ERR s3 err,"
+
+if [ "$ERR" = "" ]; then
+ exit 0
+else
+ echo "ERR is $ERR"
+ exit 1
+fi
--- a/jdk/test/sun/security/tools/jarsigner/warnings.sh Thu Sep 17 16:53:42 2015 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,117 +0,0 @@
-#
-# 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 8024302
-# @bug 8026037
-# @summary Clarify jar verifications
-#
-
-if [ "${TESTJAVA}" = "" ] ; then
- JAVAC_CMD=`which javac`
- TESTJAVA=`dirname $JAVAC_CMD`/..
-fi
-
-# set platform-dependent variables
-OS=`uname -s`
-case "$OS" in
- Windows_* )
- FS="\\"
- ;;
- * )
- FS="/"
- ;;
-esac
-
-KS=warnings.jks
-JFILE=warnings.jar
-
-KT="$TESTJAVA${FS}bin${FS}keytool ${TESTTOOLVMOPTS} -storepass changeit -keypass changeit \
- -keystore $KS"
-JAR="$TESTJAVA${FS}bin${FS}jar ${TESTTOOLVMOPTS}"
-JARSIGNER="$TESTJAVA${FS}bin${FS}jarsigner ${TESTTOOLVMOPTS} -keystore $KS -storepass changeit"
-
-rm $KS 2> /dev/null
-
-LANG=C
-export LANG
-
-echo 12345 > file
-
-ERR=""
-
-# Normal signer expiring on 2100-01-01
-$KT -alias s1 -dname CN=s1 -genkey -startdate 2000/01/01 -validity 36525 || ERR="$ERR keytool s1,"
-# Cert expiring soon, informational warning
-$KT -alias s2 -dname CN=s2 -genkey -validity 100 || ERR="$ERR keytool s2,"
-# Cert expired, severe warning
-$KT -alias s3 -dname CN=s3 -genkey -startdate -200d -validity 100 || ERR="$ERR keytool s3,"
-
-# noTimestamp is informatiional warning and includes a date
-$JAR cvf $JFILE file
-$JARSIGNER $JFILE s1 > output1 || ERR="$ERR jarsigner s1,"
-$JARSIGNER -strict $JFILE s1 >> output1 || ERR="$ERR jarsigner s1 strict,"
-$JARSIGNER -verify $JFILE s1 >> output1 || ERR="$ERR jarsigner s1,"
-$JARSIGNER -verify -strict $JFILE s1 >> output1 || ERR="$ERR jarsigner s1 strict,"
-
-cat output1 | grep Warning || ERR="$ERR s1 warning,"
-cat output1 | grep Error && ERR="$ERR s1 error,"
-cat output1 | grep timestamp | grep 2100-01-01 || ERR="$ERR s1 timestamp,"
-cat output1 | grep "with signer errors" && ERR="$ERR s1 err,"
-
-# hasExpiringCert is informatiional warning
-$JAR cvf $JFILE file
-$JARSIGNER $JFILE s2 > output2 || ERR="$ERR jarsigner s2,"
-$JARSIGNER -strict $JFILE s2 >> output2 || ERR="$ERR jarsigner s2 strict,"
-$JARSIGNER -verify $JFILE s2 >> output2 || ERR="$ERR jarsigner s2,"
-$JARSIGNER -verify -strict $JFILE s2 >> output2 || ERR="$ERR jarsigner s2 strict,"
-
-cat output2 | grep Warning || ERR="$ERR s2 warning,"
-cat output2 | grep Error && ERR="$ERR s2 error,"
-cat output2 | grep timestamp || ERR="$ERR s2 timestamp,"
-cat output2 | grep "will expire" || ERR="$ERR s2 expiring,"
-cat output2 | grep "with signer errors" && ERR="$ERR s2 err,"
-
-# hasExpiredCert is severe warning
-$JAR cvf $JFILE file
-$JARSIGNER $JFILE s3 > output3 || ERR="$ERR jarsigner s3,"
-$JARSIGNER -strict $JFILE s3 > output3s && ERR="$ERR jarsigner s3 strict,"
-$JARSIGNER -verify $JFILE s3 >> output3 || ERR="$ERR jarsigner s3,"
-$JARSIGNER -verify -strict $JFILE s3 >> output3s && ERR="$ERR jarsigner s3 strict,"
-
-# warning without -strict
-cat output3 | grep Warning || ERR="$ERR s3 warning,"
-cat output3 | grep Error && ERR="$ERR s3 error,"
-cat output3 | grep "with signer errors" && ERR="$ERR s3 err,"
-
-# error with -strict
-cat output3s | grep Warning || ERR="$ERR s3s warning,"
-cat output3s | grep Error || ERR="$ERR s3s error,"
-cat output3s | grep "with signer errors" || ERR="$ERR s3 err,"
-
-if [ "$ERR" = "" ]; then
- exit 0
-else
- echo "ERR is $ERR"
- exit 1
-fi
--- a/langtools/.hgtags Thu Sep 17 16:53:42 2015 +0200
+++ b/langtools/.hgtags Fri Sep 25 12:04:35 2015 -0700
@@ -324,3 +324,4 @@
eaab8a16dcfb807acacdb6d133f3ecd502667a8c jdk9-b79
c5671e662392df372b2005b75afa6cfdc0eebce7 jdk9-b80
ead8b7192f00417185f0e64d0cb332f0f8ad4ae1 jdk9-b81
+d68904d5a00e7e6c714e11f7ec9d0689af959d79 jdk9-b82
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Types.java Thu Sep 17 16:53:42 2015 +0200
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Types.java Fri Sep 25 12:04:35 2015 -0700
@@ -3152,10 +3152,20 @@
throw new IllegalArgumentException("Not a method type: " + t);
}
public Type visitMethodType(MethodType t, Type newReturn) {
- return new MethodType(t.argtypes, newReturn, t.thrown, t.tsym);
+ return new MethodType(t.argtypes, newReturn, t.thrown, t.tsym) {
+ @Override
+ public Type baseType() {
+ return t;
+ }
+ };
}
public Type visitForAll(ForAll t, Type newReturn) {
- return new ForAll(t.tvars, t.qtype.accept(this, newReturn));
+ return new ForAll(t.tvars, t.qtype.accept(this, newReturn)) {
+ @Override
+ public Type baseType() {
+ return t;
+ }
+ };
}
};
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/ArgumentAttr.java Fri Sep 25 12:04:35 2015 -0700
@@ -0,0 +1,679 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * 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.comp;
+
+import com.sun.source.tree.LambdaExpressionTree.BodyKind;
+import com.sun.tools.javac.code.Flags;
+import com.sun.tools.javac.code.Symbol;
+import com.sun.tools.javac.code.Symtab;
+import com.sun.tools.javac.code.Type;
+import com.sun.tools.javac.code.Types.FunctionDescriptorLookupError;
+import com.sun.tools.javac.comp.Attr.ResultInfo;
+import com.sun.tools.javac.comp.Attr.TargetInfo;
+import com.sun.tools.javac.comp.Check.CheckContext;
+import com.sun.tools.javac.comp.DeferredAttr.AttrMode;
+import com.sun.tools.javac.comp.DeferredAttr.DeferredAttrContext;
+import com.sun.tools.javac.comp.DeferredAttr.DeferredType;
+import com.sun.tools.javac.comp.DeferredAttr.DeferredTypeCompleter;
+import com.sun.tools.javac.comp.DeferredAttr.LambdaReturnScanner;
+import com.sun.tools.javac.comp.Infer.PartiallyInferredMethodType;
+import com.sun.tools.javac.comp.Resolve.MethodResolutionPhase;
+import com.sun.tools.javac.tree.JCTree;
+import com.sun.tools.javac.tree.JCTree.JCConditional;
+import com.sun.tools.javac.tree.JCTree.JCExpression;
+import com.sun.tools.javac.tree.JCTree.JCLambda;
+import com.sun.tools.javac.tree.JCTree.JCLambda.ParameterKind;
+import com.sun.tools.javac.tree.JCTree.JCMemberReference;
+import com.sun.tools.javac.tree.JCTree.JCMethodInvocation;
+import com.sun.tools.javac.tree.JCTree.JCNewClass;
+import com.sun.tools.javac.tree.JCTree.JCParens;
+import com.sun.tools.javac.tree.JCTree.JCReturn;
+import com.sun.tools.javac.tree.TreeCopier;
+import com.sun.tools.javac.tree.TreeInfo;
+import com.sun.tools.javac.util.Assert;
+import com.sun.tools.javac.util.Context;
+import com.sun.tools.javac.util.DiagnosticSource;
+import com.sun.tools.javac.util.JCDiagnostic.DiagnosticPosition;
+import com.sun.tools.javac.util.List;
+import com.sun.tools.javac.util.ListBuffer;
+import com.sun.tools.javac.util.Log;
+
+import java.util.HashMap;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.Optional;
+import java.util.function.Function;
+import java.util.function.Supplier;
+
+import static com.sun.tools.javac.code.TypeTag.DEFERRED;
+import static com.sun.tools.javac.code.TypeTag.FORALL;
+import static com.sun.tools.javac.code.TypeTag.METHOD;
+import static com.sun.tools.javac.code.TypeTag.VOID;
+
+/**
+ * This class performs attribution of method/constructor arguments when target-typing is enabled
+ * (source >= 8); for each argument that is potentially a poly expression, this class builds
+ * a rich representation (see {@link ArgumentType} which can then be used for performing fast overload
+ * checks without requiring multiple attribution passes over the same code.
+ *
+ * The attribution strategy for a given method/constructor argument A is as follows:
+ *
+ * - if A is potentially a poly expression (i.e. diamond instance creation expression), a speculative
+ * pass over A is performed; the results of such speculative attribution are then saved in a special
+ * type, so that enclosing overload resolution can be carried by simply checking compatibility against the
+ * type determined during this speculative pass.
+ *
+ * - if A is a standalone expression, regular atributtion takes place.
+ *
+ * To minimize the speculative work, a cache is used, so that already computed argument types
+ * associated with a given unique source location are never recomputed multiple times.
+ */
+public class ArgumentAttr extends JCTree.Visitor {
+
+ protected static final Context.Key<ArgumentAttr> methodAttrKey = new Context.Key<>();
+
+ private final DeferredAttr deferredAttr;
+ private final Attr attr;
+ private final Symtab syms;
+ private final Log log;
+
+ /** Attribution environment to be used. */
+ private Env<AttrContext> env;
+
+ /** Result of method attribution. */
+ private Type result;
+
+ /** Cache for argument types; behavior is influences by the currrently selected cache policy. */
+ Map<UniquePos, ArgumentType<?>> argumentTypeCache = new LinkedHashMap<>();
+
+ /** Cache policy: should argument types be cached? */
+ private CachePolicy cachePolicy = CachePolicy.CACHE;
+
+ public static ArgumentAttr instance(Context context) {
+ ArgumentAttr instance = context.get(methodAttrKey);
+ if (instance == null)
+ instance = new ArgumentAttr(context);
+ return instance;
+ }
+
+ protected ArgumentAttr(Context context) {
+ context.put(methodAttrKey, this);
+ deferredAttr = DeferredAttr.instance(context);
+ attr = Attr.instance(context);
+ syms = Symtab.instance(context);
+ log = Log.instance(context);
+ }
+
+ /**
+ * Set the results of method attribution.
+ */
+ void setResult(JCExpression tree, Type type) {
+ result = type;
+ if (env.info.isSpeculative) {
+ //if we are in a speculative branch we can save the type in the tree itself
+ //as there's no risk of polluting the original tree.
+ tree.type = result;
+ }
+ }
+
+ /**
+ * Checks a type in the speculative tree against a given result; the type can be either a plain
+ * type or an argument type,in which case a more complex check is required.
+ */
+ Type checkSpeculative(JCExpression expr, ResultInfo resultInfo) {
+ return checkSpeculative(expr, expr.type, resultInfo);
+ }
+
+ /**
+ * Checks a type in the speculative tree against a given result; the type can be either a plain
+ * type or an argument type,in which case a more complex check is required.
+ */
+ Type checkSpeculative(DiagnosticPosition pos, Type t, ResultInfo resultInfo) {
+ if (t.hasTag(DEFERRED)) {
+ return ((DeferredType)t).check(resultInfo);
+ } else {
+ return resultInfo.check(pos, t);
+ }
+ }
+
+ /**
+ * Sets given ache policy and returns current policy.
+ */
+ CachePolicy withCachePolicy(CachePolicy newPolicy) {
+ CachePolicy oldPolicy = this.cachePolicy;
+ this.cachePolicy = newPolicy;
+ return oldPolicy;
+ }
+
+ /**
+ * Main entry point for attributing an argument with given tree and attribution environment.
+ */
+ Type attribArg(JCTree tree, Env<AttrContext> env) {
+ Env<AttrContext> prevEnv = this.env;
+ try {
+ this.env = env;
+ tree.accept(this);
+ return result;
+ } finally {
+ this.env = prevEnv;
+ }
+ }
+
+ @Override
+ public void visitTree(JCTree that) {
+ //delegates to Attr
+ that.accept(attr);
+ result = attr.result;
+ }
+
+ /**
+ * Process a method argument; this method takes care of performing a speculative pass over the
+ * argument tree and calling a well-defined entry point to build the argument type associated
+ * with such tree.
+ */
+ @SuppressWarnings("unchecked")
+ <T extends JCExpression, Z extends ArgumentType<T>> void processArg(T that, Function<T, Z> argumentTypeFactory) {
+ UniquePos pos = new UniquePos(that);
+ processArg(that, () -> {
+ T speculativeTree = (T)deferredAttr.attribSpeculative(that, env, attr.new MethodAttrInfo() {
+ @Override
+ protected void attr(JCTree tree, Env<AttrContext> env) {
+ //avoid speculative attribution loops
+ if (!new UniquePos(tree).equals(pos)) {
+ super.attr(tree, env);
+ } else {
+ visitTree(tree);
+ }
+ }
+ });
+ return argumentTypeFactory.apply(speculativeTree);
+ });
+ }
+
+ /**
+ * Process a method argument; this method allows the caller to specify a custom speculative attribution
+ * logic (this is used e.g. for lambdas).
+ */
+ @SuppressWarnings("unchecked")
+ <T extends JCExpression, Z extends ArgumentType<T>> void processArg(T that, Supplier<Z> argumentTypeFactory) {
+ UniquePos pos = new UniquePos(that);
+ Z cached = (Z)argumentTypeCache.get(pos);
+ if (cached != null) {
+ //dup existing speculative type
+ setResult(that, cached.dup(that, env));
+ } else {
+ Z res = argumentTypeFactory.get();
+ if (cachePolicy == CachePolicy.CACHE) {
+ argumentTypeCache.put(pos, res);
+ }
+ setResult(that, res);
+ }
+ }
+
+ @Override
+ public void visitParens(JCParens that) {
+ processArg(that, speculativeTree -> new ParensType(that, env, speculativeTree));
+ }
+
+ @Override
+ public void visitConditional(JCConditional that) {
+ processArg(that, speculativeTree -> new ConditionalType(that, env, speculativeTree));
+ }
+
+ @Override
+ public void visitReference(JCMemberReference tree) {
+ //perform arity-based check
+ Env<AttrContext> localEnv = env.dup(tree);
+ JCExpression exprTree = (JCExpression)deferredAttr.attribSpeculative(tree.getQualifierExpression(), localEnv,
+ attr.memberReferenceQualifierResult(tree));
+ JCMemberReference mref2 = new TreeCopier<Void>(attr.make).copy(tree);
+ mref2.expr = exprTree;
+ Symbol res =
+ attr.rs.getMemberReference(tree, localEnv, mref2,
+ exprTree.type, tree.name);
+ if (!res.kind.isResolutionError()) {
+ tree.sym = res;
+ }
+ if (res.kind.isResolutionTargetError() ||
+ res.type != null && res.type.hasTag(FORALL) ||
+ (res.flags() & Flags.VARARGS) != 0 ||
+ (TreeInfo.isStaticSelector(exprTree, tree.name.table.names) &&
+ exprTree.type.isRaw())) {
+ tree.overloadKind = JCMemberReference.OverloadKind.OVERLOADED;
+ } else {
+ tree.overloadKind = JCMemberReference.OverloadKind.UNOVERLOADED;
+ }
+ //return a plain old deferred type for this
+ setResult(tree, deferredAttr.new DeferredType(tree, env));
+ }
+
+ @Override
+ public void visitLambda(JCLambda that) {
+ if (that.paramKind == ParameterKind.EXPLICIT) {
+ //if lambda is explicit, we can save info in the corresponding argument type
+ processArg(that, () -> {
+ JCLambda speculativeLambda =
+ deferredAttr.attribSpeculativeLambda(that, env, attr.methodAttrInfo);
+ return new ExplicitLambdaType(that, env, speculativeLambda);
+ });
+ } else {
+ //otherwise just use a deferred type
+ setResult(that, deferredAttr.new DeferredType(that, env));
+ }
+ }
+
+ @Override
+ public void visitApply(JCMethodInvocation that) {
+ if (that.getTypeArguments().isEmpty()) {
+ processArg(that, speculativeTree -> new ResolvedMethodType(that, env, speculativeTree));
+ } else {
+ //not a poly expression, just call Attr
+ setResult(that, attr.attribTree(that, env, attr.unknownExprInfo));
+ }
+ }
+
+ @Override
+ public void visitNewClass(JCNewClass that) {
+ if (TreeInfo.isDiamond(that)) {
+ processArg(that, speculativeTree -> new ResolvedConstructorType(that, env, speculativeTree));
+ } else {
+ //not a poly expression, just call Attr
+ setResult(that, attr.attribTree(that, env, attr.unknownExprInfo));
+ }
+ }
+
+ /**
+ * An argument type is similar to a plain deferred type; the most important difference is that
+ * the completion logic associated with argument types allows speculative attribution to be skipped
+ * during overload resolution - that is, an argument type always has enough information to
+ * perform an overload check without the need of calling back to Attr. This extra information
+ * is typically stored in the form of a speculative tree.
+ */
+ abstract class ArgumentType<T extends JCExpression> extends DeferredType implements DeferredTypeCompleter {
+
+ /** The speculative tree carrying type information. */
+ T speculativeTree;
+
+ /** Types associated with this argument (one type per possible target result). */
+ Map<ResultInfo, Type> speculativeTypes;
+
+ public ArgumentType(JCExpression tree, Env<AttrContext> env, T speculativeTree, Map<ResultInfo, Type> speculativeTypes) {
+ deferredAttr.super(tree, env);
+ this.speculativeTree = speculativeTree;
+ this.speculativeTypes = speculativeTypes;
+ }
+
+ @Override
+ final DeferredTypeCompleter completer() {
+ return this;
+ }
+
+ @Override
+ final public Type complete(DeferredType dt, ResultInfo resultInfo, DeferredAttrContext deferredAttrContext) {
+ Assert.check(dt == this);
+ if (deferredAttrContext.mode == AttrMode.SPECULATIVE) {
+ Type t = (resultInfo.pt == Type.recoveryType) ?
+ deferredAttr.basicCompleter.complete(dt, resultInfo, deferredAttrContext) :
+ overloadCheck(resultInfo, deferredAttrContext);
+ speculativeTypes.put(resultInfo, t);
+ return t;
+ } else {
+ if (!env.info.isSpeculative && cachePolicy == CachePolicy.CACHE) {
+ argumentTypeCache.remove(new UniquePos(dt.tree));
+ }
+ return deferredAttr.basicCompleter.complete(dt, resultInfo, deferredAttrContext);
+ }
+ }
+
+ @Override
+ Type speculativeType(Symbol msym, MethodResolutionPhase phase) {
+ for (Map.Entry<ResultInfo, Type> _entry : speculativeTypes.entrySet()) {
+ DeferredAttrContext deferredAttrContext = _entry.getKey().checkContext.deferredAttrContext();
+ if (deferredAttrContext.phase == phase && deferredAttrContext.msym == msym) {
+ return _entry.getValue();
+ }
+ }
+ return Type.noType;
+ }
+
+ @Override
+ JCTree speculativeTree(DeferredAttrContext deferredAttrContext) {
+ return speculativeTree;
+ }
+
+ /**
+ * Performs an overload check against a given target result.
+ */
+ abstract Type overloadCheck(ResultInfo resultInfo, DeferredAttrContext deferredAttrContext);
+
+ /**
+ * Creates a copy of this argument type with given tree and environment.
+ */
+ abstract ArgumentType<T> dup(T tree, Env<AttrContext> env);
+ }
+
+ /**
+ * Argument type for parenthesized expression.
+ */
+ class ParensType extends ArgumentType<JCParens> {
+ ParensType(JCExpression tree, Env<AttrContext> env, JCParens speculativeParens) {
+ this(tree, env, speculativeParens, new HashMap<>());
+ }
+
+ ParensType(JCExpression tree, Env<AttrContext> env, JCParens speculativeParens, Map<ResultInfo, Type> speculativeTypes) {
+ super(tree, env, speculativeParens, speculativeTypes);
+ }
+
+ @Override
+ Type overloadCheck(ResultInfo resultInfo, DeferredAttrContext deferredAttrContext) {
+ return checkSpeculative(speculativeTree.expr, resultInfo);
+ }
+
+ @Override
+ ArgumentType<JCParens> dup(JCParens tree, Env<AttrContext> env) {
+ return new ParensType(tree, env, speculativeTree, speculativeTypes);
+ }
+ }
+
+ /**
+ * Argument type for conditionals.
+ */
+ class ConditionalType extends ArgumentType<JCConditional> {
+ ConditionalType(JCExpression tree, Env<AttrContext> env, JCConditional speculativeCond) {
+ this(tree, env, speculativeCond, new HashMap<>());
+ }
+
+ ConditionalType(JCExpression tree, Env<AttrContext> env, JCConditional speculativeCond, Map<ResultInfo, Type> speculativeTypes) {
+ super(tree, env, speculativeCond, speculativeTypes);
+ }
+
+ @Override
+ Type overloadCheck(ResultInfo resultInfo, DeferredAttrContext deferredAttrContext) {
+ ResultInfo localInfo = resultInfo.dup(attr.conditionalContext(resultInfo.checkContext));
+ if (speculativeTree.isStandalone()) {
+ return localInfo.check(speculativeTree, speculativeTree.type);
+ } else if (resultInfo.pt.hasTag(VOID)) {
+ //this means we are returning a poly conditional from void-compatible lambda expression
+ resultInfo.checkContext.report(tree, attr.diags.fragment("conditional.target.cant.be.void"));
+ return attr.types.createErrorType(resultInfo.pt);
+ } else {
+ //poly
+ checkSpeculative(speculativeTree.truepart, localInfo);
+ checkSpeculative(speculativeTree.falsepart, localInfo);
+ return localInfo.pt;
+ }
+ }
+
+ @Override
+ ArgumentType<JCConditional> dup(JCConditional tree, Env<AttrContext> env) {
+ return new ConditionalType(tree, env, speculativeTree, speculativeTypes);
+ }
+ }
+
+ /**
+ * Argument type for explicit lambdas.
+ */
+ class ExplicitLambdaType extends ArgumentType<JCLambda> {
+
+ /** List of argument types (lazily populated). */
+ Optional<List<Type>> argtypes = Optional.empty();
+
+ /** List of return expressions (lazily populated). */
+ Optional<List<JCReturn>> returnExpressions = Optional.empty();
+
+ ExplicitLambdaType(JCLambda originalLambda, Env<AttrContext> env, JCLambda speculativeLambda) {
+ this(originalLambda, env, speculativeLambda, new HashMap<>());
+ }
+
+ ExplicitLambdaType(JCLambda originalLambda, Env<AttrContext> env, JCLambda speculativeLambda, Map<ResultInfo, Type> speculativeTypes) {
+ super(originalLambda, env, speculativeLambda, speculativeTypes);
+ }
+
+ /** Compute argument types (if needed). */
+ List<Type> argtypes() {
+ return argtypes.orElseGet(() -> {
+ List<Type> res = TreeInfo.types(speculativeTree.params);
+ argtypes = Optional.of(res);
+ return res;
+ });
+ }
+
+ /** Compute return expressions (if needed). */
+ List<JCReturn> returnExpressions() {
+ return returnExpressions.orElseGet(() -> {
+ final List<JCReturn> res;
+ if (speculativeTree.getBodyKind() == BodyKind.EXPRESSION) {
+ res = List.of(attr.make.Return((JCExpression)speculativeTree.body));
+ } else {
+ ListBuffer<JCReturn> returnExpressions = new ListBuffer<>();
+ new LambdaReturnScanner() {
+ @Override
+ public void visitReturn(JCReturn tree) {
+ returnExpressions.add(tree);
+ }
+ }.scan(speculativeTree.body);
+ res = returnExpressions.toList();
+ }
+ returnExpressions = Optional.of(res);
+ return res;
+ });
+ }
+
+ @Override
+ Type overloadCheck(ResultInfo resultInfo, DeferredAttrContext deferredAttrContext) {
+ try {
+ //compute target-type; this logic could be shared with Attr
+ TargetInfo targetInfo = attr.getTargetInfo(speculativeTree, resultInfo, argtypes());
+ Type lambdaType = targetInfo.descriptor;
+ Type currentTarget = targetInfo.target;
+ //check compatibility
+ checkLambdaCompatible(lambdaType, resultInfo);
+ return currentTarget;
+ } catch (FunctionDescriptorLookupError ex) {
+ resultInfo.checkContext.report(null, ex.getDiagnostic());
+ return null; //cannot get here
+ }
+ }
+
+ /** Check lambda against given target result */
+ private void checkLambdaCompatible(Type descriptor, ResultInfo resultInfo) {
+ CheckContext checkContext = resultInfo.checkContext;
+ ResultInfo bodyResultInfo = attr.lambdaBodyResult(speculativeTree, descriptor, resultInfo);
+ for (JCReturn ret : returnExpressions()) {
+ Type t = getReturnType(ret);
+ if (speculativeTree.getBodyKind() == BodyKind.EXPRESSION || !t.hasTag(VOID)) {
+ checkSpeculative(ret.expr, t, bodyResultInfo);
+ }
+ }
+
+ attr.checkLambdaCompatible(speculativeTree, descriptor, checkContext);
+ }
+
+ /** Get the type associated with given return expression. */
+ Type getReturnType(JCReturn ret) {
+ if (ret.expr == null) {
+ return syms.voidType;
+ } else {
+ return ret.expr.type;
+ }
+ }
+
+ @Override
+ ArgumentType<JCLambda> dup(JCLambda tree, Env<AttrContext> env) {
+ return new ExplicitLambdaType(tree, env, speculativeTree, speculativeTypes);
+ }
+ }
+
+ /**
+ * Argument type for methods/constructors.
+ */
+ abstract class ResolvedMemberType<E extends JCExpression> extends ArgumentType<E> {
+
+ public ResolvedMemberType(JCExpression tree, Env<AttrContext> env, E speculativeMethod, Map<ResultInfo, Type> speculativeTypes) {
+ super(tree, env, speculativeMethod, speculativeTypes);
+ }
+
+ @Override
+ Type overloadCheck(ResultInfo resultInfo, DeferredAttrContext deferredAttrContext) {
+ Type mtype = methodType();
+ ResultInfo localInfo = resultInfo(resultInfo);
+ if (mtype != null && mtype.hasTag(METHOD) && mtype.isPartial()) {
+ Type t = ((PartiallyInferredMethodType)mtype).check(localInfo);
+ if (!deferredAttrContext.inferenceContext.free(localInfo.pt)) {
+ speculativeTypes.put(localInfo, t);
+ return localInfo.check(tree.pos(), t);
+ } else {
+ return t;
+ }
+ } else {
+ Type t = localInfo.check(tree.pos(), speculativeTree.type);
+ speculativeTypes.put(localInfo, t);
+ return t;
+ }
+ }
+
+ /**
+ * Get the result info to be used for performing an overload check.
+ */
+ abstract ResultInfo resultInfo(ResultInfo resultInfo);
+
+ /**
+ * Get the method type to be used for performing an overload check.
+ */
+ abstract Type methodType();
+ }
+
+ /**
+ * Argument type for methods.
+ */
+ class ResolvedMethodType extends ResolvedMemberType<JCMethodInvocation> {
+
+ public ResolvedMethodType(JCExpression tree, Env<AttrContext> env, JCMethodInvocation speculativeTree) {
+ this(tree, env, speculativeTree, new HashMap<>());
+ }
+
+ public ResolvedMethodType(JCExpression tree, Env<AttrContext> env, JCMethodInvocation speculativeTree, Map<ResultInfo, Type> speculativeTypes) {
+ super(tree, env, speculativeTree, speculativeTypes);
+ }
+
+ @Override
+ ResultInfo resultInfo(ResultInfo resultInfo) {
+ return resultInfo;
+ }
+
+ @Override
+ Type methodType() {
+ return speculativeTree.meth.type;
+ }
+
+ @Override
+ ArgumentType<JCMethodInvocation> dup(JCMethodInvocation tree, Env<AttrContext> env) {
+ return new ResolvedMethodType(tree, env, speculativeTree, speculativeTypes);
+ }
+ }
+
+ /**
+ * Argument type for constructors.
+ */
+ class ResolvedConstructorType extends ResolvedMemberType<JCNewClass> {
+
+ public ResolvedConstructorType(JCExpression tree, Env<AttrContext> env, JCNewClass speculativeTree) {
+ this(tree, env, speculativeTree, new HashMap<>());
+ }
+
+ public ResolvedConstructorType(JCExpression tree, Env<AttrContext> env, JCNewClass speculativeTree, Map<ResultInfo, Type> speculativeTypes) {
+ super(tree, env, speculativeTree, speculativeTypes);
+ }
+
+ @Override
+ ResultInfo resultInfo(ResultInfo resultInfo) {
+ return resultInfo.dup(attr.diamondContext(speculativeTree, speculativeTree.clazz.type.tsym, resultInfo.checkContext));
+ }
+
+ @Override
+ Type methodType() {
+ return (speculativeTree.constructorType != null) ?
+ speculativeTree.constructorType.baseType() : syms.errType;
+ }
+
+ @Override
+ ArgumentType<JCNewClass> dup(JCNewClass tree, Env<AttrContext> env) {
+ return new ResolvedConstructorType(tree, env, speculativeTree, speculativeTypes);
+ }
+ }
+
+ /**
+ * An instance of this class represents a unique position in a compilation unit. A unique
+ * position is made up of (i) a unique position in a source file (char offset) and (ii)
+ * a source file info.
+ */
+ class UniquePos {
+
+ /** Char offset. */
+ int pos;
+
+ /** Source info. */
+ DiagnosticSource source;
+
+ UniquePos(JCTree tree) {
+ this.pos = tree.pos;
+ this.source = log.currentSource();
+ }
+
+ @Override
+ public int hashCode() {
+ return pos << 16 + source.hashCode();
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (obj instanceof UniquePos) {
+ UniquePos that = (UniquePos)obj;
+ return pos == that.pos && source == that.source;
+ } else {
+ return false;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return source.getFile().getName() + " @ " + source.getLineNumber(pos);
+ }
+ }
+
+ /**
+ * Argument type caching policy.
+ */
+ enum CachePolicy {
+ /** Cache argument types. */
+ CACHE,
+ /**
+ * Don't cache argument types. This is useful when performing speculative attribution on
+ * a tree that is known to contain erroneous info.
+ */
+ NO_CACHE;
+ }
+}
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java Thu Sep 17 16:53:42 2015 +0200
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java Fri Sep 25 12:04:35 2015 -0700
@@ -108,6 +108,7 @@
final TypeEnvs typeEnvs;
final Dependencies dependencies;
final Annotate annotate;
+ final ArgumentAttr argumentAttr;
public static Attr instance(Context context) {
Attr instance = context.get(attrKey);
@@ -142,6 +143,7 @@
deferredLintHandler = DeferredLintHandler.instance(context);
typeEnvs = TypeEnvs.instance(context);
dependencies = Dependencies.instance(context);
+ argumentAttr = ArgumentAttr.instance(context);
Options options = Options.instance(context);
@@ -160,7 +162,7 @@
statInfo = new ResultInfo(KindSelector.NIL, Type.noType);
varAssignmentInfo = new ResultInfo(KindSelector.ASG, Type.noType);
unknownExprInfo = new ResultInfo(KindSelector.VAL, Type.noType);
- unknownAnyPolyInfo = new ResultInfo(KindSelector.VAL, Infer.anyPoly);
+ methodAttrInfo = new MethodAttrInfo();
unknownTypeInfo = new ResultInfo(KindSelector.TYP, Type.noType);
unknownTypeExprInfo = new ResultInfo(KindSelector.VAL_TYP, Type.noType);
recoveryInfo = new RecoveryInfo(deferredAttr.emptyDeferredAttrContext);
@@ -488,6 +490,10 @@
this.checkMode = checkMode;
}
+ protected void attr(JCTree tree, Env<AttrContext> env) {
+ tree.accept(Attr.this);
+ }
+
protected Type check(final DiagnosticPosition pos, final Type found) {
return chk.checkType(pos, found, pt, checkContext);
}
@@ -522,6 +528,41 @@
}
}
+ class MethodAttrInfo extends ResultInfo {
+ public MethodAttrInfo() {
+ this(chk.basicHandler);
+ }
+
+ public MethodAttrInfo(CheckContext checkContext) {
+ super(KindSelector.VAL, Infer.anyPoly, checkContext);
+ }
+
+ @Override
+ protected void attr(JCTree tree, Env<AttrContext> env) {
+ result = argumentAttr.attribArg(tree, env);
+ }
+
+ protected ResultInfo dup(Type newPt) {
+ throw new IllegalStateException();
+ }
+
+ protected ResultInfo dup(CheckContext newContext) {
+ return new MethodAttrInfo(newContext);
+ }
+
+ protected ResultInfo dup(Type newPt, CheckContext newContext) {
+ throw new IllegalStateException();
+ }
+
+ protected ResultInfo dup(Type newPt, CheckContext newContext, CheckMode newMode) {
+ throw new IllegalStateException();
+ }
+
+ protected ResultInfo dup(CheckMode newMode) {
+ throw new IllegalStateException();
+ }
+ }
+
class RecoveryInfo extends ResultInfo {
public RecoveryInfo(final DeferredAttr.DeferredAttrContext deferredAttrContext) {
@@ -545,7 +586,7 @@
final ResultInfo statInfo;
final ResultInfo varAssignmentInfo;
- final ResultInfo unknownAnyPolyInfo;
+ final ResultInfo methodAttrInfo;
final ResultInfo unknownExprInfo;
final ResultInfo unknownTypeInfo;
final ResultInfo unknownTypeExprInfo;
@@ -588,7 +629,7 @@
try {
this.env = env;
this.resultInfo = resultInfo;
- tree.accept(this);
+ resultInfo.attr(tree, env);
if (tree == breakTree &&
resultInfo.checkContext.deferredAttrContext().mode == AttrMode.CHECK) {
throw new BreakAttr(copyEnv(env));
@@ -684,12 +725,9 @@
KindSelector attribArgs(KindSelector initialKind, List<JCExpression> trees, Env<AttrContext> env, ListBuffer<Type> argtypes) {
KindSelector kind = initialKind;
for (JCExpression arg : trees) {
- Type argtype;
- if (allowPoly && deferredAttr.isDeferred(env, arg)) {
- argtype = deferredAttr.new DeferredType(arg, env);
+ Type argtype = chk.checkNonVoid(arg, attribTree(arg, env, allowPoly ? methodAttrInfo : unknownExprInfo));
+ if (argtype.hasTag(DEFERRED)) {
kind = KindSelector.of(KindSelector.POLY, kind);
- } else {
- argtype = chk.checkNonVoid(arg, attribTree(arg, env, unknownAnyPolyInfo));
}
argtypes.append(argtype);
}
@@ -1426,12 +1464,12 @@
Type condtype = attribExpr(tree.cond, env, syms.booleanType);
tree.polyKind = (!allowPoly ||
- pt().hasTag(NONE) && pt() != Type.recoveryType ||
+ pt().hasTag(NONE) && pt() != Type.recoveryType && pt() != Infer.anyPoly ||
isBooleanOrNumeric(env, tree)) ?
PolyKind.STANDALONE : PolyKind.POLY;
if (tree.polyKind == PolyKind.POLY && resultInfo.pt.hasTag(VOID)) {
- //cannot get here (i.e. it means we are returning from void method - which is already an error)
+ //this means we are returning a poly conditional from void-compatible lambda expression
resultInfo.checkContext.report(tree, diags.fragment("conditional.target.cant.be.void"));
result = tree.type = types.createErrorType(resultInfo.pt);
return;
@@ -1439,15 +1477,7 @@
ResultInfo condInfo = tree.polyKind == PolyKind.STANDALONE ?
unknownExprInfo :
- resultInfo.dup(new Check.NestedCheckContext(resultInfo.checkContext) {
- //this will use enclosing check context to check compatibility of
- //subexpression against target type; if we are in a method check context,
- //depending on whether boxing is allowed, we could have incompatibilities
- @Override
- public void report(DiagnosticPosition pos, JCDiagnostic details) {
- enclosingContext.report(pos, diags.fragment("incompatible.type.in.conditional", details));
- }
- });
+ resultInfo.dup(conditionalContext(resultInfo.checkContext));
Type truetype = attribTree(tree.truepart, env, condInfo);
Type falsetype = attribTree(tree.falsepart, env, condInfo);
@@ -1506,6 +1536,18 @@
}
};
+ CheckContext conditionalContext(CheckContext checkContext) {
+ return new Check.NestedCheckContext(checkContext) {
+ //this will use enclosing check context to check compatibility of
+ //subexpression against target type; if we are in a method check context,
+ //depending on whether boxing is allowed, we could have incompatibilities
+ @Override
+ public void report(DiagnosticPosition pos, JCDiagnostic details) {
+ enclosingContext.report(pos, diags.fragment("incompatible.type.in.conditional", details));
+ }
+ };
+ }
+
/** Compute the type of a conditional expression, after
* checking that it exists. See JLS 15.25. Does not take into
* account the special case where condition and both arms
@@ -2070,13 +2112,8 @@
tree.constructor = constructor.baseSymbol();
final TypeSymbol csym = clazztype.tsym;
- ResultInfo diamondResult = new ResultInfo(pkind, newMethodTemplate(resultInfo.pt, argtypes, typeargtypes), new Check.NestedCheckContext(resultInfo.checkContext) {
- @Override
- public void report(DiagnosticPosition _unused, JCDiagnostic details) {
- enclosingContext.report(tree.clazz,
- diags.fragment("cant.apply.diamond.1", diags.fragment("diamond", csym), details));
- }
- }, CheckMode.NO_TREE_UPDATE);
+ ResultInfo diamondResult = new ResultInfo(pkind, newMethodTemplate(resultInfo.pt, argtypes, typeargtypes),
+ diamondContext(tree, csym, resultInfo.checkContext), CheckMode.NO_TREE_UPDATE);
Type constructorType = tree.constructorType = types.createErrorType(clazztype);
constructorType = checkId(tree, site,
constructor,
@@ -2261,6 +2298,16 @@
chk.validate(tree.typeargs, localEnv);
}
+ CheckContext diamondContext(JCNewClass clazz, TypeSymbol tsym, CheckContext checkContext) {
+ return new Check.NestedCheckContext(checkContext) {
+ @Override
+ public void report(DiagnosticPosition _unused, JCDiagnostic details) {
+ enclosingContext.report(clazz.clazz,
+ diags.fragment("cant.apply.diamond.1", diags.fragment("diamond", tsym), details));
+ }
+ };
+ }
+
/** Make an attributed null check tree.
*/
public JCExpression makeNullCheck(JCExpression arg) {
@@ -2330,8 +2377,7 @@
boolean needsRecovery =
resultInfo.checkContext.deferredAttrContext().mode == DeferredAttr.AttrMode.CHECK;
try {
- Type currentTarget = pt();
- if (needsRecovery && isSerializable(currentTarget)) {
+ if (needsRecovery && isSerializable(pt())) {
localEnv.info.isSerializable = true;
}
List<Type> explicitParamTypes = null;
@@ -2341,22 +2387,13 @@
explicitParamTypes = TreeInfo.types(that.params);
}
- Type lambdaType;
- if (pt() != Type.recoveryType) {
- /* We need to adjust the target. If the target is an
- * intersection type, for example: SAM & I1 & I2 ...
- * the target will be updated to SAM
- */
- currentTarget = targetChecker.visit(currentTarget, that);
- if (explicitParamTypes != null) {
- currentTarget = infer.instantiateFunctionalInterface(that,
- currentTarget, explicitParamTypes, resultInfo.checkContext);
- }
- currentTarget = types.removeWildcards(currentTarget);
- lambdaType = types.findDescriptorType(currentTarget);
- } else {
- currentTarget = Type.recoveryType;
- lambdaType = fallbackDescriptorType(that);
+ TargetInfo targetInfo = getTargetInfo(that, resultInfo, explicitParamTypes);
+ Type currentTarget = targetInfo.target;
+ Type lambdaType = targetInfo.descriptor;
+
+ if (currentTarget.isErroneous()) {
+ result = that.type = currentTarget;
+ return;
}
setFunctionalInfo(localEnv, that, pt(), lambdaType, currentTarget, resultInfo.checkContext);
@@ -2409,15 +2446,8 @@
//with the target-type, it will be recovered anyway in Attr.checkId
needsRecovery = false;
- FunctionalReturnContext funcContext = that.getBodyKind() == JCLambda.BodyKind.EXPRESSION ?
- new ExpressionLambdaReturnContext((JCExpression)that.getBody(), resultInfo.checkContext) :
- new FunctionalReturnContext(resultInfo.checkContext);
-
- ResultInfo bodyResultInfo = lambdaType.getReturnType() == Type.recoveryType ?
- recoveryInfo :
- new ResultInfo(KindSelector.VAL,
- lambdaType.getReturnType(), funcContext);
- localEnv.info.returnResult = bodyResultInfo;
+ ResultInfo bodyResultInfo = localEnv.info.returnResult =
+ lambdaBodyResult(that, lambdaType, resultInfo);
if (that.getBodyKind() == JCLambda.BodyKind.EXPRESSION) {
attribTree(that.getBody(), localEnv, bodyResultInfo);
@@ -2467,6 +2497,44 @@
}
}
//where
+ class TargetInfo {
+ Type target;
+ Type descriptor;
+
+ public TargetInfo(Type target, Type descriptor) {
+ this.target = target;
+ this.descriptor = descriptor;
+ }
+ }
+
+ TargetInfo getTargetInfo(JCPolyExpression that, ResultInfo resultInfo, List<Type> explicitParamTypes) {
+ Type lambdaType;
+ Type currentTarget = resultInfo.pt;
+ if (resultInfo.pt != Type.recoveryType) {
+ /* We need to adjust the target. If the target is an
+ * intersection type, for example: SAM & I1 & I2 ...
+ * the target will be updated to SAM
+ */
+ currentTarget = targetChecker.visit(currentTarget, that);
+ if (explicitParamTypes != null) {
+ currentTarget = infer.instantiateFunctionalInterface(that,
+ currentTarget, explicitParamTypes, resultInfo.checkContext);
+ }
+ currentTarget = types.removeWildcards(currentTarget);
+ lambdaType = types.findDescriptorType(currentTarget);
+ } else {
+ currentTarget = Type.recoveryType;
+ lambdaType = fallbackDescriptorType(that);
+ }
+ if (that.hasTag(LAMBDA) && lambdaType.hasTag(FORALL)) {
+ //lambda expression target desc cannot be a generic method
+ resultInfo.checkContext.report(that, diags.fragment("invalid.generic.lambda.target",
+ lambdaType, kindName(currentTarget.tsym), currentTarget.tsym));
+ currentTarget = types.createErrorType(pt());
+ }
+ return new TargetInfo(currentTarget, lambdaType);
+ }
+
void preFlow(JCLambda tree) {
new PostAttrAnalyzer() {
@Override
@@ -2612,13 +2680,24 @@
}
}
+ ResultInfo lambdaBodyResult(JCLambda that, Type descriptor, ResultInfo resultInfo) {
+ FunctionalReturnContext funcContext = that.getBodyKind() == JCLambda.BodyKind.EXPRESSION ?
+ new ExpressionLambdaReturnContext((JCExpression)that.getBody(), resultInfo.checkContext) :
+ new FunctionalReturnContext(resultInfo.checkContext);
+
+ return descriptor.getReturnType() == Type.recoveryType ?
+ recoveryInfo :
+ new ResultInfo(KindSelector.VAL,
+ descriptor.getReturnType(), funcContext);
+ }
+
/**
* Lambda compatibility. Check that given return types, thrown types, parameter types
* are compatible with the expected functional interface descriptor. This means that:
* (i) parameter types must be identical to those of the target descriptor; (ii) return
* types must be compatible with the return type of the expected descriptor.
*/
- private void checkLambdaCompatible(JCLambda tree, Type descriptor, CheckContext checkContext) {
+ void checkLambdaCompatible(JCLambda tree, Type descriptor, CheckContext checkContext) {
Type returnType = checkContext.inferenceContext().asUndetVar(descriptor.getReturnType());
//return values have already been checked - but if lambda has no return
@@ -2746,18 +2825,12 @@
typeargtypes = attribTypes(that.typeargs, localEnv);
}
- Type desc;
- Type currentTarget = pt();
boolean isTargetSerializable =
resultInfo.checkContext.deferredAttrContext().mode == DeferredAttr.AttrMode.CHECK &&
- isSerializable(currentTarget);
- if (currentTarget != Type.recoveryType) {
- currentTarget = types.removeWildcards(targetChecker.visit(currentTarget, that));
- desc = types.findDescriptorType(currentTarget);
- } else {
- currentTarget = Type.recoveryType;
- desc = fallbackDescriptorType(that);
- }
+ isSerializable(pt());
+ TargetInfo targetInfo = getTargetInfo(that, resultInfo, null);
+ Type currentTarget = targetInfo.target;
+ Type desc = targetInfo.descriptor;
setFunctionalInfo(localEnv, that, pt(), desc, currentTarget, resultInfo.checkContext);
List<Type> argtypes = desc.getParameterTypes();
@@ -3279,7 +3352,7 @@
}
// Attribute the qualifier expression, and determine its symbol (if any).
- Type site = attribTree(tree.selected, env, new ResultInfo(skind, Infer.anyPoly));
+ Type site = attribTree(tree.selected, env, new ResultInfo(skind, Type.noType));
if (!pkind().contains(KindSelector.TYP_PCK))
site = capture(site); // Capture field access
@@ -3884,8 +3957,15 @@
syms.methodClass);
}
- return chk.checkMethod(owntype, sym, env, argtrees, argtypes, env.info.lastResolveVarargs(),
- resultInfo.checkContext.inferenceContext());
+ PolyKind pkind = (sym.type.hasTag(FORALL) &&
+ sym.type.getReturnType().containsAny(((ForAll)sym.type).tvars)) ?
+ PolyKind.POLY : PolyKind.STANDALONE;
+ TreeInfo.setPolyKind(env.tree, pkind);
+
+ return (resultInfo.pt == Infer.anyPoly) ?
+ owntype :
+ chk.checkMethod(owntype, sym, env, argtrees, argtypes, env.info.lastResolveVarargs(),
+ resultInfo.checkContext.inferenceContext());
} catch (Infer.InferenceException ex) {
//invalid target type - propagate exception outwards or report error
//depending on the current check context
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Check.java Thu Sep 17 16:53:42 2015 +0200
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Check.java Fri Sep 25 12:04:35 2015 -0700
@@ -49,7 +49,6 @@
import com.sun.tools.javac.comp.DeferredAttr.DeferredAttrContext;
import com.sun.tools.javac.comp.Infer.FreeTypeListener;
import com.sun.tools.javac.tree.JCTree.*;
-import com.sun.tools.javac.tree.JCTree.JCPolyExpression.*;
import static com.sun.tools.javac.code.Flags.*;
import static com.sun.tools.javac.code.Flags.ANNOTATION;
@@ -976,10 +975,6 @@
TreeInfo.setVarargsElement(env.tree, types.elemtype(argtype));
}
}
- PolyKind pkind = (sym.type.hasTag(FORALL) &&
- sym.type.getReturnType().containsAny(((ForAll)sym.type).tvars)) ?
- PolyKind.POLY : PolyKind.STANDALONE;
- TreeInfo.setPolyKind(env.tree, pkind);
return owntype;
}
//where
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/DeferredAttr.java Thu Sep 17 16:53:42 2015 +0200
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/DeferredAttr.java Fri Sep 25 12:04:35 2015 -0700
@@ -29,6 +29,7 @@
import com.sun.source.tree.NewClassTree;
import com.sun.tools.javac.code.*;
import com.sun.tools.javac.code.Type.TypeMapping;
+import com.sun.tools.javac.comp.ArgumentAttr.CachePolicy;
import com.sun.tools.javac.comp.Resolve.ResolveError;
import com.sun.tools.javac.resources.CompilerProperties.Fragments;
import com.sun.tools.javac.tree.*;
@@ -36,7 +37,6 @@
import com.sun.tools.javac.util.DefinedBy.Api;
import com.sun.tools.javac.util.JCDiagnostic.DiagnosticPosition;
import com.sun.tools.javac.code.Symbol.*;
-import com.sun.tools.javac.code.Type.*;
import com.sun.tools.javac.comp.Attr.ResultInfo;
import com.sun.tools.javac.comp.Resolve.MethodResolutionPhase;
import com.sun.tools.javac.tree.JCTree.*;
@@ -55,8 +55,6 @@
import static com.sun.tools.javac.code.TypeTag.*;
import static com.sun.tools.javac.tree.JCTree.Tag.*;
-import static com.sun.tools.javac.code.Kinds.*;
-import static com.sun.tools.javac.code.Kinds.Kind.*;
/**
* This is an helper class that is used to perform deferred type-analysis.
@@ -73,6 +71,7 @@
protected static final Context.Key<DeferredAttr> deferredAttrKey = new Context.Key<>();
final Attr attr;
+ final ArgumentAttr argumentAttr;
final Check chk;
final JCDiagnostic.Factory diags;
final Enter enter;
@@ -98,6 +97,7 @@
protected DeferredAttr(Context context) {
context.put(deferredAttrKey, this);
attr = Attr.instance(context);
+ argumentAttr = ArgumentAttr.instance(context);
chk = Check.instance(context);
diags = JCDiagnostic.Factory.instance(context);
enter = Enter.instance(context);
@@ -255,6 +255,15 @@
return e != null ? e.speculativeTree.type : Type.noType;
}
+ JCTree speculativeTree(DeferredAttrContext deferredAttrContext) {
+ DeferredType.SpeculativeCache.Entry e = speculativeCache.get(deferredAttrContext.msym, deferredAttrContext.phase);
+ return e != null ? e.speculativeTree : stuckTree;
+ }
+
+ DeferredTypeCompleter completer() {
+ return basicCompleter;
+ }
+
/**
* Check a deferred type against a potential target-type. Depending on
* the current attribution mode, a normal vs. speculative attribution
@@ -272,7 +281,7 @@
} else {
deferredStuckPolicy = new CheckStuckPolicy(resultInfo, this);
}
- return check(resultInfo, deferredStuckPolicy, basicCompleter);
+ return check(resultInfo, deferredStuckPolicy, completer());
}
private Type check(ResultInfo resultInfo, DeferredStuckPolicy deferredStuckPolicy,
@@ -389,6 +398,42 @@
}
/**
+ * Performs speculative attribution of a lambda body and returns the speculative lambda tree,
+ * in the absence of a target-type. Since {@link Attr#visitLambda(JCLambda)} cannot type-check
+ * lambda bodies w/o a suitable target-type, this routine 'unrolls' the lambda by turning it
+ * into a regular block, speculatively type-checks the block and then puts back the pieces.
+ */
+ JCLambda attribSpeculativeLambda(JCLambda that, Env<AttrContext> env, ResultInfo resultInfo) {
+ ListBuffer<JCStatement> stats = new ListBuffer<>();
+ stats.addAll(that.params);
+ if (that.getBodyKind() == JCLambda.BodyKind.EXPRESSION) {
+ stats.add(make.Return((JCExpression)that.body));
+ } else {
+ stats.add((JCBlock)that.body);
+ }
+ JCBlock lambdaBlock = make.Block(0, stats.toList());
+ Env<AttrContext> localEnv = attr.lambdaEnv(that, env);
+ try {
+ localEnv.info.returnResult = resultInfo;
+ JCBlock speculativeTree = (JCBlock)attribSpeculative(lambdaBlock, localEnv, resultInfo);
+ List<JCVariableDecl> args = speculativeTree.getStatements().stream()
+ .filter(s -> s.hasTag(Tag.VARDEF))
+ .map(t -> (JCVariableDecl)t)
+ .collect(List.collector());
+ JCTree lambdaBody = speculativeTree.getStatements().last();
+ if (lambdaBody.hasTag(Tag.RETURN)) {
+ lambdaBody = ((JCReturn)lambdaBody).expr;
+ }
+ JCLambda speculativeLambda = make.Lambda(args, lambdaBody);
+ attr.preFlow(speculativeLambda);
+ flow.analyzeLambda(env, speculativeLambda, make, false);
+ return speculativeLambda;
+ } finally {
+ localEnv.info.scope.leave();
+ }
+ }
+
+ /**
* Routine that performs speculative type-checking; the input AST node is
* cloned (to avoid side-effects cause by Attr) and compiler state is
* restored after type-checking. All diagnostics (but critical ones) are
@@ -572,7 +617,7 @@
}
}
- private boolean insideOverloadPhase() {
+ public boolean insideOverloadPhase() {
DeferredAttrContext dac = this;
if (dac == emptyDeferredAttrContext) {
return false;
@@ -731,56 +776,16 @@
}
boolean canLambdaBodyCompleteNormally(JCLambda tree) {
- JCLambda newTree = new TreeCopier<>(make).copy(tree);
- /* attr.lambdaEnv will create a meaningful env for the
- * lambda expression. This is specially useful when the
- * lambda is used as the init of a field. But we need to
- * remove any added symbol.
- */
- Env<AttrContext> localEnv = attr.lambdaEnv(newTree, env);
+ List<JCVariableDecl> oldParams = tree.params;
+ CachePolicy prevPolicy = argumentAttr.withCachePolicy(CachePolicy.NO_CACHE);
try {
- List<JCVariableDecl> tmpParams = newTree.params;
- while (tmpParams.nonEmpty()) {
- tmpParams.head.vartype = make.at(tmpParams.head).Type(syms.errType);
- tmpParams = tmpParams.tail;
- }
-
- attr.attribStats(newTree.params, localEnv);
-
- /* set pt to Type.noType to avoid generating any bound
- * which may happen if lambda's return type is an
- * inference variable
- */
- Attr.ResultInfo bodyResultInfo = attr.new ResultInfo(KindSelector.VAL, Type.noType);
- localEnv.info.returnResult = bodyResultInfo;
-
- // discard any log output
- Log.DiagnosticHandler diagHandler = new Log.DiscardDiagnosticHandler(log);
- try {
- JCBlock body = (JCBlock)newTree.body;
- /* we need to attribute the lambda body before
- * doing the aliveness analysis. This is because
- * constant folding occurs during attribution
- * and the reachability of some statements depends
- * on constant values, for example:
- *
- * while (true) {...}
- */
- attr.attribStats(body.stats, localEnv);
-
- attr.preFlow(newTree);
- /* make an aliveness / reachability analysis of the lambda
- * to determine if it can complete normally
- */
- flow.analyzeLambda(localEnv, newTree, make, true);
- } finally {
- log.popDiagnosticHandler(diagHandler);
- }
- return newTree.canCompleteNormally;
+ tree.params = tree.params.stream()
+ .map(vd -> make.VarDef(vd.mods, vd.name, make.Erroneous(), null))
+ .collect(List.collector());
+ return attribSpeculativeLambda(tree, env, attr.unknownExprInfo).canCompleteNormally;
} finally {
- JCBlock body = (JCBlock)newTree.body;
- unenterScanner.scan(body.stats);
- localEnv.info.scope.leave();
+ argumentAttr.withCachePolicy(prevPolicy);
+ tree.params = oldParams;
}
}
@@ -951,7 +956,7 @@
* A special tree scanner that would only visit portions of a given tree.
* The set of nodes visited by the scanner can be customized at construction-time.
*/
- abstract static class FilterScanner extends TreeScanner {
+ abstract static class FilterScanner extends com.sun.tools.javac.tree.TreeScanner {
final Filter<JCTree> treeFilter;
@@ -1148,330 +1153,4 @@
}
}
}
-
- /**
- * Does the argument expression {@code expr} need speculative type-checking?
- */
- boolean isDeferred(Env<AttrContext> env, JCExpression expr) {
- DeferredChecker dc = new DeferredChecker(env);
- dc.scan(expr);
- return dc.result.isPoly();
- }
-
- /**
- * The kind of an argument expression. This is used by the analysis that
- * determines as to whether speculative attribution is necessary.
- */
- enum ArgumentExpressionKind {
-
- /** kind that denotes poly argument expression */
- POLY,
- /** kind that denotes a standalone expression */
- NO_POLY,
- /** kind that denotes a primitive/boxed standalone expression */
- PRIMITIVE;
-
- /**
- * Does this kind denote a poly argument expression
- */
- public final boolean isPoly() {
- return this == POLY;
- }
-
- /**
- * Does this kind denote a primitive standalone expression
- */
- public final boolean isPrimitive() {
- return this == PRIMITIVE;
- }
-
- /**
- * Compute the kind of a standalone expression of a given type
- */
- static ArgumentExpressionKind standaloneKind(Type type, Types types) {
- return types.unboxedTypeOrType(type).isPrimitive() ?
- ArgumentExpressionKind.PRIMITIVE :
- ArgumentExpressionKind.NO_POLY;
- }
-
- /**
- * Compute the kind of a method argument expression given its symbol
- */
- static ArgumentExpressionKind methodKind(Symbol sym, Types types) {
- Type restype = sym.type.getReturnType();
- if (sym.type.hasTag(FORALL) &&
- restype.containsAny(((ForAll)sym.type).tvars)) {
- return ArgumentExpressionKind.POLY;
- } else {
- return ArgumentExpressionKind.standaloneKind(restype, types);
- }
- }
- }
-
- /**
- * Tree scanner used for checking as to whether an argument expression
- * requires speculative attribution
- */
- final class DeferredChecker extends FilterScanner {
-
- Env<AttrContext> env;
- ArgumentExpressionKind result;
-
- public DeferredChecker(Env<AttrContext> env) {
- super(deferredCheckerTags);
- this.env = env;
- }
-
- @Override
- public void visitLambda(JCLambda tree) {
- //a lambda is always a poly expression
- result = ArgumentExpressionKind.POLY;
- }
-
- @Override
- public void visitReference(JCMemberReference tree) {
- //perform arity-based check
- Env<AttrContext> localEnv = env.dup(tree);
- JCExpression exprTree = (JCExpression)attribSpeculative(tree.getQualifierExpression(), localEnv,
- attr.memberReferenceQualifierResult(tree));
- JCMemberReference mref2 = new TreeCopier<Void>(make).copy(tree);
- mref2.expr = exprTree;
- Symbol res =
- rs.getMemberReference(tree, localEnv, mref2,
- exprTree.type, tree.name);
- tree.sym = res;
- if (res.kind.isResolutionTargetError() ||
- res.type != null && res.type.hasTag(FORALL) ||
- (res.flags() & Flags.VARARGS) != 0 ||
- (TreeInfo.isStaticSelector(exprTree, tree.name.table.names) &&
- exprTree.type.isRaw())) {
- tree.overloadKind = JCMemberReference.OverloadKind.OVERLOADED;
- } else {
- tree.overloadKind = JCMemberReference.OverloadKind.UNOVERLOADED;
- }
- //a method reference is always a poly expression
- result = ArgumentExpressionKind.POLY;
- }
-
- @Override
- public void visitTypeCast(JCTypeCast tree) {
- //a cast is always a standalone expression
- result = ArgumentExpressionKind.NO_POLY;
- }
-
- @Override
- public void visitConditional(JCConditional tree) {
- scan(tree.truepart);
- if (!result.isPrimitive()) {
- result = ArgumentExpressionKind.POLY;
- return;
- }
- scan(tree.falsepart);
- result = reduce(ArgumentExpressionKind.PRIMITIVE).isPrimitive() ?
- ArgumentExpressionKind.PRIMITIVE :
- ArgumentExpressionKind.POLY;
-
- }
-
- @Override
- public void visitNewClass(JCNewClass tree) {
- result = TreeInfo.isDiamond(tree) ?
- ArgumentExpressionKind.POLY : ArgumentExpressionKind.NO_POLY;
- }
-
- @Override
- public void visitApply(JCMethodInvocation tree) {
- Name name = TreeInfo.name(tree.meth);
-
- //fast path
- if (tree.typeargs.nonEmpty() ||
- name == name.table.names._this ||
- name == name.table.names._super) {
- result = ArgumentExpressionKind.NO_POLY;
- return;
- }
-
- //slow path
- Symbol sym = quicklyResolveMethod(env, tree);
-
- if (sym == null) {
- result = ArgumentExpressionKind.POLY;
- return;
- }
-
- result = analyzeCandidateMethods(sym, ArgumentExpressionKind.PRIMITIVE,
- argumentKindAnalyzer);
- }
- //where
- private boolean isSimpleReceiver(JCTree rec) {
- switch (rec.getTag()) {
- case IDENT:
- return true;
- case SELECT:
- return isSimpleReceiver(((JCFieldAccess)rec).selected);
- case TYPEAPPLY:
- case TYPEARRAY:
- return true;
- case ANNOTATED_TYPE:
- return isSimpleReceiver(((JCAnnotatedType)rec).underlyingType);
- case APPLY:
- return true;
- case NEWCLASS:
- JCNewClass nc = (JCNewClass) rec;
- return nc.encl == null && nc.def == null && !TreeInfo.isDiamond(nc);
- default:
- return false;
- }
- }
- private ArgumentExpressionKind reduce(ArgumentExpressionKind kind) {
- return argumentKindAnalyzer.reduce(result, kind);
- }
- MethodAnalyzer<ArgumentExpressionKind> argumentKindAnalyzer =
- new MethodAnalyzer<ArgumentExpressionKind>() {
- @Override
- public ArgumentExpressionKind process(MethodSymbol ms) {
- return ArgumentExpressionKind.methodKind(ms, types);
- }
- @Override
- public ArgumentExpressionKind reduce(ArgumentExpressionKind kind1,
- ArgumentExpressionKind kind2) {
- switch (kind1) {
- case PRIMITIVE: return kind2;
- case NO_POLY: return kind2.isPoly() ? kind2 : kind1;
- case POLY: return kind1;
- default:
- Assert.error();
- return null;
- }
- }
- @Override
- public boolean shouldStop(ArgumentExpressionKind result) {
- return result.isPoly();
- }
- };
-
- @Override
- public void visitLiteral(JCLiteral tree) {
- Type litType = attr.litType(tree.typetag);
- result = ArgumentExpressionKind.standaloneKind(litType, types);
- }
-
- @Override
- void skip(JCTree tree) {
- result = ArgumentExpressionKind.NO_POLY;
- }
-
- private Symbol quicklyResolveMethod(Env<AttrContext> env, final JCMethodInvocation tree) {
- final JCExpression rec = tree.meth.hasTag(SELECT) ?
- ((JCFieldAccess)tree.meth).selected :
- null;
-
- if (rec != null && !isSimpleReceiver(rec)) {
- return null;
- }
-
- Type site;
-
- if (rec != null) {
- switch (rec.getTag()) {
- case APPLY:
- Symbol recSym = quicklyResolveMethod(env, (JCMethodInvocation) rec);
- if (recSym == null)
- return null;
- Symbol resolvedReturnType =
- analyzeCandidateMethods(recSym, syms.errSymbol, returnSymbolAnalyzer);
- if (resolvedReturnType == null)
- return null;
- site = resolvedReturnType.type;
- break;
- case NEWCLASS:
- JCNewClass nc = (JCNewClass) rec;
- site = attribSpeculative(nc.clazz, env, attr.unknownTypeExprInfo).type;
- break;
- default:
- site = attribSpeculative(rec, env, attr.unknownTypeExprInfo).type;
- break;
- }
- } else {
- site = env.enclClass.sym.type;
- }
-
- site = types.skipTypeVars(site, true);
-
- List<Type> args = rs.dummyArgs(tree.args.length());
- Name name = TreeInfo.name(tree.meth);
-
- Resolve.LookupHelper lh = rs.new LookupHelper(name, site, args, List.<Type>nil(), MethodResolutionPhase.VARARITY) {
- @Override
- Symbol lookup(Env<AttrContext> env, MethodResolutionPhase phase) {
- return rec == null ?
- rs.findFun(env, name, argtypes, typeargtypes, phase.isBoxingRequired(), phase.isVarargsRequired()) :
- rs.findMethod(env, site, name, argtypes, typeargtypes, phase.isBoxingRequired(), phase.isVarargsRequired());
- }
- @Override
- Symbol access(Env<AttrContext> env, DiagnosticPosition pos, Symbol location, Symbol sym) {
- return sym;
- }
- };
-
- return rs.lookupMethod(env, tree, site.tsym, rs.arityMethodCheck, lh);
- }
- //where:
- MethodAnalyzer<Symbol> returnSymbolAnalyzer = new MethodAnalyzer<Symbol>() {
- @Override
- public Symbol process(MethodSymbol ms) {
- ArgumentExpressionKind kind = ArgumentExpressionKind.methodKind(ms, types);
- if (kind == ArgumentExpressionKind.POLY || ms.getReturnType().hasTag(TYPEVAR))
- return null;
- return ms.getReturnType().tsym;
- }
- @Override
- public Symbol reduce(Symbol s1, Symbol s2) {
- return s1 == syms.errSymbol ? s2 : s1 == s2 ? s1 : null;
- }
- @Override
- public boolean shouldStop(Symbol result) {
- return result == null;
- }
- };
-
- /**
- * Process the result of Resolve.lookupMethod. If sym is a method symbol, the result of
- * MethodAnalyzer.process is returned. If sym is an ambiguous symbol, all the candidate
- * methods are inspected one by one, using MethodAnalyzer.process. The outcomes are
- * reduced using MethodAnalyzer.reduce (using defaultValue as the first value over which
- * the reduction runs). MethodAnalyzer.shouldStop can be used to stop the inspection early.
- */
- <E> E analyzeCandidateMethods(Symbol sym, E defaultValue, MethodAnalyzer<E> analyzer) {
- switch (sym.kind) {
- case MTH:
- return analyzer.process((MethodSymbol) sym);
- case AMBIGUOUS:
- Resolve.AmbiguityError err = (Resolve.AmbiguityError)sym.baseSymbol();
- E res = defaultValue;
- for (Symbol s : err.ambiguousSyms) {
- if (s.kind == MTH) {
- res = analyzer.reduce(res, analyzer.process((MethodSymbol) s));
- if (analyzer.shouldStop(res))
- return res;
- }
- }
- return res;
- default:
- return defaultValue;
- }
- }
- }
-
- /** Analyzer for methods - used by analyzeCandidateMethods. */
- interface MethodAnalyzer<E> {
- E process(MethodSymbol ms);
- E reduce(E e1, E e2);
- boolean shouldStop(E result);
- }
-
- //where
- private EnumSet<JCTree.Tag> deferredCheckerTags =
- EnumSet.of(LAMBDA, REFERENCE, PARENS, TYPECAST,
- CONDEXPR, NEWCLASS, APPLY, LITERAL);
}
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Infer.java Thu Sep 17 16:53:42 2015 +0200
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Infer.java Fri Sep 25 12:04:35 2015 -0700
@@ -37,6 +37,7 @@
import com.sun.tools.javac.code.Type.UndetVar.InferenceBound;
import com.sun.tools.javac.code.Symbol.*;
import com.sun.tools.javac.comp.DeferredAttr.AttrMode;
+import com.sun.tools.javac.comp.DeferredAttr.DeferredAttrContext;
import com.sun.tools.javac.comp.Infer.GraphSolver.InferenceGraph;
import com.sun.tools.javac.comp.Infer.GraphSolver.InferenceGraph.Node;
import com.sun.tools.javac.comp.Resolve.InapplicableMethodException;
@@ -179,7 +180,11 @@
resolveContext.methodCheck.argumentsAcceptable(env, deferredAttrContext, //B2
argtypes, mt.getParameterTypes(), warn);
- if (allowGraphInference &&
+
+ if (allowGraphInference && resultInfo != null && resultInfo.pt == anyPoly) {
+ //we are inside method attribution - just return a partially inferred type
+ return new PartiallyInferredMethodType(mt, inferenceContext, env, warn);
+ } else if (allowGraphInference &&
resultInfo != null &&
!warn.hasNonSilentLint(Lint.LintCategory.UNCHECKED)) {
//inject return constraints earlier
@@ -238,6 +243,73 @@
}
}
+ /**
+ * A partially infered method/constructor type; such a type can be checked multiple times
+ * against different targets.
+ */
+ public class PartiallyInferredMethodType extends MethodType {
+ public PartiallyInferredMethodType(MethodType mtype, InferenceContext inferenceContext, Env<AttrContext> env, Warner warn) {
+ super(mtype.getParameterTypes(), mtype.getReturnType(), mtype.getThrownTypes(), mtype.tsym);
+ this.inferenceContext = inferenceContext;
+ this.env = env;
+ this.warn = warn;
+ }
+
+ /** The inference context. */
+ final InferenceContext inferenceContext;
+
+ /** The attribution environment. */
+ Env<AttrContext> env;
+
+ /** The warner. */
+ final Warner warn;
+
+ @Override
+ public boolean isPartial() {
+ return true;
+ }
+
+ /**
+ * Checks this type against a target; this means generating return type constraints, solve
+ * and then roll back the results (to avoid poolluting the context).
+ */
+ Type check(Attr.ResultInfo resultInfo) {
+ Warner noWarnings = new Warner(null);
+ inferenceException.clear();
+ List<Type> saved_undet = null;
+ try {
+ /** we need to save the inference context before generating target type constraints.
+ * This constraints may pollute the inference context and make it useless in case we
+ * need to use it several times: with several targets.
+ */
+ saved_undet = inferenceContext.save();
+ if (allowGraphInference && !warn.hasNonSilentLint(Lint.LintCategory.UNCHECKED)) {
+ //inject return constraints earlier
+ checkWithinBounds(inferenceContext, noWarnings); //propagation
+ Type res = generateReturnConstraints(env.tree, resultInfo, //B3
+ this, inferenceContext);
+
+ if (resultInfo.checkContext.inferenceContext().free(resultInfo.pt)) {
+ //propagate inference context outwards and exit
+ inferenceContext.dupTo(resultInfo.checkContext.inferenceContext(),
+ resultInfo.checkContext.deferredAttrContext().insideOverloadPhase());
+ return res;
+ }
+ }
+ inferenceContext.solve(noWarnings);
+ return inferenceContext.asInstType(this).getReturnType();
+ } catch (InferenceException ex) {
+ resultInfo.checkContext.report(null, ex.getDiagnostic());
+ Assert.error(); //cannot get here (the above should throw)
+ return null;
+ } finally {
+ if (saved_undet != null) {
+ inferenceContext.rollback(saved_undet);
+ }
+ }
+ }
+ }
+
private void dumpGraphsIfNeeded(DiagnosticPosition pos, Symbol msym, Resolve.MethodResolutionContext rsContext) {
int round = 0;
try {
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/InferenceContext.java Thu Sep 17 16:53:42 2015 +0200
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/InferenceContext.java Fri Sep 25 12:04:35 2015 -0700
@@ -315,31 +315,46 @@
return buf.toList();
}
- /**
- * Restore the state of this inference context to the previous known checkpoint
- */
+ /** Restore the state of this inference context to the previous known checkpoint.
+ * Consider that the number of saved undetermined variables can be different to the current
+ * amount. This is because new captured variables could have been added.
+ */
void rollback(List<Type> saved_undet) {
- Assert.check(saved_undet != null && saved_undet.length() == undetvars.length());
+ Assert.check(saved_undet != null);
//restore bounds (note: we need to preserve the old instances)
- for (Type t : undetvars) {
- UndetVar uv = (UndetVar)t;
+ ListBuffer<Type> newUndetVars = new ListBuffer<>();
+ ListBuffer<Type> newInferenceVars = new ListBuffer<>();
+ while (saved_undet.nonEmpty() && undetvars.nonEmpty()) {
+ UndetVar uv = (UndetVar)undetvars.head;
UndetVar uv_saved = (UndetVar)saved_undet.head;
- for (InferenceBound ib : InferenceBound.values()) {
- uv.setBounds(ib, uv_saved.getBounds(ib));
+ if (uv.qtype == uv_saved.qtype) {
+ for (InferenceBound ib : InferenceBound.values()) {
+ uv.setBounds(ib, uv_saved.getBounds(ib));
+ }
+ uv.inst = uv_saved.inst;
+ undetvars = undetvars.tail;
+ saved_undet = saved_undet.tail;
+ newUndetVars.add(uv);
+ newInferenceVars.add(uv.qtype);
+ } else {
+ undetvars = undetvars.tail;
}
- uv.inst = uv_saved.inst;
- saved_undet = saved_undet.tail;
}
+ undetvars = newUndetVars.toList();
+ inferencevars = newInferenceVars.toList();
}
/**
* Copy variable in this inference context to the given context
*/
void dupTo(final InferenceContext that) {
- that.inferencevars = that.inferencevars.appendList(
- inferencevars.diff(that.inferencevars));
- that.undetvars = that.undetvars.appendList(
- undetvars.diff(that.undetvars));
+ dupTo(that, false);
+ }
+
+ void dupTo(final InferenceContext that, boolean clone) {
+ that.inferencevars = that.inferencevars.appendList(inferencevars.diff(that.inferencevars));
+ List<Type> undetsToPropagate = clone ? save() : undetvars;
+ that.undetvars = that.undetvars.appendList(undetsToPropagate.diff(that.undetvars)); //propagate cloned undet!!
//set up listeners to notify original inference contexts as
//propagated vars are inferred in new context
for (Type t : inferencevars) {
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Resolve.java Thu Sep 17 16:53:42 2015 +0200
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Resolve.java Fri Sep 25 12:04:35 2015 -0700
@@ -588,7 +588,8 @@
MethodResolutionContext prevContext = currentResolutionContext;
try {
currentResolutionContext = new MethodResolutionContext();
- currentResolutionContext.attrMode = DeferredAttr.AttrMode.CHECK;
+ currentResolutionContext.attrMode = (resultInfo.pt == Infer.anyPoly) ?
+ AttrMode.SPECULATIVE : DeferredAttr.AttrMode.CHECK;
if (env.tree.hasTag(JCTree.Tag.REFERENCE)) {
//method/constructor references need special check class
//to handle inference variables in 'argtypes' (might happen
@@ -1032,6 +1033,11 @@
protected ResultInfo dup(CheckContext newContext) {
return new MethodResultInfo(pt, newContext);
}
+
+ @Override
+ protected ResultInfo dup(Type newPt, CheckContext newContext) {
+ return new MethodResultInfo(newPt, newContext);
+ }
}
/**
@@ -1092,10 +1098,9 @@
unrelatedFunctionalInterfaces(found, req) &&
(actual != null && actual.getTag() == DEFERRED)) {
DeferredType dt = (DeferredType) actual;
- DeferredType.SpeculativeCache.Entry e =
- dt.speculativeCache.get(deferredAttrContext.msym, deferredAttrContext.phase);
- if (e != null && e.speculativeTree != deferredAttr.stuckTree) {
- return functionalInterfaceMostSpecific(found, req, e.speculativeTree);
+ JCTree speculativeTree = dt.speculativeTree(deferredAttrContext);
+ if (speculativeTree != deferredAttr.stuckTree) {
+ return functionalInterfaceMostSpecific(found, req, speculativeTree);
}
}
return compatibleBySubtyping(found, req);
@@ -1147,8 +1152,8 @@
@Override
public void visitConditional(JCConditional tree) {
- scan(tree.truepart);
- scan(tree.falsepart);
+ scan(asExpr(tree.truepart));
+ scan(asExpr(tree.falsepart));
}
@Override
@@ -1180,6 +1185,11 @@
}
@Override
+ public void visitParens(JCParens tree) {
+ scan(asExpr(tree.expr));
+ }
+
+ @Override
public void visitLambda(JCLambda tree) {
Type desc_t = types.findDescriptorType(t);
Type desc_s = types.findDescriptorType(s);
@@ -1214,7 +1224,7 @@
private List<JCExpression> lambdaResults(JCLambda lambda) {
if (lambda.getBodyKind() == JCTree.JCLambda.BodyKind.EXPRESSION) {
- return List.of((JCExpression) lambda.body);
+ return List.of(asExpr((JCExpression) lambda.body));
} else {
final ListBuffer<JCExpression> buffer = new ListBuffer<>();
DeferredAttr.LambdaReturnScanner lambdaScanner =
@@ -1222,7 +1232,7 @@
@Override
public void visitReturn(JCReturn tree) {
if (tree.expr != null) {
- buffer.append(tree.expr);
+ buffer.append(asExpr(tree.expr));
}
}
};
@@ -1230,6 +1240,16 @@
return buffer.toList();
}
}
+
+ private JCExpression asExpr(JCExpression expr) {
+ if (expr.type.hasTag(DEFERRED)) {
+ JCTree speculativeTree = ((DeferredType)expr.type).speculativeTree(deferredAttrContext);
+ if (speculativeTree != deferredAttr.stuckTree) {
+ expr = (JCExpression)speculativeTree;
+ }
+ }
+ return expr;
+ }
}
}
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/util/List.java Thu Sep 17 16:53:42 2015 +0200
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/util/List.java Fri Sep 25 12:04:35 2015 -0700
@@ -419,13 +419,14 @@
@SuppressWarnings("unchecked")
public <Z> List<Z> map(Function<A, Z> mapper) {
- if (nonEmpty()) {
- List<Z> tail1 = tail.map(mapper);
- Z head1 = mapper.apply(head);
- if (tail1 != tail || head1 != head)
- return tail1.prepend(head1);
+ boolean changed = false;
+ ListBuffer<Z> buf = new ListBuffer<>();
+ for (A a : this) {
+ Z z = mapper.apply(a);
+ buf.append(z);
+ changed |= (z != a);
}
- return (List<Z>)this;
+ return changed ? buf.toList() : (List<Z>)this;
}
@SuppressWarnings("unchecked")
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/generics/inference/8077306/T8077306.java Fri Sep 25 12:04:35 2015 -0700
@@ -0,0 +1,106 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * 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.
+ */
+
+/**
+ * @test
+ * @bug 8077306
+ * @summary Recursive implementation of List.map leads to stack overflow
+ * @compile T8077306.java
+ */
+
+import java.util.Arrays;
+import java.util.List;
+
+class T8077306 {
+ List<Integer> list = Arrays.asList(
+ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+
+ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+
+ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+
+ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+
+ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+
+ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+
+ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
+
+ );
+}
\ No newline at end of file
--- a/langtools/test/tools/javac/generics/wildcards/neg/Readonly.out Thu Sep 17 16:53:42 2015 +0200
+++ b/langtools/test/tools/javac/generics/wildcards/neg/Readonly.out Fri Sep 25 12:04:35 2015 -0700
@@ -1,2 +1,2 @@
-Readonly.java:15:10: compiler.err.cant.apply.symbol: kindname.method, put, Err<compiler.misc.type.captureof: 1, ? extends java.lang.String>, Err<compiler.misc.type.captureof: 2, ? extends java.lang.String>, kindname.class, Err<T>, (compiler.misc.no.conforming.assignment.exists: (compiler.misc.inconvertible.types: Err<compiler.misc.type.captureof: 2, ? extends java.lang.String>, Err<compiler.misc.type.captureof: 1, ? extends java.lang.String>))
+Readonly.java:15:10: compiler.err.cant.apply.symbol: kindname.method, put, Err<compiler.misc.type.captureof: 1, ? extends java.lang.String>, Err<compiler.misc.type.captureof: 2, ? extends java.lang.String>, kindname.class, Err<T>, (compiler.misc.no.conforming.assignment.exists: (compiler.misc.inconvertible.types: Err<compiler.misc.type.captureof: 3, ? extends java.lang.String>, Err<compiler.misc.type.captureof: 1, ? extends java.lang.String>))
1 error
--- a/langtools/test/tools/javac/lambda/8019480/T8019480.out Thu Sep 17 16:53:42 2015 +0200
+++ b/langtools/test/tools/javac/lambda/8019480/T8019480.out Fri Sep 25 12:04:35 2015 -0700
@@ -1,3 +1,3 @@
+T8019480.java:21:34: compiler.err.cant.apply.symbols: kindname.method, add, java.lang.Object,{(compiler.misc.inapplicable.method: kindname.method, java.util.Collection, add(U), (compiler.misc.no.conforming.assignment.exists: (compiler.misc.inconvertible.types: java.lang.Object, U))),(compiler.misc.inapplicable.method: kindname.method, java.util.List, add(U), (compiler.misc.no.conforming.assignment.exists: (compiler.misc.inconvertible.types: java.lang.Object, U))),(compiler.misc.inapplicable.method: kindname.method, java.util.List, add(int,U), (compiler.misc.arg.length.mismatch))}
T8019480.java:21:46: compiler.err.report.access: clone(), protected, java.lang.Object
-T8019480.java:21:34: compiler.err.cant.apply.symbols: kindname.method, add, java.lang.Object,{(compiler.misc.inapplicable.method: kindname.method, java.util.Collection, add(U), (compiler.misc.no.conforming.assignment.exists: (compiler.misc.inconvertible.types: java.lang.Object, U))),(compiler.misc.inapplicable.method: kindname.method, java.util.List, add(U), (compiler.misc.no.conforming.assignment.exists: (compiler.misc.inconvertible.types: java.lang.Object, U))),(compiler.misc.inapplicable.method: kindname.method, java.util.List, add(int,U), (compiler.misc.arg.length.mismatch))}
2 errors
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/lambda/speculative/InferStrict.java Fri Sep 25 12:04:35 2015 -0700
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * 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.
+ */
+
+ /*
+ * @test
+ * @bug 8078093
+ * @summary Exponential performance regression Java 8 compiler compared to Java 7 compiler
+ * @compile InferStrict.java
+ */
+import java.util.HashSet;
+import java.util.Set;
+
+class InferStrict {
+ public <T> Set<T> compute(Set<T> t) { return t; }
+ public <T> T join(Set<T> t1, Set<T> t2) { return null; }
+ public <T extends InferStrict> T compute() { return null; }
+ public void test() {
+ join(
+ compute(compute(compute(compute(compute(compute(compute(compute(compute(compute(compute(compute(compute(compute(compute(compute(compute(new HashSet<>()))))))))))))))))),
+ compute(compute(compute(compute(compute(compute(compute(compute(compute(compute(compute(compute(compute(compute(compute(compute(compute(new HashSet<String>())))))))))))))))))
+ ).length();
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/lambda/speculative/InferWeak.java Fri Sep 25 12:04:35 2015 -0700
@@ -0,0 +1,82 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * 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.
+ */
+
+ /*
+ * @test
+ * @bug 8078093
+ * @summary Exponential performance regression Java 8 compiler compared to Java 7 compiler
+ * @compile InferWeak.java
+ */
+class InferWeak {
+ private void test() {
+ GroupLayout l = new GroupLayout();
+ l.setHorizontalGroup(
+ l.createParallelGroup().addGroup(l.createParallelGroup().addGroup(
+ l.createParallelGroup().addGroup(l.createParallelGroup().addGroup(
+ l.createParallelGroup().addGroup(l.createParallelGroup().addGroup(
+ l.createParallelGroup().addGroup(l.createParallelGroup().addGroup(
+ l.createParallelGroup().addGroup(l.createParallelGroup().addGroup(
+ l.createParallelGroup().addGroup(l.createParallelGroup().addGroup(
+ l.createParallelGroup().addGroup(l.createParallelGroup().addGroup(
+ l.createParallelGroup().addGroup(l.createParallelGroup().addGroup(
+ l.createParallelGroup().addGroup(l.createParallelGroup().addGroup(
+ l.createParallelGroup().addGap(1).addComponent(new Object()).addGap(1)
+ .addComponent(new Object())).addGap(1).addComponent(new Object()).addGap(1)
+ .addComponent(new Object())).addGap(1).addComponent(new Object()).addGap(1)
+ .addComponent(new Object())).addGap(1).addComponent(new Object()).addGap(1)
+ .addComponent(new Object())).addGap(1).addComponent(new Object()).addGap(1)
+ .addComponent(new Object())).addGap(1).addComponent(new Object()).addGap(1)
+ .addComponent(new Object())).addGap(1).addComponent(new Object()).addGap(1)
+ .addComponent(new Object())).addGap(1).addComponent(new Object()).addGap(1)
+ .addComponent(new Object())).addGap(1).addComponent(new Object()).addGap(1)
+ .addComponent(new Object())).addGap(1).addComponent(new Object()).addGap(1)
+ .addComponent(new Object())).addGap(1).addComponent(new Object()).addGap(1)
+ .addComponent(new Object())).addGap(1).addComponent(new Object()).addGap(1)
+ .addComponent(new Object())).addGap(1).addComponent(new Object()).addGap(1)
+ .addComponent(new Object())).addGap(1).addComponent(new Object()).addGap(1)
+ .addComponent(new Object())).addGap(1).addComponent(new Object()).addGap(1)
+ .addComponent(new Object())).addGap(1).addComponent(new Object()).addGap(1)
+ .addComponent(new Object())).addGap(1).addComponent(new Object()).addGap(1)
+ .addComponent(new Object())).addGap(1).addComponent(new Object()).addGap(1)
+ .addComponent(new Object())).addGap(1).addComponent(new Object()).addGap(1)
+ .addComponent(new Object()));
+ }
+
+ static class GroupLayout {
+ <T extends ParallelGroup> T createParallelGroup() {return null;}
+ <T extends ParallelGroup> T createParallelGroup(int i) {return null;}
+ <T extends ParallelGroup> T createParallelGroup(int i, int j) {return null;}
+ void setHorizontalGroup(ParallelGroup g) { }
+ }
+
+ static class ParallelGroup {
+ <T extends ParallelGroup> T addGroup(ParallelGroup g) { return null; }
+ <T extends ParallelGroup> T addGroup(int i, ParallelGroup g) { return null; }
+ <T extends ParallelGroup> T addGap(int i) { return null; }
+ <T extends ParallelGroup> T addGap(int i, int j) { return null; }
+ <T extends ParallelGroup> T addComponent(Object c) { return null; }
+ <T extends ParallelGroup> T addComponent(int i, Object c) { return null; }
+ }
+ }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/lambda/speculative/NestedLambdaGenerics.java Fri Sep 25 12:04:35 2015 -0700
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * 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.
+ */
+
+ /*
+ * @test
+ * @bug 8078093
+ * @summary Exponential performance regression Java 8 compiler compared to Java 7 compiler
+ * @compile NestedLambdaGenerics.java
+ */
+import java.util.concurrent.Callable;
+
+class NestedLambdaGenerics {
+ void test() {
+ m(null, () -> m(null, () -> m(null, () -> m(null, () -> m(null, () -> m(null, () -> m(null,
+ () -> m(null, () -> m(null, () -> m(null, () -> m(null, () -> m(null, () -> m(null,
+ () -> m(null, () -> m(null, () -> m(null, () -> m(null, () -> m(null, () -> m(null,
+ () -> m(null, () -> m(null, () -> m(null, () -> m(null, () -> m(null, () -> m(null,
+ () -> m(null, () -> m(null, () -> m(null, () -> m(null, () -> m(null, () -> m(null,
+ (Callable<String>)null)))))))))))))))))))))))))))))));
+ }
+ static class A0 { }
+ static class A1 { }
+ static class A2 { }
+ static class A3 { }
+ static class A4 { }
+ <Z extends A0> Z m(A0 t, Callable<Z> ct) { return null; }
+ <Z extends A1> Z m(A1 t, Callable<Z> ct) { return null; }
+ <Z extends A2> Z m(A2 t, Callable<Z> ct) { return null; }
+ <Z extends A3> Z m(A3 t, Callable<Z> ct) { return null; }
+ <Z extends A4> Z m(A4 t, Callable<Z> ct) { return null; }
+ <Z> Z m(Object o, Callable<Z> co) { return null; }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/lambda/speculative/NestedLambdaNoGenerics.java Fri Sep 25 12:04:35 2015 -0700
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * 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.
+ */
+
+ /*
+ * @test
+ * @bug 8078093
+ * @summary Exponential performance regression Java 8 compiler compared to Java 7 compiler
+ * @compile NestedLambdaNoGenerics.java
+ */
+import java.util.concurrent.Callable;
+
+class NestedLambdaNoGenerics {
+ void test() {
+ m(null, () -> m(null, () -> m(null, () -> m(null, () -> m(null, () -> m(null, () -> m(null,
+ () -> m(null, () -> m(null, () -> m(null, () -> m(null, () -> m(null, () -> m(null,
+ () -> m(null, () -> m(null, () -> m(null, () -> m(null, () -> m(null, () -> m(null,
+ () -> m(null, () -> m(null, () -> m(null, () -> m(null, () -> m(null, () -> m(null,
+ () -> m(null, () -> m(null, () -> m(null, () -> m(null, () -> m(null, () -> m(null,
+ (Callable<String>)null)))))))))))))))))))))))))))))));
+ }
+ static class A0 { }
+ static class A1 { }
+ static class A2 { }
+ static class A3 { }
+ static class A4 { }
+ String m(A0 t, Callable<A0> ct) { return ""; }
+ String m(A1 t, Callable<A1> ct) { return ""; }
+ String m(A2 t, Callable<A2> ct) { return ""; }
+ String m(A3 t, Callable<A3> ct) { return ""; }
+ String m(A4 t, Callable<A4> ct) { return ""; }
+ String m(Object o, Callable<String> co) { return ""; }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/lambda/speculative/T8055984.java Fri Sep 25 12:04:35 2015 -0700
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * 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.
+ */
+
+/*
+ * @test
+ * @bug 8078093 8055894
+ * @summary Exponential performance regression Java 8 compiler compared to Java 7 compiler
+ * @compile T8055984.java
+ */
+
+class T8055984 {
+ static class C<U> {
+ U fu;
+
+ C() { }
+
+ C(C<U> other) {
+ this.fu = other.fu;
+ }
+
+ C(U fu) {
+ this.fu = fu;
+ }
+ }
+
+ static <U> C<U> m(C<U> src) { return new C<U>(src); }
+
+ static void test() {
+ C<String> c2 = m(new C<>(m(new C<>() )) );
+ C<String> c3 = m(new C<>(m(new C<>(m(new C<>() )) )) );
+ C<String> c4 = m(new C<>(m(new C<>(m(new C<>(m(new C<>() )) )) )) );
+ C<String> c5 = m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>() )) )) )) )) );
+ C<String> c6 = m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>() )) )) )) )) )) );
+ C<String> c7 = m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>() )) )) )) )) )) )) );
+ C<String> c8 = m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>() )) )) )) )) )) )) )) );
+ C<String> c9 = m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>() )) )) )) )) )) )) )) )) );
+ C<String> c10 = m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>())))))))))))))))))));
+ }
+}
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/lambda/speculative/T8077247.java Fri Sep 25 12:04:35 2015 -0700
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * 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.
+ */
+
+/*
+ * @test
+ * @bug 8078093 8077247
+ * @summary Exponential performance regression Java 8 compiler compared to Java 7 compiler
+ * @compile T8077247.java
+ */
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+class T8077247 {
+ public static void test() {
+ int x = add(add(add(add(add(add(add(add(add(add(1, 2), 3), 4), 5), 6), 7), 8), 9), 10), 11);
+ }
+
+ public static int add(int x, int y) {
+ long rslt = (long)x + (long)y;
+ if (Integer.MIN_VALUE <= rslt && rslt <= Integer.MAX_VALUE) {
+ return (int)rslt;
+ }
+
+ String msg = String.format("Integer overflow: %d + %d.", x, y);
+ throw new IllegalArgumentException(msg);
+ }
+
+ public static double add(double x, double y) {
+ double rslt = x + y;
+ if (Double.isInfinite(rslt)) {
+ String msg = String.format("Real overflow: %s + %s.", x, y);
+ throw new IllegalArgumentException(msg);
+ }
+ return (rslt == -0.0) ? 0.0 : rslt;
+ }
+
+ public static <T> List<T> add(List<T> x, List<T> y) {
+ List<T> rslt = new ArrayList<>(x.size() + y.size());
+ rslt.addAll(x);
+ rslt.addAll(y);
+ return rslt;
+ }
+
+ public static String add(String x, String y) {
+ return x + y;
+ }
+
+ public static <K, V> Map<K, V> add(Map<K, V> x, Map<K, V> y) {
+ Map<K, V> rslt = new HashMap<>(x);
+ rslt.putAll(y);
+ return rslt;
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/lambda/speculative/T8078093.java Fri Sep 25 12:04:35 2015 -0700
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * 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.
+ */
+
+/*
+ * @test
+ * @bug 8078093
+ * @summary Exponential performance regression Java 8 compiler compared to Java 7 compiler
+ * @compile T8078093.java
+ */
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+class T8078093 {
+ public static void test() {
+ Map<Integer, String> a = x(x(x(x(x(x(x(x(x(x(x(x(
+ new LinkedHashMap<Integer, String>(),
+ 1, "a"), 2, "b"), 3, "c"), 4, "d"),
+ 5, "e"), 6, "f"), 7, "g"), 8, "h"),
+ 9, "i"), 10, "j"), 11, "k"), 12, "l");
+ }
+
+ @SuppressWarnings("unused")
+ public static <K, V> Map<K, V> x(Map<K, V> m, K k, V v) {
+ // Replaced actual code by dummy implementation.
+ return null;
+ }
+}
--- a/make/CompileJavaModules.gmk Thu Sep 17 16:53:42 2015 +0200
+++ b/make/CompileJavaModules.gmk Fri Sep 25 12:04:35 2015 -0700
@@ -275,13 +275,6 @@
$(JDK_TOPDIR)/src/java.sql.rowset/share/classes/javax/sql/rowset/*.properties)
################################################################################
-# Exclude building of IIOP transport for RMI Connector
-
-ifeq ($(RMICONNECTOR_IIOP), false)
- java.management_EXCLUDES += com/sun/jmx/remote/protocol/iiop
-endif
-
-################################################################################
java.rmi_ADD_JAVAC_FLAGS := -Xdoclint:all/protected '-Xdoclint/package:java.*,javax.*'
java.rmi_CLEAN_FILES := $(wildcard \
--- a/make/Main.gmk Thu Sep 17 16:53:42 2015 +0200
+++ b/make/Main.gmk Fri Sep 25 12:04:35 2015 -0700
@@ -285,9 +285,12 @@
+($(CD) $(JDK_TOPDIR)/make/test && $(MAKE) $(MAKE_ARGS) -f JtregNative.gmk \
test-image-jdk-jtreg-native)
+build-test-lib:
+ +($(CD) $(TOPDIR)/make/test && $(MAKE) $(MAKE_ARGS) -f BuildTestLib.gmk)
+
ALL_TARGETS += prepare-test-image build-test-hotspot-jtreg-native \
test-image-hotspot-jtreg-native build-test-jdk-jtreg-native \
- test-image-jdk-jtreg-native
+ test-image-jdk-jtreg-native build-test-lib
################################################################################
# Run tests
@@ -553,7 +556,7 @@
CLEAN_DIRS += hotspot jdk bootcycle-build test buildtools support \
images make-support test-make bundles
CLEAN_DIR_TARGETS := $(addprefix clean-, $(CLEAN_DIRS))
-CLEAN_TESTS += hotspot-jtreg-native jdk-jtreg-native
+CLEAN_TESTS += hotspot-jtreg-native jdk-jtreg-native lib
CLEAN_TEST_TARGETS += $(addprefix clean-test-, $(CLEAN_TESTS))
CLEAN_PHASES := gensrc java native include docs
CLEAN_PHASE_TARGETS := $(addprefix clean-, $(CLEAN_PHASES))
--- a/make/common/MakeBase.gmk Thu Sep 17 16:53:42 2015 +0200
+++ b/make/common/MakeBase.gmk Fri Sep 25 12:04:35 2015 -0700
@@ -567,16 +567,22 @@
endif
################################################################################
-# Convenience functions for working around make's limitations with $(filter ).
-containing = \
- $(strip $(foreach v,$(strip $2),$(if $(findstring $(strip $1),$v),$v)))
-not-containing = \
- $(strip $(foreach v,$(strip $2),$(if $(findstring $(strip $1),$v),,$v)))
-
# Filter out duplicate sub strings while preserving order. Keeps the first occurance.
uniq = \
$(if $1,$(firstword $1) $(call uniq,$(filter-out $(firstword $1),$1)))
+# Returns all whitespace-separated words in $2 where at least one of the
+# whitespace-separated words in $1 is a substring.
+containing = \
+ $(strip \
+ $(foreach v,$(strip $2),\
+ $(call uniq,$(foreach p,$(strip $1),$(if $(findstring $p,$v),$v)))))
+
+# Returns all whitespace-separated words in $2 where none of the
+# whitespace-separated words in $1 is a substring.
+not-containing = \
+ $(strip $(filter-out $(call containing,$1,$2),$2))
+
# Return a list of all string elements that are duplicated in $1.
dups = \
$(strip $(foreach v, $(sort $1), $(if $(filter-out 1, \
--- a/make/common/NativeCompilation.gmk Thu Sep 17 16:53:42 2015 +0200
+++ b/make/common/NativeCompilation.gmk Fri Sep 25 12:04:35 2015 -0700
@@ -102,7 +102,7 @@
################################################################################
# Extensions of files handled by this macro.
-NATIVE_SOURCE_EXTENSIONS := %.s %.c %.cpp %.m %.mm
+NATIVE_SOURCE_EXTENSIONS := %.s %.c %.cpp %.cc %.m %.mm
# Replaces native source extensions with the object file extension in a string.
# Param 1: the string containing source file names with extensions
@@ -167,7 +167,7 @@
$1_$2_FLAGS=$8 -DTHIS_FILE='"$$(<F)"'
$1_$2_COMP=$(AS)
$1_$2_DEP_FLAG:=
- else ifneq (,$$(filter %.cpp,$2)$$(filter %.mm,$2))
+ else ifneq (,$$(filter %.cpp,$2)$$(filter %.cc,$2)$$(filter %.mm,$2))
# Compile as a C++ or Objective-C++ file
$1_$2_FLAGS=$(CFLAGS_CCACHE) $6 $$($1_$(notdir $2)_CXXFLAGS) -DTHIS_FILE='"$$(<F)"' -c
$1_$2_COMP=$7
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/make/test/BuildTestLib.gmk Fri Sep 25 12:04:35 2015 -0700
@@ -0,0 +1,67 @@
+#
+# Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+# 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.
+#
+
+default: all
+
+include $(SPEC)
+include MakeBase.gmk
+include JavaCompilation.gmk
+include SetupJavaCompilers.gmk
+
+TARGETS :=
+
+TEST_LIB_SOURCE_DIR := $(TOPDIR)/test/lib
+TEST_LIB_SUPPORT := $(SUPPORT_OUTPUTDIR)/test/lib
+
+# Unfortunately, test-lib.jar does not compile properly without warnings.
+$(eval $(call SetupJavaCompiler, BOOT_JAVAC_NOWARNINGS, \
+ JAVAC := $(JAVAC), \
+ FLAGS := -XDignore.symbol.file=true -g, \
+))
+
+$(eval $(call SetupJavaCompilation, BUILD_WB_JAR, \
+ SETUP := BOOT_JAVAC, \
+ SRC := $(TEST_LIB_SOURCE_DIR)/sun, \
+ BIN := $(TEST_LIB_SUPPORT), \
+ JAR := $(TEST_LIB_SUPPORT)/wb.jar, \
+))
+
+TARGETS += $(BUILD_WB_JAR)
+
+# test-lib.jar will contain only hprof classes until JDK-8081381 is resolved
+$(eval $(call SetupJavaCompilation, BUILD_TEST_LIB_JAR, \
+ SETUP := BOOT_JAVAC_NOWARNINGS, \
+ SRC := $(TEST_LIB_SOURCE_DIR)/share/classes/jdk/test/lib/hprof, \
+ BIN := $(TEST_LIB_SUPPORT), \
+ JAR := $(TEST_LIB_SUPPORT)/test-lib.jar, \
+))
+
+TARGETS += $(BUILD_TEST_LIB_JAR)
+
+##########################################################################################
+
+all: $(TARGETS)
+
+.PHONY: default all
--- a/modules.xml Thu Sep 17 16:53:42 2015 +0200
+++ b/modules.xml Fri Sep 25 12:04:35 2015 -0700
@@ -277,6 +277,7 @@
<to>jdk.jvmstat</to>
<to>jdk.management.resource</to>
<to>jdk.pack200</to>
+ <to>jdk.scripting.nashorn</to>
<to>jdk.security.auth</to>
<to>jdk.security.jgss</to>
<to>jdk.snmp</to>
--- a/nashorn/.hgtags Thu Sep 17 16:53:42 2015 +0200
+++ b/nashorn/.hgtags Fri Sep 25 12:04:35 2015 -0700
@@ -315,3 +315,4 @@
9b3eca69b88b2d1bebce92d58280ae66fc0b6091 jdk9-b79
61b401b23fc28208930977d46b690423911173c6 jdk9-b80
42d8ed4651b62572b39e6fed3fafcb7ee93f9dc2 jdk9-b81
+8bab0a9d8a638affdd680c5ec783373f71c19267 jdk9-b82
--- a/nashorn/samples/EvalWithArbitraryThis.java.orig Thu Sep 17 16:53:42 2015 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 2015, 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
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * - Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * - Neither the name of Oracle nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
- * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-import javax.script.*;
-import jdk.nashorn.api.scripting.*;
-
-// Simple nashorn demo that evals a script with arbitrary script
-// object bound as "this" for the evaluated script.
-
-public class EvalWithArbitraryThis {
- public static void main(String[] args) throws Exception {
- ScriptEngineManager m = new ScriptEngineManager();
- ScriptEngine e = m.getEngineByName("nashorn");
- Object sobj = e.eval("( { foo: 343, bar: 'hello' } )");
-
- // "this" bound to sobj in this eval.
- // so it prints sobj.foo and sobj.bar.
- ((ScriptObjectMirror)sobj).eval("print(this.foo); print(this.bar)");
- }
-}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/samples/exceptionswallow.js Fri Sep 25 12:04:35 2015 -0700
@@ -0,0 +1,136 @@
+#// Usage: jjs exceptionswallow.js -- <directory>
+
+/*
+ * Copyright (c) 2015, 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
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * - Neither the name of Oracle nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// This example demonstrates Java subclassing by Java.extend
+// and javac Compiler and Tree API. This example looks for
+// empty catch blocks ("exception swallow") and reports those.
+
+if (arguments.length == 0) {
+ print("Usage: jjs exceptionswallow.js -- <directory>");
+ exit(1);
+}
+
+// Java types used
+var File = Java.type("java.io.File");
+var Files = Java.type("java.nio.file.Files");
+var StringArray = Java.type("java.lang.String[]");
+var ToolProvider = Java.type("javax.tools.ToolProvider");
+var Tree = Java.type("com.sun.source.tree.Tree");
+var EmptyStatementTree = Java.type("com.sun.source.tree.EmptyStatementTree");
+var Trees = Java.type("com.sun.source.util.Trees");
+var TreeScanner = Java.type("com.sun.source.util.TreeScanner");
+
+// printEmptyCatch
+
+function printEmptyCatch() {
+ // get the system compiler tool
+ var compiler = ToolProvider.systemJavaCompiler;
+ // get standard file manager
+ var fileMgr = compiler.getStandardFileManager(null, null, null);
+ // Using Java.to convert script array (arguments) to a Java String[]
+ var compUnits = fileMgr.getJavaFileObjects(
+ Java.to(arguments, StringArray));
+ // create a new compilation task
+ var task = compiler.getTask(null, fileMgr, null, null, null, compUnits);
+
+ // SourcePositions object to get positions of AST nodes
+ var sourcePositions = Trees.instance(task).sourcePositions;
+
+ // subclass SimpleTreeVisitor - to print empty catch
+ var EmptyCatchFinder = Java.extend(TreeScanner);
+
+ function hasOnlyEmptyStats(stats) {
+ var itr = stats.iterator();
+ while (itr.hasNext()) {
+ if (! (itr.next() instanceof EmptyStatementTree)) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ var visitor = new EmptyCatchFinder() {
+ // current CompilationUnitTree
+ compUnit: null,
+ // current LineMap (pos -> line, column)
+ lineMap: null,
+ // current compilation unit's file name
+ fileName: null,
+
+ // overrides of TreeScanner methods
+
+ visitCompilationUnit: function(node, p) {
+ // capture info about current Compilation unit
+ this.compUnit = node;
+ this.lineMap = node.lineMap;
+ this.fileName = node.sourceFile.name;
+
+ // Using Java.super API to call super class method here
+ return Java.super(visitor).visitCompilationUnit(node, p);
+ },
+
+ visitCatch: function (node, p) {
+ var stats = node.block.statements;
+ if (stats.empty || hasOnlyEmptyStats(stats)) {
+ // print information on this empty catch
+ var pos = sourcePositions.getStartPosition(this.compUnit, node);
+ var line = this.lineMap.getLineNumber(pos);
+ var col = this.lineMap.getColumnNumber(pos);
+ print("Exception swallow" + " @ " + this.fileName + ":" + line + ":" + col);
+ // print(node);
+ }
+ }
+ }
+
+ for each (var cu in task.parse()) {
+ cu.accept(visitor, null);
+ }
+}
+
+// for each ".java" file in directory (recursively) and check it!
+function main(dir) {
+ Files.walk(dir.toPath()).
+ forEach(function(p) {
+ var name = p.toFile().absolutePath;
+ if (name.endsWith(".java")) {
+ try {
+ printEmptyCatch(p.toFile().getAbsolutePath());
+ } catch (e) {
+ print(e);
+ }
+ }
+ });
+}
+
+main(new File(arguments[0]));
--- a/nashorn/samples/find_nonfinals2.js Thu Sep 17 16:53:42 2015 +0200
+++ b/nashorn/samples/find_nonfinals2.js Fri Sep 25 12:04:35 2015 -0700
@@ -43,7 +43,6 @@
// Java types used
var File = Java.type("java.io.File");
var Files = Java.type("java.nio.file.Files");
-var FileVisitOption = Java.type("java.nio.file.FileVisitOption");
var StringArray = Java.type("java.lang.String[]");
var ToolProvider = Java.type("javax.tools.ToolProvider");
var Tree = Java.type("com.sun.source.tree.Tree");
@@ -106,7 +105,7 @@
// for each ".java" file in directory (recursively).
function main(dir) {
var totalCount = 0;
- Files.walk(dir.toPath(), FileVisitOption.FOLLOW_LINKS).
+ Files.walk(dir.toPath()).
forEach(function(p) {
var name = p.toFile().absolutePath;
if (name.endsWith(".java")) {
--- a/nashorn/samples/javafoovars.js Thu Sep 17 16:53:42 2015 +0200
+++ b/nashorn/samples/javafoovars.js Fri Sep 25 12:04:35 2015 -0700
@@ -42,7 +42,6 @@
// Java types used
var File = Java.type("java.io.File");
var Files = Java.type("java.nio.file.Files");
-var FileVisitOption = Java.type("java.nio.file.FileVisitOption");
var StringArray = Java.type("java.lang.String[]");
var ToolProvider = Java.type("javax.tools.ToolProvider");
var Tree = Java.type("com.sun.source.tree.Tree");
@@ -81,7 +80,7 @@
// for each ".java" file in directory (recursively) count "foo".
function main(dir) {
var totalCount = 0;
- Files.walk(dir.toPath(), FileVisitOption.FOLLOW_LINKS).
+ Files.walk(dir.toPath()).
forEach(function(p) {
var name = p.toFile().absolutePath;
if (name.endsWith(".java")) {
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/samples/resourcetrysuggester.js Fri Sep 25 12:04:35 2015 -0700
@@ -0,0 +1,156 @@
+#// Usage: jjs resourcetrysuggester.js -- <directory>
+
+/*
+ * Copyright (c) 2015, 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
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * - Neither the name of Oracle nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// This example demonstrates Java subclassing by Java.extend
+// and javac Compiler and Tree API. This example looks for
+// finally clauses with "close" call and suggests "resource try"!
+
+if (arguments.length == 0) {
+ print("Usage: jjs resourcetrysuggester.js -- <directory>");
+ exit(1);
+}
+
+// Java types used
+var ExpressionStatementTree = Java.type("com.sun.source.tree.ExpressionStatementTree");
+var File = Java.type("java.io.File");
+var Files = Java.type("java.nio.file.Files");
+var MemberSelectTree = Java.type("com.sun.source.tree.MemberSelectTree");
+var MethodInvocationTree = Java.type("com.sun.source.tree.MethodInvocationTree");
+var StringArray = Java.type("java.lang.String[]");
+var ToolProvider = Java.type("javax.tools.ToolProvider");
+var Tree = Java.type("com.sun.source.tree.Tree");
+var Trees = Java.type("com.sun.source.util.Trees");
+var TreeScanner = Java.type("com.sun.source.util.TreeScanner");
+
+// resourceTrySuggestions
+
+function resourceTrySuggestions() {
+ // get the system compiler tool
+ var compiler = ToolProvider.systemJavaCompiler;
+ // get standard file manager
+ var fileMgr = compiler.getStandardFileManager(null, null, null);
+ // Using Java.to convert script array (arguments) to a Java String[]
+ var compUnits = fileMgr.getJavaFileObjects(
+ Java.to(arguments, StringArray));
+ // create a new compilation task
+ var task = compiler.getTask(null, fileMgr, null, null, null, compUnits);
+
+ // SourcePositions object to get positions of AST nodes
+ var sourcePositions = Trees.instance(task).sourcePositions;
+
+ // subclass SimpleTreeVisitor - to print resource try suggestions
+ var ResourceTrySuggester = Java.extend(TreeScanner);
+
+ function hasOnlyEmptyStats(stats) {
+ var itr = stats.iterator();
+ while (itr.hasNext()) {
+ if (! (itr.next() instanceof EmptyStatementTree)) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ // does the given statement list has an expression statement which
+ // calls "close" method (don't worry about types - just crude one will do)
+ function hasCloseCall(stats) {
+ var itr = stats.iterator();
+ while (itr.hasNext()) {
+ var stat = itr.next();
+ if (stat instanceof ExpressionStatementTree) {
+ var expr = stat.expression;
+ if (expr instanceof MethodInvocationTree) {
+ var method = expr.methodSelect;
+ if (method instanceof MemberSelectTree) {
+ return method.identifier.toString().equals("close");
+ }
+ }
+ }
+ }
+ return false;
+ }
+
+ var visitor = new ResourceTrySuggester() {
+ // current CompilationUnitTree
+ compUnit: null,
+ // current LineMap (pos -> line, column)
+ lineMap: null,
+ // current compilation unit's file name
+ fileName: null,
+
+ // overrides of TreeScanner methods
+
+ visitCompilationUnit: function(node, p) {
+ // capture info about current Compilation unit
+ this.compUnit = node;
+ this.lineMap = node.lineMap;
+ this.fileName = node.sourceFile.name;
+
+ // Using Java.super API to call super class method here
+ return Java.super(visitor).visitCompilationUnit(node, p);
+ },
+
+ visitTry: function (node, p) {
+ var finallyBlk = node.finallyBlock;
+ if (finallyBlk != null && hasCloseCall(finallyBlk.statements)) {
+ var pos = sourcePositions.getStartPosition(this.compUnit, node);
+ var line = this.lineMap.getLineNumber(pos);
+ var col = this.lineMap.getColumnNumber(pos);
+ print("Consider resource try statement " + " @ " + this.fileName + ":" + line + ":" + col);
+ // print(node);
+ }
+ }
+ }
+
+ for each (var cu in task.parse()) {
+ cu.accept(visitor, null);
+ }
+}
+
+// for each ".java" file in directory (recursively) and check it!
+function main(dir) {
+ Files.walk(dir.toPath()).
+ forEach(function(p) {
+ var name = p.toFile().absolutePath;
+ if (name.endsWith(".java")) {
+ try {
+ resourceTrySuggestions(p.toFile().getAbsolutePath());
+ } catch (e) {
+ print(e);
+ }
+ }
+ });
+}
+
+main(new File(arguments[0]));
--- a/nashorn/samples/zipfs.js Thu Sep 17 16:53:42 2015 +0200
+++ b/nashorn/samples/zipfs.js Fri Sep 25 12:04:35 2015 -0700
@@ -36,13 +36,12 @@
var Files = Java.type("java.nio.file.Files")
var FileSystems = Java.type("java.nio.file.FileSystems")
-var FileVisitOption = Java.type("java.nio.file.FileVisitOption")
var Paths = Java.type("java.nio.file.Paths")
var zipfile = Paths.get(arguments[0])
var fs = FileSystems.newFileSystem(zipfile, null)
var root = fs.rootDirectories[0]
-Files.walk(root, FileVisitOption.FOLLOW_LINKS).forEach(
+Files.walk(root).forEach(
function(p) (print(p), print(Files.readAttributes(p, "zip:*")))
)
fs.close()
--- a/nashorn/src/jdk.scripting.nashorn.shell/share/classes/jdk/nashorn/tools/jjs/EditPad.java Thu Sep 17 16:53:42 2015 +0200
+++ b/nashorn/src/jdk.scripting.nashorn.shell/share/classes/jdk/nashorn/tools/jjs/EditPad.java Fri Sep 25 12:04:35 2015 -0700
@@ -49,8 +49,8 @@
private final boolean[] closeLock;
private final Consumer<String> saveHandler;
- EditPad(Consumer<String> errorHandler, String initialText,
- boolean[] closeLock, Consumer<String> saveHandler) {
+ EditPad(final Consumer<String> errorHandler, final String initialText,
+ final boolean[] closeLock, final Consumer<String> saveHandler) {
super("Edit Pad (Experimental)");
this.errorHandler = errorHandler;
this.initialText = initialText;
@@ -62,7 +62,7 @@
public void run() {
addWindowListener(new WindowAdapter() {
@Override
- public void windowClosing(WindowEvent e) {
+ public void windowClosing(final WindowEvent e) {
EditPad.this.dispose();
notifyClose();
}
@@ -77,7 +77,7 @@
setVisible(true);
}
- private JPanel buttons(JTextArea textArea) {
+ private JPanel buttons(final JTextArea textArea) {
FlowLayout flow = new FlowLayout();
flow.setHgap(35);
JPanel buttons = new JPanel(flow);
@@ -118,8 +118,8 @@
}
}
- static void edit(Consumer<String> errorHandler, String initialText,
- Consumer<String> saveHandler) {
+ static void edit(final Consumer<String> errorHandler, final String initialText,
+ final Consumer<String> saveHandler) {
boolean[] closeLock = new boolean[1];
SwingUtilities.invokeLater(
new EditPad(errorHandler, initialText, closeLock, saveHandler));
@@ -127,7 +127,7 @@
while (!closeLock[0]) {
try {
closeLock.wait();
- } catch (InterruptedException ex) {
+ } catch (final InterruptedException ex) {
// ignore and loop
}
}
--- a/nashorn/src/jdk.scripting.nashorn.shell/share/classes/jdk/nashorn/tools/jjs/ExternalEditor.java Thu Sep 17 16:53:42 2015 +0200
+++ b/nashorn/src/jdk.scripting.nashorn.shell/share/classes/jdk/nashorn/tools/jjs/ExternalEditor.java Fri Sep 25 12:04:35 2015 -0700
@@ -49,13 +49,13 @@
private Path dir;
private Path tmpfile;
- ExternalEditor(Consumer<String> errorHandler, Consumer<String> saveHandler, Console input) {
+ ExternalEditor(final Consumer<String> errorHandler, final Consumer<String> saveHandler, final Console input) {
this.errorHandler = errorHandler;
this.saveHandler = saveHandler;
this.input = input;
}
- private void edit(String cmd, String initialText) {
+ private void edit(final String cmd, final String initialText) {
try {
setupWatch(initialText);
launch(cmd);
@@ -67,7 +67,7 @@
/**
* Creates a WatchService and registers the given directory
*/
- private void setupWatch(String initialText) throws IOException {
+ private void setupWatch(final String initialText) throws IOException {
this.watcher = FileSystems.getDefault().newWatchService();
this.dir = Files.createTempDirectory("REPL");
this.tmpfile = Files.createTempFile(dir, null, ".js");
@@ -81,9 +81,9 @@
WatchKey key;
try {
key = watcher.take();
- } catch (ClosedWatchServiceException ex) {
+ } catch (final ClosedWatchServiceException ex) {
break;
- } catch (InterruptedException ex) {
+ } catch (final InterruptedException ex) {
continue; // tolerate an intrupt
}
@@ -103,7 +103,7 @@
watchedThread.start();
}
- private void launch(String cmd) throws IOException {
+ private void launch(final String cmd) throws IOException {
ProcessBuilder pb = new ProcessBuilder(cmd, tmpfile.toString());
pb = pb.inheritIO();
@@ -111,9 +111,9 @@
input.suspend();
Process process = pb.start();
process.waitFor();
- } catch (IOException ex) {
+ } catch (final IOException ex) {
errorHandler.accept("process IO failure: " + ex.getMessage());
- } catch (InterruptedException ex) {
+ } catch (final InterruptedException ex) {
errorHandler.accept("process interrupt: " + ex.getMessage());
} finally {
try {
@@ -132,7 +132,7 @@
List<String> lines;
try {
lines = Files.readAllLines(tmpfile);
- } catch (IOException ex) {
+ } catch (final IOException ex) {
errorHandler.accept("Failure read edit file: " + ex.getMessage());
return ;
}
@@ -144,8 +144,8 @@
saveHandler.accept(sb.toString());
}
- static void edit(String cmd, Consumer<String> errorHandler, String initialText,
- Consumer<String> saveHandler, Console input) {
+ static void edit(final String cmd, final Consumer<String> errorHandler, final String initialText,
+ final Consumer<String> saveHandler, final Console input) {
ExternalEditor ed = new ExternalEditor(errorHandler, saveHandler, input);
ed.edit(cmd, initialText);
}
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/ApplySpecialization.java Thu Sep 17 16:53:42 2015 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/ApplySpecialization.java Fri Sep 25 12:04:35 2015 -0700
@@ -40,7 +40,6 @@
import jdk.nashorn.internal.ir.CallNode;
import jdk.nashorn.internal.ir.Expression;
import jdk.nashorn.internal.ir.FunctionNode;
-import jdk.nashorn.internal.ir.FunctionNode.CompilationState;
import jdk.nashorn.internal.ir.IdentNode;
import jdk.nashorn.internal.ir.LexicalContext;
import jdk.nashorn.internal.ir.Node;
@@ -384,7 +383,7 @@
callSiteTypes.pop();
explodedArguments.pop();
- return newFunctionNode.setState(lc, CompilationState.BUILTINS_TRANSFORMED);
+ return newFunctionNode;
}
private static boolean isApply(final CallNode callNode) {
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/AssignSymbols.java Thu Sep 17 16:53:42 2015 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/AssignSymbols.java Fri Sep 25 12:04:35 2015 -0700
@@ -65,7 +65,6 @@
import jdk.nashorn.internal.ir.Expression;
import jdk.nashorn.internal.ir.ForNode;
import jdk.nashorn.internal.ir.FunctionNode;
-import jdk.nashorn.internal.ir.FunctionNode.CompilationState;
import jdk.nashorn.internal.ir.IdentNode;
import jdk.nashorn.internal.ir.IndexNode;
import jdk.nashorn.internal.ir.LexicalContext;
@@ -828,7 +827,7 @@
lc.applyTopFlags(functionNode))))
.setThisProperties(lc, thisProperties.pop().size()));
}
- return finalizedFunction.setState(lc, CompilationState.SYMBOLS_ASSIGNED);
+ return finalizedFunction;
}
@Override
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/CodeGenerator.java Thu Sep 17 16:53:42 2015 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/CodeGenerator.java Fri Sep 25 12:04:35 2015 -0700
@@ -93,7 +93,6 @@
import jdk.nashorn.internal.ir.ExpressionStatement;
import jdk.nashorn.internal.ir.ForNode;
import jdk.nashorn.internal.ir.FunctionNode;
-import jdk.nashorn.internal.ir.FunctionNode.CompilationState;
import jdk.nashorn.internal.ir.GetSplitState;
import jdk.nashorn.internal.ir.IdentNode;
import jdk.nashorn.internal.ir.IfNode;
@@ -2142,7 +2141,7 @@
markOptimistic = false;
}
- FunctionNode newFunctionNode = functionNode.setState(lc, CompilationState.BYTECODE_GENERATED);
+ FunctionNode newFunctionNode = functionNode;
if (markOptimistic) {
newFunctionNode = newFunctionNode.setFlag(lc, FunctionNode.IS_DEOPTIMIZABLE);
}
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/CompilationPhase.java Thu Sep 17 16:53:42 2015 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/CompilationPhase.java Fri Sep 25 12:04:35 2015 -0700
@@ -25,32 +25,17 @@
package jdk.nashorn.internal.codegen;
-import static jdk.nashorn.internal.ir.FunctionNode.CompilationState.BUILTINS_TRANSFORMED;
-import static jdk.nashorn.internal.ir.FunctionNode.CompilationState.BYTECODE_GENERATED;
-import static jdk.nashorn.internal.ir.FunctionNode.CompilationState.BYTECODE_INSTALLED;
-import static jdk.nashorn.internal.ir.FunctionNode.CompilationState.CONSTANT_FOLDED;
-import static jdk.nashorn.internal.ir.FunctionNode.CompilationState.INITIALIZED;
-import static jdk.nashorn.internal.ir.FunctionNode.CompilationState.LOCAL_VARIABLE_TYPES_CALCULATED;
-import static jdk.nashorn.internal.ir.FunctionNode.CompilationState.LOWERED;
-import static jdk.nashorn.internal.ir.FunctionNode.CompilationState.OPTIMISTIC_TYPES_ASSIGNED;
-import static jdk.nashorn.internal.ir.FunctionNode.CompilationState.PARSED;
-import static jdk.nashorn.internal.ir.FunctionNode.CompilationState.SCOPE_DEPTHS_COMPUTED;
-import static jdk.nashorn.internal.ir.FunctionNode.CompilationState.SPLIT;
-import static jdk.nashorn.internal.ir.FunctionNode.CompilationState.SYMBOLS_ASSIGNED;
import static jdk.nashorn.internal.runtime.logging.DebugLogger.quote;
import java.io.PrintWriter;
-import java.util.EnumSet;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
-import jdk.nashorn.internal.AssertsEnabled;
import jdk.nashorn.internal.codegen.Compiler.CompilationPhases;
import jdk.nashorn.internal.ir.Block;
import jdk.nashorn.internal.ir.FunctionNode;
-import jdk.nashorn.internal.ir.FunctionNode.CompilationState;
import jdk.nashorn.internal.ir.LexicalContext;
import jdk.nashorn.internal.ir.LiteralNode;
import jdk.nashorn.internal.ir.Node;
@@ -67,15 +52,9 @@
* A compilation phase is a step in the processes of turning a JavaScript
* FunctionNode into bytecode. It has an optional return value.
*/
-enum CompilationPhase {
- /**
- * Constant folding pass Simple constant folding that will make elementary
- * constructs go away
- */
- CONSTANT_FOLDING_PHASE(
- EnumSet.of(
- INITIALIZED,
- PARSED)) {
+abstract class CompilationPhase {
+
+ private static final class ConstantFoldingPhase extends CompilationPhase {
@Override
FunctionNode transform(final Compiler compiler, final CompilationPhases phases, final FunctionNode fn) {
return transformFunction(fn, new FoldConstants(compiler));
@@ -85,20 +64,15 @@
public String toString() {
return "'Constant Folding'";
}
- },
+ }
/**
- * Lower (Control flow pass) Finalizes the control flow. Clones blocks for
- * finally constructs and similar things. Establishes termination criteria
- * for nodes Guarantee return instructions to method making sure control
- * flow cannot fall off the end. Replacing high level nodes with lower such
- * as runtime nodes where applicable.
+ * Constant folding pass Simple constant folding that will make elementary
+ * constructs go away
*/
- LOWERING_PHASE(
- EnumSet.of(
- INITIALIZED,
- PARSED,
- CONSTANT_FOLDED)) {
+ static final CompilationPhase CONSTANT_FOLDING_PHASE = new ConstantFoldingPhase();
+
+ private static final class LoweringPhase extends CompilationPhase {
@Override
FunctionNode transform(final Compiler compiler, final CompilationPhases phases, final FunctionNode fn) {
return transformFunction(fn, new Lower(compiler));
@@ -108,42 +82,35 @@
public String toString() {
return "'Control Flow Lowering'";
}
- },
+ }
/**
- * Phase used only when doing optimistic code generation. It assigns all potentially
- * optimistic ops a program point so that an UnwarrantedException knows from where
- * a guess went wrong when creating the continuation to roll back this execution
+ * Lower (Control flow pass) Finalizes the control flow. Clones blocks for
+ * finally constructs and similar things. Establishes termination criteria
+ * for nodes Guarantee return instructions to method making sure control
+ * flow cannot fall off the end. Replacing high level nodes with lower such
+ * as runtime nodes where applicable.
*/
- TRANSFORM_BUILTINS_PHASE(
- EnumSet.of(
- INITIALIZED,
- PARSED,
- CONSTANT_FOLDED,
- LOWERED)) {
- //we only do this if we have a param type map, otherwise this is not a specialized recompile
+ static final CompilationPhase LOWERING_PHASE = new LoweringPhase();
+
+ private static final class ApplySpecializationPhase extends CompilationPhase {
@Override
FunctionNode transform(final Compiler compiler, final CompilationPhases phases, final FunctionNode fn) {
- return setStates(transformFunction(fn, new ApplySpecialization(compiler)), BUILTINS_TRANSFORMED);
+ return transformFunction(fn, new ApplySpecialization(compiler));
}
@Override
public String toString() {
return "'Builtin Replacement'";
}
- },
+ };
/**
- * Splitter Split the AST into several compile units based on a heuristic size calculation.
- * Split IR can lead to scope information being changed.
+ * Phase used to transform Function.prototype.apply.
*/
- SPLITTING_PHASE(
- EnumSet.of(
- INITIALIZED,
- PARSED,
- CONSTANT_FOLDED,
- LOWERED,
- BUILTINS_TRANSFORMED)) {
+ static final CompilationPhase APPLY_SPECIALIZATION_PHASE = new ApplySpecializationPhase();
+
+ private static final class SplittingPhase extends CompilationPhase {
@Override
FunctionNode transform(final Compiler compiler, final CompilationPhases phases, final FunctionNode fn) {
final CompileUnit outermostCompileUnit = compiler.addCompileUnit(0L);
@@ -170,16 +137,15 @@
public String toString() {
return "'Code Splitting'";
}
- },
+ };
- PROGRAM_POINT_PHASE(
- EnumSet.of(
- INITIALIZED,
- PARSED,
- CONSTANT_FOLDED,
- LOWERED,
- BUILTINS_TRANSFORMED,
- SPLIT)) {
+ /**
+ * Splitter Split the AST into several compile units based on a heuristic size calculation.
+ * Split IR can lead to scope information being changed.
+ */
+ static final CompilationPhase SPLITTING_PHASE = new SplittingPhase();
+
+ private static final class ProgramPointPhase extends CompilationPhase {
@Override
FunctionNode transform(final Compiler compiler, final CompilationPhases phases, final FunctionNode fn) {
return transformFunction(fn, new ProgramPoints());
@@ -189,16 +155,16 @@
public String toString() {
return "'Program Point Calculation'";
}
- },
+ };
- CACHE_AST(
- EnumSet.of(
- INITIALIZED,
- PARSED,
- CONSTANT_FOLDED,
- LOWERED,
- BUILTINS_TRANSFORMED,
- SPLIT)) {
+ /**
+ * Phase used only when doing optimistic code generation. It assigns all potentially
+ * optimistic ops a program point so that an UnwarrantedException knows from where
+ * a guess went wrong when creating the continuation to roll back this execution
+ */
+ static final CompilationPhase PROGRAM_POINT_PHASE = new ProgramPointPhase();
+
+ private static final class CacheAstPhase extends CompilationPhase {
@Override
FunctionNode transform(final Compiler compiler, final CompilationPhases phases, final FunctionNode fn) {
if (!compiler.isOnDemandCompilation()) {
@@ -217,16 +183,11 @@
public String toString() {
return "'Cache ASTs'";
}
- },
+ };
- SYMBOL_ASSIGNMENT_PHASE(
- EnumSet.of(
- INITIALIZED,
- PARSED,
- CONSTANT_FOLDED,
- LOWERED,
- BUILTINS_TRANSFORMED,
- SPLIT)) {
+ static final CompilationPhase CACHE_AST_PHASE = new CacheAstPhase();
+
+ private static final class SymbolAssignmentPhase extends CompilationPhase {
@Override
FunctionNode transform(final Compiler compiler, final CompilationPhases phases, final FunctionNode fn) {
return transformFunction(fn, new AssignSymbols(compiler));
@@ -236,17 +197,11 @@
public String toString() {
return "'Symbol Assignment'";
}
- },
+ };
- SCOPE_DEPTH_COMPUTATION_PHASE(
- EnumSet.of(
- INITIALIZED,
- PARSED,
- CONSTANT_FOLDED,
- LOWERED,
- BUILTINS_TRANSFORMED,
- SPLIT,
- SYMBOLS_ASSIGNED)) {
+ static final CompilationPhase SYMBOL_ASSIGNMENT_PHASE = new SymbolAssignmentPhase();
+
+ private static final class ScopeDepthComputationPhase extends CompilationPhase {
@Override
FunctionNode transform(final Compiler compiler, final CompilationPhases phases, final FunctionNode fn) {
return transformFunction(fn, new FindScopeDepths(compiler));
@@ -256,18 +211,11 @@
public String toString() {
return "'Scope Depth Computation'";
}
- },
+ }
- DECLARE_LOCAL_SYMBOLS_TO_COMPILER(
- EnumSet.of(
- INITIALIZED,
- PARSED,
- CONSTANT_FOLDED,
- LOWERED,
- BUILTINS_TRANSFORMED,
- SPLIT,
- SYMBOLS_ASSIGNED,
- SCOPE_DEPTHS_COMPUTED)) {
+ static final CompilationPhase SCOPE_DEPTH_COMPUTATION_PHASE = new ScopeDepthComputationPhase();
+
+ private static final class DeclareLocalSymbolsPhase extends CompilationPhase {
@Override
FunctionNode transform(final Compiler compiler, final CompilationPhases phases, final FunctionNode fn) {
// It's not necessary to guard the marking of symbols as locals with this "if" condition for
@@ -301,43 +249,28 @@
public String toString() {
return "'Local Symbols Declaration'";
}
- },
+ };
- OPTIMISTIC_TYPE_ASSIGNMENT_PHASE(
- EnumSet.of(
- INITIALIZED,
- PARSED,
- CONSTANT_FOLDED,
- LOWERED,
- BUILTINS_TRANSFORMED,
- SPLIT,
- SYMBOLS_ASSIGNED,
- SCOPE_DEPTHS_COMPUTED)) {
+ static final CompilationPhase DECLARE_LOCAL_SYMBOLS_PHASE = new DeclareLocalSymbolsPhase();
+
+ private static final class OptimisticTypeAssignmentPhase extends CompilationPhase {
@Override
FunctionNode transform(final Compiler compiler, final CompilationPhases phases, final FunctionNode fn) {
if (compiler.useOptimisticTypes()) {
return transformFunction(fn, new OptimisticTypesCalculator(compiler));
}
- return setStates(fn, OPTIMISTIC_TYPES_ASSIGNED);
+ return fn;
}
@Override
public String toString() {
return "'Optimistic Type Assignment'";
}
- },
+ }
- LOCAL_VARIABLE_TYPE_CALCULATION_PHASE(
- EnumSet.of(
- INITIALIZED,
- PARSED,
- CONSTANT_FOLDED,
- LOWERED,
- BUILTINS_TRANSFORMED,
- SPLIT,
- SYMBOLS_ASSIGNED,
- SCOPE_DEPTHS_COMPUTED,
- OPTIMISTIC_TYPES_ASSIGNED)) {
+ static final CompilationPhase OPTIMISTIC_TYPE_ASSIGNMENT_PHASE = new OptimisticTypeAssignmentPhase();
+
+ private static final class LocalVariableTypeCalculationPhase extends CompilationPhase {
@Override
FunctionNode transform(final Compiler compiler, final CompilationPhases phases, final FunctionNode fn) {
final FunctionNode newFunctionNode = transformFunction(fn, new LocalVariableTypesCalculator(compiler));
@@ -362,25 +295,11 @@
public String toString() {
return "'Local Variable Type Calculation'";
}
- },
-
+ };
- /**
- * Reuse compile units, if they are already present. We are using the same compiler
- * to recompile stuff
- */
- REUSE_COMPILE_UNITS_PHASE(
- EnumSet.of(
- INITIALIZED,
- PARSED,
- CONSTANT_FOLDED,
- LOWERED,
- BUILTINS_TRANSFORMED,
- SPLIT,
- SYMBOLS_ASSIGNED,
- SCOPE_DEPTHS_COMPUTED,
- OPTIMISTIC_TYPES_ASSIGNED,
- LOCAL_VARIABLE_TYPES_CALCULATED)) {
+ static final CompilationPhase LOCAL_VARIABLE_TYPE_CALCULATION_PHASE = new LocalVariableTypeCalculationPhase();
+
+ private static final class ReuseCompileUnitsPhase extends CompilationPhase {
@Override
FunctionNode transform(final Compiler compiler, final CompilationPhases phases, final FunctionNode fn) {
assert phases.isRestOfCompilation() : "reuse compile units currently only used for Rest-Of methods";
@@ -428,16 +347,15 @@
public String toString() {
return "'Reuse Compile Units'";
}
- },
+ }
- REINITIALIZE_CACHED(
- EnumSet.of(
- INITIALIZED,
- PARSED,
- CONSTANT_FOLDED,
- LOWERED,
- BUILTINS_TRANSFORMED,
- SPLIT)) {
+ /**
+ * Reuse compile units, if they are already present. We are using the same compiler
+ * to recompile stuff
+ */
+ static final CompilationPhase REUSE_COMPILE_UNITS_PHASE = new ReuseCompileUnitsPhase();
+
+ private static final class ReinitializeCachedPhase extends CompilationPhase {
@Override
FunctionNode transform(final Compiler compiler, final CompilationPhases phases, final FunctionNode fn) {
final Set<CompileUnit> unitSet = CompileUnit.createCompileUnitSet();
@@ -480,26 +398,11 @@
public String toString() {
return "'Reinitialize cached'";
}
- },
+ }
- /**
- * Bytecode generation:
- *
- * Generate the byte code class(es) resulting from the compiled FunctionNode
- */
- BYTECODE_GENERATION_PHASE(
- EnumSet.of(
- INITIALIZED,
- PARSED,
- CONSTANT_FOLDED,
- LOWERED,
- BUILTINS_TRANSFORMED,
- SPLIT,
- SYMBOLS_ASSIGNED,
- SCOPE_DEPTHS_COMPUTED,
- OPTIMISTIC_TYPES_ASSIGNED,
- LOCAL_VARIABLE_TYPES_CALCULATED)) {
+ static final CompilationPhase REINITIALIZE_CACHED = new ReinitializeCachedPhase();
+ private static final class BytecodeGenerationPhase extends CompilationPhase {
@Override
FunctionNode transform(final Compiler compiler, final CompilationPhases phases, final FunctionNode fn) {
final ScriptEnvironment senv = compiler.getScriptEnvironment();
@@ -517,7 +420,7 @@
try {
// Explicitly set BYTECODE_GENERATED here; it can not be set in case of skipping codegen for :program
// in the lazy + optimistic world. See CodeGenerator.skipFunction().
- newFunctionNode = transformFunction(newFunctionNode, codegen).setState(null, BYTECODE_GENERATED);
+ newFunctionNode = transformFunction(newFunctionNode, codegen);
codegen.generateScopeCalls();
} catch (final VerifyError e) {
if (senv._verify_code || senv._print_code) {
@@ -565,22 +468,16 @@
public String toString() {
return "'Bytecode Generation'";
}
- },
+ }
- INSTALL_PHASE(
- EnumSet.of(
- INITIALIZED,
- PARSED,
- CONSTANT_FOLDED,
- LOWERED,
- BUILTINS_TRANSFORMED,
- SPLIT,
- SYMBOLS_ASSIGNED,
- SCOPE_DEPTHS_COMPUTED,
- OPTIMISTIC_TYPES_ASSIGNED,
- LOCAL_VARIABLE_TYPES_CALCULATED,
- BYTECODE_GENERATED)) {
+ /**
+ * Bytecode generation:
+ *
+ * Generate the byte code class(es) resulting from the compiled FunctionNode
+ */
+ static final CompilationPhase BYTECODE_GENERATION_PHASE = new BytecodeGenerationPhase();
+ private static final class InstallPhase extends CompilationPhase {
@Override
FunctionNode transform(final Compiler compiler, final CompilationPhases phases, final FunctionNode fn) {
final DebugLogger log = compiler.getLogger();
@@ -591,8 +488,9 @@
Class<?> rootClass = null;
long length = 0L;
- final CodeInstaller codeInstaller = compiler.getCodeInstaller();
- final Map<String, byte[]> bytecode = compiler.getBytecode();
+ final CodeInstaller origCodeInstaller = compiler.getCodeInstaller();
+ final Map<String, byte[]> bytecode = compiler.getBytecode();
+ final CodeInstaller codeInstaller = bytecode.size() > 1 ? origCodeInstaller.getMultiClassCodeInstaller() : origCodeInstaller;
for (final Entry<String, byte[]> entry : bytecode.entrySet()) {
final String className = entry.getKey();
@@ -648,18 +546,16 @@
log.fine(sb.toString());
}
- return setStates(fn.setRootClass(null, rootClass), BYTECODE_INSTALLED);
+ return fn.setRootClass(null, rootClass);
}
@Override
public String toString() {
return "'Class Installation'";
}
-
- };
+ }
- /** pre conditions required for function node to which this transform is to be applied */
- private final EnumSet<CompilationState> pre;
+ static final CompilationPhase INSTALL_PHASE = new InstallPhase();
/** start time of transform - used for timing, see {@link jdk.nashorn.internal.runtime.Timing} */
private long startTime;
@@ -670,21 +566,7 @@
/** boolean that is true upon transform completion */
private boolean isFinished;
- private CompilationPhase(final EnumSet<CompilationState> pre) {
- this.pre = pre;
- }
-
- private static FunctionNode setStates(final FunctionNode functionNode, final CompilationState state) {
- if (!AssertsEnabled.assertsEnabled()) {
- return functionNode;
- }
- return transformFunction(functionNode, new NodeVisitor<LexicalContext>(new LexicalContext()) {
- @Override
- public Node leaveFunctionNode(final FunctionNode fn) {
- return fn.setState(lc, state);
- }
- });
- }
+ private CompilationPhase() {}
/**
* Start a compilation phase
@@ -694,23 +576,7 @@
*/
protected FunctionNode begin(final Compiler compiler, final FunctionNode functionNode) {
compiler.getLogger().indent();
-
- assert pre != null;
-
- if (!functionNode.hasState(pre)) {
- final StringBuilder sb = new StringBuilder("Compilation phase ");
- sb.append(this).
- append(" is not applicable to ").
- append(quote(functionNode.getName())).
- append("\n\tFunctionNode state = ").
- append(functionNode.getState()).
- append("\n\tRequired state = ").
- append(this.pre);
-
- throw new CompilationException(sb.toString());
- }
-
- startTime = System.nanoTime();
+ startTime = System.nanoTime();
return functionNode;
}
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/Compiler.java Thu Sep 17 16:53:42 2015 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/Compiler.java Fri Sep 25 12:04:35 2015 -0700
@@ -172,17 +172,17 @@
"Common initial phases",
CompilationPhase.CONSTANT_FOLDING_PHASE,
CompilationPhase.LOWERING_PHASE,
- CompilationPhase.TRANSFORM_BUILTINS_PHASE,
+ CompilationPhase.APPLY_SPECIALIZATION_PHASE,
CompilationPhase.SPLITTING_PHASE,
CompilationPhase.PROGRAM_POINT_PHASE,
CompilationPhase.SYMBOL_ASSIGNMENT_PHASE,
CompilationPhase.SCOPE_DEPTH_COMPUTATION_PHASE,
- CompilationPhase.CACHE_AST
+ CompilationPhase.CACHE_AST_PHASE
);
private final static CompilationPhases COMPILE_CACHED_UPTO_BYTECODE = new CompilationPhases(
"After common phases, before bytecode generator",
- CompilationPhase.DECLARE_LOCAL_SYMBOLS_TO_COMPILER,
+ CompilationPhase.DECLARE_LOCAL_SYMBOLS_PHASE,
CompilationPhase.OPTIMISTIC_TYPE_ASSIGNMENT_PHASE,
CompilationPhase.LOCAL_VARIABLE_TYPE_CALCULATION_PHASE
);
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/FindScopeDepths.java Thu Sep 17 16:53:42 2015 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/FindScopeDepths.java Fri Sep 25 12:04:35 2015 -0700
@@ -34,7 +34,6 @@
import java.util.Set;
import jdk.nashorn.internal.ir.Block;
import jdk.nashorn.internal.ir.FunctionNode;
-import jdk.nashorn.internal.ir.FunctionNode.CompilationState;
import jdk.nashorn.internal.ir.IdentNode;
import jdk.nashorn.internal.ir.LexicalContext;
import jdk.nashorn.internal.ir.Node;
@@ -180,8 +179,7 @@
@Override
public Node leaveFunctionNode(final FunctionNode functionNode) {
final String name = functionNode.getName();
- FunctionNode newFunctionNode = functionNode.setState(lc, CompilationState.SCOPE_DEPTHS_COMPUTED);
-
+ FunctionNode newFunctionNode = functionNode;
if (compiler.isOnDemandCompilation()) {
final RecompilableScriptFunctionData data = compiler.getScriptFunctionData(newFunctionNode.getId());
if (data.inDynamicContext()) {
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/FoldConstants.java Thu Sep 17 16:53:42 2015 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/FoldConstants.java Fri Sep 25 12:04:35 2015 -0700
@@ -37,7 +37,6 @@
import jdk.nashorn.internal.ir.EmptyNode;
import jdk.nashorn.internal.ir.Expression;
import jdk.nashorn.internal.ir.FunctionNode;
-import jdk.nashorn.internal.ir.FunctionNode.CompilationState;
import jdk.nashorn.internal.ir.IfNode;
import jdk.nashorn.internal.ir.LexicalContext;
import jdk.nashorn.internal.ir.LiteralNode;
@@ -101,7 +100,7 @@
@Override
public Node leaveFunctionNode(final FunctionNode functionNode) {
- return functionNode.setState(lc, CompilationState.CONSTANT_FOLDED);
+ return functionNode;
}
@Override
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/LocalVariableTypesCalculator.java Thu Sep 17 16:53:42 2015 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/LocalVariableTypesCalculator.java Fri Sep 25 12:04:35 2015 -0700
@@ -54,7 +54,6 @@
import jdk.nashorn.internal.ir.ExpressionStatement;
import jdk.nashorn.internal.ir.ForNode;
import jdk.nashorn.internal.ir.FunctionNode;
-import jdk.nashorn.internal.ir.FunctionNode.CompilationState;
import jdk.nashorn.internal.ir.GetSplitState;
import jdk.nashorn.internal.ir.IdentNode;
import jdk.nashorn.internal.ir.IfNode;
@@ -1478,7 +1477,6 @@
newFunction = newFunction.setReturnType(lc, returnType);
- newFunction = newFunction.setState(lc, CompilationState.LOCAL_VARIABLE_TYPES_CALCULATED);
newFunction = newFunction.setParameters(lc, newFunction.visitParameters(applyChangesVisitor));
return newFunction;
}
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/Lower.java Thu Sep 17 16:53:42 2015 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/Lower.java Fri Sep 25 12:04:35 2015 -0700
@@ -52,7 +52,6 @@
import jdk.nashorn.internal.ir.ExpressionStatement;
import jdk.nashorn.internal.ir.ForNode;
import jdk.nashorn.internal.ir.FunctionNode;
-import jdk.nashorn.internal.ir.FunctionNode.CompilationState;
import jdk.nashorn.internal.ir.IdentNode;
import jdk.nashorn.internal.ir.IfNode;
import jdk.nashorn.internal.ir.IndexNode;
@@ -276,7 +275,7 @@
@Override
public Node leaveFunctionNode(final FunctionNode functionNode) {
log.info("END FunctionNode: ", functionNode.getName());
- return functionNode.setState(lc, CompilationState.LOWERED);
+ return functionNode;
}
@Override
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/OptimisticTypesCalculator.java Thu Sep 17 16:53:42 2015 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/OptimisticTypesCalculator.java Fri Sep 25 12:04:35 2015 -0700
@@ -38,7 +38,6 @@
import jdk.nashorn.internal.ir.ExpressionStatement;
import jdk.nashorn.internal.ir.ForNode;
import jdk.nashorn.internal.ir.FunctionNode;
-import jdk.nashorn.internal.ir.FunctionNode.CompilationState;
import jdk.nashorn.internal.ir.IdentNode;
import jdk.nashorn.internal.ir.IfNode;
import jdk.nashorn.internal.ir.IndexNode;
@@ -208,7 +207,7 @@
@Override
public Node leaveFunctionNode(final FunctionNode functionNode) {
neverOptimistic.pop();
- return functionNode.setState(lc, CompilationState.OPTIMISTIC_TYPES_ASSIGNED);
+ return functionNode;
}
@Override
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/ReplaceCompileUnits.java Thu Sep 17 16:53:42 2015 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/ReplaceCompileUnits.java Fri Sep 25 12:04:35 2015 -0700
@@ -29,7 +29,6 @@
import java.util.List;
import jdk.nashorn.internal.ir.CompileUnitHolder;
import jdk.nashorn.internal.ir.FunctionNode;
-import jdk.nashorn.internal.ir.FunctionNode.CompilationState;
import jdk.nashorn.internal.ir.LexicalContext;
import jdk.nashorn.internal.ir.LiteralNode;
import jdk.nashorn.internal.ir.LiteralNode.ArrayLiteralNode;
@@ -64,7 +63,7 @@
@Override
public Node leaveFunctionNode(final FunctionNode node) {
- return node.setCompileUnit(lc, getExistingReplacement(node)).setState(lc, CompilationState.COMPILE_UNITS_REUSED);
+ return node.setCompileUnit(lc, getExistingReplacement(node));
}
@Override
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/SplitIntoFunctions.java Thu Sep 17 16:53:42 2015 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/SplitIntoFunctions.java Fri Sep 25 12:04:35 2015 -0700
@@ -47,7 +47,6 @@
import jdk.nashorn.internal.ir.Expression;
import jdk.nashorn.internal.ir.ExpressionStatement;
import jdk.nashorn.internal.ir.FunctionNode;
-import jdk.nashorn.internal.ir.FunctionNode.CompilationState;
import jdk.nashorn.internal.ir.GetSplitState;
import jdk.nashorn.internal.ir.IdentNode;
import jdk.nashorn.internal.ir.IfNode;
@@ -176,11 +175,9 @@
// we still use IS_SPLIT as the criteria in CompilationPhase.SERIALIZE_SPLIT_PHASE.
FunctionNode.IS_ANONYMOUS | FunctionNode.USES_ANCESTOR_SCOPE | FunctionNode.IS_SPLIT,
body,
- CompilationState.INITIALIZED,
null
)
- .setCompileUnit(lc, splitNode.getCompileUnit())
- .copyCompilationState(lc, originalFn);
+ .setCompileUnit(lc, splitNode.getCompileUnit());
// Call the function:
// either "(function () { ... }).call(this)"
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/Splitter.java Thu Sep 17 16:53:42 2015 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/Splitter.java Fri Sep 25 12:04:35 2015 -0700
@@ -33,7 +33,6 @@
import java.util.Map;
import jdk.nashorn.internal.ir.Block;
import jdk.nashorn.internal.ir.FunctionNode;
-import jdk.nashorn.internal.ir.FunctionNode.CompilationState;
import jdk.nashorn.internal.ir.LexicalContext;
import jdk.nashorn.internal.ir.LiteralNode;
import jdk.nashorn.internal.ir.LiteralNode.ArrayLiteralNode;
@@ -158,7 +157,7 @@
assert functionNode.getCompileUnit() != null;
- return functionNode.setState(null, CompilationState.SPLIT);
+ return functionNode;
}
private static List<FunctionNode> directChildren(final FunctionNode functionNode) {
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/FunctionNode.java Thu Sep 17 16:53:42 2015 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/FunctionNode.java Fri Sep 25 12:04:35 2015 -0700
@@ -33,10 +33,8 @@
import static jdk.nashorn.internal.runtime.linker.NashornCallSiteDescriptor.CALLSITE_TRACE_VALUES;
import java.util.Collections;
-import java.util.EnumSet;
import java.util.Iterator;
import java.util.List;
-import jdk.nashorn.internal.AssertsEnabled;
import jdk.nashorn.internal.codegen.CompileUnit;
import jdk.nashorn.internal.codegen.Compiler;
import jdk.nashorn.internal.codegen.CompilerConstants;
@@ -74,40 +72,6 @@
SETTER
}
- /** Compilation states available */
- public enum CompilationState {
- /** compiler is ready */
- INITIALIZED,
- /** method has been parsed */
- PARSED,
- /** method has been parsed */
- PARSE_ERROR,
- /** constant folding pass */
- CONSTANT_FOLDED,
- /** method has been lowered */
- LOWERED,
- /** program points have been assigned to unique locations */
- PROGRAM_POINTS_ASSIGNED,
- /** any transformations of builtins have taken place, e.g. apply=>call */
- BUILTINS_TRANSFORMED,
- /** method has been split */
- SPLIT,
- /** method has had symbols assigned */
- SYMBOLS_ASSIGNED,
- /** computed scope depths for symbols */
- SCOPE_DEPTHS_COMPUTED,
- /** method has had types calculated*/
- OPTIMISTIC_TYPES_ASSIGNED,
- /** method has had types calculated */
- LOCAL_VARIABLE_TYPES_CALCULATED,
- /** compile units reused (optional) */
- COMPILE_UNITS_REUSED,
- /** method has been emitted to bytecode */
- BYTECODE_GENERATED,
- /** method has been installed */
- BYTECODE_INSTALLED
- }
-
/** Source of entity. */
private transient final Source source;
@@ -145,10 +109,6 @@
/** Method's namespace. */
private transient final Namespace namespace;
- /** Current compilation state */
- @Ignore
- private final EnumSet<CompilationState> compilationState;
-
/** Number of properties of "this" object assigned in this function */
@Ignore
private final int thisProperties;
@@ -306,7 +266,6 @@
* @param kind kind of function as in {@link FunctionNode.Kind}
* @param flags initial flags
* @param body body of the function
- * @param state The initial state from the parser. Must be one of {@link CompilationState#PARSED} and {@link CompilationState#PARSE_ERROR}
* @param endParserState The parser state at the end of the parsing.
*/
public FunctionNode(
@@ -323,7 +282,6 @@
final FunctionNode.Kind kind,
final int flags,
final Block body,
- final CompilationState state,
final Object endParserState) {
super(token, finish);
@@ -336,7 +294,6 @@
this.firstToken = firstToken;
this.lastToken = lastToken;
this.namespace = namespace;
- this.compilationState = EnumSet.of(CompilationState.INITIALIZED, state);
this.flags = flags;
this.compileUnit = null;
this.body = body;
@@ -353,7 +310,6 @@
final String name,
final Type returnType,
final CompileUnit compileUnit,
- final EnumSet<CompilationState> compilationState,
final Block body,
final List<IdentNode> parameters,
final int thisProperties,
@@ -368,7 +324,6 @@
this.returnType = returnType;
this.compileUnit = compileUnit;
this.lastToken = lastToken;
- this.compilationState = compilationState;
this.body = body;
this.parameters = parameters;
this.thisProperties = thisProperties;
@@ -468,7 +423,6 @@
name,
returnType,
compileUnit,
- compilationState,
body,
parameters,
thisProperties,
@@ -544,80 +498,6 @@
}
/**
- * Get the compilation state of this function
- * @return the compilation state
- */
- public EnumSet<CompilationState> getState() {
- return compilationState;
- }
-
- /**
- * Check whether this FunctionNode has reached a give CompilationState.
- *
- * @param state the state to check for
- * @return true of the node is in the given state
- */
- public boolean hasState(final EnumSet<CompilationState> state) {
- return !AssertsEnabled.assertsEnabled() || compilationState.containsAll(state);
- }
-
- /**
- * Add a state to the total CompilationState of this node, e.g. if
- * FunctionNode has been lowered, the compiler will add
- * {@code CompilationState#LOWERED} to the state vector
- *
- * @param lc lexical context
- * @param state {@link CompilationState} to add
- * @return function node or a new one if state was changed
- */
- public FunctionNode setState(final LexicalContext lc, final CompilationState state) {
- if (!AssertsEnabled.assertsEnabled() || this.compilationState.contains(state)) {
- return this;
- }
- final EnumSet<CompilationState> newState = EnumSet.copyOf(this.compilationState);
- newState.add(state);
- return setCompilationState(lc, newState);
- }
-
- /**
- * Copy a compilation state from an original function to this function. Used when creating synthetic
- * function nodes by the splitter.
- *
- * @param lc lexical context
- * @param original the original function node to copy compilation state from
- * @return function node or a new one if state was changed
- */
- public FunctionNode copyCompilationState(final LexicalContext lc, final FunctionNode original) {
- final EnumSet<CompilationState> origState = original.compilationState;
- if (!AssertsEnabled.assertsEnabled() || this.compilationState.containsAll(origState)) {
- return this;
- }
- final EnumSet<CompilationState> newState = EnumSet.copyOf(this.compilationState);
- newState.addAll(origState);
- return setCompilationState(lc, newState);
- }
-
- private FunctionNode setCompilationState(final LexicalContext lc, final EnumSet<CompilationState> compilationState) {
- return Node.replaceInLexicalContext(
- lc,
- this,
- new FunctionNode(
- this,
- lastToken,
- endParserState,
- flags,
- name,
- returnType,
- compileUnit,
- compilationState,
- body,
- parameters,
- thisProperties,
- rootClass, source, namespace));
- }
-
-
- /**
* Create a unique name in the namespace of this FunctionNode
* @param base prefix for name
* @return base if no collision exists, otherwise a name prefix with base
@@ -682,7 +562,6 @@
name,
returnType,
compileUnit,
- compilationState,
body,
parameters,
thisProperties,
@@ -823,7 +702,6 @@
name,
returnType,
compileUnit,
- compilationState,
body,
parameters,
thisProperties,
@@ -919,7 +797,6 @@
name,
returnType,
compileUnit,
- compilationState,
body,
parameters,
thisProperties,
@@ -996,7 +873,6 @@
name,
returnType,
compileUnit,
- compilationState,
body,
parameters,
thisProperties,
@@ -1070,7 +946,6 @@
name,
returnType,
compileUnit,
- compilationState,
body,
parameters,
thisProperties,
@@ -1158,7 +1033,6 @@
name,
type,
compileUnit,
- compilationState,
body,
parameters,
thisProperties,
@@ -1224,7 +1098,6 @@
name,
returnType,
compileUnit,
- compilationState,
body,
parameters,
thisProperties,
@@ -1280,7 +1153,6 @@
name,
returnType,
compileUnit,
- compilationState,
body,
parameters,
thisProperties,
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeJSAdapter.java Thu Sep 17 16:53:42 2015 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeJSAdapter.java Fri Sep 25 12:04:35 2015 -0700
@@ -627,7 +627,7 @@
return new GuardedInvocation(MH.dropArguments(MH.constant(Object.class,
func.createBound(this, new Object[] { name })), 0, Object.class),
testJSAdaptor(adaptee, null, null, null),
- adaptee.getProtoSwitchPoint(__call__, find.getOwner()));
+ adaptee.getProtoSwitchPoints(__call__, find.getOwner()), null);
}
}
throw typeError("no.such.function", desc.getNameToken(2), ScriptRuntime.safeToString(this));
@@ -698,7 +698,7 @@
return new GuardedInvocation(
methodHandle,
testJSAdaptor(adaptee, findData.getGetter(Object.class, INVALID_PROGRAM_POINT, null), findData.getOwner(), func),
- adaptee.getProtoSwitchPoint(hook, findData.getOwner()));
+ adaptee.getProtoSwitchPoints(hook, findData.getOwner()), null);
}
}
}
@@ -710,7 +710,7 @@
final MethodHandle methodHandle = hook.equals(__put__) ?
MH.asType(Lookup.EMPTY_SETTER, type) :
Lookup.emptyGetter(type.returnType());
- return new GuardedInvocation(methodHandle, testJSAdaptor(adaptee, null, null, null), adaptee.getProtoSwitchPoint(hook, null));
+ return new GuardedInvocation(methodHandle, testJSAdaptor(adaptee, null, null, null), adaptee.getProtoSwitchPoints(hook, null), null);
}
}
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeJava.java Thu Sep 17 16:53:42 2015 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeJava.java Fri Sep 25 12:04:35 2015 -0700
@@ -345,7 +345,8 @@
/**
* Given a script object and a Java type, converts the script object into the desired Java type. Currently it
* performs shallow creation of Java arrays, as well as wrapping of objects in Lists, Dequeues, Queues,
- * and Collections. Example:
+ * and Collections. If conversion is not possible or fails for some reason, TypeError is thrown.
+ * Example:
* <pre>
* var anArray = [1, "13", false]
* var javaIntArray = Java.to(anArray, "int[]")
@@ -389,7 +390,11 @@
}
if(targetClass.isArray()) {
- return JSType.toJavaArray(obj, targetClass.getComponentType());
+ try {
+ return JSType.toJavaArray(obj, targetClass.getComponentType());
+ } catch (final Exception exp) {
+ throw typeError(exp, "java.array.conversion.failed", targetClass.getName());
+ }
}
if (targetClass == List.class || targetClass == Deque.class || targetClass == Queue.class || targetClass == Collection.class) {
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeJavaImporter.java Thu Sep 17 16:53:42 2015 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeJavaImporter.java Fri Sep 25 12:04:35 2015 -0700
@@ -134,7 +134,7 @@
}
@Override
- protected Object invokeNoSuchProperty(final String name, final int programPoint) {
+ protected Object invokeNoSuchProperty(final String name, final boolean isScope, final int programPoint) {
final Object retval = createProperty(name);
if (isValid(programPoint)) {
throw new UnwarrantedOptimismException(retval, programPoint);
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/parser/Parser.java Thu Sep 17 16:53:42 2015 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/parser/Parser.java Fri Sep 25 12:04:35 2015 -0700
@@ -84,7 +84,6 @@
import jdk.nashorn.internal.ir.ExpressionStatement;
import jdk.nashorn.internal.ir.ForNode;
import jdk.nashorn.internal.ir.FunctionNode;
-import jdk.nashorn.internal.ir.FunctionNode.CompilationState;
import jdk.nashorn.internal.ir.IdentNode;
import jdk.nashorn.internal.ir.IfNode;
import jdk.nashorn.internal.ir.IndexNode;
@@ -487,7 +486,6 @@
}
private FunctionNode createFunctionNode(final ParserContextFunctionNode function, final long startToken, final IdentNode ident, final List<IdentNode> parameters, final FunctionNode.Kind kind, final int functionLine, final Block body){
- final CompilationState state = errors.hasErrors() ? CompilationState.PARSE_ERROR : CompilationState.PARSED;
// Start new block.
final FunctionNode functionNode =
new FunctionNode(
@@ -504,7 +502,6 @@
kind,
function.getFlags(),
body,
- state,
function.getEndParserState());
printAST(functionNode);
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/AllocationStrategy.java Thu Sep 17 16:53:42 2015 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/AllocationStrategy.java Fri Sep 25 12:04:35 2015 -0700
@@ -29,6 +29,7 @@
import java.io.Serializable;
import java.lang.invoke.MethodHandle;
import java.lang.invoke.MethodHandles;
+import java.lang.ref.WeakReference;
import jdk.nashorn.internal.codegen.Compiler;
import jdk.nashorn.internal.codegen.CompilerConstants;
import jdk.nashorn.internal.codegen.ObjectClassGenerator;
@@ -53,6 +54,9 @@
/** lazily generated allocator */
private transient MethodHandle allocator;
+ /** Last used allocator map */
+ private transient AllocatorMap lastMap;
+
/**
* Construct an allocation strategy with the given map and class name.
* @param fieldCount number of fields in the allocated object
@@ -71,11 +75,49 @@
return allocatorClassName;
}
- PropertyMap getAllocatorMap() {
- // Create a new map for each function instance
- return PropertyMap.newMap(null, getAllocatorClassName(), 0, fieldCount, 0);
+ /**
+ * Get the property map for the allocated object.
+ * @param prototype the prototype object
+ * @return the property map
+ */
+ synchronized PropertyMap getAllocatorMap(final ScriptObject prototype) {
+ assert prototype != null;
+ final PropertyMap protoMap = prototype.getMap();
+
+ if (lastMap != null) {
+ if (!lastMap.hasSharedProtoMap()) {
+ if (lastMap.hasSamePrototype(prototype)) {
+ return lastMap.allocatorMap;
+ }
+ if (lastMap.hasSameProtoMap(protoMap) && lastMap.hasUnchangedProtoMap()) {
+ // Convert to shared prototype map. Allocated objects will use the same property map
+ // that can be used as long as none of the prototypes modify the shared proto map.
+ final PropertyMap allocatorMap = PropertyMap.newMap(null, getAllocatorClassName(), 0, fieldCount, 0);
+ final SharedPropertyMap sharedProtoMap = new SharedPropertyMap(protoMap);
+ allocatorMap.setSharedProtoMap(sharedProtoMap);
+ prototype.setMap(sharedProtoMap);
+ lastMap = new AllocatorMap(prototype, protoMap, allocatorMap);
+ return allocatorMap;
+ }
+ }
+
+ if (lastMap.hasValidSharedProtoMap() && lastMap.hasSameProtoMap(protoMap)) {
+ prototype.setMap(lastMap.getSharedProtoMap());
+ return lastMap.allocatorMap;
+ }
+ }
+
+ final PropertyMap allocatorMap = PropertyMap.newMap(null, getAllocatorClassName(), 0, fieldCount, 0);
+ lastMap = new AllocatorMap(prototype, protoMap, allocatorMap);
+
+ return allocatorMap;
}
+ /**
+ * Allocate an object with the given property map
+ * @param map the property map
+ * @return the allocated object
+ */
ScriptObject allocate(final PropertyMap map) {
try {
if (allocator == null) {
@@ -94,4 +136,43 @@
public String toString() {
return "AllocationStrategy[fieldCount=" + fieldCount + "]";
}
+
+ static class AllocatorMap {
+ final private WeakReference<ScriptObject> prototype;
+ final private WeakReference<PropertyMap> prototypeMap;
+
+ private PropertyMap allocatorMap;
+
+ AllocatorMap(final ScriptObject prototype, final PropertyMap protoMap, final PropertyMap allocMap) {
+ this.prototype = new WeakReference<>(prototype);
+ this.prototypeMap = new WeakReference<>(protoMap);
+ this.allocatorMap = allocMap;
+ }
+
+ boolean hasSamePrototype(final ScriptObject proto) {
+ return prototype.get() == proto;
+ }
+
+ boolean hasSameProtoMap(final PropertyMap protoMap) {
+ return prototypeMap.get() == protoMap || allocatorMap.getSharedProtoMap() == protoMap;
+ }
+
+ boolean hasUnchangedProtoMap() {
+ final ScriptObject proto = prototype.get();
+ return proto != null && proto.getMap() == prototypeMap.get();
+ }
+
+ boolean hasSharedProtoMap() {
+ return getSharedProtoMap() != null;
+ }
+
+ boolean hasValidSharedProtoMap() {
+ return hasSharedProtoMap() && getSharedProtoMap().isValidSharedProtoMap();
+ }
+
+ PropertyMap getSharedProtoMap() {
+ return allocatorMap.getSharedProtoMap();
+ }
+
+ }
}
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/CodeInstaller.java Thu Sep 17 16:53:42 2015 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/CodeInstaller.java Fri Sep 25 12:04:35 2015 -0700
@@ -101,16 +101,24 @@
public StoredScript loadScript(Source source, String functionKey);
/**
- * Returns a new code installer that shares most of the functionality of this code installer, but uses a
- * new, independent class loader.
- * @return a new code installer with a new independent class loader.
+ * Returns a code installer {@code #isCompatibleWith(CodeInstaller) compatible with} this installer, but
+ * is suitable for on-demand compilations. Can return itself if it is itself suitable.
+ * @return a compatible code installer suitable for on-demand compilations.
*/
- public CodeInstaller withNewLoader();
+ public CodeInstaller getOnDemandCompilationInstaller();
+
+ /**
+ * Returns a code installer {@code #isCompatibleWith(CodeInstaller) compatible with} this installer, but
+ * is suitable for installation of multiple classes that reference each other by name. Should be used when
+ * a compilation job produces multiple compilation units. Can return itself if it is itself suitable.
+ * @return a compatible code installer suitable for installation of multiple classes.
+ */
+ public CodeInstaller getMultiClassCodeInstaller();
/**
* Returns true if this code installer is compatible with the other code installer. Compatibility is expected to be
* an equivalence relation, and installers are supposed to be compatible with those they create using
- * {@link #withNewLoader()}.
+ * {@link #getOnDemandCompilationInstaller()}.
* @param other the other code installer tested for compatibility with this code installer.
* @return true if this code installer is compatible with the other code installer.
*/
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/Context.java Thu Sep 17 16:53:42 2015 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/Context.java Fri Sep 25 12:04:35 2015 -0700
@@ -25,6 +25,7 @@
package jdk.nashorn.internal.runtime;
+import static jdk.internal.org.objectweb.asm.Opcodes.V1_7;
import static jdk.nashorn.internal.codegen.CompilerConstants.CONSTANTS;
import static jdk.nashorn.internal.codegen.CompilerConstants.CREATE_PROGRAM_FUNCTION;
import static jdk.nashorn.internal.codegen.CompilerConstants.SOURCE;
@@ -41,8 +42,10 @@
import java.lang.invoke.MethodHandles;
import java.lang.invoke.MethodType;
import java.lang.invoke.SwitchPoint;
+import java.lang.ref.Reference;
import java.lang.ref.ReferenceQueue;
import java.lang.ref.SoftReference;
+import java.lang.ref.WeakReference;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
import java.net.MalformedURLException;
@@ -61,14 +64,18 @@
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Objects;
+import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.atomic.AtomicLong;
import java.util.concurrent.atomic.AtomicReference;
+import java.util.concurrent.atomic.LongAdder;
import java.util.function.Consumer;
import java.util.function.Supplier;
import java.util.logging.Level;
import javax.script.ScriptContext;
import javax.script.ScriptEngine;
import jdk.internal.org.objectweb.asm.ClassReader;
+import jdk.internal.org.objectweb.asm.ClassWriter;
+import jdk.internal.org.objectweb.asm.Opcodes;
import jdk.internal.org.objectweb.asm.util.CheckClassAdapter;
import jdk.nashorn.api.scripting.ClassFilter;
import jdk.nashorn.api.scripting.ScriptObjectMirror;
@@ -87,6 +94,7 @@
import jdk.nashorn.internal.runtime.logging.Logger;
import jdk.nashorn.internal.runtime.options.LoggingOption.LoggerInfo;
import jdk.nashorn.internal.runtime.options.Options;
+import sun.misc.Unsafe;
/**
* This class manages the global state of execution. Context is immutable.
@@ -128,9 +136,12 @@
private static final String LOAD_FX = "fx:";
private static final String LOAD_NASHORN = "nashorn:";
- private static MethodHandles.Lookup LOOKUP = MethodHandles.lookup();
- private static MethodType CREATE_PROGRAM_FUNCTION_TYPE = MethodType.methodType(ScriptFunction.class, ScriptObject.class);
+ private static final MethodHandles.Lookup LOOKUP = MethodHandles.lookup();
+ private static final MethodType CREATE_PROGRAM_FUNCTION_TYPE = MethodType.methodType(ScriptFunction.class, ScriptObject.class);
+ private static final LongAdder NAMED_INSTALLED_SCRIPT_COUNT = new LongAdder();
+ private static final LongAdder ANONYMOUS_INSTALLED_SCRIPT_COUNT = new LongAdder();
+ private static final boolean DISABLE_VM_ANONYMOUS_CLASSES = Options.getBooleanProperty("nashorn.disableVmAnonymousClasses");
/**
* Should scripts use only object slots for fields, or dual long/object slots? The default
* behaviour is to couple this to optimistic types, using dual representation if optimistic types are enabled
@@ -163,25 +174,24 @@
DebuggerSupport.FORCELOAD = true;
}
+ static long getNamedInstalledScriptCount() {
+ return NAMED_INSTALLED_SCRIPT_COUNT.sum();
+ }
+
+ static long getAnonymousInstalledScriptCount() {
+ return ANONYMOUS_INSTALLED_SCRIPT_COUNT.sum();
+ }
+
/**
* ContextCodeInstaller that has the privilege of installing classes in the Context.
* Can only be instantiated from inside the context and is opaque to other classes
*/
- public static class ContextCodeInstaller implements CodeInstaller {
- private final Context context;
- private final ScriptLoader loader;
- private final CodeSource codeSource;
- private int usageCount = 0;
- private int bytesDefined = 0;
+ private abstract static class ContextCodeInstaller implements CodeInstaller {
+ final Context context;
+ final CodeSource codeSource;
- // We reuse this installer for 10 compilations or 200000 defined bytes. Usually the first condition
- // will occur much earlier, the second is a safety measure for very large scripts/functions.
- private final static int MAX_USAGES = 10;
- private final static int MAX_BYTES_DEFINED = 200_000;
-
- private ContextCodeInstaller(final Context context, final ScriptLoader loader, final CodeSource codeSource) {
- this.context = context;
- this.loader = loader;
+ ContextCodeInstaller(final Context context, final CodeSource codeSource) {
+ this.context = context;
this.codeSource = codeSource;
}
@@ -191,14 +201,6 @@
}
@Override
- public Class<?> install(final String className, final byte[] bytecode) {
- usageCount++;
- bytesDefined += bytecode.length;
- final String binaryName = Compiler.binaryName(className);
- return loader.installClass(binaryName, bytecode, codeSource);
- }
-
- @Override
public void initialize(final Collection<Class<?>> classes, final Source source, final Object[] constants) {
try {
AccessController.doPrivileged(new PrivilegedExceptionAction<Void>() {
@@ -250,15 +252,6 @@
}
@Override
- public CodeInstaller withNewLoader() {
- // Reuse this installer if we're within our limits.
- if (usageCount < MAX_USAGES && bytesDefined < MAX_BYTES_DEFINED) {
- return this;
- }
- return new ContextCodeInstaller(context, context.createNewLoader(), codeSource);
- }
-
- @Override
public boolean isCompatibleWith(final CodeInstaller other) {
if (other instanceof ContextCodeInstaller) {
final ContextCodeInstaller cci = (ContextCodeInstaller)other;
@@ -268,6 +261,116 @@
}
}
+ private static class NamedContextCodeInstaller extends ContextCodeInstaller {
+ private final ScriptLoader loader;
+ private int usageCount = 0;
+ private int bytesDefined = 0;
+
+ // We reuse this installer for 10 compilations or 200000 defined bytes. Usually the first condition
+ // will occur much earlier, the second is a safety measure for very large scripts/functions.
+ private final static int MAX_USAGES = 10;
+ private final static int MAX_BYTES_DEFINED = 200_000;
+
+ private NamedContextCodeInstaller(final Context context, final CodeSource codeSource, final ScriptLoader loader) {
+ super(context, codeSource);
+ this.loader = loader;
+ }
+
+ @Override
+ public Class<?> install(final String className, final byte[] bytecode) {
+ usageCount++;
+ bytesDefined += bytecode.length;
+ NAMED_INSTALLED_SCRIPT_COUNT.increment();
+ return loader.installClass(Compiler.binaryName(className), bytecode, codeSource);
+ }
+
+ @Override
+ public CodeInstaller getOnDemandCompilationInstaller() {
+ // Reuse this installer if we're within our limits.
+ if (usageCount < MAX_USAGES && bytesDefined < MAX_BYTES_DEFINED) {
+ return this;
+ }
+ return new NamedContextCodeInstaller(context, codeSource, context.createNewLoader());
+ }
+
+ @Override
+ public CodeInstaller getMultiClassCodeInstaller() {
+ // This installer is perfectly suitable for installing multiple classes that reference each other
+ // as it produces classes with resolvable names, all defined in a single class loader.
+ return this;
+ }
+ }
+
+ private final Map<CodeSource, Reference<Class<?>>> anonymousHostClasses = new ConcurrentHashMap<>();
+
+ private static final class AnonymousContextCodeInstaller extends ContextCodeInstaller {
+ private static final Unsafe UNSAFE = getUnsafe();
+ private static final String ANONYMOUS_HOST_CLASS_NAME = Compiler.SCRIPTS_PACKAGE.replace('/', '.') + ".AnonymousHost";
+ private static final byte[] ANONYMOUS_HOST_CLASS_BYTES = getAnonymousHostClassBytes();
+
+ private final Class<?> hostClass;
+
+ private AnonymousContextCodeInstaller(final Context context, final CodeSource codeSource) {
+ super(context, codeSource);
+ hostClass = getAnonymousHostClass();
+ }
+
+ @Override
+ public Class<?> install(final String className, final byte[] bytecode) {
+ ANONYMOUS_INSTALLED_SCRIPT_COUNT.increment();
+ return UNSAFE.defineAnonymousClass(hostClass, bytecode, null);
+ }
+
+ @Override
+ public CodeInstaller getOnDemandCompilationInstaller() {
+ // This code loader can be indefinitely reused for on-demand recompilations for the same code source.
+ return this;
+ }
+
+ @Override
+ public CodeInstaller getMultiClassCodeInstaller() {
+ // This code loader can not be used to install multiple classes that reference each other, as they
+ // would have no resolvable names. Therefore, in such situation we must revert to an installer that
+ // produces named classes.
+ return new NamedContextCodeInstaller(context, codeSource, context.createNewLoader());
+ }
+
+ private Class<?> getAnonymousHostClass() {
+ final Reference<Class<?>> ref = context.anonymousHostClasses.get(codeSource);
+ if (ref != null) {
+ final Class<?> existingHostClass = ref.get();
+ if (existingHostClass != null) {
+ return existingHostClass;
+ }
+ }
+ final Class<?> newHostClass = context.createNewLoader().installClass(ANONYMOUS_HOST_CLASS_NAME, ANONYMOUS_HOST_CLASS_BYTES, codeSource);
+ context.anonymousHostClasses.put(codeSource, new WeakReference<>(newHostClass));
+ return newHostClass;
+ }
+
+ private static final byte[] getAnonymousHostClassBytes() {
+ final ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_FRAMES | ClassWriter.COMPUTE_MAXS);
+ cw.visit(V1_7, Opcodes.ACC_INTERFACE | Opcodes.ACC_ABSTRACT, ANONYMOUS_HOST_CLASS_NAME.replace('.', '/'), null, "java/lang/Object", null);
+ cw.visitEnd();
+ return cw.toByteArray();
+ }
+
+ private static Unsafe getUnsafe() {
+ return AccessController.doPrivileged(new PrivilegedAction<Unsafe>() {
+ @Override
+ public Unsafe run() {
+ try {
+ final Field theUnsafeField = Unsafe.class.getDeclaredField("theUnsafe");
+ theUnsafeField.setAccessible(true);
+ return (Unsafe)theUnsafeField.get(null);
+ } catch (final ReflectiveOperationException e) {
+ throw new RuntimeException(e);
+ }
+ }
+ });
+ }
+ }
+
/** Is Context global debug mode enabled ? */
public static final boolean DEBUG = Options.getBooleanProperty("nashorn.debug");
@@ -1294,9 +1397,15 @@
}
final URL url = source.getURL();
- final ScriptLoader loader = env._loader_per_compile ? createNewLoader() : scriptLoader;
final CodeSource cs = new CodeSource(url, (CodeSigner[])null);
- final CodeInstaller installer = new ContextCodeInstaller(this, loader, cs);
+ final CodeInstaller installer;
+ if (DISABLE_VM_ANONYMOUS_CLASSES || env._persistent_cache || !env._lazy_compilation) {
+ // Persistent code cache and eager compilation preclude use of VM anonymous classes
+ final ScriptLoader loader = env._loader_per_compile ? createNewLoader() : scriptLoader;
+ installer = new NamedContextCodeInstaller(this, cs, loader);
+ } else {
+ installer = new AnonymousContextCodeInstaller(this, cs);
+ }
if (storedScript == null) {
final CompilationPhases phases = Compiler.CompilationPhases.COMPILE_ALL;
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/Debug.java Thu Sep 17 16:53:42 2015 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/Debug.java Fri Sep 25 12:04:35 2015 -0700
@@ -26,6 +26,8 @@
package jdk.nashorn.internal.runtime;
import static jdk.nashorn.internal.parser.TokenType.EOF;
+
+import jdk.nashorn.api.scripting.NashornException;
import jdk.nashorn.internal.parser.Lexer;
import jdk.nashorn.internal.parser.Token;
import jdk.nashorn.internal.parser.TokenStream;
@@ -63,6 +65,15 @@
}
/**
+ * Return a formatted script stack trace string with frames information separated by '\n'.
+ * This is a shortcut for {@code NashornException.getScriptStackString(new Throwable())}.
+ * @return formatted stack trace string
+ */
+ public static String scriptStack() {
+ return NashornException.getScriptStackString(new Throwable());
+ }
+
+ /**
* Return the system identity hashcode for an object as a human readable
* string
*
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/NativeJavaPackage.java Thu Sep 17 16:53:42 2015 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/NativeJavaPackage.java Fri Sep 25 12:04:35 2015 -0700
@@ -206,7 +206,7 @@
}
@Override
- protected Object invokeNoSuchProperty(final String key, final int programPoint) {
+ protected Object invokeNoSuchProperty(final String key, final boolean isScope, final int programPoint) {
final Object retval = createProperty(key);
if (isValid(programPoint)) {
throw new UnwarrantedOptimismException(retval, programPoint);
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/PropertyListeners.java Thu Sep 17 16:53:42 2015 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/PropertyListeners.java Fri Sep 25 12:04:35 2015 -0700
@@ -75,16 +75,20 @@
}
/**
- * Return listeners added to this ScriptObject.
+ * Return number of listeners added to a ScriptObject.
* @param obj the object
* @return the listener count
*/
public static int getListenerCount(final ScriptObject obj) {
- final PropertyListeners propertyListeners = obj.getMap().getListeners();
- if (propertyListeners != null) {
- return propertyListeners.listeners == null ? 0 : propertyListeners.listeners.size();
- }
- return 0;
+ return obj.getMap().getListenerCount();
+ }
+
+ /**
+ * Return the number of listeners added to this PropertyListeners instance.
+ * @return the listener count;
+ */
+ public int getListenerCount() {
+ return listeners == null ? 0 : listeners.size();
}
// Property listener management methods
@@ -156,7 +160,7 @@
final WeakPropertyMapSet set = listeners.get(prop.getKey());
if (set != null) {
for (final PropertyMap propertyMap : set.elements()) {
- propertyMap.propertyAdded(prop);
+ propertyMap.propertyAdded(prop, false);
}
listeners.remove(prop.getKey());
if (Context.DEBUG) {
@@ -176,7 +180,7 @@
final WeakPropertyMapSet set = listeners.get(prop.getKey());
if (set != null) {
for (final PropertyMap propertyMap : set.elements()) {
- propertyMap.propertyDeleted(prop);
+ propertyMap.propertyDeleted(prop, false);
}
listeners.remove(prop.getKey());
if (Context.DEBUG) {
@@ -198,7 +202,7 @@
final WeakPropertyMapSet set = listeners.get(oldProp.getKey());
if (set != null) {
for (final PropertyMap propertyMap : set.elements()) {
- propertyMap.propertyModified(oldProp, newProp);
+ propertyMap.propertyModified(oldProp, newProp, false);
}
listeners.remove(oldProp.getKey());
if (Context.DEBUG) {
@@ -215,7 +219,7 @@
if (listeners != null) {
for (final WeakPropertyMapSet set : listeners.values()) {
for (final PropertyMap propertyMap : set.elements()) {
- propertyMap.protoChanged();
+ propertyMap.protoChanged(false);
}
}
listeners.clear();
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/PropertyMap.java Thu Sep 17 16:53:42 2015 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/PropertyMap.java Fri Sep 25 12:04:35 2015 -0700
@@ -54,32 +54,36 @@
* All property maps are immutable. If a property is added, modified or removed, the mutator
* will return a new map.
*/
-public final class PropertyMap implements Iterable<Object>, Serializable {
+public class PropertyMap implements Iterable<Object>, Serializable {
/** Used for non extensible PropertyMaps, negative logic as the normal case is extensible. See {@link ScriptObject#preventExtensions()} */
- public static final int NOT_EXTENSIBLE = 0b0000_0001;
+ private static final int NOT_EXTENSIBLE = 0b0000_0001;
/** Does this map contain valid array keys? */
- public static final int CONTAINS_ARRAY_KEYS = 0b0000_0010;
+ private static final int CONTAINS_ARRAY_KEYS = 0b0000_0010;
/** Map status flags. */
- private int flags;
+ private final int flags;
/** Map of properties. */
private transient PropertyHashMap properties;
/** Number of fields in use. */
- private int fieldCount;
+ private final int fieldCount;
/** Number of fields available. */
private final int fieldMaximum;
/** Length of spill in use. */
- private int spillLength;
+ private final int spillLength;
/** Structure class name */
- private String className;
+ private final String className;
+
+ /** A reference to the expected shared prototype property map. If this is set this
+ * property map should only be used if it the same as the actual prototype map. */
+ private transient SharedPropertyMap sharedProtoMap;
/** {@link SwitchPoint}s for gets on inherited properties. */
- private transient HashMap<String, SwitchPoint> protoGetSwitches;
+ private transient HashMap<String, SwitchPoint> protoSwitches;
/** History of maps, used to limit map duplication. */
private transient WeakHashMap<Property, SoftReference<PropertyMap>> history;
@@ -95,24 +99,21 @@
private static final long serialVersionUID = -7041836752008732533L;
/**
- * Constructor.
+ * Constructs a new property map.
*
* @param properties A {@link PropertyHashMap} with initial contents.
* @param fieldCount Number of fields in use.
* @param fieldMaximum Number of fields available.
* @param spillLength Number of spill slots used.
- * @param containsArrayKeys True if properties contain numeric keys
*/
- private PropertyMap(final PropertyHashMap properties, final String className, final int fieldCount,
- final int fieldMaximum, final int spillLength, final boolean containsArrayKeys) {
+ private PropertyMap(final PropertyHashMap properties, final int flags, final String className,
+ final int fieldCount, final int fieldMaximum, final int spillLength) {
this.properties = properties;
this.className = className;
this.fieldCount = fieldCount;
this.fieldMaximum = fieldMaximum;
this.spillLength = spillLength;
- if (containsArrayKeys) {
- setContainsArrayKeys();
- }
+ this.flags = flags;
if (Context.DEBUG) {
count.increment();
@@ -120,20 +121,22 @@
}
/**
- * Cloning constructor.
+ * Constructs a clone of {@code propertyMap} with changed properties, flags, or boundaries.
*
* @param propertyMap Existing property map.
* @param properties A {@link PropertyHashMap} with a new set of properties.
*/
- private PropertyMap(final PropertyMap propertyMap, final PropertyHashMap properties) {
+ private PropertyMap(final PropertyMap propertyMap, final PropertyHashMap properties, final int flags, final int fieldCount, final int spillLength) {
this.properties = properties;
- this.flags = propertyMap.flags;
- this.spillLength = propertyMap.spillLength;
- this.fieldCount = propertyMap.fieldCount;
+ this.flags = flags;
+ this.spillLength = spillLength;
+ this.fieldCount = fieldCount;
this.fieldMaximum = propertyMap.fieldMaximum;
+ this.className = propertyMap.className;
// We inherit the parent property listeners instance. It will be cloned when a new listener is added.
this.listeners = propertyMap.listeners;
this.freeSlots = propertyMap.freeSlots;
+ this.sharedProtoMap = propertyMap.sharedProtoMap;
if (Context.DEBUG) {
count.increment();
@@ -142,12 +145,12 @@
}
/**
- * Cloning constructor.
+ * Constructs an exact clone of {@code propertyMap}.
*
* @param propertyMap Existing property map.
*/
- private PropertyMap(final PropertyMap propertyMap) {
- this(propertyMap, propertyMap.properties);
+ protected PropertyMap(final PropertyMap propertyMap) {
+ this(propertyMap, propertyMap.properties, propertyMap.flags, propertyMap.fieldCount, propertyMap.spillLength);
}
private void writeObject(final ObjectOutputStream out) throws IOException {
@@ -183,7 +186,7 @@
*/
public static PropertyMap newMap(final Collection<Property> properties, final String className, final int fieldCount, final int fieldMaximum, final int spillLength) {
final PropertyHashMap newProperties = EMPTY_HASHMAP.immutableAdd(properties);
- return new PropertyMap(newProperties, className, fieldCount, fieldMaximum, spillLength, false);
+ return new PropertyMap(newProperties, 0, className, fieldCount, fieldMaximum, spillLength);
}
/**
@@ -205,7 +208,7 @@
* @return New empty {@link PropertyMap}.
*/
public static PropertyMap newMap(final Class<? extends ScriptObject> clazz) {
- return new PropertyMap(EMPTY_HASHMAP, clazz.getName(), 0, 0, 0, false);
+ return new PropertyMap(EMPTY_HASHMAP, 0, clazz.getName(), 0, 0, 0);
}
/**
@@ -227,12 +230,12 @@
}
/**
- * Get the listeners of this map, or null if none exists
+ * Get the number of listeners of this map
*
- * @return the listeners
+ * @return the number of listeners
*/
- public PropertyListeners getListeners() {
- return listeners;
+ public int getListenerCount() {
+ return listeners == null ? 0 : listeners.getListenerCount();
}
/**
@@ -253,9 +256,12 @@
* A new property is being added.
*
* @param property The new Property added.
+ * @param isSelf was the property added to this map?
*/
- public void propertyAdded(final Property property) {
- invalidateProtoGetSwitchPoint(property);
+ public void propertyAdded(final Property property, final boolean isSelf) {
+ if (!isSelf) {
+ invalidateProtoSwitchPoint(property.getKey());
+ }
if (listeners != null) {
listeners.propertyAdded(property);
}
@@ -265,9 +271,12 @@
* An existing property is being deleted.
*
* @param property The property being deleted.
+ * @param isSelf was the property deleted from this map?
*/
- public void propertyDeleted(final Property property) {
- invalidateProtoGetSwitchPoint(property);
+ public void propertyDeleted(final Property property, final boolean isSelf) {
+ if (!isSelf) {
+ invalidateProtoSwitchPoint(property.getKey());
+ }
if (listeners != null) {
listeners.propertyDeleted(property);
}
@@ -278,9 +287,12 @@
*
* @param oldProperty The old property
* @param newProperty The new property
+ * @param isSelf was the property modified on this map?
*/
- public void propertyModified(final Property oldProperty, final Property newProperty) {
- invalidateProtoGetSwitchPoint(oldProperty);
+ public void propertyModified(final Property oldProperty, final Property newProperty, final boolean isSelf) {
+ if (!isSelf) {
+ invalidateProtoSwitchPoint(oldProperty.getKey());
+ }
if (listeners != null) {
listeners.propertyModified(oldProperty, newProperty);
}
@@ -288,9 +300,15 @@
/**
* The prototype of an object associated with this {@link PropertyMap} is changed.
+ *
+ * @param isSelf was the prototype changed on the object using this map?
*/
- public void protoChanged() {
- invalidateAllProtoGetSwitchPoints();
+ public void protoChanged(final boolean isSelf) {
+ if (!isSelf) {
+ invalidateAllProtoSwitchPoints();
+ } else if (sharedProtoMap != null) {
+ sharedProtoMap.invalidateSwitchPoint();
+ }
if (listeners != null) {
listeners.protoChanged();
}
@@ -303,14 +321,14 @@
* @return A shared {@link SwitchPoint} for the property.
*/
public synchronized SwitchPoint getSwitchPoint(final String key) {
- if (protoGetSwitches == null) {
- protoGetSwitches = new HashMap<>();
+ if (protoSwitches == null) {
+ protoSwitches = new HashMap<>();
}
- SwitchPoint switchPoint = protoGetSwitches.get(key);
+ SwitchPoint switchPoint = protoSwitches.get(key);
if (switchPoint == null) {
switchPoint = new SwitchPoint();
- protoGetSwitches.put(key, switchPoint);
+ protoSwitches.put(key, switchPoint);
}
return switchPoint;
@@ -319,19 +337,17 @@
/**
* Indicate that a prototype property has changed.
*
- * @param property {@link Property} to invalidate.
+ * @param key {@link Property} key to invalidate.
*/
- synchronized void invalidateProtoGetSwitchPoint(final Property property) {
- if (protoGetSwitches != null) {
-
- final String key = property.getKey();
- final SwitchPoint sp = protoGetSwitches.get(key);
+ synchronized void invalidateProtoSwitchPoint(final String key) {
+ if (protoSwitches != null) {
+ final SwitchPoint sp = protoSwitches.get(key);
if (sp != null) {
- protoGetSwitches.remove(key);
+ protoSwitches.remove(key);
if (Context.DEBUG) {
protoInvalidations.increment();
}
- SwitchPoint.invalidateAll(new SwitchPoint[] { sp });
+ SwitchPoint.invalidateAll(new SwitchPoint[]{sp});
}
}
}
@@ -339,15 +355,15 @@
/**
* Indicate that proto itself has changed in hierarchy somewhere.
*/
- synchronized void invalidateAllProtoGetSwitchPoints() {
- if (protoGetSwitches != null) {
- final int size = protoGetSwitches.size();
+ synchronized void invalidateAllProtoSwitchPoints() {
+ if (protoSwitches != null) {
+ final int size = protoSwitches.size();
if (size > 0) {
if (Context.DEBUG) {
protoInvalidations.add(size);
}
- SwitchPoint.invalidateAll(protoGetSwitches.values().toArray(new SwitchPoint[size]));
- protoGetSwitches.clear();
+ SwitchPoint.invalidateAll(protoSwitches.values().toArray(new SwitchPoint[size]));
+ protoSwitches.clear();
}
}
}
@@ -363,7 +379,7 @@
* @return New {@link PropertyMap} with {@link Property} added.
*/
PropertyMap addPropertyBind(final AccessorProperty property, final Object bindTo) {
- // No need to store bound property in the history as bound properties can't be reused.
+ // We must not store bound property in the history as bound properties can't be reused.
return addPropertyNoHistory(new AccessorProperty(property, bindTo));
}
@@ -376,16 +392,16 @@
return property.isSpill() ? slot + fieldMaximum : slot;
}
- // Update boundaries and flags after a property has been added
- private void updateFlagsAndBoundaries(final Property newProperty) {
- if(newProperty.isSpill()) {
- spillLength = Math.max(spillLength, newProperty.getSlot() + 1);
- } else {
- fieldCount = Math.max(fieldCount, newProperty.getSlot() + 1);
- }
- if (isValidArrayIndex(getArrayIndex(newProperty.getKey()))) {
- setContainsArrayKeys();
- }
+ private int newSpillLength(final Property newProperty) {
+ return newProperty.isSpill() ? Math.max(spillLength, newProperty.getSlot() + 1) : spillLength;
+ }
+
+ private int newFieldCount(final Property newProperty) {
+ return !newProperty.isSpill() ? Math.max(fieldCount, newProperty.getSlot() + 1) : fieldCount;
+ }
+
+ private int newFlags(final Property newProperty) {
+ return isValidArrayIndex(getArrayIndex(newProperty.getKey())) ? flags | CONTAINS_ARRAY_KEYS : flags;
}
// Update the free slots bitmap for a property that has been deleted and/or added. This method is not synchronized
@@ -420,13 +436,10 @@
* @param property {@link Property} being added.
* @return New {@link PropertyMap} with {@link Property} added.
*/
- public PropertyMap addPropertyNoHistory(final Property property) {
- if (listeners != null) {
- listeners.propertyAdded(property);
- }
+ public final PropertyMap addPropertyNoHistory(final Property property) {
+ propertyAdded(property, true);
final PropertyHashMap newProperties = properties.immutableAdd(property);
- final PropertyMap newMap = new PropertyMap(this, newProperties);
- newMap.updateFlagsAndBoundaries(property);
+ final PropertyMap newMap = new PropertyMap(this, newProperties, newFlags(property), newFieldCount(property), newSpillLength(property));
newMap.updateFreeSlots(null, property);
return newMap;
@@ -439,16 +452,13 @@
*
* @return New {@link PropertyMap} with {@link Property} added.
*/
- public synchronized PropertyMap addProperty(final Property property) {
- if (listeners != null) {
- listeners.propertyAdded(property);
- }
+ public final synchronized PropertyMap addProperty(final Property property) {
+ propertyAdded(property, true);
PropertyMap newMap = checkHistory(property);
if (newMap == null) {
final PropertyHashMap newProperties = properties.immutableAdd(property);
- newMap = new PropertyMap(this, newProperties);
- newMap.updateFlagsAndBoundaries(property);
+ newMap = new PropertyMap(this, newProperties, newFlags(property), newFieldCount(property), newSpillLength(property));
newMap.updateFreeSlots(null, property);
addToHistory(property, newMap);
}
@@ -463,10 +473,8 @@
*
* @return New {@link PropertyMap} with {@link Property} removed or {@code null} if not found.
*/
- public synchronized PropertyMap deleteProperty(final Property property) {
- if (listeners != null) {
- listeners.propertyDeleted(property);
- }
+ public final synchronized PropertyMap deleteProperty(final Property property) {
+ propertyDeleted(property, true);
PropertyMap newMap = checkHistory(property);
final String key = property.getKey();
@@ -477,13 +485,13 @@
// If deleted property was last field or spill slot we can make it reusable by reducing field/slot count.
// Otherwise mark it as free in free slots bitset.
if (isSpill && slot >= 0 && slot == spillLength - 1) {
- newMap = new PropertyMap(newProperties, className, fieldCount, fieldMaximum, spillLength - 1, containsArrayKeys());
+ newMap = new PropertyMap(this, newProperties, flags, fieldCount, spillLength - 1);
newMap.freeSlots = freeSlots;
} else if (!isSpill && slot >= 0 && slot == fieldCount - 1) {
- newMap = new PropertyMap(newProperties, className, fieldCount - 1, fieldMaximum, spillLength, containsArrayKeys());
+ newMap = new PropertyMap(this, newProperties, flags, fieldCount - 1, spillLength);
newMap.freeSlots = freeSlots;
} else {
- newMap = new PropertyMap(this, newProperties);
+ newMap = new PropertyMap(this, newProperties, flags, fieldCount, spillLength);
newMap.updateFreeSlots(property, null);
}
addToHistory(property, newMap);
@@ -500,13 +508,8 @@
*
* @return New {@link PropertyMap} with {@link Property} replaced.
*/
- public PropertyMap replaceProperty(final Property oldProperty, final Property newProperty) {
- if (listeners != null) {
- listeners.propertyModified(oldProperty, newProperty);
- }
- // Add replaces existing property.
- final PropertyHashMap newProperties = properties.immutableReplace(oldProperty, newProperty);
- final PropertyMap newMap = new PropertyMap(this, newProperties);
+ public final PropertyMap replaceProperty(final Property oldProperty, final Property newProperty) {
+ propertyModified(oldProperty, newProperty, true);
/*
* See ScriptObject.modifyProperty and ScriptObject.setUserAccessors methods.
*
@@ -528,14 +531,17 @@
newProperty instanceof UserAccessorProperty :
"arbitrary replaceProperty attempted " + sameType + " oldProperty=" + oldProperty.getClass() + " newProperty=" + newProperty.getClass() + " [" + oldProperty.getLocalType() + " => " + newProperty.getLocalType() + "]";
- newMap.flags = flags;
-
/*
* spillLength remains same in case (1) and (2) because of slot reuse. Only for case (3), we need
* to add spill count of the newly added UserAccessorProperty property.
*/
+ final int newSpillLength = sameType ? spillLength : Math.max(spillLength, newProperty.getSlot() + 1);
+
+ // Add replaces existing property.
+ final PropertyHashMap newProperties = properties.immutableReplace(oldProperty, newProperty);
+ final PropertyMap newMap = new PropertyMap(this, newProperties, flags, fieldCount, newSpillLength);
+
if (!sameType) {
- newMap.spillLength = Math.max(spillLength, newProperty.getSlot() + 1);
newMap.updateFreeSlots(oldProperty, newProperty);
}
return newMap;
@@ -551,7 +557,7 @@
* @param propertyFlags attribute flags of the property
* @return the newly created UserAccessorProperty
*/
- public UserAccessorProperty newUserAccessors(final String key, final int propertyFlags) {
+ public final UserAccessorProperty newUserAccessors(final String key, final int propertyFlags) {
return new UserAccessorProperty(key, propertyFlags, getFreeSpillSlot());
}
@@ -562,7 +568,7 @@
*
* @return {@link Property} matching key.
*/
- public Property findProperty(final String key) {
+ public final Property findProperty(final String key) {
return properties.find(key);
}
@@ -573,12 +579,12 @@
*
* @return New {@link PropertyMap} with added properties.
*/
- public PropertyMap addAll(final PropertyMap other) {
+ public final PropertyMap addAll(final PropertyMap other) {
assert this != other : "adding property map to itself";
final Property[] otherProperties = other.properties.getProperties();
final PropertyHashMap newProperties = properties.immutableAdd(otherProperties);
- final PropertyMap newMap = new PropertyMap(this, newProperties);
+ final PropertyMap newMap = new PropertyMap(this, newProperties, flags, fieldCount, spillLength);
for (final Property property : otherProperties) {
// This method is only safe to use with non-slotted, native getter/setter properties
assert property.getSlot() == -1;
@@ -593,7 +599,7 @@
*
* @return Properties as an array.
*/
- public Property[] getProperties() {
+ public final Property[] getProperties() {
return properties.getProperties();
}
@@ -602,7 +608,7 @@
*
* @return class name of owner objects.
*/
- public String getClassName() {
+ public final String getClassName() {
return className;
}
@@ -612,9 +618,7 @@
* @return New map with {@link #NOT_EXTENSIBLE} flag set.
*/
PropertyMap preventExtensions() {
- final PropertyMap newMap = new PropertyMap(this);
- newMap.flags |= NOT_EXTENSIBLE;
- return newMap;
+ return new PropertyMap(this, properties, flags | NOT_EXTENSIBLE, fieldCount, spillLength);
}
/**
@@ -630,10 +634,7 @@
newProperties = newProperties.immutableAdd(oldProperty.addFlags(Property.NOT_CONFIGURABLE));
}
- final PropertyMap newMap = new PropertyMap(this, newProperties);
- newMap.flags |= NOT_EXTENSIBLE;
-
- return newMap;
+ return new PropertyMap(this, newProperties, flags | NOT_EXTENSIBLE, fieldCount, spillLength);
}
/**
@@ -655,10 +656,7 @@
newProperties = newProperties.immutableAdd(oldProperty.addFlags(propertyFlags));
}
- final PropertyMap newMap = new PropertyMap(this, newProperties);
- newMap.flags |= NOT_EXTENSIBLE;
-
- return newMap;
+ return new PropertyMap(this, newProperties, flags | NOT_EXTENSIBLE, fieldCount, spillLength);
}
/**
@@ -830,13 +828,6 @@
}
/**
- * Flag this object as having array keys in defined properties
- */
- private void setContainsArrayKeys() {
- flags |= CONTAINS_ARRAY_KEYS;
- }
-
- /**
* Test to see if {@link PropertyMap} is extensible.
*
* @return {@code true} if {@link PropertyMap} can be added to.
@@ -914,12 +905,72 @@
setProtoNewMapCount.increment();
}
- final PropertyMap newMap = new PropertyMap(this);
+ final PropertyMap newMap = makeUnsharedCopy();
addToProtoHistory(newProto, newMap);
return newMap;
}
+ /**
+ * Make a copy of this property map with the shared prototype field set to null. Note that this is
+ * only necessary for shared maps of top-level objects. Shared prototype maps represented by
+ * {@link SharedPropertyMap} are automatically converted to plain property maps when they evolve.
+ *
+ * @return a copy with the shared proto map unset
+ */
+ PropertyMap makeUnsharedCopy() {
+ final PropertyMap newMap = new PropertyMap(this);
+ newMap.sharedProtoMap = null;
+ return newMap;
+ }
+
+ /**
+ * Set a reference to the expected parent prototype map. This is used for class-like
+ * structures where we only want to use a top-level property map if all of the
+ * prototype property maps have not been modified.
+ *
+ * @param protoMap weak reference to the prototype property map
+ */
+ void setSharedProtoMap(final SharedPropertyMap protoMap) {
+ sharedProtoMap = protoMap;
+ }
+
+ /**
+ * Get the expected prototype property map if it is known, or null.
+ *
+ * @return parent map or null
+ */
+ public PropertyMap getSharedProtoMap() {
+ return sharedProtoMap;
+ }
+
+ /**
+ * Returns {@code true} if this map has been used as a shared prototype map (i.e. as a prototype
+ * for a JavaScript constructor function) and has not had properties added, deleted or replaced since then.
+ * @return true if this is a valid shared prototype map
+ */
+ boolean isValidSharedProtoMap() {
+ return false;
+ }
+
+ /**
+ * Returns the shared prototype switch point, or null if this is not a shared prototype map.
+ * @return the shared prototype switch point, or null
+ */
+ SwitchPoint getSharedProtoSwitchPoint() {
+ return null;
+ }
+
+ /**
+ * Return true if this map has a shared prototype map which has either been invalidated or does
+ * not match the map of {@code proto}.
+ * @param prototype the prototype object
+ * @return true if this is an invalid shared map for {@code prototype}
+ */
+ boolean isInvalidSharedMapFor(final ScriptObject prototype) {
+ return sharedProtoMap != null
+ && (!sharedProtoMap.isValidSharedProtoMap() || prototype == null || sharedProtoMap != prototype.getMap());
+ }
/**
* {@link PropertyMap} iterator.
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/RecompilableScriptFunctionData.java Thu Sep 17 16:53:42 2015 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/RecompilableScriptFunctionData.java Fri Sep 25 12:04:35 2015 -0700
@@ -368,8 +368,8 @@
}
@Override
- PropertyMap getAllocatorMap() {
- return allocationStrategy.getAllocatorMap();
+ PropertyMap getAllocatorMap(final ScriptObject prototype) {
+ return allocationStrategy.getAllocatorMap(prototype);
}
@Override
@@ -649,7 +649,7 @@
*/
private CodeInstaller getInstallerForNewCode() {
final ScriptEnvironment env = installer.getContext().getEnv();
- return env._optimistic_types || env._loader_per_compile ? installer.withNewLoader() : installer;
+ return env._optimistic_types || env._loader_per_compile ? installer.getOnDemandCompilationInstaller() : installer;
}
Compiler getCompiler(final FunctionNode functionNode, final MethodType actualCallSiteType,
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/ScriptFunction.java Thu Sep 17 16:53:42 2015 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/ScriptFunction.java Fri Sep 25 12:04:35 2015 -0700
@@ -521,35 +521,39 @@
assert !isBoundFunction(); // allocate never invoked on bound functions
- final ScriptObject object = data.allocate(getAllocatorMap());
+ final ScriptObject prototype = getAllocatorPrototype();
+ final ScriptObject object = data.allocate(getAllocatorMap(prototype));
if (object != null) {
- final Object prototype = getPrototype();
- if (prototype instanceof ScriptObject) {
- object.setInitialProto((ScriptObject) prototype);
- }
-
- if (object.getProto() == null) {
- object.setInitialProto(getObjectPrototype());
- }
+ object.setInitialProto(prototype);
}
return object;
}
- private PropertyMap getAllocatorMap() {
- if (allocatorMap == null) {
- allocatorMap = data.getAllocatorMap();
+ /**
+ * Get the property map used by "allocate"
+ * @param prototype actual prototype object
+ * @return property map
+ */
+ private synchronized PropertyMap getAllocatorMap(final ScriptObject prototype) {
+ if (allocatorMap == null || allocatorMap.isInvalidSharedMapFor(prototype)) {
+ // The prototype map has changed since this function was last used as constructor.
+ // Get a new allocator map.
+ allocatorMap = data.getAllocatorMap(prototype);
}
return allocatorMap;
}
/**
- * Return Object.prototype - used by "allocate"
- *
- * @return Object.prototype
+ * Return the actual prototype used by "allocate"
+ * @return allocator prototype
*/
- protected final ScriptObject getObjectPrototype() {
+ private ScriptObject getAllocatorPrototype() {
+ final Object prototype = getPrototype();
+ if (prototype instanceof ScriptObject) {
+ return (ScriptObject) prototype;
+ }
return Global.objectPrototype();
}
@@ -591,10 +595,10 @@
*
* @param newPrototype new prototype object
*/
- public final void setPrototype(Object newPrototype) {
+ public synchronized final void setPrototype(final Object newPrototype) {
if (newPrototype instanceof ScriptObject && newPrototype != this.prototype && allocatorMap != null) {
- // Replace our current allocator map with one that is associated with the new prototype.
- allocatorMap = allocatorMap.changeProto((ScriptObject) newPrototype);
+ // Unset allocator map to be replaced with one matching the new prototype.
+ allocatorMap = null;
}
this.prototype = newPrototype;
}
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/ScriptFunctionData.java Thu Sep 17 16:53:42 2015 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/ScriptFunctionData.java Fri Sep 25 12:04:35 2015 -0700
@@ -389,9 +389,10 @@
/**
* Get the property map to use for objects allocated by this function.
*
+ * @param prototype the prototype of the allocated object
* @return the property map for allocated objects.
*/
- PropertyMap getAllocatorMap() {
+ PropertyMap getAllocatorMap(final ScriptObject prototype) {
return null;
}
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/ScriptObject.java Thu Sep 17 16:53:42 2015 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/ScriptObject.java Fri Sep 25 12:04:35 2015 -0700
@@ -149,7 +149,7 @@
/** Method handle to retrieve prototype of this object */
public static final MethodHandle GETPROTO = findOwnMH_V("getProto", ScriptObject.class);
- static final MethodHandle MEGAMORPHIC_GET = findOwnMH_V("megamorphicGet", Object.class, String.class, boolean.class);
+ static final MethodHandle MEGAMORPHIC_GET = findOwnMH_V("megamorphicGet", Object.class, String.class, boolean.class, boolean.class);
static final MethodHandle GLOBALFILTER = findOwnMH_S("globalFilter", Object.class, Object.class);
static final MethodHandle DECLARE_AND_SET = findOwnMH_V("declareAndSet", void.class, String.class, Object.class);
@@ -809,9 +809,11 @@
if (deep) {
final ScriptObject myProto = getProto();
- if (myProto != null) {
- return myProto.findProperty(key, deep, start);
- }
+ final FindProperty find = myProto == null ? null : myProto.findProperty(key, true, start);
+ // checkSharedProtoMap must be invoked after myProto.checkSharedProtoMap to propagate
+ // shared proto invalidation up the prototype chain. It also must be invoked when prototype is null.
+ checkSharedProtoMap();
+ return find;
}
return null;
@@ -832,7 +834,7 @@
if (deep) {
final ScriptObject myProto = getProto();
if (myProto != null) {
- return myProto.hasProperty(key, deep);
+ return myProto.hasProperty(key, true);
}
}
@@ -1258,11 +1260,8 @@
if (oldProto != newProto) {
proto = newProto;
- // Let current listeners know that the prototype has changed and set our map
- final PropertyListeners listeners = getMap().getListeners();
- if (listeners != null) {
- listeners.protoChanged();
- }
+ // Let current listeners know that the prototype has changed
+ getMap().protoChanged(true);
// Replace our current allocator map with one that is associated with the new prototype.
setMap(getMap().changeProto(newProto));
}
@@ -1314,7 +1313,7 @@
}
p = p.getProto();
}
- setProto((ScriptObject)newProto);
+ setProto((ScriptObject) newProto);
} else {
throw typeError("cant.set.proto.to.non.object", ScriptRuntime.safeToString(this), ScriptRuntime.safeToString(newProto));
}
@@ -2012,11 +2011,11 @@
final ScriptObject owner = find.getOwner();
final Class<ClassCastException> exception = explicitInstanceOfCheck ? null : ClassCastException.class;
- final SwitchPoint protoSwitchPoint;
+ final SwitchPoint[] protoSwitchPoints;
if (mh == null) {
mh = Lookup.emptyGetter(returnType);
- protoSwitchPoint = getProtoSwitchPoint(name, owner);
+ protoSwitchPoints = getProtoSwitchPoints(name, owner);
} else if (!find.isSelf()) {
assert mh.type().returnType().equals(returnType) :
"return type mismatch for getter " + mh.type().returnType() + " != " + returnType;
@@ -2024,30 +2023,30 @@
// Add a filter that replaces the self object with the prototype owning the property.
mh = addProtoFilter(mh, find.getProtoChainLength());
}
- protoSwitchPoint = getProtoSwitchPoint(name, owner);
+ protoSwitchPoints = getProtoSwitchPoints(name, owner);
} else {
- protoSwitchPoint = null;
+ protoSwitchPoints = null;
}
- final GuardedInvocation inv = new GuardedInvocation(mh, guard, protoSwitchPoint, exception);
+ final GuardedInvocation inv = new GuardedInvocation(mh, guard, protoSwitchPoints, exception);
return inv.addSwitchPoint(findBuiltinSwitchPoint(name));
}
private static GuardedInvocation findMegaMorphicGetMethod(final CallSiteDescriptor desc, final String name, final boolean isMethod) {
Context.getContextTrusted().getLogger(ObjectClassGenerator.class).warning("Megamorphic getter: " + desc + " " + name + " " +isMethod);
- final MethodHandle invoker = MH.insertArguments(MEGAMORPHIC_GET, 1, name, isMethod);
+ final MethodHandle invoker = MH.insertArguments(MEGAMORPHIC_GET, 1, name, isMethod, NashornCallSiteDescriptor.isScope(desc));
final MethodHandle guard = getScriptObjectGuard(desc.getMethodType(), true);
return new GuardedInvocation(invoker, guard);
}
@SuppressWarnings("unused")
- private Object megamorphicGet(final String key, final boolean isMethod) {
+ private Object megamorphicGet(final String key, final boolean isMethod, final boolean isScope) {
final FindProperty find = findProperty(key, true);
if (find != null) {
return find.getObjectValue();
}
- return isMethod ? getNoSuchMethod(key, INVALID_PROGRAM_POINT) : invokeNoSuchProperty(key, INVALID_PROGRAM_POINT);
+ return isMethod ? getNoSuchMethod(key, isScope, INVALID_PROGRAM_POINT) : invokeNoSuchProperty(key, isScope, INVALID_PROGRAM_POINT);
}
// Marks a property as declared and sets its value. Used as slow path for block-scoped LET and CONST
@@ -2128,17 +2127,32 @@
* @param owner the property owner, null if property is not defined
* @return a SwitchPoint or null
*/
- public final SwitchPoint getProtoSwitchPoint(final String name, final ScriptObject owner) {
+ public final SwitchPoint[] getProtoSwitchPoints(final String name, final ScriptObject owner) {
if (owner == this || getProto() == null) {
return null;
}
+ final List<SwitchPoint> switchPoints = new ArrayList<>();
for (ScriptObject obj = this; obj != owner && obj.getProto() != null; obj = obj.getProto()) {
final ScriptObject parent = obj.getProto();
parent.getMap().addListener(name, obj.getMap());
+ final SwitchPoint sp = parent.getMap().getSharedProtoSwitchPoint();
+ if (sp != null && !sp.hasBeenInvalidated()) {
+ switchPoints.add(sp);
+ }
}
- return getMap().getSwitchPoint(name);
+ switchPoints.add(getMap().getSwitchPoint(name));
+ return switchPoints.toArray(new SwitchPoint[switchPoints.size()]);
+ }
+
+ private void checkSharedProtoMap() {
+ // Check if our map has an expected shared prototype property map. If it has, make sure that
+ // the prototype map has not been invalidated, and that it does match the actual map of the prototype.
+ if (getMap().isInvalidSharedMapFor(getProto())) {
+ // Change our own map to one that does not assume a shared prototype map.
+ setMap(getMap().makeUnsharedCopy());
+ }
}
/**
@@ -2220,7 +2234,7 @@
return new GuardedInvocation(
Lookup.EMPTY_SETTER,
NashornGuards.getMapGuard(getMap(), explicitInstanceOfCheck),
- getProtoSwitchPoint(name, null),
+ getProtoSwitchPoints(name, null),
explicitInstanceOfCheck ? null : ClassCastException.class);
}
@@ -2366,7 +2380,7 @@
find.getGetter(Object.class, INVALID_PROGRAM_POINT, request),
find.getProtoChainLength(),
func),
- getProtoSwitchPoint(NO_SUCH_PROPERTY_NAME, find.getOwner()),
+ getProtoSwitchPoints(NO_SUCH_PROPERTY_NAME, find.getOwner()),
//TODO this doesn't need a ClassCastException as guard always checks script object
null);
}
@@ -2382,20 +2396,21 @@
/**
* Invoke fall back if a property is not found.
* @param name Name of property.
+ * @param isScope is this a scope access?
* @param programPoint program point
* @return Result from call.
*/
- protected Object invokeNoSuchProperty(final String name, final int programPoint) {
+ protected Object invokeNoSuchProperty(final String name, final boolean isScope, final int programPoint) {
final FindProperty find = findProperty(NO_SUCH_PROPERTY_NAME, true);
+ final Object func = (find != null)? find.getObjectValue() : null;
Object ret = UNDEFINED;
-
- if (find != null) {
- final Object func = find.getObjectValue();
-
- if (func instanceof ScriptFunction) {
- ret = ScriptRuntime.apply((ScriptFunction)func, this, name);
- }
+ if (func instanceof ScriptFunction) {
+ final ScriptFunction sfunc = (ScriptFunction)func;
+ final Object self = isScope && sfunc.isStrict()? UNDEFINED : this;
+ ret = ScriptRuntime.apply(sfunc, self, name);
+ } else if (isScope) {
+ throw referenceError("not.defined", name);
}
if (isValid(programPoint)) {
@@ -2409,21 +2424,27 @@
/**
* Get __noSuchMethod__ as a function bound to this object and {@code name} if it is defined.
* @param name the method name
+ * @param isScope is this a scope access?
* @return the bound function, or undefined
*/
- private Object getNoSuchMethod(final String name, final int programPoint) {
+ private Object getNoSuchMethod(final String name, final boolean isScope, final int programPoint) {
final FindProperty find = findProperty(NO_SUCH_METHOD_NAME, true);
if (find == null) {
- return invokeNoSuchProperty(name, programPoint);
+ return invokeNoSuchProperty(name, isScope, programPoint);
}
final Object value = find.getObjectValue();
if (!(value instanceof ScriptFunction)) {
+ if (isScope) {
+ throw referenceError("not.defined", name);
+ }
return UNDEFINED;
}
- return ((ScriptFunction)value).createBound(this, new Object[] {name});
+ final ScriptFunction func = (ScriptFunction)value;
+ final Object self = isScope && func.isStrict()? UNDEFINED : this;
+ return func.createBound(self, new Object[] {name});
}
private GuardedInvocation createEmptyGetter(final CallSiteDescriptor desc, final boolean explicitInstanceOfCheck, final String name) {
@@ -2432,7 +2453,7 @@
}
return new GuardedInvocation(Lookup.emptyGetter(desc.getMethodType().returnType()),
- NashornGuards.getMapGuard(getMap(), explicitInstanceOfCheck), getProtoSwitchPoint(name, null),
+ NashornGuards.getMapGuard(getMap(), explicitInstanceOfCheck), getProtoSwitchPoints(name, null),
explicitInstanceOfCheck ? null : ClassCastException.class);
}
@@ -2738,7 +2759,7 @@
}
}
- return JSType.toInt32(invokeNoSuchProperty(key, programPoint));
+ return JSType.toInt32(invokeNoSuchProperty(key, false, programPoint));
}
@Override
@@ -2820,7 +2841,7 @@
}
}
- return JSType.toLong(invokeNoSuchProperty(key, programPoint));
+ return JSType.toLong(invokeNoSuchProperty(key, false, programPoint));
}
@Override
@@ -2902,7 +2923,7 @@
}
}
- return JSType.toNumber(invokeNoSuchProperty(key, INVALID_PROGRAM_POINT));
+ return JSType.toNumber(invokeNoSuchProperty(key, false, INVALID_PROGRAM_POINT));
}
@Override
@@ -2983,7 +3004,7 @@
}
}
- return invokeNoSuchProperty(key, INVALID_PROGRAM_POINT);
+ return invokeNoSuchProperty(key, false, INVALID_PROGRAM_POINT);
}
@Override
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/SetMethodCreator.java Thu Sep 17 16:53:42 2015 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/SetMethodCreator.java Fri Sep 25 12:04:35 2015 -0700
@@ -186,10 +186,7 @@
private SetMethod createNewPropertySetter(final SwitchPoint builtinSwitchPoint) {
final SetMethod sm = map.getFreeFieldSlot() > -1 ? createNewFieldSetter(builtinSwitchPoint) : createNewSpillPropertySetter(builtinSwitchPoint);
- final PropertyListeners listeners = map.getListeners();
- if (listeners != null) {
- listeners.propertyAdded(sm.property);
- }
+ map.propertyAdded(sm.property, true);
return sm;
}
@@ -204,7 +201,7 @@
//fast type specific setter
final MethodHandle fastSetter = property.getSetter(type, newMap); //0 sobj, 1 value, slot folded for spill property already
- //slow setter, that calls ScriptObject.set with appropraite type and key name
+ //slow setter, that calls ScriptObject.set with appropriate type and key name
MethodHandle slowSetter = ScriptObject.SET_SLOW[getAccessorTypeIndex(type)];
slowSetter = MH.insertArguments(slowSetter, 3, NashornCallSiteDescriptor.getFlags(desc));
slowSetter = MH.insertArguments(slowSetter, 1, name);
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/SharedPropertyMap.java Fri Sep 25 12:04:35 2015 -0700
@@ -0,0 +1,100 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package jdk.nashorn.internal.runtime;
+
+import java.lang.invoke.SwitchPoint;
+
+/**
+ * This class represents a property map that can be shared among multiple prototype objects, allowing all inheriting
+ * top-level objects to also share one property map. This is class is only used for prototype objects, the
+ * top-level objects use ordinary {@link PropertyMap}s with the {@link PropertyMap#sharedProtoMap} field
+ * set to the expected shared prototype map.
+ *
+ * <p>When an instance of this class is evolved because a property is added, removed, or modified in an object
+ * using it, the {@link #invalidateSwitchPoint()} method is invoked to signal to all callsites and inheriting
+ * objects that the assumption of a single shared prototype map is no longer valid. The property map resulting
+ * from the modification will no longer be an instance of this class.</p>
+ */
+public final class SharedPropertyMap extends PropertyMap {
+
+ private SwitchPoint switchPoint;
+
+ private static final long serialVersionUID = 2166297719721778876L;
+
+ /**
+ * Create a new shared property map from the given {@code map}.
+ * @param map property map to copy
+ */
+ public SharedPropertyMap(final PropertyMap map) {
+ super(map);
+ this.switchPoint = new SwitchPoint();
+ }
+
+ @Override
+ public void propertyAdded(final Property property, final boolean isSelf) {
+ if (isSelf) {
+ invalidateSwitchPoint();
+ }
+ super.propertyAdded(property, isSelf);
+ }
+
+ @Override
+ public void propertyDeleted(final Property property, final boolean isSelf) {
+ if (isSelf) {
+ invalidateSwitchPoint();
+ }
+ super.propertyDeleted(property, isSelf);
+ }
+
+ @Override
+ public void propertyModified(final Property oldProperty, final Property newProperty, final boolean isSelf) {
+ if (isSelf) {
+ invalidateSwitchPoint();
+ }
+ super.propertyModified(oldProperty, newProperty, isSelf);
+ }
+
+ @Override
+ synchronized boolean isValidSharedProtoMap() {
+ return switchPoint != null;
+ }
+
+ @Override
+ synchronized SwitchPoint getSharedProtoSwitchPoint() {
+ return switchPoint;
+ }
+
+ /**
+ * Invalidate the shared prototype switch point if this is a shared prototype map.
+ */
+ synchronized void invalidateSwitchPoint() {
+ if (switchPoint != null) {
+ assert !switchPoint.hasBeenInvalidated();
+ SwitchPoint.invalidateAll(new SwitchPoint[]{ switchPoint });
+ switchPoint = null;
+ }
+ }
+}
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/Timing.java Thu Sep 17 16:53:42 2015 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/Timing.java Fri Sep 25 12:04:35 2015 -0700
@@ -220,19 +220,20 @@
}
final long total = t - startTime;
- sb.append('\n');
- sb.append("Total runtime: ").
+ return sb.append("\nTotal runtime: ").
append(toMillisPrint(total)).
append(" ms (Non-runtime: ").
append(toMillisPrint(knownTime)).
append(" ms [").
append((int)(knownTime * 100.0 / total)).
- append("%])");
-
- sb.append("\n\nEmitted compile units: ").
- append(CompileUnit.getEmittedUnitCount());
-
- return sb.toString();
+ append("%])").
+ append("\n\nEmitted compile units: ").
+ append(CompileUnit.getEmittedUnitCount()).
+ append("\nCompile units installed as named classes: ").
+ append(Context.getNamedInstalledScriptCount()).
+ append("\nCompile units installed as anonymous classes: ").
+ append(Context.getAnonymousInstalledScriptCount()).
+ toString();
}
private void accumulateTime(final String module, final long duration) {
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/WithObject.java Thu Sep 17 16:53:42 2015 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/WithObject.java Fri Sep 25 12:04:35 2015 -0700
@@ -26,6 +26,7 @@
package jdk.nashorn.internal.runtime;
import static jdk.nashorn.internal.lookup.Lookup.MH;
+import static jdk.nashorn.internal.runtime.ScriptRuntime.UNDEFINED;
import java.lang.invoke.MethodHandle;
import java.lang.invoke.MethodHandles;
@@ -45,7 +46,7 @@
*
*/
public final class WithObject extends Scope {
- private static final MethodHandle WITHEXPRESSIONGUARD = findOwnMH("withExpressionGuard", boolean.class, Object.class, PropertyMap.class, SwitchPoint.class);
+ private static final MethodHandle WITHEXPRESSIONGUARD = findOwnMH("withExpressionGuard", boolean.class, Object.class, PropertyMap.class, SwitchPoint[].class);
private static final MethodHandle WITHEXPRESSIONFILTER = findOwnMH("withFilterExpression", Object.class, Object.class);
private static final MethodHandle WITHSCOPEFILTER = findOwnMH("withFilterScope", Object.class, Object.class);
private static final MethodHandle BIND_TO_EXPRESSION_OBJ = findOwnMH("bindToExpression", Object.class, Object.class, Object.class);
@@ -209,16 +210,18 @@
}
@Override
- protected Object invokeNoSuchProperty(final String name, final int programPoint) {
+ protected Object invokeNoSuchProperty(final String name, final boolean isScope, final int programPoint) {
FindProperty find = expression.findProperty(NO_SUCH_PROPERTY_NAME, true);
if (find != null) {
final Object func = find.getObjectValue();
if (func instanceof ScriptFunction) {
- return ScriptRuntime.apply((ScriptFunction)func, expression, name);
+ final ScriptFunction sfunc = (ScriptFunction)func;
+ final Object self = isScope && sfunc.isStrict()? UNDEFINED : expression;
+ return ScriptRuntime.apply(sfunc, self, name);
}
}
- return getProto().invokeNoSuchProperty(name, programPoint);
+ return getProto().invokeNoSuchProperty(name, isScope, programPoint);
}
@Override
@@ -357,13 +360,24 @@
private MethodHandle expressionGuard(final String name, final ScriptObject owner) {
final PropertyMap map = expression.getMap();
- final SwitchPoint sp = expression.getProtoSwitchPoint(name, owner);
+ final SwitchPoint[] sp = expression.getProtoSwitchPoints(name, owner);
return MH.insertArguments(WITHEXPRESSIONGUARD, 1, map, sp);
}
@SuppressWarnings("unused")
- private static boolean withExpressionGuard(final Object receiver, final PropertyMap map, final SwitchPoint sp) {
- return ((WithObject)receiver).expression.getMap() == map && (sp == null || !sp.hasBeenInvalidated());
+ private static boolean withExpressionGuard(final Object receiver, final PropertyMap map, final SwitchPoint[] sp) {
+ return ((WithObject)receiver).expression.getMap() == map && !hasBeenInvalidated(sp);
+ }
+
+ private static boolean hasBeenInvalidated(final SwitchPoint[] switchPoints) {
+ if (switchPoints != null) {
+ for (final SwitchPoint switchPoint : switchPoints) {
+ if (switchPoint.hasBeenInvalidated()) {
+ return true;
+ }
+ }
+ }
+ return false;
}
/**
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/resources/Messages.properties Thu Sep 17 16:53:42 2015 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/resources/Messages.properties Fri Sep 25 12:04:35 2015 -0700
@@ -150,6 +150,7 @@
type.error.method.not.constructor=Java method {0} cannot be used as a constructor.
type.error.env.not.object=$ENV must be an Object.
type.error.unsupported.java.to.type=Unsupported Java.to target type {0}.
+type.error.java.array.conversion.failed=Java.to conversion to array type {0} failed
type.error.constructor.requires.new=Constructor {0} requires "new".
type.error.new.on.nonpublic.javatype=new cannot be used with non-public java type {0}.
--- a/nashorn/test/script/basic/JDK-8044750.js Thu Sep 17 16:53:42 2015 +0200
+++ b/nashorn/test/script/basic/JDK-8044750.js Fri Sep 25 12:04:35 2015 -0700
@@ -25,6 +25,8 @@
* JDK-8044750: megamorphic getter for scope objects does not call __noSuchProperty__ hook
*
* @test
+ * @fork
+ * @option -Dnashorn.unstable.relink.threshold=16
* @run
*/
@@ -40,7 +42,9 @@
}
}
-for (var i = 0; i < 20; i++) {
+var LIMIT = 20; // should be more than megamorphic threshold set via @option
+
+for (var i = 0; i < LIMIT; i++) {
var obj = {};
obj.foo = i;
obj[i] = i;
@@ -51,3 +55,30 @@
// callsite inside func should see __noSuchProperty__
// hook on global scope object.
func({});
+
+function checkFoo() {
+ with({}) {
+ try {
+ foo;
+ return true;
+ } catch (e) {
+ return false;
+ }
+ }
+}
+
+var oldNoSuchProperty = this.__noSuchProperty__;
+delete this.__noSuchProperty__;
+
+// keep deleting/restorting __noSuchProperty__ alternatively
+// to make "foo" access in checkFoo function megamorphic!
+
+for (var i = 0; i < LIMIT; i++) {
+ // no __noSuchProperty__ and 'with' scope object has no 'foo'
+ delete __noSuchProperty__;
+ Assert.assertFalse(checkFoo(), "Expected false in iteration " + i);
+
+ // __noSuchProperty__ is exists but 'with' scope object has no 'foo'
+ this.__noSuchProperty__ = oldNoSuchProperty;
+ Assert.assertTrue(checkFoo(), "Expected true in iteration " + i);
+}
--- a/nashorn/test/script/basic/JDK-8134569.js Thu Sep 17 16:53:42 2015 +0200
+++ b/nashorn/test/script/basic/JDK-8134569.js Fri Sep 25 12:04:35 2015 -0700
@@ -62,67 +62,146 @@
return new C();
}
+function createDeeper() {
+ function C() {
+ this.i1 = 1;
+ this.i2 = 2;
+ this.i3 = 3;
+ return this;
+ }
+ function D() {
+ this.p1 = 1;
+ this.p2 = 2;
+ this.p3 = 3;
+ return this;
+ }
+ function E() {
+ this.e1 = 1;
+ this.e2 = 2;
+ this.e3 = 3;
+ return this;
+ }
+ D.prototype = new E();
+ C.prototype = new D();
+ return new C();
+}
+
function createEval() {
return eval("Object.create({})");
}
function p(o) { print(o.x) }
-var a, b;
+function e(o) { print(o.e1) }
+
+var a, b, c;
create();
a = create();
b = create();
+c = create();
a.__proto__.x = 123;
p(a);
p(b);
+p(c);
a = create();
b = create();
+c = create();
b.__proto__.x = 123;
p(a);
p(b);
+p(c);
a = createEmpty();
b = createEmpty();
+c = createEmpty();
a.__proto__.x = 123;
p(a);
p(b);
+p(c);
a = createEmpty();
b = createEmpty();
+c = createEmpty();
b.__proto__.x = 123;
p(a);
p(b);
+p(c);
a = createDeep();
b = createDeep();
+c = createDeep();
a.__proto__.__proto__.x = 123;
p(a);
p(b);
+p(c);
a = createDeep();
b = createDeep();
+c = createDeep();
b.__proto__.__proto__.x = 123;
p(a);
p(b);
+p(c);
+
+a = createDeeper();
+b = createDeeper();
+c = createDeeper();
+a.__proto__.__proto__.__proto__.x = 123;
+
+p(a);
+p(b);
+p(c);
+
+a = createDeeper();
+b = createDeeper();
+c = createDeeper();
+b.__proto__.__proto__.__proto__.x = 123;
+
+p(a);
+p(b);
+p(c);
+
+a = createDeeper();
+b = createDeeper();
+c = createDeeper();
+a.__proto__.__proto__ = null;
+
+e(a);
+e(b);
+e(c);
+
+a = createDeeper();
+b = createDeeper();
+c = createDeeper();
+b.__proto__.__proto__ = null;
+
+e(a);
+e(b);
+e(c);
+
a = createEval();
b = createEval();
+c = createEval();
a.__proto__.x = 123;
p(a);
p(b);
+p(c);
a = createEval();
b = createEval();
+c = createEval();
b.__proto__.x = 123;
p(a);
p(b);
+p(c);
--- a/nashorn/test/script/basic/JDK-8134569.js.EXPECTED Thu Sep 17 16:53:42 2015 +0200
+++ b/nashorn/test/script/basic/JDK-8134569.js.EXPECTED Fri Sep 25 12:04:35 2015 -0700
@@ -1,16 +1,36 @@
123
undefined
undefined
+undefined
123
+undefined
123
undefined
undefined
+undefined
+123
+undefined
+123
+undefined
+undefined
+undefined
123
+undefined
123
undefined
undefined
+undefined
123
+undefined
+undefined
+1
+1
+1
+undefined
+1
123
undefined
undefined
+undefined
123
+undefined
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8134609.js Fri Sep 25 12:04:35 2015 -0700
@@ -0,0 +1,95 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * 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-8134609: Allow constructors with same prototoype map to share the allocator map
+ *
+ * @test
+ * @run
+ * @fork
+ * @option -Dnashorn.debug
+ */
+
+function createProto(members) {
+ function P() {
+ for (var id in members) {
+ if (members.hasOwnProperty(id)) {
+ this[id] = members[id];
+ }
+ }
+ return this;
+ }
+ return new P();
+}
+
+function createSubclass(prototype, members) {
+ function C() {
+ for (var id in members) {
+ if (members.hasOwnProperty(id)) {
+ this[id] = members[id];
+ }
+ }
+ return this;
+ }
+
+ C.prototype = prototype;
+
+ return new C();
+}
+
+function assertP1(object, value) {
+ Assert.assertTrue(object.p1 === value);
+}
+
+// First prototype will have non-shared proto-map. Second and third will be shared.
+var proto0 = createProto({p1: 0, p2: 1});
+var proto1 = createProto({p1: 1, p2: 2});
+var proto2 = createProto({p1: 2, p2: 3});
+
+Assert.assertTrue(Debug.map(proto1) === Debug.map(proto2));
+
+assertP1(proto1, 1);
+assertP1(proto2, 2);
+
+// First instantiation will have a non-shared prototype map, from the second one
+// maps will be shared until a different proto map comes along.
+var child0 = createSubclass(proto1, {c1: 1, c2: 2});
+var child1 = createSubclass(proto2, {c1: 2, c2: 3});
+var child2 = createSubclass(proto1, {c1: 3, c2: 4});
+var child3 = createSubclass(proto2, {c1: 1, c2: 2});
+var child4 = createSubclass(proto0, {c1: 3, c2: 2});
+
+Assert.assertTrue(Debug.map(child1) === Debug.map(child2));
+Assert.assertTrue(Debug.map(child1) === Debug.map(child3));
+Assert.assertTrue(Debug.map(child3) !== Debug.map(child4));
+
+assertP1(child1, 2);
+assertP1(child2, 1);
+assertP1(child3, 2);
+assertP1(child4, 0);
+
+Assert.assertTrue(delete proto2.p1);
+
+assertP1(child3, undefined);
+assertP1(child2, 1);
+Assert.assertTrue(Debug.map(child1) !== Debug.map(child3));
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8136544.js Fri Sep 25 12:04:35 2015 -0700
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * 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-8136544: Call site switching to megamorphic causes incorrect property read
+ *
+ * @test
+ * @fork
+ * @option -Dnashorn.unstable.relink.threshold=8
+ * @run
+ */
+
+var ScriptContext = Java.type("javax.script.ScriptContext");
+var ScriptEngineManager = Java.type("javax.script.ScriptEngineManager");
+var m = new ScriptEngineManager();
+var e = m.getEngineByName("nashorn");
+
+var scope = e.getBindings(ScriptContext.ENGINE_SCOPE);
+var MYVAR = "myvar";
+
+function loopupVar() {
+ try {
+ e.eval(MYVAR);
+ return true;
+ } catch (e) {
+ return false;
+ }
+}
+
+// make sure we exercise callsite beyond megamorphic threshold we set
+// in this test via nashorn.unstable.relink.threshold property
+// In each iteration, callsite is exercised twice (two evals)
+// So, LIMIT should be more than 4 to exercise megamorphic callsites.
+
+var LIMIT = 5; // This LIMIT should be more than 4
+
+for (var i = 0; i < LIMIT; i++) {
+ // remove the variable and lookup
+ delete scope[MYVAR];
+ Assert.assertFalse(loopupVar(), "Expected true in iteration " + i);
+
+ // set that variable and check again
+ scope[MYVAR] = "foo";
+ Assert.assertTrue(loopupVar(), "Expected false in iteration " + i);
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8136694.js Fri Sep 25 12:04:35 2015 -0700
@@ -0,0 +1,74 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * 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-8136694: Megemorphic scope access does not throw ReferenceError when property is missing
+ *
+ * @test
+ * @fork
+ * @option -Dnashorn.unstable.relink.threshold=16
+ * @run
+ */
+
+function checkFoo() {
+ try {
+ // The 'foo' access becomes megamorphic
+ foo;
+ return true;
+ } catch (e) {
+ return false;
+ }
+}
+
+
+// Similar check for 'with' blocks as well.
+function checkFooInWith() {
+ with({}) {
+ try {
+ // The 'foo' access becomes megamorphic
+ foo;
+ return true;
+ } catch (e) {
+ return false;
+ }
+ }
+}
+
+function loop(checker) {
+ // LIMIT has to be more than the megamorphic threashold
+ // set via @option in this test header!
+ var LIMIT = 20;
+ for (var i = 0; i < LIMIT; i++) {
+ // make sure global has no "foo"
+ delete foo;
+ Assert.assertFalse(checker(), "Expected false in interation " + i);
+
+ // now add 'foo' in global
+ foo = 44;
+ Assert.assertTrue(checker(), "Expected true in interation " + i);
+ }
+}
+
+
+loop(checkFoo);
+loop(checkFooInWith);
--- a/nashorn/test/script/basic/javaarrayconversion.js Thu Sep 17 16:53:42 2015 +0200
+++ b/nashorn/test/script/basic/javaarrayconversion.js Fri Sep 25 12:04:35 2015 -0700
@@ -128,24 +128,32 @@
// Converting to string, toString takes precedence over valueOf
test({ valueOf: function() { return "42"; }, toString: function() { return "43"; } }, "java.lang.String", "43")
+function assertCanConvert(sourceType, targetType) {
+ Java.to([new (Java.type(sourceType))()], targetType + "[]")
+ ++testCount;
+}
+
function assertCantConvert(sourceType, targetType) {
try {
- Java.to([new Java.type(sourceType)()], targetType + "[]")
+ Java.to([new (Java.type(sourceType))()], targetType + "[]")
throw "no TypeError encountered"
} catch(e) {
- if(!(e instanceof TypeError)) {
+ if(!(e instanceof TypeError) ||
+ !e.message.startsWith("Java.to conversion to array type")) {
throw e;
}
++testCount;
}
}
+// Arbitrary POJOs to JS Primitive type should work
+assertCanConvert("java.util.BitSet", "int")
+assertCanConvert("java.util.BitSet", "double")
+assertCanConvert("java.util.BitSet", "long")
+assertCanConvert("java.util.BitSet", "boolean")
+assertCanConvert("java.util.BitSet", "java.lang.String")
+
// Arbitrary POJOs can't be converted to Java values
-assertCantConvert("java.util.BitSet", "int")
-assertCantConvert("java.util.BitSet", "double")
-assertCantConvert("java.util.BitSet", "long")
-assertCantConvert("java.util.BitSet", "boolean")
-assertCantConvert("java.util.BitSet", "java.lang.String")
assertCantConvert("java.util.BitSet", "java.lang.Double")
assertCantConvert("java.util.BitSet", "java.lang.Long")
--- a/nashorn/test/src/jdk/nashorn/api/scripting/test/ScopeTest.java Thu Sep 17 16:53:42 2015 +0200
+++ b/nashorn/test/src/jdk/nashorn/api/scripting/test/ScopeTest.java Fri Sep 25 12:04:35 2015 -0700
@@ -26,6 +26,7 @@
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertNotNull;
+import static org.testng.Assert.assertFalse;
import static org.testng.Assert.assertTrue;
import static org.testng.Assert.fail;
import javax.script.Bindings;
@@ -820,4 +821,38 @@
public void recursiveEvalCallScriptContextTest() throws ScriptException {
new RecursiveEval().program();
}
+
+ private static final String VAR_NAME = "myvar";
+
+ private static boolean lookupVar(final ScriptEngine engine, final String varName) {
+ try {
+ engine.eval(varName);
+ return true;
+ } catch (final ScriptException se) {
+ return false;
+ }
+ }
+
+ // @bug 8136544: Call site switching to megamorphic causes incorrect property read
+ @Test
+ public void megamorphicPropertyReadTest() throws ScriptException {
+ final NashornScriptEngineFactory factory = new NashornScriptEngineFactory();
+ final ScriptEngine engine = factory.getScriptEngine();
+ final Bindings scope = engine.getBindings(ScriptContext.ENGINE_SCOPE);
+ boolean ret;
+
+ // Why 16 is the upper limit of this loop? The default nashorn dynalink megamorphic threshold is 16.
+ // See jdk.nashorn.internal.runtime.linker.Bootstrap.NASHORN_DEFAULT_UNSTABLE_RELINK_THRESHOLD
+ // We do, 'eval' of the same in this loop twice. So, 16*2 = 32 times that callsite in the script
+ // is exercised - much beyond the default megamorphic threshold.
+
+ for (int i = 0; i < 16; i++) {
+ scope.remove(VAR_NAME);
+ ret = lookupVar(engine, VAR_NAME);
+ assertFalse(ret, "Expected false in iteration " + i);
+ scope.put(VAR_NAME, "foo");
+ ret = lookupVar(engine, VAR_NAME);
+ assertTrue(ret, "Expected true in iteration " + i);
+ }
+ }
}
--- a/test/Makefile Thu Sep 17 16:53:42 2015 +0200
+++ b/test/Makefile Fri Sep 25 12:04:35 2015 -0700
@@ -57,6 +57,9 @@
# All testing
all: jdk_all langtools_all jaxp_all
+# Bring in closed test targets if present
+-include $(TOPDIR)/closed/test/Makefile
+
# Test targets
langtools_% :
@$(NO_STOPPING)$(call SUBDIR_TEST, $(LANGTOOLS_DIR), JT_JAVA=$(PRODUCT_HOME) JTREG_HOME=$(JT_HOME) TEST="$(subst langtools_,,$@)" $(subst langtools_,,$@))
--- a/test/lib/Makefile Thu Sep 17 16:53:42 2015 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,79 +0,0 @@
-#
-# Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
-# 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.
-#
-
-# Utility Makefile that creates wb.jar, which is used to simplify using
-# the Whitebox API outside the jtreg-testbase.
-
-ifneq "x$(ALT_BOOTDIR)" "x"
- BOOTDIR := $(ALT_BOOTDIR)
-endif
-
-ifeq "x$(BOOTDIR)" "x"
- JDK_HOME := $(shell dirname $(shell which java))/..
-else
- JDK_HOME := $(BOOTDIR)
-endif
-
-SRC_DIR = ./
-BUILD_DIR = build
-OUTPUT_DIR = $(BUILD_DIR)/classes
-
-JAVAC = $(JDK_HOME)/bin/javac
-JAR = $(JDK_HOME)/bin/jar
-
-WB_SRC_FILES = $(shell find $(SRC_DIR)/sun/hotspot -name '*.java')
-# test-lib.jar will contain only hprof classes until JDK-8081381 is resolved
-SHARE_SRC_FILES = $(shell find $(SRC_DIR)/share/classes/jdk/test/lib/hprof -name '*.java')
-
-.PHONY: wb.filelist share.filelist clean cleantmp
-
-all: wb.jar test-lib.jar cleantmp
-
-wb.jar: wb.filelist
- @mkdir -p $(OUTPUT_DIR)
- $(JAVAC) -sourcepath $(SRC_DIR) -d $(OUTPUT_DIR) -cp $(OUTPUT_DIR) @wb.filelist
- $(JAR) cf wb.jar -C $(OUTPUT_DIR) .
- @rm -rf $(OUTPUT_DIR)
-
-wb.filelist: $(WB_SRC_FILES)
- @rm -f $@
- @echo $(WB_SRC_FILES) > $@
-
-test-lib.jar: share.filelist
- @mkdir -p $(OUTPUT_DIR)
- $(JAVAC) -sourcepath $(SRC_DIR) -d $(OUTPUT_DIR) -cp $(OUTPUT_DIR) @share.filelist
- $(JAR) cf test-lib.jar -C $(OUTPUT_DIR) .
- @rm -rf $(OUTPUT_DIR)
-
-share.filelist: $(SHARE_SRC_FILES)
- @rm -f $@
- @echo $(SHARE_SRC_FILES) > $@
-
-clean: cleantmp
- @rm -rf wb.jar
- @rm -rf test-list.jar
-
-cleantmp:
- @rm -rf wb.filelist
- @rm -rf share.filelist
- @rm -rf $(BUILD_DIR)
--- a/test/lib/sun/hotspot/WhiteBox.java Thu Sep 17 16:53:42 2015 +0200
+++ b/test/lib/sun/hotspot/WhiteBox.java Fri Sep 25 12:04:35 2015 -0700
@@ -26,12 +26,10 @@
import java.lang.management.MemoryUsage;
import java.lang.reflect.Executable;
-import java.nio.ByteBuffer;
import java.util.Arrays;
import java.util.List;
import java.util.function.BiFunction;
import java.util.function.Function;
-import java.util.stream.Stream;
import java.security.BasicPermission;
import java.util.Objects;
@@ -85,6 +83,7 @@
public native int getVMPageSize();
public native long getVMAllocationGranularity();
public native long getVMLargePageSize();
+ public native long getHeapSpaceAlignment();
private native boolean isObjectInOldGen0(Object o);
public boolean isObjectInOldGen(Object o) {
@@ -144,6 +143,10 @@
return parseCommandLine0(commandline, delim, args);
}
+ // Parallel GC
+ public native long psVirtualSpaceAlignment();
+ public native long psHeapGenerationAlignment();
+
// NMT
public native long NMTMalloc(long size);
public native void NMTFree(long mem);
@@ -386,23 +389,6 @@
.orElse(null);
}
- public native boolean readImageFile(String imagePath);
- public native long imageOpenImage(String imagePath, boolean bigEndian);
- public native void imageCloseImage(long id);
- public native long imageGetIndexAddress(long id);
- public native long imageGetDataAddress(long id);
- public native boolean imageReadCompressed(long id, long offset,
- ByteBuffer compressedBuffer, long compressedSize,
- ByteBuffer uncompressedBuffer, long uncompressedSize);
- public native boolean imageRead(long id, long offset,
- ByteBuffer uncompressedBuffer, long uncompressedSize);
- public native byte[] imageGetStringBytes(long id, int offset);
- public native long imageGetStringsSize(long id);
- public native long[] imageGetAttributes(long id, int offset);
- public native long[] imageFindAttributes(long id, byte[] path);
- public native int[] imageAttributeOffsets(long id);
- public native int imageGetIntAtAddress(long address, int offset, boolean big_endian);
-
// Safepoint Checking
public native void assertMatchingSafepointCalls(boolean mutexSafepointValue, boolean attemptedNoSafepointValue);
--- a/test/make/TestMakeBase.gmk Thu Sep 17 16:53:42 2015 +0200
+++ b/test/make/TestMakeBase.gmk Fri Sep 25 12:04:35 2015 -0700
@@ -73,6 +73,37 @@
TEST_TARGETS += $(ESCAPE_DOLLAR_DIR)/_escape_dollar
################################################################################
+# Test containing and not-containing
+
+CONT_LIST := foo bar baz foobar foobaz
+
+# Param 1 - string to look for
+# Param 2 - expected result
+define TestContaining
+ value := $$(call containing, $1, $(CONT_LIST))
+ ifneq ($$(value), $2)
+ $$(info (call containing, $1, $(CONT_LIST)))
+ $$(error result >$$(value)<, expected >$2<)
+ endif
+endef
+
+$(eval $(call TestContaining,bar,bar foobar))
+$(eval $(call TestContaining,foo bar,foo bar foobar foobaz))
+
+# Param 1 - string to look for
+# Param 2 - expected result
+define TestNotContaining
+ value := $$(call not-containing, $1, $(CONT_LIST))
+ ifneq ($$(value), $2)
+ $$(info (call not-containing, $1, $(CONT_LIST)))
+ $$(error result >$$(value)<, expected >$2<)
+ endif
+endef
+
+$(eval $(call TestNotContaining,bar,foo baz foobaz))
+$(eval $(call TestNotContaining,foo bar,baz))
+
+################################################################################
# Test Equals
EQUALS_VALUE1 := value1$(SPACE)