# HG changeset patch # User prr # Date 1441748444 25200 # Node ID b348f693a10e51387d0986f7d02c1f04c1550548 # Parent 82e066c83bd0accd2ade4dab2e548c4bd782e4f0# Parent d06ae7ff8afda5efac1aebb124670724581a968a Merge diff -r 82e066c83bd0 -r b348f693a10e .hgtags --- a/.hgtags Tue Sep 08 16:01:29 2015 +0400 +++ b/.hgtags Tue Sep 08 14:40:44 2015 -0700 @@ -322,3 +322,4 @@ 7fd081100f48828431e7c1bff65c906ee759069b jdk9-b77 0940ce86c614458f5bdd72278b190abbf36b7b45 jdk9-b78 d99c2ffdd0f15753e69126583688f2f075a0a5e8 jdk9-b79 +4947810137ae53abba3028cc366af953d90fa81a jdk9-b80 diff -r 82e066c83bd0 -r b348f693a10e README --- a/README Tue Sep 08 16:01:29 2015 +0400 +++ b/README Tue Sep 08 14:40:44 2015 -0700 @@ -25,5 +25,3 @@ 5. Construct the images: cd make && gnumake images The resulting JDK image should be found in build/*/j2sdk-image - - diff -r 82e066c83bd0 -r b348f693a10e make/mapfiles/libj2ucrypto/mapfile-vers --- a/make/mapfiles/libj2ucrypto/mapfile-vers Tue Sep 08 16:01:29 2015 +0400 +++ b/make/mapfiles/libj2ucrypto/mapfile-vers Tue Sep 08 14:40:44 2015 -0700 @@ -1,5 +1,5 @@ # -# Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2012, 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 @@ Java_com_oracle_security_ucrypto_NativeCipher_nativeUpdate; Java_com_oracle_security_ucrypto_NativeCipher_nativeFinal; Java_com_oracle_security_ucrypto_NativeKey_nativeFree; + Java_com_oracle_security_ucrypto_NativeKey_00024RSAPrivate_nativeInit; Java_com_oracle_security_ucrypto_NativeKey_00024RSAPrivateCrt_nativeInit; Java_com_oracle_security_ucrypto_NativeKey_00024RSAPublic_nativeInit; Java_com_oracle_security_ucrypto_NativeRSASignature_nativeInit; @@ -56,6 +57,7 @@ JavaCritical_com_oracle_security_ucrypto_NativeCipher_nativeUpdate; JavaCritical_com_oracle_security_ucrypto_NativeCipher_nativeFinal; JavaCritical_com_oracle_security_ucrypto_NativeKey_nativeFree; + JavaCritical_com_oracle_security_ucrypto_NativeKey_00024RSAPrivate_nativeInit; JavaCritical_com_oracle_security_ucrypto_NativeKey_00024RSAPrivateCrt_nativeInit; JavaCritical_com_oracle_security_ucrypto_NativeKey_00024RSAPublic_nativeInit; JavaCritical_com_oracle_security_ucrypto_NativeRSASignature_nativeInit; diff -r 82e066c83bd0 -r b348f693a10e make/netbeans/jdbc/build.properties --- a/make/netbeans/jdbc/build.properties Tue Sep 08 16:01:29 2015 +0400 +++ b/make/netbeans/jdbc/build.properties Tue Sep 08 14:40:44 2015 -0700 @@ -43,4 +43,4 @@ build.number = b00 jdbc.version = ${build.release}-${user.name}-${build.number} jdbc.args = -debug -javadoc.options=-J-Xmx256m -Xdoclint:none -keywords -quiet \ No newline at end of file +javadoc.options=-J-Xmx256m -Xdoclint:none -keywords -quiet diff -r 82e066c83bd0 -r b348f693a10e src/demo/share/applets/Fractal/example1.html --- a/src/demo/share/applets/Fractal/example1.html Tue Sep 08 16:01:29 2015 +0400 +++ b/src/demo/share/applets/Fractal/example1.html Tue Sep 08 14:40:44 2015 -0700 @@ -23,5 +23,3 @@ The source. - - diff -r 82e066c83bd0 -r b348f693a10e src/demo/share/applets/MoleculeViewer/example1.html --- a/src/demo/share/applets/MoleculeViewer/example1.html Tue Sep 08 16:01:29 2015 +0400 +++ b/src/demo/share/applets/MoleculeViewer/example1.html Tue Sep 08 14:40:44 2015 -0700 @@ -14,9 +14,3 @@ The source. - - - - - - diff -r 82e066c83bd0 -r b348f693a10e src/java.base/share/classes/sun/launcher/resources/launcher.properties --- a/src/java.base/share/classes/sun/launcher/resources/launcher.properties Tue Sep 08 16:01:29 2015 +0400 +++ b/src/java.base/share/classes/sun/launcher/resources/launcher.properties Tue Sep 08 14:40:44 2015 -0700 @@ -60,8 +60,8 @@ \ -dsa | -disablesystemassertions\n\ \ disable system assertions\n\ \ -agentlib:[=]\n\ -\ load native agent library , e.g. -agentlib:hprof\n\ -\ see also, -agentlib:jdwp=help and -agentlib:hprof=help\n\ +\ load native agent library , e.g. -agentlib:jdwp\n\ +\ see also -agentlib:jdwp=help\n\ \ -agentpath:[=]\n\ \ load native agent library by full pathname\n\ \ -javaagent:[=]\n\ diff -r 82e066c83bd0 -r b348f693a10e src/java.base/share/classes/sun/security/provider/certpath/OCSPNonceExtension.java --- a/src/java.base/share/classes/sun/security/provider/certpath/OCSPNonceExtension.java Tue Sep 08 16:01:29 2015 +0400 +++ b/src/java.base/share/classes/sun/security/provider/certpath/OCSPNonceExtension.java Tue Sep 08 14:40:44 2015 -0700 @@ -26,15 +26,13 @@ package sun.security.provider.certpath; import java.io.IOException; -import java.io.OutputStream; -import java.util.Enumeration; +import java.util.Objects; import java.security.SecureRandom; -import sun.security.x509.AttributeNameEnumeration; -import sun.security.x509.CertAttrSet; import sun.security.x509.Extension; import sun.security.x509.PKIXExtensions; -import sun.security.util.*; +import sun.security.util.Debug; +import sun.security.util.DerValue; /** * Represent the OCSP Nonce Extension. @@ -43,252 +41,139 @@ * and help to prevent replay attacks (see RFC 6960, section 4.4.1). * * @see Extension - * @see CertAttrSet */ -public class OCSPNonceExtension extends Extension -implements CertAttrSet { +public final class OCSPNonceExtension extends Extension { /** * Attribute name. */ - public static final String NAME = "OCSPNonce"; - public static final String NONCE = "nonce"; - + private static final String EXTENSION_NAME = "OCSPNonce"; private byte[] nonceData = null; - private String extensionName; - - /** - * Encode this extension value to DER and assign it to the - * {@code extensionName} data member. - * - * @throws IOException if any errors occur during DER encoding - */ - private void encodeInternal() throws IOException { - if (nonceData == null) { - this.extensionValue = null; - return; - } - DerOutputStream os = new DerOutputStream(); - os.putOctetString(this.nonceData); - this.extensionValue = os.toByteArray(); - } /** * Create a {@code OCSPNonceExtension} by providing the nonce length. - * The criticality is set to false. The random bytes will be generated - * using the SUN provider. + * The criticality is set to false, and the OID for the extension will + * be the value defined by "id-pkix-ocsp-nonce" from RFC 6960. * * @param length the number of random bytes composing the nonce * * @throws IOException if any errors happen during encoding of the * extension. + * @throws IllegalArgumentException if length is not a positive integer. */ public OCSPNonceExtension(int length) throws IOException { - this(PKIXExtensions.OCSPNonce_Id, false, length, NAME); - } - - /** - * Creates the extension (also called by the subclass). - * - * @param extensionId the {@code ObjectIdentifier} for the OCSP Nonce - * extension - * @param isCritical a boolean flag indicating if the criticality bit - * is to be set for this extension - * @param length the length of the nonce in bytes - * @param extensionName the name of the extension - * - * @throws IOException if any errors happen during encoding of the - * extension. - */ - protected OCSPNonceExtension(ObjectIdentifier extensionId, - boolean isCritical, int length, String extensionName) - throws IOException { - SecureRandom rng = new SecureRandom(); - this.nonceData = new byte[length]; - rng.nextBytes(nonceData); - this.extensionId = extensionId; - this.critical = isCritical; - this.extensionName = extensionName; - encodeInternal(); - } - - /** - * Create the extension using the provided criticality bit setting and - * DER encoding. - * - * @param critical true if the extension is to be treated as critical. - * @param value an array of DER encoded bytes of the extnValue for the - * extension. It must not include the encapsulating OCTET STRING - * tag and length. For an {@code OCSPNonceExtension} the data value - * should be a simple OCTET STRING containing random bytes - * (see RFC 6960, section 4.4.1). - * - * @throws ClassCastException if value is not an array of bytes - * @throws IOException if any errors happen during encoding of the - * extension - */ - public OCSPNonceExtension(Boolean critical, Object value) - throws IOException { - this(PKIXExtensions.OCSPNonce_Id, critical, value, NAME); + this(false, length); } /** - * Creates the extension (also called by the subclass). - * - * @param extensionId the {@code ObjectIdentifier} for the OCSP Nonce - * extension - * @param critical a boolean flag indicating if the criticality bit - * is to be set for this extension - * @param value an array of DER encoded bytes of the extnValue for the - * extension. It must not include the encapsulating OCTET STRING - * tag and length. For an {@code OCSPNonceExtension} the data value - * should be a simple OCTET STRING containing random bytes - * (see RFC 6960, section 4.4.1). - * @param extensionName the name of the extension + * Create a {@code OCSPNonceExtension} by providing the nonce length and + * criticality setting. The OID for the extension will + * be the value defined by "id-pkix-ocsp-nonce" from RFC 6960. * - * @throws ClassCastException if value is not an array of bytes - * @throws IOException if any errors happen during encoding of the - * extension - */ - protected OCSPNonceExtension(ObjectIdentifier extensionId, - Boolean critical, Object value, String extensionName) - throws IOException { - this.extensionId = extensionId; - this.critical = critical; - this.extensionValue = (byte[]) value; - DerValue val = new DerValue(this.extensionValue); - this.nonceData = val.getOctetString(); - this.extensionName = extensionName; - } - - /** - * Set the attribute value. - * - * @param name the name of the attribute. - * @param obj an array of nonce bytes for the extension. It must not - * contain any DER tags or length. + * @param isCritical a boolean flag indicating whether the criticality bit + * is set for this extension + * @param length the number of random bytes composing the nonce * - * @throws IOException if an unsupported name is provided or the supplied - * {@code obj} is not a byte array + * @throws IOException if any errors happen during encoding of the + * extension. + * @throws IllegalArgumentException if length is not a positive integer. */ - @Override - public void set(String name, Object obj) throws IOException { - if (name.equalsIgnoreCase(NONCE)) { - if (!(obj instanceof byte[])) { - throw new IOException("Attribute must be of type byte[]."); - } - nonceData = (byte[])obj; - } else { - throw new IOException("Attribute name not recognized by" - + " CertAttrSet:" + extensionName + "."); - } - encodeInternal(); - } + public OCSPNonceExtension(boolean isCritical, int length) + throws IOException { + this.extensionId = PKIXExtensions.OCSPNonce_Id; + this.critical = isCritical; - /** - * Get the attribute value. - * - * @param name the name of the attribute to retrieve. Only "OCSPNonce" - * is currently supported. - * - * @return an array of bytes that are the nonce data. It will not contain - * any DER tags or length, only the random nonce bytes. - * - * @throws IOException if an unsupported name is provided. - */ - @Override - public Object get(String name) throws IOException { - if (name.equalsIgnoreCase(NONCE)) { - return nonceData; + if (length > 0) { + SecureRandom rng = new SecureRandom(); + this.nonceData = new byte[length]; + rng.nextBytes(nonceData); + this.extensionValue = new DerValue(DerValue.tag_OctetString, + nonceData).toByteArray(); } else { - throw new IOException("Attribute name not recognized by" - + " CertAttrSet:" + extensionName + "."); + throw new IllegalArgumentException( + "Length must be a positive integer"); } } /** - * Delete the attribute value. + * Create a {@code OCSPNonceExtension} by providing a nonce value. + * The criticality is set to false, and the OID for the extension will + * be the value defined by "id-pkix-ocsp-nonce" from RFC 6960. * - * @param name the name of the attribute to retrieve. Only "OCSPNonce" - * is currently supported. + * @param incomingNonce The nonce data to be set for the extension. This + * must be a non-null array of at least one byte long. * - * @throws IOException if an unsupported name is provided or an error - * occurs during re-encoding of the extension. + * @throws IOException if any errors happen during encoding of the + * extension. + * @throws IllegalArgumentException if the incomingNonce length is not a + * positive integer. + * @throws NullPointerException if the incomingNonce is null. */ - @Override - public void delete(String name) throws IOException { - if (name.equalsIgnoreCase(NONCE)) { - nonceData = null; + public OCSPNonceExtension(byte[] incomingNonce) throws IOException { + this(false, incomingNonce); + } + + /** + * Create a {@code OCSPNonceExtension} by providing a nonce value and + * criticality setting. The OID for the extension will + * be the value defined by "id-pkix-ocsp-nonce" from RFC 6960. + * + * @param isCritical a boolean flag indicating whether the criticality bit + * is set for this extension + * @param incomingNonce The nonce data to be set for the extension. This + * must be a non-null array of at least one byte long. + * + * @throws IOException if any errors happen during encoding of the + * extension. + * @throws IllegalArgumentException if the incomingNonce length is not a + * positive integer. + * @throws NullPointerException if the incomingNonce is null. + */ + public OCSPNonceExtension(boolean isCritical, byte[] incomingNonce) + throws IOException { + this.extensionId = PKIXExtensions.OCSPNonce_Id; + this.critical = isCritical; + + Objects.requireNonNull(incomingNonce, "Nonce data must be non-null"); + if (incomingNonce.length > 0) { + this.nonceData = incomingNonce.clone(); + this.extensionValue = new DerValue(DerValue.tag_OctetString, + nonceData).toByteArray(); } else { - throw new IOException("Attribute name not recognized by" - + " CertAttrSet:" + extensionName + "."); + throw new IllegalArgumentException( + "Nonce data must be at least 1 byte in length"); } - encodeInternal(); + } + + /** + * Return the nonce bytes themselves, without any DER encoding. + * + * @return A copy of the underlying nonce bytes + */ + public byte[] getNonceValue() { + return nonceData.clone(); } /** * Returns a printable representation of the {@code OCSPNonceExtension}. + * + * @return a string representation of the extension. */ @Override public String toString() { - String s = super.toString() + extensionName + ": " + - ((nonceData == null) ? "" : Debug.toString(nonceData)) - + "\n"; - return (s); - } - - /** - * Write the extension to an {@code OutputStream} - * - * @param out the {@code OutputStream} to write the extension to. - * - * @throws IOException on encoding errors. - */ - @Override - public void encode(OutputStream out) throws IOException { - encode(out, PKIXExtensions.OCSPNonce_Id, this.critical); + StringBuilder sb = new StringBuilder(); + sb.append(super.toString()).append(EXTENSION_NAME).append(": "); + sb.append((nonceData == null) ? "" : Debug.toString(nonceData)); + sb.append("\n"); + return sb.toString(); } /** - * Write the extension to the DerOutputStream. + * Return the name of the extension as a {@code String} * - * @param out the {@code OutputStream} to write the extension to. - * @param extensionId the {@code ObjectIdentifier} used for this extension - * @param isCritical a flag indicating if the criticality bit is set for - * this extension. - * - * @throws IOException on encoding errors. + * @return the name of the extension */ - protected void encode(OutputStream out, ObjectIdentifier extensionId, - boolean isCritical) throws IOException { - - DerOutputStream tmp = new DerOutputStream(); - - if (this.extensionValue == null) { - this.extensionId = extensionId; - this.critical = isCritical; - encodeInternal(); - } - super.encode(tmp); - out.write(tmp.toByteArray()); - } - - /** - * Return an enumeration of names of attributes existing within this - * attribute. - */ - @Override - public Enumeration getElements() { - AttributeNameEnumeration elements = new AttributeNameEnumeration(); - elements.addElement(NONCE); - return (elements.elements()); - } - - /** - * Return the name of this attribute. - */ - @Override public String getName() { - return (extensionName); + return EXTENSION_NAME; } } diff -r 82e066c83bd0 -r b348f693a10e src/java.base/share/native/libnet/InetAddress.c --- a/src/java.base/share/native/libnet/InetAddress.c Tue Sep 08 16:01:29 2015 +0400 +++ b/src/java.base/share/native/libnet/InetAddress.c Tue Sep 08 14:40:44 2015 -0700 @@ -57,6 +57,7 @@ c = (*env)->FindClass(env,"java/net/InetAddress$InetAddressHolder"); CHECK_NULL(c); iac_class = (*env)->NewGlobalRef(env, c); + CHECK_NULL(iac_class); ia_holderID = (*env)->GetFieldID(env, ia_class, "holder", "Ljava/net/InetAddress$InetAddressHolder;"); CHECK_NULL(ia_holderID); ia_preferIPv6AddressID = (*env)->GetStaticFieldID(env, ia_class, "preferIPv6Address", "Z"); diff -r 82e066c83bd0 -r b348f693a10e src/java.base/share/native/libzip/Adler32.c --- a/src/java.base/share/native/libzip/Adler32.c Tue Sep 08 16:01:29 2015 +0400 +++ b/src/java.base/share/native/libzip/Adler32.c Tue Sep 08 14:40:44 2015 -0700 @@ -66,5 +66,3 @@ } return adler; } - - diff -r 82e066c83bd0 -r b348f693a10e src/java.base/unix/classes/sun/net/www/content-types.properties --- a/src/java.base/unix/classes/sun/net/www/content-types.properties Tue Sep 08 16:01:29 2015 +0400 +++ b/src/java.base/unix/classes/sun/net/www/content-types.properties Tue Sep 08 14:40:44 2015 -0700 @@ -275,6 +275,3 @@ application/xml: \ description=XML document;\ file_extensions=.xml - - - diff -r 82e066c83bd0 -r b348f693a10e src/java.base/unix/native/libjava/FileDescriptor_md.c --- a/src/java.base/unix/native/libjava/FileDescriptor_md.c Tue Sep 08 16:01:29 2015 +0400 +++ b/src/java.base/unix/native/libjava/FileDescriptor_md.c Tue Sep 08 14:40:44 2015 -0700 @@ -26,9 +26,11 @@ #include #include +#include "jni.h" +#include "jni_util.h" #include "jvm.h" + #include "io_util_md.h" - #include "java_io_FileDescriptor.h" /*******************************************************************/ @@ -47,8 +49,8 @@ JNIEXPORT void JNICALL Java_java_io_FileDescriptor_initIDs(JNIEnv *env, jclass fdClass) { - IO_fd_fdID = (*env)->GetFieldID(env, fdClass, "fd", "I"); - IO_append_fdID = (*env)->GetFieldID(env, fdClass, "append", "Z"); + CHECK_NULL(IO_fd_fdID = (*env)->GetFieldID(env, fdClass, "fd", "I")); + CHECK_NULL(IO_append_fdID = (*env)->GetFieldID(env, fdClass, "append", "Z")); } /************************************************************** diff -r 82e066c83bd0 -r b348f693a10e src/java.base/windows/classes/sun/net/www/content-types.properties --- a/src/java.base/windows/classes/sun/net/www/content-types.properties Tue Sep 08 16:01:29 2015 +0400 +++ b/src/java.base/windows/classes/sun/net/www/content-types.properties Tue Sep 08 14:40:44 2015 -0700 @@ -272,5 +272,3 @@ application/xml: \ description=XML document;\ file_extensions=.xml - - diff -r 82e066c83bd0 -r b348f693a10e src/java.base/windows/native/libnet/DualStackPlainSocketImpl.c --- a/src/java.base/windows/native/libnet/DualStackPlainSocketImpl.c Tue Sep 08 16:01:29 2015 +0400 +++ b/src/java.base/windows/native/libnet/DualStackPlainSocketImpl.c Tue Sep 08 14:40:44 2015 -0700 @@ -45,9 +45,10 @@ jclass cls = (*env)->FindClass(env, "java/net/InetSocketAddress"); CHECK_NULL(cls); isa_class = (*env)->NewGlobalRef(env, cls); + CHECK_NULL(isa_class); isa_ctorID = (*env)->GetMethodID(env, cls, "", "(Ljava/net/InetAddress;I)V"); - + CHECK_NULL(isa_ctorID); initInetAddressIDs(env); // implement read timeout with select. diff -r 82e066c83bd0 -r b348f693a10e src/java.desktop/macosx/classes/com/apple/eawt/_OpenAppHandler.java --- a/src/java.desktop/macosx/classes/com/apple/eawt/_OpenAppHandler.java Tue Sep 08 16:01:29 2015 +0400 +++ b/src/java.desktop/macosx/classes/com/apple/eawt/_OpenAppHandler.java Tue Sep 08 14:40:44 2015 -0700 @@ -27,4 +27,4 @@ interface _OpenAppHandler { void handleOpenApp(); -} \ No newline at end of file +} diff -r 82e066c83bd0 -r b348f693a10e src/java.desktop/macosx/classes/com/apple/laf/AquaLookAndFeel.java --- a/src/java.desktop/macosx/classes/com/apple/laf/AquaLookAndFeel.java Tue Sep 08 16:01:29 2015 +0400 +++ b/src/java.desktop/macosx/classes/com/apple/laf/AquaLookAndFeel.java Tue Sep 08 14:40:44 2015 -0700 @@ -1096,4 +1096,4 @@ }; table.putDefaults(uiDefaults); } -} \ No newline at end of file +} diff -r 82e066c83bd0 -r b348f693a10e src/java.desktop/macosx/classes/sun/lwawt/macosx/CDataTransferer.java --- a/src/java.desktop/macosx/classes/sun/lwawt/macosx/CDataTransferer.java Tue Sep 08 16:01:29 2015 +0400 +++ b/src/java.desktop/macosx/classes/sun/lwawt/macosx/CDataTransferer.java Tue Sep 08 14:40:44 2015 -0700 @@ -278,5 +278,3 @@ return false; } } - - diff -r 82e066c83bd0 -r b348f693a10e src/java.desktop/macosx/native/libawt_lwawt/awt/AWTView.m --- a/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTView.m Tue Sep 08 16:01:29 2015 +0400 +++ b/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTView.m Tue Sep 08 14:40:44 2015 -0700 @@ -1406,5 +1406,3 @@ return underMouse; } - - diff -r 82e066c83bd0 -r b348f693a10e src/java.desktop/macosx/native/libawt_lwawt/awt/CClipboard.m --- a/src/java.desktop/macosx/native/libawt_lwawt/awt/CClipboard.m Tue Sep 08 16:01:29 2015 +0400 +++ b/src/java.desktop/macosx/native/libawt_lwawt/awt/CClipboard.m Tue Sep 08 14:40:44 2015 -0700 @@ -289,4 +289,4 @@ JNF_COCOA_EXIT(env); return ret; -} \ No newline at end of file +} diff -r 82e066c83bd0 -r b348f693a10e src/java.desktop/share/classes/sun/awt/image/MultiResolutionCachedImage.java --- a/src/java.desktop/share/classes/sun/awt/image/MultiResolutionCachedImage.java Tue Sep 08 16:01:29 2015 +0400 +++ b/src/java.desktop/share/classes/sun/awt/image/MultiResolutionCachedImage.java Tue Sep 08 14:40:44 2015 -0700 @@ -183,4 +183,4 @@ return false; } } -} \ No newline at end of file +} diff -r 82e066c83bd0 -r b348f693a10e src/java.desktop/share/native/libfontmanager/layout/AnchorTables.h --- a/src/java.desktop/share/native/libfontmanager/layout/AnchorTables.h Tue Sep 08 16:01:29 2015 +0400 +++ b/src/java.desktop/share/native/libfontmanager/layout/AnchorTables.h Tue Sep 08 14:40:44 2015 -0700 @@ -80,5 +80,3 @@ U_NAMESPACE_END #endif - - diff -r 82e066c83bd0 -r b348f693a10e src/java.desktop/share/native/libfontmanager/layout/CharSubstitutionFilter.h --- a/src/java.desktop/share/native/libfontmanager/layout/CharSubstitutionFilter.h Tue Sep 08 16:01:29 2015 +0400 +++ b/src/java.desktop/share/native/libfontmanager/layout/CharSubstitutionFilter.h Tue Sep 08 14:40:44 2015 -0700 @@ -104,5 +104,3 @@ U_NAMESPACE_END #endif - - diff -r 82e066c83bd0 -r b348f693a10e src/java.desktop/share/native/libfontmanager/layout/CursiveAttachmentSubtables.h --- a/src/java.desktop/share/native/libfontmanager/layout/CursiveAttachmentSubtables.h Tue Sep 08 16:01:29 2015 +0400 +++ b/src/java.desktop/share/native/libfontmanager/layout/CursiveAttachmentSubtables.h Tue Sep 08 14:40:44 2015 -0700 @@ -63,5 +63,3 @@ U_NAMESPACE_END #endif - - diff -r 82e066c83bd0 -r b348f693a10e src/java.desktop/share/native/libfontmanager/layout/DeviceTables.h --- a/src/java.desktop/share/native/libfontmanager/layout/DeviceTables.h Tue Sep 08 16:01:29 2015 +0400 +++ b/src/java.desktop/share/native/libfontmanager/layout/DeviceTables.h Tue Sep 08 14:40:44 2015 -0700 @@ -61,5 +61,3 @@ U_NAMESPACE_END #endif - - diff -r 82e066c83bd0 -r b348f693a10e src/java.desktop/share/native/libfontmanager/layout/MPreFixups.h --- a/src/java.desktop/share/native/libfontmanager/layout/MPreFixups.h Tue Sep 08 16:01:29 2015 +0400 +++ b/src/java.desktop/share/native/libfontmanager/layout/MPreFixups.h Tue Sep 08 14:40:44 2015 -0700 @@ -63,5 +63,3 @@ U_NAMESPACE_END #endif - - diff -r 82e066c83bd0 -r b348f693a10e src/java.desktop/share/native/libfontmanager/layout/MarkArrays.h --- a/src/java.desktop/share/native/libfontmanager/layout/MarkArrays.h Tue Sep 08 16:01:29 2015 +0400 +++ b/src/java.desktop/share/native/libfontmanager/layout/MarkArrays.h Tue Sep 08 14:40:44 2015 -0700 @@ -62,5 +62,3 @@ U_NAMESPACE_END #endif - - diff -r 82e066c83bd0 -r b348f693a10e src/java.desktop/share/native/libfontmanager/layout/PairPositioningSubtables.h --- a/src/java.desktop/share/native/libfontmanager/layout/PairPositioningSubtables.h Tue Sep 08 16:01:29 2015 +0400 +++ b/src/java.desktop/share/native/libfontmanager/layout/PairPositioningSubtables.h Tue Sep 08 14:40:44 2015 -0700 @@ -109,5 +109,3 @@ U_NAMESPACE_END #endif - - diff -r 82e066c83bd0 -r b348f693a10e src/java.desktop/share/native/libfontmanager/layout/SinglePositioningSubtables.h --- a/src/java.desktop/share/native/libfontmanager/layout/SinglePositioningSubtables.h Tue Sep 08 16:01:29 2015 +0400 +++ b/src/java.desktop/share/native/libfontmanager/layout/SinglePositioningSubtables.h Tue Sep 08 14:40:44 2015 -0700 @@ -71,5 +71,3 @@ U_NAMESPACE_END #endif - - diff -r 82e066c83bd0 -r b348f693a10e src/java.desktop/share/native/libfontmanager/layout/SingleSubstitutionSubtables.h --- a/src/java.desktop/share/native/libfontmanager/layout/SingleSubstitutionSubtables.h Tue Sep 08 16:01:29 2015 +0400 +++ b/src/java.desktop/share/native/libfontmanager/layout/SingleSubstitutionSubtables.h Tue Sep 08 14:40:44 2015 -0700 @@ -68,5 +68,3 @@ U_NAMESPACE_END #endif - - diff -r 82e066c83bd0 -r b348f693a10e src/java.desktop/share/native/libfontmanager/layout/ThaiShaping.h --- a/src/java.desktop/share/native/libfontmanager/layout/ThaiShaping.h Tue Sep 08 16:01:29 2015 +0400 +++ b/src/java.desktop/share/native/libfontmanager/layout/ThaiShaping.h Tue Sep 08 14:40:44 2015 -0700 @@ -129,5 +129,3 @@ U_NAMESPACE_END #endif - - diff -r 82e066c83bd0 -r b348f693a10e src/java.desktop/share/native/libfontmanager/layout/ValueRecords.h --- a/src/java.desktop/share/native/libfontmanager/layout/ValueRecords.h Tue Sep 08 16:01:29 2015 +0400 +++ b/src/java.desktop/share/native/libfontmanager/layout/ValueRecords.h Tue Sep 08 14:40:44 2015 -0700 @@ -94,5 +94,3 @@ U_NAMESPACE_END #endif - - diff -r 82e066c83bd0 -r b348f693a10e src/java.desktop/share/native/liblcms/cmslut.c --- a/src/java.desktop/share/native/liblcms/cmslut.c Tue Sep 08 16:01:29 2015 +0400 +++ b/src/java.desktop/share/native/liblcms/cmslut.c Tue Sep 08 14:40:44 2015 -0700 @@ -1836,5 +1836,3 @@ return TRUE; } - - diff -r 82e066c83bd0 -r b348f693a10e src/java.desktop/share/native/liblcms/cmsmtrx.c --- a/src/java.desktop/share/native/liblcms/cmsmtrx.c Tue Sep 08 16:01:29 2015 +0400 +++ b/src/java.desktop/share/native/liblcms/cmsmtrx.c Tue Sep 08 14:40:44 2015 -0700 @@ -201,5 +201,3 @@ r->n[VY] = a->v[1].n[VX]*v->n[VX] + a->v[1].n[VY]*v->n[VY] + a->v[1].n[VZ]*v->n[VZ]; r->n[VZ] = a->v[2].n[VX]*v->n[VX] + a->v[2].n[VY]*v->n[VY] + a->v[2].n[VZ]*v->n[VZ]; } - - diff -r 82e066c83bd0 -r b348f693a10e src/java.desktop/share/native/liblcms/cmsplugin.c --- a/src/java.desktop/share/native/liblcms/cmsplugin.c Tue Sep 08 16:01:29 2015 +0400 +++ b/src/java.desktop/share/native/liblcms/cmsplugin.c Tue Sep 08 14:40:44 2015 -0700 @@ -989,5 +989,3 @@ { return _cmsContextGetClientChunk(ContextID, UserPtr); } - - diff -r 82e066c83bd0 -r b348f693a10e src/java.desktop/share/native/liblcms/cmswtpnt.c --- a/src/java.desktop/share/native/liblcms/cmswtpnt.c Tue Sep 08 16:01:29 2015 +0400 +++ b/src/java.desktop/share/native/liblcms/cmswtpnt.c Tue Sep 08 14:40:44 2015 -0700 @@ -376,5 +376,3 @@ return TRUE; } - - diff -r 82e066c83bd0 -r b348f693a10e src/java.desktop/share/native/libsplashscreen/java_awt_SplashScreen.c --- a/src/java.desktop/share/native/libsplashscreen/java_awt_SplashScreen.c Tue Sep 08 16:01:29 2015 +0400 +++ b/src/java.desktop/share/native/libsplashscreen/java_awt_SplashScreen.c Tue Sep 08 14:40:44 2015 -0700 @@ -234,4 +234,4 @@ return 1; } return splash->scaleFactor; -} \ No newline at end of file +} diff -r 82e066c83bd0 -r b348f693a10e src/java.desktop/windows/native/libawt/windows/DllUtil.cpp --- a/src/java.desktop/windows/native/libawt/windows/DllUtil.cpp Tue Sep 08 16:01:29 2015 +0400 +++ b/src/java.desktop/windows/native/libawt/windows/DllUtil.cpp Tue Sep 08 14:40:44 2015 -0700 @@ -84,5 +84,3 @@ } throw FunctionUnavailableException(); } - - diff -r 82e066c83bd0 -r b348f693a10e src/java.desktop/windows/native/libawt/windows/README.JNI --- a/src/java.desktop/windows/native/libawt/windows/README.JNI Tue Sep 08 16:01:29 2015 +0400 +++ b/src/java.desktop/windows/native/libawt/windows/README.JNI Tue Sep 08 14:40:44 2015 -0700 @@ -131,5 +131,3 @@ 2. Handle exceptions properly. The current code lacks error checking and recovery. This leads to random runtime crashes. - - diff -r 82e066c83bd0 -r b348f693a10e src/java.logging/share/classes/java/util/logging/package.html --- a/src/java.logging/share/classes/java/util/logging/package.html Tue Sep 08 16:01:29 2015 +0400 +++ b/src/java.logging/share/classes/java/util/logging/package.html Tue Sep 08 14:40:44 2015 -0700 @@ -126,8 +126,3 @@ - - - - - diff -r 82e066c83bd0 -r b348f693a10e src/java.management/share/classes/javax/management/ObjectName.java --- a/src/java.management/share/classes/javax/management/ObjectName.java Tue Sep 08 16:01:29 2015 +0400 +++ b/src/java.management/share/classes/javax/management/ObjectName.java Tue Sep 08 14:40:44 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 @@ -218,9 +218,19 @@ *

The serialVersionUID of this class is 1081892073854801359L. * * @since 1.5 + * + * @implNote The maximum allowed length of the domain name in this implementation + * is {@code Integer.MAX_VALUE/4} */ @SuppressWarnings("serial") // don't complain serialVersionUID not constant public class ObjectName implements Comparable, QueryExp { + private static final int DOMAIN_PATTERN = 0x8000_0000; + private static final int PROPLIST_PATTERN = 0x4000_0000; + private static final int PROPVAL_PATTERN = 0x2000_0000; + + private static final int FLAG_MASK = DOMAIN_PATTERN | PROPLIST_PATTERN | + PROPVAL_PATTERN; + private static final int DOMAIN_LENGTH_MASK = ~FLAG_MASK; /** * A structure recording property structure and @@ -365,33 +375,25 @@ /** - * The length of the domain part of built objectname - */ - private transient int _domain_length = 0; - - - /** * The propertyList of built object name. Initialized lazily. * Table that contains all the pairs (key,value) for this ObjectName. */ private transient Map _propertyList; /** - * boolean that declares if this ObjectName domain part is a pattern - */ - private transient boolean _domain_pattern = false; - - /** - * boolean that declares if this ObjectName contains a pattern on the - * key property list + * This field encodes _domain_pattern, _property_list_pattern and + * _property_value_pattern booleans and _domain_length integer. + *

+ * The following masks can be used to extract the value: + *

    + *
  • {@linkplain ObjectName#DOMAIN_PATTERN}
  • + *
  • {@linkplain ObjectName#PROPLIST_PATTERN}
  • + *
  • {@linkplain ObjectName#PROPVAL_PATTERN}
  • + *
  • {@linkplain ObjectName#DOMAIN_LENGTH_MASK}
  • + *
+ *

. */ - private transient boolean _property_list_pattern = false; - - /** - * boolean that declares if this ObjectName contains a pattern on the - * value of at least one key property - */ - private transient boolean _property_value_pattern = false; + private transient int _compressed_storage = 0x0; // Instance private fields <======================================= @@ -426,11 +428,11 @@ _canonicalName = "*:*"; _kp_array = _Empty_property_array; _ca_array = _Empty_property_array; - _domain_length = 1; + setDomainLength(1); _propertyList = null; - _domain_pattern = true; - _property_list_pattern = true; - _property_value_pattern = false; + setDomainPattern(true); + setPropertyListPattern(true); + setPropertyValuePattern(false); return; } @@ -448,7 +450,7 @@ while (index < len) { switch (name_chars[index]) { case ':' : - _domain_length = index++; + setDomainLength(index++); break domain_parsing; case '=' : // ":" omission check. @@ -469,7 +471,7 @@ "Invalid character '\\n' in domain name"); case '*' : case '?' : - _domain_pattern = true; + setDomainPattern(true); index++; break; default : @@ -484,6 +486,7 @@ "Key properties cannot be empty"); // we have got the domain part, begins building of _canonicalName + int _domain_length = getDomainLength(); System.arraycopy(name_chars, 0, canonical_chars, 0, _domain_length); canonical_chars[_domain_length] = ':'; cname_index = _domain_length + 1; @@ -500,20 +503,20 @@ keys = new String[10]; _kp_array = new Property[10]; - _property_list_pattern = false; - _property_value_pattern = false; + setPropertyListPattern(false); + setPropertyValuePattern(false); while (index < len) { c = name_chars[index]; // case of pattern properties if (c == '*') { - if (_property_list_pattern) + if (isPropertyListPattern()) throw new MalformedObjectNameException( "Cannot have several '*' characters in pattern " + "property list"); else { - _property_list_pattern = true; + setPropertyListPattern(true); if ((++index < len ) && (name_chars[index] != ',')) throw new MalformedObjectNameException( "Invalid character found after '*': end of " + @@ -639,7 +642,7 @@ if (!value_pattern) { prop = new Property(key_index, key_length, value_length); } else { - _property_value_pattern = true; + setPropertyValuePattern(true); prop = new PatternProperty(key_index, key_length, value_length); } key_name = name.substring(key_index, key_index + key_length); @@ -670,7 +673,8 @@ * @exception MalformedObjectNameException The domain * contains an illegal character, or one of the keys or values in * table contains an illegal character, or one of the - * values in table does not follow the rules for quoting. + * values in table does not follow the rules for quoting, + * or the domain's length exceeds the maximum allowed length. * @exception NullPointerException One of the parameters is null. */ private void construct(String domain, Map props) @@ -696,7 +700,7 @@ // init canonicalname final StringBuilder sb = new StringBuilder(); sb.append(domain).append(':'); - _domain_length = domain.length(); + setDomainLength(domain.length()); // allocates the property array int nb_props = props.size(); @@ -729,7 +733,7 @@ key.length(), value.length()); } else { - _property_value_pattern = true; + setPropertyValuePattern(true); prop = new PatternProperty(key_index, key.length(), value.length()); @@ -743,10 +747,10 @@ char[] initial_chars = new char[len]; sb.getChars(0, len, initial_chars, 0); char[] canonical_chars = new char[len]; - System.arraycopy(initial_chars, 0, canonical_chars, 0, - _domain_length + 1); + int copyLen = getDomainLength() + 1; + System.arraycopy(initial_chars, 0, canonical_chars, 0, copyLen); setCanonicalName(initial_chars, canonical_chars, keys, keys_map, - _domain_length + 1, _kp_array.length); + copyLen, _kp_array.length); } // Category : Instance construction <============================== @@ -822,7 +826,7 @@ } // terminate canonicalname with '*' in case of pattern - if (_property_list_pattern) { + if (isPropertyListPattern()) { if (_kp_array != _Empty_property_array) canonical_chars[prop_index++] = ','; canonical_chars[prop_index++] = '*'; @@ -1051,13 +1055,32 @@ return false; case '*' : case '?' : - _domain_pattern = true; + setDomainPattern(true); break; } } return true; } + private int getDomainLength() { + return _compressed_storage & DOMAIN_LENGTH_MASK; + } + + /** + * Validates and sets the domain length + * @param length The domain length + * @throws MalformedObjectNameException + * When the given domain length exceeds the maximum allowed length + */ + private void setDomainLength(int length) throws MalformedObjectNameException { + if ((length & FLAG_MASK) != 0 ) { + throw new MalformedObjectNameException( + "Domain name too long. Maximum allowed domain name length is:" + + DOMAIN_LENGTH_MASK); + } + _compressed_storage = (_compressed_storage & FLAG_MASK) | length; + } + // Category : Internal accessors <============================== // Category : Serialization -----------------------------------> @@ -1225,12 +1248,12 @@ // Serializes this instance in the old serial form // Read CR 6441274 before making any changes to this code ObjectOutputStream.PutField fields = out.putFields(); - fields.put("domain", _canonicalName.substring(0, _domain_length)); + fields.put("domain", _canonicalName.substring(0, getDomainLength())); fields.put("propertyList", getKeyPropertyList()); fields.put("propertyListString", getKeyPropertyListString()); fields.put("canonicalName", _canonicalName); - fields.put("pattern", (_domain_pattern || _property_list_pattern)); - fields.put("propertyPattern", _property_list_pattern); + fields.put("pattern", (_compressed_storage & (DOMAIN_PATTERN | PROPLIST_PATTERN)) != 0); + fields.put("propertyPattern", isPropertyListPattern()); out.writeFields(); } else @@ -1291,7 +1314,8 @@ * @exception MalformedObjectNameException The * domain, key, or value * contains an illegal character, or value does not - * follow the rules for quoting. + * follow the rules for quoting, or the domain's length exceeds + * the maximum allowed length. * @exception NullPointerException One of the parameters is null. * */ @@ -1322,7 +1346,7 @@ * contains an illegal character, or one of the keys or values in * table contains an illegal character, or one of the * values in table does not follow the rules for - * quoting. + * quoting, or the domain's length exceeds the maximum allowed length. * @exception NullPointerException One of the parameters is null. * */ @@ -1392,7 +1416,8 @@ * @exception MalformedObjectNameException The * domain, key, or value * contains an illegal character, or value does not - * follow the rules for quoting. + * follow the rules for quoting, or the domain's length exceeds + * the maximum allowed length. * @exception NullPointerException One of the parameters is null. */ public ObjectName(String domain, String key, String value) @@ -1417,7 +1442,7 @@ * contains an illegal character, or one of the keys or values in * table contains an illegal character, or one of the * values in table does not follow the rules for - * quoting. + * quoting, or the domain's length exceeds the maximum allowed length. * @exception NullPointerException One of the parameters is null. */ public ObjectName(String domain, Hashtable table) @@ -1443,9 +1468,7 @@ * @return True if the name is a pattern, otherwise false. */ public boolean isPattern() { - return (_domain_pattern || - _property_list_pattern || - _property_value_pattern); + return (_compressed_storage & FLAG_MASK) != 0; } /** @@ -1455,7 +1478,20 @@ * */ public boolean isDomainPattern() { - return _domain_pattern; + return (_compressed_storage & DOMAIN_PATTERN) != 0; + } + + /** + * Marks the object name as representing a pattern on the domain part. + * @param value {@code true} if the domain name is a pattern, + * {@code false} otherwise + */ + private void setDomainPattern(boolean value) { + if (value) { + _compressed_storage |= DOMAIN_PATTERN; + } else { + _compressed_storage &= ~DOMAIN_PATTERN; + } } /** @@ -1468,7 +1504,7 @@ * @return True if the name is a property pattern, otherwise false. */ public boolean isPropertyPattern() { - return _property_list_pattern || _property_value_pattern; + return (_compressed_storage & (PROPVAL_PATTERN | PROPLIST_PATTERN)) != 0; } /** @@ -1482,7 +1518,20 @@ * @since 1.6 */ public boolean isPropertyListPattern() { - return _property_list_pattern; + return (_compressed_storage & PROPLIST_PATTERN) != 0; + } + + /** + * Marks the object name as representing a pattern on the key property list. + * @param value {@code true} if the key property list is a pattern, + * {@code false} otherwise + */ + private void setPropertyListPattern(boolean value) { + if (value) { + _compressed_storage |= PROPLIST_PATTERN; + } else { + _compressed_storage &= ~PROPLIST_PATTERN; + } } /** @@ -1497,7 +1546,20 @@ * @since 1.6 */ public boolean isPropertyValuePattern() { - return _property_value_pattern; + return (_compressed_storage & PROPVAL_PATTERN) != 0; + } + + /** + * Marks the object name as representing a pattern on the value part. + * @param value {@code true} if the value part of at least one of the + * key properties is a pattern, {@code false} otherwise + */ + private void setPropertyValuePattern(boolean value) { + if (value) { + _compressed_storage |= PROPVAL_PATTERN; + } else { + _compressed_storage &= ~PROPVAL_PATTERN; + } } /** @@ -1563,7 +1625,7 @@ * @return The domain. */ public String getDomain() { - return _canonicalName.substring(0, _domain_length); + return _canonicalName.substring(0, getDomainLength()); } /** @@ -1640,8 +1702,8 @@ // the size of the string is the canonical one minus domain // part and pattern part - final int total_size = _canonicalName.length() - _domain_length - 1 - - (_property_list_pattern?2:0); + final int total_size = _canonicalName.length() - getDomainLength() - 1 + - (isPropertyListPattern()?2:0); final char[] dest_chars = new char[total_size]; final char[] value = _canonicalName.toCharArray(); @@ -1665,7 +1727,7 @@ final int total_size = _canonicalName.length(); final char[] dest_chars = new char[total_size]; final char[] value = _canonicalName.toCharArray(); - final int offset = _domain_length+1; + final int offset = getDomainLength() + 1; // copy "domain:" into dest_chars // @@ -1675,7 +1737,7 @@ final int end = writeKeyPropertyListString(value,dest_chars,offset); // Add ",*" if necessary - if (_property_list_pattern) { + if (isPropertyListPattern()) { if (end == offset) { // Property list string is empty. dest_chars[end] = '*'; @@ -1737,8 +1799,8 @@ if (_ca_array.length == 0) return ""; int len = _canonicalName.length(); - if (_property_list_pattern) len -= 2; - return _canonicalName.substring(_domain_length +1, len); + if (isPropertyListPattern()) len -= 2; + return _canonicalName.substring(getDomainLength() + 1, len); } // Category : Getter methods <=================================== @@ -1944,22 +2006,18 @@ if (name == null) throw new NullPointerException(); - if (name._domain_pattern || - name._property_list_pattern || - name._property_value_pattern) + if (name.isPattern()) return false; // No pattern - if (!_domain_pattern && - !_property_list_pattern && - !_property_value_pattern) + if (!isPattern()) return _canonicalName.equals(name._canonicalName); return matchDomains(name) && matchKeys(name); } private final boolean matchDomains(ObjectName name) { - if (_domain_pattern) { + if (isDomainPattern()) { // wildmatch domains // This ObjectName is the pattern // The other ObjectName is the string. @@ -1972,15 +2030,15 @@ // If key property value pattern but not key property list // pattern, then the number of key properties must be equal // - if (_property_value_pattern && - !_property_list_pattern && + if (isPropertyValuePattern() && + !isPropertyListPattern() && (name._ca_array.length != _ca_array.length)) return false; // If key property value pattern or key property list pattern, // then every property inside pattern should exist in name // - if (_property_value_pattern || _property_list_pattern) { + if (isPropertyPattern()) { final Map nameProps = name._getKeyPropertyList(); final Property[] props = _ca_array; final String cn = _canonicalName; @@ -1996,7 +2054,7 @@ if (v == null) return false; // If this property is ok (same key, same value), go to next // - if (_property_value_pattern && (p instanceof PatternProperty)) { + if (isPropertyValuePattern() && (p instanceof PatternProperty)) { // wildmatch key property values // p is the property pattern, v is the string if (Util.wildmatch(v,p.getValueString(cn))) diff -r 82e066c83bd0 -r b348f693a10e src/java.security.jgss/share/classes/javax/security/auth/kerberos/DelegationPermission.java --- a/src/java.security.jgss/share/classes/javax/security/auth/kerberos/DelegationPermission.java Tue Sep 08 16:01:29 2015 +0400 +++ b/src/java.security.jgss/share/classes/javax/security/auth/kerberos/DelegationPermission.java Tue Sep 08 14:40:44 2015 -0700 @@ -132,7 +132,9 @@ * Checks if this Kerberos delegation permission object "implies" the * specified permission. *

- * If none of the above are true, {@code implies} returns false. + * This method returns true if this {@code DelegationPermission} + * is equal to {@code p}, and returns false otherwise. + * * @param p the permission to check against. * * @return true if the specified permission is implied by this object, diff -r 82e066c83bd0 -r b348f693a10e src/java.security.jgss/share/classes/javax/security/auth/kerberos/ServicePermission.java --- a/src/java.security.jgss/share/classes/javax/security/auth/kerberos/ServicePermission.java Tue Sep 08 16:01:29 2015 +0400 +++ b/src/java.security.jgss/share/classes/javax/security/auth/kerberos/ServicePermission.java Tue Sep 08 14:40:44 2015 -0700 @@ -179,7 +179,16 @@ * Checks if this Kerberos service permission object "implies" the * specified permission. *

- * If none of the above are true, {@code implies} returns false. + * More specifically, this method returns true if all of the following + * are true (and returns false if any of them are not): + *

    + *
  • p is an instanceof {@code ServicePermission}, + *
  • p's actions are a proper subset of this + * {@code ServicePermission}'s actions, + *
  • p's name is equal to this {@code ServicePermission}'s name + * or this {@code ServicePermission}'s name is "*". + *
+ * * @param p the permission to check against. * * @return true if the specified permission is implied by this object, diff -r 82e066c83bd0 -r b348f693a10e src/java.sql.rowset/share/classes/javax/sql/rowset/BaseRowSet.java --- a/src/java.sql.rowset/share/classes/javax/sql/rowset/BaseRowSet.java Tue Sep 08 16:01:29 2015 +0400 +++ b/src/java.sql.rowset/share/classes/javax/sql/rowset/BaseRowSet.java Tue Sep 08 14:40:44 2015 -0700 @@ -4467,4 +4467,4 @@ static final long serialVersionUID = 4886719666485113312L; -} //end class \ No newline at end of file +} //end class diff -r 82e066c83bd0 -r b348f693a10e src/java.sql.rowset/share/classes/javax/sql/rowset/RowSetFactory.java --- a/src/java.sql.rowset/share/classes/javax/sql/rowset/RowSetFactory.java Tue Sep 08 16:01:29 2015 +0400 +++ b/src/java.sql.rowset/share/classes/javax/sql/rowset/RowSetFactory.java Tue Sep 08 14:40:44 2015 -0700 @@ -96,4 +96,4 @@ */ public WebRowSet createWebRowSet() throws SQLException; -} \ No newline at end of file +} diff -r 82e066c83bd0 -r b348f693a10e src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/algorithms/package.html --- a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/algorithms/package.html Tue Sep 08 16:01:29 2015 +0400 +++ b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/algorithms/package.html Tue Sep 08 14:40:44 2015 -0700 @@ -1,3 +1,3 @@

algorithm factories. -

\ No newline at end of file +

diff -r 82e066c83bd0 -r b348f693a10e src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/content/keyvalues/package.html --- a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/content/keyvalues/package.html Tue Sep 08 16:01:29 2015 +0400 +++ b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/content/keyvalues/package.html Tue Sep 08 14:40:44 2015 -0700 @@ -1,3 +1,3 @@

basic handlers for elements that can occur inside ds:KeyValue. -

\ No newline at end of file +

diff -r 82e066c83bd0 -r b348f693a10e src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/content/package.html --- a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/content/package.html Tue Sep 08 16:01:29 2015 +0400 +++ b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/content/package.html Tue Sep 08 14:40:44 2015 -0700 @@ -1,3 +1,3 @@

basic handlers for elements that can occur inside ds:KeyInfo. -

\ No newline at end of file +

diff -r 82e066c83bd0 -r b348f693a10e src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/content/x509/package.html --- a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/content/x509/package.html Tue Sep 08 16:01:29 2015 +0400 +++ b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/content/x509/package.html Tue Sep 08 14:40:44 2015 -0700 @@ -1,3 +1,3 @@

basic handlers for elements that can occur inside ds:X509Data. -

\ No newline at end of file +

diff -r 82e066c83bd0 -r b348f693a10e src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/keyresolver/implementations/package.html --- a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/keyresolver/implementations/package.html Tue Sep 08 16:01:29 2015 +0400 +++ b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/keyresolver/implementations/package.html Tue Sep 08 14:40:44 2015 -0700 @@ -1,3 +1,3 @@

implementations for retrieval of certificates and public keys from elements. -

\ No newline at end of file +

diff -r 82e066c83bd0 -r b348f693a10e src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/keyresolver/package.html --- a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/keyresolver/package.html Tue Sep 08 16:01:29 2015 +0400 +++ b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/keyresolver/package.html Tue Sep 08 14:40:44 2015 -0700 @@ -1,3 +1,3 @@

the resolver framework for retrieval of certificates and public keys from elements. -

\ No newline at end of file +

diff -r 82e066c83bd0 -r b348f693a10e src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/storage/implementations/package.html --- a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/storage/implementations/package.html Tue Sep 08 16:01:29 2015 +0400 +++ b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/storage/implementations/package.html Tue Sep 08 14:40:44 2015 -0700 @@ -1,3 +1,3 @@

implementations of resolvers for retrieval for certificates and public keys from user-specified locations. -

\ No newline at end of file +

diff -r 82e066c83bd0 -r b348f693a10e src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/storage/package.html --- a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/storage/package.html Tue Sep 08 16:01:29 2015 +0400 +++ b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/storage/package.html Tue Sep 08 14:40:44 2015 -0700 @@ -1,3 +1,3 @@

a resolver framework for certificates and public keys from user-specified locations. -

\ No newline at end of file +

diff -r 82e066c83bd0 -r b348f693a10e src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/transforms/TransformParam.java --- a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/transforms/TransformParam.java Tue Sep 08 16:01:29 2015 +0400 +++ b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/transforms/TransformParam.java Tue Sep 08 14:40:44 2015 -0700 @@ -24,4 +24,4 @@ package com.sun.org.apache.xml.internal.security.transforms; public interface TransformParam { -} \ No newline at end of file +} diff -r 82e066c83bd0 -r b348f693a10e src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/NativeKey.java --- a/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/NativeKey.java Tue Sep 08 16:01:29 2015 +0400 +++ b/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/NativeKey.java Tue Sep 08 14:40:44 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 @@ -31,19 +31,9 @@ import java.lang.ref.*; import java.math.BigInteger; -import java.security.InvalidKeyException; -import java.security.NoSuchAlgorithmException; -import java.security.Key; -import java.security.PublicKey; -import java.security.PrivateKey; -import java.security.KeyFactorySpi; -import java.security.interfaces.RSAPrivateCrtKey; -import java.security.interfaces.RSAPublicKey; - -import java.security.spec.InvalidKeySpecException; -import java.security.spec.KeySpec; -import java.security.spec.RSAPrivateCrtKeySpec; -import java.security.spec.RSAPublicKeySpec; +import java.security.*; +import java.security.interfaces.*; +import java.security.spec.*; /** * Wrapper class for native keys needed for using ucrypto APIs. @@ -87,6 +77,41 @@ return b; } + static final class RSAPrivate extends NativeKey implements RSAPrivateKey { + + private static final long serialVersionUID = 1622705588904302831L; + + private final RSAPrivateKeySpec keySpec; + private final long keyId; + + RSAPrivate(KeySpec keySpec) throws InvalidKeySpecException { + super(2); + long pKey = 0L; + if (keySpec instanceof RSAPrivateKeySpec) { + RSAPrivateKeySpec ks = (RSAPrivateKeySpec) keySpec; + BigInteger mod = ks.getModulus(); + BigInteger privateExp = ks.getPrivateExponent(); + pKey = nativeInit(NativeKey.getMagnitude(mod), + NativeKey.getMagnitude(privateExp)); + } else { + throw new InvalidKeySpecException("Only supports RSAPrivateKeySpec"); + } + if (pKey == 0L) { + throw new UcryptoException("Error constructing RSA PrivateKey"); + } + // track native resource clean up + new KeyRef(this, pKey); + this.keySpec = (RSAPrivateKeySpec) keySpec; + this.keyId = pKey; + } + + long value() { return keyId; } + public BigInteger getModulus() { return keySpec.getModulus(); }; + public BigInteger getPrivateExponent() { return keySpec.getPrivateExponent(); }; + + private native static long nativeInit(byte[] mod, byte[] privExp); + } + static final class RSAPrivateCrt extends NativeKey implements RSAPrivateCrtKey { private static final long serialVersionUID = 6812507588904302831L; @@ -119,7 +144,7 @@ throw new InvalidKeySpecException("Only supports RSAPrivateCrtKeySpec"); } if (pKey == 0L) { - throw new UcryptoException("Error constructing RSA PrivateKey"); + throw new UcryptoException("Error constructing RSA PrivateCrtKey"); } // track native resource clean up new KeyRef(this, pKey); diff -r 82e066c83bd0 -r b348f693a10e src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/NativeRSACipher.java --- a/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/NativeRSACipher.java Tue Sep 08 16:01:29 2015 +0400 +++ b/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/NativeRSACipher.java Tue Sep 08 14:40:44 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 @@ -37,9 +37,11 @@ import java.security.PublicKey; import java.security.PrivateKey; import java.security.spec.RSAPrivateCrtKeySpec; +import java.security.spec.RSAPrivateKeySpec; import java.security.spec.RSAPublicKeySpec; import java.security.interfaces.RSAKey; import java.security.interfaces.RSAPrivateCrtKey; +import java.security.interfaces.RSAPrivateKey; import java.security.interfaces.RSAPublicKey; import java.security.KeyFactory; @@ -205,8 +207,8 @@ // Make sure the proper opmode uses the proper key if (doEncrypt && (!(newKey instanceof RSAPublicKey))) { throw new InvalidKeyException("RSAPublicKey required for encryption"); - } else if (!doEncrypt && (!(newKey instanceof RSAPrivateCrtKey))) { - throw new InvalidKeyException("RSAPrivateCrtKey required for decryption"); + } else if (!doEncrypt && (!(newKey instanceof RSAPrivateKey))) { + throw new InvalidKeyException("RSAPrivateKey required for decryption"); } NativeKey nativeKey = null; @@ -223,17 +225,26 @@ throw new InvalidKeyException(ikse); } } else { - RSAPrivateCrtKey privateKey = (RSAPrivateCrtKey) newKey; try { - nativeKey = (NativeKey) keyFactory.engineGeneratePrivate - (new RSAPrivateCrtKeySpec(privateKey.getModulus(), - privateKey.getPublicExponent(), - privateKey.getPrivateExponent(), - privateKey.getPrimeP(), - privateKey.getPrimeQ(), - privateKey.getPrimeExponentP(), - privateKey.getPrimeExponentQ(), - privateKey.getCrtCoefficient())); + if (newKey instanceof RSAPrivateCrtKey) { + RSAPrivateCrtKey privateKey = (RSAPrivateCrtKey) newKey; + nativeKey = (NativeKey) keyFactory.engineGeneratePrivate + (new RSAPrivateCrtKeySpec(privateKey.getModulus(), + privateKey.getPublicExponent(), + privateKey.getPrivateExponent(), + privateKey.getPrimeP(), + privateKey.getPrimeQ(), + privateKey.getPrimeExponentP(), + privateKey.getPrimeExponentQ(), + privateKey.getCrtCoefficient())); + } 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"); + } } catch (InvalidKeySpecException ikse) { throw new InvalidKeyException(ikse); } diff -r 82e066c83bd0 -r b348f693a10e src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/NativeRSAKeyFactory.java --- a/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/NativeRSAKeyFactory.java Tue Sep 08 16:01:29 2015 +0400 +++ b/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/NativeRSAKeyFactory.java Tue Sep 08 14:40:44 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 @@ -38,16 +38,11 @@ import java.security.PrivateKey; import java.security.KeyFactorySpi; -import java.security.spec.InvalidKeySpecException; -import java.security.spec.KeySpec; -import java.security.spec.RSAPrivateCrtKeySpec; -import java.security.spec.RSAPublicKeySpec; +import java.security.spec.*; /** * Ucrypto-private KeyFactory class for generating native keys - * needed for using ucrypto APIs. Given that it's not used - * externally, it only needs to support RSAPrivateCrtKeySpec - * and RSAPublicKeySpec objects. + * needed for using ucrypto APIs. * * @since 1.9 */ @@ -56,7 +51,13 @@ @Override protected PrivateKey engineGeneratePrivate(KeySpec keySpec) throws InvalidKeySpecException { - return new NativeKey.RSAPrivateCrt(keySpec); + if (keySpec instanceof RSAPrivateCrtKeySpec) { + return new NativeKey.RSAPrivateCrt(keySpec); + } else if (keySpec instanceof RSAPrivateKeySpec) { + return new NativeKey.RSAPrivate(keySpec); + } else { + throw new InvalidKeySpecException("Unsupported key spec"); + } } @Override diff -r 82e066c83bd0 -r b348f693a10e src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/NativeRSASignature.java --- a/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/NativeRSASignature.java Tue Sep 08 16:01:29 2015 +0400 +++ b/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/NativeRSASignature.java Tue Sep 08 14:40:44 2015 -0700 @@ -43,9 +43,8 @@ import java.security.*; import java.security.interfaces.*; -import java.security.spec.RSAPrivateCrtKeySpec; -import java.security.spec.RSAPublicKeySpec; -import java.security.spec.InvalidKeySpecException; +import java.security.spec.*; + import sun.nio.ch.DirectBuffer; import java.nio.ByteBuffer; @@ -192,25 +191,31 @@ int newSigLength = sigLength; // Need to check RSA key length whenever a new private key is set if (privateKey != key) { - if (privateKey instanceof RSAPrivateCrtKey) { - RSAPrivateCrtKey rsaPrivKey = (RSAPrivateCrtKey) privateKey; - BigInteger mod = rsaPrivKey.getModulus(); - newSigLength = checkRSAKeyLength(mod); - try { + if (!(privateKey instanceof RSAPrivateKey)) { + throw new InvalidKeyException("RSAPrivateKey required"); + } + RSAPrivateKey rsaPrivKey = (RSAPrivateKey) privateKey; + BigInteger mod = rsaPrivKey.getModulus(); + newSigLength = checkRSAKeyLength(mod); + BigInteger pe = rsaPrivKey.getPrivateExponent(); + try { + if (rsaPrivKey instanceof RSAPrivateCrtKey) { + RSAPrivateCrtKey rsaPrivCrtKey = (RSAPrivateCrtKey) rsaPrivKey; newKey = (NativeKey) keyFactory.engineGeneratePrivate (new RSAPrivateCrtKeySpec(mod, - rsaPrivKey.getPublicExponent(), - rsaPrivKey.getPrivateExponent(), - rsaPrivKey.getPrimeP(), - rsaPrivKey.getPrimeQ(), - rsaPrivKey.getPrimeExponentP(), - rsaPrivKey.getPrimeExponentQ(), - rsaPrivKey.getCrtCoefficient())); - } catch (InvalidKeySpecException ikse) { - throw new InvalidKeyException(ikse); + rsaPrivCrtKey.getPublicExponent(), + pe, + rsaPrivCrtKey.getPrimeP(), + rsaPrivCrtKey.getPrimeQ(), + rsaPrivCrtKey.getPrimeExponentP(), + rsaPrivCrtKey.getPrimeExponentQ(), + rsaPrivCrtKey.getCrtCoefficient())); + } else { + newKey = (NativeKey) keyFactory.engineGeneratePrivate + (new RSAPrivateKeySpec(mod, pe)); } - } else { - throw new InvalidKeyException("RSAPrivateCrtKey required"); + } catch (InvalidKeySpecException ikse) { + throw new InvalidKeyException(ikse); } } init(true, newKey, newSigLength); diff -r 82e066c83bd0 -r b348f693a10e src/jdk.crypto.ucrypto/solaris/native/libj2ucrypto/nativeCrypto.c --- a/src/jdk.crypto.ucrypto/solaris/native/libj2ucrypto/nativeCrypto.c Tue Sep 08 16:01:29 2015 +0400 +++ b/src/jdk.crypto.ucrypto/solaris/native/libj2ucrypto/nativeCrypto.c Tue Sep 08 14:40:44 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 @@ -435,6 +435,11 @@ int rv = 0; context = (crypto_ctx_t *) pContext; + // Avoid null output buffer to workaround Solaris bug21481818 (fixed in S12) + if (bufOut == NULL) { + bufOut = (unsigned char *)(&outLen); + outLen = 0; + } rv = CipherFinal(context, encrypt, (unsigned char*)bufOut, outOfs, &outLen); free(context); if (rv) { @@ -648,7 +653,8 @@ // out is null when nativeFinal() is called solely for resource clean up if (out == NULL) { - bufOut = NULL; + // Avoid null output buffer to workaround Solaris bug21481818 (fixed in S12) + bufOut = (unsigned char *)(&outLen); outLen = 0; } else { outLen = (*env)->GetArrayLength(env, out) - outOfs; @@ -661,10 +667,12 @@ rv = CipherFinal(context, encrypt, bufOut, 0, &outLen); if (rv) { free(context); - free(bufOut); + if (outLen != 0) { + free(bufOut); + } return -rv; } else { - if (bufOut != NULL) { + if (bufOut != NULL && outLen != 0) { (*env)->SetByteArrayRegion(env, out, outOfs, outLen, (jbyte *)bufOut); free(bufOut); } @@ -697,6 +705,86 @@ } /* + * Class: com_oracle_security_ucrypto_NativeKey_RSAPrivate + * Method: nativeInit + * Signature: ([B[B)J + */ +jlong JavaCritical_com_oracle_security_ucrypto_NativeKey_00024RSAPrivate_nativeInit +(int modLen, jbyte* jMod, int privLen, jbyte* jPriv) { + + unsigned char *mod, *priv; + crypto_object_attribute_t* pKey = NULL; + + pKey = calloc(2, sizeof(crypto_object_attribute_t)); + if (pKey == NULL) { + return 0L; + } + mod = priv = NULL; + mod = malloc(modLen); + priv = malloc(privLen); + if (mod == NULL || priv == NULL) { + free(pKey); + free(mod); + free(priv); + return 0L; + } else { + memcpy(mod, jMod, modLen); + memcpy(priv, jPriv, privLen); + } + + // NOTE: numOfComponents should be 2 + pKey[0].oa_type = SUN_CKA_MODULUS; + pKey[0].oa_value = (char*) mod; + pKey[0].oa_value_len = (size_t) modLen; + pKey[1].oa_type = SUN_CKA_PRIVATE_EXPONENT; + pKey[1].oa_value = (char*) priv; + pKey[1].oa_value_len = (size_t) privLen; + + return (jlong) pKey; +} + +JNIEXPORT jlong JNICALL +Java_com_oracle_security_ucrypto_NativeKey_00024RSAPrivate_nativeInit + (JNIEnv *env, jclass jCls, jbyteArray jMod, jbyteArray jPriv) { + + int modLen, privLen; + jbyte *bufMod, *bufPriv; + crypto_object_attribute_t* pKey = NULL; + + bufMod = bufPriv = NULL; + + modLen = (*env)->GetArrayLength(env, jMod); + bufMod = getBytes(env, jMod, 0, modLen); + if ((*env)->ExceptionCheck(env)) goto cleanup; + + privLen = (*env)->GetArrayLength(env, jPriv); + bufPriv = getBytes(env, jPriv, 0, privLen); + if ((*env)->ExceptionCheck(env)) goto cleanup; + + // proceed if no error; otherwise free allocated memory + pKey = calloc(2, sizeof(crypto_object_attribute_t)); + if (pKey == NULL) { + throwOutOfMemoryError(env, NULL); + goto cleanup; + } + + // NOTE: numOfComponents should be 2 + pKey[0].oa_type = SUN_CKA_MODULUS; + pKey[0].oa_value = (char*) bufMod; + pKey[0].oa_value_len = (size_t) modLen; + pKey[1].oa_type = SUN_CKA_PRIVATE_EXPONENT; + pKey[1].oa_value = (char*) bufPriv; + pKey[1].oa_value_len = (size_t) privLen; + return (jlong) pKey; + +cleanup: + free(bufMod); + free(bufPriv); + + return 0L; +} + +/* * Class: com_oracle_security_ucrypto_NativeKey_RSAPrivateCrt * Method: nativeInit * Signature: ([B[B[B[B[B[B[B[B)J diff -r 82e066c83bd0 -r b348f693a10e src/jdk.jcmd/share/classes/sun/tools/jps/Jps.java --- a/src/jdk.jcmd/share/classes/sun/tools/jps/Jps.java Tue Sep 08 16:01:29 2015 +0400 +++ b/src/jdk.jcmd/share/classes/sun/tools/jps/Jps.java Tue Sep 08 14:40:44 2015 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2013, 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 @@ -106,7 +106,11 @@ errorString = " -- jvm args information unavailable"; String jvmArgs = MonitoredVmUtil.jvmArgs(vm); if (jvmArgs != null && jvmArgs.length() > 0) { - output.append(' ').append(jvmArgs); + output.append(' ') + .append( + // multi-line args are permitted + jvmArgs.replace("\n", "\\n").replace("\r", "\\r") + ); } } if (arguments.showVmFlags()) { diff -r 82e066c83bd0 -r b348f693a10e src/jdk.management/linux/native/libmanagement_ext/UnixOperatingSystem.c --- a/src/jdk.management/linux/native/libmanagement_ext/UnixOperatingSystem.c Tue Sep 08 16:01:29 2015 +0400 +++ b/src/jdk.management/linux/native/libmanagement_ext/UnixOperatingSystem.c Tue Sep 08 14:40:44 2015 -0700 @@ -77,14 +77,17 @@ static int get_totalticks(int which, ticks *pticks) { FILE *fh; uint64_t userTicks, niceTicks, systemTicks, idleTicks; + uint64_t iowTicks = 0, irqTicks = 0, sirqTicks= 0; int n; if((fh = fopen("/proc/stat", "r")) == NULL) { return -1; } - n = fscanf(fh, "cpu " DEC_64 " " DEC_64 " " DEC_64 " " DEC_64, - &userTicks, &niceTicks, &systemTicks, &idleTicks); + n = fscanf(fh, "cpu " DEC_64 " " DEC_64 " " DEC_64 " " DEC_64 " " DEC_64 " " + DEC_64 " " DEC_64, + &userTicks, &niceTicks, &systemTicks, &idleTicks, + &iowTicks, &irqTicks, &sirqTicks); // Move to next line next_line(fh); @@ -93,24 +96,30 @@ if (which != -1) { int i; for (i = 0; i < which; i++) { - if (fscanf(fh, "cpu%*d " DEC_64 " " DEC_64 " " DEC_64 " " DEC_64, &userTicks, &niceTicks, &systemTicks, &idleTicks) != 4) { + if (fscanf(fh, "cpu%*d " DEC_64 " " DEC_64 " " DEC_64 " " DEC_64 " " + DEC_64 " " DEC_64 " " DEC_64, + &userTicks, &niceTicks, &systemTicks, &idleTicks, + &iowTicks, &irqTicks, &sirqTicks) < 4) { fclose(fh); return -2; } next_line(fh); } - n = fscanf(fh, "cpu%*d " DEC_64 " " DEC_64 " " DEC_64 " " DEC_64 "\n", - &userTicks, &niceTicks, &systemTicks, &idleTicks); + n = fscanf(fh, "cpu%*d " DEC_64 " " DEC_64 " " DEC_64 " " DEC_64 " " + DEC_64 " " DEC_64 " " DEC_64 "\n", + &userTicks, &niceTicks, &systemTicks, &idleTicks, + &iowTicks, &irqTicks, &sirqTicks); } fclose(fh); - if (n != 4) { + if (n < 4) { return -2; } pticks->used = userTicks + niceTicks; - pticks->usedKernel = systemTicks; - pticks->total = userTicks + niceTicks + systemTicks + idleTicks; + pticks->usedKernel = systemTicks + irqTicks + sirqTicks; + pticks->total = userTicks + niceTicks + systemTicks + idleTicks + + iowTicks + irqTicks + sirqTicks; return 0; } diff -r 82e066c83bd0 -r b348f693a10e src/sample/share/annotations/DependencyChecker/PluginChecker/src/checker/Kettle.xml --- a/src/sample/share/annotations/DependencyChecker/PluginChecker/src/checker/Kettle.xml Tue Sep 08 16:01:29 2015 +0400 +++ b/src/sample/share/annotations/DependencyChecker/PluginChecker/src/checker/Kettle.xml Tue Sep 08 14:40:44 2015 -0700 @@ -54,4 +54,4 @@ 4 - \ No newline at end of file + diff -r 82e066c83bd0 -r b348f693a10e src/sample/share/annotations/index.html --- a/src/sample/share/annotations/index.html Tue Sep 08 16:01:29 2015 +0400 +++ b/src/sample/share/annotations/index.html Tue Sep 08 14:40:44 2015 -0700 @@ -64,4 +64,4 @@ Sources: Validator/src/ - \ No newline at end of file + diff -r 82e066c83bd0 -r b348f693a10e src/sample/share/lambda/BulkDataOperations/index.html --- a/src/sample/share/lambda/BulkDataOperations/index.html Tue Sep 08 16:01:29 2015 +0400 +++ b/src/sample/share/lambda/BulkDataOperations/index.html Tue Sep 08 14:40:44 2015 -0700 @@ -46,4 +46,4 @@ Source: src/WC.java - \ No newline at end of file + diff -r 82e066c83bd0 -r b348f693a10e src/sample/share/try-with-resources/index.html --- a/src/sample/share/try-with-resources/index.html Tue Sep 08 16:01:29 2015 +0400 +++ b/src/sample/share/try-with-resources/index.html Tue Sep 08 14:40:44 2015 -0700 @@ -33,4 +33,4 @@ - \ No newline at end of file + diff -r 82e066c83bd0 -r b348f693a10e test/ProblemList.txt --- a/test/ProblemList.txt Tue Sep 08 16:01:29 2015 +0400 +++ b/test/ProblemList.txt Tue Sep 08 14:40:44 2015 -0700 @@ -136,9 +136,6 @@ # 8133552 java/lang/ProcessHandle/InfoTest.java generic-all -# 8134677 -java/lang/SecurityManager/CheckPackageMatching.java windows-all - ############################################################################ # jdk_instrument @@ -322,6 +319,9 @@ # jdk_time +# 8134979 +java/time/tck/java/time/chrono/TCKJapaneseChronology.java generic-all + ############################################################################ # jdk_tools @@ -387,11 +387,6 @@ # 6456333 sun/tools/jps/TestJpsJarRelative.java generic-all -# 8134420 -sun/tools/jps/TestJpsClass.java generic-all -sun/tools/jps/TestJpsJar.java generic-all -sun/tools/jps/TestJpsSanity.java generic-all - # 6734748 sun/tools/jinfo/JInfoRunningProcessFlagTest.java generic-all diff -r 82e066c83bd0 -r b348f693a10e test/com/oracle/security/ucrypto/CipherSignNotSupported.java --- a/test/com/oracle/security/ucrypto/CipherSignNotSupported.java Tue Sep 08 16:01:29 2015 +0400 +++ b/test/com/oracle/security/ucrypto/CipherSignNotSupported.java Tue Sep 08 14:40:44 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 @@ -23,7 +23,7 @@ /** * @test - * @bug 8029849 + * @bug 8029849 8132082 * @summary Make sure signing via encrypt and verifying via decrypt are not * supported by OracleUcrypto provider. * @author Anthony Scarpino @@ -31,12 +31,10 @@ */ import java.util.Random; -import java.security.KeyPairGenerator; -import java.security.KeyPair; +import java.security.*; +import java.security.interfaces.*; +import java.security.spec.RSAPrivateKeySpec; import javax.crypto.Cipher; -import java.security.InvalidKeyException; -import java.security.NoSuchAlgorithmException; -import java.security.Provider; public class CipherSignNotSupported extends UcryptoTest { @@ -69,27 +67,43 @@ c.init(Cipher.ENCRYPT_MODE, kp.getPublic()); ct = c.doFinal(pt); // Decryption - c.init(Cipher.DECRYPT_MODE, kp.getPrivate()); - c.doFinal(ct); - // Sign - try { - c.init(Cipher.ENCRYPT_MODE, kp.getPrivate()); - ct = c.doFinal(pt); - throw new RuntimeException("Encrypt operation should have failed."); - } catch (InvalidKeyException e) { - if (e.getMessage().compareTo("RSAPublicKey required for " + - "encryption") != 0) { - System.out.println("Wrong exception thrown."); - throw e; + PrivateKey[] privKeys = new PrivateKey[2]; + privKeys[0] = kp.getPrivate(); + if (privKeys[0] instanceof RSAPrivateCrtKey) { + RSAPrivateCrtKey k = (RSAPrivateCrtKey) privKeys[0]; + KeyFactory kf = KeyFactory.getInstance("RSA"); + privKeys[1] = kf.generatePrivate + (new RSAPrivateKeySpec(k.getModulus(), k.getPrivateExponent())); + } else { + privKeys = new PrivateKey[] {privKeys[0]}; + } + + for (PrivateKey pk : privKeys) { + System.out.println("Testing " + pk); + c.init(Cipher.DECRYPT_MODE, pk); + c.doFinal(ct); + + // Sign + try { + c.init(Cipher.ENCRYPT_MODE, pk); + ct = c.doFinal(pt); + throw new RuntimeException("Encrypt operation should have failed."); + } catch (InvalidKeyException e) { + if (e.getMessage().compareTo("RSAPublicKey required for " + + "encryption") != 0) { + System.out.println("Wrong exception thrown."); + throw e; + } } } + // Verify try { c.init(Cipher.DECRYPT_MODE, kp.getPublic()); c.doFinal(ct); throw new RuntimeException("Decrypt operation should have failed."); } catch (InvalidKeyException e) { - if (e.getMessage().compareTo("RSAPrivateCrtKey required for " + + if (e.getMessage().compareTo("RSAPrivateKey required for " + "decryption") != 0) { System.out.println("Wrong exception thrown."); throw e; diff -r 82e066c83bd0 -r b348f693a10e test/com/sun/awt/SecurityWarning/GetSizeShouldNotReturnZero.java --- a/test/com/sun/awt/SecurityWarning/GetSizeShouldNotReturnZero.java Tue Sep 08 16:01:29 2015 +0400 +++ b/test/com/sun/awt/SecurityWarning/GetSizeShouldNotReturnZero.java Tue Sep 08 14:40:44 2015 -0700 @@ -374,5 +374,3 @@ } }// TestDialog class - - diff -r 82e066c83bd0 -r b348f693a10e test/com/sun/crypto/provider/Mac/Utils.java --- a/test/com/sun/crypto/provider/Mac/Utils.java Tue Sep 08 16:01:29 2015 +0400 +++ b/test/com/sun/crypto/provider/Mac/Utils.java Tue Sep 08 14:40:44 2015 -0700 @@ -76,4 +76,4 @@ interface MacTest { void doTest(String alg) throws Exception; -} \ No newline at end of file +} diff -r 82e066c83bd0 -r b348f693a10e test/com/sun/jdi/InterfaceMethodsTest.java --- a/test/com/sun/jdi/InterfaceMethodsTest.java Tue Sep 08 16:01:29 2015 +0400 +++ b/test/com/sun/jdi/InterfaceMethodsTest.java Tue Sep 08 14:40:44 2015 -0700 @@ -442,6 +442,3 @@ } } } - - - diff -r 82e066c83bd0 -r b348f693a10e test/com/sun/jdi/ShellScaffold.sh --- a/test/com/sun/jdi/ShellScaffold.sh Tue Sep 08 16:01:29 2015 +0400 +++ b/test/com/sun/jdi/ShellScaffold.sh Tue Sep 08 14:40:44 2015 -0700 @@ -1215,5 +1215,3 @@ # Don't know how this arises debuggeeFailIfPresent "Internal exception" } - - diff -r 82e066c83bd0 -r b348f693a10e test/com/sun/jmx/remote/NotificationMarshalVersions/Client/ConfigKey.java --- a/test/com/sun/jmx/remote/NotificationMarshalVersions/Client/ConfigKey.java Tue Sep 08 16:01:29 2015 +0400 +++ b/test/com/sun/jmx/remote/NotificationMarshalVersions/Client/ConfigKey.java Tue Sep 08 14:40:44 2015 -0700 @@ -23,4 +23,4 @@ public enum ConfigKey { CONSTANT3, CONSTANT2; -} \ No newline at end of file +} diff -r 82e066c83bd0 -r b348f693a10e test/com/sun/jmx/remote/NotificationMarshalVersions/Server/ConfigKey.java --- a/test/com/sun/jmx/remote/NotificationMarshalVersions/Server/ConfigKey.java Tue Sep 08 16:01:29 2015 +0400 +++ b/test/com/sun/jmx/remote/NotificationMarshalVersions/Server/ConfigKey.java Tue Sep 08 14:40:44 2015 -0700 @@ -23,4 +23,4 @@ public enum ConfigKey { CONSTANT1, CONSTANT2; -} \ No newline at end of file +} diff -r 82e066c83bd0 -r b348f693a10e test/com/sun/jmx/remote/NotificationMarshalVersions/Server/Ste.java --- a/test/com/sun/jmx/remote/NotificationMarshalVersions/Server/Ste.java Tue Sep 08 16:01:29 2015 +0400 +++ b/test/com/sun/jmx/remote/NotificationMarshalVersions/Server/Ste.java Tue Sep 08 14:40:44 2015 -0700 @@ -29,4 +29,4 @@ public void foo() { sendNotification(new TestNotification("test", this, count++)); } -} \ No newline at end of file +} diff -r 82e066c83bd0 -r b348f693a10e test/com/sun/jmx/remote/NotificationMarshalVersions/Server/SteMBean.java --- a/test/com/sun/jmx/remote/NotificationMarshalVersions/Server/SteMBean.java Tue Sep 08 16:01:29 2015 +0400 +++ b/test/com/sun/jmx/remote/NotificationMarshalVersions/Server/SteMBean.java Tue Sep 08 14:40:44 2015 -0700 @@ -23,4 +23,4 @@ public interface SteMBean { public void foo(); -} \ No newline at end of file +} diff -r 82e066c83bd0 -r b348f693a10e test/com/sun/security/auth/module/LdapLoginModule/CheckConfigs.policy --- a/test/com/sun/security/auth/module/LdapLoginModule/CheckConfigs.policy Tue Sep 08 16:01:29 2015 +0400 +++ b/test/com/sun/security/auth/module/LdapLoginModule/CheckConfigs.policy Tue Sep 08 14:40:44 2015 -0700 @@ -7,5 +7,3 @@ //permission java.net.SocketPermission "*:636", "connect"; //permission javax.security.auth.AuthPermission "modifyPrincipals"; }; - - diff -r 82e066c83bd0 -r b348f693a10e test/java/awt/Component/DimensionEncapsulation/DimensionEncapsulation.java --- a/test/java/awt/Component/DimensionEncapsulation/DimensionEncapsulation.java Tue Sep 08 16:01:29 2015 +0400 +++ b/test/java/awt/Component/DimensionEncapsulation/DimensionEncapsulation.java Tue Sep 08 14:40:44 2015 -0700 @@ -212,4 +212,4 @@ throw new RuntimeException(e); } } -} \ No newline at end of file +} diff -r 82e066c83bd0 -r b348f693a10e test/java/awt/Component/InsetsEncapsulation/InsetsEncapsulation.java --- a/test/java/awt/Component/InsetsEncapsulation/InsetsEncapsulation.java Tue Sep 08 16:01:29 2015 +0400 +++ b/test/java/awt/Component/InsetsEncapsulation/InsetsEncapsulation.java Tue Sep 08 14:40:44 2015 -0700 @@ -163,4 +163,4 @@ throw new RuntimeException(e); } } -} \ No newline at end of file +} diff -r 82e066c83bd0 -r b348f693a10e test/java/awt/Component/SetEnabledPerformance/SetEnabledPerformance.java --- a/test/java/awt/Component/SetEnabledPerformance/SetEnabledPerformance.java Tue Sep 08 16:01:29 2015 +0400 +++ b/test/java/awt/Component/SetEnabledPerformance/SetEnabledPerformance.java Tue Sep 08 14:40:44 2015 -0700 @@ -69,4 +69,4 @@ } }); } -} \ No newline at end of file +} diff -r 82e066c83bd0 -r b348f693a10e test/java/awt/Cursor/MultiResolutionCursorTest/MultiResolutionCursorTest.html --- a/test/java/awt/Cursor/MultiResolutionCursorTest/MultiResolutionCursorTest.html Tue Sep 08 16:01:29 2015 +0400 +++ b/test/java/awt/Cursor/MultiResolutionCursorTest/MultiResolutionCursorTest.html Tue Sep 08 14:40:44 2015 -0700 @@ -29,4 +29,4 @@

See the dialog box (usually in upper left corner) for instructions

- \ No newline at end of file + diff -r 82e066c83bd0 -r b348f693a10e test/java/awt/FileDialog/ModalFocus/FileDialogModalFocusTest.java --- a/test/java/awt/FileDialog/ModalFocus/FileDialogModalFocusTest.java Tue Sep 08 16:01:29 2015 +0400 +++ b/test/java/awt/FileDialog/ModalFocus/FileDialogModalFocusTest.java Tue Sep 08 14:40:44 2015 -0700 @@ -134,4 +134,4 @@ throw new RuntimeException("file chooser is underneath"); } } -} \ No newline at end of file +} diff -r 82e066c83bd0 -r b348f693a10e test/java/awt/Focus/6981400/Test3.java --- a/test/java/awt/Focus/6981400/Test3.java Tue Sep 08 16:01:29 2015 +0400 +++ b/test/java/awt/Focus/6981400/Test3.java Tue Sep 08 14:40:44 2015 -0700 @@ -135,5 +135,3 @@ } } } - - diff -r 82e066c83bd0 -r b348f693a10e test/java/awt/FontClass/LCDScale.java --- a/test/java/awt/FontClass/LCDScale.java Tue Sep 08 16:01:29 2015 +0400 +++ b/test/java/awt/FontClass/LCDScale.java Tue Sep 08 14:40:44 2015 -0700 @@ -79,5 +79,3 @@ } } } - - diff -r 82e066c83bd0 -r b348f693a10e test/java/awt/Frame/FramesGC/FramesGC.java --- a/test/java/awt/Frame/FramesGC/FramesGC.java Tue Sep 08 16:01:29 2015 +0400 +++ b/test/java/awt/Frame/FramesGC/FramesGC.java Tue Sep 08 14:40:44 2015 -0700 @@ -156,4 +156,4 @@ refs.add(new PhantomReference(frame, que)); } -} \ No newline at end of file +} diff -r 82e066c83bd0 -r b348f693a10e test/java/awt/Frame/MaximizedToUnmaximized/MaximizedToUnmaximized.java --- a/test/java/awt/Frame/MaximizedToUnmaximized/MaximizedToUnmaximized.java Tue Sep 08 16:01:29 2015 +0400 +++ b/test/java/awt/Frame/MaximizedToUnmaximized/MaximizedToUnmaximized.java Tue Sep 08 14:40:44 2015 -0700 @@ -76,4 +76,4 @@ frame.dispose(); } } -} \ No newline at end of file +} diff -r 82e066c83bd0 -r b348f693a10e test/java/awt/MenuBar/RemoveHelpMenu/RemoveHelpMenu.java --- a/test/java/awt/MenuBar/RemoveHelpMenu/RemoveHelpMenu.java Tue Sep 08 16:01:29 2015 +0400 +++ b/test/java/awt/MenuBar/RemoveHelpMenu/RemoveHelpMenu.java Tue Sep 08 14:40:44 2015 -0700 @@ -129,4 +129,4 @@ checkMenuCount(menuBar, 0); checkHelpMenu(helpMenu, false); } -} \ No newline at end of file +} diff -r 82e066c83bd0 -r b348f693a10e test/java/awt/Mixing/JButtonInGlassPane.java --- a/test/java/awt/Mixing/JButtonInGlassPane.java Tue Sep 08 16:01:29 2015 +0400 +++ b/test/java/awt/Mixing/JButtonInGlassPane.java Tue Sep 08 14:40:44 2015 -0700 @@ -426,5 +426,3 @@ } }// TestDialog class - - diff -r 82e066c83bd0 -r b348f693a10e test/java/awt/Mixing/LWComboBox.java --- a/test/java/awt/Mixing/LWComboBox.java Tue Sep 08 16:01:29 2015 +0400 +++ b/test/java/awt/Mixing/LWComboBox.java Tue Sep 08 14:40:44 2015 -0700 @@ -421,5 +421,3 @@ } }// TestDialog class - - diff -r 82e066c83bd0 -r b348f693a10e test/java/awt/Mixing/MixingInHwPanel.java --- a/test/java/awt/Mixing/MixingInHwPanel.java Tue Sep 08 16:01:29 2015 +0400 +++ b/test/java/awt/Mixing/MixingInHwPanel.java Tue Sep 08 14:40:44 2015 -0700 @@ -424,5 +424,3 @@ } }// TestDialog class - - diff -r 82e066c83bd0 -r b348f693a10e test/java/awt/Mixing/MixingOnShrinkingHWButton.java --- a/test/java/awt/Mixing/MixingOnShrinkingHWButton.java Tue Sep 08 16:01:29 2015 +0400 +++ b/test/java/awt/Mixing/MixingOnShrinkingHWButton.java Tue Sep 08 14:40:44 2015 -0700 @@ -425,5 +425,3 @@ } }// TestDialog class - - diff -r 82e066c83bd0 -r b348f693a10e test/java/awt/Mixing/NonOpaqueInternalFrame.java --- a/test/java/awt/Mixing/NonOpaqueInternalFrame.java Tue Sep 08 16:01:29 2015 +0400 +++ b/test/java/awt/Mixing/NonOpaqueInternalFrame.java Tue Sep 08 14:40:44 2015 -0700 @@ -430,5 +430,3 @@ } }// TestDialog class - - diff -r 82e066c83bd0 -r b348f693a10e test/java/awt/Mouse/MouseDragEvent/MouseDraggedTest.java --- a/test/java/awt/Mouse/MouseDragEvent/MouseDraggedTest.java Tue Sep 08 16:01:29 2015 +0400 +++ b/test/java/awt/Mouse/MouseDragEvent/MouseDraggedTest.java Tue Sep 08 14:40:44 2015 -0700 @@ -100,4 +100,4 @@ frame.add(panel, BorderLayout.CENTER); frame.setVisible(true); } -} \ No newline at end of file +} diff -r 82e066c83bd0 -r b348f693a10e test/java/awt/MouseInfo/JContainerMousePositionTest.java --- a/test/java/awt/MouseInfo/JContainerMousePositionTest.java Tue Sep 08 16:01:29 2015 +0400 +++ b/test/java/awt/MouseInfo/JContainerMousePositionTest.java Tue Sep 08 14:40:44 2015 -0700 @@ -144,5 +144,3 @@ frame1.setVisible(true); } } - - diff -r 82e066c83bd0 -r b348f693a10e test/java/awt/Robot/RobotWheelTest/RobotWheelTest.java --- a/test/java/awt/Robot/RobotWheelTest/RobotWheelTest.java Tue Sep 08 16:01:29 2015 +0400 +++ b/test/java/awt/Robot/RobotWheelTest/RobotWheelTest.java Tue Sep 08 14:40:44 2015 -0700 @@ -80,4 +80,4 @@ } } } -} \ No newline at end of file +} diff -r 82e066c83bd0 -r b348f693a10e test/java/awt/ScrollPane/bug8077409Test.java --- a/test/java/awt/ScrollPane/bug8077409Test.java Tue Sep 08 16:01:29 2015 +0400 +++ b/test/java/awt/ScrollPane/bug8077409Test.java Tue Sep 08 14:40:44 2015 -0700 @@ -112,4 +112,4 @@ } } -} \ No newline at end of file +} diff -r 82e066c83bd0 -r b348f693a10e test/java/awt/TrayIcon/TrayIconPopup/TrayIconPopupTest.java --- a/test/java/awt/TrayIcon/TrayIconPopup/TrayIconPopupTest.java Tue Sep 08 16:01:29 2015 +0400 +++ b/test/java/awt/TrayIcon/TrayIconPopup/TrayIconPopupTest.java Tue Sep 08 14:40:44 2015 -0700 @@ -148,4 +148,4 @@ "JPopupMenu shown and menu item selected using keyboard"); } -} \ No newline at end of file +} diff -r 82e066c83bd0 -r b348f693a10e test/java/awt/Window/AlwaysOnTop/SyncAlwaysOnTopFieldTest.java --- a/test/java/awt/Window/AlwaysOnTop/SyncAlwaysOnTopFieldTest.java Tue Sep 08 16:01:29 2015 +0400 +++ b/test/java/awt/Window/AlwaysOnTop/SyncAlwaysOnTopFieldTest.java Tue Sep 08 14:40:44 2015 -0700 @@ -59,4 +59,4 @@ window.setVisible(true); return window; } -} \ No newline at end of file +} diff -r 82e066c83bd0 -r b348f693a10e test/java/awt/applet/Applet/AppletFlipBuffer.java --- a/test/java/awt/applet/Applet/AppletFlipBuffer.java Tue Sep 08 16:01:29 2015 +0400 +++ b/test/java/awt/applet/Applet/AppletFlipBuffer.java Tue Sep 08 14:40:44 2015 -0700 @@ -52,4 +52,4 @@ frame.dispose(); } } -} \ No newline at end of file +} diff -r 82e066c83bd0 -r b348f693a10e test/java/awt/appletviewer/IOExceptionIfEncodedURLTest/test.html --- a/test/java/awt/appletviewer/IOExceptionIfEncodedURLTest/test.html Tue Sep 08 16:01:29 2015 +0400 +++ b/test/java/awt/appletviewer/IOExceptionIfEncodedURLTest/test.html Tue Sep 08 14:40:44 2015 -0700 @@ -41,4 +41,4 @@ - \ No newline at end of file + diff -r 82e066c83bd0 -r b348f693a10e test/java/awt/datatransfer/ClipboardInterVMTest/ClipboardInterVMTest.java --- a/test/java/awt/datatransfer/ClipboardInterVMTest/ClipboardInterVMTest.java Tue Sep 08 16:01:29 2015 +0400 +++ b/test/java/awt/datatransfer/ClipboardInterVMTest/ClipboardInterVMTest.java Tue Sep 08 14:40:44 2015 -0700 @@ -168,4 +168,4 @@ } } } -} \ No newline at end of file +} diff -r 82e066c83bd0 -r b348f693a10e test/java/awt/datatransfer/DataFlavor/XJavaUrlDataFlavorTest/XJavaUrlDataFlavorTest.java --- a/test/java/awt/datatransfer/DataFlavor/XJavaUrlDataFlavorTest/XJavaUrlDataFlavorTest.java Tue Sep 08 16:01:29 2015 +0400 +++ b/test/java/awt/datatransfer/DataFlavor/XJavaUrlDataFlavorTest/XJavaUrlDataFlavorTest.java Tue Sep 08 14:40:44 2015 -0700 @@ -342,4 +342,4 @@ } } -}// TestDialog class \ No newline at end of file +}// TestDialog class diff -r 82e066c83bd0 -r b348f693a10e test/java/awt/datatransfer/MissedHtmlAndRtfBug/MyTransferable.java --- a/test/java/awt/datatransfer/MissedHtmlAndRtfBug/MyTransferable.java Tue Sep 08 16:01:29 2015 +0400 +++ b/test/java/awt/datatransfer/MissedHtmlAndRtfBug/MyTransferable.java Tue Sep 08 14:40:44 2015 -0700 @@ -59,4 +59,4 @@ throw new UnsupportedFlavorException(flavor); } } -} \ No newline at end of file +} diff -r 82e066c83bd0 -r b348f693a10e test/java/awt/event/MouseEvent/CTORRestrictions/CTORRestrictions_Disable.java --- a/test/java/awt/event/MouseEvent/CTORRestrictions/CTORRestrictions_Disable.java Tue Sep 08 16:01:29 2015 +0400 +++ b/test/java/awt/event/MouseEvent/CTORRestrictions/CTORRestrictions_Disable.java Tue Sep 08 14:40:44 2015 -0700 @@ -120,5 +120,3 @@ frame.dispatchEvent( ( AWTEvent )meOld ); } } - - diff -r 82e066c83bd0 -r b348f693a10e test/java/awt/im/4490692/bug4490692.html --- a/test/java/awt/im/4490692/bug4490692.html Tue Sep 08 16:01:29 2015 +0400 +++ b/test/java/awt/im/4490692/bug4490692.html Tue Sep 08 14:40:44 2015 -0700 @@ -59,5 +59,3 @@ - - diff -r 82e066c83bd0 -r b348f693a10e test/java/awt/im/4959409/bug4959409.html --- a/test/java/awt/im/4959409/bug4959409.html Tue Sep 08 16:01:29 2015 +0400 +++ b/test/java/awt/im/4959409/bug4959409.html Tue Sep 08 14:40:44 2015 -0700 @@ -45,5 +45,3 @@ - - diff -r 82e066c83bd0 -r b348f693a10e test/java/beans/README --- a/test/java/beans/README Tue Sep 08 16:01:29 2015 +0400 +++ b/test/java/beans/README Tue Sep 08 14:40:44 2015 -0700 @@ -73,4 +73,4 @@ If this object is not null it will be encoded and decoded. Also the object updating will be tested in this case. The test() method has a boolean parameter, -which indicates that the test should be started in secure context. \ No newline at end of file +which indicates that the test should be started in secure context. diff -r 82e066c83bd0 -r b348f693a10e test/java/beans/SimpleBeanInfo/LoadingStandardIcons/java.policy --- a/test/java/beans/SimpleBeanInfo/LoadingStandardIcons/java.policy Tue Sep 08 16:01:29 2015 +0400 +++ b/test/java/beans/SimpleBeanInfo/LoadingStandardIcons/java.policy Tue Sep 08 14:40:44 2015 -0700 @@ -1,1 +1,1 @@ -; \ No newline at end of file +; diff -r 82e066c83bd0 -r b348f693a10e test/java/io/Serializable/evolution/AddedSuperClass/README --- a/test/java/io/Serializable/evolution/AddedSuperClass/README Tue Sep 08 16:01:29 2015 +0400 +++ b/test/java/io/Serializable/evolution/AddedSuperClass/README Tue Sep 08 14:40:44 2015 -0700 @@ -12,6 +12,3 @@ rm A.class AddedSuperClass.class javac ReadAddedSuperClass2.java java ReadAddedSuperClass2 - - - diff -r 82e066c83bd0 -r b348f693a10e test/java/lang/ClassLoader/getdotresource.sh --- a/test/java/lang/ClassLoader/getdotresource.sh Tue Sep 08 16:01:29 2015 +0400 +++ b/test/java/lang/ClassLoader/getdotresource.sh Tue Sep 08 14:40:44 2015 -0700 @@ -44,5 +44,3 @@ # now start the test ${TESTJAVA}/bin/java ${TESTVMOPTS} -cp ${TESTSRC}${FS}resource.jar${PS}${TESTCLASSES} GetDotResource - - diff -r 82e066c83bd0 -r b348f693a10e test/java/lang/management/MemoryMXBean/LowMemoryTest2.sh --- a/test/java/lang/management/MemoryMXBean/LowMemoryTest2.sh Tue Sep 08 16:01:29 2015 +0400 +++ b/test/java/lang/management/MemoryMXBean/LowMemoryTest2.sh Tue Sep 08 14:40:44 2015 -0700 @@ -69,5 +69,3 @@ then echo "$failures test(s) failed"; else echo "All test(s) passed"; fi exit $failures - - diff -r 82e066c83bd0 -r b348f693a10e test/java/net/SocketPermission/policy --- a/test/java/net/SocketPermission/policy Tue Sep 08 16:01:29 2015 +0400 +++ b/test/java/net/SocketPermission/policy Tue Sep 08 14:40:44 2015 -0700 @@ -1,3 +1,3 @@ grant { permission java.security.AllPermission; -}; \ No newline at end of file +}; diff -r 82e066c83bd0 -r b348f693a10e test/java/nio/channels/SocketChannel/Open.sh --- a/test/java/nio/channels/SocketChannel/Open.sh Tue Sep 08 16:01:29 2015 +0400 +++ b/test/java/nio/channels/SocketChannel/Open.sh Tue Sep 08 14:40:44 2015 -0700 @@ -33,6 +33,3 @@ * ) echo "unrecognized system: $OS" ;; esac - - - diff -r 82e066c83bd0 -r b348f693a10e test/java/nio/channels/spi/SelectorProvider/inheritedChannel/README --- a/test/java/nio/channels/spi/SelectorProvider/inheritedChannel/README Tue Sep 08 16:01:29 2015 +0400 +++ b/test/java/nio/channels/spi/SelectorProvider/inheritedChannel/README Tue Sep 08 14:40:44 2015 -0700 @@ -31,5 +31,3 @@ (c) Execute the make script :- Solaris: gnumake all Linux: gmake all - - diff -r 82e066c83bd0 -r b348f693a10e test/java/nio/file/Files/StreamLinesTest.java --- a/test/java/nio/file/Files/StreamLinesTest.java Tue Sep 08 16:01:29 2015 +0400 +++ b/test/java/nio/file/Files/StreamLinesTest.java Tue Sep 08 14:40:44 2015 -0700 @@ -138,18 +138,25 @@ StandardCharsets.ISO_8859_1, StandardCharsets.UTF_16); String[] lines = {"", "A", "AB", "ABC", "ABCD"}; - int[] linesSizes = {1, 2, 3, 4, 16, 256, 1024}; + int[] linesSizes = {0, 1, 2, 3, 4, 16, 256, 1024}; for (Charset charset : charsets) { - for (String line : lines) { - for (int linesSize : linesSizes) { - for (LineSeparator ls : EnumSet.complementOf(EnumSet.of(LineSeparator.NONE))) { - String description = String.format("%d lines of \"%s\" with separator %s", linesSize, line, ls); - l.add(of(description, - i -> line, - i -> ls, - linesSize, charset)); + for (int linesSize : linesSizes) { + if (linesSize > 0) { + for (String line : lines) { + for (LineSeparator ls : EnumSet.complementOf(EnumSet.of(LineSeparator.NONE))) { + String description = String.format("%d lines of \"%s\" with separator %s", linesSize, line, ls); + l.add(of(description, + i -> line, + i -> ls, + linesSize, charset)); + } } + } else { + l.add(of("Empty file: 0 lines", + i -> "", + i -> LineSeparator.NONE, + 0, charset)); } } } diff -r 82e066c83bd0 -r b348f693a10e test/java/rmi/registry/readTest/readTest.sh --- a/test/java/rmi/registry/readTest/readTest.sh Tue Sep 08 16:01:29 2015 +0400 +++ b/test/java/rmi/registry/readTest/readTest.sh Tue Sep 08 14:40:44 2015 -0700 @@ -125,5 +125,3 @@ fi rm -rf OUT.TXT ${RMIREG_OUT} rmi_tmp exit ${exitCode} - - diff -r 82e066c83bd0 -r b348f693a10e test/java/security/KeyStore/PKCS12/README --- a/test/java/security/KeyStore/PKCS12/README Tue Sep 08 16:01:29 2015 +0400 +++ b/test/java/security/KeyStore/PKCS12/README Tue Sep 08 14:40:44 2015 -0700 @@ -25,4 +25,4 @@ 3. Import certificate /bin/keytool -import -alias pkcs12test -keystore ks-pkcs.data --storepass storepass -file pkcs12testCA.cer.data \ No newline at end of file +-storepass storepass -file pkcs12testCA.cer.data diff -r 82e066c83bd0 -r b348f693a10e test/java/security/SignedObject/Copy.java --- a/test/java/security/SignedObject/Copy.java Tue Sep 08 16:01:29 2015 +0400 +++ b/test/java/security/SignedObject/Copy.java Tue Sep 08 14:40:44 2015 -0700 @@ -119,5 +119,3 @@ } } } - - diff -r 82e066c83bd0 -r b348f693a10e test/java/util/AbstractCollection/ToArrayTest.java --- a/test/java/util/AbstractCollection/ToArrayTest.java Tue Sep 08 16:01:29 2015 +0400 +++ b/test/java/util/AbstractCollection/ToArrayTest.java Tue Sep 08 14:40:44 2015 -0700 @@ -211,5 +211,3 @@ else {System.out.println(x + " not equal to " + y); fail(); } } } - - diff -r 82e066c83bd0 -r b348f693a10e test/java/util/Arrays/SetAllTest.java --- a/test/java/util/Arrays/SetAllTest.java Tue Sep 08 16:01:29 2015 +0400 +++ b/test/java/util/Arrays/SetAllTest.java Tue Sep 08 14:40:44 2015 -0700 @@ -278,4 +278,4 @@ // expected } } -} \ No newline at end of file +} diff -r 82e066c83bd0 -r b348f693a10e test/java/util/Locale/bug4123285.html --- a/test/java/util/Locale/bug4123285.html Tue Sep 08 16:01:29 2015 +0400 +++ b/test/java/util/Locale/bug4123285.html Tue Sep 08 14:40:44 2015 -0700 @@ -1,1 +1,1 @@ - \ No newline at end of file + diff -r 82e066c83bd0 -r b348f693a10e test/java/util/concurrent/CompletableFuture/ThenComposeExceptionTest.java --- a/test/java/util/concurrent/CompletableFuture/ThenComposeExceptionTest.java Tue Sep 08 16:01:29 2015 +0400 +++ b/test/java/util/concurrent/CompletableFuture/ThenComposeExceptionTest.java Tue Sep 08 14:40:44 2015 -0700 @@ -120,4 +120,4 @@ Assert.assertTrue(eOnWhenComplete.get() instanceof CompletionException, "Incorrect exception passed to whenComplete: " + eOnWhenComplete.get()); } -} \ No newline at end of file +} diff -r 82e066c83bd0 -r b348f693a10e test/java/util/logging/LogManager/Configuration/TestConfigurationLock.properties --- a/test/java/util/logging/LogManager/Configuration/TestConfigurationLock.properties Tue Sep 08 16:01:29 2015 +0400 +++ b/test/java/util/logging/LogManager/Configuration/TestConfigurationLock.properties Tue Sep 08 14:40:44 2015 -0700 @@ -18,5 +18,3 @@ foo.bar.l10.level = INFO foo.bar.l100.level = INFO foo.bar.l1000.level = INFO - - diff -r 82e066c83bd0 -r b348f693a10e test/java/util/stream/bootlib/java/util/stream/DefaultMethodStreams.java --- a/test/java/util/stream/bootlib/java/util/stream/DefaultMethodStreams.java Tue Sep 08 16:01:29 2015 +0400 +++ b/test/java/util/stream/bootlib/java/util/stream/DefaultMethodStreams.java Tue Sep 08 14:40:44 2015 -0700 @@ -981,4 +981,4 @@ s.close(); } } -} \ No newline at end of file +} diff -r 82e066c83bd0 -r b348f693a10e test/javax/crypto/SecretKeyFactory/PBKDF2TranslateTest.java --- a/test/javax/crypto/SecretKeyFactory/PBKDF2TranslateTest.java Tue Sep 08 16:01:29 2015 +0400 +++ b/test/javax/crypto/SecretKeyFactory/PBKDF2TranslateTest.java Tue Sep 08 14:40:44 2015 -0700 @@ -267,4 +267,4 @@ } } -} \ No newline at end of file +} diff -r 82e066c83bd0 -r b348f693a10e test/javax/imageio/plugins/shared/CanWriteSequence.java --- a/test/javax/imageio/plugins/shared/CanWriteSequence.java Tue Sep 08 16:01:29 2015 +0400 +++ b/test/javax/imageio/plugins/shared/CanWriteSequence.java Tue Sep 08 14:40:44 2015 -0700 @@ -75,4 +75,4 @@ writer.dispose(); ios.close(); } -} \ No newline at end of file +} diff -r 82e066c83bd0 -r b348f693a10e test/javax/management/MustBeValidMBeanInfo/logging.properties --- a/test/javax/management/MustBeValidMBeanInfo/logging.properties Tue Sep 08 16:01:29 2015 +0400 +++ b/test/javax/management/MustBeValidMBeanInfo/logging.properties Tue Sep 08 14:40:44 2015 -0700 @@ -11,4 +11,4 @@ java.util.logging.ConsoleHandler.level = FINEST java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter -javax.management.misc.level = FINEST \ No newline at end of file +javax.management.misc.level = FINEST diff -r 82e066c83bd0 -r b348f693a10e test/javax/management/ObjectName/CompressedStorageTest.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/javax/management/ObjectName/CompressedStorageTest.java Tue Sep 08 14:40:44 2015 -0700 @@ -0,0 +1,231 @@ +/* + * 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 8041565 + * @summary Tests the limits imposed on the domain name part of an + * ObjectName instance + * @author Jaroslav Bachorik + * @modules java.management + * @run main CompressedStorageTest + */ + +import java.lang.reflect.Field; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.util.function.Consumer; +import javax.management.MalformedObjectNameException; +import javax.management.ObjectName; + +public class CompressedStorageTest { + private static Method setDomainLengthM; + private static Field compressedStorageFld; + + private static int DOMAIN_PATTERN; + private static int PROPLIST_PATTERN; + private static int PROPVAL_PATTERN; + + private static Method setDomainPattern; + private static Method setPropertyListPattern; + private static Method setPropertyValuePattern; + + + static { + try { + Class clz = ObjectName.class; + setDomainLengthM = clz.getDeclaredMethod("setDomainLength", int.class); + setDomainLengthM.setAccessible(true); + + compressedStorageFld = clz.getDeclaredField("_compressed_storage"); + compressedStorageFld.setAccessible(true); + + setDomainPattern = clz.getDeclaredMethod("setDomainPattern", boolean.class); + setDomainPattern.setAccessible(true); + setPropertyListPattern = clz.getDeclaredMethod("setPropertyListPattern", boolean.class); + setPropertyListPattern.setAccessible(true); + setPropertyValuePattern = clz.getDeclaredMethod("setPropertyValuePattern", boolean.class); + setPropertyValuePattern.setAccessible(true); + + DOMAIN_PATTERN = getStaticIntFld("DOMAIN_PATTERN"); + PROPLIST_PATTERN = getStaticIntFld("PROPLIST_PATTERN"); + PROPVAL_PATTERN = getStaticIntFld("PROPVAL_PATTERN"); + + } catch (Exception e) { + throw new Error(e); + } + } + + public static void main(String[] args) throws Exception { + testZeroLength(); + testNegativeLength(); + testMaxLength(); + + testSetDomainPattern(); + testSetPropertyListPattern(); + testSetPropertyValuePattern(); + } + + private static ObjectName getObjectName() + throws MalformedObjectNameException { + return new ObjectName("domain", "key", "value"); + } + + /** + * Test for accepting 0 being passed as argument to + * {@linkplain ObjectName#setDomainLength(int)}. + * + */ + private static void testZeroLength() throws Exception { + setDomainNameLength(0); + } + + /** + * Test for rejecting negative value being passed as argument to + * {@linkplain ObjectName#setDomainLength(int)}. + */ + private static void testNegativeLength() throws Exception { + try { + setDomainNameLength(-1); + } catch (MalformedObjectNameException e) { + return; + } + fail("Allowing negative domain name length"); + } + + /** + * Test for rejecting value exceeding the maximum allowed length + * being passed as argument to {@linkplain ObjectName#setDomainLength(int)}. + */ + private static void testMaxLength() throws Exception { + try { + setDomainNameLength(Integer.MAX_VALUE / 4 + 1); + } catch (MalformedObjectNameException e) { + return; + } + fail("Maximum domain name length is not respected"); + } + + /** + * Tests that calling {@linkplain ObjectName#setDomainPattern(boolean)} + * results in setting correct bits in {@linkplain ObjectName#_compressed_storage}. + */ + private static void testSetDomainPattern() throws Exception { + ObjectName on = getObjectName(); + + checkMask(DOMAIN_PATTERN, setDomainPattern, on); + } + + /** + * Tests that calling {@linkplain ObjectName#setPropertyListPattern(boolean)} + * results in setting correct bits in {@linkplain ObjectName#_compressed_storage}. + */ + private static void testSetPropertyListPattern() throws Exception { + ObjectName on = getObjectName(); + + checkMask(PROPLIST_PATTERN, setPropertyListPattern, on); + } + + /** + * Tests that calling {@linkplain ObjectName#setPropertyValuePattern(boolean)} + * results in setting correct bits in {@linkplain ObjectName#_compressed_storage}. + */ + private static void testSetPropertyValuePattern() throws Exception { + ObjectName on = getObjectName(); + + checkMask(PROPVAL_PATTERN, setPropertyValuePattern, on); + } + + /** + * Helper method to call {@linkplain ObjectName#setDomainLength(int)} + * method via reflection. + * @param len The domain name length + * @throws MalformedObjectNameException Propagated from + * {@linkplain ObjectName#setDomainLength(int)} invocation. + */ + private static void setDomainNameLength(int len) + throws MalformedObjectNameException { + try { + setDomainLengthM.invoke(getObjectName(), len); + } catch (InvocationTargetException e) { + Throwable cause = e.getCause(); + if (cause instanceof MalformedObjectNameException) { + throw (MalformedObjectNameException)cause; + } + throw new Error(cause); + } catch (IllegalAccessException | IllegalArgumentException e) { + throw new Error(e); + } + } + + /** + * Helper method to assert that a particular boolean setter affects only + * a particular bit in the {@linkplain ObjectName#_compressed_storage} field. + * @param mask bitmask for storing the boolean value + * @param setter setter method reference + * @param on {@linkplain ObjectName} instance + */ + private static void checkMask(int mask, Method setter, ObjectName on) + throws Exception { + int valBefore = compressedStorageFld.getInt(on); + setter.invoke(on, true); + int valAfter = compressedStorageFld.getInt(on); + + checkMask(mask, valAfter ^ valBefore); + + valBefore = valAfter; + setter.invoke(on, false); + valAfter = compressedStorageFld.getInt(on); + + checkMask(mask, valAfter ^ valBefore); + } + + /** + * Compare the changed bits with the given mask. + * @param mask bitmask + * @param val the changed bits; may be 0 if there was no change + */ + private static void checkMask(int mask, int val) { + if (val != 0 && val != mask) { + fail("Invalid mask: expecting '" + + Integer.toBinaryString(mask) + "' , received '" + + Integer.toBinaryString(val) + "'"); + } + } + + /** + * Helper method to obtain the value of a static field via reflection. + * @param name static field name + * @return static field value + */ + private static int getStaticIntFld(String name) throws Exception { + Field fld = ObjectName.class.getDeclaredField(name); + fld.setAccessible(true); + + return fld.getInt(null); + } + + private static void fail(String msg) { + throw new Error(msg); + } +} diff -r 82e066c83bd0 -r b348f693a10e test/javax/management/modelmbean/SimpleModelMBean/logging.properties --- a/test/javax/management/modelmbean/SimpleModelMBean/logging.properties Tue Sep 08 16:01:29 2015 +0400 +++ b/test/javax/management/modelmbean/SimpleModelMBean/logging.properties Tue Sep 08 14:40:44 2015 -0700 @@ -11,4 +11,4 @@ java.util.logging.ConsoleHandler.level = FINEST java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter -javax.management.misc.level = FINEST \ No newline at end of file +javax.management.misc.level = FINEST diff -r 82e066c83bd0 -r b348f693a10e test/javax/security/auth/Subject/doAs/policy.expect.ace --- a/test/javax/security/auth/Subject/doAs/policy.expect.ace Tue Sep 08 16:01:29 2015 +0400 +++ b/test/javax/security/auth/Subject/doAs/policy.expect.ace Tue Sep 08 14:40:44 2015 -0700 @@ -24,4 +24,4 @@ grant codeBase "file:ReadPropertyNegativeAction.jar" Principal javax.security.auth.x500.X500Principal "cn=Duke" { permission java.security.AllPermission; -}; \ No newline at end of file +}; diff -r 82e066c83bd0 -r b348f693a10e test/javax/security/auth/Subject/doAs/policy.one.principal --- a/test/javax/security/auth/Subject/doAs/policy.one.principal Tue Sep 08 16:01:29 2015 +0400 +++ b/test/javax/security/auth/Subject/doAs/policy.one.principal Tue Sep 08 14:40:44 2015 -0700 @@ -33,4 +33,4 @@ permission javax.security.auth.AuthPermission "getSubject"; permission javax.security.auth.AuthPermission "doAs"; permission java.util.PropertyPermission "java.class.path", "read"; -}; \ No newline at end of file +}; diff -r 82e066c83bd0 -r b348f693a10e test/javax/security/auth/Subject/doAs/policy.two.principals --- a/test/javax/security/auth/Subject/doAs/policy.two.principals Tue Sep 08 16:01:29 2015 +0400 +++ b/test/javax/security/auth/Subject/doAs/policy.two.principals Tue Sep 08 14:40:44 2015 -0700 @@ -34,4 +34,4 @@ permission javax.security.auth.AuthPermission "getSubject"; permission javax.security.auth.AuthPermission "doAs"; permission java.util.PropertyPermission "java.class.path", "read"; -}; \ No newline at end of file +}; diff -r 82e066c83bd0 -r b348f693a10e test/javax/security/auth/login/LoginContext/shared.config --- a/test/javax/security/auth/login/LoginContext/shared.config Tue Sep 08 16:01:29 2015 +0400 +++ b/test/javax/security/auth/login/LoginContext/shared.config Tue Sep 08 14:40:44 2015 -0700 @@ -1,4 +1,4 @@ SharedState { SharedState$FirstModule required; SharedState$SecondModule required; -}; \ No newline at end of file +}; diff -r 82e066c83bd0 -r b348f693a10e test/javax/sound/midi/Gervill/ModelStandardIndexedDirector/ModelStandardIndexedDirectorTest.java --- a/test/javax/sound/midi/Gervill/ModelStandardIndexedDirector/ModelStandardIndexedDirectorTest.java Tue Sep 08 16:01:29 2015 +0400 +++ b/test/javax/sound/midi/Gervill/ModelStandardIndexedDirector/ModelStandardIndexedDirectorTest.java Tue Sep 08 14:40:44 2015 -0700 @@ -184,5 +184,3 @@ } } - - diff -r 82e066c83bd0 -r b348f693a10e test/javax/swing/JColorChooser/8065098/bug8065098.html --- a/test/javax/swing/JColorChooser/8065098/bug8065098.html Tue Sep 08 16:01:29 2015 +0400 +++ b/test/javax/swing/JColorChooser/8065098/bug8065098.html Tue Sep 08 14:40:44 2015 -0700 @@ -37,4 +37,4 @@ - \ No newline at end of file + diff -r 82e066c83bd0 -r b348f693a10e test/javax/swing/JFileChooser/8062561/security2.policy --- a/test/javax/swing/JFileChooser/8062561/security2.policy Tue Sep 08 16:01:29 2015 +0400 +++ b/test/javax/swing/JFileChooser/8062561/security2.policy Tue Sep 08 14:40:44 2015 -0700 @@ -1,1 +1,1 @@ -// Autogenerated file \ No newline at end of file +// Autogenerated file diff -r 82e066c83bd0 -r b348f693a10e test/javax/swing/JFileChooser/FileFilterDescription/FileFilterDescription.java --- a/test/javax/swing/JFileChooser/FileFilterDescription/FileFilterDescription.java Tue Sep 08 16:01:29 2015 +0400 +++ b/test/javax/swing/JFileChooser/FileFilterDescription/FileFilterDescription.java Tue Sep 08 14:40:44 2015 -0700 @@ -82,4 +82,4 @@ return "CustomFileFilter"; } } -} \ No newline at end of file +} diff -r 82e066c83bd0 -r b348f693a10e test/javax/swing/JMenu/8072900/WrongSelectionOnMouseOver.java --- a/test/javax/swing/JMenu/8072900/WrongSelectionOnMouseOver.java Tue Sep 08 16:01:29 2015 +0400 +++ b/test/javax/swing/JMenu/8072900/WrongSelectionOnMouseOver.java Tue Sep 08 14:40:44 2015 -0700 @@ -195,4 +195,4 @@ } System.out.println("Test passed"); } -} \ No newline at end of file +} diff -r 82e066c83bd0 -r b348f693a10e test/javax/swing/JMenuBar/MisplacedBorder/MisplacedBorder.java --- a/test/javax/swing/JMenuBar/MisplacedBorder/MisplacedBorder.java Tue Sep 08 16:01:29 2015 +0400 +++ b/test/javax/swing/JMenuBar/MisplacedBorder/MisplacedBorder.java Tue Sep 08 14:40:44 2015 -0700 @@ -132,4 +132,4 @@ throw new RuntimeException(e); } } -} \ No newline at end of file +} diff -r 82e066c83bd0 -r b348f693a10e test/javax/swing/JOptionPane/8081019/bug8081019.java --- a/test/javax/swing/JOptionPane/8081019/bug8081019.java Tue Sep 08 16:01:29 2015 +0400 +++ b/test/javax/swing/JOptionPane/8081019/bug8081019.java Tue Sep 08 14:40:44 2015 -0700 @@ -103,4 +103,4 @@ throw new RuntimeException("Exception in the output!"); } } -} \ No newline at end of file +} diff -r 82e066c83bd0 -r b348f693a10e test/javax/swing/JTextArea/4697612/bug4697612.txt --- a/test/javax/swing/JTextArea/4697612/bug4697612.txt Tue Sep 08 16:01:29 2015 +0400 +++ b/test/javax/swing/JTextArea/4697612/bug4697612.txt Tue Sep 08 14:40:44 2015 -0700 @@ -219,5 +219,3 @@ Copyright 2003 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, California 95054, U.S.A. All rights reserved. - - diff -r 82e066c83bd0 -r b348f693a10e test/javax/swing/JTree/8072676/TreeClipTest.java --- a/test/javax/swing/JTree/8072676/TreeClipTest.java Tue Sep 08 16:01:29 2015 +0400 +++ b/test/javax/swing/JTree/8072676/TreeClipTest.java Tue Sep 08 14:40:44 2015 -0700 @@ -94,4 +94,4 @@ System.out.println("Passed."); } } -} \ No newline at end of file +} diff -r 82e066c83bd0 -r b348f693a10e test/javax/swing/JTree/DnD/LastNodeLowerHalfDrop.java --- a/test/javax/swing/JTree/DnD/LastNodeLowerHalfDrop.java Tue Sep 08 16:01:29 2015 +0400 +++ b/test/javax/swing/JTree/DnD/LastNodeLowerHalfDrop.java Tue Sep 08 14:40:44 2015 -0700 @@ -381,4 +381,4 @@ return nodesFlavor.equals(flavor); } } -} \ No newline at end of file +} diff -r 82e066c83bd0 -r b348f693a10e test/javax/swing/UIDefaults/7180976/Pending.java --- a/test/javax/swing/UIDefaults/7180976/Pending.java Tue Sep 08 16:01:29 2015 +0400 +++ b/test/javax/swing/UIDefaults/7180976/Pending.java Tue Sep 08 14:40:44 2015 -0700 @@ -47,4 +47,4 @@ UIManager.get("foobar"); passed = true; } -} \ No newline at end of file +} diff -r 82e066c83bd0 -r b348f693a10e test/javax/swing/plaf/basic/BasicLabelUI/bug7172652.java --- a/test/javax/swing/plaf/basic/BasicLabelUI/bug7172652.java Tue Sep 08 16:01:29 2015 +0400 +++ b/test/javax/swing/plaf/basic/BasicLabelUI/bug7172652.java Tue Sep 08 14:40:44 2015 -0700 @@ -169,4 +169,4 @@ frame.setVisible(true); } -} \ No newline at end of file +} diff -r 82e066c83bd0 -r b348f693a10e test/javax/swing/text/View/8015853/bug8015853.txt --- a/test/javax/swing/text/View/8015853/bug8015853.txt Tue Sep 08 16:01:29 2015 +0400 +++ b/test/javax/swing/text/View/8015853/bug8015853.txt Tue Sep 08 14:40:44 2015 -0700 @@ -64,4 +64,4 @@ frame.add(editorPane); frame.setVisible(true); } -} \ No newline at end of file +} diff -r 82e066c83bd0 -r b348f693a10e test/javax/swing/text/html/8005391/bug8005391.java --- a/test/javax/swing/text/html/8005391/bug8005391.java Tue Sep 08 16:01:29 2015 +0400 +++ b/test/javax/swing/text/html/8005391/bug8005391.java Tue Sep 08 14:40:44 2015 -0700 @@ -58,4 +58,4 @@ } } } -} \ No newline at end of file +} diff -r 82e066c83bd0 -r b348f693a10e test/javax/swing/text/html/HTMLDocument/8058120/bug8058120.java --- a/test/javax/swing/text/html/HTMLDocument/8058120/bug8058120.java Tue Sep 08 16:01:29 2015 +0400 +++ b/test/javax/swing/text/html/HTMLDocument/8058120/bug8058120.java Tue Sep 08 14:40:44 2015 -0700 @@ -109,5 +109,3 @@ frame.setVisible(true); } } - - diff -r 82e066c83bd0 -r b348f693a10e test/javax/xml/bind/xjc/8032884/optional-property-schema.xsd --- a/test/javax/xml/bind/xjc/8032884/optional-property-schema.xsd Tue Sep 08 16:01:29 2015 +0400 +++ b/test/javax/xml/bind/xjc/8032884/optional-property-schema.xsd Tue Sep 08 14:40:44 2015 -0700 @@ -11,4 +11,4 @@ - \ No newline at end of file + diff -r 82e066c83bd0 -r b348f693a10e test/javax/xml/jaxp/parsers/8032909/a_utf16.xml diff -r 82e066c83bd0 -r b348f693a10e test/javax/xml/jaxp/parsers/8032909/a_utf16.xsl diff -r 82e066c83bd0 -r b348f693a10e test/javax/xml/jaxp/testng/validation/jdk8036951/idc.xml --- a/test/javax/xml/jaxp/testng/validation/jdk8036951/idc.xml Tue Sep 08 16:01:29 2015 +0400 +++ b/test/javax/xml/jaxp/testng/validation/jdk8036951/idc.xml Tue Sep 08 14:40:44 2015 -0700 @@ -4,4 +4,4 @@ 2 2 3 - \ No newline at end of file + diff -r 82e066c83bd0 -r b348f693a10e test/javax/xml/jaxp/testng/validation/jdk8036951/idc.xsd --- a/test/javax/xml/jaxp/testng/validation/jdk8036951/idc.xsd Tue Sep 08 16:01:29 2015 +0400 +++ b/test/javax/xml/jaxp/testng/validation/jdk8036951/idc.xsd Tue Sep 08 14:40:44 2015 -0700 @@ -38,4 +38,4 @@ - \ No newline at end of file + diff -r 82e066c83bd0 -r b348f693a10e test/javax/xml/jaxp/testng/validation/jdk8036951/simpleType.xml --- a/test/javax/xml/jaxp/testng/validation/jdk8036951/simpleType.xml Tue Sep 08 16:01:29 2015 +0400 +++ b/test/javax/xml/jaxp/testng/validation/jdk8036951/simpleType.xml Tue Sep 08 14:40:44 2015 -0700 @@ -1,2 +1,2 @@ --12345 \ No newline at end of file +-12345 diff -r 82e066c83bd0 -r b348f693a10e test/javax/xml/jaxp/testng/validation/jdk8036951/xerces1128_1.xml --- a/test/javax/xml/jaxp/testng/validation/jdk8036951/xerces1128_1.xml Tue Sep 08 16:01:29 2015 +0400 +++ b/test/javax/xml/jaxp/testng/validation/jdk8036951/xerces1128_1.xml Tue Sep 08 14:40:44 2015 -0700 @@ -2,4 +2,4 @@ - \ No newline at end of file + diff -r 82e066c83bd0 -r b348f693a10e test/javax/xml/jaxp/testng/validation/jdk8036951/xerces1128_2.xml --- a/test/javax/xml/jaxp/testng/validation/jdk8036951/xerces1128_2.xml Tue Sep 08 16:01:29 2015 +0400 +++ b/test/javax/xml/jaxp/testng/validation/jdk8036951/xerces1128_2.xml Tue Sep 08 14:40:44 2015 -0700 @@ -2,4 +2,4 @@ - \ No newline at end of file + diff -r 82e066c83bd0 -r b348f693a10e test/javax/xml/jaxp/testng/validation/jdk8037819/unparsedEntity.dtd --- a/test/javax/xml/jaxp/testng/validation/jdk8037819/unparsedEntity.dtd Tue Sep 08 16:01:29 2015 +0400 +++ b/test/javax/xml/jaxp/testng/validation/jdk8037819/unparsedEntity.dtd Tue Sep 08 14:40:44 2015 -0700 @@ -1,2 +1,2 @@ - \ No newline at end of file + diff -r 82e066c83bd0 -r b348f693a10e test/javax/xml/jaxp/transform/8004476/tokenize.xml --- a/test/javax/xml/jaxp/transform/8004476/tokenize.xml Tue Sep 08 16:01:29 2015 +0400 +++ b/test/javax/xml/jaxp/transform/8004476/tokenize.xml Tue Sep 08 14:40:44 2015 -0700 @@ -4,4 +4,4 @@ Is this EXSLT? No. no Is this EXSLT? No. no - \ No newline at end of file + diff -r 82e066c83bd0 -r b348f693a10e test/sun/jvmstat/testlibrary/utils.sh --- a/test/sun/jvmstat/testlibrary/utils.sh Tue Sep 08 16:01:29 2015 +0400 +++ b/test/sun/jvmstat/testlibrary/utils.sh Tue Sep 08 14:40:44 2015 -0700 @@ -221,5 +221,3 @@ fi echo "${port1}" } - - diff -r 82e066c83bd0 -r b348f693a10e test/sun/management/jmxremote/bootstrap/PasswordFilePermissionTest.java --- a/test/sun/management/jmxremote/bootstrap/PasswordFilePermissionTest.java Tue Sep 08 16:01:29 2015 +0400 +++ b/test/sun/management/jmxremote/bootstrap/PasswordFilePermissionTest.java Tue Sep 08 14:40:44 2015 -0700 @@ -57,5 +57,3 @@ } } - - diff -r 82e066c83bd0 -r b348f693a10e test/sun/management/jmxremote/bootstrap/SSLConfigFilePermissionTest.java --- a/test/sun/management/jmxremote/bootstrap/SSLConfigFilePermissionTest.java Tue Sep 08 16:01:29 2015 +0400 +++ b/test/sun/management/jmxremote/bootstrap/SSLConfigFilePermissionTest.java Tue Sep 08 14:40:44 2015 -0700 @@ -61,5 +61,3 @@ test.runTest(args); } } - - diff -r 82e066c83bd0 -r b348f693a10e test/sun/management/jmxremote/startstop/JMXStatusPerfCountersTest.java --- a/test/sun/management/jmxremote/startstop/JMXStatusPerfCountersTest.java Tue Sep 08 16:01:29 2015 +0400 +++ b/test/sun/management/jmxremote/startstop/JMXStatusPerfCountersTest.java Tue Sep 08 14:40:44 2015 -0700 @@ -186,4 +186,4 @@ private Properties getCounters() throws IOException, InterruptedException { return jcmd.perfCounters("sun\\.management\\.JMXConnectorServer\\..*"); } -} \ No newline at end of file +} diff -r 82e066c83bd0 -r b348f693a10e test/sun/management/jmxremote/startstop/REMOTE_TESTING.txt --- a/test/sun/management/jmxremote/startstop/REMOTE_TESTING.txt Tue Sep 08 16:01:29 2015 +0400 +++ b/test/sun/management/jmxremote/startstop/REMOTE_TESTING.txt Tue Sep 08 14:40:44 2015 -0700 @@ -15,5 +15,3 @@ 6. connect jconsole to host2:50234 Make sure jconsole works Make sure only host2.50234 and host2.50235 appears in tcpdump output. - - diff -r 82e066c83bd0 -r b348f693a10e test/sun/management/windows/README --- a/test/sun/management/windows/README Tue Sep 08 16:01:29 2015 +0400 +++ b/test/sun/management/windows/README Tue Sep 08 14:40:44 2015 -0700 @@ -26,5 +26,3 @@ Note that a 32-bit version of revokeall.exe is checked into SCCS - this 32-bit application is also used when running on 64-bit versions of Windows (AMD64 and IA64). - - diff -r 82e066c83bd0 -r b348f693a10e test/sun/net/www/http/HttpClient/IsKeepingAlive.policy --- a/test/sun/net/www/http/HttpClient/IsKeepingAlive.policy Tue Sep 08 16:01:29 2015 +0400 +++ b/test/sun/net/www/http/HttpClient/IsKeepingAlive.policy Tue Sep 08 14:40:44 2015 -0700 @@ -45,5 +45,3 @@ permission java.util.PropertyPermission "java.vm.vendor", "read"; permission java.util.PropertyPermission "java.vm.name", "read"; }; - - diff -r 82e066c83bd0 -r b348f693a10e test/sun/net/www/http/HttpClient/OpenServer.policy --- a/test/sun/net/www/http/HttpClient/OpenServer.policy Tue Sep 08 16:01:29 2015 +0400 +++ b/test/sun/net/www/http/HttpClient/OpenServer.policy Tue Sep 08 14:40:44 2015 -0700 @@ -45,5 +45,3 @@ permission java.util.PropertyPermission "java.vm.vendor", "read"; permission java.util.PropertyPermission "java.vm.name", "read"; }; - - diff -r 82e066c83bd0 -r b348f693a10e test/sun/net/www/protocol/http/spnegoTest --- a/test/sun/net/www/protocol/http/spnegoTest Tue Sep 08 16:01:29 2015 +0400 +++ b/test/sun/net/www/protocol/http/spnegoTest Tue Sep 08 14:40:44 2015 -0700 @@ -205,4 +205,4 @@ rm err.log rm out.log -exit 0 \ No newline at end of file +exit 0 diff -r 82e066c83bd0 -r b348f693a10e test/sun/security/ec/SignatureOffsets.java --- a/test/sun/security/ec/SignatureOffsets.java Tue Sep 08 16:01:29 2015 +0400 +++ b/test/sun/security/ec/SignatureOffsets.java Tue Sep 08 14:40:44 2015 -0700 @@ -49,4 +49,4 @@ InvalidKeyException, SignatureException { Offsets.main(args); } -} \ No newline at end of file +} diff -r 82e066c83bd0 -r b348f693a10e test/sun/security/krb5/IPv6.java --- a/test/sun/security/krb5/IPv6.java Tue Sep 08 16:01:29 2015 +0400 +++ b/test/sun/security/krb5/IPv6.java Tue Sep 08 14:40:44 2015 -0700 @@ -127,5 +127,3 @@ } } } - - diff -r 82e066c83bd0 -r b348f693a10e test/sun/security/mscapi/KeytoolChangeAlias.sh --- a/test/sun/security/mscapi/KeytoolChangeAlias.sh Tue Sep 08 16:01:29 2015 +0400 +++ b/test/sun/security/mscapi/KeytoolChangeAlias.sh Tue Sep 08 14:40:44 2015 -0700 @@ -132,6 +132,3 @@ exit 0 ;; esac - - - diff -r 82e066c83bd0 -r b348f693a10e test/sun/security/mscapi/SignatureOffsets.java --- a/test/sun/security/mscapi/SignatureOffsets.java Tue Sep 08 16:01:29 2015 +0400 +++ b/test/sun/security/mscapi/SignatureOffsets.java Tue Sep 08 14:40:44 2015 -0700 @@ -50,4 +50,4 @@ InvalidKeyException, SignatureException { Offsets.main(args); } -} \ No newline at end of file +} diff -r 82e066c83bd0 -r b348f693a10e test/sun/security/pkcs11/Provider/Absolute.java --- a/test/sun/security/pkcs11/Provider/Absolute.java Tue Sep 08 16:01:29 2015 +0400 +++ b/test/sun/security/pkcs11/Provider/Absolute.java Tue Sep 08 14:40:44 2015 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 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 @@ -22,40 +22,31 @@ */ /** * @test - * @bug 7003952 + * @bug 7003952 7191662 + * @library .. * @summary load DLLs and launch executables using fully qualified path */ import java.security.*; -import java.lang.reflect.*; public class Absolute { public static void main(String[] args) throws Exception { - Constructor cons; - try { - Class clazz = Class.forName("sun.security.pkcs11.SunPKCS11"); - cons = clazz.getConstructor(new Class[] {String.class}); - } catch (Exception ex) { - System.out.println("Skipping test - no PKCS11 provider available"); - return; - } - String config = System.getProperty("test.src", ".") + "/Absolute.cfg"; try { - Object obj = cons.newInstance(new Object[] {config}); - } catch (InvocationTargetException ite) { - Throwable cause = ite.getCause(); - if (cause instanceof ProviderException) { - Throwable cause2 = cause.getCause(); - if ((cause2 == null) || - !cause2.getMessage().startsWith( - "Absolute path required for library value:")) { - // rethrow - throw (ProviderException) cause; - } - System.out.println("Caught expected Exception: \n" + cause2); + Provider p = PKCS11Test.getSunPKCS11(config); + if (p == null) { + System.out.println("Skipping test - no PKCS11 provider available"); + } + } catch (InvalidParameterException ipe) { + Throwable ex = ipe.getCause(); + if (ex.getMessage().indexOf( + "Absolute path required for library value:") != -1) { + System.out.println("Test Passed: expected exception thrown"); + } else { + // rethrow + throw ipe; } } } diff -r 82e066c83bd0 -r b348f693a10e test/sun/security/pkcs11/Provider/ConfigShortPath.java --- a/test/sun/security/pkcs11/Provider/ConfigShortPath.java Tue Sep 08 16:01:29 2015 +0400 +++ b/test/sun/security/pkcs11/Provider/ConfigShortPath.java Tue Sep 08 14:40:44 2015 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 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 @@ -33,44 +33,52 @@ public class ConfigShortPath { - private static final String[] configNames = { - "csp.cfg", "cspPlus.cfg", "cspSpace.cfg", "cspQuotedPath.cfg" + private static final String[] winConfigNames = { + "csp.cfg", "cspSpace.cfg", "cspQuotedPath.cfg" + }; + private static final String[] solConfigNames = { + "cspPlus.cfg" }; public static void main(String[] args) throws Exception { - Constructor cons = null; - try { - Class clazz = Class.forName("sun.security.pkcs11.SunPKCS11"); - cons = clazz.getConstructor(String.class); - } catch (Exception ex) { - System.out.println("Skipping test - no PKCS11 provider available"); - return; + Provider p = Security.getProvider("SunPKCS11"); + if (p == null) { + // re-try w/ SunPKCS11-Solaris + p = Security.getProvider("SunPKCS11-Solaris"); + if (p == null) { + System.out.println("Skipping test - no PKCS11 provider available"); + return; + } } + + String osInfo = System.getProperty("os.name", ""); + String[] configNames = (osInfo.contains("Windows")? + winConfigNames : solConfigNames); + String testSrc = System.getProperty("test.src", "."); for (int i = 0; i < configNames.length; i++) { String configFile = testSrc + File.separator + configNames[i]; System.out.println("Testing against " + configFile); try { - Object obj = cons.newInstance(configFile); - } catch (InvocationTargetException ite) { - Throwable cause = ite.getCause(); - System.out.println(cause); - if (cause instanceof ProviderException) { - while ((cause = cause.getCause()) != null) { - System.out.println(cause); - String causeMsg = cause.getMessage(); - // Indicate failure if due to parsing config - if (causeMsg.indexOf("Unexpected") != -1) { - throw (ProviderException) cause; - } + p.configure(configFile); + } catch (InvalidParameterException ipe) { + ipe.printStackTrace(); + Throwable cause = ipe.getCause(); + // Indicate failure if due to parsing config + if (cause.getClass().getName().equals + ("sun.security.pkcs11.ConfigurationException")) { + // Error occurred during parsing + if (cause.getMessage().indexOf("Unexpected") != -1) { + throw (ProviderException) cause; } - // Consider the test passes if the exception is - // thrown after parsing, i.e. due to the absolute - // path requirement or the non-existent path. - } else { - // unexpected exception - throw new RuntimeException("Unexpected Exception", cause); + } + } catch (ProviderException pe) { + pe.printStackTrace(); + if (pe.getCause() instanceof IOException) { + // Thrown when the directory does not exist which is ok + System.out.println("Pass: config parsed ok"); + continue; } } } diff -r 82e066c83bd0 -r b348f693a10e test/sun/security/pkcs11/Provider/cspSpace.cfg --- a/test/sun/security/pkcs11/Provider/cspSpace.cfg Tue Sep 08 16:01:29 2015 +0400 +++ b/test/sun/security/pkcs11/Provider/cspSpace.cfg Tue Sep 08 14:40:44 2015 -0700 @@ -1,5 +1,3 @@ showInfo = false name = test library = C:\pki DLL\x64\acpkcs211.dll - - diff -r 82e066c83bd0 -r b348f693a10e test/sun/security/provider/certpath/Extensions/OCSPNonceExtensionTests.java --- a/test/sun/security/provider/certpath/Extensions/OCSPNonceExtensionTests.java Tue Sep 08 16:01:29 2015 +0400 +++ b/test/sun/security/provider/certpath/Extensions/OCSPNonceExtensionTests.java Tue Sep 08 14:40:44 2015 -0700 @@ -79,14 +79,11 @@ Map testList = new LinkedHashMap() {{ put("CTOR Test (provide length)", testCtorByLength); + put("CTOR Test (provide nonce bytes)", testCtorByValue); + put("CTOR Test (set criticality forms)", testCtorCritForms); put("CTOR Test (provide extension DER encoding)", testCtorSuperByDerValue); - put("Use set() call to provide random data", testResetValue); - put("Test get() method", testGet); - put("test set() method", testSet); - put("Test getElements() method", testGetElements); put("Test getName() method", testGetName); - put("Test delete() method", testDelete); }}; System.out.println("============ Tests ============"); @@ -179,6 +176,20 @@ Boolean pass = Boolean.FALSE; String message = null; try (ByteArrayOutputStream baos = new ByteArrayOutputStream()) { + // Try sending in a negative length + try { + Extension negLenNonce = new OCSPNonceExtension(-8); + throw new RuntimeException( + "Accepted a negative length nonce"); + } catch (IllegalArgumentException iae) { } + + // How about a zero length? + try { + Extension zeroLenNonce = new OCSPNonceExtension(0); + throw new RuntimeException("Accepted a zero length nonce"); + } catch (IllegalArgumentException iae) { } + + // Valid input to constructor Extension nonceByLen = new OCSPNonceExtension(32); // Verify overall encoded extension structure @@ -216,6 +227,82 @@ } }; + public static final TestCase testCtorByValue = new TestCase() { + @Override + public Map.Entry runTest() { + Boolean pass = Boolean.FALSE; + String message = null; + try (ByteArrayOutputStream baos = new ByteArrayOutputStream()) { + + // Try giving a null value for the nonce + try { + Extension nullNonce = new OCSPNonceExtension(null); + throw new RuntimeException("Accepted a null nonce"); + } catch (NullPointerException npe) { } + + // How about a zero-length byte array? + try { + Extension zeroLenNonce = + new OCSPNonceExtension(new byte[0]); + throw new RuntimeException("Accepted a zero length nonce"); + } catch (IllegalArgumentException iae) { } + + OCSPNonceExtension nonceByValue = + new OCSPNonceExtension(DEADBEEF_16); + + // Verify overall encoded extension structure + nonceByValue.encode(baos); + verifyExtStructure(baos.toByteArray()); + + // Verify the name, elements, and data conform to + // expected values for this specific object. + boolean crit = nonceByValue.isCritical(); + String oid = nonceByValue.getId(); + byte[] nonceData = nonceByValue.getNonceValue(); + + if (crit) { + message = "Extension incorrectly marked critical"; + } else if (!oid.equals(OCSP_NONCE_OID)) { + message = "Incorrect OID (Got " + oid + ", Expected " + + OCSP_NONCE_OID + ")"; + } else if (!Arrays.equals(nonceData, DEADBEEF_16)) { + message = "Returned nonce value did not match input"; + } else { + pass = Boolean.TRUE; + } + } catch (Exception e) { + e.printStackTrace(System.out); + message = e.getClass().getName(); + } + + return new AbstractMap.SimpleEntry<>(pass, message); + } + }; + + public static final TestCase testCtorCritForms = new TestCase() { + @Override + public Map.Entry runTest() { + Boolean pass = Boolean.FALSE; + String message = null; + try (ByteArrayOutputStream baos = new ByteArrayOutputStream()) { + Extension nonceByLength = new OCSPNonceExtension(true, 32); + Extension nonceByValue = + new OCSPNonceExtension(true, DEADBEEF_16); + pass = nonceByLength.isCritical() && nonceByValue.isCritical(); + if (!pass) { + message = "nonceByLength or nonceByValue was not marked " + + "critical as expected"; + } + } catch (Exception e) { + e.printStackTrace(System.out); + message = e.getClass().getName(); + } + + return new AbstractMap.SimpleEntry<>(pass, message); + } + }; + + public static final TestCase testCtorSuperByDerValue = new TestCase() { @Override public Map.Entry runTest() { @@ -260,145 +347,6 @@ } }; - public static final TestCase testResetValue = new TestCase() { - @Override - public Map.Entry runTest() { - Boolean pass = Boolean.FALSE; - String message = null; - try (ByteArrayOutputStream baos = new ByteArrayOutputStream()) { - OCSPNonceExtension nonce = new OCSPNonceExtension(32); - - // Reset the nonce data to reflect 16 bytes of DEADBEEF - nonce.set(OCSPNonceExtension.NONCE, (Object)DEADBEEF_16); - - // Verify overall encoded extension content - nonce.encode(baos); - dumpHexBytes(OCSP_NONCE_DB16); - System.out.println(); - dumpHexBytes(baos.toByteArray()); - - pass = Arrays.equals(baos.toByteArray(), OCSP_NONCE_DB16); - } catch (Exception e) { - e.printStackTrace(System.out); - message = e.getClass().getName(); - } - - return new AbstractMap.SimpleEntry<>(pass, message); - } - }; - - public static final TestCase testSet = new TestCase() { - @Override - public Map.Entry runTest() { - Boolean pass = Boolean.FALSE; - String message = null; - try { - OCSPNonceExtension nonceByLen = new OCSPNonceExtension(32); - - // Set the nonce data to 16 bytes of DEADBEEF - nonceByLen.set(ELEMENT_NONCE, DEADBEEF_16); - byte[] nonceData = (byte[])nonceByLen.get(ELEMENT_NONCE); - if (!Arrays.equals(nonceData, DEADBEEF_16)) { - throw new RuntimeException("Retuned nonce data does not " + - "match expected result"); - } - - // Now try to set a value using an object that is not a byte - // array - int[] INT_DB_16 = { - 0xDEADBEEF, 0xDEADBEEF, 0xDEADBEEF, 0xDEADBEEF - }; - try { - nonceByLen.set(ELEMENT_NONCE, INT_DB_16); - throw new RuntimeException("Accepted get() for " + - "unsupported element name"); - } catch (IOException ioe) { } // Expected result - - // And try setting a value using an unknown element name - try { - nonceByLen.set("FOO", DEADBEEF_16); - throw new RuntimeException("Accepted get() for " + - "unsupported element name"); - } catch (IOException ioe) { } // Expected result - - pass = Boolean.TRUE; - } catch (Exception e) { - e.printStackTrace(System.out); - message = e.getClass().getName(); - } - - return new AbstractMap.SimpleEntry<>(pass, message); - } - }; - - public static final TestCase testGet = new TestCase() { - @Override - public Map.Entry runTest() { - Boolean pass = Boolean.FALSE; - String message = null; - try { - OCSPNonceExtension nonceByLen = new OCSPNonceExtension(32); - - // Grab the nonce data by its correct element name - byte[] nonceData = (byte[])nonceByLen.get(ELEMENT_NONCE); - if (nonceData == null || nonceData.length != 32) { - throw new RuntimeException("Unexpected return value from " + - "get() method: either null or incorrect length"); - } - - // Now try to get any kind of data using an element name that - // doesn't exist for this extension. - try { - nonceByLen.get("FOO"); - throw new RuntimeException("Accepted get() for " + - "unsupported element name"); - } catch (IOException ioe) { } // Expected result - - pass = Boolean.TRUE; - } catch (Exception e) { - e.printStackTrace(System.out); - message = e.getClass().getName(); - } - - return new AbstractMap.SimpleEntry<>(pass, message); - } - }; - - public static final TestCase testGetElements = new TestCase() { - @Override - public Map.Entry runTest() { - Boolean pass = Boolean.FALSE; - String message = null; - try { - OCSPNonceExtension nonceByLen = new OCSPNonceExtension(32); - - int elementCount = 0; - boolean foundElement = false; - - // There should be exactly one element and its name should - // be "nonce" - for (Enumeration elements = nonceByLen.getElements(); - elements.hasMoreElements(); elementCount++) { - if (elements.nextElement().equals(ELEMENT_NONCE)) { - foundElement = true; - } - } - - if (!foundElement || elementCount != 1) { - throw new RuntimeException("Unexpected or missing " + - "Enumeration element"); - } - - pass = Boolean.TRUE; - } catch (Exception e) { - e.printStackTrace(System.out); - message = e.getClass().getName(); - } - - return new AbstractMap.SimpleEntry<>(pass, message); - } - }; - public static final TestCase testGetName = new TestCase() { @Override public Map.Entry runTest() { @@ -415,44 +363,4 @@ return new AbstractMap.SimpleEntry<>(pass, message); } }; - - public static final TestCase testDelete = new TestCase() { - @Override - public Map.Entry runTest() { - Boolean pass = Boolean.FALSE; - String message = null; - try { - OCSPNonceExtension nonceByLen = new OCSPNonceExtension(32); - - // First verify that there's data to begin with - byte[] nonceData = (byte[])nonceByLen.get(ELEMENT_NONCE); - if (nonceData == null || nonceData.length != 32) { - throw new RuntimeException("Unexpected return value from " + - "get() method: either null or incorrect length"); - } - - // Attempt to delete using an element name that doesn't exist - // for this extension. - try { - nonceByLen.delete("FOO"); - throw new RuntimeException("Accepted delete() for " + - "unsupported element name"); - } catch (IOException ioe) { } // Expected result - - // Now attempt to properly delete the extension data - nonceByLen.delete(ELEMENT_NONCE); - nonceData = (byte[])nonceByLen.get(ELEMENT_NONCE); - if (nonceData != null) { - throw new RuntimeException("Unexpected non-null return"); - } - - pass = Boolean.TRUE; - } catch (Exception e) { - e.printStackTrace(System.out); - message = e.getClass().getName(); - } - - return new AbstractMap.SimpleEntry<>(pass, message); - } - }; } diff -r 82e066c83bd0 -r b348f693a10e test/sun/security/rsa/SignatureOffsets.java --- a/test/sun/security/rsa/SignatureOffsets.java Tue Sep 08 16:01:29 2015 +0400 +++ b/test/sun/security/rsa/SignatureOffsets.java Tue Sep 08 14:40:44 2015 -0700 @@ -50,4 +50,4 @@ InvalidKeyException, SignatureException { Offsets.main(args); } -} \ No newline at end of file +} diff -r 82e066c83bd0 -r b348f693a10e test/sun/security/ssl/StatusStapling/TestCase.java --- a/test/sun/security/ssl/StatusStapling/TestCase.java Tue Sep 08 16:01:29 2015 +0400 +++ b/test/sun/security/ssl/StatusStapling/TestCase.java Tue Sep 08 14:40:44 2015 -0700 @@ -28,5 +28,3 @@ public interface TestCase { Map.Entry runTest(); } - - diff -r 82e066c83bd0 -r b348f693a10e test/sun/security/ssl/StatusStapling/TestUtils.java --- a/test/sun/security/ssl/StatusStapling/TestUtils.java Tue Sep 08 16:01:29 2015 +0400 +++ b/test/sun/security/ssl/StatusStapling/TestUtils.java Tue Sep 08 14:40:44 2015 -0700 @@ -122,5 +122,3 @@ return resultBuf; } } - - diff -r 82e066c83bd0 -r b348f693a10e test/sun/security/ssl/rsa/SignatureOffsets.java --- a/test/sun/security/ssl/rsa/SignatureOffsets.java Tue Sep 08 16:01:29 2015 +0400 +++ b/test/sun/security/ssl/rsa/SignatureOffsets.java Tue Sep 08 14:40:44 2015 -0700 @@ -47,4 +47,4 @@ InvalidKeyException, SignatureException { Offsets.main(args); } -} \ No newline at end of file +} diff -r 82e066c83bd0 -r b348f693a10e test/sun/security/tools/jarsigner/collator.sh --- a/test/sun/security/tools/jarsigner/collator.sh Tue Sep 08 16:01:29 2015 +0400 +++ b/test/sun/security/tools/jarsigner/collator.sh Tue Sep 08 14:40:44 2015 -0700 @@ -72,5 +72,3 @@ echo "ERR is $ERR" exit 1 fi - - diff -r 82e066c83bd0 -r b348f693a10e test/sun/security/tools/jarsigner/jvindex.sh --- a/test/sun/security/tools/jarsigner/jvindex.sh Tue Sep 08 16:01:29 2015 +0400 +++ b/test/sun/security/tools/jarsigner/jvindex.sh Tue Sep 08 14:40:44 2015 -0700 @@ -72,5 +72,3 @@ echo "ERR is $ERR" exit 1 fi - - diff -r 82e066c83bd0 -r b348f693a10e test/sun/security/tools/jarsigner/warnings.sh --- a/test/sun/security/tools/jarsigner/warnings.sh Tue Sep 08 16:01:29 2015 +0400 +++ b/test/sun/security/tools/jarsigner/warnings.sh Tue Sep 08 14:40:44 2015 -0700 @@ -115,5 +115,3 @@ echo "ERR is $ERR" exit 1 fi - - diff -r 82e066c83bd0 -r b348f693a10e test/sun/security/x509/X509CertImpl/V3Certificate.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/sun/security/x509/X509CertImpl/V3Certificate.java Tue Sep 08 14:40:44 2015 -0700 @@ -0,0 +1,262 @@ +/* + * 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.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.io.PrintWriter; +import static java.lang.System.out; +import java.security.InvalidKeyException; +import java.security.KeyPair; +import java.security.KeyPairGenerator; +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; +import java.security.NoSuchProviderException; +import java.security.PrivateKey; +import java.security.PublicKey; +import java.security.Signature; +import java.security.SignatureException; +import java.security.cert.CertificateException; +import java.security.cert.CertificateFactory; +import java.security.cert.X509Certificate; +import java.util.Calendar; +import java.util.Date; +import java.util.TimeZone; +import sun.misc.BASE64Encoder; +import sun.security.util.BitArray; +import sun.security.util.ObjectIdentifier; +import sun.security.x509.*; + +/** + * @test + * @bug 8049237 + * @modules java.base/sun.security.x509 + * java.base/sun.security.util + * java.base/sun.misc + * @summary This test generates V3 certificate with all the supported + * extensions. Writes back the generated certificate in to a file and checks for + * equality with the original certificate. + */ +public class V3Certificate { + + public static final String V3_FILE = "certV3"; + public static final String V3_B64_FILE = "certV3.b64"; + + public static void main(String[] args) throws IOException, + NoSuchAlgorithmException, InvalidKeyException, CertificateException, + NoSuchProviderException, SignatureException { + + boolean success = true; + + success &= test("RSA", "SHA256withRSA", 2048); + success &= test("DSA", "SHA256withDSA", 2048); + success &= test("EC", "SHA256withECDSA", 384); + + if (!success) { + throw new RuntimeException("At least one test case failed"); + } + } + + public static boolean test(String algorithm, String sigAlg, int keyLength) + throws IOException, + NoSuchAlgorithmException, + InvalidKeyException, + CertificateException, + NoSuchProviderException, + SignatureException { + + byte[] issuerId = {1, 2, 3, 4, 5}; + byte[] subjectId = {6, 7, 8, 9, 10}; + boolean testResult = true; + + // Subject and Issuer + X500Name subject = new X500Name("test", "Oracle", "Santa Clara", + "US"); + X500Name issuer = subject; + + // Generate keys and sign + KeyPairGenerator keyGen = KeyPairGenerator.getInstance(algorithm); + keyGen.initialize(keyLength); + KeyPair pair = keyGen.generateKeyPair(); + PublicKey publicKey = pair.getPublic(); + PrivateKey privateKey = pair.getPrivate(); + MessageDigest md = MessageDigest.getInstance("SHA"); + byte[] keyId = md.digest(publicKey.getEncoded()); + + Signature signature = Signature.getInstance(sigAlg); + signature.initSign(privateKey); + + // Validity interval + Date firstDate = new Date(); + Calendar cal = Calendar.getInstance(TimeZone.getTimeZone("PST")); + cal.set(2014, 03, 10, 12, 30, 30); + Date lastDate = cal.getTime(); + CertificateValidity interval = new CertificateValidity(firstDate, + lastDate); + + // Certificate Info + X509CertInfo cert = new X509CertInfo(); + + cert.set(X509CertInfo.VERSION, + new CertificateVersion(CertificateVersion.V3)); + cert.set(X509CertInfo.SERIAL_NUMBER, + new CertificateSerialNumber((int) (firstDate.getTime() / 1000))); + cert.set(X509CertInfo.ALGORITHM_ID, + new CertificateAlgorithmId(AlgorithmId.get(sigAlg))); + cert.set(X509CertInfo.SUBJECT, subject); + cert.set(X509CertInfo.KEY, new CertificateX509Key(publicKey)); + cert.set(X509CertInfo.VALIDITY, interval); + cert.set(X509CertInfo.ISSUER, issuer); + + cert.set(X509CertInfo.ISSUER_ID, + new UniqueIdentity( + new BitArray(issuerId.length * 8 - 2, issuerId))); + cert.set(X509CertInfo.SUBJECT_ID, new UniqueIdentity(subjectId)); + + // Create Extensions + CertificateExtensions exts = new CertificateExtensions(); + + GeneralNameInterface mailInf = new RFC822Name("test@Oracle.com"); + GeneralName mail = new GeneralName(mailInf); + GeneralNameInterface dnsInf = new DNSName("Oracle.com"); + GeneralName dns = new GeneralName(dnsInf); + GeneralNameInterface uriInf = new URIName("http://www.Oracle.com"); + GeneralName uri = new GeneralName(uriInf); + + // localhost + byte[] address = new byte[]{127, 0, 0, 1}; + + GeneralNameInterface ipInf = new IPAddressName(address); + GeneralName ip = new GeneralName(ipInf); + int[] oidData = new int[]{1, 2, 3, 4}; + + GeneralNameInterface oidInf = new OIDName(new ObjectIdentifier(oidData)); + GeneralName oid = new GeneralName(oidInf); + + SubjectAlternativeNameExtension subjectName + = new SubjectAlternativeNameExtension(); + IssuerAlternativeNameExtension issuerName + = new IssuerAlternativeNameExtension(); + + GeneralNames subjectNames + = (GeneralNames) subjectName. + get(SubjectAlternativeNameExtension.SUBJECT_NAME); + + GeneralNames issuerNames + = (GeneralNames) issuerName. + get(IssuerAlternativeNameExtension.ISSUER_NAME); + + subjectNames.add(mail); + subjectNames.add(dns); + subjectNames.add(uri); + + issuerNames.add(ip); + issuerNames.add(oid); + + cal.set(2000, 11, 15, 12, 30, 30); + lastDate = cal.getTime(); + PrivateKeyUsageExtension pkusage + = new PrivateKeyUsageExtension(firstDate, lastDate); + + KeyUsageExtension usage = new KeyUsageExtension(); + usage.set(KeyUsageExtension.CRL_SIGN, true); + usage.set(KeyUsageExtension.DIGITAL_SIGNATURE, true); + usage.set(KeyUsageExtension.NON_REPUDIATION, true); + + KeyIdentifier kid = new KeyIdentifier(keyId); + SerialNumber sn = new SerialNumber(42); + AuthorityKeyIdentifierExtension aki + = new AuthorityKeyIdentifierExtension(kid, subjectNames, sn); + + SubjectKeyIdentifierExtension ski + = new SubjectKeyIdentifierExtension(keyId); + + BasicConstraintsExtension cons + = new BasicConstraintsExtension(true, 10); + + PolicyConstraintsExtension pce = new PolicyConstraintsExtension(2, 4); + + exts.set(SubjectAlternativeNameExtension.NAME, subjectName); + exts.set(IssuerAlternativeNameExtension.NAME, issuerName); + exts.set(PrivateKeyUsageExtension.NAME, pkusage); + exts.set(KeyUsageExtension.NAME, usage); + exts.set(AuthorityKeyIdentifierExtension.NAME, aki); + exts.set(SubjectKeyIdentifierExtension.NAME, ski); + exts.set(BasicConstraintsExtension.NAME, cons); + exts.set(PolicyConstraintsExtension.NAME, pce); + cert.set(X509CertInfo.EXTENSIONS, exts); + + // Generate and sign X509CertImpl + X509CertImpl crt = new X509CertImpl(cert); + crt.sign(privateKey, sigAlg); + crt.verify(publicKey); + + try (FileOutputStream fos = new FileOutputStream(new File(V3_FILE)); + FileOutputStream fos_b64 + = new FileOutputStream(new File(V3_B64_FILE)); + PrintWriter pw = new PrintWriter(fos_b64)) { + crt.encode((OutputStream) fos); + fos.flush(); + + // Certificate boundaries/ + pw.println("-----BEGIN CERTIFICATE-----"); + pw.flush(); + new BASE64Encoder().encodeBuffer(crt.getEncoded(), fos_b64); + fos_b64.flush(); + pw.println("-----END CERTIFICATE-----"); + } + + out.println("*** Certificate ***"); + out.println(crt); + out.println("*** End Certificate ***"); + + X509Certificate x2 = generateCertificate(V3_FILE); + if (!x2.equals(crt)) { + out.println("*** Certificate mismatch ***"); + testResult = false; + } + + X509Certificate x3 = generateCertificate(V3_B64_FILE); + if (!x3.equals(crt)) { + out.println("*** Certificate mismatch ***"); + testResult = false; + } + + return testResult; + } + + static X509Certificate generateCertificate(String certFile) { + try (InputStream inStrm = new FileInputStream(certFile)) { + CertificateFactory cf = CertificateFactory.getInstance("X509"); + X509Certificate x2 + = (X509Certificate) cf.generateCertificate(inStrm); + return x2; + } catch (CertificateException | IOException e) { + throw new RuntimeException("Exception while " + + "genrating certificate for " + certFile, e); + } + } +} diff -r 82e066c83bd0 -r b348f693a10e test/sun/tools/jps/JpsBase.java --- a/test/sun/tools/jps/JpsBase.java Tue Sep 08 16:01:29 2015 +0400 +++ b/test/sun/tools/jps/JpsBase.java Tue Sep 08 14:40:44 2015 -0700 @@ -138,6 +138,8 @@ String tmp = str.replace("\\", "\\\\"); tmp = tmp.replace("+", "\\+"); tmp = tmp.replace(".", "\\."); + tmp = tmp.replace("\n", "\\\\n"); + tmp = tmp.replace("\r", "\\\\r"); return tmp; } diff -r 82e066c83bd0 -r b348f693a10e test/sun/tools/jps/JpsHelper.java --- a/test/sun/tools/jps/JpsHelper.java Tue Sep 08 16:01:29 2015 +0400 +++ b/test/sun/tools/jps/JpsHelper.java Tue Sep 08 14:40:44 2015 -0700 @@ -97,7 +97,10 @@ * VM arguments to start test application with. * -XX:+UsePerfData is required for running the tests on embedded platforms. */ - public static final String[] VM_ARGS = {"-XX:+UsePerfData", "-Xmx512m", "-XX:+PrintGCDetails"}; + public static final String[] VM_ARGS = { + "-XX:+UsePerfData", "-Xmx512m", "-XX:+PrintGCDetails", + "-Dmultiline.prop=value1\nvalue2\r\nvalue3" + }; /** * VM flag to start test application with */