From 81d33c472719b4f89f6f50201f80bec16e5a184d Mon Sep 17 00:00:00 2001 From: Sean Coffey Date: Tue, 13 Sep 2011 11:21:51 +0100 Subject: [PATCH 01/23] 7082769: FileInputStream/FileOutputStream/RandomAccessFile allow file descriptor be closed when still in use Reviewed-by: alanb --- .../classes/java/io/FileInputStream.java | 25 +- .../classes/java/io/FileOutputStream.java | 26 +- .../classes/java/io/RandomAccessFile.java | 13 +- .../java/io/etc/FileDescriptorSharing.java | 336 ++++++++++++++++++ 4 files changed, 351 insertions(+), 49 deletions(-) create mode 100644 jdk/test/java/io/etc/FileDescriptorSharing.java diff --git a/jdk/src/share/classes/java/io/FileInputStream.java b/jdk/src/share/classes/java/io/FileInputStream.java index 3aec50810fb..9dc19557e54 100644 --- a/jdk/src/share/classes/java/io/FileInputStream.java +++ b/jdk/src/share/classes/java/io/FileInputStream.java @@ -56,16 +56,6 @@ class FileInputStream extends InputStream private final Object closeLock = new Object(); private volatile boolean closed = false; - private static final ThreadLocal runningFinalize = - new ThreadLocal<>(); - - private static boolean isRunningFinalize() { - Boolean val; - if ((val = runningFinalize.get()) != null) - return val.booleanValue(); - return false; - } - /** * Creates a FileInputStream by * opening a connection to an actual file, @@ -319,10 +309,10 @@ class FileInputStream extends InputStream int useCount = fd.decrementAndGetUseCount(); /* - * If FileDescriptor is still in use by another stream, the finalizer + * If FileDescriptor is still in use by another stream, we * will not close it. */ - if ((useCount <= 0) || !isRunningFinalize()) { + if (useCount <= 0) { close0(); } } @@ -391,18 +381,7 @@ class FileInputStream extends InputStream */ protected void finalize() throws IOException { if ((fd != null) && (fd != FileDescriptor.in)) { - - /* - * Finalizer should not release the FileDescriptor if another - * stream is still using it. If the user directly invokes - * close() then the FileDescriptor is also released. - */ - runningFinalize.set(Boolean.TRUE); - try { close(); - } finally { - runningFinalize.set(Boolean.FALSE); - } } } } diff --git a/jdk/src/share/classes/java/io/FileOutputStream.java b/jdk/src/share/classes/java/io/FileOutputStream.java index 6f1a77633c4..4a8a724ba15 100644 --- a/jdk/src/share/classes/java/io/FileOutputStream.java +++ b/jdk/src/share/classes/java/io/FileOutputStream.java @@ -63,21 +63,12 @@ class FileOutputStream extends OutputStream private final boolean append; /** - * The associated channel, initalized lazily. + * The associated channel, initialized lazily. */ private FileChannel channel; private final Object closeLock = new Object(); private volatile boolean closed = false; - private static final ThreadLocal runningFinalize = - new ThreadLocal<>(); - - private static boolean isRunningFinalize() { - Boolean val; - if ((val = runningFinalize.get()) != null) - return val.booleanValue(); - return false; - } /** * Creates a file output stream to write to the file with the @@ -355,10 +346,10 @@ class FileOutputStream extends OutputStream int useCount = fd.decrementAndGetUseCount(); /* - * If FileDescriptor is still in use by another stream, the finalizer + * If FileDescriptor is still in use by another stream, we * will not close it. */ - if ((useCount <= 0) || !isRunningFinalize()) { + if (useCount <= 0) { close0(); } } @@ -424,18 +415,7 @@ class FileOutputStream extends OutputStream if (fd == FileDescriptor.out || fd == FileDescriptor.err) { flush(); } else { - - /* - * Finalizer should not release the FileDescriptor if another - * stream is still using it. If the user directly invokes - * close() then the FileDescriptor is also released. - */ - runningFinalize.set(Boolean.TRUE); - try { close(); - } finally { - runningFinalize.set(Boolean.FALSE); - } } } } diff --git a/jdk/src/share/classes/java/io/RandomAccessFile.java b/jdk/src/share/classes/java/io/RandomAccessFile.java index 2c16791f4b8..a2863c59a08 100644 --- a/jdk/src/share/classes/java/io/RandomAccessFile.java +++ b/jdk/src/share/classes/java/io/RandomAccessFile.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1994, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1994, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -590,8 +590,15 @@ public class RandomAccessFile implements DataOutput, DataInput, Closeable { * Decrement FD use count associated with this stream. * The count got incremented by FileDescriptor during its construction. */ - fd.decrementAndGetUseCount(); - close0(); + int useCount = fd.decrementAndGetUseCount(); + + /* + * If FileDescriptor is still in use by another stream, we + * will not close it. + */ + if (useCount <= 0) { + close0(); + } } // diff --git a/jdk/test/java/io/etc/FileDescriptorSharing.java b/jdk/test/java/io/etc/FileDescriptorSharing.java new file mode 100644 index 00000000000..d46f61a5282 --- /dev/null +++ b/jdk/test/java/io/etc/FileDescriptorSharing.java @@ -0,0 +1,336 @@ +/* + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 6322678 7082769 + * @summary FileInputStream/FileOutputStream/RandomAccessFile allow file descriptor + * to be closed while still in use. + * @run main/othervm FileDescriptorSharing + */ + +import java.io.*; +import java.nio.channels.FileChannel; +import java.nio.channels.FileLock; +import java.util.concurrent.CountDownLatch; + +public class FileDescriptorSharing { + + final static int numFiles = 10; + volatile static boolean fail; + + public static void main(String[] args) throws Exception { + TestFinalizer(); + TestMultipleFD(); + TestIsValid(); + MultiThreadedFD(); + } + + /** + * We shouldn't discard a file descriptor until all streams have + * finished with it + */ + private static void TestFinalizer() throws Exception { + FileDescriptor fd = null; + File tempFile = new File("TestFinalizer1.txt"); + tempFile.deleteOnExit(); + try (Writer writer = new FileWriter(tempFile)) { + for (int i=0; i<5; i++) { + writer.write("test file content test file content"); + } + } + + FileInputStream fis1 = new FileInputStream(tempFile); + fd = fis1.getFD(); + // Create a new FIS based on the existing FD (so the two FIS's share the same native fd) + try (FileInputStream fis2 = new FileInputStream(fd)) { + // allow fis1 to be gc'ed + fis1 = null; + int ret = 0; + while(ret >= 0) { + // encourage gc + System.gc(); + // read from fis2 - when fis1 is gc'ed and finalizer is run, read will fail + System.out.print("."); + ret = fis2.read(); + } + } + + // variation of above. Use RandomAccessFile to obtain a filedescriptor + File testFinalizerFile = new File("TestFinalizer"); + RandomAccessFile raf = new RandomAccessFile(testFinalizerFile, "rw"); + raf.writeBytes("test file content test file content"); + raf.seek(0L); + fd = raf.getFD(); + try (FileInputStream fis3 = new FileInputStream(fd)) { + // allow raf to be gc'ed + raf = null; + int ret = 0; + while (ret >= 0) { + // encourage gc + System.gc(); + /* + * read from fis3 - when raf is gc'ed and finalizer is run, + * fd should still be valid. + */ + System.out.print("."); + ret = fis3.read(); + } + if(!fd.valid()) { + throw new RuntimeException("TestFinalizer() : FileDescriptor should be valid"); + } + } finally { + testFinalizerFile.delete(); + } + } + + /** + * Exercise FileDispatcher close()/preClose() + */ + private static void TestMultipleFD() throws Exception { + RandomAccessFile raf = null; + FileOutputStream fos = null; + FileInputStream fis = null; + FileChannel fc = null; + FileLock fileLock = null; + + File test1 = new File("test1"); + try { + raf = new RandomAccessFile(test1, "rw"); + fos = new FileOutputStream(raf.getFD()); + fis = new FileInputStream(raf.getFD()); + fc = raf.getChannel(); + fileLock = fc.lock(); + raf.setLength(0L); + fos.flush(); + fos.write("TEST".getBytes()); + } finally { + if (fileLock != null) fileLock.release(); + if (fis != null) fis.close(); + if (fos != null) fos.close(); + if (raf != null) raf.close(); + test1.delete(); + } + + /* + * Close out in different order to ensure FD is not + * closed out too early + */ + File test2 = new File("test2"); + try { + raf = new RandomAccessFile(test2, "rw"); + fos = new FileOutputStream(raf.getFD()); + fis = new FileInputStream(raf.getFD()); + fc = raf.getChannel(); + fileLock = fc.lock(); + raf.setLength(0L); + fos.flush(); + fos.write("TEST".getBytes()); + } finally { + if (fileLock != null) fileLock.release(); + if (raf != null) raf.close(); + if (fos != null) fos.close(); + if (fis != null) fis.close(); + test2.delete(); + } + + // one more time, fos first this time + File test3 = new File("test3"); + try { + raf = new RandomAccessFile(test3, "rw"); + fos = new FileOutputStream(raf.getFD()); + fis = new FileInputStream(raf.getFD()); + fc = raf.getChannel(); + fileLock = fc.lock(); + raf.setLength(0L); + fos.flush(); + fos.write("TEST".getBytes()); + } finally { + if (fileLock != null) fileLock.release(); + if (fos != null) fos.close(); + if (raf != null) raf.close(); + if (fis != null) fis.close(); + test3.delete(); + } + } + + /** + * Similar to TestMultipleFD() but this time we + * just get and use FileDescriptor.valid() for testing. + */ + private static void TestIsValid() throws Exception { + FileDescriptor fd = null; + RandomAccessFile raf = null; + FileOutputStream fos = null; + FileInputStream fis = null; + FileChannel fc = null; + + File test1 = new File("test1"); + try { + raf = new RandomAccessFile(test1, "rw"); + fd = raf.getFD(); + fos = new FileOutputStream(fd); + fis = new FileInputStream(fd); + } finally { + try { + if (fis != null) fis.close(); + if (fos != null) fos.close(); + if (!fd.valid()) { + throw new RuntimeException("FileDescriptor should be valid"); + } + if (raf != null) raf.close(); + if (fd.valid()) { + throw new RuntimeException("close() called and FileDescriptor still valid"); + } + } finally { + if (raf != null) raf.close(); + test1.delete(); + } + } + + /* + * Close out in different order to ensure FD is not + * closed out too early + */ + File test2 = new File("test2"); + try { + raf = new RandomAccessFile(test2, "rw"); + fd = raf.getFD(); + fos = new FileOutputStream(fd); + fis = new FileInputStream(fd); + } finally { + try { + if (raf != null) raf.close(); + if (fos != null) fos.close(); + if (!fd.valid()) { + throw new RuntimeException("FileDescriptor should be valid"); + } + if (fis != null) fis.close(); + if (fd.valid()) { + throw new RuntimeException("close() called and FileDescriptor still valid"); + } + } finally { + test2.delete(); + } + } + + // one more time, fos first this time + File test3 = new File("test3"); + try { + raf = new RandomAccessFile(test3, "rw"); + fd = raf.getFD(); + fos = new FileOutputStream(fd); + fis = new FileInputStream(fd); + } finally { + try { + if (fos != null) fos.close(); + if (raf != null) raf.close(); + if (!fd.valid()) { + throw new RuntimeException("FileDescriptor should be valid"); + } + if (fis != null) fis.close(); + if (fd.valid()) { + throw new RuntimeException("close() called and FileDescriptor still valid"); + } + } finally { + test3.delete(); + } + } + } + + /** + * Test concurrent access to the same fd.useCount field + */ + private static void MultiThreadedFD() throws Exception { + RandomAccessFile raf = null; + FileDescriptor fd = null; + int numThreads = 2; + CountDownLatch done = new CountDownLatch(numThreads); + OpenClose[] fileOpenClose = new OpenClose[numThreads]; + File MultipleThreadedFD = new File("MultipleThreadedFD"); + try { + raf = new RandomAccessFile(MultipleThreadedFD, "rw"); + fd = raf.getFD(); + for(int count=0;count Date: Wed, 14 Sep 2011 08:33:34 -0700 Subject: [PATCH 02/23] 6915797: Remove sun.tools.jar.JarImageSource that is not used 7090178: Move java.util.XMLUtils to another package to avoid split package Reviewed-by: alanb, sherman --- jdk/make/java/java/FILES_java.gmk | 1 - jdk/make/sun/Makefile | 2 +- jdk/make/sun/util/Makefile | 40 +++++++++ .../share/classes/java/util/Properties.java | 57 ++++++++++++ .../classes/sun/tools/jar/JarImageSource.java | 88 ------------------- .../{java/util => sun/util/xml}/XMLUtils.java | 9 +- 6 files changed, 103 insertions(+), 94 deletions(-) create mode 100644 jdk/make/sun/util/Makefile delete mode 100644 jdk/src/share/classes/sun/tools/jar/JarImageSource.java rename jdk/src/share/classes/{java/util => sun/util/xml}/XMLUtils.java (97%) diff --git a/jdk/make/java/java/FILES_java.gmk b/jdk/make/java/java/FILES_java.gmk index 58c763a3fe5..7aae0877000 100644 --- a/jdk/make/java/java/FILES_java.gmk +++ b/jdk/make/java/java/FILES_java.gmk @@ -208,7 +208,6 @@ JAVA_JAVA_java = \ java/util/Observable.java \ java/util/Observer.java \ java/util/Properties.java \ - java/util/XMLUtils.java \ java/util/InvalidPropertiesFormatException.java \ java/util/PropertyPermission.java \ java/util/PropertyResourceBundle.java \ diff --git a/jdk/make/sun/Makefile b/jdk/make/sun/Makefile index 4c19f4ecbc0..c3a8f189170 100644 --- a/jdk/make/sun/Makefile +++ b/jdk/make/sun/Makefile @@ -68,7 +68,7 @@ else endif # nio need to be compiled before awt to have all charsets ready -SUBDIRS = jar security javazic misc net nio text launcher +SUBDIRS = jar security javazic misc net nio text util launcher ifdef BUILD_HEADLESS_ONLY DISPLAY_LIBS = awt $(HEADLESS_SUBDIR) diff --git a/jdk/make/sun/util/Makefile b/jdk/make/sun/util/Makefile new file mode 100644 index 00000000000..70d90757b7c --- /dev/null +++ b/jdk/make/sun/util/Makefile @@ -0,0 +1,40 @@ +# +# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + +BUILDDIR = ../.. +PACKAGE = sun.util +PRODUCT = sun +include $(BUILDDIR)/common/Defs.gmk + +# +# Files +# +AUTO_FILES_JAVA_DIRS = sun/util/xml + +# +# Rules +# +include $(BUILDDIR)/common/Classes.gmk + diff --git a/jdk/src/share/classes/java/util/Properties.java b/jdk/src/share/classes/java/util/Properties.java index d27e60871f3..1cd19a0e40e 100644 --- a/jdk/src/share/classes/java/util/Properties.java +++ b/jdk/src/share/classes/java/util/Properties.java @@ -34,6 +34,7 @@ import java.io.Reader; import java.io.Writer; import java.io.OutputStreamWriter; import java.io.BufferedWriter; +import java.lang.reflect.*; /** * The Properties class represents a persistent set of @@ -1111,4 +1112,60 @@ class Properties extends Hashtable { private static final char[] hexDigit = { '0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F' }; + + + private static class XMLUtils { + private static Method load = null; + private static Method save = null; + static { + try { + // reference sun.util.xml.Utils reflectively + // to allow the Properties class be compiled in + // the absence of XML + Class c = Class.forName("sun.util.xml.XMLUtils", true, null); + load = c.getMethod("load", Properties.class, InputStream.class); + save = c.getMethod("save", Properties.class, OutputStream.class, + String.class, String.class); + } catch (ClassNotFoundException cnf) { + throw new AssertionError(cnf); + } catch (NoSuchMethodException e) { + throw new AssertionError(e); + } + } + + static void invoke(Method m, Object... args) throws IOException { + try { + m.invoke(null, args); + } catch (IllegalAccessException e) { + throw new AssertionError(e); + } catch (InvocationTargetException e) { + Throwable t = e.getCause(); + if (t instanceof RuntimeException) + throw (RuntimeException)t; + + if (t instanceof IOException) { + throw (IOException)t; + } else { + throw new AssertionError(t); + } + } + } + + static void load(Properties props, InputStream in) + throws IOException, InvalidPropertiesFormatException + { + if (load == null) + throw new InternalError("sun.util.xml.XMLUtils not found"); + invoke(load, props, in); + } + + static void save(Properties props, OutputStream os, String comment, + String encoding) + throws IOException + { + if (save == null) + throw new InternalError("sun.util.xml.XMLUtils not found"); + invoke(save, props, os, comment, encoding); + } + } } diff --git a/jdk/src/share/classes/sun/tools/jar/JarImageSource.java b/jdk/src/share/classes/sun/tools/jar/JarImageSource.java deleted file mode 100644 index 254eebd284a..00000000000 --- a/jdk/src/share/classes/sun/tools/jar/JarImageSource.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright (c) 1996, 1998, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - - -package sun.tools.jar; - -import sun.awt.image.URLImageSource; -import sun.awt.image.ImageDecoder; -import java.net.URL; -import java.net.JarURLConnection; -import java.util.jar.JarFile; -import java.util.jar.JarEntry; -import java.io.InputStream; -import java.io.IOException; - - -public class JarImageSource extends URLImageSource { - String mimeType; - String entryName = null; - URL url; - - /** - * Create an image source from a Jar entry URL with the specified - * mime type. - */ - public JarImageSource(URL u, String type) { - super(u); - url = u; - mimeType = type; - } - - /** - * Create an image source from a Jar file/entry URL - * with the specified entry name and mime type. - */ - public JarImageSource(URL u, String name, String type) { - this(u, type); - this.entryName = name; - } - - protected ImageDecoder getDecoder() { - InputStream is = null; - try { - JarURLConnection c = (JarURLConnection)url.openConnection(); - JarFile f = c.getJarFile(); - JarEntry e = c.getJarEntry(); - - if (entryName != null && e == null) { - e = f.getJarEntry(entryName); - } - if (e == null || (e != null && entryName != null - && (!(entryName.equals(e.getName()))))) { - return null; - } - is = f.getInputStream(e); - } catch (IOException e) { - return null; - } - - ImageDecoder id = decoderForType(is, mimeType); - if (id == null) { - id = getDecoder(is); - } - return id; - } -} diff --git a/jdk/src/share/classes/java/util/XMLUtils.java b/jdk/src/share/classes/sun/util/xml/XMLUtils.java similarity index 97% rename from jdk/src/share/classes/java/util/XMLUtils.java rename to jdk/src/share/classes/sun/util/xml/XMLUtils.java index 1666c631cac..ab7ca851396 100644 --- a/jdk/src/share/classes/java/util/XMLUtils.java +++ b/jdk/src/share/classes/sun/util/xml/XMLUtils.java @@ -23,9 +23,10 @@ * questions. */ -package java.util; +package sun.util.xml; import java.io.*; +import java.util.*; import org.xml.sax.*; import org.xml.sax.helpers.*; import org.w3c.dom.*; @@ -42,7 +43,7 @@ import javax.xml.transform.stream.*; * @author Michael McCloskey * @since 1.3 */ -class XMLUtils { +public class XMLUtils { // XML loading and saving methods for Properties @@ -66,7 +67,7 @@ class XMLUtils { */ private static final String EXTERNAL_XML_VERSION = "1.0"; - static void load(Properties props, InputStream in) + public static void load(Properties props, InputStream in) throws IOException, InvalidPropertiesFormatException { Document doc = null; @@ -120,7 +121,7 @@ class XMLUtils { } } - static void save(Properties props, OutputStream os, String comment, + public static void save(Properties props, OutputStream os, String comment, String encoding) throws IOException { From 30d2b45bd8010d5c01ad942beb4c9e2f2853f531 Mon Sep 17 00:00:00 2001 From: Joe Darcy Date: Wed, 14 Sep 2011 11:32:11 -0700 Subject: [PATCH 03/23] 6879143: java.math.BigInteger misses the xxxValueExact methods Reviewed-by: alanb --- .../share/classes/java/math/BigInteger.java | 82 ++++++++ .../java/math/BigInteger/TestValueExact.java | 194 ++++++++++++++++++ 2 files changed, 276 insertions(+) create mode 100644 jdk/test/java/math/BigInteger/TestValueExact.java diff --git a/jdk/src/share/classes/java/math/BigInteger.java b/jdk/src/share/classes/java/math/BigInteger.java index 748a6c2f2b0..a4988deaa40 100644 --- a/jdk/src/share/classes/java/math/BigInteger.java +++ b/jdk/src/share/classes/java/math/BigInteger.java @@ -2919,6 +2919,7 @@ public class BigInteger extends Number implements Comparable { * result with the opposite sign. * * @return this BigInteger converted to an {@code int}. + * @see #intValueExact() */ public int intValue() { int result = 0; @@ -2939,6 +2940,7 @@ public class BigInteger extends Number implements Comparable { * result with the opposite sign. * * @return this BigInteger converted to a {@code long}. + * @see #longValueExact() */ public long longValue() { long result = 0; @@ -3382,4 +3384,84 @@ public class BigInteger extends Number implements Comparable { } return result; } + + /** + * Converts this {@code BigInteger} to a {@code long}, checking + * for lost information. If the value of this {@code BigInteger} + * is out of the range of the {@code long} type, then an + * {@code ArithmeticException} is thrown. + * + * @return this {@code BigInteger} converted to a {@code long}. + * @throws ArithmeticException if the value of {@code this} will + * not exactly fit in a {@code long}. + * @see BigInteger#longValue + * @since 1.8 + */ + public long longValueExact() { + if (mag.length <= 2 && bitLength() <= 63) + return longValue(); + else + throw new ArithmeticException("BigInteger out of long range"); + } + + /** + * Converts this {@code BigInteger} to an {@code int}, checking + * for lost information. If the value of this {@code BigInteger} + * is out of the range of the {@code int} type, then an + * {@code ArithmeticException} is thrown. + * + * @return this {@code BigInteger} converted to an {@code int}. + * @throws ArithmeticException if the value of {@code this} will + * not exactly fit in a {@code int}. + * @see BigInteger#intValue + * @since 1.8 + */ + public int intValueExact() { + if (mag.length <= 1 && bitLength() <= 31) + return intValue(); + else + throw new ArithmeticException("BigInteger out of int range"); + } + + /** + * Converts this {@code BigInteger} to a {@code short}, checking + * for lost information. If the value of this {@code BigInteger} + * is out of the range of the {@code short} type, then an + * {@code ArithmeticException} is thrown. + * + * @return this {@code BigInteger} converted to a {@code short}. + * @throws ArithmeticException if the value of {@code this} will + * not exactly fit in a {@code short}. + * @see BigInteger#shortValue + * @since 1.8 + */ + public short shortValueExact() { + if (mag.length <= 1 && bitLength() <= 31) { + int value = intValue(); + if (value >= Short.MIN_VALUE && value <= Short.MAX_VALUE) + return shortValue(); + } + throw new ArithmeticException("BigInteger out of short range"); + } + + /** + * Converts this {@code BigInteger} to a {@code byte}, checking + * for lost information. If the value of this {@code BigInteger} + * is out of the range of the {@code byte} type, then an + * {@code ArithmeticException} is thrown. + * + * @return this {@code BigInteger} converted to a {@code byte}. + * @throws ArithmeticException if the value of {@code this} will + * not exactly fit in a {@code byte}. + * @see BigInteger#byteValue + * @since 1.8 + */ + public byte byteValueExact() { + if (mag.length <= 1 && bitLength() <= 31) { + int value = intValue(); + if (value >= Byte.MIN_VALUE && value <= Byte.MAX_VALUE) + return byteValue(); + } + throw new ArithmeticException("BigInteger out of byte range"); + } } diff --git a/jdk/test/java/math/BigInteger/TestValueExact.java b/jdk/test/java/math/BigInteger/TestValueExact.java new file mode 100644 index 00000000000..63ee1583527 --- /dev/null +++ b/jdk/test/java/math/BigInteger/TestValueExact.java @@ -0,0 +1,194 @@ +/* + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 6371401 + * @summary Tests of fooValueExact methods + * @author Joseph D. Darcy + */ +import java.math.BigInteger; + +public class TestValueExact { + public static void main(String... args) { + int errors = 0; + + errors += testLongValueExact(); + errors += testIntValueExact(); + errors += testShortValueExact(); + errors += testByteValueExact(); + + if (errors > 0) + throw new RuntimeException(); + } + + private static int testLongValueExact() { + int errors = 0; + BigInteger[] inRange = { + BigInteger.valueOf(Long.MIN_VALUE), + BigInteger.ZERO, + BigInteger.valueOf(Long.MAX_VALUE) + }; + + BigInteger[] outOfRange = { + BigInteger.valueOf(Long.MIN_VALUE).subtract(BigInteger.ONE), + BigInteger.valueOf(Long.MAX_VALUE).add(BigInteger.ONE) + }; + + for (BigInteger bi : inRange) { + if (bi.longValueExact() != bi.longValue()) { + System.err.println("Mismatching int conversion for " + bi); + errors++; + } + } + + for (BigInteger bi : outOfRange) { + try { + long value = bi.longValueExact(); + System.err.println("Failed to get expected exception on " + + bi + " got " + value); + errors++; + } catch(ArithmeticException ae) { + ; // Expected + } + } + return errors; + } + + private static int testIntValueExact() { + int errors = 0; + BigInteger[] inRange = { + BigInteger.valueOf(Integer.MIN_VALUE), + BigInteger.ZERO, + BigInteger.ONE, + BigInteger.TEN, + BigInteger.valueOf(Integer.MAX_VALUE) + }; + + BigInteger[] outOfRange = { + BigInteger.valueOf((long)Integer.MIN_VALUE - 1), + BigInteger.valueOf((long)Integer.MAX_VALUE + 1) + }; + + for (BigInteger bi : inRange) { + if (bi.intValueExact() != bi.intValue()) { + System.err.println("Mismatching int conversion for " + bi); + errors++; + } + } + + for (BigInteger bi : outOfRange) { + try { + int value = bi.intValueExact(); + System.err.println("Failed to get expected exception on " + + bi + " got " + value); + errors++; + } catch(ArithmeticException ae) { + ; // Expected + } + } + return errors; + } + + private static int testShortValueExact() { + int errors = 0; + BigInteger[] inRange = { + BigInteger.valueOf(Short.MIN_VALUE), + BigInteger.ZERO, + BigInteger.ONE, + BigInteger.TEN, + BigInteger.valueOf(Short.MAX_VALUE) + }; + + BigInteger[] outOfRange = { + BigInteger.valueOf((long)Integer.MIN_VALUE - 1), + BigInteger.valueOf((long)Integer.MIN_VALUE), + BigInteger.valueOf( (int)Short.MIN_VALUE - 1), + BigInteger.valueOf( (int)Short.MAX_VALUE + 1), + BigInteger.valueOf((long)Integer.MAX_VALUE), + BigInteger.valueOf((long)Integer.MAX_VALUE + 1) + }; + + for (BigInteger bi : inRange) { + if (bi.shortValueExact() != bi.shortValue()) { + System.err.println("Mismatching short conversion for " + bi); + errors++; + } + } + + for (BigInteger bi : outOfRange) { + try { + int value = bi.shortValueExact(); + System.err.println("Failed to get expected exception on " + + bi + " got " + value); + errors++; + } catch(ArithmeticException ae) { + ; // Expected + } + } + return errors; + } + + private static int testByteValueExact() { + int errors = 0; + BigInteger[] inRange = { + BigInteger.valueOf(Byte.MIN_VALUE), + BigInteger.valueOf(0), + BigInteger.ONE, + BigInteger.TEN, + BigInteger.valueOf(Byte.MAX_VALUE) + }; + + BigInteger[] outOfRange = { + BigInteger.valueOf((long)Integer.MIN_VALUE - 1), + BigInteger.valueOf((long)Integer.MIN_VALUE), + BigInteger.valueOf( (int)Short.MIN_VALUE - 1), + BigInteger.valueOf( (int)Short.MIN_VALUE), + BigInteger.valueOf( (int)Byte.MIN_VALUE - 1), + BigInteger.valueOf( (int)Byte.MAX_VALUE + 1), + BigInteger.valueOf( (int)Short.MAX_VALUE + 1), + BigInteger.valueOf( (int)Short.MAX_VALUE), + BigInteger.valueOf((long)Integer.MAX_VALUE), + BigInteger.valueOf((long)Integer.MAX_VALUE + 1) + }; + + for (BigInteger bi : inRange) { + if (bi.byteValueExact() != bi.byteValue()) { + System.err.println("Mismatching byte conversion for " + bi); + errors++; + } + } + + for (BigInteger bi : outOfRange) { + try { + int value = bi.byteValueExact(); + System.err.println("Failed to get expected exception on " + + bi + " got " + value); + errors++; + } catch(ArithmeticException ae) { + ; // Expected + } + } + return errors; + } +} From 2c3a780b41a5577a45fc8469a3813dcff2bada57 Mon Sep 17 00:00:00 2001 From: Joe Darcy Date: Wed, 14 Sep 2011 13:09:15 -0700 Subject: [PATCH 04/23] 7088500: there is no @since tag on SafeVarargs Reviewed-by: mduigou --- jdk/src/share/classes/java/lang/SafeVarargs.java | 1 + 1 file changed, 1 insertion(+) diff --git a/jdk/src/share/classes/java/lang/SafeVarargs.java b/jdk/src/share/classes/java/lang/SafeVarargs.java index 818ea21bafb..cb14134ffbe 100644 --- a/jdk/src/share/classes/java/lang/SafeVarargs.java +++ b/jdk/src/share/classes/java/lang/SafeVarargs.java @@ -82,6 +82,7 @@ import java.lang.annotation.*; * * * + * @since 1.7 * @jls 4.7 Reifiable Types * @jls 8.4.1 Formal Parameters */ From d9777d76bdaf3c26ff1fbb0340f18200e75b9128 Mon Sep 17 00:00:00 2001 From: Mala Bankal Date: Wed, 14 Sep 2011 21:43:42 -0700 Subject: [PATCH 05/23] 7049963: DISTINGUISHED NAMES FOR CERT ARE ESCAPED IN JROCKIT 1.6(NOT COMPATIBLE WITH JROC Reviewed-by: mullan --- jdk/src/share/classes/sun/security/x509/AVA.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/jdk/src/share/classes/sun/security/x509/AVA.java b/jdk/src/share/classes/sun/security/x509/AVA.java index e1d49611c16..b07e565cfbd 100644 --- a/jdk/src/share/classes/sun/security/x509/AVA.java +++ b/jdk/src/share/classes/sun/security/x509/AVA.java @@ -1071,8 +1071,17 @@ public class AVA implements DerEncoder { * to need quoting, or at least escaping. So do leading or * trailing spaces, and multiple internal spaces. */ - for (int i = 0; i < valStr.length(); i++) { + int length = valStr.length(); + boolean alreadyQuoted = + (length > 1 && valStr.charAt(0) == '\"' + && valStr.charAt(length - 1) == '\"'); + + for (int i = 0; i < length; i++) { char c = valStr.charAt(i); + if (alreadyQuoted && (i == 0 || i == length - 1)) { + sbuffer.append(c); + continue; + } if (DerValue.isPrintableStringChar(c) || escapees.indexOf(c) >= 0) { @@ -1136,7 +1145,8 @@ public class AVA implements DerEncoder { } // Emit the string ... quote it if needed - if (quoteNeeded) { + // if string is already quoted, don't re-quote + if (!alreadyQuoted && quoteNeeded) { retval.append("\"" + sbuffer.toString() + "\""); } else { retval.append(sbuffer.toString()); From 3674ebe6e6c90b9c6d149fd3b2ac0d00302ec520 Mon Sep 17 00:00:00 2001 From: Yuka Kamiya Date: Thu, 15 Sep 2011 14:45:35 +0900 Subject: [PATCH 06/23] 7090844: Support a timezone whose offset is changed more than once in the future Reviewed-by: okutsu --- jdk/make/tools/src/build/tools/javazic/Mappings.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/jdk/make/tools/src/build/tools/javazic/Mappings.java b/jdk/make/tools/src/build/tools/javazic/Mappings.java index 954d3d5988f..5e5498a675c 100644 --- a/jdk/make/tools/src/build/tools/javazic/Mappings.java +++ b/jdk/make/tools/src/build/tools/javazic/Mappings.java @@ -76,8 +76,8 @@ class Mappings { // If the GMT offset of this Zone will change in some // future time, this Zone is added to the exclude list. boolean isExcluded = false; - if (zone.size() > 1) { - ZoneRec zrec = zone.get(zone.size()-2); + for (int i = 0; i < zone.size(); i++) { + ZoneRec zrec = zone.get(i); if ((zrec.getGmtOffset() != rawOffset) && (zrec.getUntilTime(0) > Time.getCurrentTime())) { if (excludeList == null) { @@ -85,6 +85,7 @@ class Mappings { } excludeList.add(zone.getName()); isExcluded = true; + break; } } From 0594a394983fff71184f77b5014436c1f08469fb Mon Sep 17 00:00:00 2001 From: Yuka Kamiya Date: Thu, 15 Sep 2011 15:02:05 +0900 Subject: [PATCH 07/23] 7090843: (tz) Support tzdata2011j Reviewed-by: okutsu --- jdk/make/sun/javazic/tzdata/VERSION | 2 +- jdk/make/sun/javazic/tzdata/africa | 13 +- jdk/make/sun/javazic/tzdata/antarctica | 12 -- jdk/make/sun/javazic/tzdata/asia | 4 + jdk/make/sun/javazic/tzdata/australasia | 72 +++++++++- jdk/make/sun/javazic/tzdata/europe | 68 +++++++--- jdk/make/sun/javazic/tzdata/iso3166.tab | 8 +- jdk/make/sun/javazic/tzdata/northamerica | 128 ++++++++++++++---- jdk/make/sun/javazic/tzdata/southamerica | 8 ++ jdk/make/sun/javazic/tzdata/zone.tab | 7 +- .../sun/util/resources/TimeZoneNames.java | 10 +- .../sun/util/resources/TimeZoneNames_de.java | 10 +- .../sun/util/resources/TimeZoneNames_es.java | 10 +- .../sun/util/resources/TimeZoneNames_fr.java | 10 +- .../sun/util/resources/TimeZoneNames_it.java | 10 +- .../sun/util/resources/TimeZoneNames_ja.java | 10 +- .../sun/util/resources/TimeZoneNames_ko.java | 10 +- .../util/resources/TimeZoneNames_pt_BR.java | 10 +- .../sun/util/resources/TimeZoneNames_sv.java | 10 +- .../util/resources/TimeZoneNames_zh_CN.java | 10 +- .../util/resources/TimeZoneNames_zh_TW.java | 10 +- 21 files changed, 323 insertions(+), 109 deletions(-) diff --git a/jdk/make/sun/javazic/tzdata/VERSION b/jdk/make/sun/javazic/tzdata/VERSION index c52096254ae..9ccfe4c299f 100644 --- a/jdk/make/sun/javazic/tzdata/VERSION +++ b/jdk/make/sun/javazic/tzdata/VERSION @@ -21,4 +21,4 @@ # or visit www.oracle.com if you need additional information or have any # questions. # -tzdata2011g +tzdata2011j diff --git a/jdk/make/sun/javazic/tzdata/africa b/jdk/make/sun/javazic/tzdata/africa index a43e73ce10b..6fb9d645000 100644 --- a/jdk/make/sun/javazic/tzdata/africa +++ b/jdk/make/sun/javazic/tzdata/africa @@ -80,7 +80,7 @@ # I invented the following abbreviations; corrections are welcome! # 2:00 WAST West Africa Summer Time # 2:30 BEAT British East Africa Time (no longer used) -# 2:44:45 BEAUT British East Africa Unified Time (no longer used) +# 2:45 BEAUT British East Africa Unified Time (no longer used) # 3:00 CAST Central Africa Summer Time (no longer used) # 3:00 SAST South Africa Summer Time (no longer used) # 3:00 EAT East Africa Time @@ -418,7 +418,7 @@ Zone Africa/Bissau -1:02:20 - LMT 1911 May 26 Zone Africa/Nairobi 2:27:16 - LMT 1928 Jul 3:00 - EAT 1930 2:30 - BEAT 1940 - 2:44:45 - BEAUT 1960 + 2:45 - BEAUT 1960 3:00 - EAT # Lesotho @@ -979,6 +979,11 @@ Zone Africa/Khartoum 2:10:08 - LMT 1931 2:00 Sudan CA%sT 2000 Jan 15 12:00 3:00 - EAT +# South Sudan +Zone Africa/Juba 2:06:24 - LMT 1931 + 2:00 Sudan CA%sT 2000 Jan 15 12:00 + 3:00 - EAT + # Swaziland # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Africa/Mbabane 2:04:24 - LMT 1903 Mar @@ -988,7 +993,7 @@ Zone Africa/Mbabane 2:04:24 - LMT 1903 Mar # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Africa/Dar_es_Salaam 2:37:08 - LMT 1931 3:00 - EAT 1948 - 2:44:45 - BEAUT 1961 + 2:45 - BEAUT 1961 3:00 - EAT # Togo @@ -1114,7 +1119,7 @@ Zone Africa/Tunis 0:40:44 - LMT 1881 May 12 Zone Africa/Kampala 2:09:40 - LMT 1928 Jul 3:00 - EAT 1930 2:30 - BEAT 1948 - 2:44:45 - BEAUT 1957 + 2:45 - BEAUT 1957 3:00 - EAT # Zambia diff --git a/jdk/make/sun/javazic/tzdata/antarctica b/jdk/make/sun/javazic/tzdata/antarctica index 17f44a8286a..2fa4232a60c 100644 --- a/jdk/make/sun/javazic/tzdata/antarctica +++ b/jdk/make/sun/javazic/tzdata/antarctica @@ -41,18 +41,6 @@ # I made up all time zone abbreviations mentioned here; corrections welcome! # FORMAT is `zzz' and GMTOFF is 0 for locations while uninhabited. -# These rules are stolen from the `europe' file. -# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S -Rule RussAQ 1981 1984 - Apr 1 0:00 1:00 S -Rule RussAQ 1981 1983 - Oct 1 0:00 0 - -Rule RussAQ 1984 1991 - Sep lastSun 2:00s 0 - -Rule RussAQ 1985 1991 - Mar lastSun 2:00s 1:00 S -Rule RussAQ 1992 only - Mar lastSat 23:00 1:00 S -Rule RussAQ 1992 only - Sep lastSat 23:00 0 - -Rule RussAQ 1993 max - Mar lastSun 2:00s 1:00 S -Rule RussAQ 1993 1995 - Sep lastSun 2:00s 0 - -Rule RussAQ 1996 max - Oct lastSun 2:00s 0 - - # These rules are stolen from the `southamerica' file. # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule ArgAQ 1964 1966 - Mar 1 0:00 0 - diff --git a/jdk/make/sun/javazic/tzdata/asia b/jdk/make/sun/javazic/tzdata/asia index d4d8ab1115e..36c52373004 100644 --- a/jdk/make/sun/javazic/tzdata/asia +++ b/jdk/make/sun/javazic/tzdata/asia @@ -99,6 +99,10 @@ Rule RussiaAsia 1993 max - Mar lastSun 2:00s 1:00 S Rule RussiaAsia 1993 1995 - Sep lastSun 2:00s 0 - Rule RussiaAsia 1996 max - Oct lastSun 2:00s 0 - +# From Arthur David Olson (2011-06-15): +# While Russia abandoned DST in 2011, Armenia may choose to +# follow Russia's "old" rules. + # Afghanistan # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Kabul 4:36:48 - LMT 1890 diff --git a/jdk/make/sun/javazic/tzdata/australasia b/jdk/make/sun/javazic/tzdata/australasia index 61d338f9683..0330fcd9234 100644 --- a/jdk/make/sun/javazic/tzdata/australasia +++ b/jdk/make/sun/javazic/tzdata/australasia @@ -521,7 +521,7 @@ Zone Pacific/Pago_Pago 12:37:12 - LMT 1879 Jul 5 # http://www.parliament.gov.ws/documents/acts/Daylight%20Saving%20Act%20%202009%20%28English%29%20-%20Final%207-7-091.pdf # -# From Raymond Hughes (2010-10-07): +# From Laupue Raymond Hughes (2010-10-07): # Please see # # http://www.mcil.gov.ws @@ -531,7 +531,7 @@ Zone Pacific/Pago_Pago 12:37:12 - LMT 1879 Jul 5 # to 01:00am and First Sunday April 2011 (03/04/11) - adjust clocks # backwards from 1:00am to 12:00am" -# From Raymond Hughes (2011-03-07) +# From Laupue Raymond Hughes (2011-03-07): # I believe this will be posted shortly on the website # # www.mcil.gov.ws @@ -551,12 +551,74 @@ Zone Pacific/Pago_Pago 12:37:12 - LMT 1879 Jul 5 # Margaret Fruean ACTING CHIEF EXECUTIVE OFFICER MINISTRY OF COMMERCE, # INDUSTRY AND LABOUR 28th February 2011 +# From David Zuelke (2011-05-09): +# Subject: Samoa to move timezone from east to west of international date line +# +# +# http://www.morningstar.co.uk/uk/markets/newsfeeditem.aspx?id=138501958347963 +# + +# From Mark Sim-Smith (2011-08-17): +# I have been in contact with Leilani Tuala Warren from the Samoa Law +# Reform Commission, and she has sent me a copy of the Bill that she +# confirmed has been passed...Most of the sections are about maps rather +# than the time zone change, but I'll paste the relevant bits below. But +# the essence is that at midnight 29 Dec (UTC-11 I suppose), Samoa +# changes from UTC-11 to UTC+13: +# +# International Date Line Bill 2011 +# +# AN ACT to provide for the change to standard time in Samoa and to make +# consequential amendments to the position of the International Date +# Line, and for related purposes. +# +# BE IT ENACTED by the Legislative Assembly of Samoa in Parliament +# assembled as follows: +# +# 1. Short title and commencement-(1) This Act may be cited as the +# International Date Line Act 2011. (2) Except for section 5(3) this Act +# commences at 12 o'clock midnight, on Thursday 29th December 2011. (3) +# Section 5(3) commences on the date of assent by the Head of State. +# +# [snip] +# +# 3. Interpretation - [snip] "Samoa standard time" in this Act and any +# other statute of Samoa which refers to 'Samoa standard time' means the +# time 13 hours in advance of Co-ordinated Universal Time. +# +# 4. Samoa standard time - (1) Upon the commencement of this Act, Samoa +# standard time shall be set at 13 hours in advance of Co-ordinated +# Universal Time for the whole of Samoa. (2) All references to Samoa's +# time zone and to Samoa standard time in Samoa in all legislation and +# instruments after the commencement of this Act shall be references to +# Samoa standard time as provided for in this Act. (3) Nothing in this +# Act affects the provisions of the Daylight Saving Act 2009, except that +# it defines Samoa standard time.... + +# From Laupue Raymond Hughes (2011-09-02): +# +# http://www.mcil.gov.ws/mcil_publications.html +# +# +# here is the official website publication for Samoa DST and dateline change +# +# DST +# Year End Time Start Time +# 2011 - - - - - - 24 September 3:00am to 4:00am +# 2012 01 April 4:00am to 3:00am - - - - - - +# +# Dateline Change skip Friday 30th Dec 2011 +# Thursday 29th December 2011 23:59:59 Hours +# Saturday 31st December 2011 00:00:00 Hours Zone Pacific/Apia 12:33:04 - LMT 1879 Jul 5 -11:26:56 - LMT 1911 -11:30 - SAMT 1950 # Samoa Time -11:00 - WST 2010 Sep 26 -11:00 1:00 WSDT 2011 Apr 2 4:00 - -11:00 - WST + -11:00 - WST 2011 Sep 24 3:00 + -11:00 1:00 WSDT 2011 Dec 30 + 13:00 1:00 WSDT 2012 Apr 1 4:00 + 13:00 - WST # Solomon Is # excludes Bougainville, for which see Papua New Guinea @@ -1228,7 +1290,7 @@ Zone Pacific/Wallis 12:15:20 - LMT 1901 # Lord Howe Island Board (controlling authority for the Island) is # seeking the community's views on various options for summer time # arrangements on the Island, e.g. advance clocks by 1 full hour -# instead of only 30 minutes. Dependant on the wishes of residents +# instead of only 30 minutes. [Dependent] on the wishes of residents # the Board may approach the NSW government to change the existing # arrangements. The starting date for summer time on the Island will # however always coincide with the rest of NSW. @@ -1354,7 +1416,7 @@ Zone Pacific/Wallis 12:15:20 - LMT 1901 # From Paul Eggert (1996-01-22): # Today's _Wall Street Journal_ (page 1) reports that Kiribati -# ``declared it the same day throught the country as of Jan. 1, 1995'' +# ``declared it the same day [throughout] the country as of Jan. 1, 1995'' # as part of the competition to be first into the 21st century. diff --git a/jdk/make/sun/javazic/tzdata/europe b/jdk/make/sun/javazic/tzdata/europe index 89bf6c5d3dc..5c6abc17424 100644 --- a/jdk/make/sun/javazic/tzdata/europe +++ b/jdk/make/sun/javazic/tzdata/europe @@ -587,6 +587,26 @@ Rule Russia 1993 max - Mar lastSun 2:00s 1:00 S Rule Russia 1993 1995 - Sep lastSun 2:00s 0 - Rule Russia 1996 max - Oct lastSun 2:00s 0 - +# From Alexander Krivenyshev (2011-06-14): +# According to Kremlin press service, Russian President Dmitry Medvedev +# signed a federal law "On calculation of time" on June 9, 2011. +# According to the law Russia is abolishing daylight saving time. +# +# Medvedev signed a law "On the Calculation of Time" (in russian): +# +# http://bmockbe.ru/events/?ID=7583 +# +# +# Medvedev signed a law on the calculation of the time (in russian): +# +# http://www.regnum.ru/news/polit/1413906.html +# + +# From Arthur David Olson (2011-06-15): +# Take "abolishing daylight saving time" to mean that time is now considered +# to be standard. +# At least for now, keep the "old" Russia rules for the benefit of Belarus. + # These are for backward compatibility with older versions. # Zone NAME GMTOFF RULES FORMAT [UNTIL] @@ -2035,7 +2055,8 @@ Zone Europe/Kaliningrad 1:22:00 - LMT 1893 Apr 1:00 C-Eur CE%sT 1945 2:00 Poland CE%sT 1946 3:00 Russia MSK/MSD 1991 Mar 31 2:00s - 2:00 Russia EE%sT + 2:00 Russia EE%sT 2011 Mar 27 2:00s + 3:00 - KALT # # From Oscar van Vlijmen (2001-08-25): [This region consists of] # Respublika Adygeya, Arkhangel'skaya oblast', @@ -2064,7 +2085,8 @@ Zone Europe/Moscow 2:30:20 - LMT 1880 2:00 - EET 1930 Jun 21 3:00 Russia MSK/MSD 1991 Mar 31 2:00s 2:00 Russia EE%sT 1992 Jan 19 2:00s - 3:00 Russia MSK/MSD + 3:00 Russia MSK/MSD 2011 Mar 27 2:00s + 4:00 - MSK # # Astrakhanskaya oblast', Kirovskaya oblast', Saratovskaya oblast', # Volgogradskaya oblast'. Shanks & Pottenger say Kirov is still at +0400 @@ -2077,7 +2099,8 @@ Zone Europe/Volgograd 2:57:40 - LMT 1920 Jan 3 4:00 Russia VOL%sT 1989 Mar 26 2:00s # Volgograd T 3:00 Russia VOL%sT 1991 Mar 31 2:00s 4:00 - VOLT 1992 Mar 29 2:00s - 3:00 Russia VOL%sT + 3:00 Russia VOL%sT 2011 Mar 27 2:00s + 4:00 - VOLT # # From Oscar van Vlijmen (2001-08-25): [This region consists of] # Samarskaya oblast', Udmyrtskaya respublika @@ -2089,7 +2112,8 @@ Zone Europe/Samara 3:20:36 - LMT 1919 Jul 1 2:00 2:00 Russia KUY%sT 1991 Sep 29 2:00s 3:00 - KUYT 1991 Oct 20 3:00 4:00 Russia SAM%sT 2010 Mar 28 2:00s # Samara Time - 3:00 Russia SAM%sT + 3:00 Russia SAM%sT 2011 Mar 27 2:00s + 4:00 - SAMT # # From Oscar van Vlijmen (2001-08-25): [This region consists of] @@ -2102,7 +2126,8 @@ Zone Asia/Yekaterinburg 4:02:24 - LMT 1919 Jul 15 4:00 4:00 - SVET 1930 Jun 21 # Sverdlovsk Time 5:00 Russia SVE%sT 1991 Mar 31 2:00s 4:00 Russia SVE%sT 1992 Jan 19 2:00s - 5:00 Russia YEK%sT # Yekaterinburg Time + 5:00 Russia YEK%sT 2011 Mar 27 2:00s + 6:00 - YEKT # Yekaterinburg Time # # From Oscar van Vlijmen (2001-08-25): [This region consists of] # Respublika Altaj, Altajskij kraj, Omskaya oblast'. @@ -2110,7 +2135,8 @@ Zone Asia/Omsk 4:53:36 - LMT 1919 Nov 14 5:00 - OMST 1930 Jun 21 # Omsk TIme 6:00 Russia OMS%sT 1991 Mar 31 2:00s 5:00 Russia OMS%sT 1992 Jan 19 2:00s - 6:00 Russia OMS%sT + 6:00 Russia OMS%sT 2011 Mar 27 2:00s + 7:00 - OMST # # From Paul Eggert (2006-08-19): I'm guessing about Tomsk here; it's # not clear when it switched from +7 to +6. @@ -2120,7 +2146,8 @@ Zone Asia/Novosibirsk 5:31:40 - LMT 1919 Dec 14 6:00 7:00 Russia NOV%sT 1991 Mar 31 2:00s 6:00 Russia NOV%sT 1992 Jan 19 2:00s 7:00 Russia NOV%sT 1993 May 23 # say Shanks & P. - 6:00 Russia NOV%sT + 6:00 Russia NOV%sT 2011 Mar 27 2:00s + 7:00 - NOVT # From Alexander Krivenyshev (2009-10-13): # Kemerovo oblast' (Kemerovo region) in Russia will change current time zone on @@ -2153,7 +2180,8 @@ Zone Asia/Novokuznetsk 5:48:48 - NMT 1920 Jan 6 7:00 Russia KRA%sT 1991 Mar 31 2:00s 6:00 Russia KRA%sT 1992 Jan 19 2:00s 7:00 Russia KRA%sT 2010 Mar 28 2:00s - 6:00 Russia NOV%sT # Novosibirsk/Novokuznetsk Time + 6:00 Russia NOV%sT 2011 Mar 27 2:00s + 7:00 - NOVT # Novosibirsk/Novokuznetsk Time # # From Oscar van Vlijmen (2001-08-25): [This region consists of] @@ -2164,7 +2192,8 @@ Zone Asia/Krasnoyarsk 6:11:20 - LMT 1920 Jan 6 6:00 - KRAT 1930 Jun 21 # Krasnoyarsk Time 7:00 Russia KRA%sT 1991 Mar 31 2:00s 6:00 Russia KRA%sT 1992 Jan 19 2:00s - 7:00 Russia KRA%sT + 7:00 Russia KRA%sT 2011 Mar 27 2:00s + 8:00 - KRAT # # From Oscar van Vlijmen (2001-08-25): [This region consists of] # Respublika Buryatiya, Irkutskaya oblast', @@ -2174,7 +2203,8 @@ Zone Asia/Irkutsk 6:57:20 - LMT 1880 7:00 - IRKT 1930 Jun 21 # Irkutsk Time 8:00 Russia IRK%sT 1991 Mar 31 2:00s 7:00 Russia IRK%sT 1992 Jan 19 2:00s - 8:00 Russia IRK%sT + 8:00 Russia IRK%sT 2011 Mar 27 2:00s + 9:00 - IRKT # # From Oscar van Vlijmen (2003-10-18): [This region consists of] # Aginskij Buryatskij avtonomnyj okrug, Amurskaya oblast', @@ -2197,7 +2227,8 @@ Zone Asia/Yakutsk 8:38:40 - LMT 1919 Dec 15 8:00 - YAKT 1930 Jun 21 # Yakutsk Time 9:00 Russia YAK%sT 1991 Mar 31 2:00s 8:00 Russia YAK%sT 1992 Jan 19 2:00s - 9:00 Russia YAK%sT + 9:00 Russia YAK%sT 2011 Mar 27 2:00s + 10:00 - YAKT # # From Oscar van Vlijmen (2003-10-18): [This region consists of] # Evrejskaya avtonomnaya oblast', Khabarovskij kraj, Primorskij kraj, @@ -2210,7 +2241,8 @@ Zone Asia/Vladivostok 8:47:44 - LMT 1922 Nov 15 9:00 - VLAT 1930 Jun 21 # Vladivostok Time 10:00 Russia VLA%sT 1991 Mar 31 2:00s 9:00 Russia VLA%sST 1992 Jan 19 2:00s - 10:00 Russia VLA%sT + 10:00 Russia VLA%sT 2011 Mar 27 2:00s + 11:00 - VLAT # # Sakhalinskaya oblast'. # The Zone name should be Yuzhno-Sakhalinsk, but that's too long. @@ -2220,7 +2252,8 @@ Zone Asia/Sakhalin 9:30:48 - LMT 1905 Aug 23 11:00 Russia SAK%sT 1991 Mar 31 2:00s # Sakhalin T. 10:00 Russia SAK%sT 1992 Jan 19 2:00s 11:00 Russia SAK%sT 1997 Mar lastSun 2:00s - 10:00 Russia SAK%sT + 10:00 Russia SAK%sT 2011 Mar 27 2:00s + 11:00 - SAKT # # From Oscar van Vlijmen (2003-10-18): [This region consists of] # Magadanskaya oblast', Respublika Sakha (Yakutiya). @@ -2233,7 +2266,8 @@ Zone Asia/Magadan 10:03:12 - LMT 1924 May 2 10:00 - MAGT 1930 Jun 21 # Magadan Time 11:00 Russia MAG%sT 1991 Mar 31 2:00s 10:00 Russia MAG%sT 1992 Jan 19 2:00s - 11:00 Russia MAG%sT + 11:00 Russia MAG%sT 2011 Mar 27 2:00s + 12:00 - MAGT # # From Oscar van Vlijmen (2001-08-25): [This region consists of] # Kamchatskaya oblast', Koryakskij avtonomnyj okrug. @@ -2244,7 +2278,8 @@ Zone Asia/Kamchatka 10:34:36 - LMT 1922 Nov 10 12:00 Russia PET%sT 1991 Mar 31 2:00s 11:00 Russia PET%sT 1992 Jan 19 2:00s 12:00 Russia PET%sT 2010 Mar 28 2:00s - 11:00 Russia PET%sT + 11:00 Russia PET%sT 2011 Mar 27 2:00s + 12:00 - PETT # # Chukotskij avtonomnyj okrug Zone Asia/Anadyr 11:49:56 - LMT 1924 May 2 @@ -2253,7 +2288,8 @@ Zone Asia/Anadyr 11:49:56 - LMT 1924 May 2 12:00 Russia ANA%sT 1991 Mar 31 2:00s 11:00 Russia ANA%sT 1992 Jan 19 2:00s 12:00 Russia ANA%sT 2010 Mar 28 2:00s - 11:00 Russia ANA%sT + 11:00 Russia ANA%sT 2011 Mar 27 2:00s + 12:00 - ANAT # Serbia # Zone NAME GMTOFF RULES FORMAT [UNTIL] diff --git a/jdk/make/sun/javazic/tzdata/iso3166.tab b/jdk/make/sun/javazic/tzdata/iso3166.tab index f582cad45eb..fee3f33911a 100644 --- a/jdk/make/sun/javazic/tzdata/iso3166.tab +++ b/jdk/make/sun/javazic/tzdata/iso3166.tab @@ -43,6 +43,9 @@ # # Lines beginning with `#' are comments. # +# From Arthur David Olson (2011-08-17): +# Resynchronized today with the ISO 3166 site (adding SS for South Sudan). +# #country- #code country name AD Andorra @@ -52,7 +55,6 @@ AG Antigua & Barbuda AI Anguilla AL Albania AM Armenia -AN Netherlands Antilles AO Angola AQ Antarctica AR Argentina @@ -75,6 +77,7 @@ BL St Barthelemy BM Bermuda BN Brunei BO Bolivia +BQ Bonaire Sint Eustatius & Saba BR Brazil BS Bahamas BT Bhutan @@ -97,6 +100,7 @@ CO Colombia CR Costa Rica CU Cuba CV Cape Verde +CW Curacao CX Christmas Island CY Cyprus CZ Czech Republic @@ -251,8 +255,10 @@ SM San Marino SN Senegal SO Somalia SR Suriname +SS South Sudan ST Sao Tome & Principe SV El Salvador +SX Sint Maarten SY Syria SZ Swaziland TC Turks & Caicos Is diff --git a/jdk/make/sun/javazic/tzdata/northamerica b/jdk/make/sun/javazic/tzdata/northamerica index 7111cb7048d..d31b7f0ad03 100644 --- a/jdk/make/sun/javazic/tzdata/northamerica +++ b/jdk/make/sun/javazic/tzdata/northamerica @@ -490,6 +490,10 @@ Zone America/Los_Angeles -7:52:58 - LMT 1883 Nov 18 12:07:02 # own time. I asked about daylight saving; they said it wasn't used. I # did not inquire about practices in the past. +# From Arthur David Olson (2011-08-17): +# For lack of better information, assume that Metlakatla's +# abandonment of use of daylight saving resulted from the 1983 vote. + # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone America/Juneau 15:02:19 - LMT 1867 Oct 18 -8:57:41 - LMT 1900 Aug 20 12:00 @@ -515,7 +519,7 @@ Zone America/Metlakatla 15:13:42 - LMT 1867 Oct 18 -8:00 US P%sT 1946 -8:00 - PST 1969 -8:00 US P%sT 1983 Oct 30 2:00 - -8:00 US MeST + -8:00 - MeST Zone America/Yakutat 14:41:05 - LMT 1867 Oct 18 -9:18:55 - LMT 1900 Aug 20 12:00 -9:00 - YST 1942 @@ -615,8 +619,8 @@ Zone Pacific/Honolulu -10:31:26 - LMT 1896 Jan 13 12:00 #Schmitt&Cox -10:30 - HST 1933 Apr 30 2:00 #Laws 1933 -10:30 1:00 HDT 1933 May 21 12:00 #Laws 1933+12 -10:30 - HST 1942 Feb 09 2:00 #Schmitt&Cox+2 - -10:30 1:00 HDT 1945 Sep 30 2:00 #Schmitt&Fox+2 - -10:30 US H%sT 1947 Jun 8 2:00 #Schmitt&Fox+2 + -10:30 1:00 HDT 1945 Sep 30 2:00 #Schmitt&Cox+2 + -10:30 - HST 1947 Jun 8 2:00 #Schmitt&Cox+2 -10:00 - HST # Now we turn to US areas that have diverged from the consensus since 1970. @@ -1185,12 +1189,39 @@ Rule StJohns 1960 1986 - Oct lastSun 2:00 0 S # From Paul Eggert (2000-10-02): # INMS (2000-09-12) says that, since 1988 at least, Newfoundland switches # at 00:01 local time. For now, assume it started in 1987. + +# From Michael Pelley (2011-08-05): +# The Government of Newfoundland and Labrador has pending changes to +# modify the hour for daylight savings time to come into effect in +# November 2011. This modification would change the time from 12:01AM to +# 2:00AM on the dates of the switches of Daylight Savings Time to/from +# Standard Time. +# +# As a matter of reference, in Canada provinces have the authority of +# setting time zone information. The legislation has passed our +# legislative body (The House of Assembly) and is awaiting the +# proclamation to come into effect. You may find this information at: +# +# http://www.assembly.nl.ca/legislation/sr/lists/Proclamation.htm +# +# and +# search within that web page for Standard Time (Amendment) Act. The Act +# may be found at: +# +# http://www.assembly.nl.ca/business/bills/Bill1106.htm +# +# ... +# MICHAEL PELLEY | Manager of Enterprise Architecture - Solution Delivery +# Office of the Chief Information Officer Executive Council Government of +# Newfoundland & Labrador P.O. Box 8700, 40 Higgins Line, St. John's NL +# A1B 4J6 + Rule StJohns 1987 only - Apr Sun>=1 0:01 1:00 D Rule StJohns 1987 2006 - Oct lastSun 0:01 0 S Rule StJohns 1988 only - Apr Sun>=1 0:01 2:00 DD Rule StJohns 1989 2006 - Apr Sun>=1 0:01 1:00 D -Rule StJohns 2007 max - Mar Sun>=8 0:01 1:00 D -Rule StJohns 2007 max - Nov Sun>=1 0:01 0 S +Rule StJohns 2007 2011 - Mar Sun>=8 0:01 1:00 D +Rule StJohns 2007 2010 - Nov Sun>=1 0:01 0 S # # St John's has an apostrophe, but Posix file names can't have apostrophes. # Zone NAME GMTOFF RULES FORMAT [UNTIL] @@ -1200,7 +1231,8 @@ Zone America/St_Johns -3:30:52 - LMT 1884 -3:30:52 StJohns N%sT 1935 Mar 30 -3:30 StJohns N%sT 1942 May 11 -3:30 Canada N%sT 1946 - -3:30 StJohns N%sT + -3:30 StJohns N%sT 2011 Nov + -3:30 Canada N%sT # most of east Labrador @@ -1214,7 +1246,8 @@ Zone America/Goose_Bay -4:01:40 - LMT 1884 # Happy Valley-Goose Bay -3:30 StJohns N%sT 1942 May 11 -3:30 Canada N%sT 1946 -3:30 StJohns N%sT 1966 Mar 15 2:00 - -4:00 StJohns A%sT + -4:00 StJohns A%sT 2011 Nov + -4:00 Canada A%sT # west Labrador, Nova Scotia, Prince Edward I @@ -1946,20 +1979,69 @@ Zone America/Dawson_Creek -8:00:56 - LMT 1884 # daylight saving.... # http://www.nnsl.com/frames/newspapers/2006-11/nov13_06none.html -# From Chris Walton (2007-03-14): -# Today I phoned the "hamlet office" to find out what Resolute was doing with -# its clocks. +# From Chris Walton (2011-03-21): +# Back in 2007 I initiated the creation of a new "zone file" for Resolute +# Bay. Resolute Bay is a small community located about 900km north of +# the Arctic Circle. The zone file was required because Resolute Bay had +# decided to use UTC-5 instead of UTC-6 for the winter of 2006-2007. # -# The individual that answered the phone confirmed that the clocks did not -# move at the end of daylight saving on October 29/2006. He also told me that -# the clocks did not move this past weekend (March 11/2007).... - -# From Chris Walton (2008-11-13): -# ...the residents of Resolute believe that they are changing "time zones" -# twice a year. In winter months, local time is qualified with "Eastern -# Time" which is really "Eastern Standard Time (UTC-5)". In summer -# months, local time is qualified with "Central Time" which is really -# "Central Daylight Time (UTC-5)"... +# According to new information which I received last week, Resolute Bay +# went back to using UTC-6 in the winter of 2007-2008... +# +# On March 11/2007 most of Canada went onto daylight saving. On March +# 14/2007 I phoned the Resolute Bay hamlet office to do a "time check." I +# talked to somebody that was both knowledgeable and helpful. I was able +# to confirm that Resolute Bay was still operating on UTC-5. It was +# explained to me that Resolute Bay had been on the Eastern Time zone +# (EST) in the winter, and was now back on the Central Time zone (CDT). +# i.e. the time zone had changed twice in the last year but the clocks +# had not moved. The residents had to know which time zone they were in +# so they could follow the correct TV schedule... +# +# On Nov 02/2008 most of Canada went onto standard time. On Nov 03/2008 I +# phoned the Resolute Bay hamlet office...[D]ue to the challenging nature +# of the phone call, I decided to seek out an alternate source of +# information. I found an e-mail address for somebody by the name of +# Stephanie Adams whose job was listed as "Inns North Support Officer for +# Arctic Co-operatives." I was under the impression that Stephanie lived +# and worked in Resolute Bay... +# +# On March 14/2011 I phoned the hamlet office again. I was told that +# Resolute Bay had been using Central Standard Time over the winter of +# 2010-2011 and that the clocks had therefore been moved one hour ahead +# on March 13/2011. The person I talked to was aware that Resolute Bay +# had previously experimented with Eastern Standard Time but he could not +# tell me when the practice had stopped. +# +# On March 17/2011 I searched the Web to find an e-mail address of +# somebody that might be able to tell me exactly when Resolute Bay went +# off Eastern Standard Time. I stumbled on the name "Aziz Kheraj." Aziz +# used to be the mayor of Resolute Bay and he apparently owns half the +# businesses including "South Camp Inn." This website has some info on +# Aziz: +# +# http://www.uphere.ca/node/493 +# +# +# I sent Aziz an e-mail asking when Resolute Bay had stopped using +# Eastern Standard Time. +# +# Aziz responded quickly with this: "hi, The time was not changed for the +# 1 year only, the following year, the community went back to the old way +# of "spring ahead-fall behind" currently we are zulu plus 5 hrs and in +# the winter Zulu plus 6 hrs" +# +# This of course conflicted with everything I had ascertained in November 2008. +# +# I sent Aziz a copy of my 2008 e-mail exchange with Stephanie. Aziz +# responded with this: "Hi, Stephanie lives in Winnipeg. I live here, You +# may want to check with the weather office in Resolute Bay or do a +# search on the weather through Env. Canada. web site" +# +# If I had realized the Stephanie did not live in Resolute Bay I would +# never have contacted her. I now believe that all the information I +# obtained in November 2008 should be ignored... +# I apologize for reporting incorrect information in 2008. # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule NT_YK 1918 only - Apr 14 2:00 1:00 D @@ -1987,14 +2069,12 @@ Zone America/Iqaluit 0 - zzz 1942 Aug # Frobisher Bay est. -6:00 Canada C%sT 2000 Oct 29 2:00 -5:00 Canada E%sT # aka Qausuittuq -# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S -Rule Resolute 2006 max - Nov Sun>=1 2:00 0 ES -Rule Resolute 2007 max - Mar Sun>=8 2:00 0 CD Zone America/Resolute 0 - zzz 1947 Aug 31 # Resolute founded -6:00 NT_YK C%sT 2000 Oct 29 2:00 -5:00 - EST 2001 Apr 1 3:00 -6:00 Canada C%sT 2006 Oct 29 2:00 - -5:00 Resolute %sT + -5:00 - EST 2007 Mar 11 3:00 + -6:00 Canada C%sT # aka Kangiqiniq Zone America/Rankin_Inlet 0 - zzz 1957 # Rankin Inlet founded -6:00 NT_YK C%sT 2000 Oct 29 2:00 diff --git a/jdk/make/sun/javazic/tzdata/southamerica b/jdk/make/sun/javazic/tzdata/southamerica index 7717d12d17a..215d95defbc 100644 --- a/jdk/make/sun/javazic/tzdata/southamerica +++ b/jdk/make/sun/javazic/tzdata/southamerica @@ -1298,6 +1298,14 @@ Zone America/Curacao -4:35:44 - LMT 1912 Feb 12 # Willemstad -4:30 - ANT 1965 # Netherlands Antilles Time -4:00 - AST +# From Arthur David Olson (2011-06-15): +# At least for now, use links for places with new iso3166 codes. +# The name "Lower Prince's Quarter" is both longer than fourteen charaters +# and contains an apostrophe; use "Lower_Princes" below. + +Link America/Curacao America/Lower_Princes # Sint Maarten +Link America/Curacao America/Kralendijk # Bonaire, Sint Estatius and Saba + # Ecuador # # From Paul Eggert (2007-03-04): diff --git a/jdk/make/sun/javazic/tzdata/zone.tab b/jdk/make/sun/javazic/tzdata/zone.tab index 0b158ec2234..81ce7f5a56f 100644 --- a/jdk/make/sun/javazic/tzdata/zone.tab +++ b/jdk/make/sun/javazic/tzdata/zone.tab @@ -54,7 +54,6 @@ AG +1703-06148 America/Antigua AI +1812-06304 America/Anguilla AL +4120+01950 Europe/Tirane AM +4011+04430 Asia/Yerevan -AN +1211-06900 America/Curacao AO -0848+01314 Africa/Luanda AQ -7750+16636 Antarctica/McMurdo McMurdo Station, Ross Island AQ -9000+00000 Antarctica/South_Pole Amundsen-Scott Station, South Pole @@ -109,6 +108,7 @@ BL +1753-06251 America/St_Barthelemy BM +3217-06446 Atlantic/Bermuda BN +0456+11455 Asia/Brunei BO -1630-06809 America/La_Paz +BQ +120903-0681636 America/Kralendijk BR -0351-03225 America/Noronha Atlantic islands BR -0127-04829 America/Belem Amapa, E Para BR -0343-03830 America/Fortaleza NE Brazil (MA, PI, CE, RN, PB) @@ -142,7 +142,7 @@ CA +4901-08816 America/Nipigon Eastern Time - Ontario & Quebec - places that did CA +4823-08915 America/Thunder_Bay Eastern Time - Thunder Bay, Ontario CA +6344-06828 America/Iqaluit Eastern Time - east Nunavut - most locations CA +6608-06544 America/Pangnirtung Eastern Time - Pangnirtung, Nunavut -CA +744144-0944945 America/Resolute Eastern Standard Time - Resolute, Nunavut +CA +744144-0944945 America/Resolute Central Standard Time - Resolute, Nunavut CA +484531-0913718 America/Atikokan Eastern Standard Time - Atikokan, Ontario and Southampton I, Nunavut CA +624900-0920459 America/Rankin_Inlet Central Time - central Nunavut CA +4953-09709 America/Winnipeg Central Time - Manitoba & west Ontario @@ -177,6 +177,7 @@ CO +0436-07405 America/Bogota CR +0956-08405 America/Costa_Rica CU +2308-08222 America/Havana CV +1455-02331 Atlantic/Cape_Verde +CW +1211-06900 America/Curacao CX -1025+10543 Indian/Christmas CY +3510+03322 Asia/Nicosia CZ +5005+01426 Europe/Prague @@ -382,8 +383,10 @@ SM +4355+01228 Europe/San_Marino SN +1440-01726 Africa/Dakar SO +0204+04522 Africa/Mogadishu SR +0550-05510 America/Paramaribo +SS +0451+03136 Africa/Juba ST +0020+00644 Africa/Sao_Tome SV +1342-08912 America/El_Salvador +SX +180305-0630250 America/Lower_Princes SY +3330+03618 Asia/Damascus SZ -2618+03106 Africa/Mbabane TC +2128-07108 America/Grand_Turk diff --git a/jdk/src/share/classes/sun/util/resources/TimeZoneNames.java b/jdk/src/share/classes/sun/util/resources/TimeZoneNames.java index f39fae2f229..c4862dc75aa 100644 --- a/jdk/src/share/classes/sun/util/resources/TimeZoneNames.java +++ b/jdk/src/share/classes/sun/util/resources/TimeZoneNames.java @@ -159,8 +159,6 @@ public final class TimeZoneNames extends TimeZoneNamesBundle { "Pohnpei Summer Time", "PONST"}; String PST[] = new String[] {"Pacific Standard Time", "PST", "Pacific Daylight Time", "PDT"}; - String RST[] = new String[] {"Eastern Standard Time", "EST", - "Central Daylight Time", "CDT"}; String SAST[] = new String[] {"South Africa Standard Time", "SAST", "South Africa Summer Time", "SAST"}; String SBT[] = new String[] {"Solomon Is. Time", "SBT", @@ -262,6 +260,7 @@ public final class TimeZoneNames extends TimeZoneNamesBundle { {"Africa/Gaborone", CAT}, {"Africa/Harare", CAT}, {"Africa/Johannesburg", SAST}, + {"Africa/Juba", EAT}, {"Africa/Kampala", EAT}, {"Africa/Khartoum", EAT}, {"Africa/Kigali", CAT}, @@ -378,11 +377,13 @@ public final class TimeZoneNames extends TimeZoneNamesBundle { {"America/Kentucky/Louisville", EST}, {"America/Kentucky/Monticello", EST}, {"America/Knox_IN", CST}, + {"America/Kralendijk", AST}, {"America/La_Paz", new String[] {"Bolivia Time", "BOT", "Bolivia Summer Time", "BOST"}}, {"America/Lima", new String[] {"Peru Time", "PET", "Peru Summer Time", "PEST"}}, {"America/Louisville", EST}, + {"America/Lower_Princes", AST}, {"America/Maceio", BRT}, {"America/Managua", CST}, {"America/Manaus", AMT}, @@ -425,7 +426,7 @@ public final class TimeZoneNames extends TimeZoneNamesBundle { {"America/Rankin_Inlet", CST}, {"America/Recife", BRT}, {"America/Regina", CST}, - {"America/Resolute", RST}, + {"America/Resolute", CST}, {"America/Rio_Branco", AMT}, {"America/Rosario", AGT}, {"America/Santa_Isabel", PST}, @@ -673,7 +674,8 @@ public final class TimeZoneNames extends TimeZoneNamesBundle { {"Europe/Isle_of_Man", GMTBST}, {"Europe/Istanbul", EET}, {"Europe/Jersey", GMTBST}, - {"Europe/Kaliningrad", EET}, + {"Europe/Kaliningrad", new String[] {"Kaliningrad Time", "KALT", + "Kaliningrad Summer Time", "KALST"}}, {"Europe/Kiev", EET}, {"Europe/Lisbon", WET}, {"Europe/Ljubljana", CET}, diff --git a/jdk/src/share/classes/sun/util/resources/TimeZoneNames_de.java b/jdk/src/share/classes/sun/util/resources/TimeZoneNames_de.java index e74074f02cd..763f7f51fb1 100644 --- a/jdk/src/share/classes/sun/util/resources/TimeZoneNames_de.java +++ b/jdk/src/share/classes/sun/util/resources/TimeZoneNames_de.java @@ -159,8 +159,6 @@ public final class TimeZoneNames_de extends TimeZoneNamesBundle { "Pohnpei Summer Time", "PONST"}; String PST[] = new String[] {"Pazifische Normalzeit", "PST", "Pazifische Sommerzeit", "PDT"}; - String RST[] = new String[] {"\u00d6stliche Normalzeit", "EST", - "Zentrale Sommerzeit", "CDT"}; String SAST[] = new String[] {"S\u00fcdafrikanische Normalzeit", "SAST", "S\u00fcdafrikanische Sommerzeit", "SAST"}; String SBT[] = new String[] {"Salomoninseln Zeit", "SBT", @@ -262,6 +260,7 @@ public final class TimeZoneNames_de extends TimeZoneNamesBundle { {"Africa/Gaborone", CAT}, {"Africa/Harare", CAT}, {"Africa/Johannesburg", SAST}, + {"Africa/Juba", EAT}, {"Africa/Kampala", EAT}, {"Africa/Khartoum", EAT}, {"Africa/Kigali", CAT}, @@ -378,11 +377,13 @@ public final class TimeZoneNames_de extends TimeZoneNamesBundle { {"America/Kentucky/Louisville", EST}, {"America/Kentucky/Monticello", EST}, {"America/Knox_IN", CST}, + {"America/Kralendijk", AST}, {"America/La_Paz", new String[] {"Bolivianische Zeit", "BOT", "Bolivianische Sommerzeit", "BOST"}}, {"America/Lima", new String[] {"Peruanische Zeit", "PET", "Peruanische Sommerzeit", "PEST"}}, {"America/Louisville", EST}, + {"America/Lower_Princes", AST}, {"America/Maceio", BRT}, {"America/Managua", CST}, {"America/Manaus", AMT}, @@ -425,7 +426,7 @@ public final class TimeZoneNames_de extends TimeZoneNamesBundle { {"America/Rankin_Inlet", CST}, {"America/Recife", BRT}, {"America/Regina", CST}, - {"America/Resolute", RST}, + {"America/Resolute", CST}, {"America/Rio_Branco", AMT}, {"America/Rosario", AGT}, {"America/Santa_Isabel", PST}, @@ -673,7 +674,8 @@ public final class TimeZoneNames_de extends TimeZoneNamesBundle { {"Europe/Isle_of_Man", GMTBST}, {"Europe/Istanbul", EET}, {"Europe/Jersey", GMTBST}, - {"Europe/Kaliningrad", EET}, + {"Europe/Kaliningrad", new String[] {"Kaliningrad Time", "KALT", + "Kaliningrad Summer Time", "KALST"}}, {"Europe/Kiev", EET}, {"Europe/Lisbon", WET}, {"Europe/Ljubljana", CET}, diff --git a/jdk/src/share/classes/sun/util/resources/TimeZoneNames_es.java b/jdk/src/share/classes/sun/util/resources/TimeZoneNames_es.java index 1a87c33ed56..1c09f1e585c 100644 --- a/jdk/src/share/classes/sun/util/resources/TimeZoneNames_es.java +++ b/jdk/src/share/classes/sun/util/resources/TimeZoneNames_es.java @@ -159,8 +159,6 @@ public final class TimeZoneNames_es extends TimeZoneNamesBundle { "Pohnpei Summer Time", "PONST"}; String PST[] = new String[] {"Hora est\u00e1ndar del Pac\u00edfico", "PST", "Hora de verano del Pac\u00edfico", "PDT"}; - String RST[] = new String[] {"Hora est\u00e1ndar Oriental", "EST", - "Hora de verano Central", "CDT"}; String SAST[] = new String[] {"Hora est\u00e1ndar de Sud\u00e1frica", "SAST", "Hora de verano de Sud\u00e1frica", "SAST"}; String SBT[] = new String[] {"Hora de las Islas Solomon", "SBT", @@ -262,6 +260,7 @@ public final class TimeZoneNames_es extends TimeZoneNamesBundle { {"Africa/Gaborone", CAT}, {"Africa/Harare", CAT}, {"Africa/Johannesburg", SAST}, + {"Africa/Juba", EAT}, {"Africa/Kampala", EAT}, {"Africa/Khartoum", EAT}, {"Africa/Kigali", CAT}, @@ -378,11 +377,13 @@ public final class TimeZoneNames_es extends TimeZoneNamesBundle { {"America/Kentucky/Louisville", EST}, {"America/Kentucky/Monticello", EST}, {"America/Knox_IN", CST}, + {"America/Kralendijk", AST}, {"America/La_Paz", new String[] {"Hora de Bolivia", "BOT", "Hora de verano de Bolivia", "BOST"}}, {"America/Lima", new String[] {"Hora de Per\u00fa", "PET", "Hora de verano de Per\u00fa", "PEST"}}, {"America/Louisville", EST}, + {"America/Lower_Princes", AST}, {"America/Maceio", BRT}, {"America/Managua", CST}, {"America/Manaus", AMT}, @@ -425,7 +426,7 @@ public final class TimeZoneNames_es extends TimeZoneNamesBundle { {"America/Rankin_Inlet", CST}, {"America/Recife", BRT}, {"America/Regina", CST}, - {"America/Resolute", RST}, + {"America/Resolute", CST}, {"America/Rio_Branco", AMT}, {"America/Rosario", AGT}, {"America/Santa_Isabel", PST}, @@ -673,7 +674,8 @@ public final class TimeZoneNames_es extends TimeZoneNamesBundle { {"Europe/Isle_of_Man", GMTBST}, {"Europe/Istanbul", EET}, {"Europe/Jersey", GMTBST}, - {"Europe/Kaliningrad", EET}, + {"Europe/Kaliningrad", new String[] {"Kaliningrad Time", "KALT", + "Kaliningrad Summer Time", "KALST"}}, {"Europe/Kiev", EET}, {"Europe/Lisbon", WET}, {"Europe/Ljubljana", CET}, diff --git a/jdk/src/share/classes/sun/util/resources/TimeZoneNames_fr.java b/jdk/src/share/classes/sun/util/resources/TimeZoneNames_fr.java index 56701d6407e..fba1e827b0a 100644 --- a/jdk/src/share/classes/sun/util/resources/TimeZoneNames_fr.java +++ b/jdk/src/share/classes/sun/util/resources/TimeZoneNames_fr.java @@ -159,8 +159,6 @@ public final class TimeZoneNames_fr extends TimeZoneNamesBundle { "Pohnpei Summer Time", "PONST"}; String PST[] = new String[] {"Heure normale du Pacifique", "PST", "Heure avanc\u00e9e du Pacifique", "PDT"} ; - String RST[] = new String[] {"Heure normale de l'Est", "EST", - "Heure avanc\u00e9e du Centre", "CDT"} ; String SAST[] = new String[] {"Heure normale d'Afrique du Sud", "SAST", "Heure d'\u00e9t\u00e9 d'Afrique du Sud", "SAST"} ; String SBT[] = new String[] {"Heure des \u00celes Salomon", "SBT", @@ -262,6 +260,7 @@ public final class TimeZoneNames_fr extends TimeZoneNamesBundle { {"Africa/Gaborone", CAT}, {"Africa/Harare", CAT}, {"Africa/Johannesburg", SAST}, + {"Africa/Juba", EAT}, {"Africa/Kampala", EAT}, {"Africa/Khartoum", EAT}, {"Africa/Kigali", CAT}, @@ -378,11 +377,13 @@ public final class TimeZoneNames_fr extends TimeZoneNamesBundle { {"America/Kentucky/Louisville", EST}, {"America/Kentucky/Monticello", EST}, {"America/Knox_IN", CST}, + {"America/Kralendijk", AST}, {"America/La_Paz", new String[] {"Heure de Bolivie", "BOT", "Heure d'\u00e9t\u00e9 de Bolivie", "BOST"}}, {"America/Lima", new String[] {"Heure du P\u00e9rou", "PET", "Heure d'\u00e9t\u00e9 du P\u00e9rou", "PEST"}}, {"America/Louisville", EST}, + {"America/Lower_Princes", AST}, {"America/Maceio", BRT}, {"America/Managua", CST}, {"America/Manaus", AMT}, @@ -425,7 +426,7 @@ public final class TimeZoneNames_fr extends TimeZoneNamesBundle { {"America/Rankin_Inlet", CST}, {"America/Recife", BRT}, {"America/Regina", CST}, - {"America/Resolute", RST}, + {"America/Resolute", CST}, {"America/Rio_Branco", AMT}, {"America/Rosario", AGT}, {"America/Santa_Isabel", PST}, @@ -673,7 +674,8 @@ public final class TimeZoneNames_fr extends TimeZoneNamesBundle { {"Europe/Isle_of_Man", GMTBST}, {"Europe/Istanbul", EET}, {"Europe/Jersey", GMTBST}, - {"Europe/Kaliningrad", EET}, + {"Europe/Kaliningrad", new String[] {"Kaliningrad Time", "KALT", + "Kaliningrad Summer Time", "KALST"}}, {"Europe/Kiev", EET}, {"Europe/Lisbon", WET}, {"Europe/Ljubljana", CET}, diff --git a/jdk/src/share/classes/sun/util/resources/TimeZoneNames_it.java b/jdk/src/share/classes/sun/util/resources/TimeZoneNames_it.java index a02535fc00c..c2bb1d673f0 100644 --- a/jdk/src/share/classes/sun/util/resources/TimeZoneNames_it.java +++ b/jdk/src/share/classes/sun/util/resources/TimeZoneNames_it.java @@ -159,8 +159,6 @@ public final class TimeZoneNames_it extends TimeZoneNamesBundle { "Pohnpei Summer Time", "PONST"}; String PST[] = new String[] {"Ora solare della costa occidentale USA", "PST", "Ora legale della costa occidentale USA", "PDT"}; - String RST[] = new String[] {"Ora solare USA orientale", "EST", - "Ora legale USA centrale", "CDT"}; String SAST[] = new String[] {"Ora solare del Sudafrica", "SAST", "Ora estiva del Sudafrica", "SAST"}; String SBT[] = new String[] {"Ora delle Isole Salomone", "SBT", @@ -262,6 +260,7 @@ public final class TimeZoneNames_it extends TimeZoneNamesBundle { {"Africa/Gaborone", CAT}, {"Africa/Harare", CAT}, {"Africa/Johannesburg", SAST}, + {"Africa/Juba", EAT}, {"Africa/Kampala", EAT}, {"Africa/Khartoum", EAT}, {"Africa/Kigali", CAT}, @@ -378,11 +377,13 @@ public final class TimeZoneNames_it extends TimeZoneNamesBundle { {"America/Kentucky/Louisville", EST}, {"America/Kentucky/Monticello", EST}, {"America/Knox_IN", CST}, + {"America/Kralendijk", AST}, {"America/La_Paz", new String[] {"Ora della Bolivia", "BOT", "Ora estiva della Bolivia", "BOST"}}, {"America/Lima", new String[] {"Ora del Per\u00f9", "PET", "Ora estiva del Per\u00f9", "PEST"}}, {"America/Louisville", EST}, + {"America/Lower_Princes", AST}, {"America/Maceio", BRT}, {"America/Managua", CST}, {"America/Manaus", AMT}, @@ -425,7 +426,7 @@ public final class TimeZoneNames_it extends TimeZoneNamesBundle { {"America/Rankin_Inlet", CST}, {"America/Recife", BRT}, {"America/Regina", CST}, - {"America/Resolute", RST}, + {"America/Resolute", CST}, {"America/Rio_Branco", AMT}, {"America/Rosario", AGT}, {"America/Santa_Isabel", PST}, @@ -673,7 +674,8 @@ public final class TimeZoneNames_it extends TimeZoneNamesBundle { {"Europe/Isle_of_Man", GMTBST}, {"Europe/Istanbul", EET}, {"Europe/Jersey", GMTBST}, - {"Europe/Kaliningrad", EET}, + {"Europe/Kaliningrad", new String[] {"Kaliningrad Time", "KALT", + "Kaliningrad Summer Time", "KALST"}}, {"Europe/Kiev", EET}, {"Europe/Lisbon", WET}, {"Europe/Ljubljana", CET}, diff --git a/jdk/src/share/classes/sun/util/resources/TimeZoneNames_ja.java b/jdk/src/share/classes/sun/util/resources/TimeZoneNames_ja.java index bb28e3c51e4..a0d9d7c863f 100644 --- a/jdk/src/share/classes/sun/util/resources/TimeZoneNames_ja.java +++ b/jdk/src/share/classes/sun/util/resources/TimeZoneNames_ja.java @@ -159,8 +159,6 @@ public final class TimeZoneNames_ja extends TimeZoneNamesBundle { "Pohnpei Summer Time", "PONST"}; String PST[] = new String[] {"\u592a\u5e73\u6d0b\u6a19\u6e96\u6642", "PST", "\u592a\u5e73\u6d0b\u590f\u6642\u9593", "PDT"}; - String RST[] = new String[] {"\u6771\u90e8\u6a19\u6e96\u6642", "EST", - "\u4e2d\u90e8\u590f\u6642\u9593", "CDT"}; String SAST[] = new String[] {"\u5357\u30a2\u30d5\u30ea\u30ab\u6a19\u6e96\u6642", "SAST", "\u5357\u30a2\u30d5\u30ea\u30ab\u590f\u6642\u9593", "SAST"}; String SBT[] = new String[] {"\u30bd\u30ed\u30e2\u30f3\u8af8\u5cf6\u6642\u9593", "SBT", @@ -262,6 +260,7 @@ public final class TimeZoneNames_ja extends TimeZoneNamesBundle { {"Africa/Gaborone", CAT}, {"Africa/Harare", CAT}, {"Africa/Johannesburg", SAST}, + {"Africa/Juba", EAT}, {"Africa/Kampala", EAT}, {"Africa/Khartoum", EAT}, {"Africa/Kigali", CAT}, @@ -378,11 +377,13 @@ public final class TimeZoneNames_ja extends TimeZoneNamesBundle { {"America/Kentucky/Louisville", EST}, {"America/Kentucky/Monticello", EST}, {"America/Knox_IN", CST}, + {"America/Kralendijk", AST}, {"America/La_Paz", new String[] {"\u30dc\u30ea\u30d3\u30a2\u6642\u9593", "BOT", "\u30dc\u30ea\u30d3\u30a2\u590f\u6642\u9593", "BOST"}}, {"America/Lima", new String[] {"\u30da\u30eb\u30fc\u6642\u9593", "PET", "\u30da\u30eb\u30fc\u590f\u6642\u9593", "PEST"}}, {"America/Louisville", EST}, + {"America/Lower_Princes", AST}, {"America/Maceio", BRT}, {"America/Managua", CST}, {"America/Manaus", AMT}, @@ -425,7 +426,7 @@ public final class TimeZoneNames_ja extends TimeZoneNamesBundle { {"America/Rankin_Inlet", CST}, {"America/Recife", BRT}, {"America/Regina", CST}, - {"America/Resolute", RST}, + {"America/Resolute", CST}, {"America/Rio_Branco", AMT}, {"America/Rosario", AGT}, {"America/Santa_Isabel", PST}, @@ -673,7 +674,8 @@ public final class TimeZoneNames_ja extends TimeZoneNamesBundle { {"Europe/Isle_of_Man", GMTBST}, {"Europe/Istanbul", EET}, {"Europe/Jersey", GMTBST}, - {"Europe/Kaliningrad", EET}, + {"Europe/Kaliningrad", new String[] {"Kaliningrad Time", "KALT", + "Kaliningrad Summer Time", "KALST"}}, {"Europe/Kiev", EET}, {"Europe/Lisbon", WET}, {"Europe/Ljubljana", CET}, diff --git a/jdk/src/share/classes/sun/util/resources/TimeZoneNames_ko.java b/jdk/src/share/classes/sun/util/resources/TimeZoneNames_ko.java index baaa5f057c6..2079655f736 100644 --- a/jdk/src/share/classes/sun/util/resources/TimeZoneNames_ko.java +++ b/jdk/src/share/classes/sun/util/resources/TimeZoneNames_ko.java @@ -159,8 +159,6 @@ public final class TimeZoneNames_ko extends TimeZoneNamesBundle { "Pohnpei Summer Time", "PONST"}; String PST[] = new String[] {"\ud0dc\ud3c9\uc591 \ud45c\uc900\uc2dc", "PST", "\ud0dc\ud3c9\uc591 \uc77c\uad11\uc808\uc57d\uc2dc\uac04", "PDT"}; - String RST[] = new String[] {"\ub3d9\ubd80 \ud45c\uc900\uc2dc", "EST", - "\uc911\ubd80 \uc77c\uad11\uc808\uc57d\uc2dc\uac04", "CDT"}; String SAST[] = new String[] {"\ub0a8\uc544\ud504\ub9ac\uce74 \ud45c\uc900\uc2dc", "SAST", "\ub0a8\uc544\ud504\ub9ac\uce74 \uc77c\uad11\uc808\uc57d\uc2dc\uac04", "SAST"}; String SBT[] = new String[] {"\uc194\ub85c\ubaac \uad70\ub3c4 \uc2dc\uac04", "SBT", @@ -262,6 +260,7 @@ public final class TimeZoneNames_ko extends TimeZoneNamesBundle { {"Africa/Gaborone", CAT}, {"Africa/Harare", CAT}, {"Africa/Johannesburg", SAST}, + {"Africa/Juba", EAT}, {"Africa/Kampala", EAT}, {"Africa/Khartoum", EAT}, {"Africa/Kigali", CAT}, @@ -378,11 +377,13 @@ public final class TimeZoneNames_ko extends TimeZoneNamesBundle { {"America/Kentucky/Louisville", EST}, {"America/Kentucky/Monticello", EST}, {"America/Knox_IN", CST}, + {"America/Kralendijk", AST}, {"America/La_Paz", new String[] {"\ubcfc\ub9ac\ube44\uc544 \uc2dc\uac04", "BOT", "\ubcfc\ub9ac\ube44\uc544 \uc77c\uad11\uc808\uc57d\uc2dc\uac04", "BOST"}}, {"America/Lima", new String[] {"\ud398\ub8e8 \uc2dc\uac04", "PET", "\ud398\ub8e8 \uc77c\uad11\uc808\uc57d\uc2dc\uac04", "PEST"}}, {"America/Louisville", EST}, + {"America/Lower_Princes", AST}, {"America/Maceio", BRT}, {"America/Managua", CST}, {"America/Manaus", AMT}, @@ -425,7 +426,7 @@ public final class TimeZoneNames_ko extends TimeZoneNamesBundle { {"America/Rankin_Inlet", CST}, {"America/Recife", BRT}, {"America/Regina", CST}, - {"America/Resolute", RST}, + {"America/Resolute", CST}, {"America/Rio_Branco", AMT}, {"America/Rosario", AGT}, {"America/Santa_Isabel", PST}, @@ -673,7 +674,8 @@ public final class TimeZoneNames_ko extends TimeZoneNamesBundle { {"Europe/Isle_of_Man", GMTBST}, {"Europe/Istanbul", EET}, {"Europe/Jersey", GMTBST}, - {"Europe/Kaliningrad", EET}, + {"Europe/Kaliningrad", new String[] {"Kaliningrad Time", "KALT", + "Kaliningrad Summer Time", "KALST"}}, {"Europe/Kiev", EET}, {"Europe/Lisbon", WET}, {"Europe/Ljubljana", CET}, diff --git a/jdk/src/share/classes/sun/util/resources/TimeZoneNames_pt_BR.java b/jdk/src/share/classes/sun/util/resources/TimeZoneNames_pt_BR.java index d7b485b2951..89191d0674f 100644 --- a/jdk/src/share/classes/sun/util/resources/TimeZoneNames_pt_BR.java +++ b/jdk/src/share/classes/sun/util/resources/TimeZoneNames_pt_BR.java @@ -157,8 +157,6 @@ public final class TimeZoneNames_pt_BR extends TimeZoneNamesBundle { "Fuso hor\u00e1rio de ver\u00e3o de Pohnpei", "PONST"}; String PST[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o do Pac\u00edfico", "PST", "Hor\u00e1rio de luz natural do Pac\u00edfico", "PDT"}; - String RST[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o oriental", "EST", - "Hor\u00e1rio de luz natural central", "CDT"}; String SAST[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o da \u00c1frica do Sul", "SAST", "Fuso hor\u00e1rio de ver\u00e3o da \u00c1frica do Sul", "SAST"}; String SBT[] = new String[] {"Fuso hor\u00e1rio das Ilhas Salom\u00e3o", "SBT", @@ -262,6 +260,7 @@ public final class TimeZoneNames_pt_BR extends TimeZoneNamesBundle { {"Africa/Gaborone", CAT}, {"Africa/Harare", CAT}, {"Africa/Johannesburg", SAST}, + {"Africa/Juba", EAT}, {"Africa/Kampala", EAT}, {"Africa/Khartoum", EAT}, {"Africa/Kigali", CAT}, @@ -378,11 +377,13 @@ public final class TimeZoneNames_pt_BR extends TimeZoneNamesBundle { {"America/Kentucky/Louisville", EST}, {"America/Kentucky/Monticello", EST}, {"America/Knox_IN", CST}, + {"America/Kralendijk", AST}, {"America/La_Paz", new String[] {"Fuso hor\u00e1rio da Bol\u00edvia", "BOT", "Fuso hor\u00e1rio de ver\u00e3o da Bol\u00edvia", "BOST"}}, {"America/Lima", new String[] {"Fuso hor\u00e1rio do Peru", "PET", "Fuso hor\u00e1rio de ver\u00e3o do Peru", "PEST"}}, {"America/Louisville", EST}, + {"America/Lower_Princes", AST}, {"America/Maceio", BRT}, {"America/Managua", CST}, {"America/Manaus", AMT}, @@ -425,7 +426,7 @@ public final class TimeZoneNames_pt_BR extends TimeZoneNamesBundle { {"America/Rankin_Inlet", CST}, {"America/Recife", BRT}, {"America/Regina", CST}, - {"America/Resolute", RST}, + {"America/Resolute", CST}, {"America/Rio_Branco", AMT}, {"America/Rosario", AGT}, {"America/Santa_Isabel", PST}, @@ -673,7 +674,8 @@ public final class TimeZoneNames_pt_BR extends TimeZoneNamesBundle { {"Europe/Isle_of_Man", GMTBST}, {"Europe/Istanbul", EET}, {"Europe/Jersey", GMTBST}, - {"Europe/Kaliningrad", EET}, + {"Europe/Kaliningrad", new String[] {"Kaliningrad Time", "KALT", + "Kaliningrad Summer Time", "KALST"}}, {"Europe/Kiev", EET}, {"Europe/Lisbon", WET}, {"Europe/Ljubljana", CET}, diff --git a/jdk/src/share/classes/sun/util/resources/TimeZoneNames_sv.java b/jdk/src/share/classes/sun/util/resources/TimeZoneNames_sv.java index 0ddaa348326..007e5534a13 100644 --- a/jdk/src/share/classes/sun/util/resources/TimeZoneNames_sv.java +++ b/jdk/src/share/classes/sun/util/resources/TimeZoneNames_sv.java @@ -159,8 +159,6 @@ public final class TimeZoneNames_sv extends TimeZoneNamesBundle { "Pohnpei Summer Time", "PONST"}; String PST[] = new String[] {"Stilla havet, normaltid", "PST", "Stilla havet, sommartid", "PDT"}; - String RST[] = new String[] {"Eastern, normaltid", "EST", - "Central sommartid", "CDT"}; String SAST[] = new String[] {"Sydafrika, normaltid", "SAST", "Sydafrika, sommartid", "SAST"}; String SBT[] = new String[] {"Salomon\u00f6arna, normaltid", "SBT", @@ -262,6 +260,7 @@ public final class TimeZoneNames_sv extends TimeZoneNamesBundle { {"Africa/Gaborone", CAT}, {"Africa/Harare", CAT}, {"Africa/Johannesburg", SAST}, + {"Africa/Juba", EAT}, {"Africa/Kampala", EAT}, {"Africa/Khartoum", EAT}, {"Africa/Kigali", CAT}, @@ -378,11 +377,13 @@ public final class TimeZoneNames_sv extends TimeZoneNamesBundle { {"America/Kentucky/Louisville", EST}, {"America/Kentucky/Monticello", EST}, {"America/Knox_IN", CST}, + {"America/Kralendijk", AST}, {"America/La_Paz", new String[] {"Bolivia, normaltid", "BOT", "Bolivia, sommartid", "BOST"}}, {"America/Lima", new String[] {"Peru, normaltid", "PET", "Peru, sommartid", "PEST"}}, {"America/Louisville", EST}, + {"America/Lower_Princes", AST}, {"America/Maceio", BRT}, {"America/Managua", CST}, {"America/Manaus", AMT}, @@ -425,7 +426,7 @@ public final class TimeZoneNames_sv extends TimeZoneNamesBundle { {"America/Rankin_Inlet", CST}, {"America/Recife", BRT}, {"America/Regina", CST}, - {"America/Resolute", RST}, + {"America/Resolute", CST}, {"America/Rio_Branco", AMT}, {"America/Rosario", AGT}, {"America/Santa_Isabel", PST}, @@ -673,7 +674,8 @@ public final class TimeZoneNames_sv extends TimeZoneNamesBundle { {"Europe/Isle_of_Man", GMTBST}, {"Europe/Istanbul", EET}, {"Europe/Jersey", GMTBST}, - {"Europe/Kaliningrad", EET}, + {"Europe/Kaliningrad", new String[] {"Kaliningrad Time", "KALT", + "Kaliningrad Summer Time", "KALST"}}, {"Europe/Kiev", EET}, {"Europe/Lisbon", WET}, {"Europe/Ljubljana", CET}, diff --git a/jdk/src/share/classes/sun/util/resources/TimeZoneNames_zh_CN.java b/jdk/src/share/classes/sun/util/resources/TimeZoneNames_zh_CN.java index 17f72a67b31..d7521372bbd 100644 --- a/jdk/src/share/classes/sun/util/resources/TimeZoneNames_zh_CN.java +++ b/jdk/src/share/classes/sun/util/resources/TimeZoneNames_zh_CN.java @@ -159,8 +159,6 @@ public final class TimeZoneNames_zh_CN extends TimeZoneNamesBundle { "Pohnpei Summer Time", "PONST"}; String PST[] = new String[] {"\u592a\u5e73\u6d0b\u6807\u51c6\u65f6\u95f4", "PST", "\u592a\u5e73\u6d0b\u590f\u4ee4\u65f6", "PDT"}; - String RST[] = new String[] {"\u4e1c\u90e8\u6807\u51c6\u65f6\u95f4", "EST", - "\u4e2d\u592e\u590f\u4ee4\u65f6", "CDT"}; String SAST[] = new String[] {"\u5357\u975e\u6807\u51c6\u65f6\u95f4", "SAST", "\u5357\u975e\u590f\u4ee4\u65f6", "SAST"}; String SBT[] = new String[] {"\u6240\u7f57\u95e8\u7fa4\u5c9b\u65f6\u95f4", "SBT", @@ -262,6 +260,7 @@ public final class TimeZoneNames_zh_CN extends TimeZoneNamesBundle { {"Africa/Gaborone", CAT}, {"Africa/Harare", CAT}, {"Africa/Johannesburg", SAST}, + {"Africa/Juba", EAT}, {"Africa/Kampala", EAT}, {"Africa/Khartoum", EAT}, {"Africa/Kigali", CAT}, @@ -378,11 +377,13 @@ public final class TimeZoneNames_zh_CN extends TimeZoneNamesBundle { {"America/Kentucky/Louisville", EST}, {"America/Kentucky/Monticello", EST}, {"America/Knox_IN", CST}, + {"America/Kralendijk", AST}, {"America/La_Paz", new String[] {"\u73bb\u5229\u7ef4\u4e9a\u65f6\u95f4", "BOT", "\u73bb\u5229\u7ef4\u4e9a\u590f\u4ee4\u65f6", "BOST"}}, {"America/Lima", new String[] {"\u79d8\u9c81\u65f6\u95f4", "PET", "\u79d8\u9c81\u590f\u4ee4\u65f6", "PEST"}}, {"America/Louisville", EST}, + {"America/Lower_Princes", AST}, {"America/Maceio", BRT}, {"America/Managua", CST}, {"America/Manaus", AMT}, @@ -425,7 +426,7 @@ public final class TimeZoneNames_zh_CN extends TimeZoneNamesBundle { {"America/Rankin_Inlet", CST}, {"America/Recife", BRT}, {"America/Regina", CST}, - {"America/Resolute", RST}, + {"America/Resolute", CST}, {"America/Rio_Branco", AMT}, {"America/Rosario", AGT}, {"America/Santa_Isabel", PST}, @@ -673,7 +674,8 @@ public final class TimeZoneNames_zh_CN extends TimeZoneNamesBundle { {"Europe/Isle_of_Man", GMTBST}, {"Europe/Istanbul", EET}, {"Europe/Jersey", GMTBST}, - {"Europe/Kaliningrad", EET}, + {"Europe/Kaliningrad", new String[] {"Kaliningrad Time", "KALT", + "Kaliningrad Summer Time", "KALST"}}, {"Europe/Kiev", EET}, {"Europe/Lisbon", WET}, {"Europe/Ljubljana", CET}, diff --git a/jdk/src/share/classes/sun/util/resources/TimeZoneNames_zh_TW.java b/jdk/src/share/classes/sun/util/resources/TimeZoneNames_zh_TW.java index d7f1b10e2a4..9a7fbe9479a 100644 --- a/jdk/src/share/classes/sun/util/resources/TimeZoneNames_zh_TW.java +++ b/jdk/src/share/classes/sun/util/resources/TimeZoneNames_zh_TW.java @@ -159,8 +159,6 @@ public final class TimeZoneNames_zh_TW extends TimeZoneNamesBundle { "Pohnpei Summer Time", "PONST"}; String PST[] = new String[] {"\u592a\u5e73\u6d0b\u6a19\u6e96\u6642\u9593", "PST", "\u592a\u5e73\u6d0b\u65e5\u5149\u7bc0\u7d04\u6642\u9593", "PDT"}; - String RST[] = new String[] {"\u6771\u65b9\u6a19\u6e96\u6642\u9593", "EST", - "\u4e2d\u592e\u65e5\u5149\u7bc0\u7d04\u6642\u9593", "CDT"}; String SAST[] = new String[] {"\u5357\u975e\u6a19\u6e96\u6642\u9593", "SAST", "\u5357\u975e\u590f\u4ee4\u6642\u9593", "SAST"}; String SBT[] = new String[] {"\u6240\u7f85\u9580\u7fa4\u5cf6\u6642\u9593", "SBT", @@ -262,6 +260,7 @@ public final class TimeZoneNames_zh_TW extends TimeZoneNamesBundle { {"Africa/Gaborone", CAT}, {"Africa/Harare", CAT}, {"Africa/Johannesburg", SAST}, + {"Africa/Juba", EAT}, {"Africa/Kampala", EAT}, {"Africa/Khartoum", EAT}, {"Africa/Kigali", CAT}, @@ -378,11 +377,13 @@ public final class TimeZoneNames_zh_TW extends TimeZoneNamesBundle { {"America/Kentucky/Louisville", EST}, {"America/Kentucky/Monticello", EST}, {"America/Knox_IN", CST}, + {"America/Kralendijk", AST}, {"America/La_Paz", new String[] {"\u73bb\u5229\u7dad\u4e9e\u6642\u9593", "BOT", "\u73bb\u5229\u7dad\u4e9e\u590f\u4ee4\u6642\u9593", "BOST"}}, {"America/Lima", new String[] {"\u7955\u9b6f\u6642\u9593", "PET", "\u7955\u9b6f\u590f\u4ee4\u6642\u9593", "PEST"}}, {"America/Louisville", EST}, + {"America/Lower_Princes", AST}, {"America/Maceio", BRT}, {"America/Managua", CST}, {"America/Manaus", AMT}, @@ -425,7 +426,7 @@ public final class TimeZoneNames_zh_TW extends TimeZoneNamesBundle { {"America/Rankin_Inlet", CST}, {"America/Recife", BRT}, {"America/Regina", CST}, - {"America/Resolute", RST}, + {"America/Resolute", CST}, {"America/Rio_Branco", AMT}, {"America/Rosario", AGT}, {"America/Santa_Isabel", PST}, @@ -674,7 +675,8 @@ public final class TimeZoneNames_zh_TW extends TimeZoneNamesBundle { {"Europe/Isle_of_Man", GMTBST}, {"Europe/Istanbul", EET}, {"Europe/Jersey", GMTBST}, - {"Europe/Kaliningrad", EET}, + {"Europe/Kaliningrad", new String[] {"Kaliningrad Time", "KALT", + "Kaliningrad Summer Time", "KALST"}}, {"Europe/Kiev", EET}, {"Europe/Lisbon", WET}, {"Europe/Ljubljana", CET}, From f9cd96b19ba8ec54e17db197b7d09a99e5c131b0 Mon Sep 17 00:00:00 2001 From: Michael McMahon Date: Thu, 15 Sep 2011 13:50:30 +0100 Subject: [PATCH 08/23] 7073491: -Dsun.net.maxDatagramSockets=1 does not work correctly with system.gc() Reviewed-by: ngmr --- .../share/classes/java/net/AbstractPlainDatagramSocketImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jdk/src/share/classes/java/net/AbstractPlainDatagramSocketImpl.java b/jdk/src/share/classes/java/net/AbstractPlainDatagramSocketImpl.java index a772b7c4c4a..ff0d2cd3584 100644 --- a/jdk/src/share/classes/java/net/AbstractPlainDatagramSocketImpl.java +++ b/jdk/src/share/classes/java/net/AbstractPlainDatagramSocketImpl.java @@ -66,8 +66,8 @@ abstract class AbstractPlainDatagramSocketImpl extends DatagramSocketImpl * Creates a datagram socket */ protected synchronized void create() throws SocketException { - fd = new FileDescriptor(); ResourceManager.beforeUdpCreate(); + fd = new FileDescriptor(); try { datagramSocketCreate(); } catch (SocketException ioe) { From 35806610982ead49cb90f2ead714171a134ab6cf Mon Sep 17 00:00:00 2001 From: Kurchi Subhra Hazra Date: Fri, 16 Sep 2011 12:09:04 -0700 Subject: [PATCH 09/23] 7090158: Networking Libraries don't build with javac -Werror Minor changes to networking java files to remove warnings Co-authored-by: Alexandre Boulgakov Reviewed-by: chegar, weijun, hawtin --- jdk/make/com/sun/net/httpserver/Makefile | 4 +- jdk/make/com/sun/net/ssl/Makefile | 3 ++ jdk/make/java/net/Makefile | 3 ++ jdk/make/javax/Makefile | 2 +- jdk/make/javax/others/Makefile | 1 - jdk/make/sun/net/Makefile | 4 +- jdk/make/sun/net/spi/Makefile | 2 + jdk/make/sun/net/spi/nameservice/dns/Makefile | 3 +- .../net/httpserver/BasicAuthenticator.java | 8 +-- .../com/sun/net/httpserver/Headers.java | 4 +- .../httpserver/spi/HttpServerProvider.java | 20 ++++---- .../classes/com/sun/net/ssl/SSLSecurity.java | 11 ++--- .../https/DelegateHttpsURLConnection.java | 6 +-- .../net/AbstractPlainDatagramSocketImpl.java | 4 +- .../classes/java/net/ContentHandler.java | 4 +- .../share/classes/java/net/CookieManager.java | 3 +- .../classes/java/net/DatagramSocket.java | 6 +-- .../classes/java/net/HttpURLConnection.java | 1 + .../share/classes/java/net/Inet4Address.java | 4 +- .../classes/java/net/Inet4AddressImpl.java | 6 +-- .../share/classes/java/net/Inet6Address.java | 6 +-- .../classes/java/net/Inet6AddressImpl.java | 6 +-- .../classes/java/net/MulticastSocket.java | 7 ++- jdk/src/share/classes/java/net/Proxy.java | 4 +- .../share/classes/java/net/ProxySelector.java | 4 +- jdk/src/share/classes/java/net/Socket.java | 9 ++-- .../classes/java/net/SocketPermission.java | 23 +++++---- jdk/src/share/classes/java/net/URL.java | 11 ++--- .../classes/java/net/URLClassLoader.java | 15 ++---- .../share/classes/java/net/URLConnection.java | 11 +++-- .../javax/net/ssl/SSLServerSocketFactory.java | 4 +- .../javax/net/ssl/SSLSocketFactory.java | 4 +- .../share/classes/sun/misc/REException.java | 3 ++ .../sun/net/TransferProtocolClient.java | 10 ++-- .../sun/net/ftp/FtpClientProvider.java | 15 +++--- .../classes/sun/net/httpserver/Request.java | 9 ++-- .../sun/net/httpserver/SSLStreams.java | 6 +-- .../sun/net/httpserver/ServerImpl.java | 6 +-- .../classes/sun/net/idn/UCharacterEnums.java | 43 ++++++++++++++++ .../spi/nameservice/dns/DNSNameService.java | 12 ++--- .../classes/sun/net/www/HeaderParser.java | 14 +++--- .../classes/sun/net/www/MessageHeader.java | 20 ++++---- .../share/classes/sun/net/www/MimeTable.java | 12 ++--- .../classes/sun/net/www/URLConnection.java | 9 +--- .../sun/net/www/content/image/gif.java | 7 +-- .../sun/net/www/content/image/jpeg.java | 7 +-- .../sun/net/www/content/image/png.java | 7 +-- .../sun/net/www/content/image/x_xbitmap.java | 4 +- .../sun/net/www/content/image/x_xpixmap.java | 4 +- .../sun/net/www/http/KeepAliveStream.java | 2 +- .../net/www/protocol/gopher/GopherClient.java | 2 +- .../net/www/protocol/http/AuthCacheImpl.java | 30 +++++------- .../protocol/http/AuthenticationHeader.java | 28 +++++------ .../www/protocol/http/HttpURLConnection.java | 49 ++++++++++--------- .../sun/net/www/protocol/http/Negotiator.java | 6 +-- .../AbstractDelegateHttpsURLConnection.java | 10 ++-- .../net/www/protocol/https/HttpsClient.java | 12 ++--- .../sun/net/www/protocol/mailto/Handler.java | 16 +++++- .../net/DefaultDatagramSocketImplFactory.java | 4 +- .../java/net/PlainDatagramSocketImpl.java | 4 +- .../net/dns/ResolverConfigurationImpl.java | 18 ++++--- .../net/DefaultDatagramSocketImplFactory.java | 4 +- .../net/DualStackPlainDatagramSocketImpl.java | 6 +-- .../net/TwoStacksPlainDatagramSocketImpl.java | 2 + .../net/dns/ResolverConfigurationImpl.java | 10 ++-- .../net/www/protocol/jar/JarFileFactory.java | 4 +- 66 files changed, 318 insertions(+), 280 deletions(-) diff --git a/jdk/make/com/sun/net/httpserver/Makefile b/jdk/make/com/sun/net/httpserver/Makefile index 5c0e85c8188..2d2e6b89b01 100644 --- a/jdk/make/com/sun/net/httpserver/Makefile +++ b/jdk/make/com/sun/net/httpserver/Makefile @@ -1,5 +1,5 @@ # -# Copyright (c) 2005, 2007, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -26,6 +26,8 @@ BUILDDIR = ../../../.. PACKAGE = com.sun.net.httpserver PRODUCT = sun +JAVAC_MAX_WARNINGS = true +JAVAC_WARNINGS_FATAL = true include $(BUILDDIR)/common/Defs.gmk # diff --git a/jdk/make/com/sun/net/ssl/Makefile b/jdk/make/com/sun/net/ssl/Makefile index 4ec297c2346..b5c291ec2e6 100644 --- a/jdk/make/com/sun/net/ssl/Makefile +++ b/jdk/make/com/sun/net/ssl/Makefile @@ -26,6 +26,9 @@ BUILDDIR = ../../../.. PACKAGE = com.sun.net.ssl PRODUCT = sun +JAVAC_LINT_OPTIONS=-Xlint:all,-deprecation +JAVAC_MAX_WARNINGS = true +JAVAC_WARNINGS_FATAL = true include $(BUILDDIR)/common/Defs.gmk # diff --git a/jdk/make/java/net/Makefile b/jdk/make/java/net/Makefile index e6429c6c209..83c885b34d8 100644 --- a/jdk/make/java/net/Makefile +++ b/jdk/make/java/net/Makefile @@ -27,6 +27,9 @@ BUILDDIR = ../.. PACKAGE = java.net LIBRARY = net PRODUCT = sun +JAVAC_MAX_WARNINGS = true +JAVAC_WARNINGS_FATAL = true +JAVAC_LINT_OPTIONS = -Xlint:all,-deprecation include $(BUILDDIR)/common/Defs.gmk # diff --git a/jdk/make/javax/Makefile b/jdk/make/javax/Makefile index a58a1b1eb5a..251628c8381 100644 --- a/jdk/make/javax/Makefile +++ b/jdk/make/javax/Makefile @@ -1,5 +1,5 @@ # -# Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it diff --git a/jdk/make/javax/others/Makefile b/jdk/make/javax/others/Makefile index c98d63ded35..1283dcea892 100644 --- a/jdk/make/javax/others/Makefile +++ b/jdk/make/javax/others/Makefile @@ -28,7 +28,6 @@ # BUILDDIR = ../.. -JAVAC_MAX_WARNINGS = true include $(BUILDDIR)/common/Defs.gmk # diff --git a/jdk/make/sun/net/Makefile b/jdk/make/sun/net/Makefile index 4a4278560c6..3e56798e2ee 100644 --- a/jdk/make/sun/net/Makefile +++ b/jdk/make/sun/net/Makefile @@ -1,5 +1,5 @@ # -# Copyright (c) 1995, 2010, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1995, 2011, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -26,6 +26,8 @@ BUILDDIR = ../.. PACKAGE = sun.net PRODUCT = sun +SUBDIRS_MAKEFLAGS += JAVAC_MAX_WARNINGS=true +SUBDIRS_MAKEFLAGS += JAVAC_WARNINGS_FATAL=true include $(BUILDDIR)/common/Defs.gmk SUBDIRS = others spi diff --git a/jdk/make/sun/net/spi/Makefile b/jdk/make/sun/net/spi/Makefile index 1b2f8daffee..dc448cf2558 100644 --- a/jdk/make/sun/net/spi/Makefile +++ b/jdk/make/sun/net/spi/Makefile @@ -24,6 +24,8 @@ # BUILDDIR = ../../.. +SUBDIRS_MAKEFLAGS += JAVAC_WARNINGS_FATAL=true + include $(BUILDDIR)/common/Defs.gmk SUBDIRS_misc = nameservice diff --git a/jdk/make/sun/net/spi/nameservice/dns/Makefile b/jdk/make/sun/net/spi/nameservice/dns/Makefile index 13ed8e63e45..4c4ef34aa21 100644 --- a/jdk/make/sun/net/spi/nameservice/dns/Makefile +++ b/jdk/make/sun/net/spi/nameservice/dns/Makefile @@ -28,7 +28,8 @@ # BUILDDIR = ../../../../.. - +JAVAC_MAX_WARNINGS = true +JAVAC_WARNINGS_FATAL = true # dns should probably be its own module PACKAGE = sun.net.spi.nameservice.dns PRODUCT = sun diff --git a/jdk/src/share/classes/com/sun/net/httpserver/BasicAuthenticator.java b/jdk/src/share/classes/com/sun/net/httpserver/BasicAuthenticator.java index de749ff0440..781510a2cca 100644 --- a/jdk/src/share/classes/com/sun/net/httpserver/BasicAuthenticator.java +++ b/jdk/src/share/classes/com/sun/net/httpserver/BasicAuthenticator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -54,13 +54,13 @@ public abstract class BasicAuthenticator extends Authenticator { public Result authenticate (HttpExchange t) { - Headers rmap = (Headers) t.getRequestHeaders(); + Headers rmap = t.getRequestHeaders(); /* * look for auth token */ String auth = rmap.getFirst ("Authorization"); if (auth == null) { - Headers map = (Headers) t.getResponseHeaders(); + Headers map = t.getResponseHeaders(); map.set ("WWW-Authenticate", "Basic realm=" + "\""+realm+"\""); return new Authenticator.Retry (401); } @@ -83,7 +83,7 @@ public abstract class BasicAuthenticator extends Authenticator { } else { /* reject the request again with 401 */ - Headers map = (Headers) t.getResponseHeaders(); + Headers map = t.getResponseHeaders(); map.set ("WWW-Authenticate", "Basic realm=" + "\""+realm+"\""); return new Authenticator.Failure(401); } diff --git a/jdk/src/share/classes/com/sun/net/httpserver/Headers.java b/jdk/src/share/classes/com/sun/net/httpserver/Headers.java index 0d4172fd44e..afe3c217d41 100644 --- a/jdk/src/share/classes/com/sun/net/httpserver/Headers.java +++ b/jdk/src/share/classes/com/sun/net/httpserver/Headers.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -117,7 +117,7 @@ public class Headers implements Map> { * @return the first string value associated with the key */ public String getFirst (String key) { - List l = map.get(normalize((String)key)); + List l = map.get(normalize(key)); if (l == null) { return null; } diff --git a/jdk/src/share/classes/com/sun/net/httpserver/spi/HttpServerProvider.java b/jdk/src/share/classes/com/sun/net/httpserver/spi/HttpServerProvider.java index 53ba6488dcb..ec8b91c5f5d 100644 --- a/jdk/src/share/classes/com/sun/net/httpserver/spi/HttpServerProvider.java +++ b/jdk/src/share/classes/com/sun/net/httpserver/spi/HttpServerProvider.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -81,29 +81,27 @@ public abstract class HttpServerProvider { if (cn == null) return false; try { - Class c = Class.forName(cn, true, + Class c = Class.forName(cn, true, ClassLoader.getSystemClassLoader()); provider = (HttpServerProvider)c.newInstance(); return true; - } catch (ClassNotFoundException x) { - throw new ServiceConfigurationError(x); - } catch (IllegalAccessException x) { - throw new ServiceConfigurationError(x); - } catch (InstantiationException x) { - throw new ServiceConfigurationError(x); - } catch (SecurityException x) { + } catch (ClassNotFoundException | + IllegalAccessException | + InstantiationException | + SecurityException x) { throw new ServiceConfigurationError(x); } } private static boolean loadProviderAsService() { - Iterator i = Service.providers(HttpServerProvider.class, + @SuppressWarnings("unchecked") + Iterator i = Service.providers(HttpServerProvider.class, ClassLoader.getSystemClassLoader()); for (;;) { try { if (!i.hasNext()) return false; - provider = (HttpServerProvider)i.next(); + provider = i.next(); return true; } catch (ServiceConfigurationError sce) { if (sce.getCause() instanceof SecurityException) { diff --git a/jdk/src/share/classes/com/sun/net/ssl/SSLSecurity.java b/jdk/src/share/classes/com/sun/net/ssl/SSLSecurity.java index ba80627cf8c..cac7298ab69 100644 --- a/jdk/src/share/classes/com/sun/net/ssl/SSLSecurity.java +++ b/jdk/src/share/classes/com/sun/net/ssl/SSLSecurity.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -77,7 +77,7 @@ final class SSLSecurity { { Provider provider = service.getProvider(); String className = service.getClassName(); - Class implClass; + Class implClass; try { ClassLoader cl = provider.getClass().getClassLoader(); if (cl == null) { @@ -133,8 +133,8 @@ final class SSLSecurity { * or someone has removed classes from the jsse.jar file. */ - Class typeClassJavax; - Class typeClassCom; + Class typeClassJavax; + Class typeClassCom; Object obj = null; /* @@ -237,7 +237,7 @@ final class SSLSecurity { /* * Checks whether one class is the superclass of another */ - private static boolean checkSuperclass(Class subclass, Class superclass) { + private static boolean checkSuperclass(Class subclass, Class superclass) { if ((subclass == null) || (superclass == null)) return false; @@ -276,7 +276,6 @@ final class SSLSecurity { * object. This also mean that anything going down into the SPI * needs to be wrapped, as well as anything coming back up. */ - final class SSLContextSpiWrapper extends SSLContextSpi { private javax.net.ssl.SSLContext theSSLContext; diff --git a/jdk/src/share/classes/com/sun/net/ssl/internal/www/protocol/https/DelegateHttpsURLConnection.java b/jdk/src/share/classes/com/sun/net/ssl/internal/www/protocol/https/DelegateHttpsURLConnection.java index 3dda0665ab6..2fcbc4e72a6 100644 --- a/jdk/src/share/classes/com/sun/net/ssl/internal/www/protocol/https/DelegateHttpsURLConnection.java +++ b/jdk/src/share/classes/com/sun/net/ssl/internal/www/protocol/https/DelegateHttpsURLConnection.java @@ -165,10 +165,10 @@ class VerifierWrapper implements javax.net.ssl.HostnameVerifier { private static String getServername(X509Certificate peerCert) { try { // compare to subjectAltNames if dnsName is present - Collection subjAltNames = peerCert.getSubjectAlternativeNames(); + Collection> subjAltNames = peerCert.getSubjectAlternativeNames(); if (subjAltNames != null) { - for (Iterator itr = subjAltNames.iterator(); itr.hasNext(); ) { - List next = (List)itr.next(); + for (Iterator> itr = subjAltNames.iterator(); itr.hasNext(); ) { + List next = itr.next(); if (((Integer)next.get(0)).intValue() == 2) { // compare dNSName with host in url String dnsName = ((String)next.get(1)); diff --git a/jdk/src/share/classes/java/net/AbstractPlainDatagramSocketImpl.java b/jdk/src/share/classes/java/net/AbstractPlainDatagramSocketImpl.java index ff0d2cd3584..0d03a40859c 100644 --- a/jdk/src/share/classes/java/net/AbstractPlainDatagramSocketImpl.java +++ b/jdk/src/share/classes/java/net/AbstractPlainDatagramSocketImpl.java @@ -26,8 +26,6 @@ package java.net; import java.io.FileDescriptor; import java.io.IOException; -import java.io.InterruptedIOException; -import java.util.Enumeration; import sun.net.ResourceManager; /** @@ -153,11 +151,13 @@ abstract class AbstractPlainDatagramSocketImpl extends DatagramSocketImpl * Set the TTL (time-to-live) option. * @param TTL to be set. */ + @Deprecated protected abstract void setTTL(byte ttl) throws IOException; /** * Get the TTL (time-to-live) option. */ + @Deprecated protected abstract byte getTTL() throws IOException; /** diff --git a/jdk/src/share/classes/java/net/ContentHandler.java b/jdk/src/share/classes/java/net/ContentHandler.java index 9460f25a7ae..319e6199bf7 100644 --- a/jdk/src/share/classes/java/net/ContentHandler.java +++ b/jdk/src/share/classes/java/net/ContentHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -96,7 +96,7 @@ abstract public class ContentHandler { * @exception IOException if an I/O error occurs while reading the object. * @since 1.3 */ - public Object getContent(URLConnection urlc, Class[] classes) throws IOException { + public Object getContent(URLConnection urlc, Class[] classes) throws IOException { Object obj = getContent(urlc); for (int i = 0; i < classes.length; i++) { diff --git a/jdk/src/share/classes/java/net/CookieManager.java b/jdk/src/share/classes/java/net/CookieManager.java index 532999b57b7..b9de7191df3 100644 --- a/jdk/src/share/classes/java/net/CookieManager.java +++ b/jdk/src/share/classes/java/net/CookieManager.java @@ -249,7 +249,6 @@ public class CookieManager extends CookieHandler return Collections.unmodifiableMap(cookieMap); } - public void put(URI uri, Map> responseHeaders) throws IOException @@ -284,7 +283,7 @@ public class CookieManager extends CookieHandler cookies = HttpCookie.parse(headerValue); } catch (IllegalArgumentException e) { // Bogus header, make an empty list and log the error - cookies = java.util.Collections.EMPTY_LIST; + cookies = java.util.Collections.emptyList(); if (logger.isLoggable(PlatformLogger.SEVERE)) { logger.severe("Invalid cookie for " + uri + ": " + headerValue); } diff --git a/jdk/src/share/classes/java/net/DatagramSocket.java b/jdk/src/share/classes/java/net/DatagramSocket.java index 7166c5f93ea..5d73de6c0fc 100644 --- a/jdk/src/share/classes/java/net/DatagramSocket.java +++ b/jdk/src/share/classes/java/net/DatagramSocket.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,9 +25,7 @@ package java.net; -import java.io.FileDescriptor; import java.io.IOException; -import java.io.InterruptedIOException; import java.nio.channels.DatagramChannel; import java.security.AccessController; import java.security.PrivilegedExceptionAction; @@ -300,7 +298,7 @@ class DatagramSocket implements java.io.Closeable { } } - static Class implClass = null; + static Class implClass = null; void createImpl() throws SocketException { if (impl == null) { diff --git a/jdk/src/share/classes/java/net/HttpURLConnection.java b/jdk/src/share/classes/java/net/HttpURLConnection.java index f88e9ef1b20..d52c26789fa 100644 --- a/jdk/src/share/classes/java/net/HttpURLConnection.java +++ b/jdk/src/share/classes/java/net/HttpURLConnection.java @@ -535,6 +535,7 @@ abstract public class HttpURLConnection extends URLConnection { return responseMessage; } + @SuppressWarnings("deprecation") public long getHeaderFieldDate(String name, long Default) { String dateString = getHeaderField(name); try { diff --git a/jdk/src/share/classes/java/net/Inet4Address.java b/jdk/src/share/classes/java/net/Inet4Address.java index af8334640c3..190b56353ee 100644 --- a/jdk/src/share/classes/java/net/Inet4Address.java +++ b/jdk/src/share/classes/java/net/Inet4Address.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,9 +25,7 @@ package java.net; -import java.security.AccessController; import java.io.ObjectStreamException; -import sun.security.action.*; /** * This class represents an Internet Protocol version 4 (IPv4) address. diff --git a/jdk/src/share/classes/java/net/Inet4AddressImpl.java b/jdk/src/share/classes/java/net/Inet4AddressImpl.java index 86ff9d33260..367ca22b9aa 100644 --- a/jdk/src/share/classes/java/net/Inet4AddressImpl.java +++ b/jdk/src/share/classes/java/net/Inet4AddressImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -59,11 +59,11 @@ class Inet4AddressImpl implements InetAddressImpl { /* * Let's make sure we use an address of the proper family */ - java.util.Enumeration it = netif.getInetAddresses(); + java.util.Enumeration it = netif.getInetAddresses(); InetAddress inetaddr = null; while (!(inetaddr instanceof Inet4Address) && it.hasMoreElements()) - inetaddr = (InetAddress) it.nextElement(); + inetaddr = it.nextElement(); if (inetaddr instanceof Inet4Address) ifaddr = inetaddr.getAddress(); } diff --git a/jdk/src/share/classes/java/net/Inet6Address.java b/jdk/src/share/classes/java/net/Inet6Address.java index 4236ddc79c4..77e7cf80314 100644 --- a/jdk/src/share/classes/java/net/Inet6Address.java +++ b/jdk/src/share/classes/java/net/Inet6Address.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -383,9 +383,9 @@ class Inet6Address extends InetAddress { while (en.hasMoreElements()) { NetworkInterface ifc = en.nextElement(); if (ifc.getName().equals (ifname)) { - Enumeration addresses = ifc.getInetAddresses(); + Enumeration addresses = ifc.getInetAddresses(); while (addresses.hasMoreElements()) { - InetAddress addr = (InetAddress)addresses.nextElement(); + InetAddress addr = addresses.nextElement(); if (!(addr instanceof Inet6Address)) { continue; } diff --git a/jdk/src/share/classes/java/net/Inet6AddressImpl.java b/jdk/src/share/classes/java/net/Inet6AddressImpl.java index 3c2341064f1..663c77ebccc 100644 --- a/jdk/src/share/classes/java/net/Inet6AddressImpl.java +++ b/jdk/src/share/classes/java/net/Inet6AddressImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -54,10 +54,10 @@ class Inet6AddressImpl implements InetAddressImpl { * be either an IPv6 address or an IPv4 address (case of a dual * stack system). */ - java.util.Enumeration it = netif.getInetAddresses(); + java.util.Enumeration it = netif.getInetAddresses(); InetAddress inetaddr = null; while (it.hasMoreElements()) { - inetaddr = (InetAddress) it.nextElement(); + inetaddr = it.nextElement(); if (inetaddr.getClass().isInstance(addr)) { ifaddr = inetaddr.getAddress(); if (inetaddr instanceof Inet6Address) { diff --git a/jdk/src/share/classes/java/net/MulticastSocket.java b/jdk/src/share/classes/java/net/MulticastSocket.java index bb4760f1184..0171315530e 100644 --- a/jdk/src/share/classes/java/net/MulticastSocket.java +++ b/jdk/src/share/classes/java/net/MulticastSocket.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,7 +26,6 @@ package java.net; import java.io.IOException; -import java.io.InterruptedIOException; import java.util.Enumeration; /** @@ -500,9 +499,9 @@ class MulticastSocket extends DatagramSocket { */ try { NetworkInterface ni = NetworkInterface.getByInetAddress(ia); - Enumeration addrs = ni.getInetAddresses(); + Enumeration addrs = ni.getInetAddresses(); while (addrs.hasMoreElements()) { - InetAddress addr = (InetAddress)(addrs.nextElement()); + InetAddress addr = addrs.nextElement(); if (addr.equals(infAddress)) { return infAddress; } diff --git a/jdk/src/share/classes/java/net/Proxy.java b/jdk/src/share/classes/java/net/Proxy.java index 333067dea0f..4b8b6f148d5 100644 --- a/jdk/src/share/classes/java/net/Proxy.java +++ b/jdk/src/share/classes/java/net/Proxy.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -73,7 +73,7 @@ public class Proxy { // Creates the proxy that represents a DIRECT connection. private Proxy() { - type = type.DIRECT; + type = Type.DIRECT; sa = null; } diff --git a/jdk/src/share/classes/java/net/ProxySelector.java b/jdk/src/share/classes/java/net/ProxySelector.java index 9a62e138a2a..88f24a210ae 100644 --- a/jdk/src/share/classes/java/net/ProxySelector.java +++ b/jdk/src/share/classes/java/net/ProxySelector.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -69,7 +69,7 @@ public abstract class ProxySelector { static { try { - Class c = Class.forName("sun.net.spi.DefaultProxySelector"); + Class c = Class.forName("sun.net.spi.DefaultProxySelector"); if (c != null && ProxySelector.class.isAssignableFrom(c)) { theProxySelector = (ProxySelector) c.newInstance(); } diff --git a/jdk/src/share/classes/java/net/Socket.java b/jdk/src/share/classes/java/net/Socket.java index 91ec5862b34..22d4d6acd0a 100644 --- a/jdk/src/share/classes/java/net/Socket.java +++ b/jdk/src/share/classes/java/net/Socket.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -459,13 +459,10 @@ class Socket implements java.io.Closeable { oldImpl = AccessController.doPrivileged (new PrivilegedAction() { public Boolean run() { - Class[] cl = new Class[2]; - cl[0] = SocketAddress.class; - cl[1] = Integer.TYPE; - Class clazz = impl.getClass(); + Class clazz = impl.getClass(); while (true) { try { - clazz.getDeclaredMethod("connect", cl); + clazz.getDeclaredMethod("connect", SocketAddress.class, int.class); return Boolean.FALSE; } catch (NoSuchMethodException e) { clazz = clazz.getSuperclass(); diff --git a/jdk/src/share/classes/java/net/SocketPermission.java b/jdk/src/share/classes/java/net/SocketPermission.java index a0fdbb8cc31..b20563bc9dc 100644 --- a/jdk/src/share/classes/java/net/SocketPermission.java +++ b/jdk/src/share/classes/java/net/SocketPermission.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -467,6 +467,7 @@ implements java.io.Serializable * @param action the action string * @return the action mask */ + @SuppressWarnings("fallthrough") private static int getMask(String action) { if (action == null) { @@ -1231,7 +1232,7 @@ final class SocketPermissionCollection extends PermissionCollection implements Serializable { // Not serialized; see serialization section at end of class - private transient List perms; + private transient List perms; /** * Create an empty SocketPermissions object. @@ -1239,7 +1240,7 @@ implements Serializable */ public SocketPermissionCollection() { - perms = new ArrayList(); + perms = new ArrayList(); } /** @@ -1267,7 +1268,7 @@ implements Serializable // optimization to ensure perms most likely to be tested // show up early (4301064) synchronized (this) { - perms.add(0, permission); + perms.add(0, (SocketPermission)permission); } } @@ -1296,7 +1297,7 @@ implements Serializable int len = perms.size(); //System.out.println("implies "+np); for (int i = 0; i < len; i++) { - SocketPermission x = (SocketPermission) perms.get(i); + SocketPermission x = perms.get(i); //System.out.println(" trying "+x); if (((needed & x.getMask()) != 0) && x.impliesIgnoreMask(np)) { effective |= x.getMask(); @@ -1316,10 +1317,11 @@ implements Serializable * @return an enumeration of all the SocketPermission objects. */ - public Enumeration elements() { + @SuppressWarnings("unchecked") + public Enumeration elements() { // Convert Iterator into Enumeration synchronized (this) { - return Collections.enumeration(perms); + return Collections.enumeration((List)(List)perms); } } @@ -1353,7 +1355,7 @@ implements Serializable // Don't call out.defaultWriteObject() // Write out Vector - Vector permissions = new Vector(perms.size()); + Vector permissions = new Vector<>(perms.size()); synchronized (this) { permissions.addAll(perms); @@ -1375,8 +1377,9 @@ implements Serializable ObjectInputStream.GetField gfields = in.readFields(); // Get the one we want - Vector permissions = (Vector)gfields.get("permissions", null); - perms = new ArrayList(permissions.size()); + @SuppressWarnings("unchecked") + Vector permissions = (Vector)gfields.get("permissions", null); + perms = new ArrayList(permissions.size()); perms.addAll(permissions); } } diff --git a/jdk/src/share/classes/java/net/URL.java b/jdk/src/share/classes/java/net/URL.java index 06222c6f100..e7e9ddacc4c 100644 --- a/jdk/src/share/classes/java/net/URL.java +++ b/jdk/src/share/classes/java/net/URL.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,7 +27,6 @@ package java.net; import java.io.IOException; import java.io.InputStream; -import java.io.OutputStream; import java.util.Hashtable; import java.util.StringTokenizer; import sun.security.util.SecurityConstants; @@ -1113,7 +1112,7 @@ public final class URL implements java.io.Serializable { /** * A table of protocol handlers. */ - static Hashtable handlers = new Hashtable(); + static Hashtable handlers = new Hashtable<>(); private static Object streamHandlerLock = new Object(); /** @@ -1122,7 +1121,7 @@ public final class URL implements java.io.Serializable { */ static URLStreamHandler getURLStreamHandler(String protocol) { - URLStreamHandler handler = (URLStreamHandler)handlers.get(protocol); + URLStreamHandler handler = handlers.get(protocol); if (handler == null) { boolean checkedWithFactory = false; @@ -1160,7 +1159,7 @@ public final class URL implements java.io.Serializable { try { String clsName = packagePrefix + "." + protocol + ".Handler"; - Class cls = null; + Class cls = null; try { cls = Class.forName(clsName); } catch (ClassNotFoundException e) { @@ -1185,7 +1184,7 @@ public final class URL implements java.io.Serializable { // Check again with hashtable just in case another // thread created a handler since we last checked - handler2 = (URLStreamHandler)handlers.get(protocol); + handler2 = handlers.get(protocol); if (handler2 != null) { return handler2; diff --git a/jdk/src/share/classes/java/net/URLClassLoader.java b/jdk/src/share/classes/java/net/URLClassLoader.java index 4f28be634ff..fb0fe47cd2b 100644 --- a/jdk/src/share/classes/java/net/URLClassLoader.java +++ b/jdk/src/share/classes/java/net/URLClassLoader.java @@ -25,14 +25,7 @@ package java.net; -import java.lang.reflect.Method; -import java.lang.reflect.Modifier; -import java.lang.ref.*; import java.io.*; -import java.net.URL; -import java.net.URLConnection; -import java.net.URLStreamHandlerFactory; -import java.util.Enumeration; import java.util.*; import java.util.jar.Manifest; import java.util.jar.JarFile; @@ -352,8 +345,8 @@ public class URLClassLoader extends SecureClassLoader implements Closeable { { try { return AccessController.doPrivileged( - new PrivilegedExceptionAction() { - public Class run() throws ClassNotFoundException { + new PrivilegedExceptionAction>() { + public Class run() throws ClassNotFoundException { String path = name.replace('.', '/').concat(".class"); Resource res = ucp.getResource(path, false); if (res != null) { @@ -406,7 +399,7 @@ public class URLClassLoader extends SecureClassLoader implements Closeable { * Resource. The resulting Class must be resolved before it can be * used. */ - private Class defineClass(String name, Resource res) throws IOException { + private Class defineClass(String name, Resource res) throws IOException { long t0 = System.nanoTime(); int i = name.lastIndexOf('.'); URL url = res.getCodeSourceURL(); @@ -774,7 +767,7 @@ final class FactoryURLClassLoader extends URLClassLoader { super(urls, acc); } - public final Class loadClass(String name, boolean resolve) + public final Class loadClass(String name, boolean resolve) throws ClassNotFoundException { // First check if we have permission to access the package. This diff --git a/jdk/src/share/classes/java/net/URLConnection.java b/jdk/src/share/classes/java/net/URLConnection.java index 976e8f66cea..cc747a8eef0 100644 --- a/jdk/src/share/classes/java/net/URLConnection.java +++ b/jdk/src/share/classes/java/net/URLConnection.java @@ -595,7 +595,7 @@ public abstract class URLConnection { * @since 1.4 */ public Map> getHeaderFields() { - return Collections.EMPTY_MAP; + return Collections.emptyMap(); } /** @@ -659,6 +659,7 @@ public abstract class URLConnection { * Default argument is returned if the field is * missing or malformed. */ + @SuppressWarnings("deprecation") public long getHeaderFieldDate(String name, long Default) { String value = getHeaderField(name); try { @@ -1153,7 +1154,7 @@ public abstract class URLConnection { throw new IllegalStateException("Already connected"); if (requests == null) - return Collections.EMPTY_MAP; + return Collections.emptyMap(); return requests.getHeaders(null); } @@ -1236,7 +1237,7 @@ public abstract class URLConnection { factory = fac; } - private static Hashtable handlers = new Hashtable(); + private static Hashtable handlers = new Hashtable<>(); /** * Gets the Content Handler appropriate for this connection. @@ -1250,7 +1251,7 @@ public abstract class URLConnection { if (contentType == null) throw new UnknownServiceException("no content-type"); try { - handler = (ContentHandler) handlers.get(contentType); + handler = handlers.get(contentType); if (handler != null) return handler; } catch(Exception e) { @@ -1316,7 +1317,7 @@ public abstract class URLConnection { try { String clsName = packagePrefix + "." + contentHandlerClassName; - Class cls = null; + Class cls = null; try { cls = Class.forName(clsName); } catch (ClassNotFoundException e) { diff --git a/jdk/src/share/classes/javax/net/ssl/SSLServerSocketFactory.java b/jdk/src/share/classes/javax/net/ssl/SSLServerSocketFactory.java index dc32d14e559..24911295adf 100644 --- a/jdk/src/share/classes/javax/net/ssl/SSLServerSocketFactory.java +++ b/jdk/src/share/classes/javax/net/ssl/SSLServerSocketFactory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -87,7 +87,7 @@ public abstract class SSLServerSocketFactory extends ServerSocketFactory if (clsName != null) { log("setting up default SSLServerSocketFactory"); try { - Class cls = null; + Class cls = null; try { cls = Class.forName(clsName); } catch (ClassNotFoundException e) { diff --git a/jdk/src/share/classes/javax/net/ssl/SSLSocketFactory.java b/jdk/src/share/classes/javax/net/ssl/SSLSocketFactory.java index f7d5e5b0a2f..c3d33c34f70 100644 --- a/jdk/src/share/classes/javax/net/ssl/SSLSocketFactory.java +++ b/jdk/src/share/classes/javax/net/ssl/SSLSocketFactory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -95,7 +95,7 @@ public abstract class SSLSocketFactory extends SocketFactory if (clsName != null) { log("setting up default SSLSocketFactory"); try { - Class cls = null; + Class cls = null; try { cls = Class.forName(clsName); } catch (ClassNotFoundException e) { diff --git a/jdk/src/share/classes/sun/misc/REException.java b/jdk/src/share/classes/sun/misc/REException.java index 1799e82cd95..2b091cd6616 100644 --- a/jdk/src/share/classes/sun/misc/REException.java +++ b/jdk/src/share/classes/sun/misc/REException.java @@ -31,6 +31,9 @@ package sun.misc; */ public class REException extends Exception { + + private static final long serialVersionUID = 4656584872733646963L; + REException (String s) { super(s); } diff --git a/jdk/src/share/classes/sun/net/TransferProtocolClient.java b/jdk/src/share/classes/sun/net/TransferProtocolClient.java index 2b74b62e0f0..79f9e1358f8 100644 --- a/jdk/src/share/classes/sun/net/TransferProtocolClient.java +++ b/jdk/src/share/classes/sun/net/TransferProtocolClient.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1994, 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1994, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,10 +25,8 @@ package sun.net; -import java.lang.StringIndexOutOfBoundsException; import java.io.*; import java.util.Vector; -import sun.net.NetworkClient; /** * This class implements that basic intefaces of transfer protocols. @@ -44,7 +42,7 @@ public class TransferProtocolClient extends NetworkClient { /** Array of strings (usually 1 entry) for the last reply from the server. */ - protected Vector serverResponse = new Vector(1); + protected Vector serverResponse = new Vector<>(1); /** code for last reply */ protected int lastReplyCode; @@ -123,11 +121,11 @@ public class TransferProtocolClient extends NetworkClient { /** converts the server response into a string. */ public String getResponseString() { - return (String) serverResponse.elementAt(0); + return serverResponse.elementAt(0); } /** Returns all server response strings. */ - public Vector getResponseStrings() { + public Vector getResponseStrings() { return serverResponse; } diff --git a/jdk/src/share/classes/sun/net/ftp/FtpClientProvider.java b/jdk/src/share/classes/sun/net/ftp/FtpClientProvider.java index 71cd134fb17..7a09810718c 100644 --- a/jdk/src/share/classes/sun/net/ftp/FtpClientProvider.java +++ b/jdk/src/share/classes/sun/net/ftp/FtpClientProvider.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -67,16 +67,13 @@ public abstract class FtpClientProvider { return false; } try { - Class c = Class.forName(cm, true, null); + Class c = Class.forName(cm, true, null); provider = (FtpClientProvider) c.newInstance(); return true; - } catch (ClassNotFoundException x) { - throw new ServiceConfigurationError(x.toString()); - } catch (IllegalAccessException x) { - throw new ServiceConfigurationError(x.toString()); - } catch (InstantiationException x) { - throw new ServiceConfigurationError(x.toString()); - } catch (SecurityException x) { + } catch (ClassNotFoundException | + IllegalAccessException | + InstantiationException | + SecurityException x) { throw new ServiceConfigurationError(x.toString()); } } diff --git a/jdk/src/share/classes/sun/net/httpserver/Request.java b/jdk/src/share/classes/sun/net/httpserver/Request.java index ee2db48240f..f0b56e1e815 100644 --- a/jdk/src/share/classes/sun/net/httpserver/Request.java +++ b/jdk/src/share/classes/sun/net/httpserver/Request.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,13 +25,10 @@ package sun.net.httpserver; -import java.util.*; import java.nio.*; -import java.net.*; import java.io.*; import java.nio.channels.*; import com.sun.net.httpserver.*; -import com.sun.net.httpserver.spi.*; /** */ @@ -47,7 +44,6 @@ class Request { private OutputStream os; Request (InputStream rawInputStream, OutputStream rawout) throws IOException { - this.chan = chan; is = rawInputStream; os = rawout; do { @@ -121,7 +117,7 @@ class Request { } Headers hdrs = null; - + @SuppressWarnings("fallthrough") Headers headers () throws IOException { if (hdrs != null) { return hdrs; @@ -152,6 +148,7 @@ class Request { parseloop:{ while ((c = is.read()) >= 0) { switch (c) { + /*fallthrough*/ case ':': if (inKey && len > 0) keyend = len; diff --git a/jdk/src/share/classes/sun/net/httpserver/SSLStreams.java b/jdk/src/share/classes/sun/net/httpserver/SSLStreams.java index c6b87cd6729..6e362d07aa4 100644 --- a/jdk/src/share/classes/sun/net/httpserver/SSLStreams.java +++ b/jdk/src/share/classes/sun/net/httpserver/SSLStreams.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -29,13 +29,10 @@ import java.net.*; import java.nio.*; import java.io.*; import java.nio.channels.*; -import java.util.*; -import java.util.concurrent.*; import java.util.concurrent.locks.*; import javax.net.ssl.*; import javax.net.ssl.SSLEngineResult.*; import com.sun.net.httpserver.*; -import com.sun.net.httpserver.spi.*; /** * given a non-blocking SocketChannel, it produces @@ -448,6 +445,7 @@ class SSLStreams { * on the wrapper methods being idempotent. eg. if wrapAndSend() * is called with no data to send then there must be no problem */ + @SuppressWarnings("fallthrough") void doHandshake (HandshakeStatus hs_status) throws IOException { try { handshaking.lock(); diff --git a/jdk/src/share/classes/sun/net/httpserver/ServerImpl.java b/jdk/src/share/classes/sun/net/httpserver/ServerImpl.java index 5b53389d45f..cce9c136e8a 100644 --- a/jdk/src/share/classes/sun/net/httpserver/ServerImpl.java +++ b/jdk/src/share/classes/sun/net/httpserver/ServerImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -593,8 +593,8 @@ class ServerImpl implements TimeSource { rheaders.set ("Connection", "close"); } else if (chdr.equalsIgnoreCase ("keep-alive")) { rheaders.set ("Connection", "keep-alive"); - int idle=(int)ServerConfig.getIdleInterval()/1000; - int max=(int)ServerConfig.getMaxIdleConnections(); + int idle=(int)(ServerConfig.getIdleInterval()/1000); + int max=ServerConfig.getMaxIdleConnections(); String val = "timeout="+idle+", max="+max; rheaders.set ("Keep-Alive", val); } diff --git a/jdk/src/share/classes/sun/net/idn/UCharacterEnums.java b/jdk/src/share/classes/sun/net/idn/UCharacterEnums.java index 660d055a013..eef2fdda421 100644 --- a/jdk/src/share/classes/sun/net/idn/UCharacterEnums.java +++ b/jdk/src/share/classes/sun/net/idn/UCharacterEnums.java @@ -33,6 +33,22 @@ // - copy this file from icu4jsrc_3_2/src/com/ibm/icu/lang/UCharacterEnums.java // - move from package com.ibm.icu.lang to package sun.net.idn // +// 2011-09-06 Kurchi Subhra Hazra +// - Added @Deprecated tag to the following: +// - class UCharacterEnums +// - interfaces ECharacterCategory, ECharacterDirection +// - fields INITIAL_QUOTE_PUNCTUATION, FINAL_QUOTE_PUNCTUATION, +// DIRECTIONALITY_LEFT_TO_RIGHT, DIRECTIONALITY_RIGHT_TO_LEFT, +// DIRECTIONALITY_EUROPEAN_NUMBER, DIRECTIONALITY_EUROPEAN_NUMBER_SEPARATOR +// DIRECTIONALITY_EUROPEAN_NUMBER_TERMINATOR, DIRECTIONALITY_ARABIC_NUMBER, +// DIRECTIONALITY_COMMON_NUMBER_SEPARATOR, DIRECTIONALITY_PARAGRAPH_SEPARATOR, +// DIRECTIONALITY_SEGMENT_SEPARATOR, DIRECTIONALITY_WHITESPACE, +// DIRECTIONALITY_OTHER_NEUTRALS, DIRECTIONALITY_LEFT_TO_RIGHT_EMBEDDING, +// DIRECTIONALITY_LEFT_TO_RIGHT_OVERRIDE, DIRECTIONALITY_RIGHT_TO_LEFT_ARABIC, +// DIRECTIONALITY_RIGHT_TO_LEFT_EMBEDDING, DIRECTIONALITY_RIGHT_TO_LEFT_OVERRIDE, +// DIRECTIONALITY_POP_DIRECTIONAL_FORMAT, DIRECTIONALITY_NON_SPACING_MARK, +// DIRECTIONALITY_BOUNDARY_NEUTRAL, DIRECTIONALITY_UNDEFINED +// package sun.net.idn; @@ -41,6 +57,8 @@ package sun.net.idn; * @draft ICU 3.0 * @deprecated This is a draft API and might change in a future release of ICU. */ + +@Deprecated class UCharacterEnums { /** This is just a namespace, it is not instantiatable. */ @@ -54,6 +72,7 @@ class UCharacterEnums { * @draft ICU 3.0 * @deprecated This is a draft API and might change in a future release of ICU. */ + @Deprecated public static interface ECharacterCategory { /** * Unassigned character type @@ -245,6 +264,7 @@ class UCharacterEnums { * @draft ICU 2.8 * @deprecated This is a draft API and might change in a future release of ICU. */ + @Deprecated public static final int INITIAL_QUOTE_PUNCTUATION = 28; /** @@ -261,6 +281,7 @@ class UCharacterEnums { * @draft ICU 2.8 * @deprecated This is a draft API and might change in a future release of ICU. */ + @Deprecated public static final int FINAL_QUOTE_PUNCTUATION = 29; /** @@ -279,6 +300,8 @@ class UCharacterEnums { * @draft ICU 3.0 * @deprecated This is a draft API and might change in a future release of ICU. */ + + @Deprecated public static interface ECharacterDirection { /** * Directional type L @@ -291,6 +314,7 @@ class UCharacterEnums { * @draft ICU 3.0 * @deprecated This is a draft API and might change in a future release of ICU. */ + @Deprecated public static final byte DIRECTIONALITY_LEFT_TO_RIGHT = (byte)LEFT_TO_RIGHT; /** @@ -304,6 +328,7 @@ class UCharacterEnums { * @draft ICU 3.0 * @deprecated This is a draft API and might change in a future release of ICU. */ + @Deprecated public static final byte DIRECTIONALITY_RIGHT_TO_LEFT = (byte)RIGHT_TO_LEFT; /** @@ -317,6 +342,7 @@ class UCharacterEnums { * @draft ICU 3.0 * @deprecated This is a draft API and might change in a future release of ICU. */ + @Deprecated public static final byte DIRECTIONALITY_EUROPEAN_NUMBER = (byte)EUROPEAN_NUMBER; /** @@ -330,6 +356,7 @@ class UCharacterEnums { * @draft ICU 3.0 * @deprecated This is a draft API and might change in a future release of ICU. */ + @Deprecated public static final byte DIRECTIONALITY_EUROPEAN_NUMBER_SEPARATOR = (byte)EUROPEAN_NUMBER_SEPARATOR; /** @@ -343,6 +370,7 @@ class UCharacterEnums { * @draft ICU 3.0 * @deprecated This is a draft API and might change in a future release of ICU. */ + @Deprecated public static final byte DIRECTIONALITY_EUROPEAN_NUMBER_TERMINATOR = (byte)EUROPEAN_NUMBER_TERMINATOR; /** @@ -356,6 +384,7 @@ class UCharacterEnums { * @draft ICU 3.0 * @deprecated This is a draft API and might change in a future release of ICU. */ + @Deprecated public static final byte DIRECTIONALITY_ARABIC_NUMBER = (byte)ARABIC_NUMBER; /** @@ -369,6 +398,7 @@ class UCharacterEnums { * @draft ICU 3.0 * @deprecated This is a draft API and might change in a future release of ICU. */ + @Deprecated public static final byte DIRECTIONALITY_COMMON_NUMBER_SEPARATOR = (byte)COMMON_NUMBER_SEPARATOR; /** @@ -382,6 +412,7 @@ class UCharacterEnums { * @draft ICU 3.0 * @deprecated This is a draft API and might change in a future release of ICU. */ + @Deprecated public static final byte DIRECTIONALITY_PARAGRAPH_SEPARATOR = (byte)BLOCK_SEPARATOR; /** @@ -395,6 +426,7 @@ class UCharacterEnums { * @draft ICU 3.0 * @deprecated This is a draft API and might change in a future release of ICU. */ + @Deprecated public static final byte DIRECTIONALITY_SEGMENT_SEPARATOR = (byte)SEGMENT_SEPARATOR; /** @@ -408,6 +440,7 @@ class UCharacterEnums { * @draft ICU 3.0 * @deprecated This is a draft API and might change in a future release of ICU. */ + @Deprecated public static final byte DIRECTIONALITY_WHITESPACE = (byte)WHITE_SPACE_NEUTRAL; /** @@ -421,6 +454,7 @@ class UCharacterEnums { * @draft ICU 3.0 * @deprecated This is a draft API and might change in a future release of ICU. */ + @Deprecated public static final byte DIRECTIONALITY_OTHER_NEUTRALS = (byte)OTHER_NEUTRAL; /** @@ -434,6 +468,7 @@ class UCharacterEnums { * @draft ICU 3.0 * @deprecated This is a draft API and might change in a future release of ICU. */ + @Deprecated public static final byte DIRECTIONALITY_LEFT_TO_RIGHT_EMBEDDING = (byte)LEFT_TO_RIGHT_EMBEDDING; /** @@ -447,6 +482,7 @@ class UCharacterEnums { * @draft ICU 3.0 * @deprecated This is a draft API and might change in a future release of ICU. */ + @Deprecated public static final byte DIRECTIONALITY_LEFT_TO_RIGHT_OVERRIDE = (byte)LEFT_TO_RIGHT_OVERRIDE; /** @@ -460,6 +496,7 @@ class UCharacterEnums { * @draft ICU 3.0 * @deprecated This is a draft API and might change in a future release of ICU. */ + @Deprecated public static final byte DIRECTIONALITY_RIGHT_TO_LEFT_ARABIC = (byte)RIGHT_TO_LEFT_ARABIC; /** @@ -473,6 +510,7 @@ class UCharacterEnums { * @draft ICU 3.0 * @deprecated This is a draft API and might change in a future release of ICU. */ + @Deprecated public static final byte DIRECTIONALITY_RIGHT_TO_LEFT_EMBEDDING = (byte)RIGHT_TO_LEFT_EMBEDDING; /** @@ -486,6 +524,7 @@ class UCharacterEnums { * @draft ICU 3.0 * @deprecated This is a draft API and might change in a future release of ICU. */ + @Deprecated public static final byte DIRECTIONALITY_RIGHT_TO_LEFT_OVERRIDE = (byte)RIGHT_TO_LEFT_OVERRIDE; /** @@ -499,6 +538,7 @@ class UCharacterEnums { * @draft ICU 3.0 * @deprecated This is a draft API and might change in a future release of ICU. */ + @Deprecated public static final byte DIRECTIONALITY_POP_DIRECTIONAL_FORMAT = (byte)POP_DIRECTIONAL_FORMAT; /** @@ -512,6 +552,7 @@ class UCharacterEnums { * @draft ICU 3.0 * @deprecated This is a draft API and might change in a future release of ICU. */ + @Deprecated public static final byte DIRECTIONALITY_NON_SPACING_MARK = (byte)DIR_NON_SPACING_MARK; /** @@ -525,6 +566,7 @@ class UCharacterEnums { * @draft ICU 3.0 * @deprecated This is a draft API and might change in a future release of ICU. */ + @Deprecated public static final byte DIRECTIONALITY_BOUNDARY_NEUTRAL = (byte)BOUNDARY_NEUTRAL; /** @@ -539,6 +581,7 @@ class UCharacterEnums { * @draft ICU 3.0 * @deprecated This is a draft API and might change in a future release of ICU. */ + @Deprecated public static final byte DIRECTIONALITY_UNDEFINED = -1; } } diff --git a/jdk/src/share/classes/sun/net/spi/nameservice/dns/DNSNameService.java b/jdk/src/share/classes/sun/net/spi/nameservice/dns/DNSNameService.java index 9142de0a3c0..5b11fe33e16 100644 --- a/jdk/src/share/classes/sun/net/spi/nameservice/dns/DNSNameService.java +++ b/jdk/src/share/classes/sun/net/spi/nameservice/dns/DNSNameService.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -140,7 +140,7 @@ public final class DNSNameService implements NameService { // create new soft reference to our thread context // thrCtxt = new ThreadContext(dirCtxt, nsList); - contextRef.set(new SoftReference(thrCtxt)); + contextRef.set(new SoftReference(thrCtxt)); } return thrCtxt.dirContext(); @@ -193,7 +193,7 @@ public final class DNSNameService implements NameService { Attribute attr = ne.next(); String attrID = attr.getID(); - for (NamingEnumeration e = attr.getAll(); e.hasMoreElements();) { + for (NamingEnumeration e = attr.getAll(); e.hasMoreElements();) { String addr = (String)e.next(); // for canoncical name records do recursive lookup @@ -233,7 +233,7 @@ public final class DNSNameService implements NameService { String domain = AccessController.doPrivileged( new GetPropertyAction("sun.net.spi.nameservice.domain")); if (domain != null && domain.length() > 0) { - domainList = new LinkedList(); + domainList = new LinkedList(); domainList.add(domain); } @@ -282,7 +282,7 @@ public final class DNSNameService implements NameService { throw new Error(nx); } - ArrayList results = null; + ArrayList results = null; UnknownHostException uhe = null; // If host already contains a domain name then just look it up @@ -365,7 +365,7 @@ public final class DNSNameService implements NameService { InetAddress[] addrs = new InetAddress[results.size()]; int count = 0; for (int i=0; i { int index; boolean returnsValue; // or key @@ -202,7 +202,7 @@ public class HeaderParser { public boolean hasNext () { return index keys () { return new ParserIterator (false); } - public Iterator values () { + public Iterator values () { return new ParserIterator (true); } public String toString () { - Iterator k = keys(); + Iterator k = keys(); StringBuffer sbuf = new StringBuffer(); sbuf.append ("{size="+asize+" nkeys="+nkeys+" "); for (int i=0; k.hasNext(); i++) { - String key = (String)k.next(); + String key = k.next(); String val = findValue (i); if (val != null && "".equals (val)) { val = null; diff --git a/jdk/src/share/classes/sun/net/www/MessageHeader.java b/jdk/src/share/classes/sun/net/www/MessageHeader.java index 9f2ad57691c..dbb2cfc7c3a 100644 --- a/jdk/src/share/classes/sun/net/www/MessageHeader.java +++ b/jdk/src/share/classes/sun/net/www/MessageHeader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -35,7 +35,6 @@ import java.util.Map; import java.util.HashMap; import java.util.List; import java.util.ArrayList; -import java.util.Set; import java.util.Iterator; import java.util.NoSuchElementException; @@ -199,7 +198,8 @@ class MessageHeader { return filterAndAddHeaders(excludeList, null); } - public synchronized Map> filterAndAddHeaders(String[] excludeList, Map> include) { + public synchronized Map> filterAndAddHeaders( + String[] excludeList, Map> include) { boolean skipIt = false; Map> m = new HashMap>(); for (int i = nkeys; --i >= 0;) { @@ -228,15 +228,13 @@ class MessageHeader { } if (include != null) { - Iterator entries = include.entrySet().iterator(); - while (entries.hasNext()) { - Map.Entry entry = (Map.Entry)entries.next(); - List l = (List)m.get(entry.getKey()); + for (Map.Entry> entry: include.entrySet()) { + List l = m.get(entry.getKey()); if (l == null) { - l = new ArrayList(); - m.put((String)entry.getKey(), l); + l = new ArrayList(); + m.put(entry.getKey(), l); } - l.add(entry.getValue()); + l.addAll(entry.getValue()); } } @@ -400,6 +398,7 @@ class MessageHeader { } /** Parse and merge a MIME header from an input stream. */ + @SuppressWarnings("fallthrough") public void mergeHeader(InputStream is) throws java.io.IOException { if (is == null) return; @@ -421,6 +420,7 @@ class MessageHeader { break; case '\t': c = ' '; + /*fall through*/ case ' ': inKey = false; break; diff --git a/jdk/src/share/classes/sun/net/www/MimeTable.java b/jdk/src/share/classes/sun/net/www/MimeTable.java index b8b70fdba91..cab244c7615 100644 --- a/jdk/src/share/classes/sun/net/www/MimeTable.java +++ b/jdk/src/share/classes/sun/net/www/MimeTable.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1994, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1994, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,10 +25,6 @@ package sun.net.www; import java.io.*; -import java.util.Calendar; -import java.util.Date; -import java.text.SimpleDateFormat; -import java.net.URL; import java.net.FileNameMap; import java.util.Hashtable; import java.util.Enumeration; @@ -271,7 +267,7 @@ public class MimeTable implements FileNameMap { String tempFileTemplate = (String)entries.get("temp.file.template"); if (tempFileTemplate != null) { entries.remove("temp.file.template"); - this.tempFileTemplate = tempFileTemplate; + MimeTable.tempFileTemplate = tempFileTemplate; } // now, parse the mime-type spec's @@ -417,10 +413,10 @@ public class MimeTable implements FileNameMap { String user = System.getProperty("user.name"); if (user != null) { tag = "; customized for " + user; - properties.save(os, filePreamble + tag); + properties.store(os, filePreamble + tag); } else { - properties.save(os, filePreamble); + properties.store(os, filePreamble); } } catch (IOException e) { diff --git a/jdk/src/share/classes/sun/net/www/URLConnection.java b/jdk/src/share/classes/sun/net/www/URLConnection.java index 2760acc2081..c4959285d60 100644 --- a/jdk/src/share/classes/sun/net/www/URLConnection.java +++ b/jdk/src/share/classes/sun/net/www/URLConnection.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,12 +26,7 @@ package sun.net.www; import java.net.URL; -import java.net.ContentHandler; import java.util.*; -import java.io.InputStream; -import java.io.OutputStream; -import java.io.BufferedInputStream; -import java.net.UnknownServiceException; /** * A class to represent an active connection to an object @@ -99,7 +94,7 @@ abstract public class URLConnection extends java.net.URLConnection { public Map> getRequestProperties() { if (connected) throw new IllegalStateException("Already connected"); - return Collections.EMPTY_MAP; + return Collections.emptyMap(); } public String getHeaderField(String name) { diff --git a/jdk/src/share/classes/sun/net/www/content/image/gif.java b/jdk/src/share/classes/sun/net/www/content/image/gif.java index d388fad9720..adba0c16d5b 100644 --- a/jdk/src/share/classes/sun/net/www/content/image/gif.java +++ b/jdk/src/share/classes/sun/net/www/content/image/gif.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1994, 1999, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1994, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,11 +25,8 @@ package sun.net.www.content.image; -import java.net.URL; -import java.net.URLConnection; import java.net.*; import sun.awt.image.*; -import java.io.InputStream; import java.io.IOException; import java.awt.Image; import java.awt.Toolkit; @@ -40,7 +37,7 @@ public class gif extends ContentHandler { return new URLImageSource(urlc); } - public Object getContent(URLConnection urlc, Class[] classes) throws IOException { + public Object getContent(URLConnection urlc, Class[] classes) throws IOException { for (int i = 0; i < classes.length; i++) { if (classes[i].isAssignableFrom(URLImageSource.class)) { return new URLImageSource(urlc); diff --git a/jdk/src/share/classes/sun/net/www/content/image/jpeg.java b/jdk/src/share/classes/sun/net/www/content/image/jpeg.java index 382d36347d4..8076954caeb 100644 --- a/jdk/src/share/classes/sun/net/www/content/image/jpeg.java +++ b/jdk/src/share/classes/sun/net/www/content/image/jpeg.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 1999, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,11 +25,8 @@ package sun.net.www.content.image; -import java.net.URL; -import java.net.URLConnection; import java.net.*; import sun.awt.image.*; -import java.io.InputStream; import java.io.IOException; import java.awt.Image; import java.awt.Toolkit; @@ -39,7 +36,7 @@ public class jpeg extends ContentHandler { return new URLImageSource(urlc); } - public Object getContent(URLConnection urlc, Class[] classes) throws IOException { + public Object getContent(URLConnection urlc, Class[] classes) throws IOException { for (int i = 0; i < classes.length; i++) { if (classes[i].isAssignableFrom(URLImageSource.class)) { return new URLImageSource(urlc); diff --git a/jdk/src/share/classes/sun/net/www/content/image/png.java b/jdk/src/share/classes/sun/net/www/content/image/png.java index 607402c87b4..88026de1e25 100644 --- a/jdk/src/share/classes/sun/net/www/content/image/png.java +++ b/jdk/src/share/classes/sun/net/www/content/image/png.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,10 +25,7 @@ package sun.net.www.content.image; -import java.net.URL; -import java.net.URLConnection; import java.net.*; -import java.io.InputStream; import java.io.IOException; import sun.awt.image.*; import java.awt.Image; @@ -39,7 +36,7 @@ public class png extends ContentHandler { return new URLImageSource(urlc); } - public Object getContent(URLConnection urlc, Class[] classes) throws IOException { + public Object getContent(URLConnection urlc, Class[] classes) throws IOException { for (int i = 0; i < classes.length; i++) { if (classes[i].isAssignableFrom(URLImageSource.class)) { return new URLImageSource(urlc); diff --git a/jdk/src/share/classes/sun/net/www/content/image/x_xbitmap.java b/jdk/src/share/classes/sun/net/www/content/image/x_xbitmap.java index eea24fd2c1b..10e724622db 100644 --- a/jdk/src/share/classes/sun/net/www/content/image/x_xbitmap.java +++ b/jdk/src/share/classes/sun/net/www/content/image/x_xbitmap.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1994, 1999, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1994, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -35,7 +35,7 @@ public class x_xbitmap extends ContentHandler { return new URLImageSource(urlc); } - public Object getContent(URLConnection urlc, Class[] classes) throws java.io.IOException { + public Object getContent(URLConnection urlc, Class[] classes) throws java.io.IOException { for (int i = 0; i < classes.length; i++) { if (classes[i].isAssignableFrom(URLImageSource.class)) { return new URLImageSource(urlc); diff --git a/jdk/src/share/classes/sun/net/www/content/image/x_xpixmap.java b/jdk/src/share/classes/sun/net/www/content/image/x_xpixmap.java index 31e83aad91e..3b3ed4006a2 100644 --- a/jdk/src/share/classes/sun/net/www/content/image/x_xpixmap.java +++ b/jdk/src/share/classes/sun/net/www/content/image/x_xpixmap.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1994, 1999, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1994, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -35,7 +35,7 @@ public class x_xpixmap extends ContentHandler { return new URLImageSource(urlc); } - public Object getContent(URLConnection urlc, Class[] classes) throws java.io.IOException { + public Object getContent(URLConnection urlc, Class[] classes) throws java.io.IOException { for (int i = 0; i < classes.length; i++) { if (classes[i].isAssignableFrom(URLImageSource.class)) { return new URLImageSource(urlc); diff --git a/jdk/src/share/classes/sun/net/www/http/KeepAliveStream.java b/jdk/src/share/classes/sun/net/www/http/KeepAliveStream.java index 5d7bb573aab..db9b7b03041 100644 --- a/jdk/src/share/classes/sun/net/www/http/KeepAliveStream.java +++ b/jdk/src/share/classes/sun/net/www/http/KeepAliveStream.java @@ -81,7 +81,7 @@ class KeepAliveStream extends MeteredStream implements Hurryable { // NOTE: Don't close super class try { if (expected > count) { - long nskip = (long) (expected - count); + long nskip = expected - count; if (nskip <= available()) { long n = 0; while (n < nskip) { diff --git a/jdk/src/share/classes/sun/net/www/protocol/gopher/GopherClient.java b/jdk/src/share/classes/sun/net/www/protocol/gopher/GopherClient.java index 41c6b8d2894..03470634a37 100644 --- a/jdk/src/share/classes/sun/net/www/protocol/gopher/GopherClient.java +++ b/jdk/src/share/classes/sun/net/www/protocol/gopher/GopherClient.java @@ -281,7 +281,7 @@ public class GopherClient extends NetworkClient implements Runnable { ps.print("\n\n

"); ps.print(title); ps.print("

\n"); - DataInputStream ds = new DataInputStream(serverInput); + BufferedReader ds = new BufferedReader(new InputStreamReader(serverInput)); String s; while ((s = ds.readLine()) != null) { int len = s.length(); diff --git a/jdk/src/share/classes/sun/net/www/protocol/http/AuthCacheImpl.java b/jdk/src/share/classes/sun/net/www/protocol/http/AuthCacheImpl.java index c2ebf429922..45a5a0eaf9b 100644 --- a/jdk/src/share/classes/sun/net/www/protocol/http/AuthCacheImpl.java +++ b/jdk/src/share/classes/sun/net/www/protocol/http/AuthCacheImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,12 +25,8 @@ package sun.net.www.protocol.http; -import java.io.IOException; -import java.net.URL; -import java.util.Hashtable; import java.util.LinkedList; import java.util.ListIterator; -import java.util.Enumeration; import java.util.HashMap; /** @@ -38,13 +34,13 @@ import java.util.HashMap; */ public class AuthCacheImpl implements AuthCache { - HashMap hashtable; + HashMap> hashtable; public AuthCacheImpl () { - hashtable = new HashMap (); + hashtable = new HashMap>(); } - public void setMap (HashMap map) { + public void setMap (HashMap> map) { hashtable = map; } @@ -52,21 +48,21 @@ public class AuthCacheImpl implements AuthCache { // is the path field of AuthenticationInfo public synchronized void put (String pkey, AuthCacheValue value) { - LinkedList list = (LinkedList) hashtable.get (pkey); + LinkedList list = hashtable.get (pkey); String skey = value.getPath(); if (list == null) { - list = new LinkedList (); - hashtable.put (pkey, list); + list = new LinkedList(); + hashtable.put(pkey, list); } // Check if the path already exists or a super-set of it exists - ListIterator iter = list.listIterator(); + ListIterator iter = list.listIterator(); while (iter.hasNext()) { AuthenticationInfo inf = (AuthenticationInfo)iter.next(); if (inf.path == null || inf.path.startsWith (skey)) { iter.remove (); } } - iter.add (value); + iter.add(value); } // get a value from map checking both primary @@ -74,7 +70,7 @@ public class AuthCacheImpl implements AuthCache { public synchronized AuthCacheValue get (String pkey, String skey) { AuthenticationInfo result = null; - LinkedList list = (LinkedList) hashtable.get (pkey); + LinkedList list = hashtable.get (pkey); if (list == null || list.size() == 0) { return null; } @@ -82,7 +78,7 @@ public class AuthCacheImpl implements AuthCache { // list should contain only one element return (AuthenticationInfo)list.get (0); } - ListIterator iter = list.listIterator(); + ListIterator iter = list.listIterator(); while (iter.hasNext()) { AuthenticationInfo inf = (AuthenticationInfo)iter.next(); if (skey.startsWith (inf.path)) { @@ -93,7 +89,7 @@ public class AuthCacheImpl implements AuthCache { } public synchronized void remove (String pkey, AuthCacheValue entry) { - LinkedList list = (LinkedList) hashtable.get (pkey); + LinkedList list = hashtable.get (pkey); if (list == null) { return; } @@ -101,7 +97,7 @@ public class AuthCacheImpl implements AuthCache { list.clear(); return; } - ListIterator iter = list.listIterator (); + ListIterator iter = list.listIterator (); while (iter.hasNext()) { AuthenticationInfo inf = (AuthenticationInfo)iter.next(); if (entry.equals(inf)) { diff --git a/jdk/src/share/classes/sun/net/www/protocol/http/AuthenticationHeader.java b/jdk/src/share/classes/sun/net/www/protocol/http/AuthenticationHeader.java index eee2579d64f..390898292f0 100644 --- a/jdk/src/share/classes/sun/net/www/protocol/http/AuthenticationHeader.java +++ b/jdk/src/share/classes/sun/net/www/protocol/http/AuthenticationHeader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -122,7 +122,7 @@ public class AuthenticationHeader { this.dontUseNegotiate = dontUseNegotiate; rsp = response; this.hdrname = hdrname; - schemes = new HashMap(); + schemes = new HashMap(); parse(); } @@ -136,7 +136,7 @@ public class AuthenticationHeader { HeaderParser parser; } - HashMap schemes; + HashMap schemes; /* Iterate through each header line, and then within each line. * If multiple entries exist for a particular scheme (unlikely) @@ -144,11 +144,11 @@ public class AuthenticationHeader { * preferred scheme that we support will be used. */ private void parse () { - Iterator iter = rsp.multiValueIterator (hdrname); + Iterator iter = rsp.multiValueIterator(hdrname); while (iter.hasNext()) { - String raw = (String)iter.next(); - HeaderParser hp = new HeaderParser (raw); - Iterator keys = hp.keys(); + String raw = iter.next(); + HeaderParser hp = new HeaderParser(raw); + Iterator keys = hp.keys(); int i, lastSchemeIndex; for (i=0, lastSchemeIndex = -1; keys.hasNext(); i++) { keys.next(); @@ -164,7 +164,7 @@ public class AuthenticationHeader { if (i > lastSchemeIndex) { HeaderParser hpn = hp.subsequence (lastSchemeIndex, i); String scheme = hpn.findKey(0); - schemes.put (scheme, new SchemeMapValue (hpn, raw)); + schemes.put(scheme, new SchemeMapValue (hpn, raw)); } } @@ -172,10 +172,10 @@ public class AuthenticationHeader { * negotiate -> kerberos -> digest -> ntlm -> basic */ SchemeMapValue v = null; - if (authPref == null || (v=(SchemeMapValue)schemes.get (authPref)) == null) { + if (authPref == null || (v=schemes.get (authPref)) == null) { if(v == null && !dontUseNegotiate) { - SchemeMapValue tmp = (SchemeMapValue)schemes.get("negotiate"); + SchemeMapValue tmp = schemes.get("negotiate"); if(tmp != null) { if(hci == null || !NegotiateAuthentication.isSupported(new HttpCallerInfo(hci, "Negotiate"))) { tmp = null; @@ -185,7 +185,7 @@ public class AuthenticationHeader { } if(v == null && !dontUseNegotiate) { - SchemeMapValue tmp = (SchemeMapValue)schemes.get("kerberos"); + SchemeMapValue tmp = schemes.get("kerberos"); if(tmp != null) { // the Kerberos scheme is only observed in MS ISA Server. In // fact i think it's a Kerberos-mechnism-only Negotiate. @@ -205,9 +205,9 @@ public class AuthenticationHeader { } if(v == null) { - if ((v=(SchemeMapValue)schemes.get ("digest")) == null) { - if (((v=(SchemeMapValue)schemes.get("ntlm"))==null)) { - v = (SchemeMapValue)schemes.get ("basic"); + if ((v=schemes.get ("digest")) == null) { + if (((v=schemes.get("ntlm"))==null)) { + v = schemes.get ("basic"); } } } diff --git a/jdk/src/share/classes/sun/net/www/protocol/http/HttpURLConnection.java b/jdk/src/share/classes/sun/net/www/protocol/http/HttpURLConnection.java index 4b297b8ba59..e14ce8d810d 100644 --- a/jdk/src/share/classes/sun/net/www/protocol/http/HttpURLConnection.java +++ b/jdk/src/share/classes/sun/net/www/protocol/http/HttpURLConnection.java @@ -25,6 +25,7 @@ package sun.net.www.protocol.http; +import java.util.Arrays; import java.net.URL; import java.net.URLConnection; import java.net.ProtocolException; @@ -229,9 +230,9 @@ public class HttpURLConnection extends java.net.HttpURLConnection { bufSize4ES = 4096; // use the default } - allowRestrictedHeaders = ((Boolean)java.security.AccessController.doPrivileged( + allowRestrictedHeaders = java.security.AccessController.doPrivileged( new sun.security.action.GetBooleanAction( - "sun.net.http.allowRestrictedHeaders"))).booleanValue(); + "sun.net.http.allowRestrictedHeaders")).booleanValue(); if (!allowRestrictedHeaders) { restrictedHeaderSet = new HashSet(restrictedHeaders.length); for (int i=0; i < restrictedHeaders.length; i++) { @@ -289,6 +290,7 @@ public class HttpURLConnection extends java.net.HttpURLConnection { * REMIND: backwards compatibility with JDK 1.1. Should be * eliminated for JDK 2.0. */ + @Deprecated private static HttpAuthenticator defaultAuth; /* all the headers we send @@ -750,6 +752,7 @@ public class HttpURLConnection extends java.net.HttpURLConnection { /** * @deprecated. Use java.net.Authenticator.setDefault() instead. */ + @Deprecated public static void setDefaultAuthenticator(HttpAuthenticator a) { defaultAuth = a; } @@ -830,8 +833,7 @@ public class HttpURLConnection extends java.net.HttpURLConnection { InetAddress a1 = InetAddress.getByName(h1); InetAddress a2 = InetAddress.getByName(h2); result[0] = a1.equals(a2); - } catch(UnknownHostException e) { - } catch(SecurityException e) { + } catch(UnknownHostException | SecurityException e) { } return null; } @@ -1336,9 +1338,9 @@ public class HttpURLConnection extends java.net.HttpURLConnection { // Read comments labeled "Failed Negotiate" for details. boolean dontUseNegotiate = false; - Iterator iter = responses.multiValueIterator("Proxy-Authenticate"); + Iterator iter = responses.multiValueIterator("Proxy-Authenticate"); while (iter.hasNext()) { - String value = ((String)iter.next()).trim(); + String value = iter.next().trim(); if (value.equalsIgnoreCase("Negotiate") || value.equalsIgnoreCase("Kerberos")) { if (!inNegotiateProxy) { @@ -1414,9 +1416,9 @@ public class HttpURLConnection extends java.net.HttpURLConnection { // Read comments labeled "Failed Negotiate" for details. boolean dontUseNegotiate = false; - Iterator iter = responses.multiValueIterator("WWW-Authenticate"); + Iterator iter = responses.multiValueIterator("WWW-Authenticate"); while (iter.hasNext()) { - String value = ((String)iter.next()).trim(); + String value = iter.next().trim(); if (value.equalsIgnoreCase("Negotiate") || value.equalsIgnoreCase("Kerberos")) { if (!inNegotiate) { @@ -1585,9 +1587,8 @@ public class HttpURLConnection extends java.net.HttpURLConnection { // HttpsURLConnection instance saved in // DelegateHttpsURLConnection uconn = (URLConnection)this.getClass().getField("httpsURLConnection").get(this); - } catch (IllegalAccessException iae) { - // ignored; use 'this' - } catch (NoSuchFieldException nsfe) { + } catch (IllegalAccessException | + NoSuchFieldException e) { // ignored; use 'this' } } @@ -1786,9 +1787,9 @@ public class HttpURLConnection extends java.net.HttpURLConnection { if (respCode == HTTP_PROXY_AUTH) { // Read comments labeled "Failed Negotiate" for details. boolean dontUseNegotiate = false; - Iterator iter = responses.multiValueIterator("Proxy-Authenticate"); + Iterator iter = responses.multiValueIterator("Proxy-Authenticate"); while (iter.hasNext()) { - String value = ((String)iter.next()).trim(); + String value = iter.next().trim(); if (value.equalsIgnoreCase("Negotiate") || value.equalsIgnoreCase("Kerberos")) { if (!inNegotiateProxy) { @@ -1938,6 +1939,7 @@ public class HttpURLConnection extends java.net.HttpURLConnection { * Gets the authentication for an HTTP proxy, and applies it to * the connection. */ + @SuppressWarnings("fallthrough") private AuthenticationInfo getHttpProxyAuthentication (AuthenticationHeader authhdr) { /* get authorization from authenticator */ AuthenticationInfo ret = null; @@ -2004,13 +2006,13 @@ public class HttpURLConnection extends java.net.HttpURLConnection { } break; case NTLM: - if (NTLMAuthenticationProxy.proxy.supported) { + if (NTLMAuthenticationProxy.supported) { /* tryTransparentNTLMProxy will always be true the first * time around, but verify that the platform supports it * otherwise don't try. */ if (tryTransparentNTLMProxy) { tryTransparentNTLMProxy = - NTLMAuthenticationProxy.proxy.supportsTransparentAuth; + NTLMAuthenticationProxy.supportsTransparentAuth; } a = null; if (tryTransparentNTLMProxy) { @@ -2043,6 +2045,7 @@ public class HttpURLConnection extends java.net.HttpURLConnection { break; case UNKNOWN: logger.finest("Unknown/Unsupported authentication scheme: " + scheme); + /*fall through*/ default: throw new AssertionError("should not reach here"); } @@ -2080,6 +2083,7 @@ public class HttpURLConnection extends java.net.HttpURLConnection { * @param authHdr the AuthenticationHeader which tells what auth scheme is * prefered. */ + @SuppressWarnings("fallthrough") private AuthenticationInfo getServerAuthentication (AuthenticationHeader authhdr) { /* get authorization from authenticator */ AuthenticationInfo ret = null; @@ -2150,7 +2154,7 @@ public class HttpURLConnection extends java.net.HttpURLConnection { } break; case NTLM: - if (NTLMAuthenticationProxy.proxy.supported) { + if (NTLMAuthenticationProxy.supported) { URL url1; try { url1 = new URL (url, "/"); /* truncate the path */ @@ -2163,13 +2167,13 @@ public class HttpURLConnection extends java.net.HttpURLConnection { * otherwise don't try. */ if (tryTransparentNTLMServer) { tryTransparentNTLMServer = - NTLMAuthenticationProxy.proxy.supportsTransparentAuth; + NTLMAuthenticationProxy.supportsTransparentAuth; /* If the platform supports transparent authentication * then check if we are in a secure environment * whether, or not, we should try transparent authentication.*/ if (tryTransparentNTLMServer) { tryTransparentNTLMServer = - NTLMAuthenticationProxy.proxy.isTrustedSite(url); + NTLMAuthenticationProxy.isTrustedSite(url); } } a = null; @@ -2198,6 +2202,7 @@ public class HttpURLConnection extends java.net.HttpURLConnection { break; case UNKNOWN: logger.finest("Unknown/Unsupported authentication scheme: " + scheme); + /*fall through*/ default: throw new AssertionError("should not reach here"); } @@ -2745,14 +2750,14 @@ public class HttpURLConnection extends java.net.HttpURLConnection { * The cookies in the requests message headers may have * been modified. Use the saved user cookies instead. */ - Map userCookiesMap = null; + Map> userCookiesMap = null; if (userCookies != null || userCookies2 != null) { - userCookiesMap = new HashMap(); + userCookiesMap = new HashMap<>(); if (userCookies != null) { - userCookiesMap.put("Cookie", userCookies); + userCookiesMap.put("Cookie", Arrays.asList(userCookies)); } if (userCookies2 != null) { - userCookiesMap.put("Cookie2", userCookies2); + userCookiesMap.put("Cookie2", Arrays.asList(userCookies2)); } } return requests.filterAndAddHeaders(EXCLUDE_HEADERS2, userCookiesMap); diff --git a/jdk/src/share/classes/sun/net/www/protocol/http/Negotiator.java b/jdk/src/share/classes/sun/net/www/protocol/http/Negotiator.java index 522d6fbf72e..32446f63f70 100644 --- a/jdk/src/share/classes/sun/net/www/protocol/http/Negotiator.java +++ b/jdk/src/share/classes/sun/net/www/protocol/http/Negotiator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -45,8 +45,8 @@ public abstract class Negotiator { // Makes NegotiatorImpl, and the security classes it references, a // runtime dependency rather than a static one. - Class clazz; - Constructor c; + Class clazz; + Constructor c; try { clazz = Class.forName("sun.net.www.protocol.http.spnego.NegotiatorImpl", true, null); c = clazz.getConstructor(HttpCallerInfo.class); diff --git a/jdk/src/share/classes/sun/net/www/protocol/https/AbstractDelegateHttpsURLConnection.java b/jdk/src/share/classes/sun/net/www/protocol/https/AbstractDelegateHttpsURLConnection.java index ecc75efb5b3..88c62594008 100644 --- a/jdk/src/share/classes/sun/net/www/protocol/https/AbstractDelegateHttpsURLConnection.java +++ b/jdk/src/share/classes/sun/net/www/protocol/https/AbstractDelegateHttpsURLConnection.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -221,11 +221,11 @@ public abstract class AbstractDelegateHttpsURLConnection extends */ public java.security.cert.Certificate[] getLocalCertificates() { if (cachedResponse != null) { - List l = ((SecureCacheResponse)cachedResponse).getLocalCertificateChain(); + List l = ((SecureCacheResponse)cachedResponse).getLocalCertificateChain(); if (l == null) { return null; } else { - return (java.security.cert.Certificate[])l.toArray(); + return l.toArray(new java.security.cert.Certificate[0]); } } if (http == null) { @@ -243,11 +243,11 @@ public abstract class AbstractDelegateHttpsURLConnection extends public java.security.cert.Certificate[] getServerCertificates() throws SSLPeerUnverifiedException { if (cachedResponse != null) { - List l = ((SecureCacheResponse)cachedResponse).getServerCertificateChain(); + List l = ((SecureCacheResponse)cachedResponse).getServerCertificateChain(); if (l == null) { return null; } else { - return (java.security.cert.Certificate[])l.toArray(); + return l.toArray(new java.security.cert.Certificate[0]); } } diff --git a/jdk/src/share/classes/sun/net/www/protocol/https/HttpsClient.java b/jdk/src/share/classes/sun/net/www/protocol/https/HttpsClient.java index cffc12c7260..c83860b14c6 100644 --- a/jdk/src/share/classes/sun/net/www/protocol/https/HttpsClient.java +++ b/jdk/src/share/classes/sun/net/www/protocol/https/HttpsClient.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -529,7 +529,7 @@ final class HttpsClient extends HttpClient new BufferedOutputStream(serverSocket.getOutputStream()), false, encoding); } catch (UnsupportedEncodingException e) { - throw new InternalError(encoding+" encoding not found", e); + throw new InternalError(encoding+" encoding not found"); } // check URL spoofing if it has not been checked under handshaking @@ -623,7 +623,7 @@ final class HttpsClient extends HttpClient */ @Override public void closeIdleConnection() { - HttpClient http = (HttpClient) kac.get(url, sslSocketFactory); + HttpClient http = kac.get(url, sslSocketFactory); if (http != null) { http.closeServer(); } @@ -681,8 +681,7 @@ final class HttpsClient extends HttpClient // return the X500Principal of the end-entity cert. java.security.cert.Certificate[] certs = session.getPeerCertificates(); - principal = (X500Principal) - ((X509Certificate)certs[0]).getSubjectX500Principal(); + principal = ((X509Certificate)certs[0]).getSubjectX500Principal(); } return principal; } @@ -703,8 +702,7 @@ final class HttpsClient extends HttpClient java.security.cert.Certificate[] certs = session.getLocalCertificates(); if (certs != null) { - principal = (X500Principal) - ((X509Certificate)certs[0]).getSubjectX500Principal(); + principal = ((X509Certificate)certs[0]).getSubjectX500Principal(); } } return principal; diff --git a/jdk/src/share/classes/sun/net/www/protocol/mailto/Handler.java b/jdk/src/share/classes/sun/net/www/protocol/mailto/Handler.java index 10fe6849f79..13076fc4eca 100644 --- a/jdk/src/share/classes/sun/net/www/protocol/mailto/Handler.java +++ b/jdk/src/share/classes/sun/net/www/protocol/mailto/Handler.java @@ -139,6 +139,20 @@ public class Handler extends URLStreamHandler { } if (nogood) throw new RuntimeException("No email address"); - setURL(u, protocol, host, port, file, null); + setURLHandler(u, protocol, host, port, file, null); + } + + /** + * This method is used to suppress the deprecated warning + * + * @param u the URL to receive the result of parsing the spec + * @param spec the URL string to parse + * @param start the character position to start parsing at. This is + * just past the ':'. + * @param limit the character position to stop parsing at. + */ + @SuppressWarnings("deprecation") + private void setURLHandler(URL u, String protocol, String host, int port, String file, String ref) { + setURL(u,protocol,host,port,file,null); } } diff --git a/jdk/src/solaris/classes/java/net/DefaultDatagramSocketImplFactory.java b/jdk/src/solaris/classes/java/net/DefaultDatagramSocketImplFactory.java index 6c6bdbf85d5..ad62c582691 100644 --- a/jdk/src/solaris/classes/java/net/DefaultDatagramSocketImplFactory.java +++ b/jdk/src/solaris/classes/java/net/DefaultDatagramSocketImplFactory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007,2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -35,7 +35,7 @@ import java.security.AccessController; */ class DefaultDatagramSocketImplFactory { - static Class prefixImplClass = null; + static Class prefixImplClass = null; static { String prefix = null; diff --git a/jdk/src/solaris/classes/java/net/PlainDatagramSocketImpl.java b/jdk/src/solaris/classes/java/net/PlainDatagramSocketImpl.java index cd00b0bd887..20bc6fbc394 100644 --- a/jdk/src/solaris/classes/java/net/PlainDatagramSocketImpl.java +++ b/jdk/src/solaris/classes/java/net/PlainDatagramSocketImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007,2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -54,8 +54,10 @@ class PlainDatagramSocketImpl extends AbstractPlainDatagramSocketImpl protected native int getTimeToLive() throws IOException; + @Deprecated protected native void setTTL(byte ttl) throws IOException; + @Deprecated protected native byte getTTL() throws IOException; protected native void join(InetAddress inetaddr, NetworkInterface netIf) diff --git a/jdk/src/solaris/classes/sun/net/dns/ResolverConfigurationImpl.java b/jdk/src/solaris/classes/sun/net/dns/ResolverConfigurationImpl.java index 3695b5d368b..66430d40495 100644 --- a/jdk/src/solaris/classes/sun/net/dns/ResolverConfigurationImpl.java +++ b/jdk/src/solaris/classes/sun/net/dns/ResolverConfigurationImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -149,7 +149,7 @@ public class ResolverConfigurationImpl sl = java.security.AccessController.doPrivileged( new java.security.PrivilegedAction>() { public LinkedList run() { - LinkedList ll; + LinkedList ll; // first try search keyword (max 6 domains) ll = resolvconf("search", 6, 1); @@ -173,7 +173,7 @@ public class ResolverConfigurationImpl String localDomain = localDomain0(); if (localDomain != null && localDomain.length() > 0) { - sl = new LinkedList(); + sl = new LinkedList(); sl.add(localDomain); return sl; } @@ -198,7 +198,7 @@ public class ResolverConfigurationImpl } // no local domain so try fallback (RPC) domain or - // hostname + // hostName sl = new LinkedList<>(); String domain = fallbackDomain0(); @@ -216,22 +216,26 @@ public class ResolverConfigurationImpl opts = new OptionsImpl(); } + @SuppressWarnings("unchecked") public List searchlist() { synchronized (lock) { loadConfig(); // List is mutable so return a shallow copy - return (List)searchlist.clone(); + return (List)searchlist.clone(); } } + @SuppressWarnings("unchecked") public List nameservers() { synchronized (lock) { loadConfig(); // List is mutable so return a shallow copy - return (List)nameservers.clone(); - } + + return (List)nameservers.clone(); + + } } public Options options() { diff --git a/jdk/src/windows/classes/java/net/DefaultDatagramSocketImplFactory.java b/jdk/src/windows/classes/java/net/DefaultDatagramSocketImplFactory.java index c8605c8c337..43ce6f27744 100644 --- a/jdk/src/windows/classes/java/net/DefaultDatagramSocketImplFactory.java +++ b/jdk/src/windows/classes/java/net/DefaultDatagramSocketImplFactory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -45,7 +45,7 @@ import java.security.PrivilegedAction; class DefaultDatagramSocketImplFactory { - static Class prefixImplClass = null; + static Class prefixImplClass = null; /* the windows version. */ private static float version; diff --git a/jdk/src/windows/classes/java/net/DualStackPlainDatagramSocketImpl.java b/jdk/src/windows/classes/java/net/DualStackPlainDatagramSocketImpl.java index 7533dea13fa..57a12a8885a 100644 --- a/jdk/src/windows/classes/java/net/DualStackPlainDatagramSocketImpl.java +++ b/jdk/src/windows/classes/java/net/DualStackPlainDatagramSocketImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007,2011 Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,7 +25,6 @@ package java.net; import java.io.IOException; -import java.io.FileDescriptor; import sun.misc.SharedSecrets; import sun.misc.JavaIOFileDescriptorAccess; @@ -215,11 +214,12 @@ class DualStackPlainDatagramSocketImpl extends AbstractPlainDatagramSocketImpl throw new IOException("Method not implemented!"); } - + @Deprecated protected void setTTL(byte ttl) throws IOException { throw new IOException("Method not implemented!"); } + @Deprecated protected byte getTTL() throws IOException { throw new IOException("Method not implemented!"); } diff --git a/jdk/src/windows/classes/java/net/TwoStacksPlainDatagramSocketImpl.java b/jdk/src/windows/classes/java/net/TwoStacksPlainDatagramSocketImpl.java index d8e4ec54c20..0729d76ada4 100644 --- a/jdk/src/windows/classes/java/net/TwoStacksPlainDatagramSocketImpl.java +++ b/jdk/src/windows/classes/java/net/TwoStacksPlainDatagramSocketImpl.java @@ -133,8 +133,10 @@ class TwoStacksPlainDatagramSocketImpl extends AbstractPlainDatagramSocketImpl protected native int getTimeToLive() throws IOException; + @Deprecated protected native void setTTL(byte ttl) throws IOException; + @Deprecated protected native byte getTTL() throws IOException; protected native void join(InetAddress inetaddr, NetworkInterface netIf) diff --git a/jdk/src/windows/classes/sun/net/dns/ResolverConfigurationImpl.java b/jdk/src/windows/classes/sun/net/dns/ResolverConfigurationImpl.java index 79708856036..eb7405de9d3 100644 --- a/jdk/src/windows/classes/sun/net/dns/ResolverConfigurationImpl.java +++ b/jdk/src/windows/classes/sun/net/dns/ResolverConfigurationImpl.java @@ -57,8 +57,8 @@ public class ResolverConfigurationImpl private static String os_nameservers; // Cached lists - private static LinkedList searchlist; - private static LinkedList nameservers; + private static LinkedList searchlist; + private static LinkedList nameservers; // Parse string that consists of token delimited by space or commas // and return LinkedHashMap @@ -111,21 +111,23 @@ public class ResolverConfigurationImpl opts = new OptionsImpl(); } + @SuppressWarnings("unchecked") // clone() public List searchlist() { synchronized (lock) { loadConfig(); // List is mutable so return a shallow copy - return (List)searchlist.clone(); + return (List)searchlist.clone(); } } + @SuppressWarnings("unchecked") // clone() public List nameservers() { synchronized (lock) { loadConfig(); // List is mutable so return a shallow copy - return (List)nameservers.clone(); + return (List)nameservers.clone(); } } diff --git a/jdk/src/windows/classes/sun/net/www/protocol/jar/JarFileFactory.java b/jdk/src/windows/classes/sun/net/www/protocol/jar/JarFileFactory.java index c04bef8fcad..80bd9d1a66a 100644 --- a/jdk/src/windows/classes/sun/net/www/protocol/jar/JarFileFactory.java +++ b/jdk/src/windows/classes/sun/net/www/protocol/jar/JarFileFactory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -148,7 +148,7 @@ class JarFileFactory implements URLJarFile.URLJarFileCloseController { private Permission getPermission(JarFile jarFile) { try { - URLConnection uc = (URLConnection)getConnection(jarFile); + URLConnection uc = getConnection(jarFile); if (uc != null) return uc.getPermission(); } catch (IOException ioe) { From 19f1338ae9604fc849ab309e6c182c2fe5aaef7c Mon Sep 17 00:00:00 2001 From: Alan Bateman Date: Sun, 18 Sep 2011 12:33:56 +0100 Subject: [PATCH 10/23] 7091935: (fs) Polling based WatchService not used on Linux Reviewed-by: forax --- jdk/make/java/nio/Makefile | 1 - 1 file changed, 1 deletion(-) diff --git a/jdk/make/java/nio/Makefile b/jdk/make/java/nio/Makefile index 7a802d03531..b72cfc1eb1a 100644 --- a/jdk/make/java/nio/Makefile +++ b/jdk/make/java/nio/Makefile @@ -206,7 +206,6 @@ FILES_java += \ sun/nio/fs/LinuxUserDefinedFileAttributeView.java \ sun/nio/fs/LinuxNativeDispatcher.java \ sun/nio/fs/LinuxWatchService.java \ - sun/nio/fs/PollingWatchService.java \ sun/nio/fs/UnixChannelFactory.java \ sun/nio/fs/UnixCopyFile.java \ sun/nio/fs/UnixDirectoryStream.java \ From 5b7643e258c772b0e152446c06cd3c429f6fcd3f Mon Sep 17 00:00:00 2001 From: Joe Darcy Date: Sun, 18 Sep 2011 18:14:07 -0700 Subject: [PATCH 11/23] 7091682: Move sun.misc.FpUtils code into java.lang.Math Reviewed-by: alanb --- jdk/src/share/classes/java/lang/Double.java | 4 +- jdk/src/share/classes/java/lang/Float.java | 9 +- jdk/src/share/classes/java/lang/Math.java | 338 +++++++++++++++- .../share/classes/java/lang/StrictMath.java | 32 +- .../share/classes/java/util/Formatter.java | 6 +- .../classes/sun/misc/FloatingDecimal.java | 7 +- .../sun/misc/FormattedFloatingDecimal.java | 1 - jdk/src/share/classes/sun/misc/FpUtils.java | 382 +++--------------- jdk/test/java/lang/Double/ToHexString.java | 1 - jdk/test/java/lang/Math/CubeRootTests.java | 40 +- jdk/test/java/lang/Math/Expm1Tests.java | 10 +- jdk/test/java/lang/Math/HyperbolicTests.java | 12 +- jdk/test/java/lang/Math/HypotTests.java | 10 +- .../java/lang/Math/IeeeRecommendedTests.java | 28 +- jdk/test/java/lang/Math/Log10Tests.java | 4 +- jdk/test/java/lang/Math/Log1pTests.java | 10 +- jdk/test/java/lang/Math/Rint.java | 14 +- 17 files changed, 468 insertions(+), 440 deletions(-) diff --git a/jdk/src/share/classes/java/lang/Double.java b/jdk/src/share/classes/java/lang/Double.java index 6f8cdaf1eb2..fd6278a88f8 100644 --- a/jdk/src/share/classes/java/lang/Double.java +++ b/jdk/src/share/classes/java/lang/Double.java @@ -283,7 +283,7 @@ public final class Double extends Number implements Comparable { // Initialized to maximum size of output. StringBuffer answer = new StringBuffer(24); - if (FpUtils.rawCopySign(1.0, d) == -1.0) // value is negative, + if (Math.copySign(1.0, d) == -1.0) // value is negative, answer.append("-"); // so append sign info answer.append("0x"); @@ -322,7 +322,7 @@ public final class Double extends Number implements Comparable { // E_min -1). answer.append("p" + (subnormal ? DoubleConsts.MIN_EXPONENT: - FpUtils.getExponent(d) )); + Math.getExponent(d) )); } return answer.toString(); } diff --git a/jdk/src/share/classes/java/lang/Float.java b/jdk/src/share/classes/java/lang/Float.java index fa4bfb73857..7fac24c79f9 100644 --- a/jdk/src/share/classes/java/lang/Float.java +++ b/jdk/src/share/classes/java/lang/Float.java @@ -26,7 +26,6 @@ package java.lang; import sun.misc.FloatingDecimal; -import sun.misc.FpUtils; import sun.misc.FloatConsts; import sun.misc.DoubleConsts; @@ -279,10 +278,10 @@ public final class Float extends Number implements Comparable { // Adjust exponent to create subnormal double, then // replace subnormal double exponent with subnormal float // exponent - String s = Double.toHexString(FpUtils.scalb((double)f, - /* -1022+126 */ - DoubleConsts.MIN_EXPONENT- - FloatConsts.MIN_EXPONENT)); + String s = Double.toHexString(Math.scalb((double)f, + /* -1022+126 */ + DoubleConsts.MIN_EXPONENT- + FloatConsts.MIN_EXPONENT)); return s.replaceFirst("p-1022$", "p-126"); } else // double string will be the same as float string diff --git a/jdk/src/share/classes/java/lang/Math.java b/jdk/src/share/classes/java/lang/Math.java index 177d710aa9e..ff9ffe2f09d 100644 --- a/jdk/src/share/classes/java/lang/Math.java +++ b/jdk/src/share/classes/java/lang/Math.java @@ -26,6 +26,8 @@ package java.lang; import java.util.Random; +import sun.misc.FloatConsts; +import sun.misc.DoubleConsts; /** * The class {@code Math} contains methods for performing basic @@ -963,7 +965,31 @@ public final class Math { * @since 1.5 */ public static double ulp(double d) { - return sun.misc.FpUtils.ulp(d); + int exp = getExponent(d); + + switch(exp) { + case DoubleConsts.MAX_EXPONENT+1: // NaN or infinity + return Math.abs(d); + + case DoubleConsts.MIN_EXPONENT-1: // zero or subnormal + return Double.MIN_VALUE; + + default: + assert exp <= DoubleConsts.MAX_EXPONENT && exp >= DoubleConsts.MIN_EXPONENT; + + // ulp(x) is usually 2^(SIGNIFICAND_WIDTH-1)*(2^ilogb(x)) + exp = exp - (DoubleConsts.SIGNIFICAND_WIDTH-1); + if (exp >= DoubleConsts.MIN_EXPONENT) { + return powerOfTwoD(exp); + } + else { + // return a subnormal result; left shift integer + // representation of Double.MIN_VALUE appropriate + // number of positions + return Double.longBitsToDouble(1L << + (exp - (DoubleConsts.MIN_EXPONENT - (DoubleConsts.SIGNIFICAND_WIDTH-1)) )); + } + } } /** @@ -990,7 +1016,31 @@ public final class Math { * @since 1.5 */ public static float ulp(float f) { - return sun.misc.FpUtils.ulp(f); + int exp = getExponent(f); + + switch(exp) { + case FloatConsts.MAX_EXPONENT+1: // NaN or infinity + return Math.abs(f); + + case FloatConsts.MIN_EXPONENT-1: // zero or subnormal + return FloatConsts.MIN_VALUE; + + default: + assert exp <= FloatConsts.MAX_EXPONENT && exp >= FloatConsts.MIN_EXPONENT; + + // ulp(x) is usually 2^(SIGNIFICAND_WIDTH-1)*(2^ilogb(x)) + exp = exp - (FloatConsts.SIGNIFICAND_WIDTH-1); + if (exp >= FloatConsts.MIN_EXPONENT) { + return powerOfTwoF(exp); + } + else { + // return a subnormal result; left shift integer + // representation of FloatConsts.MIN_VALUE appropriate + // number of positions + return Float.intBitsToFloat(1 << + (exp - (FloatConsts.MIN_EXPONENT - (FloatConsts.SIGNIFICAND_WIDTH-1)) )); + } + } } /** @@ -1011,7 +1061,7 @@ public final class Math { * @since 1.5 */ public static double signum(double d) { - return sun.misc.FpUtils.signum(d); + return (d == 0.0 || Double.isNaN(d))?d:copySign(1.0, d); } /** @@ -1032,7 +1082,7 @@ public final class Math { * @since 1.5 */ public static float signum(float f) { - return sun.misc.FpUtils.signum(f); + return (f == 0.0f || Float.isNaN(f))?f:copySign(1.0f, f); } /** @@ -1252,7 +1302,11 @@ public final class Math { * @since 1.6 */ public static double copySign(double magnitude, double sign) { - return sun.misc.FpUtils.rawCopySign(magnitude, sign); + return Double.longBitsToDouble((Double.doubleToRawLongBits(sign) & + (DoubleConsts.SIGN_BIT_MASK)) | + (Double.doubleToRawLongBits(magnitude) & + (DoubleConsts.EXP_BIT_MASK | + DoubleConsts.SIGNIF_BIT_MASK))); } /** @@ -1271,7 +1325,11 @@ public final class Math { * @since 1.6 */ public static float copySign(float magnitude, float sign) { - return sun.misc.FpUtils.rawCopySign(magnitude, sign); + return Float.intBitsToFloat((Float.floatToRawIntBits(sign) & + (FloatConsts.SIGN_BIT_MASK)) | + (Float.floatToRawIntBits(magnitude) & + (FloatConsts.EXP_BIT_MASK | + FloatConsts.SIGNIF_BIT_MASK))); } /** @@ -1289,7 +1347,13 @@ public final class Math { * @since 1.6 */ public static int getExponent(float f) { - return sun.misc.FpUtils.getExponent(f); + /* + * Bitwise convert f to integer, mask out exponent bits, shift + * to the right and then subtract out float's bias adjust to + * get true exponent value + */ + return ((Float.floatToRawIntBits(f) & FloatConsts.EXP_BIT_MASK) >> + (FloatConsts.SIGNIFICAND_WIDTH - 1)) - FloatConsts.EXP_BIAS; } /** @@ -1307,7 +1371,13 @@ public final class Math { * @since 1.6 */ public static int getExponent(double d) { - return sun.misc.FpUtils.getExponent(d); + /* + * Bitwise convert d to long, mask out exponent bits, shift + * to the right and then subtract out double's bias adjust to + * get true exponent value. + */ + return (int)(((Double.doubleToRawLongBits(d) & DoubleConsts.EXP_BIT_MASK) >> + (DoubleConsts.SIGNIFICAND_WIDTH - 1)) - DoubleConsts.EXP_BIAS); } /** @@ -1351,7 +1421,63 @@ public final class Math { * @since 1.6 */ public static double nextAfter(double start, double direction) { - return sun.misc.FpUtils.nextAfter(start, direction); + /* + * The cases: + * + * nextAfter(+infinity, 0) == MAX_VALUE + * nextAfter(+infinity, +infinity) == +infinity + * nextAfter(-infinity, 0) == -MAX_VALUE + * nextAfter(-infinity, -infinity) == -infinity + * + * are naturally handled without any additional testing + */ + + // First check for NaN values + if (Double.isNaN(start) || Double.isNaN(direction)) { + // return a NaN derived from the input NaN(s) + return start + direction; + } else if (start == direction) { + return direction; + } else { // start > direction or start < direction + // Add +0.0 to get rid of a -0.0 (+0.0 + -0.0 => +0.0) + // then bitwise convert start to integer. + long transducer = Double.doubleToRawLongBits(start + 0.0d); + + /* + * IEEE 754 floating-point numbers are lexicographically + * ordered if treated as signed- magnitude integers . + * Since Java's integers are two's complement, + * incrementing" the two's complement representation of a + * logically negative floating-point value *decrements* + * the signed-magnitude representation. Therefore, when + * the integer representation of a floating-point values + * is less than zero, the adjustment to the representation + * is in the opposite direction than would be expected at + * first . + */ + if (direction > start) { // Calculate next greater value + transducer = transducer + (transducer >= 0L ? 1L:-1L); + } else { // Calculate next lesser value + assert direction < start; + if (transducer > 0L) + --transducer; + else + if (transducer < 0L ) + ++transducer; + /* + * transducer==0, the result is -MIN_VALUE + * + * The transition from zero (implicitly + * positive) to the smallest negative + * signed magnitude value must be done + * explicitly. + */ + else + transducer = DoubleConsts.SIGN_BIT_MASK | 1L; + } + + return Double.longBitsToDouble(transducer); + } } /** @@ -1394,7 +1520,63 @@ public final class Math { * @since 1.6 */ public static float nextAfter(float start, double direction) { - return sun.misc.FpUtils.nextAfter(start, direction); + /* + * The cases: + * + * nextAfter(+infinity, 0) == MAX_VALUE + * nextAfter(+infinity, +infinity) == +infinity + * nextAfter(-infinity, 0) == -MAX_VALUE + * nextAfter(-infinity, -infinity) == -infinity + * + * are naturally handled without any additional testing + */ + + // First check for NaN values + if (Float.isNaN(start) || Double.isNaN(direction)) { + // return a NaN derived from the input NaN(s) + return start + (float)direction; + } else if (start == direction) { + return (float)direction; + } else { // start > direction or start < direction + // Add +0.0 to get rid of a -0.0 (+0.0 + -0.0 => +0.0) + // then bitwise convert start to integer. + int transducer = Float.floatToRawIntBits(start + 0.0f); + + /* + * IEEE 754 floating-point numbers are lexicographically + * ordered if treated as signed- magnitude integers . + * Since Java's integers are two's complement, + * incrementing" the two's complement representation of a + * logically negative floating-point value *decrements* + * the signed-magnitude representation. Therefore, when + * the integer representation of a floating-point values + * is less than zero, the adjustment to the representation + * is in the opposite direction than would be expected at + * first. + */ + if (direction > start) {// Calculate next greater value + transducer = transducer + (transducer >= 0 ? 1:-1); + } else { // Calculate next lesser value + assert direction < start; + if (transducer > 0) + --transducer; + else + if (transducer < 0 ) + ++transducer; + /* + * transducer==0, the result is -MIN_VALUE + * + * The transition from zero (implicitly + * positive) to the smallest negative + * signed magnitude value must be done + * explicitly. + */ + else + transducer = FloatConsts.SIGN_BIT_MASK | 1; + } + + return Float.intBitsToFloat(transducer); + } } /** @@ -1423,7 +1605,13 @@ public final class Math { * @since 1.6 */ public static double nextUp(double d) { - return sun.misc.FpUtils.nextUp(d); + if( Double.isNaN(d) || d == Double.POSITIVE_INFINITY) + return d; + else { + d += 0.0d; + return Double.longBitsToDouble(Double.doubleToRawLongBits(d) + + ((d >= 0.0d)?+1L:-1L)); + } } /** @@ -1452,7 +1640,13 @@ public final class Math { * @since 1.6 */ public static float nextUp(float f) { - return sun.misc.FpUtils.nextUp(f); + if( Float.isNaN(f) || f == FloatConsts.POSITIVE_INFINITY) + return f; + else { + f += 0.0f; + return Float.intBitsToFloat(Float.floatToRawIntBits(f) + + ((f >= 0.0f)?+1:-1)); + } } @@ -1487,7 +1681,80 @@ public final class Math { * @since 1.6 */ public static double scalb(double d, int scaleFactor) { - return sun.misc.FpUtils.scalb(d, scaleFactor); + /* + * This method does not need to be declared strictfp to + * compute the same correct result on all platforms. When + * scaling up, it does not matter what order the + * multiply-store operations are done; the result will be + * finite or overflow regardless of the operation ordering. + * However, to get the correct result when scaling down, a + * particular ordering must be used. + * + * When scaling down, the multiply-store operations are + * sequenced so that it is not possible for two consecutive + * multiply-stores to return subnormal results. If one + * multiply-store result is subnormal, the next multiply will + * round it away to zero. This is done by first multiplying + * by 2 ^ (scaleFactor % n) and then multiplying several + * times by by 2^n as needed where n is the exponent of number + * that is a covenient power of two. In this way, at most one + * real rounding error occurs. If the double value set is + * being used exclusively, the rounding will occur on a + * multiply. If the double-extended-exponent value set is + * being used, the products will (perhaps) be exact but the + * stores to d are guaranteed to round to the double value + * set. + * + * It is _not_ a valid implementation to first multiply d by + * 2^MIN_EXPONENT and then by 2 ^ (scaleFactor % + * MIN_EXPONENT) since even in a strictfp program double + * rounding on underflow could occur; e.g. if the scaleFactor + * argument was (MIN_EXPONENT - n) and the exponent of d was a + * little less than -(MIN_EXPONENT - n), meaning the final + * result would be subnormal. + * + * Since exact reproducibility of this method can be achieved + * without any undue performance burden, there is no + * compelling reason to allow double rounding on underflow in + * scalb. + */ + + // magnitude of a power of two so large that scaling a finite + // nonzero value by it would be guaranteed to over or + // underflow; due to rounding, scaling down takes takes an + // additional power of two which is reflected here + final int MAX_SCALE = DoubleConsts.MAX_EXPONENT + -DoubleConsts.MIN_EXPONENT + + DoubleConsts.SIGNIFICAND_WIDTH + 1; + int exp_adjust = 0; + int scale_increment = 0; + double exp_delta = Double.NaN; + + // Make sure scaling factor is in a reasonable range + + if(scaleFactor < 0) { + scaleFactor = Math.max(scaleFactor, -MAX_SCALE); + scale_increment = -512; + exp_delta = twoToTheDoubleScaleDown; + } + else { + scaleFactor = Math.min(scaleFactor, MAX_SCALE); + scale_increment = 512; + exp_delta = twoToTheDoubleScaleUp; + } + + // Calculate (scaleFactor % +/-512), 512 = 2^9, using + // technique from "Hacker's Delight" section 10-2. + int t = (scaleFactor >> 9-1) >>> 32 - 9; + exp_adjust = ((scaleFactor + t) & (512 -1)) - t; + + d *= powerOfTwoD(exp_adjust); + scaleFactor -= exp_adjust; + + while(scaleFactor != 0) { + d *= exp_delta; + scaleFactor -= scale_increment; + } + return d; } /** @@ -1521,6 +1788,49 @@ public final class Math { * @since 1.6 */ public static float scalb(float f, int scaleFactor) { - return sun.misc.FpUtils.scalb(f, scaleFactor); + // magnitude of a power of two so large that scaling a finite + // nonzero value by it would be guaranteed to over or + // underflow; due to rounding, scaling down takes takes an + // additional power of two which is reflected here + final int MAX_SCALE = FloatConsts.MAX_EXPONENT + -FloatConsts.MIN_EXPONENT + + FloatConsts.SIGNIFICAND_WIDTH + 1; + + // Make sure scaling factor is in a reasonable range + scaleFactor = Math.max(Math.min(scaleFactor, MAX_SCALE), -MAX_SCALE); + + /* + * Since + MAX_SCALE for float fits well within the double + * exponent range and + float -> double conversion is exact + * the multiplication below will be exact. Therefore, the + * rounding that occurs when the double product is cast to + * float will be the correctly rounded float result. Since + * all operations other than the final multiply will be exact, + * it is not necessary to declare this method strictfp. + */ + return (float)((double)f*powerOfTwoD(scaleFactor)); + } + + // Constants used in scalb + static double twoToTheDoubleScaleUp = powerOfTwoD(512); + static double twoToTheDoubleScaleDown = powerOfTwoD(-512); + + /** + * Returns a floating-point power of two in the normal range. + */ + static double powerOfTwoD(int n) { + assert(n >= DoubleConsts.MIN_EXPONENT && n <= DoubleConsts.MAX_EXPONENT); + return Double.longBitsToDouble((((long)n + (long)DoubleConsts.EXP_BIAS) << + (DoubleConsts.SIGNIFICAND_WIDTH-1)) + & DoubleConsts.EXP_BIT_MASK); + } + + /** + * Returns a floating-point power of two in the normal range. + */ + public static float powerOfTwoF(int n) { + assert(n >= FloatConsts.MIN_EXPONENT && n <= FloatConsts.MAX_EXPONENT); + return Float.intBitsToFloat(((n + FloatConsts.EXP_BIAS) << + (FloatConsts.SIGNIFICAND_WIDTH-1)) + & FloatConsts.EXP_BIT_MASK); } } diff --git a/jdk/src/share/classes/java/lang/StrictMath.java b/jdk/src/share/classes/java/lang/StrictMath.java index 42c701fa5cb..bb4cf219346 100644 --- a/jdk/src/share/classes/java/lang/StrictMath.java +++ b/jdk/src/share/classes/java/lang/StrictMath.java @@ -25,7 +25,6 @@ package java.lang; import java.util.Random; -import sun.misc.FpUtils; import sun.misc.DoubleConsts; /** @@ -428,7 +427,7 @@ public final class StrictMath { * 1.0, which is exact too. */ double twoToThe52 = (double)(1L << 52); // 2^52 - double sign = FpUtils.rawCopySign(1.0, a); // preserve sign info + double sign = Math.copySign(1.0, a); // preserve sign info a = Math.abs(a); if (a < twoToThe52) { // E_min <= ilogb(a) <= 51 @@ -955,7 +954,7 @@ public final class StrictMath { * @since 1.5 */ public static double ulp(double d) { - return sun.misc.FpUtils.ulp(d); + return Math.ulp(d); } /** @@ -982,7 +981,7 @@ public final class StrictMath { * @since 1.5 */ public static float ulp(float f) { - return sun.misc.FpUtils.ulp(f); + return Math.ulp(f); } /** @@ -1003,7 +1002,7 @@ public final class StrictMath { * @since 1.5 */ public static double signum(double d) { - return sun.misc.FpUtils.signum(d); + return Math.signum(d); } /** @@ -1024,7 +1023,7 @@ public final class StrictMath { * @since 1.5 */ public static float signum(float f) { - return sun.misc.FpUtils.signum(f); + return Math.signum(f); } /** @@ -1202,7 +1201,7 @@ public final class StrictMath { * @since 1.6 */ public static double copySign(double magnitude, double sign) { - return sun.misc.FpUtils.copySign(magnitude, sign); + return Math.copySign(magnitude, (Double.isNaN(sign)?1.0d:sign)); } /** @@ -1218,7 +1217,7 @@ public final class StrictMath { * @since 1.6 */ public static float copySign(float magnitude, float sign) { - return sun.misc.FpUtils.copySign(magnitude, sign); + return Math.copySign(magnitude, (Float.isNaN(sign)?1.0f:sign)); } /** * Returns the unbiased exponent used in the representation of a @@ -1234,7 +1233,7 @@ public final class StrictMath { * @since 1.6 */ public static int getExponent(float f) { - return sun.misc.FpUtils.getExponent(f); + return Math.getExponent(f); } /** @@ -1251,7 +1250,7 @@ public final class StrictMath { * @since 1.6 */ public static int getExponent(double d) { - return sun.misc.FpUtils.getExponent(d); + return Math.getExponent(d); } /** @@ -1294,7 +1293,7 @@ public final class StrictMath { * @since 1.6 */ public static double nextAfter(double start, double direction) { - return sun.misc.FpUtils.nextAfter(start, direction); + return Math.nextAfter(start, direction); } /** @@ -1336,7 +1335,7 @@ public final class StrictMath { * @since 1.6 */ public static float nextAfter(float start, double direction) { - return sun.misc.FpUtils.nextAfter(start, direction); + return Math.nextAfter(start, direction); } /** @@ -1365,7 +1364,7 @@ public final class StrictMath { * @since 1.6 */ public static double nextUp(double d) { - return sun.misc.FpUtils.nextUp(d); + return Math.nextUp(d); } /** @@ -1394,10 +1393,9 @@ public final class StrictMath { * @since 1.6 */ public static float nextUp(float f) { - return sun.misc.FpUtils.nextUp(f); + return Math.nextUp(f); } - /** * Return {@code d} × * 2{@code scaleFactor} rounded as if performed @@ -1429,7 +1427,7 @@ public final class StrictMath { * @since 1.6 */ public static double scalb(double d, int scaleFactor) { - return sun.misc.FpUtils.scalb(d, scaleFactor); + return Math.scalb(d, scaleFactor); } /** @@ -1463,6 +1461,6 @@ public final class StrictMath { * @since 1.6 */ public static float scalb(float f, int scaleFactor) { - return sun.misc.FpUtils.scalb(f, scaleFactor); + return Math.scalb(f, scaleFactor); } } diff --git a/jdk/src/share/classes/java/util/Formatter.java b/jdk/src/share/classes/java/util/Formatter.java index bcd36ea6120..05ca8cc6ef3 100644 --- a/jdk/src/share/classes/java/util/Formatter.java +++ b/jdk/src/share/classes/java/util/Formatter.java @@ -3423,18 +3423,18 @@ public final class Formatter implements Closeable, Flushable { else { assert(prec >= 1 && prec <= 12); - int exponent = FpUtils.getExponent(d); + int exponent = Math.getExponent(d); boolean subnormal = (exponent == DoubleConsts.MIN_EXPONENT - 1); // If this is subnormal input so normalize (could be faster to // do as integer operation). if (subnormal) { - scaleUp = FpUtils.scalb(1.0, 54); + scaleUp = Math.scalb(1.0, 54); d *= scaleUp; // Calculate the exponent. This is not just exponent + 54 // since the former is not the normalized exponent. - exponent = FpUtils.getExponent(d); + exponent = Math.getExponent(d); assert exponent >= DoubleConsts.MIN_EXPONENT && exponent <= DoubleConsts.MAX_EXPONENT: exponent; } diff --git a/jdk/src/share/classes/sun/misc/FloatingDecimal.java b/jdk/src/share/classes/sun/misc/FloatingDecimal.java index 1e3a25e84af..4df0487c88e 100644 --- a/jdk/src/share/classes/sun/misc/FloatingDecimal.java +++ b/jdk/src/share/classes/sun/misc/FloatingDecimal.java @@ -25,7 +25,6 @@ package sun.misc; -import sun.misc.FpUtils; import sun.misc.DoubleConsts; import sun.misc.FloatConsts; import java.util.regex.*; @@ -2297,9 +2296,9 @@ public class FloatingDecimal{ significand++; } - FloatingDecimal fd = new FloatingDecimal(FpUtils.rawCopySign( - Double.longBitsToDouble(significand), - sign)); + FloatingDecimal fd = new FloatingDecimal(Math.copySign( + Double.longBitsToDouble(significand), + sign)); /* * Set roundingDir variable field of fd properly so diff --git a/jdk/src/share/classes/sun/misc/FormattedFloatingDecimal.java b/jdk/src/share/classes/sun/misc/FormattedFloatingDecimal.java index 0b6dd85051f..261dbc07e2f 100644 --- a/jdk/src/share/classes/sun/misc/FormattedFloatingDecimal.java +++ b/jdk/src/share/classes/sun/misc/FormattedFloatingDecimal.java @@ -25,7 +25,6 @@ package sun.misc; -import sun.misc.FpUtils; import sun.misc.DoubleConsts; import sun.misc.FloatConsts; import java.util.regex.*; diff --git a/jdk/src/share/classes/sun/misc/FpUtils.java b/jdk/src/share/classes/sun/misc/FpUtils.java index 1050d322a11..9e03067cbef 100644 --- a/jdk/src/share/classes/sun/misc/FpUtils.java +++ b/jdk/src/share/classes/sun/misc/FpUtils.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -125,10 +125,6 @@ public class FpUtils { */ private FpUtils() {} - // Constants used in scalb - static double twoToTheDoubleScaleUp = powerOfTwoD(512); - static double twoToTheDoubleScaleDown = powerOfTwoD(-512); - // Helper Methods // The following helper methods are used in the implementation of @@ -137,49 +133,22 @@ public class FpUtils { /** * Returns unbiased exponent of a {@code double}. + * @deprecated Use Math.getExponent. */ + @Deprecated public static int getExponent(double d){ - /* - * Bitwise convert d to long, mask out exponent bits, shift - * to the right and then subtract out double's bias adjust to - * get true exponent value. - */ - return (int)(((Double.doubleToRawLongBits(d) & DoubleConsts.EXP_BIT_MASK) >> - (DoubleConsts.SIGNIFICAND_WIDTH - 1)) - DoubleConsts.EXP_BIAS); + return Math.getExponent(d); } /** * Returns unbiased exponent of a {@code float}. + * @deprecated Use Math.getExponent. */ + @Deprecated public static int getExponent(float f){ - /* - * Bitwise convert f to integer, mask out exponent bits, shift - * to the right and then subtract out float's bias adjust to - * get true exponent value - */ - return ((Float.floatToRawIntBits(f) & FloatConsts.EXP_BIT_MASK) >> - (FloatConsts.SIGNIFICAND_WIDTH - 1)) - FloatConsts.EXP_BIAS; + return Math.getExponent(f); } - /** - * Returns a floating-point power of two in the normal range. - */ - static double powerOfTwoD(int n) { - assert(n >= DoubleConsts.MIN_EXPONENT && n <= DoubleConsts.MAX_EXPONENT); - return Double.longBitsToDouble((((long)n + (long)DoubleConsts.EXP_BIAS) << - (DoubleConsts.SIGNIFICAND_WIDTH-1)) - & DoubleConsts.EXP_BIT_MASK); - } - - /** - * Returns a floating-point power of two in the normal range. - */ - static float powerOfTwoF(int n) { - assert(n >= FloatConsts.MIN_EXPONENT && n <= FloatConsts.MAX_EXPONENT); - return Float.intBitsToFloat(((n + FloatConsts.EXP_BIAS) << - (FloatConsts.SIGNIFICAND_WIDTH-1)) - & FloatConsts.EXP_BIT_MASK); - } /** * Returns the first floating-point argument with the sign of the @@ -195,13 +164,11 @@ public class FpUtils { * @return a value with the magnitude of {@code magnitude} * and the sign of {@code sign}. * @author Joseph D. Darcy + * @deprecated Use Math.copySign. */ + @Deprecated public static double rawCopySign(double magnitude, double sign) { - return Double.longBitsToDouble((Double.doubleToRawLongBits(sign) & - (DoubleConsts.SIGN_BIT_MASK)) | - (Double.doubleToRawLongBits(magnitude) & - (DoubleConsts.EXP_BIT_MASK | - DoubleConsts.SIGNIF_BIT_MASK))); + return Math.copySign(magnitude, sign); } /** @@ -218,13 +185,11 @@ public class FpUtils { * @return a value with the magnitude of {@code magnitude} * and the sign of {@code sign}. * @author Joseph D. Darcy + * @deprecated Use Math.copySign. */ + @Deprecated public static float rawCopySign(float magnitude, float sign) { - return Float.intBitsToFloat((Float.floatToRawIntBits(sign) & - (FloatConsts.SIGN_BIT_MASK)) | - (Float.floatToRawIntBits(magnitude) & - (FloatConsts.EXP_BIT_MASK | - FloatConsts.SIGNIF_BIT_MASK))); + return Math.copySign(magnitude, sign); } /* ***************************************************************** */ @@ -558,82 +523,11 @@ public class FpUtils { * @param scale_factor power of 2 used to scale {@code d} * @return {@code d * }2{@code scale_factor} * @author Joseph D. Darcy + * @deprecated Use Math.scalb. */ + @Deprecated public static double scalb(double d, int scale_factor) { - /* - * This method does not need to be declared strictfp to - * compute the same correct result on all platforms. When - * scaling up, it does not matter what order the - * multiply-store operations are done; the result will be - * finite or overflow regardless of the operation ordering. - * However, to get the correct result when scaling down, a - * particular ordering must be used. - * - * When scaling down, the multiply-store operations are - * sequenced so that it is not possible for two consecutive - * multiply-stores to return subnormal results. If one - * multiply-store result is subnormal, the next multiply will - * round it away to zero. This is done by first multiplying - * by 2 ^ (scale_factor % n) and then multiplying several - * times by by 2^n as needed where n is the exponent of number - * that is a covenient power of two. In this way, at most one - * real rounding error occurs. If the double value set is - * being used exclusively, the rounding will occur on a - * multiply. If the double-extended-exponent value set is - * being used, the products will (perhaps) be exact but the - * stores to d are guaranteed to round to the double value - * set. - * - * It is _not_ a valid implementation to first multiply d by - * 2^MIN_EXPONENT and then by 2 ^ (scale_factor % - * MIN_EXPONENT) since even in a strictfp program double - * rounding on underflow could occur; e.g. if the scale_factor - * argument was (MIN_EXPONENT - n) and the exponent of d was a - * little less than -(MIN_EXPONENT - n), meaning the final - * result would be subnormal. - * - * Since exact reproducibility of this method can be achieved - * without any undue performance burden, there is no - * compelling reason to allow double rounding on underflow in - * scalb. - */ - - // magnitude of a power of two so large that scaling a finite - // nonzero value by it would be guaranteed to over or - // underflow; due to rounding, scaling down takes takes an - // additional power of two which is reflected here - final int MAX_SCALE = DoubleConsts.MAX_EXPONENT + -DoubleConsts.MIN_EXPONENT + - DoubleConsts.SIGNIFICAND_WIDTH + 1; - int exp_adjust = 0; - int scale_increment = 0; - double exp_delta = Double.NaN; - - // Make sure scaling factor is in a reasonable range - - if(scale_factor < 0) { - scale_factor = Math.max(scale_factor, -MAX_SCALE); - scale_increment = -512; - exp_delta = twoToTheDoubleScaleDown; - } - else { - scale_factor = Math.min(scale_factor, MAX_SCALE); - scale_increment = 512; - exp_delta = twoToTheDoubleScaleUp; - } - - // Calculate (scale_factor % +/-512), 512 = 2^9, using - // technique from "Hacker's Delight" section 10-2. - int t = (scale_factor >> 9-1) >>> 32 - 9; - exp_adjust = ((scale_factor + t) & (512 -1)) - t; - - d *= powerOfTwoD(exp_adjust); - scale_factor -= exp_adjust; - - while(scale_factor != 0) { - d *= exp_delta; - scale_factor -= scale_increment; - } - return d; + return Math.scalb(d, scale_factor); } /** @@ -667,28 +561,11 @@ public class FpUtils { * @param scale_factor power of 2 used to scale {@code f} * @return {@code f * }2{@code scale_factor} * @author Joseph D. Darcy + * @deprecated Use Math.scalb. */ - public static float scalb(float f, int scale_factor) { - // magnitude of a power of two so large that scaling a finite - // nonzero value by it would be guaranteed to over or - // underflow; due to rounding, scaling down takes takes an - // additional power of two which is reflected here - final int MAX_SCALE = FloatConsts.MAX_EXPONENT + -FloatConsts.MIN_EXPONENT + - FloatConsts.SIGNIFICAND_WIDTH + 1; - - // Make sure scaling factor is in a reasonable range - scale_factor = Math.max(Math.min(scale_factor, MAX_SCALE), -MAX_SCALE); - - /* - * Since + MAX_SCALE for float fits well within the double - * exponent range and + float -> double conversion is exact - * the multiplication below will be exact. Therefore, the - * rounding that occurs when the double product is cast to - * float will be the correctly rounded float result. Since - * all operations other than the final multiply will be exact, - * it is not necessary to declare this method strictfp. - */ - return (float)((double)f*powerOfTwoD(scale_factor)); + @Deprecated + public static float scalb(float f, int scale_factor) { + return Math.scalb(f, scale_factor); } /** @@ -730,65 +607,11 @@ public class FpUtils { * @return The floating-point number adjacent to {@code start} in the * direction of {@code direction}. * @author Joseph D. Darcy + * @deprecated Use Math.nextAfter */ + @Deprecated public static double nextAfter(double start, double direction) { - /* - * The cases: - * - * nextAfter(+infinity, 0) == MAX_VALUE - * nextAfter(+infinity, +infinity) == +infinity - * nextAfter(-infinity, 0) == -MAX_VALUE - * nextAfter(-infinity, -infinity) == -infinity - * - * are naturally handled without any additional testing - */ - - // First check for NaN values - if (isNaN(start) || isNaN(direction)) { - // return a NaN derived from the input NaN(s) - return start + direction; - } else if (start == direction) { - return direction; - } else { // start > direction or start < direction - // Add +0.0 to get rid of a -0.0 (+0.0 + -0.0 => +0.0) - // then bitwise convert start to integer. - long transducer = Double.doubleToRawLongBits(start + 0.0d); - - /* - * IEEE 754 floating-point numbers are lexicographically - * ordered if treated as signed- magnitude integers . - * Since Java's integers are two's complement, - * incrementing" the two's complement representation of a - * logically negative floating-point value *decrements* - * the signed-magnitude representation. Therefore, when - * the integer representation of a floating-point values - * is less than zero, the adjustment to the representation - * is in the opposite direction than would be expected at - * first . - */ - if (direction > start) { // Calculate next greater value - transducer = transducer + (transducer >= 0L ? 1L:-1L); - } else { // Calculate next lesser value - assert direction < start; - if (transducer > 0L) - --transducer; - else - if (transducer < 0L ) - ++transducer; - /* - * transducer==0, the result is -MIN_VALUE - * - * The transition from zero (implicitly - * positive) to the smallest negative - * signed magnitude value must be done - * explicitly. - */ - else - transducer = DoubleConsts.SIGN_BIT_MASK | 1L; - } - - return Double.longBitsToDouble(transducer); - } + return Math.nextAfter(start, direction); } /** @@ -830,65 +653,11 @@ public class FpUtils { * @return The floating-point number adjacent to {@code start} in the * direction of {@code direction}. * @author Joseph D. Darcy + * @deprecated Use Math.nextAfter. */ - public static float nextAfter(float start, double direction) { - /* - * The cases: - * - * nextAfter(+infinity, 0) == MAX_VALUE - * nextAfter(+infinity, +infinity) == +infinity - * nextAfter(-infinity, 0) == -MAX_VALUE - * nextAfter(-infinity, -infinity) == -infinity - * - * are naturally handled without any additional testing - */ - - // First check for NaN values - if (isNaN(start) || isNaN(direction)) { - // return a NaN derived from the input NaN(s) - return start + (float)direction; - } else if (start == direction) { - return (float)direction; - } else { // start > direction or start < direction - // Add +0.0 to get rid of a -0.0 (+0.0 + -0.0 => +0.0) - // then bitwise convert start to integer. - int transducer = Float.floatToRawIntBits(start + 0.0f); - - /* - * IEEE 754 floating-point numbers are lexicographically - * ordered if treated as signed- magnitude integers . - * Since Java's integers are two's complement, - * incrementing" the two's complement representation of a - * logically negative floating-point value *decrements* - * the signed-magnitude representation. Therefore, when - * the integer representation of a floating-point values - * is less than zero, the adjustment to the representation - * is in the opposite direction than would be expected at - * first. - */ - if (direction > start) {// Calculate next greater value - transducer = transducer + (transducer >= 0 ? 1:-1); - } else { // Calculate next lesser value - assert direction < start; - if (transducer > 0) - --transducer; - else - if (transducer < 0 ) - ++transducer; - /* - * transducer==0, the result is -MIN_VALUE - * - * The transition from zero (implicitly - * positive) to the smallest negative - * signed magnitude value must be done - * explicitly. - */ - else - transducer = FloatConsts.SIGN_BIT_MASK | 1; - } - - return Float.intBitsToFloat(transducer); - } + @Deprecated + public static float nextAfter(float start, double direction) { + return Math.nextAfter(start, direction); } /** @@ -915,15 +684,11 @@ public class FpUtils { * @return The adjacent floating-point value closer to positive * infinity. * @author Joseph D. Darcy + * @deprecated use Math.nextUp. */ + @Deprecated public static double nextUp(double d) { - if( isNaN(d) || d == Double.POSITIVE_INFINITY) - return d; - else { - d += 0.0d; - return Double.longBitsToDouble(Double.doubleToRawLongBits(d) + - ((d >= 0.0d)?+1L:-1L)); - } + return Math.nextUp(d); } /** @@ -950,15 +715,11 @@ public class FpUtils { * @return The adjacent floating-point value closer to positive * infinity. * @author Joseph D. Darcy + * @deprecated Use Math.nextUp. */ - public static float nextUp(float f) { - if( isNaN(f) || f == FloatConsts.POSITIVE_INFINITY) - return f; - else { - f += 0.0f; - return Float.intBitsToFloat(Float.floatToRawIntBits(f) + - ((f >= 0.0f)?+1:-1)); - } + @Deprecated + public static float nextUp(float f) { + return Math.nextUp(f); } /** @@ -1047,9 +808,11 @@ public class FpUtils { * and the sign of {@code sign}. * @author Joseph D. Darcy * @since 1.5 + * @deprecated Use StrictMath.copySign. */ + @Deprecated public static double copySign(double magnitude, double sign) { - return rawCopySign(magnitude, (isNaN(sign)?1.0d:sign)); + return StrictMath.copySign(magnitude, sign); } /** @@ -1063,9 +826,11 @@ public class FpUtils { * @return a value with the magnitude of {@code magnitude} * and the sign of {@code sign}. * @author Joseph D. Darcy + * @deprecated Use StrictMath.copySign. */ - public static float copySign(float magnitude, float sign) { - return rawCopySign(magnitude, (isNaN(sign)?1.0f:sign)); + @Deprecated + public static float copySign(float magnitude, float sign) { + return StrictMath.copySign(magnitude, sign); } /** @@ -1090,33 +855,11 @@ public class FpUtils { * @return the size of an ulp of the argument * @author Joseph D. Darcy * @since 1.5 + * @deprecated Use Math.ulp. */ + @Deprecated public static double ulp(double d) { - int exp = getExponent(d); - - switch(exp) { - case DoubleConsts.MAX_EXPONENT+1: // NaN or infinity - return Math.abs(d); - - case DoubleConsts.MIN_EXPONENT-1: // zero or subnormal - return Double.MIN_VALUE; - - default: - assert exp <= DoubleConsts.MAX_EXPONENT && exp >= DoubleConsts.MIN_EXPONENT; - - // ulp(x) is usually 2^(SIGNIFICAND_WIDTH-1)*(2^ilogb(x)) - exp = exp - (DoubleConsts.SIGNIFICAND_WIDTH-1); - if (exp >= DoubleConsts.MIN_EXPONENT) { - return powerOfTwoD(exp); - } - else { - // return a subnormal result; left shift integer - // representation of Double.MIN_VALUE appropriate - // number of positions - return Double.longBitsToDouble(1L << - (exp - (DoubleConsts.MIN_EXPONENT - (DoubleConsts.SIGNIFICAND_WIDTH-1)) )); - } - } + return Math.ulp(d); } /** @@ -1141,33 +884,11 @@ public class FpUtils { * @return the size of an ulp of the argument * @author Joseph D. Darcy * @since 1.5 + * @deprecated Use Math.ulp. */ + @Deprecated public static float ulp(float f) { - int exp = getExponent(f); - - switch(exp) { - case FloatConsts.MAX_EXPONENT+1: // NaN or infinity - return Math.abs(f); - - case FloatConsts.MIN_EXPONENT-1: // zero or subnormal - return FloatConsts.MIN_VALUE; - - default: - assert exp <= FloatConsts.MAX_EXPONENT && exp >= FloatConsts.MIN_EXPONENT; - - // ulp(x) is usually 2^(SIGNIFICAND_WIDTH-1)*(2^ilogb(x)) - exp = exp - (FloatConsts.SIGNIFICAND_WIDTH-1); - if (exp >= FloatConsts.MIN_EXPONENT) { - return powerOfTwoF(exp); - } - else { - // return a subnormal result; left shift integer - // representation of FloatConsts.MIN_VALUE appropriate - // number of positions - return Float.intBitsToFloat(1 << - (exp - (FloatConsts.MIN_EXPONENT - (FloatConsts.SIGNIFICAND_WIDTH-1)) )); - } - } + return Math.ulp(f); } /** @@ -1186,9 +907,11 @@ public class FpUtils { * @return the signum function of the argument * @author Joseph D. Darcy * @since 1.5 + * @deprecated Use Math.signum. */ + @Deprecated public static double signum(double d) { - return (d == 0.0 || isNaN(d))?d:copySign(1.0, d); + return Math.signum(d); } /** @@ -1207,9 +930,10 @@ public class FpUtils { * @return the signum function of the argument * @author Joseph D. Darcy * @since 1.5 + * @deprecated Use Math.signum. */ + @Deprecated public static float signum(float f) { - return (f == 0.0f || isNaN(f))?f:copySign(1.0f, f); + return Math.signum(f); } - } diff --git a/jdk/test/java/lang/Double/ToHexString.java b/jdk/test/java/lang/Double/ToHexString.java index fcea456714a..c9fb07e9587 100644 --- a/jdk/test/java/lang/Double/ToHexString.java +++ b/jdk/test/java/lang/Double/ToHexString.java @@ -29,7 +29,6 @@ */ import java.util.regex.*; -import sun.misc.FpUtils; import sun.misc.DoubleConsts; public class ToHexString { diff --git a/jdk/test/java/lang/Math/CubeRootTests.java b/jdk/test/java/lang/Math/CubeRootTests.java index 6b70da3e43f..8b82183377c 100644 --- a/jdk/test/java/lang/Math/CubeRootTests.java +++ b/jdk/test/java/lang/Math/CubeRootTests.java @@ -95,14 +95,14 @@ public class CubeRootTests { // Test cbrt(2^(3n)) = 2^n. for(int i = 18; i <= DoubleConsts.MAX_EXPONENT/3; i++) { - failures += testCubeRootCase(FpUtils.scalb(1.0, 3*i), - FpUtils.scalb(1.0, i) ); + failures += testCubeRootCase(Math.scalb(1.0, 3*i), + Math.scalb(1.0, i) ); } // Test cbrt(2^(-3n)) = 2^-n. - for(int i = -1; i >= FpUtils.ilogb(Double.MIN_VALUE)/3; i--) { - failures += testCubeRootCase(FpUtils.scalb(1.0, 3*i), - FpUtils.scalb(1.0, i) ); + for(int i = -1; i >= DoubleConsts.MIN_SUB_EXPONENT/3; i--) { + failures += testCubeRootCase(Math.scalb(1.0, 3*i), + Math.scalb(1.0, i) ); } // Test random perfect cubes. Create double values with @@ -110,10 +110,10 @@ public class CubeRootTests { // significant bits in the significand set; 17*3 = 51, which // is less than the number of bits in a double's significand. long exponentBits1 = - Double.doubleToLongBits(FpUtils.scalb(1.0, 55)) & + Double.doubleToLongBits(Math.scalb(1.0, 55)) & DoubleConsts.EXP_BIT_MASK; long exponentBits2= - Double.doubleToLongBits(FpUtils.scalb(1.0, -55)) & + Double.doubleToLongBits(Math.scalb(1.0, -55)) & DoubleConsts.EXP_BIT_MASK; for(int i = 0; i < 100; i++) { // Take 16 bits since the 17th bit is implicit in the @@ -177,16 +177,16 @@ public class CubeRootTests { err = d - StrictMath.pow(y1, 3); if (err != 0.0) { - if(FpUtils.isNaN(err)) { + if(Double.isNaN(err)) { failures++; System.err.println("Encountered unexpected NaN value: d = " + d + "\tcbrt(d) = " + y1); } else { if (err < 0.0) { - err_adjacent = StrictMath.pow(FpUtils.nextUp(y1), 3) - d; + err_adjacent = StrictMath.pow(Math.nextUp(y1), 3) - d; } else { // (err > 0.0) - err_adjacent = StrictMath.pow(FpUtils.nextAfter(y1,0.0), 3) - d; + err_adjacent = StrictMath.pow(Math.nextAfter(y1,0.0), 3) - d; } if (Math.abs(err) > Math.abs(err_adjacent)) { @@ -200,16 +200,16 @@ public class CubeRootTests { err = d - StrictMath.pow(y2, 3); if (err != 0.0) { - if(FpUtils.isNaN(err)) { + if(Double.isNaN(err)) { failures++; System.err.println("Encountered unexpected NaN value: d = " + d + "\tcbrt(d) = " + y2); } else { if (err < 0.0) { - err_adjacent = StrictMath.pow(FpUtils.nextUp(y2), 3) - d; + err_adjacent = StrictMath.pow(Math.nextUp(y2), 3) - d; } else { // (err > 0.0) - err_adjacent = StrictMath.pow(FpUtils.nextAfter(y2,0.0), 3) - d; + err_adjacent = StrictMath.pow(Math.nextAfter(y2,0.0), 3) - d; } if (Math.abs(err) > Math.abs(err_adjacent)) { @@ -242,13 +242,13 @@ public class CubeRootTests { // Test near cbrt(2^(3n)) = 2^n. for(int i = 18; i <= DoubleConsts.MAX_EXPONENT/3; i++) { - double pc = FpUtils.scalb(1.0, 3*i); + double pc = Math.scalb(1.0, 3*i); pcNeighbors[2] = pc; pcNeighbors[1] = FpUtils.nextDown(pc); pcNeighbors[0] = FpUtils.nextDown(pcNeighbors[1]); - pcNeighbors[3] = FpUtils.nextUp(pc); - pcNeighbors[4] = FpUtils.nextUp(pcNeighbors[3]); + pcNeighbors[3] = Math.nextUp(pc); + pcNeighbors[4] = Math.nextUp(pcNeighbors[3]); for(int j = 0; j < pcNeighbors.length; j++) { pcNeighborsCbrt[j] = Math.cbrt(pcNeighbors[j]); @@ -280,14 +280,14 @@ public class CubeRootTests { } // Test near cbrt(2^(-3n)) = 2^-n. - for(int i = -1; i >= FpUtils.ilogb(Double.MIN_VALUE)/3; i--) { - double pc = FpUtils.scalb(1.0, 3*i); + for(int i = -1; i >= DoubleConsts.MIN_SUB_EXPONENT/3; i--) { + double pc = Math.scalb(1.0, 3*i); pcNeighbors[2] = pc; pcNeighbors[1] = FpUtils.nextDown(pc); pcNeighbors[0] = FpUtils.nextDown(pcNeighbors[1]); - pcNeighbors[3] = FpUtils.nextUp(pc); - pcNeighbors[4] = FpUtils.nextUp(pcNeighbors[3]); + pcNeighbors[3] = Math.nextUp(pc); + pcNeighbors[4] = Math.nextUp(pcNeighbors[3]); for(int j = 0; j < pcNeighbors.length; j++) { pcNeighborsCbrt[j] = Math.cbrt(pcNeighbors[j]); diff --git a/jdk/test/java/lang/Math/Expm1Tests.java b/jdk/test/java/lang/Math/Expm1Tests.java index 49fb968e3dc..f0f55d43d9e 100644 --- a/jdk/test/java/lang/Math/Expm1Tests.java +++ b/jdk/test/java/lang/Math/Expm1Tests.java @@ -82,7 +82,7 @@ public class Expm1Tests { // For |x| < 2^-54 expm1(x) ~= x for(int i = DoubleConsts.MIN_SUB_EXPONENT; i <= -54; i++) { - double d = FpUtils.scalb(2, i); + double d = Math.scalb(2, i); failures += testExpm1Case(d, d); failures += testExpm1Case(-d, -d); } @@ -101,7 +101,7 @@ public class Expm1Tests { // For x > 710, expm1(x) should be infinity for(int i = 10; i <= DoubleConsts.MAX_EXPONENT; i++) { - double d = FpUtils.scalb(2, i); + double d = Math.scalb(2, i); failures += testExpm1Case(d, infinityD); } @@ -118,7 +118,7 @@ public class Expm1Tests { } for(int i = 7; i <= DoubleConsts.MAX_EXPONENT; i++) { - double d = -FpUtils.scalb(2, i); + double d = -Math.scalb(2, i); failures += testExpm1CaseWithUlpDiff(d, -1.0, 1, reachedLimit); } @@ -145,8 +145,8 @@ public class Expm1Tests { pcNeighbors[2] = pc; pcNeighbors[1] = FpUtils.nextDown(pc); pcNeighbors[0] = FpUtils.nextDown(pcNeighbors[1]); - pcNeighbors[3] = FpUtils.nextUp(pc); - pcNeighbors[4] = FpUtils.nextUp(pcNeighbors[3]); + pcNeighbors[3] = Math.nextUp(pc); + pcNeighbors[4] = Math.nextUp(pcNeighbors[3]); for(int j = 0; j < pcNeighbors.length; j++) { pcNeighborsExpm1[j] = Math.expm1(pcNeighbors[j]); diff --git a/jdk/test/java/lang/Math/HyperbolicTests.java b/jdk/test/java/lang/Math/HyperbolicTests.java index db121575136..d82da690ea0 100644 --- a/jdk/test/java/lang/Math/HyperbolicTests.java +++ b/jdk/test/java/lang/Math/HyperbolicTests.java @@ -266,7 +266,7 @@ public class HyperbolicTests { // double significand. for(int i = DoubleConsts.MIN_SUB_EXPONENT; i < -27; i++) { - double d = FpUtils.scalb(2.0, i); + double d = Math.scalb(2.0, i); // Result and expected are the same. failures += testSinhCaseWithUlpDiff(d, d, 2.5); @@ -344,7 +344,7 @@ public class HyperbolicTests { // sinh(x) overflows for values greater than 710; in // particular, it overflows for all 2^i, i > 10. for(int i = 10; i <= DoubleConsts.MAX_EXPONENT; i++) { - double d = FpUtils.scalb(2.0, i); + double d = Math.scalb(2.0, i); // Result and expected are the same. failures += testSinhCaseWithUlpDiff(d, @@ -625,7 +625,7 @@ public class HyperbolicTests { // rounded. for(int i = DoubleConsts.MIN_SUB_EXPONENT; i < -27; i++) { - double d = FpUtils.scalb(2.0, i); + double d = Math.scalb(2.0, i); // Result and expected are the same. failures += testCoshCaseWithUlpDiff(d, 1.0, 2.5); @@ -703,7 +703,7 @@ public class HyperbolicTests { // cosh(x) overflows for values greater than 710; in // particular, it overflows for all 2^i, i > 10. for(int i = 10; i <= DoubleConsts.MAX_EXPONENT; i++) { - double d = FpUtils.scalb(2.0, i); + double d = Math.scalb(2.0, i); // Result and expected are the same. failures += testCoshCaseWithUlpDiff(d, @@ -984,7 +984,7 @@ public class HyperbolicTests { // double significand. for(int i = DoubleConsts.MIN_SUB_EXPONENT; i < -27; i++) { - double d = FpUtils.scalb(2.0, i); + double d = Math.scalb(2.0, i); // Result and expected are the same. failures += testTanhCaseWithUlpDiff(d, d, 2.5); @@ -998,7 +998,7 @@ public class HyperbolicTests { } for(int i = 5; i <= DoubleConsts.MAX_EXPONENT; i++) { - double d = FpUtils.scalb(2.0, i); + double d = Math.scalb(2.0, i); failures += testTanhCaseWithUlpDiff(d, 1.0, 2.5); } diff --git a/jdk/test/java/lang/Math/HypotTests.java b/jdk/test/java/lang/Math/HypotTests.java index e124220c046..465497e0a4b 100644 --- a/jdk/test/java/lang/Math/HypotTests.java +++ b/jdk/test/java/lang/Math/HypotTests.java @@ -90,7 +90,7 @@ public class HypotTests { for(int i = DoubleConsts.MIN_SUB_EXPONENT; i <= DoubleConsts.MAX_EXPONENT; i++) { - double input = FpUtils.scalb(2, i); + double input = Math.scalb(2, i); failures += testHypotCase(input, 0.0, input); } @@ -126,7 +126,7 @@ public class HypotTests { for(int i = 0; i < 1000; i++) { double d = rand.nextDouble(); // Scale d to have an exponent equal to MAX_EXPONENT -15 - d = FpUtils.scalb(d, DoubleConsts.MAX_EXPONENT + d = Math.scalb(d, DoubleConsts.MAX_EXPONENT -15 - FpUtils.ilogb(d)); for(int j = 0; j <= 13; j += 1) { failures += testHypotCase(3*d, 4*d, 5*d, 2.5); @@ -153,13 +153,13 @@ public class HypotTests { for(int i = -18; i <= 18; i++) { - double pc = FpUtils.scalb(1.0, i); + double pc = Math.scalb(1.0, i); pcNeighbors[2] = pc; pcNeighbors[1] = FpUtils.nextDown(pc); pcNeighbors[0] = FpUtils.nextDown(pcNeighbors[1]); - pcNeighbors[3] = FpUtils.nextUp(pc); - pcNeighbors[4] = FpUtils.nextUp(pcNeighbors[3]); + pcNeighbors[3] = Math.nextUp(pc); + pcNeighbors[4] = Math.nextUp(pcNeighbors[3]); for(int j = 0; j < pcNeighbors.length; j++) { pcNeighborsHypot[j] = Math.hypot(2.0, pcNeighbors[j]); diff --git a/jdk/test/java/lang/Math/IeeeRecommendedTests.java b/jdk/test/java/lang/Math/IeeeRecommendedTests.java index 6b4199e84b6..68e8a5ce6c4 100644 --- a/jdk/test/java/lang/Math/IeeeRecommendedTests.java +++ b/jdk/test/java/lang/Math/IeeeRecommendedTests.java @@ -177,7 +177,7 @@ public class IeeeRecommendedTests { } if (i > FloatConsts.MIN_EXPONENT) { - float po2minus = FpUtils.nextAfter(po2, + float po2minus = Math.nextAfter(po2, Float.NEGATIVE_INFINITY); failures += testGetExponentCase(po2minus, i-1); } @@ -205,7 +205,7 @@ public class IeeeRecommendedTests { // Test largest value in next smaller binade if (i >= 3) {// (i == 1) would test 0.0; // (i == 2) would just retest MIN_VALUE - testGetExponentCase(FpUtils.nextAfter(top, 0.0f), + testGetExponentCase(Math.nextAfter(top, 0.0f), FloatConsts.MIN_EXPONENT - 1); if( i >= 10) { @@ -284,7 +284,7 @@ public class IeeeRecommendedTests { } if (i > DoubleConsts.MIN_EXPONENT) { - double po2minus = FpUtils.nextAfter(po2, + double po2minus = Math.nextAfter(po2, Double.NEGATIVE_INFINITY); failures += testGetExponentCase(po2minus, i-1); } @@ -312,7 +312,7 @@ public class IeeeRecommendedTests { // Test largest value in next smaller binade if (i >= 3) {// (i == 1) would test 0.0; // (i == 2) would just retest MIN_VALUE - testGetExponentCase(FpUtils.nextAfter(top, 0.0), + testGetExponentCase(Math.nextAfter(top, 0.0), DoubleConsts.MIN_EXPONENT - 1); if( i >= 10) { @@ -1061,7 +1061,7 @@ public class IeeeRecommendedTests { float value = someTestCases[i]; failures+=testScalbCase(value, scaleFactor, - FpUtils.copySign( (scaleFactor>0?infinityF:0.0f), value) ); + Math.copySign( (scaleFactor>0?infinityF:0.0f), value) ); } } } @@ -1095,7 +1095,7 @@ public class IeeeRecommendedTests { failures+=testScalbCase(value, scaleFactor, (FpUtils.ilogb(value) +j > FloatConsts.MAX_EXPONENT ) ? - FpUtils.copySign(infinityF, value) : // overflow + Math.copySign(infinityF, value) : // overflow // calculate right answer twoToTheMaxExp*(twoToTheMaxExp*(scale*value)) ); scale*=2.0f; @@ -1268,7 +1268,7 @@ public class IeeeRecommendedTests { double value = someTestCases[i]; failures+=testScalbCase(value, scaleFactor, - FpUtils.copySign( (scaleFactor>0?infinityD:0.0), value) ); + Math.copySign( (scaleFactor>0?infinityD:0.0), value) ); } } } @@ -1302,7 +1302,7 @@ public class IeeeRecommendedTests { failures+=testScalbCase(value, scaleFactor, (FpUtils.ilogb(value) +j > DoubleConsts.MAX_EXPONENT ) ? - FpUtils.copySign(infinityD, value) : // overflow + Math.copySign(infinityD, value) : // overflow // calculate right answer twoToTheMaxExp*(twoToTheMaxExp*(scale*value)) ); scale*=2.0; @@ -1423,7 +1423,7 @@ public class IeeeRecommendedTests { // Create power of two float po2 = powerOfTwoF(i); - expected = FpUtils.scalb(1.0f, i - (FloatConsts.SIGNIFICAND_WIDTH-1)); + expected = Math.scalb(1.0f, i - (FloatConsts.SIGNIFICAND_WIDTH-1)); failures += testUlpCase(po2, expected); @@ -1443,7 +1443,7 @@ public class IeeeRecommendedTests { } if (i > FloatConsts.MIN_EXPONENT) { - float po2minus = FpUtils.nextAfter(po2, + float po2minus = Math.nextAfter(po2, Float.NEGATIVE_INFINITY); failures += testUlpCase(po2minus, expected/2.0f); } @@ -1470,7 +1470,7 @@ public class IeeeRecommendedTests { // Test largest value in next smaller binade if (i >= 3) {// (i == 1) would test 0.0; // (i == 2) would just retest MIN_VALUE - testUlpCase(FpUtils.nextAfter(top, 0.0f), + testUlpCase(Math.nextAfter(top, 0.0f), Float.MIN_VALUE); if( i >= 10) { @@ -1528,7 +1528,7 @@ public class IeeeRecommendedTests { // Create power of two double po2 = powerOfTwoD(i); - expected = FpUtils.scalb(1.0, i - (DoubleConsts.SIGNIFICAND_WIDTH-1)); + expected = Math.scalb(1.0, i - (DoubleConsts.SIGNIFICAND_WIDTH-1)); failures += testUlpCase(po2, expected); @@ -1548,7 +1548,7 @@ public class IeeeRecommendedTests { } if (i > DoubleConsts.MIN_EXPONENT) { - double po2minus = FpUtils.nextAfter(po2, + double po2minus = Math.nextAfter(po2, Double.NEGATIVE_INFINITY); failures += testUlpCase(po2minus, expected/2.0f); } @@ -1575,7 +1575,7 @@ public class IeeeRecommendedTests { // Test largest value in next smaller binade if (i >= 3) {// (i == 1) would test 0.0; // (i == 2) would just retest MIN_VALUE - testUlpCase(FpUtils.nextAfter(top, 0.0f), + testUlpCase(Math.nextAfter(top, 0.0f), Double.MIN_VALUE); if( i >= 10) { diff --git a/jdk/test/java/lang/Math/Log10Tests.java b/jdk/test/java/lang/Math/Log10Tests.java index 60d9ec6f3f5..c245a7477ff 100644 --- a/jdk/test/java/lang/Math/Log10Tests.java +++ b/jdk/test/java/lang/Math/Log10Tests.java @@ -153,12 +153,12 @@ public class Log10Tests { for(int i = 0; i < half; i++) { if (i == 0) { input[half] = 1.0; - up = FpUtils.nextUp(1.0); + up = Math.nextUp(1.0); down = FpUtils.nextDown(1.0); } else { input[half + i] = up; input[half - i] = down; - up = FpUtils.nextUp(up); + up = Math.nextUp(up); down = FpUtils.nextDown(down); } } diff --git a/jdk/test/java/lang/Math/Log1pTests.java b/jdk/test/java/lang/Math/Log1pTests.java index 1666d7b6c62..bd5f0e0aeab 100644 --- a/jdk/test/java/lang/Math/Log1pTests.java +++ b/jdk/test/java/lang/Math/Log1pTests.java @@ -88,14 +88,14 @@ public class Log1pTests { // For |x| < 2^-54 log1p(x) ~= x for(int i = DoubleConsts.MIN_SUB_EXPONENT; i <= -54; i++) { - double d = FpUtils.scalb(2, i); + double d = Math.scalb(2, i); failures += testLog1pCase(d, d); failures += testLog1pCase(-d, -d); } // For x > 2^53 log1p(x) ~= log(x) for(int i = 53; i <= DoubleConsts.MAX_EXPONENT; i++) { - double d = FpUtils.scalb(2, i); + double d = Math.scalb(2, i); failures += testLog1pCaseWithUlpDiff(d, StrictMath.log(d), 2.001); } @@ -105,7 +105,7 @@ public class Log1pTests { for(int i = 0; i < 1000; i++) { double d = rand.nextDouble(); - d = FpUtils.scalb(d, -53 - FpUtils.ilogb(d)); + d = Math.scalb(d, -53 - FpUtils.ilogb(d)); for(int j = -53; j <= 52; j++) { failures += testLog1pCaseWithUlpDiff(d, hp15cLogp(d), 5); @@ -137,8 +137,8 @@ public class Log1pTests { pcNeighbors[2] = pc; pcNeighbors[1] = FpUtils.nextDown(pc); pcNeighbors[0] = FpUtils.nextDown(pcNeighbors[1]); - pcNeighbors[3] = FpUtils.nextUp(pc); - pcNeighbors[4] = FpUtils.nextUp(pcNeighbors[3]); + pcNeighbors[3] = Math.nextUp(pc); + pcNeighbors[4] = Math.nextUp(pcNeighbors[3]); for(int j = 0; j < pcNeighbors.length; j++) { pcNeighborsLog1p[j] = Math.log1p(pcNeighbors[j]); diff --git a/jdk/test/java/lang/Math/Rint.java b/jdk/test/java/lang/Math/Rint.java index 49a8edd4352..09821c82b0b 100644 --- a/jdk/test/java/lang/Math/Rint.java +++ b/jdk/test/java/lang/Math/Rint.java @@ -48,7 +48,7 @@ public class Rint { public static void main(String args[]) { int failures = 0; - double twoToThe52 = FpUtils.scalb(1.0, 52); // 2^52 + double twoToThe52 = Math.scalb(1.0, 52); // 2^52 double [][] testCases = { {0.0, 0.0}, @@ -60,16 +60,16 @@ public class Rint { {FpUtils.nextDown(0.5), 0.0}, { 0.5, 0.0}, - { FpUtils.nextUp(0.5), 1.0}, + { Math.nextUp(0.5), 1.0}, {0.7, 1.0}, {FpUtils.nextDown(1.0), 1.0}, { 1.0, 1.0}, - { FpUtils.nextUp(1.0), 1.0}, + { Math.nextUp(1.0), 1.0}, {FpUtils.nextDown(1.5), 1.0}, { 1.5, 2.0}, - { FpUtils.nextUp(1.5), 2.0}, + { Math.nextUp(1.5), 2.0}, {4.2, 4.0}, {4.5, 4.0}, @@ -81,10 +81,10 @@ public class Rint { {150000.75, 150001.0}, {300000.5, 300000.0}, - {FpUtils.nextUp(300000.5), 300001.0}, + {Math.nextUp(300000.5), 300001.0}, {FpUtils.nextDown(300000.75), 300001.0}, {300000.75, 300001.0}, - {FpUtils.nextUp(300000.75), 300001.0}, + {Math.nextUp(300000.75), 300001.0}, {300000.99, 300001.0}, {262144.75, 262145.0}, //(2^18 ) + 0.75 {499998.75, 499999.0}, @@ -93,7 +93,7 @@ public class Rint { {FpUtils.nextDown(twoToThe52), twoToThe52}, {twoToThe52, twoToThe52}, - {FpUtils.nextUp(twoToThe52), FpUtils.nextUp(twoToThe52)}, + {Math.nextUp(twoToThe52), Math.nextUp(twoToThe52)}, {Double.MAX_VALUE, Double.MAX_VALUE}, {Double.POSITIVE_INFINITY, Double.POSITIVE_INFINITY}, From b88865d91f1859b3d30617bc65de0beca11c8bf3 Mon Sep 17 00:00:00 2001 From: Michael McMahon Date: Mon, 19 Sep 2011 15:14:17 +0100 Subject: [PATCH 12/23] 7091369: DatagramSocket/Limit.java failing on 8 and 7u2 Reviewed-by: chegar, alanb --- .../classes/java/net/TwoStacksPlainDatagramSocketImpl.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/jdk/src/windows/classes/java/net/TwoStacksPlainDatagramSocketImpl.java b/jdk/src/windows/classes/java/net/TwoStacksPlainDatagramSocketImpl.java index 0729d76ada4..ebd5e527ca2 100644 --- a/jdk/src/windows/classes/java/net/TwoStacksPlainDatagramSocketImpl.java +++ b/jdk/src/windows/classes/java/net/TwoStacksPlainDatagramSocketImpl.java @@ -68,7 +68,12 @@ class TwoStacksPlainDatagramSocketImpl extends AbstractPlainDatagramSocketImpl protected synchronized void create() throws SocketException { fd1 = new FileDescriptor(); - super.create(); + try { + super.create(); + } catch (IOException e) { + fd1 = null; + throw e; + } } protected synchronized void bind(int lport, InetAddress laddr) From 4d4a89de9b13d1184674cd5e51c96f031e73702a Mon Sep 17 00:00:00 2001 From: Weijun Wang Date: Tue, 20 Sep 2011 12:40:23 +0800 Subject: [PATCH 13/23] 7091290: fails to build jdk8 b05 Embedded build Reviewed-by: xuelei, dholmes --- jdk/src/share/classes/org/ietf/jgss/Oid.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jdk/src/share/classes/org/ietf/jgss/Oid.java b/jdk/src/share/classes/org/ietf/jgss/Oid.java index 294ec1fce72..eb55ff95197 100644 --- a/jdk/src/share/classes/org/ietf/jgss/Oid.java +++ b/jdk/src/share/classes/org/ietf/jgss/Oid.java @@ -157,7 +157,7 @@ public class Oid { return (true); if (other instanceof Oid) - return this.oid.equals(((Oid) other).oid); + return this.oid.equals((Object)((Oid) other).oid); else if (other instanceof ObjectIdentifier) return this.oid.equals(other); else From b9c11d661eaf0606e040da69fed405b6cebd1794 Mon Sep 17 00:00:00 2001 From: Mike Duigou Date: Tue, 20 Sep 2011 12:27:45 -0700 Subject: [PATCH 14/23] 7074264: Switches to packages tree view and adds unit tests to sources Reviewed-by: igor --- jdk/make/netbeans/README | 45 ++++++++----------- .../netbeans/common/closed-share-view.ent | 4 +- jdk/make/netbeans/common/java-data-native.ent | 7 ++- .../netbeans/common/java-data-no-native.ent | 7 ++- jdk/make/netbeans/common/jtreg-view.ent | 2 +- jdk/make/netbeans/common/sample-view.ent | 2 +- jdk/make/netbeans/common/share-view.ent | 2 +- jdk/make/netbeans/common/unix-view.ent | 2 +- jdk/make/netbeans/common/windows-view.ent | 2 +- jdk/make/netbeans/j2se/nbproject/project.xml | 6 ++- 10 files changed, 42 insertions(+), 37 deletions(-) diff --git a/jdk/make/netbeans/README b/jdk/make/netbeans/README index a375b8b55e3..ffae80f95ce 100644 --- a/jdk/make/netbeans/README +++ b/jdk/make/netbeans/README @@ -5,7 +5,7 @@ Working on OpenJDK using NetBeans Getting Started In addition to the source bundle for Open JDK, you'll need to download - and install copies of the JDK and of NetBeans 6. And if you want to run + and install copies of the JDK and of NetBeans. And if you want to run tests on the JDK (you do want to run tests, right?), you'll need to install the jtreg test harness. @@ -20,30 +20,28 @@ Getting Started Downloading the JDK You've probably done this a million times. Download and install it - from http://java.sun.com/javase + from http://www.oracle.com/technetwork/java/javase/overview/index.html Downloading the OpenJDK sources Since you're reading this, d you've already downloaded the OpenJDK source bundle. Later in this document we'll refer to the location where you installed the Open JDK sources as *install-dir*. - Downloading a pre-built, JDK 7 + Downloading a pre-built, JDK 8 This will be necessary to do builds of some of the projects. In general, you want to download and install a pre-built JDK that corresponds to the OpenJDK sources you download. Building the entire OpenJDK depends on a few parts of the pre-built JDK. Get this from - http://download.java.net/jdk7/binaries + http://download.java.net/jdk8/binaries - Note: For working on certain projects, like JMX and JConsole, you - may find convenient to use a pre-built version of JDK 7 (or + Note: For working on certain projects, like JMX and JConsole, you + may find convenient to use a pre-built version of JDK 8 (or OpenJDK) rather than building your own. This will allow you to build only that part of the OpenJDK sources which correspond - to that project. + to that project. - NetBeans 6 - Yep, NetBeans *6*. Nope, not FCS'd yet. We're on the edge here, - enjoy it! Get the latest working development build of NetBeans 6 - from http://netbeans.org + NetBeans 7.0 or later + Older versions may also work but are unsupported. jtreg "jtreg" is the test harness for running OpenJDK's regression tests. @@ -51,7 +49,7 @@ Getting Started Ant NetBeans comes with ant, but if you use a separately-installed copy - please make sure that it is at least version 1.7.0. + please make sure that it is at least version 1.8.1. Configuring Building OpenJDK is hard and complex. No, strike that. While it's not @@ -92,8 +90,8 @@ Configuring situation: make.options=\ - ALT_BOOTDIR=/home/me/bin/jdk1.6.0 \ - ALT_JDK_IMPORT_PATH=/home/me/bin/jdk1.7.0 \ + ALT_BOOTDIR=/home/me/bin/jdk1.7.0 \ + ALT_JDK_IMPORT_PATH=/home/me/bin/jdk1.8.0 \ OPENJDK=true The trailing '\' are important, so that make gets the above as a @@ -107,7 +105,7 @@ Configuring Windows-specific configuration First, please note that the entire JDK cannot currently be built on Windows platforms. This will likely limit your ability to build - make-based projects. See + make-based projects. See *install-dir*/jdk/make/README-builds.html for full information on issues with building on the Windows platform. @@ -141,7 +139,7 @@ Configuring editor. Locale Requirements - To build the Open JDK sources, be certain that you are using the "C" + To build the OpenJDK sources, be certain that you are using the "C" locale on Unix (R) platforms, or "English (United States)" locale on Windows. @@ -220,13 +218,13 @@ Provided NetBeans projects running and debugging JConsole. This ant-based project does *not* require that you build the jdk - project first, provided that you use a pre-built version of JDK 7. + project first, provided that you use a pre-built version of JDK 7. Java (TM) Management Extensions (JMX(TM)) API (directory "jmx") For working on JMX source code. Creates ../dist/lib/jmx.jar. This ant-based project does *not* require that you build the jdk - project first, provided that you use a pre-built version of JDK 7. + project first, provided that you use a pre-built version of JDK 7. Jar & Zip (directory "jarzip") For working on jar & zip. It builds the zip library (including @@ -242,12 +240,12 @@ Provided NetBeans projects running and debugging the SampleTree demo. This ant-based project does *not* require that you build the jdk - project first, provided that you use a pre-built version of JDK 7. + project first, provided that you use a pre-built version of JDK 7. In addition, there are projects for building the compiler, javadoc, and related tools, in the OpenJDK langtools component. These projects are separate from those described here, and have their - own set of guidelines and conventions. For more details, see the + own set of guidelines and conventions. For more details, see the README files in make/netbeans in the OpenJDK langtools component. Running Tests @@ -603,13 +601,6 @@ Appendix 1: Customizations * -clean-make Known Issues - Tests won't run: waiting for lock - Occasionally when running tests, there will be a delay, followed by a - message like this: - Waiting to lock test result cache for - /tmp/jdk/build/linux-i586/jtreg/jconsole/JTwork for 20 seconds - The workaround is to stop the tests, rm -rf the offending jtreg/ - directory by hand, and re-run the tests. Can't run nor debug a single test in the JConsole test In most projects, you can run a single test by opening it in the editor, diff --git a/jdk/make/netbeans/common/closed-share-view.ent b/jdk/make/netbeans/common/closed-share-view.ent index 6ef29331f9d..82fe0cab525 100644 --- a/jdk/make/netbeans/common/closed-share-view.ent +++ b/jdk/make/netbeans/common/closed-share-view.ent @@ -31,8 +31,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --> - - + + ${root}/src/closed/share/classes ${includes} ${excludes} diff --git a/jdk/make/netbeans/common/java-data-native.ent b/jdk/make/netbeans/common/java-data-native.ent index fb531ed8921..a801e821db6 100644 --- a/jdk/make/netbeans/common/java-data-native.ent +++ b/jdk/make/netbeans/common/java-data-native.ent @@ -38,7 +38,12 @@ ${root}/src/solaris/classes ${bootstrap.jdk}/jre/lib/rt.jar ${root}/build/${platform}-${arch}/classes - ${root}/build/javadoc/${name} + ${root}/build/${platform}-${arch}/docs/api + 1.7 + + + ${root}/test + 1.7 diff --git a/jdk/make/netbeans/common/java-data-no-native.ent b/jdk/make/netbeans/common/java-data-no-native.ent index 2e1b791bd50..a204f3a6f17 100644 --- a/jdk/make/netbeans/common/java-data-no-native.ent +++ b/jdk/make/netbeans/common/java-data-no-native.ent @@ -36,7 +36,12 @@ ${root}/src/share/classes ${bootstrap.jdk}/jre/lib/rt.jar ${root}/build/${platform}-${arch}/classes - ${root}/build/javadoc/${name} + ${root}/build/${platform}-${arch}/docs/api + 1.7 + + + ${root}/test + 1.7 diff --git a/jdk/make/netbeans/common/jtreg-view.ent b/jdk/make/netbeans/common/jtreg-view.ent index 899df888e23..ce0d2dad3ed 100644 --- a/jdk/make/netbeans/common/jtreg-view.ent +++ b/jdk/make/netbeans/common/jtreg-view.ent @@ -31,7 +31,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --> - + ${root}/test ${jtreg.tests} diff --git a/jdk/make/netbeans/common/sample-view.ent b/jdk/make/netbeans/common/sample-view.ent index 70cdd2397ca..9b470ef9d54 100644 --- a/jdk/make/netbeans/common/sample-view.ent +++ b/jdk/make/netbeans/common/sample-view.ent @@ -31,7 +31,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --> - + ${root}/src/share/sample ${samples} diff --git a/jdk/make/netbeans/common/share-view.ent b/jdk/make/netbeans/common/share-view.ent index 0b0dde08a2b..2d607889ce6 100644 --- a/jdk/make/netbeans/common/share-view.ent +++ b/jdk/make/netbeans/common/share-view.ent @@ -31,7 +31,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --> - + ${root}/src/share/classes ${includes} diff --git a/jdk/make/netbeans/common/unix-view.ent b/jdk/make/netbeans/common/unix-view.ent index c1176f66d74..84f168b2927 100644 --- a/jdk/make/netbeans/common/unix-view.ent +++ b/jdk/make/netbeans/common/unix-view.ent @@ -35,7 +35,7 @@ UNIX is a registered trademark in the United States and other countries, exclusively licensed through X/Open Company, Ltd. --> - + ${root}/src/solaris/classes ${includes} diff --git a/jdk/make/netbeans/common/windows-view.ent b/jdk/make/netbeans/common/windows-view.ent index 38419c2cf5a..8e80c6cfce3 100644 --- a/jdk/make/netbeans/common/windows-view.ent +++ b/jdk/make/netbeans/common/windows-view.ent @@ -31,7 +31,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --> - + ${root}/src/windows/classes ${includes} diff --git a/jdk/make/netbeans/j2se/nbproject/project.xml b/jdk/make/netbeans/j2se/nbproject/project.xml index 7cc5b516721..784ab7232b8 100644 --- a/jdk/make/netbeans/j2se/nbproject/project.xml +++ b/jdk/make/netbeans/j2se/nbproject/project.xml @@ -1,7 +1,7 @@