--- a/jdk/make/Setup.gmk Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/make/Setup.gmk Wed Apr 09 17:17:03 2014 -0700
@@ -27,7 +27,7 @@
# To build with all warnings enabled, do the following:
# make JAVAC_WARNINGS="-Xlint:all -Xmaxwarns 10000"
-JAVAC_WARNINGS := -Xlint:-unchecked,-deprecation,-overrides,auxiliaryclass,cast,classfile,dep-ann,divzero,empty,overloads,static,try,varargs -Werror
+JAVAC_WARNINGS := -Xlint:-unchecked,-deprecation,-overrides,auxiliaryclass,cast,classfile,dep-ann,divzero,empty,overloads,serial,static,try,varargs -Werror
# Any java code executed during a JDK build to build other parts of the JDK must be
# executed by the bootstrap JDK (probably with -Xbootclasspath/p: ) and for this
--- a/jdk/make/data/tzdata/VERSION Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/make/data/tzdata/VERSION Wed Apr 09 17:17:03 2014 -0700
@@ -21,4 +21,4 @@
# or visit www.oracle.com if you need additional information or have any
# questions.
#
-tzdata2014a
+tzdata2014b
--- a/jdk/make/data/tzdata/africa Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/make/data/tzdata/africa Wed Apr 09 17:17:03 2014 -0700
@@ -891,7 +891,10 @@
# Another source (specifying the time for start and end in the decree):
# http://www.lemag.ma/Heure-d-ete-au-Maroc-jusqu-au-27-octobre_a75620.html
-# From Paul Eggert (2013-10-03):
+# From Sebastien Willemijns (2014-03-18):
+# http://www.afriquinfos.com/articles/2014/3/18/maroc-heure-dete-avancez-tous-horloges-247891.asp
+
+# From Paul Eggert (2014-03-19):
# To estimate what the Moroccan government will do in future years,
# transition dates for 2014 through 2038 were determined by running
# the following program under GNU Emacs 24.3:
--- a/jdk/make/data/tzdata/antarctica Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/make/data/tzdata/antarctica Wed Apr 09 17:17:03 2014 -0700
@@ -253,24 +253,41 @@
# year-round base
# Scott Base, Ross Island, since 1957-01.
# See Pacific/Auckland.
-#
-# These rules for New Zealand are stolen from the 'australasia' file.
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
-Rule NZAQ 1974 only - Nov 3 2:00s 1:00 D
-Rule NZAQ 1975 1988 - Oct lastSun 2:00s 1:00 D
-Rule NZAQ 1989 only - Oct 8 2:00s 1:00 D
-Rule NZAQ 1990 2006 - Oct Sun>=1 2:00s 1:00 D
-Rule NZAQ 1975 only - Feb 23 2:00s 0 S
-Rule NZAQ 1976 1989 - Mar Sun>=1 2:00s 0 S
-Rule NZAQ 1990 2007 - Mar Sun>=15 2:00s 0 S
-Rule NZAQ 2007 max - Sep lastSun 2:00s 1:00 D
-Rule NZAQ 2008 max - Apr Sun>=1 2:00s 0 S
# Norway - territories
# Bouvet (never inhabited)
#
# claims
# Peter I Island (never inhabited)
+#
+# year-round base
+# Troll, Queen Maud Land, -720041+0023206, since 2005-02-12
+#
+# From Paul-Inge Flakstad (2014-03-10):
+# I recently had a long dialog about this with the developer of timegenie.com.
+# In the absence of specific dates, he decided to choose some likely ones:
+# GMT +1 - From March 1 to the last Sunday in March
+# GMT +2 - From the last Sunday in March until the last Sunday in October
+# GMT +1 - From the last Sunday in October until November 7
+# GMT +0 - From November 7 until March 1
+# The dates for switching to and from UTC+0 will probably not be absolutely
+# correct, but they should be quite close to the actual dates.
+#
+# From Paul Eggert (2014-03-21):
+# The CET-switching Troll rules require zic from tzcode 2014b or later, so as
+# suggested by Bengt-Inge Larsson comment them out for now, and approximate
+# with only UTC and CEST. Uncomment them when 2014b is more prevalent.
+#
+# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+#Rule Troll 2005 max - Mar 1 1:00u 1:00 CET
+Rule Troll 2005 max - Mar lastSun 1:00u 2:00 CEST
+#Rule Troll 2005 max - Oct lastSun 1:00u 1:00 CET
+#Rule Troll 2004 max - Nov 7 1:00u 0:00 UTC
+# Remove the following line when uncommenting the above '#Rule' lines.
+Rule Troll 2004 max - Oct lastSun 1:00u 0:00 UTC
+# Zone NAME GMTOFF RULES FORMAT [UNTIL]
+Zone Antarctica/Troll 0 - zzz 2005 Feb 12
+ 0:00 Troll %s
# Poland - year-round base
# Arctowski, King George Island, -620945-0582745, since 1977
--- a/jdk/make/data/tzdata/australasia Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/make/data/tzdata/australasia Wed Apr 09 17:17:03 2014 -0700
@@ -786,14 +786,29 @@
# Johnston
#
-# From Paul Eggert (2013-09-03):
+# From Paul Eggert (2014-03-11):
+# Sometimes Johnston kept Hawaii time, and sometimes it was an hour behind.
+# Details are uncertain. We have no data for Johnston after 1970, so
+# treat it like Hawaii for now.
+#
# In his memoirs of June 6th to October 4, 1945
# <http://www.315bw.org/Herb_Bach.htm> (2005), Herbert C. Bach writes,
# "We started our letdown to Kwajalein Atoll and landed there at 5:00 AM
# Johnston time, 1:30 AM Kwajalein time." This was in June 1945, and
# confirms that Johnston kept the same time as Honolulu in summer 1945.
-# We have no better information, so for now, assume this has been true
-# indefinitely into the past.
+#
+# From Lyle McElhaney (2014-03-11):
+# [W]hen JI was being used for that [atomic bomb] testing, the time being used
+# was not Hawaiian time but rather the same time being used on the ships,
+# which had a GMT offset of -11 hours. This apparently applied to at least the
+# time from Operation Newsreel (Hardtack I/Teak shot, 1958-08-01) to the last
+# Operation Fishbowl shot (Tightrope, 1962-11-04).... [See] Herman Hoerlin,
+# "The United States High-Altitude Test Experience: A Review Emphasizing the
+# Impact on the Environment", Los Alamos LA-6405, Oct 1976
+# <http://www.fas.org/sgp/othergov/doe/lanl/docs1/00322994.pdf>.
+# See the table on page 4 where he lists GMT and local times for the tests; a
+# footnote for the JI tests reads that local time is "JI time = Hawaii Time
+# Minus One Hour".
#
# See 'northamerica' for Pacific/Johnston.
--- a/jdk/make/data/tzdata/europe Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/make/data/tzdata/europe Wed Apr 09 17:17:03 2014 -0700
@@ -2986,7 +2986,11 @@
# Assume it happened in March by not changing the clocks.
3:00 Russia MSK/MSD 1997
3:00 - MSK 1997 Mar lastSun 1:00u
- 2:00 EU EE%sT
+# From Alexander Krivenyshev (2014-03-17):
+# time change at 2:00 (2am) on March 30, 2014
+# http://vz.ru/news/2014/3/17/677464.html
+ 2:00 EU EE%sT 2014 Mar 30 2:00
+ 4:00 - MSK
# Vatican City
# See Europe/Rome.
--- a/jdk/make/data/tzdata/leapseconds Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/make/data/tzdata/leapseconds Wed Apr 09 17:17:03 2014 -0700
@@ -20,7 +20,7 @@
# 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.
-
+#
# Allowance for leapseconds added to each timezone file.
# This file is in the public domain.
--- a/jdk/make/data/tzdata/zone.tab Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/make/data/tzdata/zone.tab Wed Apr 09 17:17:03 2014 -0700
@@ -74,6 +74,7 @@
AQ -7824+10654 Antarctica/Vostok Vostok Station, Lake Vostok
AQ -6640+14001 Antarctica/DumontDUrville Dumont-d'Urville Station, Terre Adelie
AQ -690022+0393524 Antarctica/Syowa Syowa Station, E Ongul I
+AQ -720041+0023206 Antarctica/Troll Troll Station, Queen Maud Land
AR -3436-05827 America/Argentina/Buenos_Aires Buenos Aires (BA, CF)
AR -3124-06411 America/Argentina/Cordoba most locations (CB, CC, CN, ER, FM, MN, SE, SF)
AR -2447-06525 America/Argentina/Salta (SA, LP, NQ, RN)
@@ -366,6 +367,7 @@
RU +5545+03735 Europe/Moscow Moscow+00 - west Russia
RU +4844+04425 Europe/Volgograd Moscow+00 - Caspian Sea
RU +5312+05009 Europe/Samara Moscow+00 - Samara, Udmurtia
+RU +4457+03406 Europe/Simferopol Moscow+00 - Crimea
RU +5651+06036 Asia/Yekaterinburg Moscow+02 - Urals
RU +5500+07324 Asia/Omsk Moscow+03 - west Siberia
RU +5502+08255 Asia/Novosibirsk Moscow+03 - Novosibirsk
@@ -421,7 +423,6 @@
UA +5026+03031 Europe/Kiev most locations
UA +4837+02218 Europe/Uzhgorod Ruthenia
UA +4750+03510 Europe/Zaporozhye Zaporozh'ye, E Lugansk / Zaporizhia, E Luhansk
-UA +4457+03406 Europe/Simferopol central Crimea
UG +0019+03225 Africa/Kampala
UM +1645-16931 Pacific/Johnston Johnston Atoll
UM +2813-17722 Pacific/Midway Midway Islands
--- a/jdk/src/share/classes/com/oracle/net/Sdp.java Wed Apr 09 09:20:54 2014 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,201 +0,0 @@
-/*
- * Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.oracle.net;
-
-import java.net.Socket;
-import java.net.ServerSocket;
-import java.net.SocketImpl;
-import java.net.SocketImplFactory;
-import java.net.SocketException;
-import java.nio.channels.SocketChannel;
-import java.nio.channels.ServerSocketChannel;
-import java.io.IOException;
-import java.io.FileDescriptor;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.AccessibleObject;
-import java.lang.reflect.InvocationTargetException;
-
-import sun.net.sdp.SdpSupport;
-
-/**
- * This class consists exclusively of static methods that Sockets or Channels to
- * sockets that support the InfiniBand Sockets Direct Protocol (SDP).
- */
-
-public final class Sdp {
- private Sdp() { }
-
- /**
- * The package-privage ServerSocket(SocketImpl) constructor
- */
- private static final Constructor<ServerSocket> serverSocketCtor;
- static {
- try {
- serverSocketCtor =
- ServerSocket.class.getDeclaredConstructor(SocketImpl.class);
- setAccessible(serverSocketCtor);
- } catch (NoSuchMethodException e) {
- throw new AssertionError(e);
- }
- }
-
- /**
- * The package-private SdpSocketImpl() constructor
- */
- private static final Constructor<SocketImpl> socketImplCtor;
- static {
- try {
- Class<?> cl = Class.forName("java.net.SdpSocketImpl", true, null);
- socketImplCtor = (Constructor<SocketImpl>)cl.getDeclaredConstructor();
- setAccessible(socketImplCtor);
- } catch (ClassNotFoundException e) {
- throw new AssertionError(e);
- } catch (NoSuchMethodException e) {
- throw new AssertionError(e);
- }
- }
-
- private static void setAccessible(final AccessibleObject o) {
- AccessController.doPrivileged(new PrivilegedAction<Void>() {
- public Void run() {
- o.setAccessible(true);
- return null;
- }
- });
- }
-
- /**
- * SDP enabled Socket.
- */
- private static class SdpSocket extends Socket {
- SdpSocket(SocketImpl impl) throws SocketException {
- super(impl);
- }
- }
-
- /**
- * Creates a SDP enabled SocketImpl
- */
- private static SocketImpl createSocketImpl() {
- try {
- return socketImplCtor.newInstance();
- } catch (InstantiationException x) {
- throw new AssertionError(x);
- } catch (IllegalAccessException x) {
- throw new AssertionError(x);
- } catch (InvocationTargetException x) {
- throw new AssertionError(x);
- }
- }
-
- /**
- * Creates an unconnected and unbound SDP socket. The {@code Socket} is
- * associated with a {@link java.net.SocketImpl} of the system-default type.
- *
- * @return a new Socket
- *
- * @throws UnsupportedOperationException
- * If SDP is not supported
- * @throws IOException
- * If an I/O error occurs
- */
- public static Socket openSocket() throws IOException {
- SocketImpl impl = createSocketImpl();
- return new SdpSocket(impl);
- }
-
- /**
- * Creates an unbound SDP server socket. The {@code ServerSocket} is
- * associated with a {@link java.net.SocketImpl} of the system-default type.
- *
- * @return a new ServerSocket
- *
- * @throws UnsupportedOperationException
- * If SDP is not supported
- * @throws IOException
- * If an I/O error occurs
- */
- public static ServerSocket openServerSocket() throws IOException {
- // create ServerSocket via package-private constructor
- SocketImpl impl = createSocketImpl();
- try {
- return serverSocketCtor.newInstance(impl);
- } catch (IllegalAccessException x) {
- throw new AssertionError(x);
- } catch (InstantiationException x) {
- throw new AssertionError(x);
- } catch (InvocationTargetException x) {
- Throwable cause = x.getCause();
- if (cause instanceof IOException)
- throw (IOException)cause;
- if (cause instanceof RuntimeException)
- throw (RuntimeException)cause;
- throw new RuntimeException(x);
- }
- }
-
- /**
- * Opens a socket channel to a SDP socket.
- *
- * <p> The channel will be associated with the system-wide default
- * {@link java.nio.channels.spi.SelectorProvider SelectorProvider}.
- *
- * @return a new SocketChannel
- *
- * @throws UnsupportedOperationException
- * If SDP is not supported or not supported by the default selector
- * provider
- * @throws IOException
- * If an I/O error occurs.
- */
- public static SocketChannel openSocketChannel() throws IOException {
- FileDescriptor fd = SdpSupport.createSocket();
- return sun.nio.ch.Secrets.newSocketChannel(fd);
- }
-
- /**
- * Opens a socket channel to a SDP socket.
- *
- * <p> The channel will be associated with the system-wide default
- * {@link java.nio.channels.spi.SelectorProvider SelectorProvider}.
- *
- * @return a new ServerSocketChannel
- *
- * @throws UnsupportedOperationException
- * If SDP is not supported or not supported by the default selector
- * provider
- * @throws IOException
- * If an I/O error occurs
- */
- public static ServerSocketChannel openServerSocketChannel()
- throws IOException
- {
- FileDescriptor fd = SdpSupport.createSocket();
- return sun.nio.ch.Secrets.newServerSocketChannel(fd);
- }
-}
--- a/jdk/src/share/classes/com/sun/crypto/provider/RSACipher.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/src/share/classes/com/sun/crypto/provider/RSACipher.java Wed Apr 09 17:17:03 2014 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -39,6 +39,8 @@
import sun.security.rsa.*;
import sun.security.jca.Providers;
+import sun.security.internal.spec.TlsRsaPremasterSecretParameterSpec;
+import sun.security.util.KeyUtil;
/**
* RSA cipher implementation. Supports RSA en/decryption and signing/verifying
@@ -91,8 +93,8 @@
// padding object
private RSAPadding padding;
- // cipher parameter for OAEP padding
- private OAEPParameterSpec spec = null;
+ // cipher parameter for OAEP padding and TLS RSA premaster secret
+ private AlgorithmParameterSpec spec = null;
// buffer for the data
private byte[] buffer;
@@ -110,6 +112,9 @@
// hash algorithm for OAEP
private String oaepHashAlgorithm = "SHA-1";
+ // the source of randomness
+ private SecureRandom random;
+
public RSACipher() {
paddingType = PAD_PKCS1;
}
@@ -175,7 +180,7 @@
// see JCE spec
protected AlgorithmParameters engineGetParameters() {
- if (spec != null) {
+ if (spec != null && spec instanceof OAEPParameterSpec) {
try {
AlgorithmParameters params =
AlgorithmParameters.getInstance("OAEP",
@@ -276,8 +281,13 @@
buffer = new byte[n];
} else if (paddingType == PAD_PKCS1) {
if (params != null) {
- throw new InvalidAlgorithmParameterException
- ("Parameters not supported");
+ if (!(params instanceof TlsRsaPremasterSecretParameterSpec)) {
+ throw new InvalidAlgorithmParameterException(
+ "Parameters not supported");
+ }
+
+ spec = params;
+ this.random = random; // for TLS RSA premaster secret
}
int blockType = (mode <= MODE_DECRYPT) ? RSAPadding.PAD_BLOCKTYPE_2
: RSAPadding.PAD_BLOCKTYPE_1;
@@ -293,19 +303,18 @@
throw new InvalidKeyException
("OAEP cannot be used to sign or verify signatures");
}
- OAEPParameterSpec myParams;
if (params != null) {
if (!(params instanceof OAEPParameterSpec)) {
throw new InvalidAlgorithmParameterException
("Wrong Parameters for OAEP Padding");
}
- myParams = (OAEPParameterSpec) params;
+ spec = params;
} else {
- myParams = new OAEPParameterSpec(oaepHashAlgorithm, "MGF1",
+ spec = new OAEPParameterSpec(oaepHashAlgorithm, "MGF1",
MGF1ParameterSpec.SHA1, PSource.PSpecified.DEFAULT);
}
padding = RSAPadding.getInstance(RSAPadding.PAD_OAEP_MGF1, n,
- random, myParams);
+ random, (OAEPParameterSpec)spec);
if (encrypt) {
int k = padding.getMaxDataSize();
buffer = new byte[k];
@@ -420,17 +429,40 @@
if (wrappedKey.length > buffer.length) {
throw new InvalidKeyException("Key is too long for unwrapping");
}
+
+ boolean isTlsRsaPremasterSecret =
+ algorithm.equals("TlsRsaPremasterSecret");
+ Exception failover = null;
+ byte[] encoded = null;
+
update(wrappedKey, 0, wrappedKey.length);
try {
- byte[] encoded = doFinal();
- return ConstructKeys.constructKey(encoded, algorithm, type);
+ encoded = doFinal();
} catch (BadPaddingException e) {
- // should not occur
- throw new InvalidKeyException("Unwrapping failed", e);
+ if (isTlsRsaPremasterSecret) {
+ failover = e;
+ } else {
+ throw new InvalidKeyException("Unwrapping failed", e);
+ }
} catch (IllegalBlockSizeException e) {
// should not occur, handled with length check above
throw new InvalidKeyException("Unwrapping failed", e);
}
+
+ if (isTlsRsaPremasterSecret) {
+ if (!(spec instanceof TlsRsaPremasterSecretParameterSpec)) {
+ throw new IllegalStateException(
+ "No TlsRsaPremasterSecretParameterSpec specified");
+ }
+
+ // polish the TLS premaster secret
+ encoded = KeyUtil.checkTlsPreMasterSecretKey(
+ ((TlsRsaPremasterSecretParameterSpec)spec).getClientVersion(),
+ ((TlsRsaPremasterSecretParameterSpec)spec).getServerVersion(),
+ random, encoded, (failover != null));
+ }
+
+ return ConstructKeys.constructKey(encoded, algorithm, type);
}
// see JCE spec
@@ -438,5 +470,4 @@
RSAKey rsaKey = RSAKeyFactory.toRSAKey(key);
return rsaKey.getModulus().bitLength();
}
-
}
--- a/jdk/src/share/classes/com/sun/crypto/provider/TlsRsaPremasterSecretGenerator.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/src/share/classes/com/sun/crypto/provider/TlsRsaPremasterSecretGenerator.java Wed Apr 09 17:17:03 2014 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -56,7 +56,7 @@
protected void engineInit(AlgorithmParameterSpec params,
SecureRandom random) throws InvalidAlgorithmParameterException {
- if (params instanceof TlsRsaPremasterSecretParameterSpec == false) {
+ if (!(params instanceof TlsRsaPremasterSecretParameterSpec)) {
throw new InvalidAlgorithmParameterException(MSG);
}
this.spec = (TlsRsaPremasterSecretParameterSpec)params;
@@ -67,21 +67,20 @@
throw new InvalidParameterException(MSG);
}
+ // Only can be used in client side to generate TLS RSA premaster secret.
protected SecretKey engineGenerateKey() {
if (spec == null) {
throw new IllegalStateException(
"TlsRsaPremasterSecretGenerator must be initialized");
}
- byte[] b = spec.getEncodedSecret();
- if (b == null) {
- if (random == null) {
- random = new SecureRandom();
- }
- b = new byte[48];
- random.nextBytes(b);
- b[0] = (byte)spec.getMajorVersion();
- b[1] = (byte)spec.getMinorVersion();
+
+ if (random == null) {
+ random = new SecureRandom();
}
+ byte[] b = new byte[48];
+ random.nextBytes(b);
+ b[0] = (byte)spec.getMajorVersion();
+ b[1] = (byte)spec.getMinorVersion();
return new SecretKeySpec(b, "TlsRsaPremasterSecret");
}
--- a/jdk/src/share/classes/com/sun/jmx/snmp/Enumerated.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/src/share/classes/com/sun/jmx/snmp/Enumerated.java Wed Apr 09 17:17:03 2014 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -45,7 +45,7 @@
* <p><b>This API is a Sun Microsystems internal API and is subject
* to change without notice.</b></p>
*/
-
+@SuppressWarnings("serial") // JDK implementation class
abstract public class Enumerated implements Serializable {
/**
--- a/jdk/src/share/classes/com/sun/jmx/snmp/IPAcl/Host.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/src/share/classes/com/sun/jmx/snmp/IPAcl/Host.java Wed Apr 09 17:17:03 2014 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -44,6 +44,7 @@
* The class defines an abstract representation of a host.
*
*/
+@SuppressWarnings("serial") // JDK implementation class
abstract class Host extends SimpleNode implements Serializable {
public Host(int id) {
--- a/jdk/src/share/classes/com/sun/jmx/snmp/SnmpPdu.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/src/share/classes/com/sun/jmx/snmp/SnmpPdu.java Wed Apr 09 17:17:03 2014 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -45,6 +45,7 @@
*
* @since 1.5
*/
+@SuppressWarnings("serial") // JDK implementation class
public abstract class SnmpPdu implements SnmpDefinitions, Serializable {
/**
--- a/jdk/src/share/classes/com/sun/jmx/snmp/SnmpScopedPduPacket.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/src/share/classes/com/sun/jmx/snmp/SnmpScopedPduPacket.java Wed Apr 09 17:17:03 2014 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -47,6 +47,7 @@
*
* @since 1.5
*/
+@SuppressWarnings("serial") // JDK implementation class
public abstract class SnmpScopedPduPacket extends SnmpPdu
implements Serializable {
/**
--- a/jdk/src/share/classes/com/sun/jmx/snmp/SnmpUnsignedInt.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/src/share/classes/com/sun/jmx/snmp/SnmpUnsignedInt.java Wed Apr 09 17:17:03 2014 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -34,7 +34,7 @@
* <p><b>This API is a Sun Microsystems internal API and is subject
* to change without notice.</b></p>
*/
-
+@SuppressWarnings("serial") // JDK implementation class
public abstract class SnmpUnsignedInt extends SnmpInt {
/**
--- a/jdk/src/share/classes/com/sun/jmx/snmp/SnmpValue.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/src/share/classes/com/sun/jmx/snmp/SnmpValue.java Wed Apr 09 17:17:03 2014 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -38,7 +38,7 @@
* <p><b>This API is a Sun Microsystems internal API and is subject
* to change without notice.</b></p>
*/
-
+@SuppressWarnings("serial") // JDK implementation class
public abstract class SnmpValue implements Cloneable, Serializable, SnmpDataTypeEnums {
/**
--- a/jdk/src/share/classes/com/sun/jmx/snmp/agent/SnmpMib.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/src/share/classes/com/sun/jmx/snmp/agent/SnmpMib.java Wed Apr 09 17:17:03 2014 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -59,6 +59,7 @@
* <p><b>This API is a Sun Microsystems internal API and is subject
* to change without notice.</b></p>
*/
+@SuppressWarnings("serial") // JDK implementation class
public abstract class SnmpMib extends SnmpMibAgent implements Serializable {
/**
--- a/jdk/src/share/classes/com/sun/jmx/snmp/agent/SnmpMibAgent.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/src/share/classes/com/sun/jmx/snmp/agent/SnmpMibAgent.java Wed Apr 09 17:17:03 2014 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -59,7 +59,7 @@
* <p><b>This API is a Sun Microsystems internal API and is subject
* to change without notice.</b></p>
*/
-
+@SuppressWarnings("serial") // JDK implementation class
public abstract class SnmpMibAgent
implements SnmpMibAgentMBean, MBeanRegistration, Serializable {
--- a/jdk/src/share/classes/com/sun/jmx/snmp/agent/SnmpMibEntry.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/src/share/classes/com/sun/jmx/snmp/agent/SnmpMibEntry.java Wed Apr 09 17:17:03 2014 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -41,7 +41,7 @@
* <p><b>This API is a Sun Microsystems internal API and is subject
* to change without notice.</b></p>
*/
-
+@SuppressWarnings("serial") // JDK implementation class
public abstract class SnmpMibEntry extends SnmpMibNode
implements Serializable {
--- a/jdk/src/share/classes/com/sun/jmx/snmp/agent/SnmpMibGroup.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/src/share/classes/com/sun/jmx/snmp/agent/SnmpMibGroup.java Wed Apr 09 17:17:03 2014 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -49,7 +49,7 @@
* <p><b>This API is a Sun Microsystems internal API and is subject
* to change without notice.</b></p>
*/
-
+@SuppressWarnings("serial") // JDK implementation class
public abstract class SnmpMibGroup extends SnmpMibOid
implements Serializable {
--- a/jdk/src/share/classes/com/sun/jmx/snmp/agent/SnmpMibNode.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/src/share/classes/com/sun/jmx/snmp/agent/SnmpMibNode.java Wed Apr 09 17:17:03 2014 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -53,7 +53,7 @@
* <p><b>This API is a Sun Microsystems internal API and is subject
* to change without notice.</b></p>
*/
-
+@SuppressWarnings("serial") // JDK implementation class
public abstract class SnmpMibNode implements Serializable {
// ---------------------------------------------------------------------
--- a/jdk/src/share/classes/com/sun/jmx/snmp/agent/SnmpMibTable.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/src/share/classes/com/sun/jmx/snmp/agent/SnmpMibTable.java Wed Apr 09 17:17:03 2014 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -84,7 +84,7 @@
* @see com.sun.jmx.snmp.agent.SnmpTableSupport
*
*/
-
+@SuppressWarnings("serial") // JDK implementation class
public abstract class SnmpMibTable extends SnmpMibNode
implements NotificationBroadcaster, Serializable {
--- a/jdk/src/share/classes/com/sun/jmx/snmp/agent/SnmpTableSupport.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/src/share/classes/com/sun/jmx/snmp/agent/SnmpTableSupport.java Wed Apr 09 17:17:03 2014 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -80,6 +80,7 @@
* @see com.sun.jmx.snmp.agent.SnmpMibTable
*
*/
+@SuppressWarnings("serial") // JDK implementation class
public abstract class SnmpTableSupport implements SnmpTableEntryFactory,
// NPCTE fix for bugId 4499265, esc 0, MR 04 sept 2001
// SnmpTableCallbackHandler {
--- a/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/utils/resolver/implementations/ResolverDirectHTTP.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/utils/resolver/implementations/ResolverDirectHTTP.java Wed Apr 09 17:17:03 2014 -0700
@@ -108,6 +108,7 @@
@Override
public XMLSignatureInput engineResolveURI(ResourceResolverContext context)
throws ResourceResolverException {
+ InputStream inputStream = null;
try {
// calculate new URI
@@ -139,7 +140,7 @@
}
String mimeType = urlConnection.getHeaderField("Content-Type");
- InputStream inputStream = urlConnection.getInputStream();
+ inputStream = urlConnection.getInputStream();
ByteArrayOutputStream baos = new ByteArrayOutputStream();
byte buf[] = new byte[4096];
int read = 0;
@@ -168,6 +169,16 @@
throw new ResourceResolverException("generic.EmptyMessage", ex, context.attr, context.baseUri);
} catch (IllegalArgumentException e) {
throw new ResourceResolverException("generic.EmptyMessage", e, context.attr, context.baseUri);
+ } finally {
+ if (inputStream != null) {
+ try {
+ inputStream.close();
+ } catch (IOException e) {
+ if (log.isLoggable(java.util.logging.Level.FINE)) {
+ log.log(java.util.logging.Level.FINE, e.getMessage(), e);
+ }
+ }
+ }
}
}
--- a/jdk/src/share/classes/java/awt/BorderLayout.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/src/share/classes/java/awt/BorderLayout.java Wed Apr 09 17:17:03 2014 -0700
@@ -115,7 +115,7 @@
* }
* }
* </pre></blockquote><hr>
- * <p>
+ *
* @author Arthur van Hoff
* @see java.awt.Container#add(String, Component)
* @see java.awt.ComponentOrientation
@@ -414,8 +414,7 @@
* the component is added to the layout.
* @see java.awt.Container#add(java.awt.Component, java.lang.Object)
* @exception IllegalArgumentException if the constraint object is not
- * a string, or if it not one of the five specified
- * constants.
+ * a string, or if it not one of the five specified constants.
* @since JDK1.1
*/
public void addLayoutComponent(Component comp, Object constraints) {
--- a/jdk/src/share/classes/java/awt/CheckboxGroup.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/src/share/classes/java/awt/CheckboxGroup.java Wed Apr 09 17:17:03 2014 -0700
@@ -49,7 +49,7 @@
* <img src="doc-files/CheckboxGroup-1.gif"
* alt="Shows three checkboxes, arranged vertically, labeled one, two, and three. Checkbox one is in the on state."
* style="float:center; margin: 7px 10px;">
- * <p>
+ *
* @author Sami Shaio
* @see java.awt.Checkbox
* @since JDK1.0
--- a/jdk/src/share/classes/java/awt/Choice.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/src/share/classes/java/awt/Choice.java Wed Apr 09 17:17:03 2014 -0700
@@ -65,7 +65,7 @@
* Native GUI <code>Choice</code> components' size are often bound by such
* attributes as font size and length of items contained within
* the <code>Choice</code>.
- * <p>
+ *
* @author Sami Shaio
* @author Arthur van Hoff
* @since JDK1.0
--- a/jdk/src/share/classes/java/awt/EventQueue.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/src/share/classes/java/awt/EventQueue.java Wed Apr 09 17:17:03 2014 -0700
@@ -680,7 +680,7 @@
* <td>No action (ignored)</td>
* </tr>
* </table>
- * <p>
+ *
* @param event an instance of <code>java.awt.AWTEvent</code>,
* or a subclass of it
* @throws NullPointerException if <code>event</code> is <code>null</code>
@@ -1015,7 +1015,6 @@
* methods to execute a task in
* {@link Toolkit#getSystemEventQueue the current AWT EventQueue}'s
* dispatch thread.
- * <p>
*
* @return true if running in
* {@link Toolkit#getSystemEventQueue the current AWT EventQueue}'s
--- a/jdk/src/share/classes/java/awt/GridBagLayoutInfo.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/src/share/classes/java/awt/GridBagLayoutInfo.java Wed Apr 09 17:17:03 2014 -0700
@@ -29,7 +29,7 @@
* The {@code GridBagLayoutInfo} is an utility class for
* {@code GridBagLayout} layout manager.
* It stores align, size and baseline parameters for every component within a container.
- * <p>
+ *
* @see java.awt.GridBagLayout
* @see java.awt.GridBagConstraints
* @since 1.6
--- a/jdk/src/share/classes/java/awt/Robot.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/src/share/classes/java/awt/Robot.java Wed Apr 09 17:17:03 2014 -0700
@@ -76,7 +76,6 @@
/**
* Constructs a Robot object in the coordinate system of the primary screen.
- * <p>
*
* @throws AWTException if the platform configuration does not allow
* low-level input control. This exception is always thrown when
--- a/jdk/src/share/classes/java/awt/TextArea.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/src/share/classes/java/awt/TextArea.java Wed Apr 09 17:17:03 2014 -0700
@@ -49,7 +49,7 @@
* <hr><blockquote><pre>
* new TextArea("Hello", 5, 40);
* </pre></blockquote><hr>
- * <p>
+ *
* @author Sami Shaio
* @since JDK1.0
*/
--- a/jdk/src/share/classes/java/awt/Toolkit.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/src/share/classes/java/awt/Toolkit.java Wed Apr 09 17:17:03 2014 -0700
@@ -2590,7 +2590,7 @@
* If not set by the time of the {@code Toolkit} class initialization, this property will be
* initialized with {@code true}.
* Changing this value after the {@code Toolkit} class initialization will have no effect.
- * <p>
+ *
* @exception HeadlessException if GraphicsEnvironment.isHeadless() returns true
* @return {@code true} if events from extra mouse buttons are allowed to be processed and posted;
* {@code false} otherwise
--- a/jdk/src/share/classes/java/awt/TrayIcon.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/src/share/classes/java/awt/TrayIcon.java Wed Apr 09 17:17:03 2014 -0700
@@ -231,7 +231,7 @@
/**
* Sets the image for this <code>TrayIcon</code>. The previous
* tray icon image is discarded without calling the {@link
- * java.awt.Image#flush} method — you will need to call it
+ * java.awt.Image#flush} method — you will need to call it
* manually.
*
* <p> If the image represents an animated image, it will be
@@ -368,7 +368,7 @@
*
* <p> If auto-size is <code>false</code>, and the image size
* doesn't match the tray icon space, the image is painted as-is
- * inside that space — if larger than the allocated space, it will
+ * inside that space — if larger than the allocated space, it will
* be cropped.
*
* <p> If auto-size is <code>true</code>, the image is stretched or shrunk to
--- a/jdk/src/share/classes/java/awt/Window.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/src/share/classes/java/awt/Window.java Wed Apr 09 17:17:03 2014 -0700
@@ -2550,7 +2550,7 @@
* a non-focusable Window.
*
* Setting the focusability state on a visible {@code Window}
- * can have a delayed effect on some platforms — the actual
+ * can have a delayed effect on some platforms — the actual
* change may happen only when the {@code Window} becomes
* hidden and then visible again. To ensure consistent behavior
* across platforms, set the {@code Window}'s focusable state
--- a/jdk/src/share/classes/java/awt/im/spi/InputMethodContext.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/src/share/classes/java/awt/im/spi/InputMethodContext.java Wed Apr 09 17:17:03 2014 -0700
@@ -85,7 +85,7 @@
* <p>
* Input methods must call {@link java.awt.Window#dispose() Window.dispose} on the
* returned input method window when it is no longer needed.
- * <p>
+ *
* @param title the title to be displayed in the window's title bar,
* if there is such a title bar.
* A <code>null</code> value is treated as an empty string, "".
@@ -117,7 +117,7 @@
* <p>
* Input methods must call {@link java.awt.Window#dispose() Window.dispose} on the
* returned input method window when it is no longer needed.
- * <p>
+ *
* @param title the title to be displayed in the window's title bar,
* if there is such a title bar.
* A <code>null</code> value is treated as an empty string, "".
--- a/jdk/src/share/classes/java/net/DatagramSocket.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/src/share/classes/java/net/DatagramSocket.java Wed Apr 09 17:17:03 2014 -0700
@@ -104,7 +104,7 @@
/**
* Connects this socket to a remote socket address (IP address + port number).
* Binds socket if not already bound.
- * <p>
+ *
* @param address The remote address.
* @param port The remote port
* @throws SocketException if binding the socket fails.
@@ -338,7 +338,7 @@
* <p>
* If the address is {@code null}, then the system will pick up
* an ephemeral port and a valid local address to bind the socket.
- *<p>
+ *
* @param addr The address and port to bind to.
* @throws SocketException if any error happens during the bind, or if the
* socket is already bound.
@@ -1240,10 +1240,8 @@
* datagram socket factory.
* @exception SocketException if the factory is already defined.
* @exception SecurityException if a security manager exists and its
- * {@code checkSetFactory} method doesn't allow the
- operation.
- * @see
- java.net.DatagramSocketImplFactory#createDatagramSocketImpl()
+ * {@code checkSetFactory} method doesn't allow the operation.
+ * @see java.net.DatagramSocketImplFactory#createDatagramSocketImpl()
* @see SecurityManager#checkSetFactory
* @since 1.3
*/
--- a/jdk/src/share/classes/java/net/InetSocketAddress.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/src/share/classes/java/net/InetSocketAddress.java Wed Apr 09 17:17:03 2014 -0700
@@ -157,7 +157,7 @@
* A valid port value is between 0 and 65535.
* A port number of {@code zero} will let the system pick up an
* ephemeral port in a {@code bind} operation.
- * <p>
+ *
* @param port The port number
* @throws IllegalArgumentException if the port parameter is outside the specified
* range of valid port values.
@@ -175,7 +175,7 @@
* ephemeral port in a {@code bind} operation.
* <P>
* A {@code null} address will assign the <i>wildcard</i> address.
- * <p>
+ *
* @param addr The IP address
* @param port The port number
* @throws IllegalArgumentException if the port parameter is outside the specified
@@ -202,7 +202,7 @@
* A valid port value is between 0 and 65535.
* A port number of {@code zero} will let the system pick up an
* ephemeral port in a {@code bind} operation.
- * <P>
+ *
* @param hostname the Host name
* @param port The port number
* @throws IllegalArgumentException if the port parameter is outside the range
@@ -239,7 +239,7 @@
* A valid port value is between 0 and 65535.
* A port number of {@code zero} will let the system pick up an
* ephemeral port in a {@code bind} operation.
- * <P>
+ *
* @param host the Host name
* @param port The port number
* @throws IllegalArgumentException if the port parameter is outside
--- a/jdk/src/share/classes/java/net/SdpSocketImpl.java Wed Apr 09 09:20:54 2014 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,49 +0,0 @@
-/*
- * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package java.net;
-
-import java.io.IOException;
-import java.io.FileDescriptor;
-
-import sun.net.sdp.SdpSupport;
-
-/**
- * SocketImpl that supports the SDP protocol
- */
-class SdpSocketImpl extends PlainSocketImpl {
- SdpSocketImpl() { }
-
- @Override
- protected void create(boolean stream) throws IOException {
- if (!stream)
- throw new UnsupportedOperationException("Must be a stream socket");
- fd = SdpSupport.createSocket();
- if (socket != null)
- socket.setCreated();
- if (serverSocket != null)
- serverSocket.setCreated();
- }
-}
--- a/jdk/src/share/classes/java/net/ServerSocket.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/src/share/classes/java/net/ServerSocket.java Wed Apr 09 17:17:03 2014 -0700
@@ -157,7 +157,6 @@
* or may choose to ignore the parameter altogther. The value provided
* should be greater than {@code 0}. If it is less than or equal to
* {@code 0}, then an implementation specific default will be used.
- * <P>
*
* @param port the port number, or {@code 0} to use a port
* number that is automatically allocated.
@@ -206,7 +205,7 @@
* or may choose to ignore the parameter altogther. The value provided
* should be greater than {@code 0}. If it is less than or equal to
* {@code 0}, then an implementation specific default will be used.
- * <P>
+ *
* @param port the port number, or {@code 0} to use a port
* number that is automatically allocated.
* @param backlog requested maximum length of the queue of incoming
@@ -315,7 +314,7 @@
* <p>
* If the address is {@code null}, then the system will pick up
* an ephemeral port and a valid local address to bind the socket.
- * <p>
+ *
* @param endpoint The IP address and port number to bind to.
* @throws IOException if the bind operation fails, or if the socket
* is already bound.
--- a/jdk/src/share/classes/java/net/Socket.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/src/share/classes/java/net/Socket.java Wed Apr 09 17:17:03 2014 -0700
@@ -153,7 +153,7 @@
/**
* Creates an unconnected Socket with a user-specified
* SocketImpl.
- * <P>
+ *
* @param impl an instance of a <B>SocketImpl</B>
* the subclass wishes to use on the Socket.
*
@@ -1245,7 +1245,7 @@
* <ol>
* <li>For sockets accepted from a ServerSocket, this must be done by calling
* {@link ServerSocket#setReceiveBufferSize(int)} before the ServerSocket
- * is bound to a local address.<p></li>
+ * is bound to a local address.</li>
* <li>For client sockets, setReceiveBufferSize() must be called before
* connecting the socket to its remote peer.</li></ol>
* @param size the size to which to set the receive buffer
--- a/jdk/src/share/classes/java/net/SocketOptions.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/src/share/classes/java/net/SocketOptions.java Wed Apr 09 17:17:03 2014 -0700
@@ -38,7 +38,7 @@
* DatagramSocketImpl, <B>you won't use these directly.</B> There are
* type-safe methods to get/set each of these options in Socket, ServerSocket,
* DatagramSocket and MulticastSocket.
- * <P>
+ *
* @author David Brown
*/
--- a/jdk/src/share/classes/java/net/SocketPermission.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/src/share/classes/java/net/SocketPermission.java Wed Apr 09 17:17:03 2014 -0700
@@ -1001,7 +1001,7 @@
/**
* Checks two SocketPermission objects for equality.
- * <P>
+ *
* @param obj the object to test for equality with this object.
*
* @return true if <i>obj</i> is a SocketPermission, and has the
--- a/jdk/src/share/classes/java/net/URI.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/src/share/classes/java/net/URI.java Wed Apr 09 17:17:03 2014 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -1337,7 +1337,7 @@
*/
public String getQuery() {
if ((decodedQuery == null) && (query != null))
- decodedQuery = decode(query);
+ decodedQuery = decode(query, false);
return decodedQuery;
}
@@ -1366,7 +1366,7 @@
*/
public String getFragment() {
if ((decodedFragment == null) && (fragment != null))
- decodedFragment = decode(fragment);
+ decodedFragment = decode(fragment, false);
return decodedFragment;
}
@@ -2764,6 +2764,12 @@
// with a scope_id
//
private static String decode(String s) {
+ return decode(s, true);
+ }
+
+ // This method was introduced as a generalization of URI.decode method
+ // to provide a fix for JDK-8037396
+ private static String decode(String s, boolean ignorePercentInBrackets) {
if (s == null)
return s;
int n = s.length();
@@ -2776,8 +2782,8 @@
ByteBuffer bb = ByteBuffer.allocate(n);
CharBuffer cb = CharBuffer.allocate(n);
CharsetDecoder dec = ThreadLocalCoders.decoderFor("UTF-8")
- .onMalformedInput(CodingErrorAction.REPLACE)
- .onUnmappableCharacter(CodingErrorAction.REPLACE);
+ .onMalformedInput(CodingErrorAction.REPLACE)
+ .onUnmappableCharacter(CodingErrorAction.REPLACE);
// This is not horribly efficient, but it will do for now
char c = s.charAt(0);
@@ -2790,7 +2796,7 @@
} else if (betweenBrackets && c == ']') {
betweenBrackets = false;
}
- if (c != '%' || betweenBrackets) {
+ if (c != '%' || (betweenBrackets && ignorePercentInBrackets)) {
sb.append(c);
if (++i >= n)
break;
--- a/jdk/src/share/classes/java/net/URL.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/src/share/classes/java/net/URL.java Wed Apr 09 17:17:03 2014 -0700
@@ -867,7 +867,7 @@
* Creates an integer suitable for hash table indexing.<p>
*
* The hash code is based upon all the URL components relevant for URL
- * comparison. As such, this operation is a blocking operation.<p>
+ * comparison. As such, this operation is a blocking operation.
*
* @return a hash code for this {@code URL}.
*/
--- a/jdk/src/share/classes/java/net/URLClassLoader.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/src/share/classes/java/net/URLClassLoader.java Wed Apr 09 17:17:03 2014 -0700
@@ -271,7 +271,7 @@
* by catching {@link IOException}s internally. Unchecked exceptions
* and errors are not caught. Calling close on an already closed
* loader has no effect.
- * <p>
+ *
* @exception IOException if closing any file opened by this class loader
* resulted in an IOException. Any such exceptions are caught internally.
* If only one is caught, then it is re-thrown. If more than one exception
--- a/jdk/src/share/classes/java/net/doc-files/net-properties.html Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/src/share/classes/java/net/doc-files/net-properties.html Wed Apr 09 17:17:03 2014 -0700
@@ -35,7 +35,8 @@
java.net package. Some are checked only once at startup of the VM,
and therefore are best set using the -D option of the java command,
while others have a more dynamic nature and can also be changed using
-the <a href="../../lang/System.html#setProperty(java.lang.String, java.lang.String)">System.setProperty()</a> API. The purpose of this document is to list
+the <a href="../../lang/System.html#setProperty(java.lang.String,%20java.lang.String)">System.setProperty()</a> API.
+The purpose of this document is to list
and detail all of these properties.</P>
<P>If there is no special note, a property value is checked every time it is used.</P>
<a name="Ipv4IPv6"></a>
--- a/jdk/src/share/classes/java/rmi/activation/ActivationGroup.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/src/share/classes/java/rmi/activation/ActivationGroup.java Wed Apr 09 17:17:03 2014 -0700
@@ -172,7 +172,7 @@
*
* <p>This method simply informs the group's monitor that the object
* is inactive. It is up to the concrete subclass of ActivationGroup
- * to fulfill the additional requirement of unexporting the object. <p>
+ * to fulfill the additional requirement of unexporting the object.
*
* @param id the object's activation identifier
* @return true if the object was successfully deactivated; otherwise
--- a/jdk/src/share/classes/java/rmi/activation/ActivationGroupDesc.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/src/share/classes/java/rmi/activation/ActivationGroupDesc.java Wed Apr 09 17:17:03 2014 -0700
@@ -49,7 +49,7 @@
*
* <li> the group's <code>ActivationGroupID</code>, and
* <li> the group's initialization data (in a
- * <code>java.rmi.MarshalledObject</code>)</ul><p>
+ * <code>java.rmi.MarshalledObject</code>)</ul>
*
* @author Ann Wollrath
* @since 1.2
--- a/jdk/src/share/classes/java/rmi/activation/ActivationMonitor.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/src/share/classes/java/rmi/activation/ActivationMonitor.java Wed Apr 09 17:17:03 2014 -0700
@@ -63,7 +63,7 @@
* reference associated with <code>id</code> as a stale reference.
* Since the reference is considered stale, a subsequent
* <code>activate</code> call for the same activation identifier
- * results in re-activating the remote object.<p>
+ * results in re-activating the remote object.
*
* @param id the object's activation identifier
* @exception UnknownObjectException if object is unknown
--- a/jdk/src/share/classes/java/rmi/activation/ActivationSystem.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/src/share/classes/java/rmi/activation/ActivationSystem.java Wed Apr 09 17:17:03 2014 -0700
@@ -61,7 +61,7 @@
* receives an <code>activate</code> request for a specific identifier, it
* looks up the activation descriptor (registered previously) for
* the specified identifier and uses that information to activate
- * the object. <p>
+ * the object.
*
* @param desc the object's activation descriptor
* @return the activation id that can be used to activate the object
--- a/jdk/src/share/classes/java/rmi/activation/Activator.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/src/share/classes/java/rmi/activation/Activator.java Wed Apr 09 17:17:03 2014 -0700
@@ -53,7 +53,7 @@
*
* The activator is responsible for monitoring and detecting when
* activation groups fail so that it can remove stale remote references
- * to groups and active object's within those groups.<p>
+ * to groups and active object's within those groups.
*
* @author Ann Wollrath
* @see ActivationInstantiator
@@ -95,7 +95,7 @@
* collection for that object. If the activator kept a strong
* reference to the remote object, the activator would then
* prevent the object from being garbage collected under the
- * normal distributed garbage collection mechanism. <p>
+ * normal distributed garbage collection mechanism.
*
* @param id the activation identifier for the object being activated
* @param force if true, the activator contacts the group to obtain
--- a/jdk/src/share/classes/java/time/format/DateTimeFormatter.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/src/share/classes/java/time/format/DateTimeFormatter.java Wed Apr 09 17:17:03 2014 -0700
@@ -1644,12 +1644,13 @@
* @return a formatter based on this formatter with the requested resolver style, not null
*/
public DateTimeFormatter withResolverFields(TemporalField... resolverFields) {
- Objects.requireNonNull(resolverFields, "resolverFields");
- Set<TemporalField> fields = new HashSet<>(Arrays.asList(resolverFields));
+ Set<TemporalField> fields = null;
+ if (resolverFields != null) {
+ fields = Collections.unmodifiableSet(new HashSet<>(Arrays.asList(resolverFields)));
+ }
if (Objects.equals(this.resolverFields, fields)) {
return this;
}
- fields = Collections.unmodifiableSet(fields);
return new DateTimeFormatter(printerParser, locale, decimalStyle, resolverStyle, fields, chrono, zone);
}
@@ -1693,11 +1694,12 @@
* @return a formatter based on this formatter with the requested resolver style, not null
*/
public DateTimeFormatter withResolverFields(Set<TemporalField> resolverFields) {
- Objects.requireNonNull(resolverFields, "resolverFields");
if (Objects.equals(this.resolverFields, resolverFields)) {
return this;
}
- resolverFields = Collections.unmodifiableSet(new HashSet<>(resolverFields));
+ if (resolverFields != null) {
+ resolverFields = Collections.unmodifiableSet(new HashSet<>(resolverFields));
+ }
return new DateTimeFormatter(printerParser, locale, decimalStyle, resolverStyle, resolverFields, chrono, zone);
}
--- a/jdk/src/share/classes/java/time/format/DateTimeFormatterBuilder.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/src/share/classes/java/time/format/DateTimeFormatterBuilder.java Wed Apr 09 17:17:03 2014 -0700
@@ -939,7 +939,7 @@
* During parsing, the offset is parsed using the format defined above.
* If the offset cannot be parsed then an exception is thrown unless the
* section of the formatter is optional.
- * <p>
+ *
* @param style the format style to use, not null
* @return this, for chaining, not null
* @throws IllegalArgumentException if style is neither {@link TextStyle#FULL
--- a/jdk/src/share/classes/java/util/regex/Matcher.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/src/share/classes/java/util/regex/Matcher.java Wed Apr 09 17:17:03 2014 -0700
@@ -65,9 +65,10 @@
* new strings whose contents can, if desired, be computed from the match
* result. The {@link #appendReplacement appendReplacement} and {@link
* #appendTail appendTail} methods can be used in tandem in order to collect
- * the result into an existing string buffer, or the more convenient {@link
- * #replaceAll replaceAll} method can be used to create a string in which every
- * matching subsequence in the input sequence is replaced.
+ * the result into an existing string buffer or string builder. Alternatively,
+ * the more convenient {@link #replaceAll replaceAll} method can be used to
+ * create a string in which every matching subsequence in the input sequence
+ * is replaced.
*
* <p> The explicit state of a matcher includes the start and end indices of
* the most recent successful match. It also includes the start and end
@@ -792,15 +793,115 @@
* that does not exist in the pattern
*/
public Matcher appendReplacement(StringBuffer sb, String replacement) {
-
// If no match, return error
if (first < 0)
throw new IllegalStateException("No match available");
+ StringBuilder result = new StringBuilder();
+ appendExpandedReplacement(replacement, result);
+ // Append the intervening text
+ sb.append(text, lastAppendPosition, first);
+ // Append the match substitution
+ sb.append(result);
+ lastAppendPosition = last;
+ return this;
+ }
- // Process substitution string to replace group references with groups
+ /**
+ * Implements a non-terminal append-and-replace step.
+ *
+ * <p> This method performs the following actions: </p>
+ *
+ * <ol>
+ *
+ * <li><p> It reads characters from the input sequence, starting at the
+ * append position, and appends them to the given string builder. It
+ * stops after reading the last character preceding the previous match,
+ * that is, the character at index {@link
+ * #start()} <tt>-</tt> <tt>1</tt>. </p></li>
+ *
+ * <li><p> It appends the given replacement string to the string builder.
+ * </p></li>
+ *
+ * <li><p> It sets the append position of this matcher to the index of
+ * the last character matched, plus one, that is, to {@link #end()}.
+ * </p></li>
+ *
+ * </ol>
+ *
+ * <p> The replacement string may contain references to subsequences
+ * captured during the previous match: Each occurrence of
+ * <tt>$</tt><i>g</i><tt></tt> will be replaced by the result of
+ * evaluating {@link #group(int) group}<tt>(</tt><i>g</i><tt>)</tt>.
+ * The first number after the <tt>$</tt> is always treated as part of
+ * the group reference. Subsequent numbers are incorporated into g if
+ * they would form a legal group reference. Only the numerals '0'
+ * through '9' are considered as potential components of the group
+ * reference. If the second group matched the string <tt>"foo"</tt>, for
+ * example, then passing the replacement string <tt>"$2bar"</tt> would
+ * cause <tt>"foobar"</tt> to be appended to the string builder. A dollar
+ * sign (<tt>$</tt>) may be included as a literal in the replacement
+ * string by preceding it with a backslash (<tt>\$</tt>).
+ *
+ * <p> Note that backslashes (<tt>\</tt>) and dollar signs (<tt>$</tt>) in
+ * the replacement string may cause the results to be different than if it
+ * were being treated as a literal replacement string. Dollar signs may be
+ * treated as references to captured subsequences as described above, and
+ * backslashes are used to escape literal characters in the replacement
+ * string.
+ *
+ * <p> This method is intended to be used in a loop together with the
+ * {@link #appendTail appendTail} and {@link #find find} methods. The
+ * following code, for example, writes <tt>one dog two dogs in the
+ * yard</tt> to the standard-output stream: </p>
+ *
+ * <blockquote><pre>
+ * Pattern p = Pattern.compile("cat");
+ * Matcher m = p.matcher("one cat two cats in the yard");
+ * StringBuilder sb = new StringBuilder();
+ * while (m.find()) {
+ * m.appendReplacement(sb, "dog");
+ * }
+ * m.appendTail(sb);
+ * System.out.println(sb.toString());</pre></blockquote>
+ *
+ * @param sb
+ * The target string builder
+ * @param replacement
+ * The replacement string
+ * @return This matcher
+ *
+ * @throws IllegalStateException
+ * If no match has yet been attempted,
+ * or if the previous match operation failed
+ * @throws IllegalArgumentException
+ * If the replacement string refers to a named-capturing
+ * group that does not exist in the pattern
+ * @throws IndexOutOfBoundsException
+ * If the replacement string refers to a capturing group
+ * that does not exist in the pattern
+ * @since 1.9
+ */
+ public Matcher appendReplacement(StringBuilder sb, String replacement) {
+ // If no match, return error
+ if (first < 0)
+ throw new IllegalStateException("No match available");
+ StringBuilder result = new StringBuilder();
+ appendExpandedReplacement(replacement, result);
+ // Append the intervening text
+ sb.append(text, lastAppendPosition, first);
+ // Append the match substitution
+ sb.append(result);
+ lastAppendPosition = last;
+ return this;
+ }
+
+ /**
+ * Processes replacement string to replace group references with
+ * groups.
+ */
+ private StringBuilder appendExpandedReplacement(
+ String replacement, StringBuilder result) {
int cursor = 0;
- StringBuilder result = new StringBuilder();
-
while (cursor < replacement.length()) {
char nextChar = replacement.charAt(cursor);
if (nextChar == '\\') {
@@ -852,8 +953,8 @@
cursor++;
} else {
// The first number is always a group
- refNum = (int)nextChar - '0';
- if ((refNum < 0)||(refNum > 9))
+ refNum = nextChar - '0';
+ if ((refNum < 0) || (refNum > 9))
throw new IllegalArgumentException(
"Illegal group reference");
cursor++;
@@ -864,7 +965,7 @@
break;
}
int nextDigit = replacement.charAt(cursor) - '0';
- if ((nextDigit < 0)||(nextDigit > 9)) { // not a number
+ if ((nextDigit < 0) || (nextDigit > 9)) { // not a number
break;
}
int newRefNum = (refNum * 10) + nextDigit;
@@ -884,13 +985,7 @@
cursor++;
}
}
- // Append the intervening text
- sb.append(text, lastAppendPosition, first);
- // Append the match substitution
- sb.append(result);
-
- lastAppendPosition = last;
- return this;
+ return result;
}
/**
@@ -913,6 +1008,27 @@
}
/**
+ * Implements a terminal append-and-replace step.
+ *
+ * <p> This method reads characters from the input sequence, starting at
+ * the append position, and appends them to the given string builder. It is
+ * intended to be invoked after one or more invocations of the {@link
+ * #appendReplacement appendReplacement} method in order to copy the
+ * remainder of the input sequence. </p>
+ *
+ * @param sb
+ * The target string builder
+ *
+ * @return The target string builder
+ *
+ * @since 1.9
+ */
+ public StringBuilder appendTail(StringBuilder sb) {
+ sb.append(text, lastAppendPosition, getTextLength());
+ return sb;
+ }
+
+ /**
* Replaces every subsequence of the input sequence that matches the
* pattern with the given replacement string.
*
@@ -950,7 +1066,7 @@
reset();
boolean result = find();
if (result) {
- StringBuffer sb = new StringBuffer();
+ StringBuilder sb = new StringBuilder();
do {
appendReplacement(sb, replacement);
result = find();
@@ -1000,7 +1116,7 @@
reset();
if (!find())
return text.toString();
- StringBuffer sb = new StringBuffer();
+ StringBuilder sb = new StringBuilder();
appendReplacement(sb, replacement);
appendTail(sb);
return sb.toString();
--- a/jdk/src/share/classes/javax/naming/event/package.html Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/src/share/classes/javax/naming/event/package.html Wed Apr 09 17:17:03 2014 -0700
@@ -112,7 +112,6 @@
<tt>namingExceptionThrown()</tt> method is invoked, as shown in the
sample code above,
and the listener is automatically deregistered.
-<p>
<h2>Package Specification</h2>
--- a/jdk/src/share/classes/javax/naming/ldap/ControlFactory.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/src/share/classes/javax/naming/ldap/ControlFactory.java Wed Apr 09 17:17:03 2014 -0700
@@ -114,7 +114,7 @@
* <p>
* Note that a control factory
* must be public and must have a public constructor that accepts no arguments.
- * <p>
+ *
* @param ctl The non-null control object containing the OID and BER data.
* @param ctx The possibly null context in which the control is being created.
* If null, no such information is available.
--- a/jdk/src/share/classes/javax/naming/ldap/LdapContext.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/src/share/classes/javax/naming/ldap/LdapContext.java Wed Apr 09 17:17:03 2014 -0700
@@ -319,7 +319,7 @@
* clear the response controls. You can call it many times (and get
* back the same controls) until the next context method that may return
* controls is invoked.
- *<p>
+ *
* @return A possibly null array of controls. If null, the previous
* method invoked on this context did not produce any controls.
* @exception NamingException If an error occurred while getting the response
--- a/jdk/src/share/classes/javax/naming/ldap/Rdn.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/src/share/classes/javax/naming/ldap/Rdn.java Wed Apr 09 17:17:03 2014 -0700
@@ -352,7 +352,7 @@
* </ul>
* <p>
* If obj is null or not an instance of Rdn, false is returned.
- * <p>
+ *
* @param obj object to be compared for equality with this Rdn.
* @return true if the specified object is equal to this Rdn.
* @see #hashCode()
--- a/jdk/src/share/classes/javax/naming/ldap/package.html Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/src/share/classes/javax/naming/ldap/package.html Wed Apr 09 17:17:03 2014 -0700
@@ -255,8 +255,6 @@
}
</pre></blockquote>
-<p>
-
<h2>Package Specification</h2>
The JNDI API Specification and related documents can be found in the
--- a/jdk/src/share/classes/javax/naming/package.html Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/src/share/classes/javax/naming/package.html Wed Apr 09 17:17:03 2014 -0700
@@ -81,7 +81,6 @@
The overloads that accept string names are likely to be more useful
for simple applications, such as those that simply read in a name
and look up the corresponding object.
-<p>
<h4>Bindings</h4>
--- a/jdk/src/share/classes/javax/naming/spi/DirectoryManager.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/src/share/classes/javax/naming/spi/DirectoryManager.java Wed Apr 09 17:17:03 2014 -0700
@@ -120,7 +120,6 @@
*</ul>
* Service providers that implement the <tt>DirContext</tt> interface
* should use this method, not <tt>NamingManager.getObjectInstance()</tt>.
- *<p>
*
* @param refInfo The possibly null object for which to create an object.
* @param name The name of this object relative to <code>nameCtx</code>.
--- a/jdk/src/share/classes/javax/naming/spi/NamingManager.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/src/share/classes/javax/naming/spi/NamingManager.java Wed Apr 09 17:17:03 2014 -0700
@@ -92,7 +92,7 @@
* The builder can only be installed if the executing thread is allowed
* (by the security manager's checkSetFactory() method) to do so.
* Once installed, the builder cannot be replaced.
- *<p>
+ *
* @param builder The factory builder to install. If null, no builder
* is installed.
* @exception SecurityException builder cannot be installed
--- a/jdk/src/share/classes/javax/naming/spi/ObjectFactory.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/src/share/classes/javax/naming/spi/ObjectFactory.java Wed Apr 09 17:17:03 2014 -0700
@@ -149,7 +149,6 @@
* If a factory uses <code>nameCtx</code> it should synchronize its use
* against concurrent access, since context implementations are not
* guaranteed to be thread-safe.
- * <p>
*
* @param obj The possibly null object containing location or reference
* information that can be used in creating an object.
--- a/jdk/src/share/classes/javax/security/auth/kerberos/KerberosKey.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/src/share/classes/javax/security/auth/kerberos/KerberosKey.java Wed Apr 09 17:17:03 2014 -0700
@@ -52,7 +52,20 @@
* application depends on the default JGSS Kerberos mechanism to access the
* KerberosKey. In that case, however, the application will need an
* appropriate
- * {@link javax.security.auth.kerberos.ServicePermission ServicePermission}.
+ * {@link javax.security.auth.kerberos.ServicePermission ServicePermission}.<p>
+ *
+ * When creating a {@code KerberosKey} using the
+ * {@link #KerberosKey(KerberosPrincipal, char[], String)} constructor,
+ * an implementation may accept non-IANA algorithm names (For example,
+ * "ArcFourMac" for "rc4-hmac"), but the {@link #getAlgorithm} method
+ * must always return the IANA algorithm name.<p>
+ *
+ * @implNote Old algorithm names used before JDK 9 are supported in the
+ * {@link #KerberosKey(KerberosPrincipal, char[], String)} constructor in this
+ * implementation for compatibility reasons, which are "DES" (and null) for
+ * "des-cbc-md5", "DESede" for "des3-cbc-sha1-kd", "ArcFourHmac" for "rc4-hmac",
+ * "AES128" for "aes128-cts-hmac-sha1-96", and "AES256" for
+ * "aes256-cts-hmac-sha1-96".
*
* @author Mayank Upadhyay
* @since 1.4
@@ -73,7 +86,7 @@
*
* @serial
*/
- private int versionNum;
+ private final int versionNum;
/**
* {@code KeyImpl} is serialized by writing out the ASN1 Encoded bytes
@@ -113,13 +126,16 @@
}
/**
- * Constructs a KerberosKey from a principal's password.
+ * Constructs a KerberosKey from a principal's password using the specified
+ * algorithm name. The algorithm name (case insensitive) should be provided
+ * as the encryption type string defined on the IANA
+ * <a href="https://www.iana.org/assignments/kerberos-parameters/kerberos-parameters.xhtml#kerberos-parameters-1">Kerberos Encryption Type Numbers</a>
+ * page. The version number of the key generated will be 0.
*
* @param principal the principal that this password belongs to
* @param password the password that should be used to compute the key
* @param algorithm the name for the algorithm that this key will be
- * used for. This parameter may be null in which case the default
- * algorithm "DES" will be assumed.
+ * used for
* @throws IllegalArgumentException if the name of the
* algorithm passed is unsupported.
*/
@@ -128,6 +144,7 @@
String algorithm) {
this.principal = principal;
+ this.versionNum = 0;
// Pass principal in for salt
key = new KeyImpl(principal, password, algorithm);
}
@@ -170,13 +187,18 @@
*/
/**
- * Returns the standard algorithm name for this key. For
- * example, "DES" would indicate that this key is a DES key.
- * See Appendix A in the <a href=
- * "../../../../../technotes/guides/security/crypto/CryptoSpec.html#AppA">
- * Java Cryptography Architecture API Specification & Reference
- * </a>
- * for information about standard algorithm names.
+ * Returns the standard algorithm name for this key. The algorithm names
+ * are the encryption type string defined on the IANA
+ * <a href="https://www.iana.org/assignments/kerberos-parameters/kerberos-parameters.xhtml#kerberos-parameters-1">Kerberos Encryption Type Numbers</a>
+ * page.
+ * <p>
+ * This method can return the following value not defined on the IANA page:
+ * <ol>
+ * <li>none: for etype equal to 0</li>
+ * <li>unknown: for etype greater than 0 but unsupported by
+ * the implementation</li>
+ * <li>private: for etype smaller than 0</li>
+ * </ol>
*
* @return the name of the algorithm associated with this key.
*/
--- a/jdk/src/share/classes/javax/security/auth/kerberos/KeyImpl.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/src/share/classes/javax/security/auth/kerberos/KeyImpl.java Wed Apr 09 17:17:03 2014 -0700
@@ -36,7 +36,6 @@
import sun.security.krb5.EncryptionKey;
import sun.security.krb5.EncryptedData;
import sun.security.krb5.KrbException;
-import sun.security.krb5.KrbCryptoException;
import sun.security.util.DerValue;
/**
@@ -86,8 +85,12 @@
try {
PrincipalName princ = new PrincipalName(principal.getName());
- EncryptionKey key =
- new EncryptionKey(password, princ.getSalt(), algorithm);
+ EncryptionKey key;
+ if ("none".equalsIgnoreCase(algorithm)) {
+ key = EncryptionKey.NULL_KEY;
+ } else {
+ key = new EncryptionKey(password, princ.getSalt(), algorithm);
+ }
this.keyBytes = key.getBytes();
this.keyType = key.getEType();
} catch (KrbException e) {
@@ -118,27 +121,28 @@
switch (eType) {
case EncryptedData.ETYPE_DES_CBC_CRC:
+ return "des-cbc-crc";
+
case EncryptedData.ETYPE_DES_CBC_MD5:
- return "DES";
+ return "des-cbc-md5";
case EncryptedData.ETYPE_DES3_CBC_HMAC_SHA1_KD:
- return "DESede";
+ return "des3-cbc-sha1-kd";
case EncryptedData.ETYPE_ARCFOUR_HMAC:
- return "ArcFourHmac";
+ return "rc4-hmac";
case EncryptedData.ETYPE_AES128_CTS_HMAC_SHA1_96:
- return "AES128";
+ return "aes128-cts-hmac-sha1-96";
case EncryptedData.ETYPE_AES256_CTS_HMAC_SHA1_96:
- return "AES256";
+ return "aes256-cts-hmac-sha1-96";
case EncryptedData.ETYPE_NULL:
- return "NULL";
+ return "none";
default:
- throw new IllegalArgumentException(
- "Unsupported encryption type: " + eType);
+ return eType > 0 ? "unknown" : "private";
}
}
--- a/jdk/src/share/classes/javax/security/auth/kerberos/package-info.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/src/share/classes/javax/security/auth/kerberos/package-info.java Wed Apr 09 17:17:03 2014 -0700
@@ -48,6 +48,12 @@
* {@code <java-home>/lib/security} and failing that, in an OS-specific
* location.<p>
*
+ * The {@code krb5.conf} file is formatted in the Windows INI file style,
+ * which contains a series of relations grouped into different sections.
+ * Each relation contains a key and a value, the value can be an arbitrary
+ * string or a boolean value. A boolean value can be one of "true", "false",
+ * "yes", or "no", case-insensitive.<p>
+ *
* @since JDK1.4
*/
package javax.security.auth.kerberos;
--- a/jdk/src/share/classes/javax/swing/JComboBox.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/JComboBox.java Wed Apr 09 17:17:03 2014 -0700
@@ -65,7 +65,7 @@
* See <a href="http://docs.oracle.com/javase/tutorial/uiswing/components/combobox.html">How to Use Combo Boxes</a>
* in <a href="http://docs.oracle.com/javase/tutorial/"><em>The Java Tutorial</em></a>
* for further information.
- * <p>
+ *
* @see ComboBoxModel
* @see DefaultComboBoxModel
*
--- a/jdk/src/share/classes/javax/swing/JFrame.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/JFrame.java Wed Apr 09 17:17:03 2014 -0700
@@ -123,7 +123,7 @@
* has this set as the close operation and is closed in an applet,
* a <code>SecurityException</code> may be thrown.
* It is recommended you only use this in an application.
- * <p>
+ *
* @since 1.3
*/
public static final int EXIT_ON_CLOSE = 3;
--- a/jdk/src/share/classes/javax/swing/JList.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/JList.java Wed Apr 09 17:17:03 2014 -0700
@@ -260,7 +260,7 @@
* See <a href="http://docs.oracle.com/javase/tutorial/uiswing/components/list.html">How to Use Lists</a>
* in <a href="http://docs.oracle.com/javase/tutorial/"><em>The Java Tutorial</em></a>
* for further documentation.
- * <p>
+ *
* @see ListModel
* @see AbstractListModel
* @see DefaultListModel
--- a/jdk/src/share/classes/javax/swing/JOptionPane.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/JOptionPane.java Wed Apr 09 17:17:03 2014 -0700
@@ -259,7 +259,7 @@
* "Choose one", "Input",
* JOptionPane.INFORMATION_MESSAGE, null,
* possibleValues, possibleValues[0]);
- * </pre><p>
+ * </pre>
* </dl>
* <b>Direct Use:</b><br>
* To create and use an <code>JOptionPane</code> directly, the
--- a/jdk/src/share/classes/javax/swing/JTable.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/JTable.java Wed Apr 09 17:17:03 2014 -0700
@@ -661,7 +661,7 @@
* with the following code:
*
* <pre>((Vector)rowData.elementAt(1)).elementAt(5);</pre>
- * <p>
+ *
* @param rowData the data for the new table
* @param columnNames names of each column
*/
@@ -678,7 +678,7 @@
* <pre> rowData[1][5]; </pre>
* <p>
* All rows must be of the same length as <code>columnNames</code>.
- * <p>
+ *
* @param rowData the data for the new table
* @param columnNames names of each column
*/
--- a/jdk/src/share/classes/javax/swing/RowSorter.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/RowSorter.java Wed Apr 09 17:17:03 2014 -0700
@@ -42,10 +42,10 @@
* <p>
* The view invokes the following methods on the <code>RowSorter</code>:
* <ul>
- * <li><code>toggleSortOrder</code> — The view invokes this when the
+ * <li><code>toggleSortOrder</code> — The view invokes this when the
* appropriate user gesture has occurred to trigger a sort. For example,
* the user clicked a column header in a table.
- * <li>One of the model change methods — The view invokes a model
+ * <li>One of the model change methods — The view invokes a model
* change method when the underlying model
* has changed. There may be order dependencies in how the events are
* delivered, so a <code>RowSorter</code> should not update its mapping
@@ -59,10 +59,10 @@
* <code>RowSorter</code> provides notification of changes by way of
* <code>RowSorterListener</code>. Two types of notification are sent:
* <ul>
- * <li><code>RowSorterEvent.Type.SORT_ORDER_CHANGED</code> — notifies
+ * <li><code>RowSorterEvent.Type.SORT_ORDER_CHANGED</code> — notifies
* listeners that the sort order has changed. This is typically followed
* by a notification that the sort has changed.
- * <li><code>RowSorterEvent.Type.SORTED</code> — notifies listeners that
+ * <li><code>RowSorterEvent.Type.SORTED</code> — notifies listeners that
* the mapping maintained by the <code>RowSorter</code> has changed in
* some way.
* </ul>
--- a/jdk/src/share/classes/javax/swing/SpringLayout.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/SpringLayout.java Wed Apr 09 17:17:03 2014 -0700
@@ -991,7 +991,7 @@
* If <code>constraints</code> is an instance of
* <code>SpringLayout.Constraints</code>,
* associates the constraints with the specified component.
- * <p>
+ *
* @param component the component being added
* @param constraints the component's constraints
*
@@ -1029,7 +1029,7 @@
* <pre>
* value(e1, c1) = value(e2, c2) + pad</pre>
* to take place during all subsequent layout operations.
- * <p>
+ *
* @param e1 the edge of the dependent
* @param c1 the component of the dependent
* @param pad the fixed distance between dependent and anchor
@@ -1056,7 +1056,7 @@
* <code>SpringLayout.VERTICAL_CENTER</code>,
* <code>SpringLayout.HORIZONTAL_CENTER</code> or
* <code>SpringLayout.BASELINE</code>.
- * <p>
+ *
* @param e1 the edge of the dependent
* @param c1 the component of the dependent
* @param s the spring linking dependent and anchor
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicButtonUI.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicButtonUI.java Wed Apr 09 17:17:03 2014 -0700
@@ -325,7 +325,7 @@
/**
* Method which renders the text of the current button.
- * <p>
+ *
* @param g Graphics context
* @param b Current button to render
* @param textRect Bounding rectangle to render the text.
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicColorChooserUI.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicColorChooserUI.java Wed Apr 09 17:17:03 2014 -0700
@@ -39,7 +39,7 @@
/**
* Provides the basic look and feel for a JColorChooser.
- * <p>
+ *
* @author Tom Santos
* @author Steve Wilson
*/
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicMenuItemUI.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicMenuItemUI.java Wed Apr 09 17:17:03 2014 -0700
@@ -664,7 +664,7 @@
/**
* Renders the text of the current menu item.
- * <p>
+ *
* @param g graphics context
* @param menuItem menu item to render
* @param textRect bounding rectangle for rendering the text
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicToggleButtonUI.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicToggleButtonUI.java Wed Apr 09 17:17:03 2014 -0700
@@ -39,7 +39,6 @@
/**
* BasicToggleButton implementation
- * <p>
*
* @author Jeff Dinkins
*/
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicToolBarSeparatorUI.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicToolBarSeparatorUI.java Wed Apr 09 17:17:03 2014 -0700
@@ -39,7 +39,6 @@
/**
* A Basic L&F implementation of ToolBarSeparatorUI. This implementation
* is a "combined" view/controller.
- * <p>
*
* @author Jeff Shapiro
*/
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicToolBarUI.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicToolBarUI.java Wed Apr 09 17:17:03 2014 -0700
@@ -44,7 +44,6 @@
/**
* A Basic L&F implementation of ToolBarUI. This implementation
* is a "combined" view/controller.
- * <p>
*
* @author Georges Saab
* @author Jeff Shapiro
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicToolTipUI.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicToolTipUI.java Wed Apr 09 17:17:03 2014 -0700
@@ -41,7 +41,6 @@
/**
* Standard tool tip L&F.
- * <p>
*
* @author Dave Moore
*/
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicTreeUI.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicTreeUI.java Wed Apr 09 17:17:03 2014 -0700
@@ -50,7 +50,6 @@
/**
* The basic L&F for a hierarchical data structure.
- * <p>
*
* @author Scott Violet
* @author Shannon Hickey (drag and drop)
--- a/jdk/src/share/classes/javax/swing/plaf/metal/MetalInternalFrameUI.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/plaf/metal/MetalInternalFrameUI.java Wed Apr 09 17:17:03 2014 -0700
@@ -37,7 +37,6 @@
/**
* Metal implementation of JInternalFrame.
- * <p>
*
* @author Steve Wilson
*/
--- a/jdk/src/share/classes/javax/swing/plaf/metal/MetalScrollBarUI.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/plaf/metal/MetalScrollBarUI.java Wed Apr 09 17:17:03 2014 -0700
@@ -56,7 +56,6 @@
/**
* Implementation of ScrollBarUI for the Metal Look and Feel
- * <p>
*
* @author Tom Santos
* @author Steve Wilson
--- a/jdk/src/share/classes/javax/swing/plaf/metal/MetalToolBarUI.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/plaf/metal/MetalToolBarUI.java Wed Apr 09 17:17:03 2014 -0700
@@ -50,7 +50,6 @@
/**
* A Metal Look and Feel implementation of ToolBarUI. This implementation
* is a "combined" view/controller.
- * <p>
*
* @author Jeff Shapiro
*/
--- a/jdk/src/share/classes/javax/swing/plaf/nimbus/doc-files/properties.html Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/plaf/nimbus/doc-files/properties.html Wed Apr 09 17:17:03 2014 -0700
@@ -5,7 +5,7 @@
</head>
<body>
<h1 id="primaryColors">Primary Colors</h1>
-<table>
+<table summary="Nimbus primary colors">
<tr><th>Key</th><th>Value</th><th>Preview</th></tr>
<tr>
<td width="250"><code>control</code></td>
@@ -86,7 +86,7 @@
</table>
<h1 id="secondaryColors">Secondary Colors</h1>
-<table>
+<table summary="Nimbus secondary colors">
<tr><th>Key</th><th>Value</th><th>Preview</th></tr>
<tr>
<td width="250"><code>activeCaption</code></td>
--- a/jdk/src/share/classes/javax/swing/plaf/synth/doc-files/componentProperties.html Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/plaf/synth/doc-files/componentProperties.html Wed Apr 09 17:17:03 2014 -0700
@@ -49,7 +49,7 @@
href="#buttonProperties">Button properties</a>, ArrowButton supports
the following properties: </p>
<h5>ArrowButton Specific Properties</h5>
-<table border="1">
+<table border="1" summary="ArrowButton specific properties">
<thead><tr>
<th>Property</th>
<th>Expected Type</th>
@@ -71,7 +71,7 @@
to the <a href="#buttonProperties">Button properties</a>, JButton
supports the following property: </p>
<h5>JButton Specific Properties</h5>
-<table border="1">
+<table border="1" summary="JButton specific properties">
<thead><tr>
<th>Property</th>
<th>Expected Type</th>
@@ -94,7 +94,7 @@
addition to the <a href="#buttonProperties">Button properties</a>,
JCheckBox supports the following property: </p>
<h5>JCheckBox Specific Properties</h5>
-<table border="1">
+<table border="1" summary="JCheckBox specific properties">
<thead><tr>
<th>Property</th>
<th>Expected Type</th>
@@ -114,7 +114,7 @@
<h4><a name="JComboBox">JComboBox</a></h4>
<p> JComboBox is a composite component that consists of the following
child Components: </p>
-<table border="1">
+<table border="1" summary="JComboBox child components">
<thead><tr>
<th>Name</th>
<th>Type</th>
@@ -159,9 +159,9 @@
</tr>
</tbody>
</table>
-<p> </p>
+
<h5>JComboBox Specific Properties</h5>
-<table border="1">
+<table border="1" summary="JComboBox specific properties">
<thead><tr>
<th>Property</th>
<th>Expected Type</th>
@@ -181,7 +181,7 @@
<br>
<h4>JFileChooser</h4>
<h5>JFileChooser Specific Properties</h5>
-<table cellpadding="2" cellspacing="2" border="1"
+<table cellpadding="2" cellspacing="2" border="1" summary="JFileChooser specific properties"
style="width: 100%; text-align: left;">
<tbody>
<tr>
@@ -341,7 +341,7 @@
<br>
<h4><a name="JInternalFrame"></a>JInternalFrame</h4>
<h5>JInternalFrame Specific Properties</h5>
-<table cellpadding="2" cellspacing="2" border="1"
+<table cellpadding="2" cellspacing="2" border="1" summary="JInternalFrame specific properties"
style="text-align: left; width: 100%;">
<tbody>
<tr>
@@ -374,7 +374,7 @@
internal frame similar to that found in a frame.<br>
</p>
<h5>JInternalFrameTitlePane Specific Properties</h5>
-<table cellpadding="2" cellspacing="2" border="1"
+<table cellpadding="2" cellspacing="2" border="1" summary="JInternalFrameTitlePane specific properties"
style="text-align: left; width: 100%;">
<tbody>
<tr>
@@ -473,7 +473,7 @@
<p> JList's sets the name of the renderer to List.renderer. JList
supports the following properties: </p>
<h5>JList Specific Properties</h5>
-<table border="1">
+<table border="1" summary="JList specific properties">
<thead><tr>
<th>Property</th>
<th>Expected Type</th>
@@ -516,7 +516,7 @@
MENU_ITEM_ACCELERATOR is used for painting the accelerator. Both Regions
paint text using the TEXT_FOREGROUND ColorType. The following set of
properties are supported: </p>
-<table border="1">
+<table border="1" summary="Menu classes common properties">
<thead><tr>
<th>Property</th>
<th>Expected Type</th>
@@ -570,7 +570,7 @@
<p> <code>Prefix</code> is one of: CheckBoxMenuItem, Menu, MenuItem, or
RadioButtonMenuItem. </p>
<p> JMenu also supports the following properties: </p>
-<table border="1">
+<table border="1" summary="JMenu specific properties">
<thead><tr>
<th>Property</th>
<th>Expected Type</th>
@@ -599,7 +599,7 @@
OptionPane.comboBox, OptionPane.scrollPane, OptionPane.list,
OptionPane.textField, OptionPane.iconLabel. </p>
<h5>JOptionPane Specific Properties</h5>
-<table border="1">
+<table border="1" summary="JOptionPane specific properties">
<thead><tr>
<th>Property</th>
<th>Expected Type</th>
@@ -713,7 +713,7 @@
</h4>
<h5>JProgressBar Specific Properties<br>
</h5>
-<table cellpadding="2" cellspacing="2" border="1"
+<table cellpadding="2" cellspacing="2" border="1" summary="JProgressBar specific properties"
style="text-align: left; width: 100%;">
<tbody>
<tr>
@@ -754,7 +754,7 @@
addition to the <a href="#buttonProperties">Button properties</a>,
JRadioButton supports the following property: </p>
<h5>JRadioButton Specific Properties</h5>
-<table border="1">
+<table border="1" summary="JRadioButton specific properties">
<thead><tr>
<th>Property</th>
<th>Expected Type</th>
@@ -774,7 +774,7 @@
<h4><a name="JScrollBar">JScrollBar</a></h4>
<p> JScrollBar is a composite component that consists of the following
child Components: </p>
-<table border="1">
+<table border="1" summary="JScrollBar child components">
<thead><tr>
<th>Name</th>
<th>Type</th>
@@ -788,9 +788,9 @@
</tr>
</tbody>
</table>
-<p> </p>
+
<h5>JScrollBar Specific Properties</h5>
-<table border="1">
+<table border="1" summary="JScrollBar specific properties">
<thead><tr>
<th>Property</th>
<th>Expected Type</th>
@@ -844,7 +844,7 @@
<h4><a name="Separator">Separators</a></h4>
<p> All of the separator classes, JSeparator, JPopupMenu.Separator and
JToolBar.Separator use the same property: </p>
-<table border="1">
+<table border="1" summary="Separator classes common properties">
<thead><tr>
<th>Property</th>
<th>Expected Type</th>
@@ -863,7 +863,7 @@
</tbody>
</table>
<p> JToolBar.Separator also supports the following property: </p>
-<table border="1">
+<table border="1" summary="JToolBar.Separator specific properties">
<thead><tr>
<th>Property</th>
<th>Expected Type</th>
@@ -896,7 +896,7 @@
<code>Viewport</code>s border.
</p>
<h5>JScrollPane Specific Properties</h5>
-<table border="1">
+<table border="1" summary="JScrollPane specific properties">
<thead><tr>
<th>Property</th>
<th>Expected Type</th>
@@ -920,7 +920,7 @@
SplitPaneDivider.leftOneTouchButton and
SplitPaneDivider.rightOneTouchButton. </p>
<h5>JSplitPane Specific Properties</h5>
-<table border="1">
+<table border="1" summary="JSplitPane specific properties">
<thead><tr>
<th>Property</th>
<th>Expected Type</th>
@@ -964,7 +964,7 @@
<br>
<h4><a name="JSlider"></a>JSlider</h4>
<h5>JSlider Specific Properties</h5>
-<table cellpadding="2" cellspacing="2" border="1"
+<table cellpadding="2" cellspacing="2" border="1" summary="JSlider specific properties"
style="text-align: left; width: 100%;">
<tbody>
<tr>
@@ -1024,7 +1024,7 @@
<br>
<h4><a name="JTabbedPane"></a>JTabbedPane</h4>
<h5>JTabbedPane Specific Properties</h5>
-<table cellpadding="2" cellspacing="2" border="1"
+<table cellpadding="2" cellspacing="2" border="1" summary="JTabbedPane specific properties"
style="text-align: left; width: 100%;">
<tbody>
<tr>
@@ -1088,7 +1088,7 @@
<p> JTable sets the name of the renderer to Table.cellRenderer.
JTable supports the following properties: </p>
<h5>JTable Specific Properties</h5>
-<table border="1">
+<table border="1" summary="JTable specific properties">
<thead><tr>
<th>Property</th>
<th>Expected Type</th>
@@ -1133,7 +1133,7 @@
<p> JTree sets the name of the renderer to Tree.renderer, the name of
the editor is Tree.cellEditor.</p>
<h5>JTree Specific Properties</h5>
-<table border="1">
+<table border="1" summary="JTree specific properties">
<thead><tr>
<th>Property</th>
<th>Expected Type</th>
@@ -1217,7 +1217,7 @@
addition to the <a href="#buttonProperties">Button properties</a>,
JToggleButton supports the following property: </p>
<h5>JToggleButton Specific Properties</h5>
-<table border="1">
+<table border="1" summary="JToggleButton specific properties">
<thead><tr>
<th>Property</th>
<th>Expected Type</th>
@@ -1238,7 +1238,7 @@
<p> Each of the Button classes (JButton, JCheckBox, JRadioButton,
JToggleButton and SynthArrowButton) support a similar set of properties.
These properties are: </p>
-<table border="1">
+<table border="1" summary="Button classes common properties">
<thead><tr>
<th>Property</th>
<th>Expected Type</th>
@@ -1283,7 +1283,7 @@
</p>
<h4><a name="textProperties"></a>Text Properties<br>
</h4>
-<table cellpadding="2" cellspacing="2" border="1"
+<table cellpadding="2" cellspacing="2" border="1" summary="Text properties"
style="text-align: left; width: 100%;">
<tbody>
<tr>
--- a/jdk/src/share/classes/javax/swing/plaf/synth/doc-files/synthFileFormat.html Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/plaf/synth/doc-files/synthFileFormat.html Wed Apr 09 17:17:03 2014 -0700
@@ -739,12 +739,12 @@
</state>
</style>
</pre>
- </div>
+ </div>
<p>
The following outlines which painter will be used for what
- SynthPainter method:
+ SynthPainter method:
</p>
- <table border=1>
+ <table border=1 summary="Painters for SynthPainter methods">
<tr><th>State<th>Method<th>Painter
<tr><td>SELECTED<td>paintButtonBackground<td>stateButtonBackgroundPainter
<tr><td>SELECTED<td>Anything but paintButtonBackground<td>stateFallbackPainter
--- a/jdk/src/share/classes/javax/swing/text/GlyphView.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/text/GlyphView.java Wed Apr 09 17:17:03 2014 -0700
@@ -56,7 +56,6 @@
* expanded if this view is embedded in a container that does
* tab expansion. ParagraphView is an example of a container
* that does tab expansion.
- * <p>
*
* @since 1.3
*
--- a/jdk/src/share/classes/javax/swing/text/StyleConstants.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/text/StyleConstants.java Wed Apr 09 17:17:03 2014 -0700
@@ -42,7 +42,6 @@
* <p style="text-align:center"><img src="doc-files/paragraph.gif"
* alt="Diagram shows SpaceAbove, FirstLineIndent, LeftIndent, RightIndent,
* and SpaceBelow a paragraph."></p>
- * <p>
*
* @author Timothy Prinzing
*/
--- a/jdk/src/share/classes/javax/swing/text/View.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/text/View.java Wed Apr 09 17:17:03 2014 -0700
@@ -183,7 +183,6 @@
<li>{@link #removeUpdate removeUpdate}
<li>{@link #changedUpdate changedUpdate}
</ul>
- <p>
</dl>
*
* @author Timothy Prinzing
--- a/jdk/src/share/classes/javax/swing/text/html/StyleSheet.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/text/html/StyleSheet.java Wed Apr 09 17:17:03 2014 -0700
@@ -116,7 +116,7 @@
* concepts we do not currently
* support are pseudo selectors, such as <code>A:link { color: red }</code>,
* and the <code>important</code> modifier.
- * <p>
+ *
* @implNote This implementation is currently
* incomplete. It can be replaced with alternative implementations
* that are complete. Future versions of this class will provide
--- a/jdk/src/share/classes/javax/swing/undo/UndoableEdit.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/undo/UndoableEdit.java Wed Apr 09 17:17:03 2014 -0700
@@ -47,7 +47,7 @@
* be incorporated into a larger edit and treated as a single edit.
* <li>If <code>addEdit</code> returns false <code>replaceEdit</code>
* is called on the new edit with the current edit passed in as the
- * argument. This is the inverse of <code>addEdit</code> —
+ * argument. This is the inverse of <code>addEdit</code> —
* if the new edit returns true from <code>replaceEdit</code>, the new
* edit replaces the current edit.
* </ol>
--- a/jdk/src/share/classes/sun/management/snmp/util/SnmpListTableCache.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/src/share/classes/sun/management/snmp/util/SnmpListTableCache.java Wed Apr 09 17:17:03 2014 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -43,6 +43,7 @@
* <p><b>NOTE: This class is not synchronized, subclasses must implement
* the appropriate synchronization whwn needed.</b></p>
**/
+@SuppressWarnings("serial") // JDK implementation class
public abstract class SnmpListTableCache extends SnmpTableCache {
--- a/jdk/src/share/classes/sun/management/snmp/util/SnmpNamedListTableCache.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/src/share/classes/sun/management/snmp/util/SnmpNamedListTableCache.java Wed Apr 09 17:17:03 2014 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -49,6 +49,7 @@
* <p><b>NOTE: This class is not synchronized, subclasses must implement
* the appropriate synchronization whwn needed.</b></p>
**/
+@SuppressWarnings("serial") // JDK implementation class
public abstract class SnmpNamedListTableCache extends SnmpListTableCache {
/**
--- a/jdk/src/share/classes/sun/management/snmp/util/SnmpTableCache.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/src/share/classes/sun/management/snmp/util/SnmpTableCache.java Wed Apr 09 17:17:03 2014 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -45,6 +45,7 @@
* <p><b>NOTE: This class is not synchronized, subclasses must implement
* the appropriate synchronization when needed.</b></p>
**/
+@SuppressWarnings("serial") // JDK implementation class
public abstract class SnmpTableCache implements Serializable {
/**
--- a/jdk/src/share/classes/sun/security/internal/spec/TlsRsaPremasterSecretParameterSpec.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/src/share/classes/sun/security/internal/spec/TlsRsaPremasterSecretParameterSpec.java Wed Apr 09 17:17:03 2014 -0700
@@ -26,11 +26,11 @@
package sun.security.internal.spec;
import java.security.spec.AlgorithmParameterSpec;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
/**
- * Parameters for SSL/TLS RSA Premaster secret generation.
- * This class is used by SSL/TLS client to initialize KeyGenerators of the
- * type "TlsRsaPremasterSecret".
+ * Parameters for SSL/TLS RSA premaster secret.
*
* <p>Instances of this class are immutable.
*
@@ -43,90 +43,108 @@
public class TlsRsaPremasterSecretParameterSpec
implements AlgorithmParameterSpec {
- private final int majorVersion;
- private final int minorVersion;
- private final byte[] encodedSecret;
+ /*
+ * The TLS spec says that the version in the RSA premaster secret must
+ * be the maximum version supported by the client (i.e. the version it
+ * requested in its client hello version). However, we (and other
+ * implementations) used to send the active negotiated version. The
+ * system property below allows to toggle the behavior.
+ */
+ private final static String PROP_NAME =
+ "com.sun.net.ssl.rsaPreMasterSecretFix";
- /**
- * Constructs a new TlsRsaPremasterSecretParameterSpec.
- * <P>
- * The version numbers will be placed inside the premaster secret to
- * detect version rollbacks attacks as described in the TLS specification.
- * Note that they do not indicate the protocol version negotiated for
- * the handshake.
- *
- * @param majorVersion the major number of the protocol version
- * @param minorVersion the minor number of the protocol version
- *
- * @throws IllegalArgumentException if minorVersion or majorVersion are
- * negative or larger than 255
+ /*
+ * Default is "false" (old behavior) for compatibility reasons in
+ * SSLv3/TLSv1. Later protocols (TLSv1.1+) do not use this property.
*/
- public TlsRsaPremasterSecretParameterSpec(int majorVersion,
- int minorVersion) {
- this.majorVersion =
- TlsMasterSecretParameterSpec.checkVersion(majorVersion);
- this.minorVersion =
- TlsMasterSecretParameterSpec.checkVersion(minorVersion);
- this.encodedSecret = null;
- }
+ private final static boolean rsaPreMasterSecretFix =
+ AccessController.doPrivileged(new PrivilegedAction<Boolean>() {
+ public Boolean run() {
+ String value = System.getProperty(PROP_NAME);
+ if (value != null && value.equalsIgnoreCase("true")) {
+ return Boolean.TRUE;
+ }
+
+ return Boolean.FALSE;
+ }
+ });
+
+ private final int clientVersion;
+ private final int serverVersion;
/**
* Constructs a new TlsRsaPremasterSecretParameterSpec.
- * <P>
- * The version numbers will be placed inside the premaster secret to
- * detect version rollbacks attacks as described in the TLS specification.
- * Note that they do not indicate the protocol version negotiated for
- * the handshake.
- * <P>
- * Usually, the encoded secret key is a random number that acts as
- * dummy pre_master_secret to avoid vulnerabilities described by
- * section 7.4.7.1, RFC 5246.
*
- * @param majorVersion the major number of the protocol version
- * @param minorVersion the minor number of the protocol version
- * @param encodedSecret the encoded secret key
+ * @param clientVersion the version of the TLS protocol by which the
+ * client wishes to communicate during this session
+ * @param serverVersion the negotiated version of the TLS protocol which
+ * contains the lower of that suggested by the client in the client
+ * hello and the highest supported by the server.
*
- * @throws IllegalArgumentException if minorVersion or majorVersion are
- * negative or larger than 255, or encodedSecret is not exactly 48 bytes.
+ * @throws IllegalArgumentException if clientVersion or serverVersion are
+ * negative or larger than (2^16 - 1)
*/
- public TlsRsaPremasterSecretParameterSpec(int majorVersion,
- int minorVersion, byte[] encodedSecret) {
- this.majorVersion =
- TlsMasterSecretParameterSpec.checkVersion(majorVersion);
- this.minorVersion =
- TlsMasterSecretParameterSpec.checkVersion(minorVersion);
+ public TlsRsaPremasterSecretParameterSpec(
+ int clientVersion, int serverVersion) {
+
+ this.clientVersion = checkVersion(clientVersion);
+ this.serverVersion = checkVersion(serverVersion);
+ }
- if (encodedSecret == null || encodedSecret.length != 48) {
- throw new IllegalArgumentException(
- "Encoded secret is not exactly 48 bytes");
- }
- this.encodedSecret = encodedSecret.clone();
+ /**
+ * Returns the version of the TLS protocol by which the client wishes to
+ * communicate during this session.
+ *
+ * @return the version of the TLS protocol in ClientHello message
+ */
+ public int getClientVersion() {
+ return clientVersion;
}
/**
- * Returns the major version.
+ * Returns the negotiated version of the TLS protocol which contains the
+ * lower of that suggested by the client in the client hello and the
+ * highest supported by the server.
*
- * @return the major version.
+ * @return the negotiated version of the TLS protocol in ServerHello message
*/
- public int getMajorVersion() {
- return majorVersion;
+ public int getServerVersion() {
+ return serverVersion;
}
/**
- * Returns the minor version.
+ * Returns the major version used in RSA premaster secret.
*
- * @return the minor version.
+ * @return the major version used in RSA premaster secret.
*/
- public int getMinorVersion() {
- return minorVersion;
+ public int getMajorVersion() {
+ if (rsaPreMasterSecretFix || clientVersion >= 0x0302) {
+ // 0x0302: TLSv1.1
+ return (clientVersion >>> 8) & 0xFF;
+ }
+
+ return (serverVersion >>> 8) & 0xFF;
}
/**
- * Returns the encoded secret.
+ * Returns the minor version used in RSA premaster secret.
*
- * @return the encoded secret, may be null if no encoded secret.
+ * @return the minor version used in RSA premaster secret.
*/
- public byte[] getEncodedSecret() {
- return encodedSecret == null ? null : encodedSecret.clone();
+ public int getMinorVersion() {
+ if (rsaPreMasterSecretFix || clientVersion >= 0x0302) {
+ // 0x0302: TLSv1.1
+ return clientVersion & 0xFF;
+ }
+
+ return serverVersion & 0xFF;
+ }
+
+ private int checkVersion(int version) {
+ if ((version < 0) || (version > 0xFFFF)) {
+ throw new IllegalArgumentException(
+ "Version must be between 0 and 65,535");
+ }
+ return version;
}
}
--- a/jdk/src/share/classes/sun/security/krb5/Config.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/src/share/classes/sun/security/krb5/Config.java Wed Apr 09 17:17:03 2014 -0700
@@ -32,20 +32,15 @@
import java.io.File;
import java.io.FileInputStream;
-import java.util.Hashtable;
-import java.util.Vector;
-import java.util.ArrayList;
+import java.util.*;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
-import java.util.StringTokenizer;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.security.AccessController;
import java.security.PrivilegedExceptionAction;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Locale;
+
import sun.net.dns.ResolverConfiguration;
import sun.security.krb5.internal.crypto.EType;
import sun.security.krb5.internal.Krb5;
@@ -232,6 +227,31 @@
}
/**
+ * Gets the boolean value for the specified keys. Returns TRUE if the
+ * string value is "yes", or "true", FALSE if "no", or "false", or null
+ * if otherwise or not defined. The comparision is case-insensitive.
+ *
+ * @param keys the keys, see {@link #get(String...)}
+ * @return the boolean value, or null if there is no value defined or the
+ * value does not look like a boolean value.
+ * @throws IllegalArgumentException see {@link #get(String...)}
+ */
+ public Boolean getBooleanObject(String... keys) {
+ String s = get(keys);
+ if (s == null) {
+ return null;
+ }
+ switch (s.toLowerCase(Locale.US)) {
+ case "yes": case "true":
+ return Boolean.TRUE;
+ case "no": case "false":
+ return Boolean.FALSE;
+ default:
+ return null;
+ }
+ }
+
+ /**
* Gets all values for the specified keys.
* @throws IllegalArgumentException if any of the keys is illegal
* (See {@link #get})
@@ -317,23 +337,6 @@
}
/**
- * Gets the boolean value for the specified keys.
- * @param keys the keys
- * @return the boolean value, false is returned if it cannot be
- * found or the value is not "true" (case insensitive).
- * @throw IllegalArgumentException if any of the keys is illegal
- * @see #get(java.lang.String[])
- */
- public boolean getBooleanValue(String... keys) {
- String val = get(keys);
- if (val != null && val.equalsIgnoreCase("true")) {
- return true;
- } else {
- return false;
- }
- }
-
- /**
* Parses a string to an integer. The convertible strings include the
* string representations of positive integers, negative integers, and
* hex decimal integers. Valid inputs are, e.g., -1234, +1234,
@@ -341,7 +344,7 @@
*
* @param input the String to be converted to an Integer.
* @return an numeric value represented by the string
- * @exception NumberFormationException if the String does not contain a
+ * @exception NumberFormatException if the String does not contain a
* parsable integer.
*/
private int parseIntValue(String input) throws NumberFormatException {
@@ -927,32 +930,20 @@
* use addresses if "no_addresses" or "noaddresses" is set to false
*/
public boolean useAddresses() {
- boolean useAddr = false;
- // use addresses if "no_addresses" is set to false
- String value = get("libdefaults", "no_addresses");
- useAddr = (value != null && value.equalsIgnoreCase("false"));
- if (useAddr == false) {
- // use addresses if "noaddresses" is set to false
- value = get("libdefaults", "noaddresses");
- useAddr = (value != null && value.equalsIgnoreCase("false"));
- }
- return useAddr;
+ return getBooleanObject("libdefaults", "no_addresses") == Boolean.FALSE ||
+ getBooleanObject("libdefaults", "noaddresses") == Boolean.FALSE;
}
/**
- * Check if need to use DNS to locate Kerberos services
+ * Check if need to use DNS to locate Kerberos services for name. If not
+ * defined, check dns_fallback, whose default value is true.
*/
private boolean useDNS(String name) {
- String value = get("libdefaults", name);
- if (value == null) {
- value = get("libdefaults", "dns_fallback");
- if ("false".equalsIgnoreCase(value)) {
- return false;
- } else {
- return true;
- }
+ Boolean value = getBooleanObject("libdefaults", name);
+ if (value != null) {
+ return value.booleanValue();
} else {
- return value.equalsIgnoreCase("true");
+ return getBooleanObject("libdefaults", "dns_fallback") != Boolean.FALSE;
}
}
--- a/jdk/src/share/classes/sun/security/krb5/EncryptionKey.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/src/share/classes/sun/security/krb5/EncryptionKey.java Wed Apr 09 17:17:03 2014 -0700
@@ -271,15 +271,22 @@
String salt,
String algorithm) throws KrbCryptoException {
- if (algorithm == null || algorithm.equalsIgnoreCase("DES")) {
+ if (algorithm == null || algorithm.equalsIgnoreCase("DES")
+ || algorithm.equalsIgnoreCase("des-cbc-md5")) {
keyType = EncryptedData.ETYPE_DES_CBC_MD5;
- } else if (algorithm.equalsIgnoreCase("DESede")) {
+ } else if (algorithm.equalsIgnoreCase("des-cbc-crc")) {
+ keyType = EncryptedData.ETYPE_DES_CBC_CRC;
+ } else if (algorithm.equalsIgnoreCase("DESede")
+ || algorithm.equalsIgnoreCase("des3-cbc-sha1-kd")) {
keyType = EncryptedData.ETYPE_DES3_CBC_HMAC_SHA1_KD;
- } else if (algorithm.equalsIgnoreCase("AES128")) {
+ } else if (algorithm.equalsIgnoreCase("AES128")
+ || algorithm.equalsIgnoreCase("aes128-cts-hmac-sha1-96")) {
keyType = EncryptedData.ETYPE_AES128_CTS_HMAC_SHA1_96;
- } else if (algorithm.equalsIgnoreCase("ArcFourHmac")) {
+ } else if (algorithm.equalsIgnoreCase("ArcFourHmac")
+ || algorithm.equalsIgnoreCase("rc4-hmac")) {
keyType = EncryptedData.ETYPE_ARCFOUR_HMAC;
- } else if (algorithm.equalsIgnoreCase("AES256")) {
+ } else if (algorithm.equalsIgnoreCase("AES256")
+ || algorithm.equalsIgnoreCase("aes256-cts-hmac-sha1-96")) {
keyType = EncryptedData.ETYPE_AES256_CTS_HMAC_SHA1_96;
// validate if AES256 is enabled
if (!EType.isSupported(keyType)) {
--- a/jdk/src/share/classes/sun/security/krb5/internal/KDCOptions.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/src/share/classes/sun/security/krb5/internal/KDCOptions.java Wed Apr 09 17:17:03 2014 -0700
@@ -299,14 +299,14 @@
if ((options & KDC_OPT_RENEWABLE_OK) == KDC_OPT_RENEWABLE_OK) {
set(RENEWABLE_OK, true);
} else {
- if (config.getBooleanValue("libdefaults", "renewable")) {
+ if (config.getBooleanObject("libdefaults", "renewable") == Boolean.TRUE) {
set(RENEWABLE_OK, true);
}
}
if ((options & KDC_OPT_PROXIABLE) == KDC_OPT_PROXIABLE) {
set(PROXIABLE, true);
} else {
- if (config.getBooleanValue("libdefaults", "proxiable")) {
+ if (config.getBooleanObject("libdefaults", "proxiable") == Boolean.TRUE) {
set(PROXIABLE, true);
}
}
@@ -314,7 +314,7 @@
if ((options & KDC_OPT_FORWARDABLE) == KDC_OPT_FORWARDABLE) {
set(FORWARDABLE, true);
} else {
- if (config.getBooleanValue("libdefaults", "forwardable")) {
+ if (config.getBooleanObject("libdefaults", "forwardable") == Boolean.TRUE) {
set(FORWARDABLE, true);
}
}
--- a/jdk/src/share/classes/sun/security/krb5/internal/crypto/EType.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/src/share/classes/sun/security/krb5/internal/crypto/EType.java Wed Apr 09 17:17:03 2014 -0700
@@ -58,8 +58,8 @@
boolean allowed = false;
try {
Config cfg = Config.getInstance();
- String temp = cfg.get("libdefaults", "allow_weak_crypto");
- if (temp != null && temp.equals("true")) allowed = true;
+ allowed = cfg.getBooleanObject("libdefaults", "allow_weak_crypto")
+ == Boolean.TRUE;
} catch (Exception exc) {
if (DEBUG) {
System.out.println ("Exception in getting allow_weak_crypto, " +
--- a/jdk/src/share/classes/sun/security/pkcs11/P11RSACipher.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/src/share/classes/sun/security/pkcs11/P11RSACipher.java Wed Apr 09 17:17:03 2014 -0700
@@ -37,6 +37,8 @@
import static sun.security.pkcs11.TemplateManager.*;
import sun.security.pkcs11.wrapper.*;
import static sun.security.pkcs11.wrapper.PKCS11Constants.*;
+import sun.security.internal.spec.TlsRsaPremasterSecretParameterSpec;
+import sun.security.util.KeyUtil;
/**
* RSA Cipher implementation class. We currently only support
@@ -102,6 +104,12 @@
// maximum output size. this is the length of the key
private int outputSize;
+ // cipher parameter for TLS RSA premaster secret
+ private AlgorithmParameterSpec spec = null;
+
+ // the source of randomness
+ private SecureRandom random;
+
P11RSACipher(Token token, String algorithm, long mechanism)
throws PKCS11Exception {
super();
@@ -165,8 +173,12 @@
AlgorithmParameterSpec params, SecureRandom random)
throws InvalidKeyException, InvalidAlgorithmParameterException {
if (params != null) {
- throw new InvalidAlgorithmParameterException
- ("Parameters not supported");
+ if (!(params instanceof TlsRsaPremasterSecretParameterSpec)) {
+ throw new InvalidAlgorithmParameterException(
+ "Parameters not supported");
+ }
+ spec = params;
+ this.random = random; // for TLS RSA premaster secret
}
implInit(opmode, key);
}
@@ -176,8 +188,8 @@
SecureRandom random)
throws InvalidKeyException, InvalidAlgorithmParameterException {
if (params != null) {
- throw new InvalidAlgorithmParameterException
- ("Parameters not supported");
+ throw new InvalidAlgorithmParameterException(
+ "Parameters not supported");
}
implInit(opmode, key);
}
@@ -452,21 +464,101 @@
protected Key engineUnwrap(byte[] wrappedKey, String algorithm,
int type) throws InvalidKeyException, NoSuchAlgorithmException {
- // XXX implement unwrap using C_Unwrap() for all keys
- implInit(Cipher.DECRYPT_MODE, p11Key);
- if (wrappedKey.length > maxInputSize) {
- throw new InvalidKeyException("Key is too long for unwrapping");
+ boolean isTlsRsaPremasterSecret =
+ algorithm.equals("TlsRsaPremasterSecret");
+ Exception failover = null;
+
+ SecureRandom secureRandom = random;
+ if (secureRandom == null && isTlsRsaPremasterSecret) {
+ secureRandom = new SecureRandom();
}
- implUpdate(wrappedKey, 0, wrappedKey.length);
- try {
- byte[] encoded = doFinal();
+
+ // Should C_Unwrap be preferred for non-TLS RSA premaster secret?
+ if (token.supportsRawSecretKeyImport()) {
+ // XXX implement unwrap using C_Unwrap() for all keys
+ implInit(Cipher.DECRYPT_MODE, p11Key);
+ if (wrappedKey.length > maxInputSize) {
+ throw new InvalidKeyException("Key is too long for unwrapping");
+ }
+
+ byte[] encoded = null;
+ implUpdate(wrappedKey, 0, wrappedKey.length);
+ try {
+ encoded = doFinal();
+ } catch (BadPaddingException e) {
+ if (isTlsRsaPremasterSecret) {
+ failover = e;
+ } else {
+ throw new InvalidKeyException("Unwrapping failed", e);
+ }
+ } catch (IllegalBlockSizeException e) {
+ // should not occur, handled with length check above
+ throw new InvalidKeyException("Unwrapping failed", e);
+ }
+
+ if (isTlsRsaPremasterSecret) {
+ if (!(spec instanceof TlsRsaPremasterSecretParameterSpec)) {
+ throw new IllegalStateException(
+ "No TlsRsaPremasterSecretParameterSpec specified");
+ }
+
+ // polish the TLS premaster secret
+ TlsRsaPremasterSecretParameterSpec psps =
+ (TlsRsaPremasterSecretParameterSpec)spec;
+ encoded = KeyUtil.checkTlsPreMasterSecretKey(
+ psps.getClientVersion(), psps.getServerVersion(),
+ secureRandom, encoded, (failover != null));
+ }
+
return ConstructKeys.constructKey(encoded, algorithm, type);
- } catch (BadPaddingException e) {
- // should not occur
- throw new InvalidKeyException("Unwrapping failed", e);
- } catch (IllegalBlockSizeException e) {
- // should not occur, handled with length check above
- throw new InvalidKeyException("Unwrapping failed", e);
+ } else {
+ Session s = null;
+ SecretKey secretKey = null;
+ try {
+ try {
+ s = token.getObjSession();
+ long keyType = CKK_GENERIC_SECRET;
+ CK_ATTRIBUTE[] attributes = new CK_ATTRIBUTE[] {
+ new CK_ATTRIBUTE(CKA_CLASS, CKO_SECRET_KEY),
+ new CK_ATTRIBUTE(CKA_KEY_TYPE, keyType),
+ };
+ attributes = token.getAttributes(
+ O_IMPORT, CKO_SECRET_KEY, keyType, attributes);
+ long keyID = token.p11.C_UnwrapKey(s.id(),
+ new CK_MECHANISM(mechanism), p11Key.keyID,
+ wrappedKey, attributes);
+ secretKey = P11Key.secretKey(s, keyID,
+ algorithm, 48 << 3, attributes);
+ } catch (PKCS11Exception e) {
+ if (isTlsRsaPremasterSecret) {
+ failover = e;
+ } else {
+ throw new InvalidKeyException("unwrap() failed", e);
+ }
+ }
+
+ if (isTlsRsaPremasterSecret) {
+ byte[] replacer = new byte[48];
+ if (failover == null) {
+ // Does smart compiler dispose this operation?
+ secureRandom.nextBytes(replacer);
+ }
+
+ TlsRsaPremasterSecretParameterSpec psps =
+ (TlsRsaPremasterSecretParameterSpec)spec;
+
+ // Please use the tricky failover and replacer byte array
+ // as the parameters so that smart compiler won't dispose
+ // the unused variable .
+ secretKey = polishPreMasterSecretKey(token, s,
+ failover, replacer, secretKey,
+ psps.getClientVersion(), psps.getServerVersion());
+ }
+
+ return secretKey;
+ } finally {
+ token.releaseSession(s);
+ }
}
}
@@ -475,6 +567,34 @@
int n = P11KeyFactory.convertKey(token, key, algorithm).length();
return n;
}
+
+ private static SecretKey polishPreMasterSecretKey(
+ Token token, Session session,
+ Exception failover, byte[] replacer, SecretKey secretKey,
+ int clientVersion, int serverVersion) {
+
+ if (failover != null) {
+ CK_VERSION version = new CK_VERSION(
+ (clientVersion >>> 8) & 0xFF, clientVersion & 0xFF);
+ try {
+ CK_ATTRIBUTE[] attributes = token.getAttributes(
+ O_GENERATE, CKO_SECRET_KEY,
+ CKK_GENERIC_SECRET, new CK_ATTRIBUTE[0]);
+ long keyID = token.p11.C_GenerateKey(session.id(),
+ // new CK_MECHANISM(CKM_TLS_PRE_MASTER_KEY_GEN, version),
+ new CK_MECHANISM(CKM_SSL3_PRE_MASTER_KEY_GEN, version),
+ attributes);
+ return P11Key.secretKey(session,
+ keyID, "TlsRsaPremasterSecret", 48 << 3, attributes);
+ } catch (PKCS11Exception e) {
+ throw new ProviderException(
+ "Could not generate premaster secret", e);
+ }
+ }
+
+ return secretKey;
+ }
+
}
final class ConstructKeys {
--- a/jdk/src/share/classes/sun/security/pkcs11/P11TlsRsaPremasterSecretGenerator.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/src/share/classes/sun/security/pkcs11/P11TlsRsaPremasterSecretGenerator.java Wed Apr 09 17:17:03 2014 -0700
@@ -73,7 +73,7 @@
protected void engineInit(AlgorithmParameterSpec params,
SecureRandom random) throws InvalidAlgorithmParameterException {
- if (params instanceof TlsRsaPremasterSecretParameterSpec == false) {
+ if (!(params instanceof TlsRsaPremasterSecretParameterSpec)) {
throw new InvalidAlgorithmParameterException(MSG);
}
this.spec = (TlsRsaPremasterSecretParameterSpec)params;
@@ -83,38 +83,32 @@
throw new InvalidParameterException(MSG);
}
+ // Only can be used in client side to generate TLS RSA premaster secret.
protected SecretKey engineGenerateKey() {
if (spec == null) {
throw new IllegalStateException
("TlsRsaPremasterSecretGenerator must be initialized");
}
- byte[] b = spec.getEncodedSecret();
- if (b == null) {
- CK_VERSION version = new CK_VERSION(
+ CK_VERSION version = new CK_VERSION(
spec.getMajorVersion(), spec.getMinorVersion());
- Session session = null;
- try {
- session = token.getObjSession();
- CK_ATTRIBUTE[] attributes = token.getAttributes(
- O_GENERATE, CKO_SECRET_KEY,
- CKK_GENERIC_SECRET, new CK_ATTRIBUTE[0]);
- long keyID = token.p11.C_GenerateKey(session.id(),
- new CK_MECHANISM(mechanism, version), attributes);
- SecretKey key = P11Key.secretKey(session,
- keyID, "TlsRsaPremasterSecret", 48 << 3, attributes);
- return key;
- } catch (PKCS11Exception e) {
- throw new ProviderException(
- "Could not generate premaster secret", e);
- } finally {
- token.releaseSession(session);
- }
+ Session session = null;
+ try {
+ session = token.getObjSession();
+ CK_ATTRIBUTE[] attributes = token.getAttributes(
+ O_GENERATE, CKO_SECRET_KEY,
+ CKK_GENERIC_SECRET, new CK_ATTRIBUTE[0]);
+ long keyID = token.p11.C_GenerateKey(session.id(),
+ new CK_MECHANISM(mechanism, version), attributes);
+ SecretKey key = P11Key.secretKey(session,
+ keyID, "TlsRsaPremasterSecret", 48 << 3, attributes);
+ return key;
+ } catch (PKCS11Exception e) {
+ throw new ProviderException(
+ "Could not generate premaster secret", e);
+ } finally {
+ token.releaseSession(session);
}
-
- // Won't worry, the TlsRsaPremasterSecret will be soon converted to
- // TlsMasterSecret.
- return new SecretKeySpec(b, "TlsRsaPremasterSecret");
}
}
--- a/jdk/src/share/classes/sun/security/pkcs11/Token.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/src/share/classes/sun/security/pkcs11/Token.java Wed Apr 09 17:17:03 2014 -0700
@@ -36,6 +36,7 @@
import sun.security.jca.JCAUtil;
import sun.security.pkcs11.wrapper.*;
+import static sun.security.pkcs11.TemplateManager.*;
import static sun.security.pkcs11.wrapper.PKCS11Constants.*;
/**
@@ -122,6 +123,9 @@
private final static CK_MECHANISM_INFO INVALID_MECH =
new CK_MECHANISM_INFO(0, 0, 0);
+ // flag indicating whether the token supports raw secret key material import
+ private Boolean supportsRawSecretKeyImport;
+
Token(SunPKCS11 provider) throws PKCS11Exception {
this.provider = provider;
this.removable = provider.removable;
@@ -160,6 +164,36 @@
return writeProtected;
}
+ // return whether the token supports raw secret key material import
+ boolean supportsRawSecretKeyImport() {
+ if (supportsRawSecretKeyImport == null) {
+ SecureRandom random = JCAUtil.getSecureRandom();
+ byte[] encoded = new byte[48];
+ random.nextBytes(encoded);
+
+ CK_ATTRIBUTE[] attributes = new CK_ATTRIBUTE[3];
+ attributes[0] = new CK_ATTRIBUTE(CKA_CLASS, CKO_SECRET_KEY);
+ attributes[1] = new CK_ATTRIBUTE(CKA_KEY_TYPE, CKK_GENERIC_SECRET);
+ attributes[2] = new CK_ATTRIBUTE(CKA_VALUE, encoded);
+
+ Session session = null;
+ try {
+ attributes = getAttributes(O_IMPORT,
+ CKO_SECRET_KEY, CKK_GENERIC_SECRET, attributes);
+ session = getObjSession();
+ long keyID = p11.C_CreateObject(session.id(), attributes);
+
+ supportsRawSecretKeyImport = Boolean.TRUE;
+ } catch (PKCS11Exception e) {
+ supportsRawSecretKeyImport = Boolean.FALSE;
+ } finally {
+ releaseSession(session);
+ }
+ }
+
+ return supportsRawSecretKeyImport;
+ }
+
// return whether we are logged in
// uses cached result if current. session is optional and may be null
boolean isLoggedIn(Session session) throws PKCS11Exception {
--- a/jdk/src/share/classes/sun/security/ssl/RSAClientKeyExchange.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/src/share/classes/sun/security/ssl/RSAClientKeyExchange.java Wed Apr 09 17:17:03 2014 -0700
@@ -48,23 +48,6 @@
*/
final class RSAClientKeyExchange extends HandshakeMessage {
- /**
- * The TLS spec says that the version in the RSA premaster secret must
- * be the maximum version supported by the client (i.e. the version it
- * requested in its client hello version). However, we (and other
- * implementations) used to send the active negotiated version. The
- * system property below allows to toggle the behavior.
- */
- private final static String PROP_NAME =
- "com.sun.net.ssl.rsaPreMasterSecretFix";
-
- /*
- * Default is "false" (old behavior) for compatibility reasons in
- * SSLv3/TLSv1. Later protocols (TLSv1.1+) do not use this property.
- */
- private final static boolean rsaPreMasterSecretFix =
- Debug.getBooleanProperty(PROP_NAME, false);
-
/*
* The following field values were encrypted with the server's public
* key (or temp key from server key exchange msg) and are presented
@@ -88,22 +71,12 @@
}
this.protocolVersion = protocolVersion;
- int major, minor;
-
- if (rsaPreMasterSecretFix || maxVersion.v >= ProtocolVersion.TLS11.v) {
- major = maxVersion.major;
- minor = maxVersion.minor;
- } else {
- major = protocolVersion.major;
- minor = protocolVersion.minor;
- }
-
try {
String s = ((protocolVersion.v >= ProtocolVersion.TLS12.v) ?
"SunTls12RsaPremasterSecret" : "SunTlsRsaPremasterSecret");
KeyGenerator kg = JsseJce.getKeyGenerator(s);
- kg.init(new TlsRsaPremasterSecretParameterSpec(major, minor),
- generator);
+ kg.init(new TlsRsaPremasterSecretParameterSpec(
+ maxVersion.v, protocolVersion.v), generator);
preMaster = kg.generateKey();
Cipher cipher = JsseJce.getCipher(JsseJce.CIPHER_RSA_PKCS1);
@@ -138,18 +111,17 @@
}
}
- Exception failover = null;
- byte[] encoded = null;
try {
Cipher cipher = JsseJce.getCipher(JsseJce.CIPHER_RSA_PKCS1);
// Cannot generate key here, please don't use Cipher.UNWRAP_MODE!
- cipher.init(Cipher.DECRYPT_MODE, privateKey);
- encoded = cipher.doFinal(encrypted);
- } catch (BadPaddingException bpe) {
- failover = bpe;
- encoded = null;
- } catch (IllegalBlockSizeException ibse) {
- // the message it too big to process with RSA
+ cipher.init(Cipher.UNWRAP_MODE, privateKey,
+ new TlsRsaPremasterSecretParameterSpec(
+ maxVersion.v, currentVersion.v),
+ generator);
+ preMaster = (SecretKey)cipher.unwrap(encrypted,
+ "TlsRsaPremasterSecret", Cipher.SECRET_KEY);
+ } catch (InvalidKeyException ibk) {
+ // the message is too big to process with RSA
throw new SSLProtocolException(
"Unable to process PreMasterSecret, may be too big");
} catch (Exception e) {
@@ -160,124 +132,6 @@
}
throw new RuntimeException("Could not generate dummy secret", e);
}
-
- // polish the premaster secret
- preMaster = polishPreMasterSecretKey(
- currentVersion, maxVersion, generator, encoded, failover);
- }
-
- /**
- * To avoid vulnerabilities described by section 7.4.7.1, RFC 5246,
- * treating incorrectly formatted message blocks and/or mismatched
- * version numbers in a manner indistinguishable from correctly
- * formatted RSA blocks.
- *
- * RFC 5246 describes the approach as :
- *
- * 1. Generate a string R of 48 random bytes
- *
- * 2. Decrypt the message to recover the plaintext M
- *
- * 3. If the PKCS#1 padding is not correct, or the length of message
- * M is not exactly 48 bytes:
- * pre_master_secret = R
- * else If ClientHello.client_version <= TLS 1.0, and version
- * number check is explicitly disabled:
- * premaster secret = M
- * else If M[0..1] != ClientHello.client_version:
- * premaster secret = R
- * else:
- * premaster secret = M
- *
- * Note that #2 has completed before the call of this method.
- */
- private SecretKey polishPreMasterSecretKey(ProtocolVersion currentVersion,
- ProtocolVersion clientHelloVersion, SecureRandom generator,
- byte[] encoded, Exception failoverException) {
-
- this.protocolVersion = clientHelloVersion;
- if (generator == null) {
- generator = new SecureRandom();
- }
- byte[] random = new byte[48];
- generator.nextBytes(random);
-
- if (failoverException == null && encoded != null) {
- // check the length
- if (encoded.length != 48) {
- if (debug != null && Debug.isOn("handshake")) {
- System.out.println(
- "incorrect length of premaster secret: " +
- encoded.length);
- }
-
- return generatePreMasterSecret(
- clientHelloVersion, random, generator);
- }
-
- if (clientHelloVersion.major != encoded[0] ||
- clientHelloVersion.minor != encoded[1]) {
-
- if (clientHelloVersion.v <= ProtocolVersion.TLS10.v &&
- currentVersion.major == encoded[0] &&
- currentVersion.minor == encoded[1]) {
- /*
- * For compatibility, we maintain the behavior that the
- * version in pre_master_secret can be the negotiated
- * version for TLS v1.0 and SSL v3.0.
- */
- this.protocolVersion = currentVersion;
- } else {
- if (debug != null && Debug.isOn("handshake")) {
- System.out.println("Mismatching Protocol Versions, " +
- "ClientHello.client_version is " +
- clientHelloVersion +
- ", while PreMasterSecret.client_version is " +
- ProtocolVersion.valueOf(encoded[0], encoded[1]));
- }
-
- encoded = random;
- }
- }
-
- return generatePreMasterSecret(
- clientHelloVersion, encoded, generator);
- }
-
- if (debug != null && Debug.isOn("handshake") &&
- failoverException != null) {
- System.out.println("Error decrypting premaster secret:");
- failoverException.printStackTrace(System.out);
- }
-
- return generatePreMasterSecret(clientHelloVersion, random, generator);
- }
-
- // generate a premaster secret with the specified version number
- private static SecretKey generatePreMasterSecret(
- ProtocolVersion version, byte[] encodedSecret,
- SecureRandom generator) {
-
- if (debug != null && Debug.isOn("handshake")) {
- System.out.println("Generating a random fake premaster secret");
- }
-
- try {
- String s = ((version.v >= ProtocolVersion.TLS12.v) ?
- "SunTls12RsaPremasterSecret" : "SunTlsRsaPremasterSecret");
- KeyGenerator kg = JsseJce.getKeyGenerator(s);
- kg.init(new TlsRsaPremasterSecretParameterSpec(
- version.major, version.minor, encodedSecret), generator);
- return kg.generateKey();
- } catch (InvalidAlgorithmParameterException |
- NoSuchAlgorithmException iae) {
- // unlikely to happen, otherwise, must be a provider exception
- if (debug != null && Debug.isOn("handshake")) {
- System.out.println("RSA premaster secret generation error:");
- iae.printStackTrace(System.out);
- }
- throw new RuntimeException("Could not generate dummy secret", iae);
- }
}
@Override
--- a/jdk/src/share/classes/sun/security/util/KeyUtil.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/src/share/classes/sun/security/util/KeyUtil.java Wed Apr 09 17:17:03 2014 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -32,6 +32,7 @@
import java.security.interfaces.ECKey;
import java.security.interfaces.RSAKey;
import java.security.interfaces.DSAKey;
+import java.security.SecureRandom;
import java.security.spec.KeySpec;
import javax.crypto.SecretKey;
import javax.crypto.interfaces.DHKey;
@@ -157,6 +158,79 @@
}
/**
+ * Check the format of TLS PreMasterSecret.
+ * <P>
+ * To avoid vulnerabilities described by section 7.4.7.1, RFC 5246,
+ * treating incorrectly formatted message blocks and/or mismatched
+ * version numbers in a manner indistinguishable from correctly
+ * formatted RSA blocks.
+ *
+ * RFC 5246 describes the approach as :
+ *
+ * 1. Generate a string R of 48 random bytes
+ *
+ * 2. Decrypt the message to recover the plaintext M
+ *
+ * 3. If the PKCS#1 padding is not correct, or the length of message
+ * M is not exactly 48 bytes:
+ * pre_master_secret = R
+ * else If ClientHello.client_version <= TLS 1.0, and version
+ * number check is explicitly disabled:
+ * premaster secret = M
+ * else If M[0..1] != ClientHello.client_version:
+ * premaster secret = R
+ * else:
+ * premaster secret = M
+ *
+ * Note that #2 should have completed before the call to this method.
+ *
+ * @param clientVersion the version of the TLS protocol by which the
+ * client wishes to communicate during this session
+ * @param serverVersion the negotiated version of the TLS protocol which
+ * contains the lower of that suggested by the client in the client
+ * hello and the highest supported by the server.
+ * @param encoded the encoded key in its "RAW" encoding format
+ * @param isFailover whether or not the previous decryption of the
+ * encrypted PreMasterSecret message run into problem
+ * @return the polished PreMasterSecret key in its "RAW" encoding format
+ */
+ public static byte[] checkTlsPreMasterSecretKey(
+ int clientVersion, int serverVersion, SecureRandom random,
+ byte[] encoded, boolean isFailOver) {
+
+ if (random == null) {
+ random = new SecureRandom();
+ }
+ byte[] replacer = new byte[48];
+ random.nextBytes(replacer);
+
+ if (!isFailOver && (encoded != null)) {
+ // check the length
+ if (encoded.length != 48) {
+ // private, don't need to clone the byte array.
+ return replacer;
+ }
+
+ int encodedVersion =
+ ((encoded[0] & 0xFF) << 8) | (encoded[1] & 0xFF);
+ if (clientVersion != encodedVersion) {
+ if (clientVersion > 0x0301 || // 0x0301: TLSv1
+ serverVersion != encodedVersion) {
+ encoded = replacer;
+ } // Otherwise, For compatibility, we maintain the behavior
+ // that the version in pre_master_secret can be the
+ // negotiated version for TLS v1.0 and SSL v3.0.
+ }
+
+ // private, don't need to clone the byte array.
+ return encoded;
+ }
+
+ // private, don't need to clone the byte array.
+ return replacer;
+ }
+
+ /**
* Returns whether the Diffie-Hellman public key is valid or not.
*
* Per RFC 2631 and NIST SP800-56A, the following algorithm is used to
--- a/jdk/src/share/classes/sun/tools/java/AmbiguousClass.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/src/share/classes/sun/tools/java/AmbiguousClass.java Wed Apr 09 17:17:03 2014 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1994, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1994, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -34,6 +34,7 @@
* they are subject to change or removal without notice.
*/
+@SuppressWarnings("serial") // JDK implementation class
public
class AmbiguousClass extends ClassNotFound {
/**
--- a/jdk/src/share/classes/sun/tools/java/AmbiguousMember.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/src/share/classes/sun/tools/java/AmbiguousMember.java Wed Apr 09 17:17:03 2014 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1994, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1994, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -35,6 +35,7 @@
* supported API. Code that depends on them does so at its own risk:
* they are subject to change or removal without notice.
*/
+@SuppressWarnings("serial") // JDK implementation class
public
class AmbiguousMember extends Exception {
/**
--- a/jdk/src/share/classes/sun/tools/java/ClassNotFound.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/src/share/classes/sun/tools/java/ClassNotFound.java Wed Apr 09 17:17:03 2014 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1994, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1994, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -33,6 +33,7 @@
* supported API. Code that depends on them does so at its own risk:
* they are subject to change or removal without notice.
*/
+@SuppressWarnings("serial") // JDK implementation class
public
class ClassNotFound extends Exception {
/**
--- a/jdk/src/share/classes/sun/tools/java/CompilerError.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/src/share/classes/sun/tools/java/CompilerError.java Wed Apr 09 17:17:03 2014 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1994, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1994, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -32,7 +32,7 @@
* supported API. Code that depends on them does so at its own risk:
* they are subject to change or removal without notice.
*/
-
+@SuppressWarnings("serial") // JDK implementation class
public
class CompilerError extends Error {
Throwable e;
--- a/jdk/src/share/classes/sun/tools/java/SyntaxError.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/src/share/classes/sun/tools/java/SyntaxError.java Wed Apr 09 17:17:03 2014 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1994, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1994, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -33,7 +33,7 @@
* supported API. Code that depends on them does so at its own risk:
* they are subject to change or removal without notice.
*/
-
+@SuppressWarnings("serial") // JDK implementation class
public
class SyntaxError extends Exception {
}
--- a/jdk/src/share/classes/sun/tools/jconsole/Tab.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/src/share/classes/sun/tools/jconsole/Tab.java Wed Apr 09 17:17:03 2014 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -28,6 +28,7 @@
import java.awt.*;
import javax.swing.*;
+@SuppressWarnings("serial") // JDK implementation class
public abstract class Tab extends JPanel {
private String name;
private Worker worker;
--- a/jdk/src/share/classes/sun/tools/jconsole/inspector/XOperations.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/src/share/classes/sun/tools/jconsole/inspector/XOperations.java Wed Apr 09 17:17:03 2014 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -39,6 +39,7 @@
import sun.tools.jconsole.JConsole;
import sun.tools.jconsole.Messages;
+@SuppressWarnings("serial") // JDK implementation class
public abstract class XOperations extends JPanel implements ActionListener {
public final static String OPERATION_INVOCATION_EVENT =
--- a/jdk/src/share/classes/sun/tools/jconsole/inspector/XTable.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/src/share/classes/sun/tools/jconsole/inspector/XTable.java Wed Apr 09 17:17:03 2014 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -33,6 +33,7 @@
import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableCellRenderer;
+@SuppressWarnings("serial") // JDK implementation class
public abstract class XTable extends JTable {
static final int NAME_COLUMN = 0;
static final int VALUE_COLUMN = 1;
--- a/jdk/src/share/classes/sun/tools/jstat/Jstat.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/src/share/classes/sun/tools/jstat/Jstat.java Wed Apr 09 17:17:03 2014 -0700
@@ -70,16 +70,7 @@
logSamples();
}
} catch (MonitorException e) {
- if (e.getMessage() != null) {
- System.err.println(e.getMessage());
- } else {
- Throwable cause = e.getCause();
- if ((cause != null) && (cause.getMessage() != null)) {
- System.err.println(cause.getMessage());
- } else {
- e.printStackTrace();
- }
- }
+ e.printStackTrace();
System.exit(1);
}
System.exit(0);
--- a/jdk/src/share/classes/sun/tools/jstat/ParserException.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/src/share/classes/sun/tools/jstat/ParserException.java Wed Apr 09 17:17:03 2014 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -31,6 +31,7 @@
* @author Brian Doherty
* @since 1.5
*/
+@SuppressWarnings("serial") // JDK implementation class
public class ParserException extends Exception {
public ParserException() {
--- a/jdk/src/share/classes/sun/tools/jstat/SyntaxException.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/src/share/classes/sun/tools/jstat/SyntaxException.java Wed Apr 09 17:17:03 2014 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -36,6 +36,7 @@
* @author Brian Doherty
* @since 1.5
*/
+@SuppressWarnings("serial") // JDK implementation class
public class SyntaxException extends ParserException {
private String message;
--- a/jdk/src/share/classes/sun/util/resources/TimeZoneNames.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/src/share/classes/sun/util/resources/TimeZoneNames.java Wed Apr 09 17:17:03 2014 -0700
@@ -570,6 +570,9 @@
{"Antarctica/Syowa", new String[] {"Syowa Time", "SYOT",
"Syowa Summer Time", "SYOST",
"Syowa Time", "SYOT"}},
+ {"Antarctica/Troll", new String[] {"Coordinated Universal Time", "UTC",
+ "Central European Summer Time", "CEST",
+ "Troll Time", "ATT"}},
{"Antarctica/Vostok", new String[] {"Vostok Time", "VOST",
"Vostok Summer Time", "VOSST",
"Vostok Time", "VOST"}},
@@ -839,7 +842,7 @@
"Samara Time", "SAMT"}},
{"Europe/San_Marino", CET},
{"Europe/Sarajevo", CET},
- {"Europe/Simferopol", EET},
+ {"Europe/Simferopol", MSK},
{"Europe/Skopje", CET},
{"Europe/Sofia", EET},
{"Europe/Stockholm", CET},
--- a/jdk/src/share/classes/sun/util/resources/de/TimeZoneNames_de.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/src/share/classes/sun/util/resources/de/TimeZoneNames_de.java Wed Apr 09 17:17:03 2014 -0700
@@ -570,6 +570,9 @@
{"Antarctica/Syowa", new String[] {"Syowa Zeit", "SYOT",
"Syowa Sommerzeit", "SYOST",
"Syowa Zeit", "SYOT"}},
+ {"Antarctica/Troll", new String[] {"Koordinierte Universalzeit", "UTC",
+ "Mitteleurop\u00e4ische Sommerzeit", "MESZ",
+ "Troll Time", "ATT"}},
{"Antarctica/Vostok", new String[] {"Vostok Zeit", "VOST",
"Vostok Sommerzeit", "VOSST",
"Vostok Zeit", "VOST"}},
@@ -838,7 +841,7 @@
"Samarische Zeit", "SAMT"}},
{"Europe/San_Marino", CET},
{"Europe/Sarajevo", CET},
- {"Europe/Simferopol", EET},
+ {"Europe/Simferopol", MSK},
{"Europe/Skopje", CET},
{"Europe/Sofia", EET},
{"Europe/Stockholm", CET},
--- a/jdk/src/share/classes/sun/util/resources/es/TimeZoneNames_es.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/src/share/classes/sun/util/resources/es/TimeZoneNames_es.java Wed Apr 09 17:17:03 2014 -0700
@@ -570,6 +570,9 @@
{"Antarctica/Syowa", new String[] {"Hora de Syowa", "SYOT",
"Hora de verano de Syowa", "SYOST",
"Hora de Syowa", "SYOT"}},
+ {"Antarctica/Troll", new String[] {"Hora Universal Coordinada", "UTC",
+ "Hora de verano de Europa Central", "CEST",
+ "Troll Time", "ATT"}},
{"Antarctica/Vostok", new String[] {"Hora de Vostok", "VOST",
"Hora de verano de Vostok", "VOSST",
"Hora de Vostok", "VOST"}},
@@ -838,7 +841,7 @@
"Hora de Samara", "SAMT"}},
{"Europe/San_Marino", CET},
{"Europe/Sarajevo", CET},
- {"Europe/Simferopol", EET},
+ {"Europe/Simferopol", MSK},
{"Europe/Skopje", CET},
{"Europe/Sofia", EET},
{"Europe/Stockholm", CET},
--- a/jdk/src/share/classes/sun/util/resources/fr/TimeZoneNames_fr.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/src/share/classes/sun/util/resources/fr/TimeZoneNames_fr.java Wed Apr 09 17:17:03 2014 -0700
@@ -570,6 +570,9 @@
{"Antarctica/Syowa", new String[] {"Heure de Syowa", "SYOT",
"Heure d'\u00e9t\u00e9 de Syowa", "SYOST",
"Heure de Syowa", "SYOT"}},
+ {"Antarctica/Troll", new String[] {"Temps universel coordonn\u00e9", "UTC",
+ "Heure d'\u00e9t\u00e9 d'Europe centrale", "CEST",
+ "Troll Time", "ATT"}},
{"Antarctica/Vostok", new String[] {"Heure de Vostok", "VOST",
"Heure d'\u00e9t\u00e9 de Vostok", "VOSST",
"Heure de Vostok", "VOST"}},
@@ -838,7 +841,7 @@
"Heure de Samara", "SAMT"}},
{"Europe/San_Marino", CET},
{"Europe/Sarajevo", CET},
- {"Europe/Simferopol", EET},
+ {"Europe/Simferopol", MSK},
{"Europe/Skopje", CET},
{"Europe/Sofia", EET},
{"Europe/Stockholm", CET},
--- a/jdk/src/share/classes/sun/util/resources/it/TimeZoneNames_it.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/src/share/classes/sun/util/resources/it/TimeZoneNames_it.java Wed Apr 09 17:17:03 2014 -0700
@@ -570,6 +570,9 @@
{"Antarctica/Syowa", new String[] {"Ora di Syowa", "SYOT",
"Ora estiva di Syowa", "SYOST",
"Ora di Syowa", "SYOT"}},
+ {"Antarctica/Troll", new String[] {"Tempo universale coordinato", "UTC",
+ "Ora estiva dell'Europa centrale", "CEST",
+ "Troll Time", "ATT"}},
{"Antarctica/Vostok", new String[] {"Ora di Vostok", "VOST",
"Ora estiva di Vostok", "VOSST",
"Ora di Vostok", "VOST"}},
@@ -838,7 +841,7 @@
"Ora di Samara", "SAMT"}},
{"Europe/San_Marino", CET},
{"Europe/Sarajevo", CET},
- {"Europe/Simferopol", EET},
+ {"Europe/Simferopol", MSK},
{"Europe/Skopje", CET},
{"Europe/Sofia", EET},
{"Europe/Stockholm", CET},
--- a/jdk/src/share/classes/sun/util/resources/ja/TimeZoneNames_ja.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/src/share/classes/sun/util/resources/ja/TimeZoneNames_ja.java Wed Apr 09 17:17:03 2014 -0700
@@ -570,6 +570,9 @@
{"Antarctica/Syowa", new String[] {"\u662d\u548c\u57fa\u5730\u6642\u9593", "SYOT",
"\u662d\u548c\u57fa\u5730\u590f\u6642\u9593", "SYOST",
"\u662D\u548C\u57FA\u5730\u6642\u9593", "SYOT"}},
+ {"Antarctica/Troll", new String[] {"\u5354\u5b9a\u4e16\u754c\u6642", "UTC",
+ "\u4e2d\u90e8\u30e8\u30fc\u30ed\u30c3\u30d1\u590f\u6642\u9593", "CEST",
+ "Troll Time", "ATT"}},
{"Antarctica/Vostok", new String[] {"\u30dc\u30b9\u30c8\u30fc\u30af\u57fa\u5730\u6642\u9593", "VOST",
"\u30dc\u30b9\u30c8\u30fc\u30af\u57fa\u5730\u590f\u6642\u9593", "VOSST",
"\u30DC\u30B9\u30C8\u30FC\u30AF\u6642\u9593", "VOST"}},
@@ -838,7 +841,7 @@
"\u30B5\u30DE\u30E9\u6642\u9593", "SAMT"}},
{"Europe/San_Marino", CET},
{"Europe/Sarajevo", CET},
- {"Europe/Simferopol", EET},
+ {"Europe/Simferopol", MSK},
{"Europe/Skopje", CET},
{"Europe/Sofia", EET},
{"Europe/Stockholm", CET},
--- a/jdk/src/share/classes/sun/util/resources/ko/TimeZoneNames_ko.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/src/share/classes/sun/util/resources/ko/TimeZoneNames_ko.java Wed Apr 09 17:17:03 2014 -0700
@@ -570,6 +570,9 @@
{"Antarctica/Syowa", new String[] {"Syowa \uc2dc\uac04", "SYOT",
"Syowa \uc77c\uad11\uc808\uc57d\uc2dc\uac04", "SYOST",
"\uC1FC\uC640 \uD45C\uC900\uC2DC", "SYOT"}},
+ {"Antarctica/Troll", new String[] {"\uc138\uacc4 \ud45c\uc900\uc2dc", "UTC",
+ "\uc911\uc559 \uc720\ub7fd \uc77c\uad11\uc808\uc57d\uc2dc\uac04", "CEST",
+ "Troll Time", "ATT"}},
{"Antarctica/Vostok", new String[] {"Vostok \uc2dc\uac04", "VOST",
"Vostok \uc77c\uad11\uc808\uc57d\uc2dc\uac04", "VOSST",
"\uBCF4\uC2A4\uD1A1 \uD45C\uC900\uC2DC", "VOST"}},
@@ -838,7 +841,7 @@
"\uC0AC\uB9C8\uB77C \uD45C\uC900\uC2DC", "SAMT"}},
{"Europe/San_Marino", CET},
{"Europe/Sarajevo", CET},
- {"Europe/Simferopol", EET},
+ {"Europe/Simferopol", MSK},
{"Europe/Skopje", CET},
{"Europe/Sofia", EET},
{"Europe/Stockholm", CET},
--- a/jdk/src/share/classes/sun/util/resources/pt/TimeZoneNames_pt_BR.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/src/share/classes/sun/util/resources/pt/TimeZoneNames_pt_BR.java Wed Apr 09 17:17:03 2014 -0700
@@ -570,6 +570,9 @@
{"Antarctica/Syowa", new String[] {"Fuso hor\u00e1rio de Syowa", "SYOT",
"Fuso hor\u00e1rio de ver\u00e3o de Syowa", "SYOST",
"Hor\u00E1rio de Syowa", "SYOT"}},
+ {"Antarctica/Troll", new String[] {"Tempo universal coordenado", "UTC",
+ "Fuso hor\u00e1rio de ver\u00e3o da Europa Central", "CEST",
+ "Troll Time", "ATT"}},
{"Antarctica/Vostok", new String[] {"Fuso hor\u00e1rio de Vostok", "VOST",
"Fuso hor\u00e1rio de ver\u00e3o de Vostok", "VOSST",
"Hor\u00E1rio de Vostok", "VOST"}},
@@ -838,7 +841,7 @@
"Hor\u00E1rio de Samara", "SAMT"}},
{"Europe/San_Marino", CET},
{"Europe/Sarajevo", CET},
- {"Europe/Simferopol", EET},
+ {"Europe/Simferopol", MSK},
{"Europe/Skopje", CET},
{"Europe/Sofia", EET},
{"Europe/Stockholm", CET},
--- a/jdk/src/share/classes/sun/util/resources/sv/TimeZoneNames_sv.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/src/share/classes/sun/util/resources/sv/TimeZoneNames_sv.java Wed Apr 09 17:17:03 2014 -0700
@@ -570,6 +570,9 @@
{"Antarctica/Syowa", new String[] {"Syowa, normaltid", "SYOT",
"Syowa, sommartid", "SYOST",
"Syowa-tid", "SYOT"}},
+ {"Antarctica/Troll", new String[] {"Koordinerad universell tid", "UTC",
+ "Centraleuropeisk sommartid", "CEST",
+ "Troll Time", "ATT"}},
{"Antarctica/Vostok", new String[] {"Vostok, normaltid", "VOST",
"Vostok, sommartid", "VOSST",
"Vostok-tid", "VOST"}},
@@ -838,7 +841,7 @@
"Samara-tid", "SAMT"}},
{"Europe/San_Marino", CET},
{"Europe/Sarajevo", CET},
- {"Europe/Simferopol", EET},
+ {"Europe/Simferopol", MSK},
{"Europe/Skopje", CET},
{"Europe/Sofia", EET},
{"Europe/Stockholm", CET},
--- a/jdk/src/share/classes/sun/util/resources/zh/TimeZoneNames_zh_CN.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/src/share/classes/sun/util/resources/zh/TimeZoneNames_zh_CN.java Wed Apr 09 17:17:03 2014 -0700
@@ -570,6 +570,9 @@
{"Antarctica/Syowa", new String[] {"Syowa \u65f6\u95f4", "SYOT",
"Syowa \u590f\u4ee4\u65f6", "SYOST",
"Syowa \u65F6\u95F4", "SYOT"}},
+ {"Antarctica/Troll", new String[] {"\u534f\u8c03\u4e16\u754c\u65f6\u95f4", "UTC",
+ "\u4e2d\u6b27\u590f\u4ee4\u65f6", "CEST",
+ "Troll Time", "ATT"}},
{"Antarctica/Vostok", new String[] {"\u83ab\u65af\u6258\u514b\u65f6\u95f4", "VOST",
"\u83ab\u65af\u6258\u514b\u590f\u4ee4\u65f6", "VOSST",
"\u83AB\u65AF\u6258\u514B\u65F6\u95F4", "VOST"}},
@@ -838,7 +841,7 @@
"\u6C99\u9A6C\u62C9\u65F6\u95F4", "SAMT"}},
{"Europe/San_Marino", CET},
{"Europe/Sarajevo", CET},
- {"Europe/Simferopol", EET},
+ {"Europe/Simferopol", MSK},
{"Europe/Skopje", CET},
{"Europe/Sofia", EET},
{"Europe/Stockholm", CET},
--- a/jdk/src/share/classes/sun/util/resources/zh/TimeZoneNames_zh_TW.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/src/share/classes/sun/util/resources/zh/TimeZoneNames_zh_TW.java Wed Apr 09 17:17:03 2014 -0700
@@ -570,6 +570,9 @@
{"Antarctica/Syowa", new String[] {"\u5915\u6b50\u74e6 (Syowa) \u6642\u9593", "SYOT",
"\u5915\u6b50\u74e6 (Syowa) \u590f\u4ee4\u6642\u9593", "SYOST",
"\u5915\u6B50\u74E6 (Syowa) \u6642\u9593", "SYOT"}},
+ {"Antarctica/Troll", new String[] {"\u5354\u8abf\u4e16\u754c\u6642\u9593", "UTC",
+ "\u4e2d\u6b50\u590f\u4ee4\u6642\u9593", "CEST",
+ "Troll Time", "ATT"}},
{"Antarctica/Vostok", new String[] {"\u4f5b\u65af\u6258 (Vostok) \u6642\u9593", "VOST",
"\u4f5b\u65af\u6258 (Vostok) \u590f\u4ee4\u6642\u9593", "VOSST",
"\u4F5B\u65AF\u6258 (Vostok) \u6642\u9593", "VOST"}},
@@ -840,7 +843,7 @@
"\u6C99\u99AC\u62C9\u6642\u9593", "SAMT"}},
{"Europe/San_Marino", CET},
{"Europe/Sarajevo", CET},
- {"Europe/Simferopol", EET},
+ {"Europe/Simferopol", MSK},
{"Europe/Skopje", CET},
{"Europe/Sofia", EET},
{"Europe/Stockholm", CET},
--- a/jdk/src/windows/classes/sun/security/mscapi/RSACipher.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/src/windows/classes/sun/security/mscapi/RSACipher.java Wed Apr 09 17:17:03 2014 -0700
@@ -35,6 +35,8 @@
import javax.crypto.spec.*;
import sun.security.rsa.RSAKeyFactory;
+import sun.security.internal.spec.TlsRsaPremasterSecretParameterSpec;
+import sun.security.util.KeyUtil;
/**
* RSA cipher implementation using the Microsoft Crypto API.
@@ -92,9 +94,16 @@
// the public key, if we were initialized using a public key
private sun.security.mscapi.Key publicKey;
+
// the private key, if we were initialized using a private key
private sun.security.mscapi.Key privateKey;
+ // cipher parameter for TLS RSA premaster secret
+ private AlgorithmParameterSpec spec = null;
+
+ // the source of randomness
+ private SecureRandom random;
+
public RSACipher() {
paddingType = PAD_PKCS1;
}
@@ -155,8 +164,12 @@
throws InvalidKeyException, InvalidAlgorithmParameterException {
if (params != null) {
- throw new InvalidAlgorithmParameterException
- ("Parameters not supported");
+ if (!(params instanceof TlsRsaPremasterSecretParameterSpec)) {
+ throw new InvalidAlgorithmParameterException(
+ "Parameters not supported");
+ }
+ spec = params;
+ this.random = random; // for TLS RSA premaster secret
}
init(opmode, key);
}
@@ -356,39 +369,47 @@
}
// see JCE spec
- protected java.security.Key engineUnwrap(byte[] wrappedKey, String algorithm,
+ protected java.security.Key engineUnwrap(byte[] wrappedKey,
+ String algorithm,
int type) throws InvalidKeyException, NoSuchAlgorithmException {
if (wrappedKey.length > buffer.length) {
throw new InvalidKeyException("Key is too long for unwrapping");
}
- update(wrappedKey, 0, wrappedKey.length);
- try {
- byte[] encoding = doFinal();
-
- switch (type) {
- case Cipher.PUBLIC_KEY:
- return constructPublicKey(encoding, algorithm);
-
- case Cipher.PRIVATE_KEY:
- return constructPrivateKey(encoding, algorithm);
+ boolean isTlsRsaPremasterSecret =
+ algorithm.equals("TlsRsaPremasterSecret");
+ Exception failover = null;
+ byte[] encoded = null;
- case Cipher.SECRET_KEY:
- return constructSecretKey(encoding, algorithm);
-
- default:
- throw new InvalidKeyException("Unknown key type " + type);
+ update(wrappedKey, 0, wrappedKey.length);
+ try {
+ encoded = doFinal();
+ } catch (BadPaddingException e) {
+ if (isTlsRsaPremasterSecret) {
+ failover = e;
+ } else {
+ throw new InvalidKeyException("Unwrapping failed", e);
}
-
- } catch (BadPaddingException e) {
- // should not occur
- throw new InvalidKeyException("Unwrapping failed", e);
-
} catch (IllegalBlockSizeException e) {
// should not occur, handled with length check above
throw new InvalidKeyException("Unwrapping failed", e);
}
+
+ if (isTlsRsaPremasterSecret) {
+ if (!(spec instanceof TlsRsaPremasterSecretParameterSpec)) {
+ throw new IllegalStateException(
+ "No TlsRsaPremasterSecretParameterSpec specified");
+ }
+
+ // polish the TLS premaster secret
+ encoded = KeyUtil.checkTlsPreMasterSecretKey(
+ ((TlsRsaPremasterSecretParameterSpec)spec).getClientVersion(),
+ ((TlsRsaPremasterSecretParameterSpec)spec).getServerVersion(),
+ random, encoded, (failover != null));
+ }
+
+ return constructKey(encoded, algorithm, type);
}
// see JCE spec
@@ -452,6 +473,22 @@
return new SecretKeySpec(encodedKey, encodedKeyAlgorithm);
}
+ private static Key constructKey(byte[] encodedKey,
+ String encodedKeyAlgorithm,
+ int keyType) throws InvalidKeyException, NoSuchAlgorithmException {
+
+ switch (keyType) {
+ case Cipher.PUBLIC_KEY:
+ return constructPublicKey(encodedKey, encodedKeyAlgorithm);
+ case Cipher.PRIVATE_KEY:
+ return constructPrivateKey(encodedKey, encodedKeyAlgorithm);
+ case Cipher.SECRET_KEY:
+ return constructSecretKey(encodedKey, encodedKeyAlgorithm);
+ default:
+ throw new InvalidKeyException("Unknown key type " + keyType);
+ }
+ }
+
/*
* Encrypt/decrypt a data buffer using Microsoft Crypto API with HCRYPTKEY.
* It expects and returns ciphertext data in big-endian form.
--- a/jdk/test/ProblemList.txt Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/test/ProblemList.txt Wed Apr 09 17:17:03 2014 -0700
@@ -273,4 +273,7 @@
# 8031482
sun/tools/jcmd/TestJcmdSanity.java windows-all
+# 8033104
+sun/jvmstat/monitor/MonitoredVm/CR6672135.java generic-all
+
############################################################################
--- a/jdk/test/TEST.groups Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/test/TEST.groups Wed Apr 09 17:17:03 2014 -0700
@@ -102,7 +102,6 @@
jdk_net = \
java/net \
com/sun/net/httpserver \
- com/oracle/net \
sun/net
jdk_time = \
--- a/jdk/test/com/oracle/net/Sanity.java Wed Apr 09 09:20:54 2014 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,142 +0,0 @@
-/*
- * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-import com.oracle.net.Sdp;
-
-import java.net.*;
-import java.io.*;
-import java.nio.channels.*;
-import java.util.*;
-
-/**
- * Exercise com.oracle.net.Sdp with each IP address plumbed to InfiniBand
- * interfaces listed in a given file.
- */
-
-public class Sanity {
- public static void main(String[] args) throws Exception {
- // The file is a list of interfaces to test.
- Scanner s = new Scanner(new File(args[0]));
- try {
- while (s.hasNextLine()) {
- String link = s.nextLine();
- NetworkInterface ni = NetworkInterface.getByName(link);
- if (ni != null) {
- Enumeration<InetAddress> addrs = ni.getInetAddresses();
- while (addrs.hasMoreElements()) {
- InetAddress addr = addrs.nextElement();
- System.out.format("Testing %s: %s\n", link, addr.getHostAddress());
- test(addr);
- }
- }
- }
- } finally {
- s.close();
- }
- }
-
- static void test(InetAddress addr) throws Exception {
- // Test SocketChannel and ServerSocketChannel
- ServerSocketChannel ssc = Sdp.openServerSocketChannel();
- try {
- ssc.socket().bind(new InetSocketAddress(addr, 0));
- int port = ssc.socket().getLocalPort();
-
- // SocketChannel.connect (implicit bind)
- SocketChannel client = Sdp.openSocketChannel();
- try {
- client.connect(new InetSocketAddress(addr, port));
- SocketChannel peer = ssc.accept();
- try {
- testConnection(Channels.newOutputStream(client),
- Channels.newInputStream(peer));
- } finally {
- peer.close();
- }
- } finally {
- client.close();
- }
-
- // SocketChannel.connect (explicit bind)
- client = Sdp.openSocketChannel();
- try {
- client.socket().bind(new InetSocketAddress(addr, 0));
- client.connect(new InetSocketAddress(addr, port));
- ssc.accept().close();
- } finally {
- client.close();
- }
- } finally {
- ssc.close();
- }
-
- // Test Socket and ServerSocket
- ServerSocket ss = Sdp.openServerSocket();
- try {
- ss.bind(new InetSocketAddress(addr, 0));
- int port = ss.getLocalPort();
-
- // Socket.connect (implicit bind)
- Socket s = Sdp.openSocket();
- try {
- s.connect(new InetSocketAddress(addr, port));
- Socket peer = ss.accept();
- try {
- testConnection(s.getOutputStream(), peer.getInputStream());
- } finally {
- peer.close();
- }
- } finally {
- s.close();
- }
-
- // Socket.connect (explicit bind)
- s = Sdp.openSocket();
- try {
- s.bind(new InetSocketAddress(addr, 0));
- s.connect(new InetSocketAddress(addr, port));
- ss.accept().close();
- } finally {
- s.close();
- }
- } finally {
- ss.close();
- }
- }
-
- static void testConnection(OutputStream out, InputStream in)
- throws IOException
- {
- byte[] msg = "hello".getBytes();
- out.write(msg);
-
- byte[] ba = new byte[100];
- int nread = 0;
- while (nread < msg.length) {
- int n = in.read(ba);
- if (n < 0)
- throw new IOException("EOF not expected!");
- nread += n;
- }
- }
-}
--- a/jdk/test/com/oracle/net/sanity.sh Wed Apr 09 09:20:54 2014 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,66 +0,0 @@
-#
-# Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#
-
-# @test
-# @bug 6965072
-# @summary Unit test for SDP support
-# @build Sanity
-# @run shell sanity.sh
-
-IB_LINKS=ib.links
-
-OS=`uname -s`
-case "$OS" in
- SunOS )
- /usr/sbin/dladm show-part -o LINK -p > ${IB_LINKS}
- if [ $? != 0 ]; then
- echo "Unable to get InfiniBand parition link information"
- exit 0
- fi
- ;;
- Linux )
- if [ ! -f /proc/net/sdp ]; then
- echo "InfiniBand SDP module not installed"
- exit 0
- fi
- egrep "^[ \t]+ib" /proc/net/dev|cut -d':' -f1|tr -d '\t ' > ${IB_LINKS}
- ;;
- * )
- echo "This test only runs on Solaris or Linux"
- exit 0
- ;;
-esac
-
-if [ -z "$TESTJAVA" ]; then
- JAVA=java
- TESTCLASSES=.
- TESTSRC=.
-else
- JAVA="${TESTJAVA}/bin/java"
-fi
-
-CLASSPATH=${TESTCLASSES}:${TESTSRC}
-export CLASSPATH
-
-# Run sanity test (IPv4-only for now)
-$JAVA ${TESTVMOPTS} -Djava.net.preferIPv4Stack=true Sanity ${IB_LINKS}
--- a/jdk/test/com/sun/crypto/provider/TLS/TestPremaster.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/test/com/sun/crypto/provider/TLS/TestPremaster.java Wed Apr 09 17:17:03 2014 -0700
@@ -33,6 +33,7 @@
import javax.crypto.KeyGenerator;
import javax.crypto.SecretKey;
+import java.util.Formatter;
import sun.security.internal.spec.TlsRsaPremasterSecretParameterSpec;
@@ -52,27 +53,51 @@
System.out.println("OK: " + e);
}
- test(kg, 3, 0);
- test(kg, 3, 1);
- test(kg, 3, 2);
- test(kg, 4, 0);
+ int[] protocolVersions = {0x0300, 0x0301, 0x0302, 0x0400};
+ for (int clientVersion : protocolVersions) {
+ for (int serverVersion : protocolVersions) {
+ test(kg, clientVersion, serverVersion);
+ if (serverVersion >= clientVersion) {
+ break;
+ }
+ }
+ }
System.out.println("Done.");
}
- private static void test(KeyGenerator kg, int major, int minor)
- throws Exception {
+ private static void test(KeyGenerator kg,
+ int clientVersion, int serverVersion) throws Exception {
- kg.init(new TlsRsaPremasterSecretParameterSpec(major, minor));
+ System.out.printf(
+ "Testing RSA pre-master secret key generation between " +
+ "client (0x%04X) and server(0x%04X)%n",
+ clientVersion, serverVersion);
+ kg.init(new TlsRsaPremasterSecretParameterSpec(
+ clientVersion, serverVersion));
+
SecretKey key = kg.generateKey();
byte[] encoded = key.getEncoded();
- if (encoded.length != 48) {
- throw new Exception("length: " + encoded.length);
- }
- if ((encoded[0] != major) || (encoded[1] != minor)) {
- throw new Exception("version mismatch: " + encoded[0] +
- "." + encoded[1]);
- }
- System.out.println("OK: " + major + "." + minor);
+ if (encoded != null) { // raw key material may be not extractable
+ if (encoded.length != 48) {
+ throw new Exception("length: " + encoded.length);
+ }
+ int v = versionOf(encoded[0], encoded[1]);
+ if (clientVersion != v) {
+ if (serverVersion != v || clientVersion >= 0x0302) {
+ throw new Exception(String.format(
+ "version mismatch: (0x%04X) rather than (0x%04X) " +
+ "is used in pre-master secret", v, clientVersion));
+ }
+ System.out.printf("Use compatible version (0x%04X)%n", v);
+ }
+ System.out.println("Passed, version matches!");
+ } else {
+ System.out.println("Raw key material is not extractable");
+ }
+ }
+
+ private static int versionOf(int major, int minor) {
+ return ((major & 0xFF) << 8) | (minor & 0xFF);
}
}
--- a/jdk/test/com/sun/jdi/SimulResumerTest.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/test/com/sun/jdi/SimulResumerTest.java Wed Apr 09 17:17:03 2014 -0700
@@ -177,12 +177,18 @@
List<StackFrame> frames = thr.frames();
// no failure return value here; could cause an NPE
+ kind = "frames(0, size - 1)";
+ System.out.println("kind = " + kind);
int nframes = frames.size();
- if (nframes > 0) {
- // hmm, how could it ever be 0?
- kind = "frames(0, size - 1)";
- System.out.println("kind = " + kind);
- thr.frames(0, frames.size() - 1);
+ while (nframes > 0) {
+ try {
+ thr.frames(0, nframes - 1);
+ break;
+ } catch (IndexOutOfBoundsException iobe) {
+ // 6815126. let's try to get less frames
+ iobe.printStackTrace();
+ nframes--;
+ }
}
kind = "frameCount()";
--- a/jdk/test/java/lang/management/MemoryMXBean/LowMemoryTest2.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/test/java/lang/management/MemoryMXBean/LowMemoryTest2.java Wed Apr 09 17:17:03 2014 -0700
@@ -64,6 +64,11 @@
// low memory notification
static class BoundlessLoaderThread extends ClassLoader implements Runnable {
+ private final List<MemoryPoolMXBean> pools;
+
+ public BoundlessLoaderThread(List<MemoryPoolMXBean> pools) {
+ this.pools = pools;
+ }
static int count = 100000;
@@ -139,26 +144,29 @@
* Then wait for the memory threshold notification to be received.
*/
public void run() {
- List<MemoryPoolMXBean> pools = ManagementFactory.getMemoryPoolMXBeans();
- boolean thresholdExceeded = false;
-
// Load classes until MemoryPoolMXBean.getUsageThresholdCount() > 0
- while (!thresholdExceeded) {
- // the classes are small so we load 10 at a time
- for (int i=0; i<10; i++) {
- loadNext();
- }
+ boolean isThresholdCountSet = false;
+ try {
+ while (!isThresholdCountSet) {
+ // the classes are small so we load 10 at a time
+ for (int i=0; i<10; i++) {
+ loadNext();
+ }
- // check if the threshold has been exceeded
- for (MemoryPoolMXBean p : pools) {
- if (p.getType() == MemoryType.NON_HEAP &&
- p.isUsageThresholdSupported() &&
- p.getUsageThresholdCount() > 0)
- {
- thresholdExceeded = true;
- break;
+ if (isAnyUsageAboveThreshold(pools)) {
+ // UsageThresholdCount is only updated during GC.
+ // Force GC to update counters.
+ // If we don't force a GC we may get an
+ // OutOfMemoryException before the counters are updated.
+ System.out.println("Force GC");
+ System.gc();
}
+ isThresholdCountSet = isAnyThresholdCountSet(pools);
}
+ } catch (OutOfMemoryError e) {
+ e.printStackTrace();
+ MemoryUtil.printMemoryPools(pools);
+ throw e;
}
System.out.println("thresholdExceeded. Waiting for notification");
@@ -168,16 +176,39 @@
} catch (InterruptedException x) {}
}
}
+
+ private boolean isAnyUsageAboveThreshold(List<MemoryPoolMXBean> pools) {
+ for (MemoryPoolMXBean p : pools) {
+ if (p.isUsageThresholdExceeded()) {
+ System.out.println("isAnyUsageAboveThreshold is true for " + p.getName());
+ MemoryUtil.printMemoryPool(p);
+ return true;
+ }
+ }
+ return false;
+ }
+
+ private boolean isAnyThresholdCountSet(List<MemoryPoolMXBean> pools) {
+ for (MemoryPoolMXBean p : pools) {
+ if (p.getUsageThresholdCount() > 0) {
+ System.out.println("isAnyThresholdCountSet is true for " + p.getName());
+ MemoryUtil.printMemoryPool(p);
+ return true;
+ }
+ }
+ return false;
+ }
}
public static void main(String args[]) {
- List<MemoryPoolMXBean> pools = ManagementFactory.getMemoryPoolMXBeans();
+ // The pools list will only contain the pools that we are interested in.
+ List<MemoryPoolMXBean> pools = new ArrayList<MemoryPoolMXBean>();
// Set threshold of 80% of all NON_HEAP memory pools
// In the Hotspot implementation this means we should get a notification
// if the CodeCache or metaspace fills up.
- for (MemoryPoolMXBean p : pools) {
+ for (MemoryPoolMXBean p : ManagementFactory.getMemoryPoolMXBeans()) {
if (p.getType() == MemoryType.NON_HEAP && p.isUsageThresholdSupported()) {
// set threshold
@@ -190,6 +221,7 @@
long threshold = (max * 80) / 100;
p.setUsageThreshold(threshold);
+ pools.add(p);
System.out.println("Selected memory pool for low memory " +
"detection.");
@@ -209,7 +241,7 @@
// Start the thread loading classes
- Thread thr = new Thread(new BoundlessLoaderThread());
+ Thread thr = new Thread(new BoundlessLoaderThread(pools));
thr.start();
// Wait for the thread to terminate
--- a/jdk/test/java/lang/management/MemoryMXBean/MemoryUtil.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/test/java/lang/management/MemoryMXBean/MemoryUtil.java Wed Apr 09 17:17:03 2014 -0700
@@ -54,6 +54,8 @@
pool.getUsage());
System.out.println(INDENT + "Threshold: " +
(pool.isUsageThresholdSupported() ? pool.getUsageThreshold() : -1));
+ System.out.println(INDENT + "ThresholdCount: " +
+ (pool.isUsageThresholdSupported() ? pool.getUsageThresholdCount() : -1));
System.out.print(INDENT + "Manager = [");
String[] mgrs = pool.getMemoryManagerNames();
for (int i = 0; i < mgrs.length; i++) {
--- a/jdk/test/java/net/URI/Test.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/test/java/net/URI/Test.java Wed Apr 09 17:17:03 2014 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -1367,6 +1367,17 @@
cmp0(u, v, true);
}
+ static void eq(String expected, String actual) {
+ if (expected == null && actual == null) {
+ return;
+ }
+ if (expected != null && expected.equals(actual)) {
+ return;
+ }
+ throw new AssertionError(String.format(
+ "Strings are not equal: '%s', '%s'", expected, actual));
+ }
+
static void eqeq(URI u, URI v) {
testCount++;
if (u != v)
@@ -1588,7 +1599,12 @@
// miscellaneous bugs/rfes that don't fit in with the test framework
static void bugs() {
- // 6339649 - include detail message from nested exception
+ b6339649();
+ b8037396();
+ }
+
+ // 6339649 - include detail message from nested exception
+ private static void b6339649() {
try {
URI uri = URI.create("http://nowhere.net/should not be permitted");
} catch (IllegalArgumentException e) {
@@ -1598,6 +1614,39 @@
}
}
+ private static void b8037396() {
+
+ // primary checks:
+
+ URI u;
+ try {
+ u = new URI("http", "example.org", "/[a b]", "[a b]", "[a b]");
+ } catch (URISyntaxException e) {
+ throw new AssertionError("shouldn't ever happen", e);
+ }
+ eq("/[a b]", u.getPath());
+ eq("[a b]", u.getQuery());
+ eq("[a b]", u.getFragment());
+
+ // additional checks:
+ // * '%' symbols are still decoded outside square brackets
+ // * the getRawXXX() functionality left intact
+
+ try {
+ u = new URI("http", "example.org", "/a b[c d]", "a b[c d]", "a b[c d]");
+ } catch (URISyntaxException e) {
+ throw new AssertionError("shouldn't ever happen", e);
+ }
+
+ eq("/a b[c d]", u.getPath());
+ eq("a b[c d]", u.getQuery());
+ eq("a b[c d]", u.getFragment());
+
+ eq("/a%20b%5Bc%20d%5D", u.getRawPath());
+ eq("a%20b[c%20d]", u.getRawQuery());
+ eq("a%20b[c%20d]", u.getRawFragment());
+ }
+
public static void main(String[] args) throws Exception {
switch (args.length) {
--- a/jdk/test/java/time/tck/java/time/format/TCKDateTimeFormatter.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/test/java/time/tck/java/time/format/TCKDateTimeFormatter.java Wed Apr 09 17:17:03 2014 -0700
@@ -254,14 +254,20 @@
assertEquals(parsed.isSupported(YEAR), false); // not in the list of resolverFields
}
- @Test(expectedExceptions = NullPointerException.class)
+ @Test
public void test_resolverFields_Array_null() throws Exception {
- DateTimeFormatter.ISO_DATE.withResolverFields((TemporalField[]) null);
+ DateTimeFormatter f = DateTimeFormatter.ISO_DATE.withResolverFields(MONTH_OF_YEAR);
+ assertEquals(f.getResolverFields().size(), 1);
+ f = f.withResolverFields((TemporalField[]) null);
+ assertEquals(f.getResolverFields(), null);
}
- @Test(expectedExceptions = NullPointerException.class)
+ @Test
public void test_resolverFields_Set_null() throws Exception {
- DateTimeFormatter.ISO_DATE.withResolverFields((Set<TemporalField>) null);
+ DateTimeFormatter f = DateTimeFormatter.ISO_DATE.withResolverFields(MONTH_OF_YEAR);
+ assertEquals(f.getResolverFields().size(), 1);
+ f = f.withResolverFields((Set<TemporalField>) null);
+ assertEquals(f.getResolverFields(), null);
}
//-----------------------------------------------------------------------
--- a/jdk/test/java/util/regex/RegExTest.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/test/java/util/regex/RegExTest.java Wed Apr 09 17:17:03 2014 -0700
@@ -32,7 +32,7 @@
* 6358731 6178785 6284152 6231989 6497148 6486934 6233084 6504326 6635133
* 6350801 6676425 6878475 6919132 6931676 6948903 6990617 7014645 7039066
* 7067045 7014640 7189363 8007395 8013252 8013254 8012646 8023647 6559590
- * 8027645 8035076
+ * 8027645 8035076 8039124
*/
import java.util.regex.*;
@@ -75,7 +75,10 @@
// Substitition tests on randomly generated sequences
globalSubstitute();
stringbufferSubstitute();
+ stringbuilderSubstitute();
+
substitutionBasher();
+ substitutionBasher2();
// Canonical Equivalence
ceTest();
@@ -296,10 +299,12 @@
final Matcher m = Pattern.compile("xyz").matcher("xyz");
m.matches();
- check(new Runnable() { public void run() { m.appendTail(null);}});
+ check(new Runnable() { public void run() { m.appendTail((StringBuffer)null);}});
+ check(new Runnable() { public void run() { m.appendTail((StringBuilder)null);}});
check(new Runnable() { public void run() { m.replaceAll(null);}});
check(new Runnable() { public void run() { m.replaceFirst(null);}});
- check(new Runnable() { public void run() { m.appendReplacement(null, null);}});
+ check(new Runnable() { public void run() { m.appendReplacement((StringBuffer)null, null);}});
+ check(new Runnable() { public void run() { m.appendReplacement((StringBuilder)null, null);}});
check(new Runnable() { public void run() { m.reset(null);}});
check(new Runnable() { public void run() { Matcher.quoteReplacement(null);}});
//check(new Runnable() { public void run() { m.usePattern(null);}});
@@ -2973,6 +2978,286 @@
report("SB Substitution");
}
+ /**
+ * Tests the usage of Matcher.appendReplacement() with literal
+ * and group substitutions.
+ */
+ private static void stringbuilderSubstitute() throws Exception {
+ // SB substitution with literal
+ String blah = "zzzblahzzz";
+ Pattern p = Pattern.compile("blah");
+ Matcher m = p.matcher(blah);
+ StringBuilder result = new StringBuilder();
+ try {
+ m.appendReplacement(result, "blech");
+ failCount++;
+ } catch (IllegalStateException e) {
+ }
+ m.find();
+ m.appendReplacement(result, "blech");
+ if (!result.toString().equals("zzzblech"))
+ failCount++;
+
+ m.appendTail(result);
+ if (!result.toString().equals("zzzblechzzz"))
+ failCount++;
+
+ // SB substitution with groups
+ blah = "zzzabcdzzz";
+ p = Pattern.compile("(ab)(cd)*");
+ m = p.matcher(blah);
+ result = new StringBuilder();
+ try {
+ m.appendReplacement(result, "$1");
+ failCount++;
+ } catch (IllegalStateException e) {
+ }
+ m.find();
+ m.appendReplacement(result, "$1");
+ if (!result.toString().equals("zzzab"))
+ failCount++;
+
+ m.appendTail(result);
+ if (!result.toString().equals("zzzabzzz"))
+ failCount++;
+
+ // SB substitution with 3 groups
+ blah = "zzzabcdcdefzzz";
+ p = Pattern.compile("(ab)(cd)*(ef)");
+ m = p.matcher(blah);
+ result = new StringBuilder();
+ try {
+ m.appendReplacement(result, "$1w$2w$3");
+ failCount++;
+ } catch (IllegalStateException e) {
+ }
+ m.find();
+ m.appendReplacement(result, "$1w$2w$3");
+ if (!result.toString().equals("zzzabwcdwef"))
+ failCount++;
+
+ m.appendTail(result);
+ if (!result.toString().equals("zzzabwcdwefzzz"))
+ failCount++;
+
+ // SB substitution with groups and three matches
+ // skipping middle match
+ blah = "zzzabcdzzzabcddzzzabcdzzz";
+ p = Pattern.compile("(ab)(cd*)");
+ m = p.matcher(blah);
+ result = new StringBuilder();
+ try {
+ m.appendReplacement(result, "$1");
+ failCount++;
+ } catch (IllegalStateException e) {
+ }
+ m.find();
+ m.appendReplacement(result, "$1");
+ if (!result.toString().equals("zzzab"))
+ failCount++;
+
+ m.find();
+ m.find();
+ m.appendReplacement(result, "$2");
+ if (!result.toString().equals("zzzabzzzabcddzzzcd"))
+ failCount++;
+
+ m.appendTail(result);
+ if (!result.toString().equals("zzzabzzzabcddzzzcdzzz"))
+ failCount++;
+
+ // Check to make sure escaped $ is ignored
+ blah = "zzzabcdcdefzzz";
+ p = Pattern.compile("(ab)(cd)*(ef)");
+ m = p.matcher(blah);
+ result = new StringBuilder();
+ m.find();
+ m.appendReplacement(result, "$1w\\$2w$3");
+ if (!result.toString().equals("zzzabw$2wef"))
+ failCount++;
+
+ m.appendTail(result);
+ if (!result.toString().equals("zzzabw$2wefzzz"))
+ failCount++;
+
+ // Check to make sure a reference to nonexistent group causes error
+ blah = "zzzabcdcdefzzz";
+ p = Pattern.compile("(ab)(cd)*(ef)");
+ m = p.matcher(blah);
+ result = new StringBuilder();
+ m.find();
+ try {
+ m.appendReplacement(result, "$1w$5w$3");
+ failCount++;
+ } catch (IndexOutOfBoundsException ioobe) {
+ // Correct result
+ }
+
+ // Check double digit group references
+ blah = "zzz123456789101112zzz";
+ p = Pattern.compile("(1)(2)(3)(4)(5)(6)(7)(8)(9)(10)(11)");
+ m = p.matcher(blah);
+ result = new StringBuilder();
+ m.find();
+ m.appendReplacement(result, "$1w$11w$3");
+ if (!result.toString().equals("zzz1w11w3"))
+ failCount++;
+
+ // Check to make sure it backs off $15 to $1 if only three groups
+ blah = "zzzabcdcdefzzz";
+ p = Pattern.compile("(ab)(cd)*(ef)");
+ m = p.matcher(blah);
+ result = new StringBuilder();
+ m.find();
+ m.appendReplacement(result, "$1w$15w$3");
+ if (!result.toString().equals("zzzabwab5wef"))
+ failCount++;
+
+
+ // Supplementary character test
+ // SB substitution with literal
+ blah = toSupplementaries("zzzblahzzz");
+ p = Pattern.compile(toSupplementaries("blah"));
+ m = p.matcher(blah);
+ result = new StringBuilder();
+ try {
+ m.appendReplacement(result, toSupplementaries("blech"));
+ failCount++;
+ } catch (IllegalStateException e) {
+ }
+ m.find();
+ m.appendReplacement(result, toSupplementaries("blech"));
+ if (!result.toString().equals(toSupplementaries("zzzblech")))
+ failCount++;
+ m.appendTail(result);
+ if (!result.toString().equals(toSupplementaries("zzzblechzzz")))
+ failCount++;
+
+ // SB substitution with groups
+ blah = toSupplementaries("zzzabcdzzz");
+ p = Pattern.compile(toSupplementaries("(ab)(cd)*"));
+ m = p.matcher(blah);
+ result = new StringBuilder();
+ try {
+ m.appendReplacement(result, "$1");
+ failCount++;
+ } catch (IllegalStateException e) {
+ }
+ m.find();
+ m.appendReplacement(result, "$1");
+ if (!result.toString().equals(toSupplementaries("zzzab")))
+ failCount++;
+
+ m.appendTail(result);
+ if (!result.toString().equals(toSupplementaries("zzzabzzz")))
+ failCount++;
+
+ // SB substitution with 3 groups
+ blah = toSupplementaries("zzzabcdcdefzzz");
+ p = Pattern.compile(toSupplementaries("(ab)(cd)*(ef)"));
+ m = p.matcher(blah);
+ result = new StringBuilder();
+ try {
+ m.appendReplacement(result, toSupplementaries("$1w$2w$3"));
+ failCount++;
+ } catch (IllegalStateException e) {
+ }
+ m.find();
+ m.appendReplacement(result, toSupplementaries("$1w$2w$3"));
+ if (!result.toString().equals(toSupplementaries("zzzabwcdwef")))
+ failCount++;
+
+ m.appendTail(result);
+ if (!result.toString().equals(toSupplementaries("zzzabwcdwefzzz")))
+ failCount++;
+
+ // SB substitution with groups and three matches
+ // skipping middle match
+ blah = toSupplementaries("zzzabcdzzzabcddzzzabcdzzz");
+ p = Pattern.compile(toSupplementaries("(ab)(cd*)"));
+ m = p.matcher(blah);
+ result = new StringBuilder();
+ try {
+ m.appendReplacement(result, "$1");
+ failCount++;
+ } catch (IllegalStateException e) {
+ }
+ m.find();
+ m.appendReplacement(result, "$1");
+ if (!result.toString().equals(toSupplementaries("zzzab")))
+ failCount++;
+
+ m.find();
+ m.find();
+ m.appendReplacement(result, "$2");
+ if (!result.toString().equals(toSupplementaries("zzzabzzzabcddzzzcd")))
+ failCount++;
+
+ m.appendTail(result);
+ if (!result.toString().equals(toSupplementaries("zzzabzzzabcddzzzcdzzz")))
+ failCount++;
+
+ // Check to make sure escaped $ is ignored
+ blah = toSupplementaries("zzzabcdcdefzzz");
+ p = Pattern.compile(toSupplementaries("(ab)(cd)*(ef)"));
+ m = p.matcher(blah);
+ result = new StringBuilder();
+ m.find();
+ m.appendReplacement(result, toSupplementaries("$1w\\$2w$3"));
+ if (!result.toString().equals(toSupplementaries("zzzabw$2wef")))
+ failCount++;
+
+ m.appendTail(result);
+ if (!result.toString().equals(toSupplementaries("zzzabw$2wefzzz")))
+ failCount++;
+
+ // Check to make sure a reference to nonexistent group causes error
+ blah = toSupplementaries("zzzabcdcdefzzz");
+ p = Pattern.compile(toSupplementaries("(ab)(cd)*(ef)"));
+ m = p.matcher(blah);
+ result = new StringBuilder();
+ m.find();
+ try {
+ m.appendReplacement(result, toSupplementaries("$1w$5w$3"));
+ failCount++;
+ } catch (IndexOutOfBoundsException ioobe) {
+ // Correct result
+ }
+ // Check double digit group references
+ blah = toSupplementaries("zzz123456789101112zzz");
+ p = Pattern.compile("(1)(2)(3)(4)(5)(6)(7)(8)(9)(10)(11)");
+ m = p.matcher(blah);
+ result = new StringBuilder();
+ m.find();
+ m.appendReplacement(result, toSupplementaries("$1w$11w$3"));
+ if (!result.toString().equals(toSupplementaries("zzz1w11w3")))
+ failCount++;
+
+ // Check to make sure it backs off $15 to $1 if only three groups
+ blah = toSupplementaries("zzzabcdcdefzzz");
+ p = Pattern.compile(toSupplementaries("(ab)(cd)*(ef)"));
+ m = p.matcher(blah);
+ result = new StringBuilder();
+ m.find();
+ m.appendReplacement(result, toSupplementaries("$1w$15w$3"));
+ if (!result.toString().equals(toSupplementaries("zzzabwab5wef")))
+ failCount++;
+ // Check nothing has been appended into the output buffer if
+ // the replacement string triggers IllegalArgumentException.
+ p = Pattern.compile("(abc)");
+ m = p.matcher("abcd");
+ result = new StringBuilder();
+ m.find();
+ try {
+ m.appendReplacement(result, ("xyz$g"));
+ failCount++;
+ } catch (IllegalArgumentException iae) {
+ if (result.length() != 0)
+ failCount++;
+ }
+ report("SB Substitution 2");
+ }
+
/*
* 5 groups of characters are created to make a substitution string.
* A base string will be created including random lead chars, the
@@ -3059,6 +3344,93 @@
report("Substitution Basher");
}
+ /*
+ * 5 groups of characters are created to make a substitution string.
+ * A base string will be created including random lead chars, the
+ * substitution string, and random trailing chars.
+ * A pattern containing the 5 groups is searched for and replaced with:
+ * random group + random string + random group.
+ * The results are checked for correctness.
+ */
+ private static void substitutionBasher2() {
+ for (int runs = 0; runs<1000; runs++) {
+ // Create a base string to work in
+ int leadingChars = generator.nextInt(10);
+ StringBuilder baseBuffer = new StringBuilder(100);
+ String leadingString = getRandomAlphaString(leadingChars);
+ baseBuffer.append(leadingString);
+
+ // Create 5 groups of random number of random chars
+ // Create the string to substitute
+ // Create the pattern string to search for
+ StringBuilder bufferToSub = new StringBuilder(25);
+ StringBuilder bufferToPat = new StringBuilder(50);
+ String[] groups = new String[5];
+ for(int i=0; i<5; i++) {
+ int aGroupSize = generator.nextInt(5)+1;
+ groups[i] = getRandomAlphaString(aGroupSize);
+ bufferToSub.append(groups[i]);
+ bufferToPat.append('(');
+ bufferToPat.append(groups[i]);
+ bufferToPat.append(')');
+ }
+ String stringToSub = bufferToSub.toString();
+ String pattern = bufferToPat.toString();
+
+ // Place sub string into working string at random index
+ baseBuffer.append(stringToSub);
+
+ // Append random chars to end
+ int trailingChars = generator.nextInt(10);
+ String trailingString = getRandomAlphaString(trailingChars);
+ baseBuffer.append(trailingString);
+ String baseString = baseBuffer.toString();
+
+ // Create test pattern and matcher
+ Pattern p = Pattern.compile(pattern);
+ Matcher m = p.matcher(baseString);
+
+ // Reject candidate if pattern happens to start early
+ m.find();
+ if (m.start() < leadingChars)
+ continue;
+
+ // Reject candidate if more than one match
+ if (m.find())
+ continue;
+
+ // Construct a replacement string with :
+ // random group + random string + random group
+ StringBuilder bufferToRep = new StringBuilder();
+ int groupIndex1 = generator.nextInt(5);
+ bufferToRep.append("$" + (groupIndex1 + 1));
+ String randomMidString = getRandomAlphaString(5);
+ bufferToRep.append(randomMidString);
+ int groupIndex2 = generator.nextInt(5);
+ bufferToRep.append("$" + (groupIndex2 + 1));
+ String replacement = bufferToRep.toString();
+
+ // Do the replacement
+ String result = m.replaceAll(replacement);
+
+ // Construct expected result
+ StringBuilder bufferToRes = new StringBuilder();
+ bufferToRes.append(leadingString);
+ bufferToRes.append(groups[groupIndex1]);
+ bufferToRes.append(randomMidString);
+ bufferToRes.append(groups[groupIndex2]);
+ bufferToRes.append(trailingString);
+ String expectedResult = bufferToRes.toString();
+
+ // Check results
+ if (!result.equals(expectedResult)) {
+ failCount++;
+ }
+ }
+
+ report("Substitution Basher 2");
+ }
+
/**
* Checks the handling of some escape sequences that the Pattern
* class should process instead of the java compiler. These are
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/security/auth/kerberos/StandardNames.java Wed Apr 09 17:17:03 2014 -0700
@@ -0,0 +1,108 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8035986
+ * @summary KerberosKey algorithm names are not specified
+ */
+
+import sun.security.krb5.EncryptedData;
+
+import javax.crypto.Cipher;
+import javax.security.auth.kerberos.KerberosKey;
+import javax.security.auth.kerberos.KerberosPrincipal;
+import java.util.Locale;
+
+public class StandardNames {
+ static KerberosPrincipal kp = new KerberosPrincipal("user@REALM");
+ static char[] pass = "secret".toCharArray();
+ static byte[] keyBytes = new byte[1];
+
+ public static void main(String[] args) throws Exception {
+ for (EncType e: EncType.values()) {
+ if (e == EncType.e18) {
+ if (Cipher.getMaxAllowedKeyLength("AES") < 256) {
+ System.out.println("Skipping aes256-cts-hmac-sha1-96");
+ continue;
+ }
+ }
+ checkByName(e.name, e);
+ checkByName(e.name.toUpperCase(Locale.US), e);
+ for (String n: e.oldnames) {
+ checkByName(n, e);
+ if (n != null) {
+ checkByName(n.toLowerCase(Locale.US), e);
+ }
+ }
+ checkByEType(e.etype, e.name);
+ }
+ checkByEType(100, "unknown");
+ checkByEType(-1, "private");
+
+ try {
+ System.out.println("unsupported");
+ new KerberosKey(kp, pass, "unsupported");
+ throw new Exception("unsupported");
+ } catch (IllegalArgumentException iae) {
+ // Expected
+ }
+ }
+
+ private static void checkByName(String n, EncType e) throws Exception {
+ System.out.println("CheckByName " + n);
+ KerberosKey k = new KerberosKey(kp, pass, n);
+ if (!k.getAlgorithm().equals(e.name)) throw new Exception(n);
+ if (k.getKeyType() != e.etype) throw new Exception(n);
+ if (k.getVersionNumber() != 0) throw new Exception(n);
+ }
+
+ private static void checkByEType(int i, String n) throws Exception {
+ System.out.println("CheckByInt " + i);
+ KerberosKey k = new KerberosKey(kp, keyBytes, i, 13);
+ if (!k.getAlgorithm().equals(n)) throw new Exception("" + i);
+ if (k.getKeyType() != i) throw new Exception("" + i);
+ if (k.getVersionNumber() != 13) throw new Exception("" + i);
+ }
+}
+
+enum EncType {
+ e0("none", EncryptedData.ETYPE_NULL),
+ e1("des-cbc-crc", EncryptedData.ETYPE_DES_CBC_CRC),
+ e3("des-cbc-md5", EncryptedData.ETYPE_DES_CBC_MD5, "DES", null),
+ e16("des3-cbc-sha1-kd", EncryptedData.ETYPE_DES3_CBC_HMAC_SHA1_KD, "DESede"),
+ e17("aes128-cts-hmac-sha1-96", EncryptedData.ETYPE_AES128_CTS_HMAC_SHA1_96, "AES128"),
+ e18("aes256-cts-hmac-sha1-96", EncryptedData.ETYPE_AES256_CTS_HMAC_SHA1_96, "AES256"),
+ e23("rc4-hmac", EncryptedData.ETYPE_ARCFOUR_HMAC, "ArcFourHmac"),
+ ;
+
+ final String name;
+ final int etype;
+ final String[] oldnames;
+
+ EncType(String name, int etype, String... oldnames) {
+ this.name = name;
+ this.etype = etype;
+ this.oldnames = oldnames;
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/xml/bind/xjc/8032884/XjcOptionalPropertyTest.java Wed Apr 09 17:17:03 2014 -0700
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8032884
+ * @summary Globalbindings optionalProperty="primitive" does not work when minOccurs=0
+ * @run shell compile-schema.sh
+ * @run main/othervm XjcOptionalPropertyTest
+ */
+
+import java.io.IOException;
+import java.lang.reflect.Method;
+
+public class XjcOptionalPropertyTest {
+
+ public static void main(String[] args) throws IOException {
+
+ generated.Foo foo = new generated.Foo();
+ log("foo = " + foo);
+ Method[] methods = foo.getClass().getMethods();
+ log("Found [" + methods.length + "] methods");
+ for (int i = 0; i < methods.length; i++) {
+ Method method = methods[i];
+ if (method.getName().equals("setFoo")) {
+ log("Checking method [" + method.getName() + "]");
+ Class[] parameterTypes = method.getParameterTypes();
+ if (parameterTypes.length != 1)
+ fail("more than 1 parameter");
+ if (!parameterTypes[0].isPrimitive()) {
+ fail("Found [" + parameterTypes[0].getName() + "], but expected primitive!");
+ }
+ break;
+ }
+ }
+ log("TEST PASSED.");
+
+ }
+
+ private static void fail(String message) {
+ throw new RuntimeException(message);
+ }
+
+ private static void log(String msg) {
+ System.out.println(msg);
+ }
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/xml/bind/xjc/8032884/compile-schema.sh Wed Apr 09 17:17:03 2014 -0700
@@ -0,0 +1,39 @@
+#! /bin/sh
+
+#
+# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
+
+#
+
+if [ "x$TESTJAVA" = x ]; then
+ TESTJAVA=$1; shift
+ TESTCLASSES=.
+fi
+
+echo "cleaning generated files ..."
+rm -rfv ${TESTSRC}/generated
+
+echo "compiling [optional-property-schema.xsd] schema ..."
+$TESTJAVA/bin/xjc -p generated -d ${TESTSRC} ${TESTSRC}/optional-property-schema.xsd
+
+echo "Schema compiled. Verification of generated files can be done now."
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/xml/bind/xjc/8032884/optional-property-schema.xsd Wed Apr 09 17:17:03 2014 -0700
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" xmlns="anamespace"
+ targetNamespace="anamespace" jaxb:version="2.0">
+ <xs:annotation>
+ <xs:appinfo>
+ <jaxb:globalBindings optionalProperty="primitive"/>
+ </xs:appinfo>
+ </xs:annotation>
+ <xs:complexType name="foo">
+ <xs:sequence>
+ <xs:element name="foo" type="xs:int" minOccurs="0"/>
+ </xs:sequence>
+ </xs:complexType>
+</xs:schema>
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/xml/ws/8033113/Organization_List.wsdl Wed Apr 09 17:17:03 2014 -0700
@@ -0,0 +1,77 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<wsdl:definitions targetNamespace="urn:Organization_List" xmlns:s0="urn:Organization_List" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+ <wsdl:types>
+ <xsd:schema elementFormDefault="qualified" targetNamespace="urn:Organization_List">
+ <xsd:element name="OpGetList" type="s0:GetListInputMap"/>
+ <xsd:complexType name="GetListInputMap">
+ <xsd:sequence>
+ <xsd:element name="Qualification" type="xsd:string"/>
+ </xsd:sequence>
+ </xsd:complexType>
+ <xsd:element name="OpGetListResponse" type="s0:GetListOutputMap"/>
+ <xsd:complexType name="GetListOutputMap">
+ <xsd:sequence>
+ <xsd:element maxOccurs="unbounded" name="getListValues">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="Organization_Name" type="xsd:string"/>
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:sequence>
+ </xsd:complexType>
+ <xsd:element name="AuthenticationInfo" type="s0:AuthenticationInfo"/>
+ <xsd:complexType name="AuthenticationInfo">
+ <xsd:sequence>
+ <xsd:element name="userName" type="xsd:string"/>
+ <xsd:element name="password" type="xsd:string"/>
+ <xsd:element minOccurs="0" name="authentication" type="xsd:string"/>
+ <xsd:element minOccurs="0" name="locale" type="xsd:string"/>
+ <xsd:element minOccurs="0" name="timeZone" type="xsd:string"/>
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:schema>
+ </wsdl:types>
+
+ <wsdl:message name="ARAuthenticate">
+ <wsdl:part element="s0:AuthenticationInfo" name="param"/>
+ </wsdl:message>
+
+ <wsdl:message name="OpGetListSoapIn">
+ <wsdl:part element="s0:OpGetList" name="param"/>
+ </wsdl:message>
+
+ <wsdl:message name="OpGetListSoapOut">
+ <wsdl:part element="s0:OpGetListResponse" name="param"/>
+ </wsdl:message>
+
+ <wsdl:portType name="Organization_ListPortType">
+ <wsdl:operation name="OpGetList">
+ <wsdl:input message="s0:OpGetListSoapIn"/>
+ <wsdl:output message="s0:OpGetListSoapOut"/>
+ </wsdl:operation>
+ </wsdl:portType>
+
+ <wsdl:binding name="Organization_ListSoapBinding" type="s0:Organization_ListPortType">
+ <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <wsdl:operation name="OpGetList">
+ <soap:operation soapAction="urn:Organization_List/OpGetList" style="document"/>
+ <wsdl:input>
+ <soap:header message="s0:ARAuthenticate" part="param" use="literal">
+ </soap:header>
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+
+ <wsdl:service name="Organization_ListService">
+ <wsdl:port binding="s0:Organization_ListSoapBinding" name="Organization_ListSoap">
+ <soap:address location="http://bogus:9080/URL"/>
+ </wsdl:port>
+ </wsdl:service>
+
+</wsdl:definitions>
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/xml/ws/8033113/WsImportTest.java Wed Apr 09 17:17:03 2014 -0700
@@ -0,0 +1,152 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8033113
+ * @summary wsimport fails on WSDL:header parameter name customization
+ * @run main/othervm WsImportTest
+ */
+
+import java.io.InputStreamReader;
+import java.io.IOException;
+import java.io.BufferedReader;
+import java.io.File;
+import java.nio.file.Files;
+import java.nio.file.FileVisitResult;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.nio.file.SimpleFileVisitor;
+import java.nio.file.attribute.BasicFileAttributes;
+
+import static java.nio.file.FileVisitResult.*;
+
+public class WsImportTest {
+
+ public static void main(String[] args) throws IOException {
+
+ String wsimport = getWsImport();
+ String customization = getWSDLFilePath("customization.xml");
+ String wsdl = getWSDLFilePath("Organization_List.wsdl");
+
+ try {
+ log("Importing wsdl: " + wsdl);
+ String[] wsargs = {
+ wsimport,
+ "-keep",
+ "-verbose",
+ "-extension",
+ "-XadditionalHeaders",
+ "-Xdebug",
+ "-b",
+ customization,
+ wsdl
+ };
+
+ ProcessBuilder pb = new ProcessBuilder(wsargs);
+ pb.redirectErrorStream(true);
+ Process p = pb.start();
+ logOutput(p);
+ int result = p.waitFor();
+ p.destroy();
+
+ if (result != 0) {
+ fail("WsImport failed. TEST FAILED.");
+ } else {
+ log("Test PASSED.");
+ }
+
+ } catch (Exception e) {
+ e.printStackTrace();
+ fail(e.getMessage());
+ } finally {
+ deleteGeneratedFiles();
+ }
+ }
+
+ private static void fail(String message) {
+ throw new RuntimeException(message);
+ }
+
+ private static void log(String msg) {
+ System.out.println(msg);
+ }
+
+ private static void logOutput(Process p) throws IOException {
+ BufferedReader r = new BufferedReader(new InputStreamReader(p.getInputStream()));
+ String s = r.readLine();
+ while (s != null) {
+ log(s.trim());
+ s = r.readLine();
+ }
+ }
+
+ private static void deleteGeneratedFiles() {
+ Path p = Paths.get("generated");
+ if (Files.exists(p)) {
+ try {
+ Files.walkFileTree(p, new SimpleFileVisitor<Path>() {
+ @Override
+ public FileVisitResult visitFile(Path file,
+ BasicFileAttributes attrs) throws IOException {
+
+ Files.delete(file);
+ return CONTINUE;
+ }
+
+ @Override
+ public FileVisitResult postVisitDirectory(Path dir,
+ IOException exc) throws IOException {
+
+ if (exc == null) {
+ Files.delete(dir);
+ return CONTINUE;
+ } else {
+ throw exc;
+ }
+ }
+ });
+ } catch (IOException ioe) {
+ ioe.printStackTrace();
+ }
+ }
+ }
+
+ private static String getWSDLFilePath(String filename) {
+ String testSrc = System.getProperty("test.src");
+ if (testSrc == null) testSrc = ".";
+ return Paths.get(testSrc).resolve(filename).toString();
+ }
+
+ private static String getWsImport() {
+ String javaHome = System.getProperty("java.home");
+ if (javaHome.endsWith("jre")) {
+ javaHome = new File(javaHome).getParent();
+ }
+ String wsimport = javaHome + File.separator + "bin" + File.separator + "wsimport";
+ if (System.getProperty("os.name").startsWith("Windows")) {
+ wsimport = wsimport.concat(".exe");
+ }
+ return wsimport;
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/xml/ws/8033113/customization.xml Wed Apr 09 17:17:03 2014 -0700
@@ -0,0 +1,23 @@
+<jaxws:bindings wsdlLocation="./Organization_List.wsdl" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:jaxws="http://java.sun.com/xml/ns/jaxws">
+ <jaxws:enableWrapperStyle>false</jaxws:enableWrapperStyle>
+ <jaxws:bindings node="wsdl:definitions/wsdl:binding[@name='Organization_ListSoapBinding']/wsdl:operation[@name='OpGetList']">
+ <jaxws:parameter part="wsdl:definitions/wsdl:message[@name='ARAuthenticate']/wsdl:part[@name='param']" name="authParam"/>
+ <jaxws:parameter part="wsdl:definitions/wsdl:message[@name='OpGetListSoapIn']/wsdl:part[@name='param']" name="inParam"/>
+ <jaxws:parameter part="wsdl:definitions/wsdl:message[@name='OpGetListSoapOut']/wsdl:part[@name='param']" name="outParam"/>
+ </jaxws:bindings>
+</jaxws:bindings>
+
+<!--wsdl:message definitions from WSDL whose part names we are trying to override...
+
+ <wsdl:message name="ARAuthenticate">
+ <wsdl:part element="s0:AuthenticationInfo" name="param"/>
+ </wsdl:message>
+
+ <wsdl:message name="OpGetListSoapIn">
+ <wsdl:part element="s0:OpGetList" name="param"/>
+ </wsdl:message>
+
+ <wsdl:message name="OpGetListSoapOut">
+ <wsdl:part element="s0:OpGetListResponse" name="param"/>
+ </wsdl:message>
+-->
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/sun/security/krb5/auto/AddressesAndNameType.java Wed Apr 09 17:17:03 2014 -0700
@@ -0,0 +1,85 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 4501327 4868379 8039132
+ * @run main/othervm AddressesAndNameType 1
+ * @run main/othervm AddressesAndNameType 2
+ * @run main/othervm AddressesAndNameType 3
+ * @summary noaddresses settings and server name type
+ */
+
+import java.net.InetAddress;
+import java.util.Set;
+import sun.security.krb5.Config;
+
+import javax.security.auth.kerberos.KerberosPrincipal;
+import javax.security.auth.kerberos.KerberosTicket;
+
+public class AddressesAndNameType {
+
+ public static void main(String[] args)
+ throws Exception {
+
+ OneKDC kdc = new OneKDC(null);
+ kdc.writeJAASConf();
+
+ String extraLine;
+ switch (args[0]) {
+ case "1": extraLine = "noaddresses = false"; break;
+ case "2": extraLine = "noaddresses = true"; break;
+ default: extraLine = ""; break;
+ }
+
+ KDC.saveConfig(OneKDC.KRB5_CONF, kdc,
+ extraLine);
+ Config.refresh();
+
+ Context c = Context.fromUserPass(OneKDC.USER, OneKDC.PASS, false);
+ Set<KerberosTicket> tickets =
+ c.s().getPrivateCredentials(KerberosTicket.class);
+
+ if (tickets.isEmpty()) throw new Exception();
+ KerberosTicket ticket = tickets.iterator().next();
+ InetAddress[] addresses = ticket.getClientAddresses();
+
+ switch (args[0]) {
+ case "1":
+ if (addresses == null || addresses.length == 0) {
+ throw new Exception("No addresses");
+ }
+ if (ticket.getServer().getNameType()
+ != KerberosPrincipal.KRB_NT_SRV_INST) {
+ throw new Exception(
+ "Wrong type: " + ticket.getServer().getNameType());
+ }
+ break;
+ default:
+ if (addresses != null && addresses.length != 0) {
+ throw new Exception("See addresses");
+ }
+ break;
+ }
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/sun/security/krb5/auto/UdpTcp.java Wed Apr 09 17:17:03 2014 -0700
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 4966382 8039132
+ * @run main/othervm UdpTcp UDP
+ * @run main/othervm UdpTcp TCP
+ * @summary udp or tcp
+ */
+
+import java.io.ByteArrayOutputStream;
+import java.io.PrintStream;
+import sun.security.krb5.Config;
+
+public class UdpTcp {
+
+ public static void main(String[] args)
+ throws Exception {
+
+ System.setProperty("sun.security.krb5.debug", "true");
+
+ OneKDC kdc = new OneKDC(null);
+ kdc.writeJAASConf();
+
+ KDC.saveConfig(OneKDC.KRB5_CONF, kdc,
+ "udp_preference_limit = "
+ + (args[0].equals("UDP") ? "1000" : "100"));
+ Config.refresh();
+
+ ByteArrayOutputStream bo = new ByteArrayOutputStream();
+ PrintStream oldout = System.out;
+ System.setOut(new PrintStream(bo));
+ Context.fromUserPass(OneKDC.USER, OneKDC.PASS, false);
+ System.setOut(oldout);
+
+ for (String line: new String(bo.toByteArray()).split("\n")) {
+ if (line.contains(">>> KDCCommunication")) {
+ if (!line.contains(args[0])) {
+ throw new Exception("No " + args[0] + " in: " + line);
+ }
+ }
+ }
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/sun/security/krb5/config/YesNo.java Wed Apr 09 17:17:03 2014 -0700
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8029995
+ * @summary accept yes/no for boolean krb5.conf settings
+ * @compile -XDignore.symbol.file YesNo.java
+ * @run main/othervm YesNo
+ */
+import sun.security.krb5.Config;
+import sun.security.krb5.internal.crypto.EType;
+
+import java.util.Arrays;
+
+public class YesNo {
+ static Config config = null;
+ public static void main(String[] args) throws Exception {
+ System.setProperty("java.security.krb5.conf",
+ System.getProperty("test.src", ".") +"/yesno.conf");
+ config = Config.getInstance();
+ check("a", Boolean.TRUE);
+ check("b", Boolean.FALSE);
+ check("c", Boolean.TRUE);
+ check("d", Boolean.FALSE);
+ check("e", null);
+ check("f", null);
+
+ if (!Arrays.stream(EType.getBuiltInDefaults())
+ .anyMatch(n -> n < 4)) {
+ throw new Exception();
+ }
+ }
+
+ static void check(String k, Boolean expected) throws Exception {
+ Boolean result = config.getBooleanObject("libdefaults", k);
+ if (expected != result) {
+ throw new Exception("value for " + k + " is " + result);
+ }
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/sun/security/krb5/config/yesno.conf Wed Apr 09 17:17:03 2014 -0700
@@ -0,0 +1,7 @@
+[libdefaults]
+a = true
+b = FALSE
+c = YES
+d = no
+e = nothing
+allow_weak_crypto = yes
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/sun/security/krb5/etype/UnsupportedKeyType.java Wed Apr 09 17:17:03 2014 -0700
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 5006629
+ * @summary Kerberos library should only select keys of types that it supports
+ */
+
+import javax.security.auth.kerberos.KerberosPrincipal;
+import javax.security.auth.kerberos.KeyTab;
+import java.io.File;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+
+public class UnsupportedKeyType {
+
+ // Homemade keytab files:
+ //
+ // String KVNO Timestamp Principal (etype)
+ // -------- ---- -------------- -----------------------
+ // camellia 4 4/3/14 9:58 AM u1@K1 (25:camellia128-cts-cmac)
+ // aes 5 4/3/14 9:58 AM u1@K1 (17:aes128-cts-hmac-sha1-96)
+
+ static String aes =
+ "050200000027000100024b310002753100000001533cc04f0500110010e0eab6" +
+ "7f31608df2b2f8fffc6b21cc91";
+ static String camellia =
+ "050200000027000100024b310002753100000001533cc03e0400190010d88678" +
+ "14e478b6b7d2d97375163b971e";
+
+ public static void main(String[] args) throws Exception {
+
+ byte[] data = new byte[aes.length()/2];
+ KerberosPrincipal kp = new KerberosPrincipal("u1@K1");
+
+ // aes128
+ for (int i=0; i<data.length; i++) {
+ data[i] = Integer.valueOf(
+ aes.substring(2*i,2*i+2), 16).byteValue();
+ }
+ Files.write(Paths.get("aes"), data);
+ if(KeyTab.getInstance(kp, new File("aes")).getKeys(kp).length == 0) {
+ throw new Exception("AES key not read");
+ }
+
+ // camellia128
+ for (int i=0; i<data.length; i++) {
+ data[i] = Integer.valueOf(
+ camellia.substring(2*i,2*i+2), 16).byteValue();
+ }
+ Files.write(Paths.get("camellia"), data);
+ if(KeyTab.getInstance(kp, new File("camellia")).getKeys(kp).length != 0) {
+ throw new Exception("Unknown key read");
+ }
+ }
+}
--- a/jdk/test/sun/security/pkcs11/fips/CipherTest.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/test/sun/security/pkcs11/fips/CipherTest.java Wed Apr 09 17:17:03 2014 -0700
@@ -472,8 +472,21 @@
return false;
}
+ // No ECDH-capable certificate in key store. May restructure
+ // this in the future.
+ if (cipherSuite.contains("ECDHE_ECDSA") ||
+ cipherSuite.contains("ECDH_ECDSA") ||
+ cipherSuite.contains("ECDH_RSA")) {
+ System.out.println("Skipping unsupported test for " +
+ cipherSuite + " of " + protocol);
+ return false;
+ }
+
// skip SSLv2Hello protocol
- if (protocol.equals("SSLv2Hello")) {
+ //
+ // skip TLSv1.2 protocol, we have not implement "SunTls12Prf" and
+ // SunTls12RsaPremasterSecret in SunPKCS11 provider
+ if (protocol.equals("SSLv2Hello") || protocol.equals("TLSv1.2")) {
System.out.println("Skipping unsupported test for " +
cipherSuite + " of " + protocol);
return false;
--- a/jdk/test/sun/security/pkcs11/fips/ClientJSSEServerJSSE.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/test/sun/security/pkcs11/fips/ClientJSSEServerJSSE.java Wed Apr 09 17:17:03 2014 -0700
@@ -23,7 +23,7 @@
/*
* @test
- * @bug 6313675 6323647
+ * @bug 6313675 6323647 8028192
* @summary Verify that all ciphersuites work in FIPS mode
* @library ..
* @author Andreas Sterbenz
@@ -47,9 +47,13 @@
return;
}
- if ("sparc".equals(System.getProperty("os.arch")) == false) {
- // we have not updated other platforms with the proper NSS libraries yet
- System.out.println("Test currently works only on solaris-sparc, skipping");
+ String arch = System.getProperty("os.arch");
+ if (!("sparc".equals(arch) || "sparcv9".equals(arch))) {
+ // we have not updated other platforms with the proper NSS
+ // libraries yet
+ System.out.println(
+ "Test currently works only on solaris-sparc " +
+ "and solaris-sparcv9. Skipping on " + arch);
return;
}
--- a/jdk/test/sun/security/pkcs11/tls/TestPremaster.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/test/sun/security/pkcs11/tls/TestPremaster.java Wed Apr 09 17:17:03 2014 -0700
@@ -34,6 +34,7 @@
import javax.crypto.KeyGenerator;
import javax.crypto.SecretKey;
+import java.util.Formatter;
import sun.security.internal.spec.TlsRsaPremasterSecretParameterSpec;
@@ -59,27 +60,51 @@
System.out.println("OK: " + e);
}
- test(kg, 3, 0);
- test(kg, 3, 1);
- test(kg, 3, 2);
- test(kg, 4, 0);
+ int[] protocolVersions = {0x0300, 0x0301, 0x0302, 0x0400};
+ for (int clientVersion : protocolVersions) {
+ for (int serverVersion : protocolVersions) {
+ test(kg, clientVersion, serverVersion);
+ if (serverVersion >= clientVersion) {
+ break;
+ }
+ }
+ }
System.out.println("Done.");
}
- private static void test(KeyGenerator kg, int major, int minor)
- throws Exception {
+ private static void test(KeyGenerator kg,
+ int clientVersion, int serverVersion) throws Exception {
- kg.init(new TlsRsaPremasterSecretParameterSpec(major, minor));
+ System.out.printf(
+ "Testing RSA pre-master secret key generation between " +
+ "client (0x%04X) and server(0x%04X)%n",
+ clientVersion, serverVersion);
+ kg.init(new TlsRsaPremasterSecretParameterSpec(
+ clientVersion, serverVersion));
SecretKey key = kg.generateKey();
byte[] encoded = key.getEncoded();
- if (encoded.length != 48) {
- throw new Exception("length: " + encoded.length);
- }
- if ((encoded[0] != major) || (encoded[1] != minor)) {
- throw new Exception("version mismatch: " + encoded[0] +
- "." + encoded[1]);
- }
- System.out.println("OK: " + major + "." + minor);
+ if (encoded != null) { // raw key material may be not extractable
+ if (encoded.length != 48) {
+ throw new Exception("length: " + encoded.length);
+ }
+ int v = versionOf(encoded[0], encoded[1]);
+ if (clientVersion != v) {
+ if (serverVersion != v || clientVersion >= 0x0302) {
+ throw new Exception(String.format(
+ "version mismatch: (0x%04X) rather than (0x%04X) " +
+ "is used in pre-master secret", v, clientVersion));
+ }
+ System.out.printf("Use compatible version (0x%04X)%n", v);
+ }
+ System.out.println("Passed, version matches!");
+ } else {
+ System.out.println("Raw key material is not extractable");
+ }
}
+
+ private static int versionOf(int major, int minor) {
+ return ((major & 0xFF) << 8) | (minor & 0xFF);
+ }
+
}
--- a/jdk/test/sun/tools/jstatd/JstatdTest.java Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/test/sun/tools/jstatd/JstatdTest.java Wed Apr 09 17:17:03 2014 -0700
@@ -27,6 +27,7 @@
import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;
import java.util.Arrays;
+import java.util.regex.Pattern;
import static jdk.testlibrary.Asserts.*;
import jdk.testlibrary.JDKToolLauncher;
@@ -34,6 +35,7 @@
import jdk.testlibrary.ProcessThread;
import jdk.testlibrary.TestThread;
import jdk.testlibrary.Utils;
+import jdk.testlibrary.ProcessTools;
/**
* The base class for tests of jstatd.
@@ -93,8 +95,11 @@
if (tool == "rmiregistry") {
processName = "registryimpl";
}
+
+ Pattern toolInJpsPattern =
+ Pattern.compile("^\\d+\\s{1}" + processName + "\\s{1}.*-dparent\\.pid\\." + ProcessTools.getProcessId() + ".*");
for (String line : lines) {
- if (line.toLowerCase().matches("^\\d+\\s{1}" + processName + "$")) {
+ if (toolInJpsPattern.matcher(line.toLowerCase()).matches()) {
pid = line.split(" ")[0];
count++;
}
@@ -167,6 +172,8 @@
private OutputAnalyzer runJps() throws Exception {
JDKToolLauncher launcher = JDKToolLauncher.createUsingTestJDK("jps");
launcher.addVMArg("-XX:+UsePerfData");
+ // Run jps with -v flag to obtain -Dparent.pid.<pid>
+ launcher.addToolArg("-v");
launcher.addToolArg(getDestination());
String[] cmd = launcher.getCommand();
@@ -286,7 +293,7 @@
* jstatd -J-XX:+UsePerfData -J-Djava.security.policy=all.policy -n serverName
* jstatd -J-XX:+UsePerfData -J-Djava.security.policy=all.policy -p port -n serverName
*/
- private String[] getJstatdCmd() throws UnknownHostException {
+ private String[] getJstatdCmd() throws Exception {
JDKToolLauncher launcher = JDKToolLauncher.createUsingTestJDK("jstatd");
launcher.addVMArg("-XX:+UsePerfData");
String testSrc = System.getProperty("test.src");
@@ -294,6 +301,8 @@
assertTrue(policy.exists() && policy.isFile(),
"Security policy " + policy.getAbsolutePath() + " does not exist or not a file");
launcher.addVMArg("-Djava.security.policy=" + policy.getAbsolutePath());
+ // -Dparent.pid.<pid> will help to identify jstad process started by this test
+ launcher.addVMArg("-Dparent.pid." + ProcessTools.getProcessId());
if (port != null) {
launcher.addToolArg("-p");
launcher.addToolArg(port);
--- a/jdk/test/sun/util/calendar/zi/tzdata/VERSION Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/test/sun/util/calendar/zi/tzdata/VERSION Wed Apr 09 17:17:03 2014 -0700
@@ -21,4 +21,4 @@
# or visit www.oracle.com if you need additional information or have any
# questions.
#
-tzdata2014a
+tzdata2014b
--- a/jdk/test/sun/util/calendar/zi/tzdata/africa Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/test/sun/util/calendar/zi/tzdata/africa Wed Apr 09 17:17:03 2014 -0700
@@ -891,7 +891,10 @@
# Another source (specifying the time for start and end in the decree):
# http://www.lemag.ma/Heure-d-ete-au-Maroc-jusqu-au-27-octobre_a75620.html
-# From Paul Eggert (2013-10-03):
+# From Sebastien Willemijns (2014-03-18):
+# http://www.afriquinfos.com/articles/2014/3/18/maroc-heure-dete-avancez-tous-horloges-247891.asp
+
+# From Paul Eggert (2014-03-19):
# To estimate what the Moroccan government will do in future years,
# transition dates for 2014 through 2038 were determined by running
# the following program under GNU Emacs 24.3:
--- a/jdk/test/sun/util/calendar/zi/tzdata/antarctica Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/test/sun/util/calendar/zi/tzdata/antarctica Wed Apr 09 17:17:03 2014 -0700
@@ -253,24 +253,41 @@
# year-round base
# Scott Base, Ross Island, since 1957-01.
# See Pacific/Auckland.
-#
-# These rules for New Zealand are stolen from the 'australasia' file.
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
-Rule NZAQ 1974 only - Nov 3 2:00s 1:00 D
-Rule NZAQ 1975 1988 - Oct lastSun 2:00s 1:00 D
-Rule NZAQ 1989 only - Oct 8 2:00s 1:00 D
-Rule NZAQ 1990 2006 - Oct Sun>=1 2:00s 1:00 D
-Rule NZAQ 1975 only - Feb 23 2:00s 0 S
-Rule NZAQ 1976 1989 - Mar Sun>=1 2:00s 0 S
-Rule NZAQ 1990 2007 - Mar Sun>=15 2:00s 0 S
-Rule NZAQ 2007 max - Sep lastSun 2:00s 1:00 D
-Rule NZAQ 2008 max - Apr Sun>=1 2:00s 0 S
# Norway - territories
# Bouvet (never inhabited)
#
# claims
# Peter I Island (never inhabited)
+#
+# year-round base
+# Troll, Queen Maud Land, -720041+0023206, since 2005-02-12
+#
+# From Paul-Inge Flakstad (2014-03-10):
+# I recently had a long dialog about this with the developer of timegenie.com.
+# In the absence of specific dates, he decided to choose some likely ones:
+# GMT +1 - From March 1 to the last Sunday in March
+# GMT +2 - From the last Sunday in March until the last Sunday in October
+# GMT +1 - From the last Sunday in October until November 7
+# GMT +0 - From November 7 until March 1
+# The dates for switching to and from UTC+0 will probably not be absolutely
+# correct, but they should be quite close to the actual dates.
+#
+# From Paul Eggert (2014-03-21):
+# The CET-switching Troll rules require zic from tzcode 2014b or later, so as
+# suggested by Bengt-Inge Larsson comment them out for now, and approximate
+# with only UTC and CEST. Uncomment them when 2014b is more prevalent.
+#
+# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+#Rule Troll 2005 max - Mar 1 1:00u 1:00 CET
+Rule Troll 2005 max - Mar lastSun 1:00u 2:00 CEST
+#Rule Troll 2005 max - Oct lastSun 1:00u 1:00 CET
+#Rule Troll 2004 max - Nov 7 1:00u 0:00 UTC
+# Remove the following line when uncommenting the above '#Rule' lines.
+Rule Troll 2004 max - Oct lastSun 1:00u 0:00 UTC
+# Zone NAME GMTOFF RULES FORMAT [UNTIL]
+Zone Antarctica/Troll 0 - zzz 2005 Feb 12
+ 0:00 Troll %s
# Poland - year-round base
# Arctowski, King George Island, -620945-0582745, since 1977
--- a/jdk/test/sun/util/calendar/zi/tzdata/australasia Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/test/sun/util/calendar/zi/tzdata/australasia Wed Apr 09 17:17:03 2014 -0700
@@ -786,14 +786,29 @@
# Johnston
#
-# From Paul Eggert (2013-09-03):
+# From Paul Eggert (2014-03-11):
+# Sometimes Johnston kept Hawaii time, and sometimes it was an hour behind.
+# Details are uncertain. We have no data for Johnston after 1970, so
+# treat it like Hawaii for now.
+#
# In his memoirs of June 6th to October 4, 1945
# <http://www.315bw.org/Herb_Bach.htm> (2005), Herbert C. Bach writes,
# "We started our letdown to Kwajalein Atoll and landed there at 5:00 AM
# Johnston time, 1:30 AM Kwajalein time." This was in June 1945, and
# confirms that Johnston kept the same time as Honolulu in summer 1945.
-# We have no better information, so for now, assume this has been true
-# indefinitely into the past.
+#
+# From Lyle McElhaney (2014-03-11):
+# [W]hen JI was being used for that [atomic bomb] testing, the time being used
+# was not Hawaiian time but rather the same time being used on the ships,
+# which had a GMT offset of -11 hours. This apparently applied to at least the
+# time from Operation Newsreel (Hardtack I/Teak shot, 1958-08-01) to the last
+# Operation Fishbowl shot (Tightrope, 1962-11-04).... [See] Herman Hoerlin,
+# "The United States High-Altitude Test Experience: A Review Emphasizing the
+# Impact on the Environment", Los Alamos LA-6405, Oct 1976
+# <http://www.fas.org/sgp/othergov/doe/lanl/docs1/00322994.pdf>.
+# See the table on page 4 where he lists GMT and local times for the tests; a
+# footnote for the JI tests reads that local time is "JI time = Hawaii Time
+# Minus One Hour".
#
# See 'northamerica' for Pacific/Johnston.
--- a/jdk/test/sun/util/calendar/zi/tzdata/europe Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/test/sun/util/calendar/zi/tzdata/europe Wed Apr 09 17:17:03 2014 -0700
@@ -2986,7 +2986,11 @@
# Assume it happened in March by not changing the clocks.
3:00 Russia MSK/MSD 1997
3:00 - MSK 1997 Mar lastSun 1:00u
- 2:00 EU EE%sT
+# From Alexander Krivenyshev (2014-03-17):
+# time change at 2:00 (2am) on March 30, 2014
+# http://vz.ru/news/2014/3/17/677464.html
+ 2:00 EU EE%sT 2014 Mar 30 2:00
+ 4:00 - MSK
# Vatican City
# See Europe/Rome.
--- a/jdk/test/sun/util/calendar/zi/tzdata/leapseconds Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/test/sun/util/calendar/zi/tzdata/leapseconds Wed Apr 09 17:17:03 2014 -0700
@@ -20,7 +20,7 @@
# 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.
-
+#
# Allowance for leapseconds added to each timezone file.
# This file is in the public domain.
--- a/jdk/test/sun/util/calendar/zi/tzdata/zone.tab Wed Apr 09 09:20:54 2014 -0700
+++ b/jdk/test/sun/util/calendar/zi/tzdata/zone.tab Wed Apr 09 17:17:03 2014 -0700
@@ -74,6 +74,7 @@
AQ -7824+10654 Antarctica/Vostok Vostok Station, Lake Vostok
AQ -6640+14001 Antarctica/DumontDUrville Dumont-d'Urville Station, Terre Adelie
AQ -690022+0393524 Antarctica/Syowa Syowa Station, E Ongul I
+AQ -720041+0023206 Antarctica/Troll Troll Station, Queen Maud Land
AR -3436-05827 America/Argentina/Buenos_Aires Buenos Aires (BA, CF)
AR -3124-06411 America/Argentina/Cordoba most locations (CB, CC, CN, ER, FM, MN, SE, SF)
AR -2447-06525 America/Argentina/Salta (SA, LP, NQ, RN)
@@ -366,6 +367,7 @@
RU +5545+03735 Europe/Moscow Moscow+00 - west Russia
RU +4844+04425 Europe/Volgograd Moscow+00 - Caspian Sea
RU +5312+05009 Europe/Samara Moscow+00 - Samara, Udmurtia
+RU +4457+03406 Europe/Simferopol Moscow+00 - Crimea
RU +5651+06036 Asia/Yekaterinburg Moscow+02 - Urals
RU +5500+07324 Asia/Omsk Moscow+03 - west Siberia
RU +5502+08255 Asia/Novosibirsk Moscow+03 - Novosibirsk
@@ -421,7 +423,6 @@
UA +5026+03031 Europe/Kiev most locations
UA +4837+02218 Europe/Uzhgorod Ruthenia
UA +4750+03510 Europe/Zaporozhye Zaporozh'ye, E Lugansk / Zaporizhia, E Luhansk
-UA +4457+03406 Europe/Simferopol central Crimea
UG +0019+03225 Africa/Kampala
UM +1645-16931 Pacific/Johnston Johnston Atoll
UM +2813-17722 Pacific/Midway Midway Islands