From a3c0889315e194a7100ec989c5ecc1d9621a03b6 Mon Sep 17 00:00:00 2001 From: Serguei Spitsyn Date: Wed, 25 Feb 2015 01:02:04 -0800 Subject: [PATCH 01/76] 8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale Add new test java/lang/instrument/ManyMethodsBenchmarkAgent.java Reviewed-by: coleenp, dcubed --- .../instrument/ManyMethodsBenchmarkAgent.java | 75 ++++++++++ .../instrument/ManyMethodsBenchmarkApp.java | 141 ++++++++++++++++++ 2 files changed, 216 insertions(+) create mode 100644 jdk/test/java/lang/instrument/ManyMethodsBenchmarkAgent.java create mode 100644 jdk/test/java/lang/instrument/ManyMethodsBenchmarkApp.java diff --git a/jdk/test/java/lang/instrument/ManyMethodsBenchmarkAgent.java b/jdk/test/java/lang/instrument/ManyMethodsBenchmarkAgent.java new file mode 100644 index 00000000000..05f9f1942ff --- /dev/null +++ b/jdk/test/java/lang/instrument/ManyMethodsBenchmarkAgent.java @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * @test + * @bug 8046246 + * @summary Tests and benchmarks the JVMTI RedefineClasses when a + * single class (and its parent) contains many methods. + * + * @run build ManyMethodsBenchmarkApp ManyMethodsBenchmarkAgent + * @run shell MakeJAR3.sh ManyMethodsBenchmarkAgent 'Can-Retransform-Classes: true' + * @run main/othervm -javaagent:ManyMethodsBenchmarkAgent.jar ManyMethodsBenchmarkApp + */ +import java.lang.instrument.*; + +public class ManyMethodsBenchmarkAgent +{ + public static boolean fail = false; + public static boolean completed = false; + private static Instrumentation instrumentation; + + public static void + premain( String agentArgs, + Instrumentation instrumentation) { + System.out.println("ManyMethodsBenchmarkAgent started"); + ManyMethodsBenchmarkAgent.instrumentation = instrumentation; + System.out.println("ManyMethodsBenchmarkAgent finished"); + } + + static void instr() { + System.out.println("ManyMethodsBenchmarkAgent.instr started"); + + Class[] allClasses = instrumentation.getAllLoadedClasses(); + + for (int i = 0; i < allClasses.length; i++) { + Class klass = allClasses[i]; + String name = klass.getName(); + if (!name.equals("Base")) { + continue; + } + System.err.println("Instrumenting the class: " + klass); + + try { + instrumentation.retransformClasses(klass); + } catch (Throwable e) { + System.err.println("Error: bad return from retransform: " + klass); + System.err.println(" ERROR: " + e); + fail = true; + } + } + completed = true; + System.out.println("ManyMethodsBenchmarkAgent.instr finished"); + } + +} diff --git a/jdk/test/java/lang/instrument/ManyMethodsBenchmarkApp.java b/jdk/test/java/lang/instrument/ManyMethodsBenchmarkApp.java new file mode 100644 index 00000000000..c85bf42b820 --- /dev/null +++ b/jdk/test/java/lang/instrument/ManyMethodsBenchmarkApp.java @@ -0,0 +1,141 @@ +/* + * Copyright 2015 Google Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.io.File; +import java.io.FileWriter; +import java.io.PrintStream; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.lang.reflect.Type; +import java.net.URL; +import java.net.URLClassLoader; +import java.util.Arrays; +import java.util.List; +import javax.tools.JavaCompiler; +import javax.tools.StandardJavaFileManager; +import javax.tools.ToolProvider; + +/** + * A manual benchmark of the JVMTI RedefineClasses when a + * single class (and its parent) contains many methods. + */ +public class ManyMethodsBenchmarkApp { + // Limit is 64k but we can not put such many as the CP limit is 32k. + // In practice, it means a real limit is much lower (less than 22000). + static final int METHOD_COUNT = 20000; + + static Class loadClassInNewClassLoader(String className) throws Exception { + URL[] urls = { new File(".").toURI().toURL() }; + URLClassLoader ucl = new URLClassLoader(urls, null); + Class klazz = Class.forName(className, true, ucl); + return klazz; + } + + static void benchmarkClassOperations(String className) throws Exception { + Class klazz = loadClassInNewClassLoader(className); + + Method[] methods = klazz.getDeclaredMethods(); + if (methods.length != METHOD_COUNT) { + throw new AssertionError("unexpected method count: " + methods.length + + " expected: " + METHOD_COUNT); + } + + methods = klazz.getMethods(); + // returned methods includes those inherited from Object + int objectMethodSlop = 100; + if (methods.length <= METHOD_COUNT || + methods.length >= METHOD_COUNT + objectMethodSlop) { + throw new AssertionError("unexpected method count: " + methods.length); + } + + // Invoke methods to make them appear in the constant pool cache + Object obj = klazz.newInstance(); + Object[] args = new Object[0]; + for (Method m: methods) { + try { + Class[] types = m.getParameterTypes(); + String name = m.getName(); + // System.out.println("method: " + name + "; argno: " + types.length); + if (types.length == 0 && name.length() == 2 && name.startsWith("f")) { + m.invoke(obj, args); + } + } catch (InvocationTargetException ex) { + ex.printStackTrace(); + } + } + } + + public static void main(String[] args) throws Exception { + System.out.println("test started: ManyMethodsBenchmarkApp"); + + // Create source files with many methods + File base = new File("Base.java"); + try (FileWriter fw = new FileWriter(base)) { + fw.write("public class Base {\n"); + final int L = 10; + // Each of the first L methods makes calls to its own chunk of METHOD_COUNT/L methods + for (int k = 0; k < L; k++) { + fw.write(" public void f" + k + "() {\n"); + int shift = (k == 0) ? L : 0; + for (int i = (k * (METHOD_COUNT/L)) + shift; i < (k + 1) * METHOD_COUNT/L; i++) { + fw.write(" f" + i + "();\n"); + } + fw.write(" }\n"); + } + + // The rest of (METHOD_COUNT - L) methods have empty body + for (int i = L; i < METHOD_COUNT; i++) { + fw.write(" public static void f" + i + "() {}\n"); + } + fw.write("}\n"); + } + + // Compile the generated source files. + JavaCompiler compiler = ToolProvider.getSystemJavaCompiler(); + List files = Arrays.asList(new File[] { base }); + try (StandardJavaFileManager fileManager = + compiler.getStandardFileManager(null, null, null)) { + compiler.getTask(null, fileManager, null, null, null, + fileManager.getJavaFileObjectsFromFiles(files)) + .call(); + } + + benchmarkClassOperations("Base"); + + ManyMethodsBenchmarkAgent.instr(); + + // Cleanup + base.delete(); + new File("Base.class").delete(); + if (!ManyMethodsBenchmarkAgent.completed) { + throw new Exception("ERROR: ManyMethodsBenchmarkAgent did not complete."); + } + + if (ManyMethodsBenchmarkAgent.fail) { + throw new Exception("ERROR: ManyMethodsBenchmarkAgent failed."); + } else { + System.out.println("ManyMethodsBenchmarkAgent succeeded."); + } + System.out.println("test finished: ManyMethodsBenchmarkApp"); + } +} From 02614afbd146d397421307c4d8de0673f3be4d7a Mon Sep 17 00:00:00 2001 From: Zaiyao Liu Date: Fri, 6 Mar 2015 00:49:38 +0000 Subject: [PATCH 02/76] 8044193: Need to add known answer tests for AES cipher Added more tests for AES cipher using known test vectors. Reviewed-by: valeriep --- .../Cipher/AES/TestAESCiphers/Dynamic.java | 186 ++++++++++++++++++ .../TestAESWithDefaultProvider.java | 35 ++++ .../TestAESWithProviderChange.java | 39 ++++ .../TestAESWithRemoveAddProvider.java | 42 ++++ .../Cipher/AES/TestAESCiphers/testAES.policy | 6 + 5 files changed, 308 insertions(+) create mode 100644 jdk/test/com/sun/crypto/provider/Cipher/AES/TestAESCiphers/Dynamic.java create mode 100644 jdk/test/com/sun/crypto/provider/Cipher/AES/TestAESCiphers/TestAESWithDefaultProvider.java create mode 100644 jdk/test/com/sun/crypto/provider/Cipher/AES/TestAESCiphers/TestAESWithProviderChange.java create mode 100644 jdk/test/com/sun/crypto/provider/Cipher/AES/TestAESCiphers/TestAESWithRemoveAddProvider.java create mode 100644 jdk/test/com/sun/crypto/provider/Cipher/AES/TestAESCiphers/testAES.policy diff --git a/jdk/test/com/sun/crypto/provider/Cipher/AES/TestAESCiphers/Dynamic.java b/jdk/test/com/sun/crypto/provider/Cipher/AES/TestAESCiphers/Dynamic.java new file mode 100644 index 00000000000..3aa6d29e8fe --- /dev/null +++ b/jdk/test/com/sun/crypto/provider/Cipher/AES/TestAESCiphers/Dynamic.java @@ -0,0 +1,186 @@ +/* + * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.io.PrintStream; +import java.security.NoSuchAlgorithmException; +import java.security.spec.AlgorithmParameterSpec; +import java.util.Arrays; +import java.util.Random; + +import javax.crypto.Cipher; +import javax.crypto.KeyGenerator; +import javax.crypto.SecretKey; +import javax.crypto.spec.IvParameterSpec; + +public class Dynamic { + + static final String ALGORITHM = "AES"; + static final String[] MODE = { + "ECb", "CbC", "CTR", "PCBC", "OFB", "OFB150", "cFB", "CFB7", + "cFB8", "cFB16", "cFB24", "cFB32", "Cfb40", "cfB48", "cfB56", + "cfB64", "cfB72", "cfB80", "cfB88", "cfB96", "cfb104", "cfB112", + "cfB120", "cfB128", "OFB8", "OFB16", "OFB24", "OFB32", "OFB40", + "OFB48", "OFB56", "OFB64", "OFB72", "OFB80", "OFB88", "OFB96", + "OFB104", "OFB112", "OFB120", "OFB128", "GCM" + }; + static final String[] PADDING = { + "NoPadding", "PKCS5Padding", "ISO10126Padding" + }; + static final String SUNJCE = "SunJCE"; + + Cipher ci = null; + byte[] iv = null; + AlgorithmParameterSpec aps = null; + SecretKey key = null; + int keyStrength; + static int DefaultSize = 128; + + public void run(String[] argv) throws Exception { + if (!runAllTest(argv, System.out)) { + throw new Exception("Test Failed"); + } + } + + protected boolean runAllTest(String argv[], PrintStream out) { + boolean result = true; + StringBuilder failedList = new StringBuilder(); + int failedCnt = 0; + int testCount = 0; + int padKinds; // how many kinds of padding mode such as PKCS5padding and + // NoPadding. + + try { + for (int i = 0; i < 3; i++) { + keyStrength = DefaultSize + i * 64; // obtain the key size 128, + // 192, 256 + + for (int j = 0; j < MODE.length; j++) { + if (MODE[j].equalsIgnoreCase("ECB") + || MODE[j].equalsIgnoreCase("PCBC") + || MODE[j].equalsIgnoreCase("CBC")) { + padKinds = PADDING.length; + } else { + padKinds = 1; + } + + for (int k = 0; k < padKinds; k++) { + testCount++; + try { + if (!runTest(ALGORITHM, MODE[j], PADDING[k])) { + result = false; + failedCnt++; + failedList.append(ALGORITHM + "/" + MODE[j] + + "/" + PADDING[k] + " "); + } + } catch (Exception e) { + e.printStackTrace(); + result = false; + failedCnt++; + failedList.append(ALGORITHM + "/" + MODE[j] + "/" + + PADDING[k] + " "); + } + + } + } + } + + if (result) { + out.println("STATUS:Passed. Test " + testCount + + " cases, All Passed"); + return true; + } + out.println("STATUS:Failed. " + failedCnt + " Failed: " + + failedList); + return false; + + } catch (Exception ex) { + ex.printStackTrace(); + out.println("STATUS:Failed. Unexpected Exception: " + ex); + return false; + } + } + + protected boolean runTest(String algo, String mo, String pad) + throws Exception { + boolean result = true; + try { + byte[] plainText = new byte[160000]; + new Random().nextBytes(plainText); + + String transformation = algo + "/" + mo + "/" + pad; + ci = Cipher.getInstance(transformation, SUNJCE); + KeyGenerator kg = KeyGenerator.getInstance(algo, SUNJCE); + if (keyStrength > Cipher.getMaxAllowedKeyLength(transformation)) { + // skip if this key length is larger than what's + // configured in the jce jurisdiction policy files + System.out.println(keyStrength + + " is larger than what's configured " + + "in the jce jurisdiction policy files"); + return result; + } + kg.init(keyStrength); + key = kg.generateKey(); + + if (!mo.equalsIgnoreCase("GCM")) { + ci.init(Cipher.ENCRYPT_MODE, key, aps); + } else { + ci.init(Cipher.ENCRYPT_MODE, key); + } + byte[] cipherText = new byte[ci.getOutputSize(plainText.length)]; + int offset = ci.update(plainText, 0, plainText.length, cipherText, + 0); + ci.doFinal(cipherText, offset); + + if (!mo.equalsIgnoreCase("ECB")) { + iv = ci.getIV(); + aps = new IvParameterSpec(iv); + } else { + aps = null; + } + + if (!mo.equalsIgnoreCase("GCM")) { + ci.init(Cipher.DECRYPT_MODE, key, aps); + } else { + ci.init(Cipher.DECRYPT_MODE, key, ci.getParameters()); + } + byte[] recoveredText = new byte[ci.getOutputSize(cipherText.length)]; + int len = ci.doFinal(cipherText, 0, cipherText.length, + recoveredText); + + byte[] tmp = new byte[len]; + for (int i = 0; i < len; i++) { + tmp[i] = recoveredText[i]; + } + + result = Arrays.equals(plainText, tmp); + } catch (NoSuchAlgorithmException nsaEx) { + nsaEx.printStackTrace(); + // CFB7 and OFB150 are negative test,SunJCE not support this + // algorithm + result = mo.equalsIgnoreCase("CFB7") + || mo.equalsIgnoreCase("OFB150"); + + } + return result; + } +} diff --git a/jdk/test/com/sun/crypto/provider/Cipher/AES/TestAESCiphers/TestAESWithDefaultProvider.java b/jdk/test/com/sun/crypto/provider/Cipher/AES/TestAESCiphers/TestAESWithDefaultProvider.java new file mode 100644 index 00000000000..132e79d9a35 --- /dev/null +++ b/jdk/test/com/sun/crypto/provider/Cipher/AES/TestAESCiphers/TestAESWithDefaultProvider.java @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * 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 8044193 + * @summary Test AES ciphers with different modes and padding schemes with + * default provider + */ + +public class TestAESWithDefaultProvider extends Dynamic { + public static void main(String argv[]) throws Exception { + new TestAESWithDefaultProvider().run(argv); + } +} diff --git a/jdk/test/com/sun/crypto/provider/Cipher/AES/TestAESCiphers/TestAESWithProviderChange.java b/jdk/test/com/sun/crypto/provider/Cipher/AES/TestAESCiphers/TestAESWithProviderChange.java new file mode 100644 index 00000000000..8dec9f136a4 --- /dev/null +++ b/jdk/test/com/sun/crypto/provider/Cipher/AES/TestAESCiphers/TestAESWithProviderChange.java @@ -0,0 +1,39 @@ +/* Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.security.Security; + +/* + * @test + * @bug 8044193 + * @summary Test AES ciphers with different modes and padding schemes after + * remove then add provider. + * @run main/othervm/policy=testAES.policy TestAESWithProviderChange + */ + +public class TestAESWithProviderChange extends Dynamic { + public static void main(String argv[]) throws Exception { + Security.removeProvider(SUNJCE); + Security.addProvider(new com.sun.crypto.provider.SunJCE()); + new TestAESWithProviderChange().run(argv); + } +} diff --git a/jdk/test/com/sun/crypto/provider/Cipher/AES/TestAESCiphers/TestAESWithRemoveAddProvider.java b/jdk/test/com/sun/crypto/provider/Cipher/AES/TestAESCiphers/TestAESWithRemoveAddProvider.java new file mode 100644 index 00000000000..81761a7ea4b --- /dev/null +++ b/jdk/test/com/sun/crypto/provider/Cipher/AES/TestAESCiphers/TestAESWithRemoveAddProvider.java @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.security.*; +import java.security.Provider; + +/* + * @test + * @bug 8044193 + * @summary Test AES ciphers with different modes and padding schemes after + * remove default provider then add it back. + * @run main/othervm/policy=testAES.policy TestAESWithRemoveAddProvider + */ + +public class TestAESWithRemoveAddProvider extends Dynamic { + public static void main(String argv[]) throws Exception { + Provider pJCE = Security.getProvider(SUNJCE); + Security.removeProvider(SUNJCE); + Security.addProvider(pJCE); + new TestAESWithRemoveAddProvider().run(argv); + } +} diff --git a/jdk/test/com/sun/crypto/provider/Cipher/AES/TestAESCiphers/testAES.policy b/jdk/test/com/sun/crypto/provider/Cipher/AES/TestAESCiphers/testAES.policy new file mode 100644 index 00000000000..a138a577ff7 --- /dev/null +++ b/jdk/test/com/sun/crypto/provider/Cipher/AES/TestAESCiphers/testAES.policy @@ -0,0 +1,6 @@ +grant +{ + permission java.security.SecurityPermission "removeProvider.SunJCE"; + permission java.security.SecurityPermission "insertProvider.SunJCE"; + permission java.security.SecurityPermission "putProviderProperty.SunJCE"; +}; From b035ca734821fa7874c9f6167183bb3e48f50109 Mon Sep 17 00:00:00 2001 From: Ivan Gerasimov Date: Fri, 6 Mar 2015 13:30:49 +0300 Subject: [PATCH 03/76] 8073692: (cs) Inconsistent docs for CharsetDecoder.replaceWith and CharsetEncoder.replaceWith Reviewed-by: martin --- .../java/nio/charset/Charset-X-Coder.java.template | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/jdk/src/java.base/share/classes/java/nio/charset/Charset-X-Coder.java.template b/jdk/src/java.base/share/classes/java/nio/charset/Charset-X-Coder.java.template index f5e50a51c85..faa51bb45d4 100644 --- a/jdk/src/java.base/share/classes/java/nio/charset/Charset-X-Coder.java.template +++ b/jdk/src/java.base/share/classes/java/nio/charset/Charset-X-Coder.java.template @@ -266,16 +266,15 @@ public abstract class Charset$Coder$ { * method, passing the new replacement, after checking that the new * replacement is acceptable.

* - * @param newReplacement The replacement value - * + * @param newReplacement The new replacement; must not be + * null, must have non-zero length, #if[decoder] - * The new replacement; must not be null - * and must have non-zero length + * and must not be longer than the value returned by the + * {@link #max$ItypesPerOtype$() max$ItypesPerOtype$} method #end[decoder] #if[encoder] - * The new replacement; must not be null, must have - * non-zero length, must not be longer than the value returned by - * the {@link #max$ItypesPerOtype$() max$ItypesPerOtype$} method, and + * must not be longer than the value returned by the + * {@link #max$ItypesPerOtype$() max$ItypesPerOtype$} method, and * must be {@link #isLegalReplacement legal} #end[encoder] * From 2ae75ccaa18a95b6bc852f67303883cb5de53e55 Mon Sep 17 00:00:00 2001 From: Mandy Chung Date: Fri, 6 Mar 2015 09:02:26 -0800 Subject: [PATCH 04/76] 8074428: Move pack200, unpack200, libpack200 to jdk.pack200 Reviewed-by: alanb, weijun, erikj, ihse --- ...{Launcher-jdk.runtime.gmk => Launcher-jdk.pack200.gmk} | 8 ++++---- jdk/make/lib/{Lib-jdk.runtime.gmk => Lib-jdk.pack200.gmk} | 6 +++--- .../share/native/common-unpack/bands.cpp | 0 .../share/native/common-unpack/bands.h | 0 .../share/native/common-unpack/bytes.cpp | 0 .../share/native/common-unpack/bytes.h | 0 .../share/native/common-unpack/coding.cpp | 0 .../share/native/common-unpack/coding.h | 0 .../share/native/common-unpack/constants.h | 0 .../share/native/common-unpack/defines.h | 0 .../share/native/common-unpack/unpack.cpp | 0 .../share/native/common-unpack/unpack.h | 0 .../share/native/common-unpack/utils.cpp | 0 .../share/native/common-unpack/utils.h | 0 .../share/native/common-unpack/zip.cpp | 0 .../share/native/common-unpack/zip.h | 0 .../share/native/libunpack/jni.cpp | 0 .../share/native/unpack200/main.cpp | 0 .../windows/native/unpack200/unpack200_proto.exe.manifest | 0 19 files changed, 7 insertions(+), 7 deletions(-) rename jdk/make/launcher/{Launcher-jdk.runtime.gmk => Launcher-jdk.pack200.gmk} (94%) rename jdk/make/lib/{Lib-jdk.runtime.gmk => Lib-jdk.pack200.gmk} (92%) rename jdk/src/{jdk.runtime => jdk.pack200}/share/native/common-unpack/bands.cpp (100%) rename jdk/src/{jdk.runtime => jdk.pack200}/share/native/common-unpack/bands.h (100%) rename jdk/src/{jdk.runtime => jdk.pack200}/share/native/common-unpack/bytes.cpp (100%) rename jdk/src/{jdk.runtime => jdk.pack200}/share/native/common-unpack/bytes.h (100%) rename jdk/src/{jdk.runtime => jdk.pack200}/share/native/common-unpack/coding.cpp (100%) rename jdk/src/{jdk.runtime => jdk.pack200}/share/native/common-unpack/coding.h (100%) rename jdk/src/{jdk.runtime => jdk.pack200}/share/native/common-unpack/constants.h (100%) rename jdk/src/{jdk.runtime => jdk.pack200}/share/native/common-unpack/defines.h (100%) rename jdk/src/{jdk.runtime => jdk.pack200}/share/native/common-unpack/unpack.cpp (100%) rename jdk/src/{jdk.runtime => jdk.pack200}/share/native/common-unpack/unpack.h (100%) rename jdk/src/{jdk.runtime => jdk.pack200}/share/native/common-unpack/utils.cpp (100%) rename jdk/src/{jdk.runtime => jdk.pack200}/share/native/common-unpack/utils.h (100%) rename jdk/src/{jdk.runtime => jdk.pack200}/share/native/common-unpack/zip.cpp (100%) rename jdk/src/{jdk.runtime => jdk.pack200}/share/native/common-unpack/zip.h (100%) rename jdk/src/{jdk.runtime => jdk.pack200}/share/native/libunpack/jni.cpp (100%) rename jdk/src/{jdk.runtime => jdk.pack200}/share/native/unpack200/main.cpp (100%) rename jdk/src/{jdk.runtime => jdk.pack200}/windows/native/unpack200/unpack200_proto.exe.manifest (100%) diff --git a/jdk/make/launcher/Launcher-jdk.runtime.gmk b/jdk/make/launcher/Launcher-jdk.pack200.gmk similarity index 94% rename from jdk/make/launcher/Launcher-jdk.runtime.gmk rename to jdk/make/launcher/Launcher-jdk.pack200.gmk index 366dc5cc9a2..1e6c21820cb 100644 --- a/jdk/make/launcher/Launcher-jdk.runtime.gmk +++ b/jdk/make/launcher/Launcher-jdk.pack200.gmk @@ -32,9 +32,9 @@ $(eval $(call SetupLauncher,pack200, \ # The order of the object files on the link command line affects the size of the resulting # binary (at least on linux) which causes the size to differ between old and new build. -UNPACKEXE_SRC := $(JDK_TOPDIR)/src/jdk.runtime/share/native/common-unpack \ - $(JDK_TOPDIR)/src/jdk.runtime/share/native/unpack200 -UNPACKEXE_CFLAGS := -I$(JDK_TOPDIR)/src/jdk.runtime/share/native/common-unpack \ +UNPACKEXE_SRC := $(JDK_TOPDIR)/src/jdk.pack200/share/native/common-unpack \ + $(JDK_TOPDIR)/src/jdk.pack200/share/native/unpack200 +UNPACKEXE_CFLAGS := -I$(JDK_TOPDIR)/src/jdk.pack200/share/native/common-unpack \ -I$(JDK_TOPDIR)/src/java.base/share/native/libjava \ -I$(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/libjava @@ -96,7 +96,7 @@ $(eval $(call SetupNativeCompilation,BUILD_UNPACKEXE, \ -D "JDK_INTERNAL_NAME=unpack200" \ -D "JDK_FTYPE=0x1L", \ DEBUG_SYMBOLS := true, \ - MANIFEST := $(JDK_TOPDIR)/src/jdk.runtime/windows/native/unpack200/unpack200_proto.exe.manifest)) + MANIFEST := $(JDK_TOPDIR)/src/jdk.pack200/windows/native/unpack200/unpack200_proto.exe.manifest)) ifneq ($(USE_EXTERNAL_LIBZ), true) diff --git a/jdk/make/lib/Lib-jdk.runtime.gmk b/jdk/make/lib/Lib-jdk.pack200.gmk similarity index 92% rename from jdk/make/lib/Lib-jdk.runtime.gmk rename to jdk/make/lib/Lib-jdk.pack200.gmk index 4bf9b026cc1..eb8caa61485 100644 --- a/jdk/make/lib/Lib-jdk.runtime.gmk +++ b/jdk/make/lib/Lib-jdk.pack200.gmk @@ -30,14 +30,14 @@ include LibCommon.gmk $(eval $(call SetupNativeCompilation,BUILD_LIBUNPACK, \ LIBRARY := unpack, \ OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \ - SRC := $(JDK_TOPDIR)/src/jdk.runtime/share/native/libunpack \ - $(JDK_TOPDIR)/src/jdk.runtime/share/native/common-unpack, \ + SRC := $(JDK_TOPDIR)/src/jdk.pack200/share/native/libunpack \ + $(JDK_TOPDIR)/src/jdk.pack200/share/native/common-unpack, \ LANG := C++, \ OPTIMIZATION := LOW, \ CFLAGS := $(CXXFLAGS_JDKLIB) \ -DNO_ZLIB -DUNPACK_JNI -DFULL \ -I$(SUPPORT_OUTPUTDIR)/headers/java.base \ - -I$(JDK_TOPDIR)/src/jdk.runtime/share/native/common-unpack \ + -I$(JDK_TOPDIR)/src/jdk.pack200/share/native/common-unpack \ $(LIBJAVA_HEADER_FLAGS), \ CFLAGS_release := -DPRODUCT, \ MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libunpack/mapfile-vers, \ diff --git a/jdk/src/jdk.runtime/share/native/common-unpack/bands.cpp b/jdk/src/jdk.pack200/share/native/common-unpack/bands.cpp similarity index 100% rename from jdk/src/jdk.runtime/share/native/common-unpack/bands.cpp rename to jdk/src/jdk.pack200/share/native/common-unpack/bands.cpp diff --git a/jdk/src/jdk.runtime/share/native/common-unpack/bands.h b/jdk/src/jdk.pack200/share/native/common-unpack/bands.h similarity index 100% rename from jdk/src/jdk.runtime/share/native/common-unpack/bands.h rename to jdk/src/jdk.pack200/share/native/common-unpack/bands.h diff --git a/jdk/src/jdk.runtime/share/native/common-unpack/bytes.cpp b/jdk/src/jdk.pack200/share/native/common-unpack/bytes.cpp similarity index 100% rename from jdk/src/jdk.runtime/share/native/common-unpack/bytes.cpp rename to jdk/src/jdk.pack200/share/native/common-unpack/bytes.cpp diff --git a/jdk/src/jdk.runtime/share/native/common-unpack/bytes.h b/jdk/src/jdk.pack200/share/native/common-unpack/bytes.h similarity index 100% rename from jdk/src/jdk.runtime/share/native/common-unpack/bytes.h rename to jdk/src/jdk.pack200/share/native/common-unpack/bytes.h diff --git a/jdk/src/jdk.runtime/share/native/common-unpack/coding.cpp b/jdk/src/jdk.pack200/share/native/common-unpack/coding.cpp similarity index 100% rename from jdk/src/jdk.runtime/share/native/common-unpack/coding.cpp rename to jdk/src/jdk.pack200/share/native/common-unpack/coding.cpp diff --git a/jdk/src/jdk.runtime/share/native/common-unpack/coding.h b/jdk/src/jdk.pack200/share/native/common-unpack/coding.h similarity index 100% rename from jdk/src/jdk.runtime/share/native/common-unpack/coding.h rename to jdk/src/jdk.pack200/share/native/common-unpack/coding.h diff --git a/jdk/src/jdk.runtime/share/native/common-unpack/constants.h b/jdk/src/jdk.pack200/share/native/common-unpack/constants.h similarity index 100% rename from jdk/src/jdk.runtime/share/native/common-unpack/constants.h rename to jdk/src/jdk.pack200/share/native/common-unpack/constants.h diff --git a/jdk/src/jdk.runtime/share/native/common-unpack/defines.h b/jdk/src/jdk.pack200/share/native/common-unpack/defines.h similarity index 100% rename from jdk/src/jdk.runtime/share/native/common-unpack/defines.h rename to jdk/src/jdk.pack200/share/native/common-unpack/defines.h diff --git a/jdk/src/jdk.runtime/share/native/common-unpack/unpack.cpp b/jdk/src/jdk.pack200/share/native/common-unpack/unpack.cpp similarity index 100% rename from jdk/src/jdk.runtime/share/native/common-unpack/unpack.cpp rename to jdk/src/jdk.pack200/share/native/common-unpack/unpack.cpp diff --git a/jdk/src/jdk.runtime/share/native/common-unpack/unpack.h b/jdk/src/jdk.pack200/share/native/common-unpack/unpack.h similarity index 100% rename from jdk/src/jdk.runtime/share/native/common-unpack/unpack.h rename to jdk/src/jdk.pack200/share/native/common-unpack/unpack.h diff --git a/jdk/src/jdk.runtime/share/native/common-unpack/utils.cpp b/jdk/src/jdk.pack200/share/native/common-unpack/utils.cpp similarity index 100% rename from jdk/src/jdk.runtime/share/native/common-unpack/utils.cpp rename to jdk/src/jdk.pack200/share/native/common-unpack/utils.cpp diff --git a/jdk/src/jdk.runtime/share/native/common-unpack/utils.h b/jdk/src/jdk.pack200/share/native/common-unpack/utils.h similarity index 100% rename from jdk/src/jdk.runtime/share/native/common-unpack/utils.h rename to jdk/src/jdk.pack200/share/native/common-unpack/utils.h diff --git a/jdk/src/jdk.runtime/share/native/common-unpack/zip.cpp b/jdk/src/jdk.pack200/share/native/common-unpack/zip.cpp similarity index 100% rename from jdk/src/jdk.runtime/share/native/common-unpack/zip.cpp rename to jdk/src/jdk.pack200/share/native/common-unpack/zip.cpp diff --git a/jdk/src/jdk.runtime/share/native/common-unpack/zip.h b/jdk/src/jdk.pack200/share/native/common-unpack/zip.h similarity index 100% rename from jdk/src/jdk.runtime/share/native/common-unpack/zip.h rename to jdk/src/jdk.pack200/share/native/common-unpack/zip.h diff --git a/jdk/src/jdk.runtime/share/native/libunpack/jni.cpp b/jdk/src/jdk.pack200/share/native/libunpack/jni.cpp similarity index 100% rename from jdk/src/jdk.runtime/share/native/libunpack/jni.cpp rename to jdk/src/jdk.pack200/share/native/libunpack/jni.cpp diff --git a/jdk/src/jdk.runtime/share/native/unpack200/main.cpp b/jdk/src/jdk.pack200/share/native/unpack200/main.cpp similarity index 100% rename from jdk/src/jdk.runtime/share/native/unpack200/main.cpp rename to jdk/src/jdk.pack200/share/native/unpack200/main.cpp diff --git a/jdk/src/jdk.runtime/windows/native/unpack200/unpack200_proto.exe.manifest b/jdk/src/jdk.pack200/windows/native/unpack200/unpack200_proto.exe.manifest similarity index 100% rename from jdk/src/jdk.runtime/windows/native/unpack200/unpack200_proto.exe.manifest rename to jdk/src/jdk.pack200/windows/native/unpack200/unpack200_proto.exe.manifest From 014ea775ad18948b40233f978b1d565971ec9199 Mon Sep 17 00:00:00 2001 From: Mandy Chung Date: Fri, 6 Mar 2015 09:07:32 -0800 Subject: [PATCH 05/76] 8074429: Move jar, jarsigner tool to jdk.jartool module Reviewed-by: alanb, weijun, erikj, ihse --- jdk/make/gensrc/Gensrc-jdk.jartool.gmk | 44 +++++++++++++++++++ jdk/make/launcher/Launcher-jdk.dev.gmk | 6 --- jdk/make/launcher/Launcher-jdk.jartool.gmk | 32 ++++++++++++++ .../com/sun/jarsigner/ContentSigner.java | 0 .../jarsigner/ContentSignerParameters.java | 0 .../com/sun/jarsigner/package-info.java | 0 .../sun/security/tools/jarsigner/Main.java | 0 .../security/tools/jarsigner/Resources.java | 0 .../tools/jarsigner/Resources_ja.java | 0 .../tools/jarsigner/Resources_zh_CN.java | 0 .../tools/jarsigner/TimestampedSigner.java | 0 .../classes/sun/tools/jar/CommandLine.java | 0 .../classes/sun/tools/jar/JarException.java | 0 .../share/classes/sun/tools/jar/Main.java | 0 .../share/classes/sun/tools/jar/Manifest.java | 0 .../classes/sun/tools/jar/SignatureFile.java | 0 .../sun/tools/jar/resources/jar.properties | 0 .../sun/tools/jar/resources/jar_de.properties | 0 .../sun/tools/jar/resources/jar_es.properties | 0 .../sun/tools/jar/resources/jar_fr.properties | 0 .../sun/tools/jar/resources/jar_it.properties | 0 .../sun/tools/jar/resources/jar_ja.properties | 0 .../sun/tools/jar/resources/jar_ko.properties | 0 .../tools/jar/resources/jar_pt_BR.properties | 0 .../sun/tools/jar/resources/jar_sv.properties | 0 .../tools/jar/resources/jar_zh_CN.properties | 0 .../tools/jar/resources/jar_zh_TW.properties | 0 27 files changed, 76 insertions(+), 6 deletions(-) create mode 100644 jdk/make/gensrc/Gensrc-jdk.jartool.gmk create mode 100644 jdk/make/launcher/Launcher-jdk.jartool.gmk rename jdk/src/{jdk.dev => jdk.jartool}/share/classes/com/sun/jarsigner/ContentSigner.java (100%) rename jdk/src/{jdk.dev => jdk.jartool}/share/classes/com/sun/jarsigner/ContentSignerParameters.java (100%) rename jdk/src/{jdk.dev => jdk.jartool}/share/classes/com/sun/jarsigner/package-info.java (100%) rename jdk/src/{jdk.dev => jdk.jartool}/share/classes/sun/security/tools/jarsigner/Main.java (100%) rename jdk/src/{jdk.dev => jdk.jartool}/share/classes/sun/security/tools/jarsigner/Resources.java (100%) rename jdk/src/{jdk.dev => jdk.jartool}/share/classes/sun/security/tools/jarsigner/Resources_ja.java (100%) rename jdk/src/{jdk.dev => jdk.jartool}/share/classes/sun/security/tools/jarsigner/Resources_zh_CN.java (100%) rename jdk/src/{jdk.dev => jdk.jartool}/share/classes/sun/security/tools/jarsigner/TimestampedSigner.java (100%) rename jdk/src/{jdk.dev => jdk.jartool}/share/classes/sun/tools/jar/CommandLine.java (100%) rename jdk/src/{jdk.dev => jdk.jartool}/share/classes/sun/tools/jar/JarException.java (100%) rename jdk/src/{jdk.dev => jdk.jartool}/share/classes/sun/tools/jar/Main.java (100%) rename jdk/src/{jdk.dev => jdk.jartool}/share/classes/sun/tools/jar/Manifest.java (100%) rename jdk/src/{jdk.dev => jdk.jartool}/share/classes/sun/tools/jar/SignatureFile.java (100%) rename jdk/src/{jdk.dev => jdk.jartool}/share/classes/sun/tools/jar/resources/jar.properties (100%) rename jdk/src/{jdk.dev => jdk.jartool}/share/classes/sun/tools/jar/resources/jar_de.properties (100%) rename jdk/src/{jdk.dev => jdk.jartool}/share/classes/sun/tools/jar/resources/jar_es.properties (100%) rename jdk/src/{jdk.dev => jdk.jartool}/share/classes/sun/tools/jar/resources/jar_fr.properties (100%) rename jdk/src/{jdk.dev => jdk.jartool}/share/classes/sun/tools/jar/resources/jar_it.properties (100%) rename jdk/src/{jdk.dev => jdk.jartool}/share/classes/sun/tools/jar/resources/jar_ja.properties (100%) rename jdk/src/{jdk.dev => jdk.jartool}/share/classes/sun/tools/jar/resources/jar_ko.properties (100%) rename jdk/src/{jdk.dev => jdk.jartool}/share/classes/sun/tools/jar/resources/jar_pt_BR.properties (100%) rename jdk/src/{jdk.dev => jdk.jartool}/share/classes/sun/tools/jar/resources/jar_sv.properties (100%) rename jdk/src/{jdk.dev => jdk.jartool}/share/classes/sun/tools/jar/resources/jar_zh_CN.properties (100%) rename jdk/src/{jdk.dev => jdk.jartool}/share/classes/sun/tools/jar/resources/jar_zh_TW.properties (100%) diff --git a/jdk/make/gensrc/Gensrc-jdk.jartool.gmk b/jdk/make/gensrc/Gensrc-jdk.jartool.gmk new file mode 100644 index 00000000000..0fb8eabc621 --- /dev/null +++ b/jdk/make/gensrc/Gensrc-jdk.jartool.gmk @@ -0,0 +1,44 @@ +# +# Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + +include GensrcCommon.gmk + +################################################################################ + +include GensrcProperties.gmk + +$(eval $(call SetupCompileProperties,COMPILE_PROPERTIES, \ + $(filter %.properties, \ + $(call CacheFind, \ + $(JDK_TOPDIR)/src/jdk.jartool/share/classes/sun/tools/jar/resources)), \ + ListResourceBundle)) + +TARGETS += $(COMPILE_PROPERTIES) + +################################################################################ + +all: $(TARGETS) + +.PHONY: all diff --git a/jdk/make/launcher/Launcher-jdk.dev.gmk b/jdk/make/launcher/Launcher-jdk.dev.gmk index 92b6d1bacb9..9dbe8a53b04 100644 --- a/jdk/make/launcher/Launcher-jdk.dev.gmk +++ b/jdk/make/launcher/Launcher-jdk.dev.gmk @@ -25,12 +25,6 @@ include LauncherCommon.gmk -$(eval $(call SetupLauncher,jar, \ - -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.tools.jar.Main"$(COMMA) }')) - -$(eval $(call SetupLauncher,jarsigner, \ - -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.security.tools.jarsigner.Main"$(COMMA) }')) - ifndef BUILD_HEADLESS_ONLY $(eval $(call SetupLauncher,policytool, \ -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.security.tools.policytool.PolicyTool"$(COMMA) }',, \ diff --git a/jdk/make/launcher/Launcher-jdk.jartool.gmk b/jdk/make/launcher/Launcher-jdk.jartool.gmk new file mode 100644 index 00000000000..b6d44e315ff --- /dev/null +++ b/jdk/make/launcher/Launcher-jdk.jartool.gmk @@ -0,0 +1,32 @@ +# +# Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + +include LauncherCommon.gmk + +$(eval $(call SetupLauncher,jar, \ + -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.tools.jar.Main"$(COMMA) }')) + +$(eval $(call SetupLauncher,jarsigner, \ + -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.security.tools.jarsigner.Main"$(COMMA) }')) diff --git a/jdk/src/jdk.dev/share/classes/com/sun/jarsigner/ContentSigner.java b/jdk/src/jdk.jartool/share/classes/com/sun/jarsigner/ContentSigner.java similarity index 100% rename from jdk/src/jdk.dev/share/classes/com/sun/jarsigner/ContentSigner.java rename to jdk/src/jdk.jartool/share/classes/com/sun/jarsigner/ContentSigner.java diff --git a/jdk/src/jdk.dev/share/classes/com/sun/jarsigner/ContentSignerParameters.java b/jdk/src/jdk.jartool/share/classes/com/sun/jarsigner/ContentSignerParameters.java similarity index 100% rename from jdk/src/jdk.dev/share/classes/com/sun/jarsigner/ContentSignerParameters.java rename to jdk/src/jdk.jartool/share/classes/com/sun/jarsigner/ContentSignerParameters.java diff --git a/jdk/src/jdk.dev/share/classes/com/sun/jarsigner/package-info.java b/jdk/src/jdk.jartool/share/classes/com/sun/jarsigner/package-info.java similarity index 100% rename from jdk/src/jdk.dev/share/classes/com/sun/jarsigner/package-info.java rename to jdk/src/jdk.jartool/share/classes/com/sun/jarsigner/package-info.java diff --git a/jdk/src/jdk.dev/share/classes/sun/security/tools/jarsigner/Main.java b/jdk/src/jdk.jartool/share/classes/sun/security/tools/jarsigner/Main.java similarity index 100% rename from jdk/src/jdk.dev/share/classes/sun/security/tools/jarsigner/Main.java rename to jdk/src/jdk.jartool/share/classes/sun/security/tools/jarsigner/Main.java diff --git a/jdk/src/jdk.dev/share/classes/sun/security/tools/jarsigner/Resources.java b/jdk/src/jdk.jartool/share/classes/sun/security/tools/jarsigner/Resources.java similarity index 100% rename from jdk/src/jdk.dev/share/classes/sun/security/tools/jarsigner/Resources.java rename to jdk/src/jdk.jartool/share/classes/sun/security/tools/jarsigner/Resources.java diff --git a/jdk/src/jdk.dev/share/classes/sun/security/tools/jarsigner/Resources_ja.java b/jdk/src/jdk.jartool/share/classes/sun/security/tools/jarsigner/Resources_ja.java similarity index 100% rename from jdk/src/jdk.dev/share/classes/sun/security/tools/jarsigner/Resources_ja.java rename to jdk/src/jdk.jartool/share/classes/sun/security/tools/jarsigner/Resources_ja.java diff --git a/jdk/src/jdk.dev/share/classes/sun/security/tools/jarsigner/Resources_zh_CN.java b/jdk/src/jdk.jartool/share/classes/sun/security/tools/jarsigner/Resources_zh_CN.java similarity index 100% rename from jdk/src/jdk.dev/share/classes/sun/security/tools/jarsigner/Resources_zh_CN.java rename to jdk/src/jdk.jartool/share/classes/sun/security/tools/jarsigner/Resources_zh_CN.java diff --git a/jdk/src/jdk.dev/share/classes/sun/security/tools/jarsigner/TimestampedSigner.java b/jdk/src/jdk.jartool/share/classes/sun/security/tools/jarsigner/TimestampedSigner.java similarity index 100% rename from jdk/src/jdk.dev/share/classes/sun/security/tools/jarsigner/TimestampedSigner.java rename to jdk/src/jdk.jartool/share/classes/sun/security/tools/jarsigner/TimestampedSigner.java diff --git a/jdk/src/jdk.dev/share/classes/sun/tools/jar/CommandLine.java b/jdk/src/jdk.jartool/share/classes/sun/tools/jar/CommandLine.java similarity index 100% rename from jdk/src/jdk.dev/share/classes/sun/tools/jar/CommandLine.java rename to jdk/src/jdk.jartool/share/classes/sun/tools/jar/CommandLine.java diff --git a/jdk/src/jdk.dev/share/classes/sun/tools/jar/JarException.java b/jdk/src/jdk.jartool/share/classes/sun/tools/jar/JarException.java similarity index 100% rename from jdk/src/jdk.dev/share/classes/sun/tools/jar/JarException.java rename to jdk/src/jdk.jartool/share/classes/sun/tools/jar/JarException.java diff --git a/jdk/src/jdk.dev/share/classes/sun/tools/jar/Main.java b/jdk/src/jdk.jartool/share/classes/sun/tools/jar/Main.java similarity index 100% rename from jdk/src/jdk.dev/share/classes/sun/tools/jar/Main.java rename to jdk/src/jdk.jartool/share/classes/sun/tools/jar/Main.java diff --git a/jdk/src/jdk.dev/share/classes/sun/tools/jar/Manifest.java b/jdk/src/jdk.jartool/share/classes/sun/tools/jar/Manifest.java similarity index 100% rename from jdk/src/jdk.dev/share/classes/sun/tools/jar/Manifest.java rename to jdk/src/jdk.jartool/share/classes/sun/tools/jar/Manifest.java diff --git a/jdk/src/jdk.dev/share/classes/sun/tools/jar/SignatureFile.java b/jdk/src/jdk.jartool/share/classes/sun/tools/jar/SignatureFile.java similarity index 100% rename from jdk/src/jdk.dev/share/classes/sun/tools/jar/SignatureFile.java rename to jdk/src/jdk.jartool/share/classes/sun/tools/jar/SignatureFile.java diff --git a/jdk/src/jdk.dev/share/classes/sun/tools/jar/resources/jar.properties b/jdk/src/jdk.jartool/share/classes/sun/tools/jar/resources/jar.properties similarity index 100% rename from jdk/src/jdk.dev/share/classes/sun/tools/jar/resources/jar.properties rename to jdk/src/jdk.jartool/share/classes/sun/tools/jar/resources/jar.properties diff --git a/jdk/src/jdk.dev/share/classes/sun/tools/jar/resources/jar_de.properties b/jdk/src/jdk.jartool/share/classes/sun/tools/jar/resources/jar_de.properties similarity index 100% rename from jdk/src/jdk.dev/share/classes/sun/tools/jar/resources/jar_de.properties rename to jdk/src/jdk.jartool/share/classes/sun/tools/jar/resources/jar_de.properties diff --git a/jdk/src/jdk.dev/share/classes/sun/tools/jar/resources/jar_es.properties b/jdk/src/jdk.jartool/share/classes/sun/tools/jar/resources/jar_es.properties similarity index 100% rename from jdk/src/jdk.dev/share/classes/sun/tools/jar/resources/jar_es.properties rename to jdk/src/jdk.jartool/share/classes/sun/tools/jar/resources/jar_es.properties diff --git a/jdk/src/jdk.dev/share/classes/sun/tools/jar/resources/jar_fr.properties b/jdk/src/jdk.jartool/share/classes/sun/tools/jar/resources/jar_fr.properties similarity index 100% rename from jdk/src/jdk.dev/share/classes/sun/tools/jar/resources/jar_fr.properties rename to jdk/src/jdk.jartool/share/classes/sun/tools/jar/resources/jar_fr.properties diff --git a/jdk/src/jdk.dev/share/classes/sun/tools/jar/resources/jar_it.properties b/jdk/src/jdk.jartool/share/classes/sun/tools/jar/resources/jar_it.properties similarity index 100% rename from jdk/src/jdk.dev/share/classes/sun/tools/jar/resources/jar_it.properties rename to jdk/src/jdk.jartool/share/classes/sun/tools/jar/resources/jar_it.properties diff --git a/jdk/src/jdk.dev/share/classes/sun/tools/jar/resources/jar_ja.properties b/jdk/src/jdk.jartool/share/classes/sun/tools/jar/resources/jar_ja.properties similarity index 100% rename from jdk/src/jdk.dev/share/classes/sun/tools/jar/resources/jar_ja.properties rename to jdk/src/jdk.jartool/share/classes/sun/tools/jar/resources/jar_ja.properties diff --git a/jdk/src/jdk.dev/share/classes/sun/tools/jar/resources/jar_ko.properties b/jdk/src/jdk.jartool/share/classes/sun/tools/jar/resources/jar_ko.properties similarity index 100% rename from jdk/src/jdk.dev/share/classes/sun/tools/jar/resources/jar_ko.properties rename to jdk/src/jdk.jartool/share/classes/sun/tools/jar/resources/jar_ko.properties diff --git a/jdk/src/jdk.dev/share/classes/sun/tools/jar/resources/jar_pt_BR.properties b/jdk/src/jdk.jartool/share/classes/sun/tools/jar/resources/jar_pt_BR.properties similarity index 100% rename from jdk/src/jdk.dev/share/classes/sun/tools/jar/resources/jar_pt_BR.properties rename to jdk/src/jdk.jartool/share/classes/sun/tools/jar/resources/jar_pt_BR.properties diff --git a/jdk/src/jdk.dev/share/classes/sun/tools/jar/resources/jar_sv.properties b/jdk/src/jdk.jartool/share/classes/sun/tools/jar/resources/jar_sv.properties similarity index 100% rename from jdk/src/jdk.dev/share/classes/sun/tools/jar/resources/jar_sv.properties rename to jdk/src/jdk.jartool/share/classes/sun/tools/jar/resources/jar_sv.properties diff --git a/jdk/src/jdk.dev/share/classes/sun/tools/jar/resources/jar_zh_CN.properties b/jdk/src/jdk.jartool/share/classes/sun/tools/jar/resources/jar_zh_CN.properties similarity index 100% rename from jdk/src/jdk.dev/share/classes/sun/tools/jar/resources/jar_zh_CN.properties rename to jdk/src/jdk.jartool/share/classes/sun/tools/jar/resources/jar_zh_CN.properties diff --git a/jdk/src/jdk.dev/share/classes/sun/tools/jar/resources/jar_zh_TW.properties b/jdk/src/jdk.jartool/share/classes/sun/tools/jar/resources/jar_zh_TW.properties similarity index 100% rename from jdk/src/jdk.dev/share/classes/sun/tools/jar/resources/jar_zh_TW.properties rename to jdk/src/jdk.jartool/share/classes/sun/tools/jar/resources/jar_zh_TW.properties From a1ffcbec36f4fe98e10671cf54a4062050d9349c Mon Sep 17 00:00:00 2001 From: Mandy Chung Date: Fri, 6 Mar 2015 09:11:42 -0800 Subject: [PATCH 06/76] 8074430: Move policytool to jdk.policytool module Reviewed-by: alanb, weijun, erikj, ihse --- jdk/make/launcher/Launcher-jdk.dev.gmk | 6 ------ .../classes/sun/security/tools/policytool/PolicyTool.java | 0 .../classes/sun/security/tools/policytool/Resources.java | 0 .../classes/sun/security/tools/policytool/Resources_de.java | 0 .../classes/sun/security/tools/policytool/Resources_es.java | 0 .../classes/sun/security/tools/policytool/Resources_fr.java | 0 .../classes/sun/security/tools/policytool/Resources_it.java | 0 .../classes/sun/security/tools/policytool/Resources_ja.java | 0 .../classes/sun/security/tools/policytool/Resources_ko.java | 0 .../sun/security/tools/policytool/Resources_pt_BR.java | 0 .../classes/sun/security/tools/policytool/Resources_sv.java | 0 .../sun/security/tools/policytool/Resources_zh_CN.java | 0 .../sun/security/tools/policytool/Resources_zh_HK.java | 0 .../sun/security/tools/policytool/Resources_zh_TW.java | 0 14 files changed, 6 deletions(-) rename jdk/src/{jdk.dev => jdk.policytool}/share/classes/sun/security/tools/policytool/PolicyTool.java (100%) rename jdk/src/{jdk.dev => jdk.policytool}/share/classes/sun/security/tools/policytool/Resources.java (100%) rename jdk/src/{jdk.dev => jdk.policytool}/share/classes/sun/security/tools/policytool/Resources_de.java (100%) rename jdk/src/{jdk.dev => jdk.policytool}/share/classes/sun/security/tools/policytool/Resources_es.java (100%) rename jdk/src/{jdk.dev => jdk.policytool}/share/classes/sun/security/tools/policytool/Resources_fr.java (100%) rename jdk/src/{jdk.dev => jdk.policytool}/share/classes/sun/security/tools/policytool/Resources_it.java (100%) rename jdk/src/{jdk.dev => jdk.policytool}/share/classes/sun/security/tools/policytool/Resources_ja.java (100%) rename jdk/src/{jdk.dev => jdk.policytool}/share/classes/sun/security/tools/policytool/Resources_ko.java (100%) rename jdk/src/{jdk.dev => jdk.policytool}/share/classes/sun/security/tools/policytool/Resources_pt_BR.java (100%) rename jdk/src/{jdk.dev => jdk.policytool}/share/classes/sun/security/tools/policytool/Resources_sv.java (100%) rename jdk/src/{jdk.dev => jdk.policytool}/share/classes/sun/security/tools/policytool/Resources_zh_CN.java (100%) rename jdk/src/{jdk.dev => jdk.policytool}/share/classes/sun/security/tools/policytool/Resources_zh_HK.java (100%) rename jdk/src/{jdk.dev => jdk.policytool}/share/classes/sun/security/tools/policytool/Resources_zh_TW.java (100%) diff --git a/jdk/make/launcher/Launcher-jdk.dev.gmk b/jdk/make/launcher/Launcher-jdk.dev.gmk index 9dbe8a53b04..b58545e5418 100644 --- a/jdk/make/launcher/Launcher-jdk.dev.gmk +++ b/jdk/make/launcher/Launcher-jdk.dev.gmk @@ -25,12 +25,6 @@ include LauncherCommon.gmk -ifndef BUILD_HEADLESS_ONLY - $(eval $(call SetupLauncher,policytool, \ - -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.security.tools.policytool.PolicyTool"$(COMMA) }',, \ - $(XLIBS))) -endif - $(eval $(call SetupLauncher,jdeps, \ -DEXPAND_CLASSPATH_WILDCARDS \ -DNEVER_ACT_AS_SERVER_CLASS_MACHINE \ diff --git a/jdk/src/jdk.dev/share/classes/sun/security/tools/policytool/PolicyTool.java b/jdk/src/jdk.policytool/share/classes/sun/security/tools/policytool/PolicyTool.java similarity index 100% rename from jdk/src/jdk.dev/share/classes/sun/security/tools/policytool/PolicyTool.java rename to jdk/src/jdk.policytool/share/classes/sun/security/tools/policytool/PolicyTool.java diff --git a/jdk/src/jdk.dev/share/classes/sun/security/tools/policytool/Resources.java b/jdk/src/jdk.policytool/share/classes/sun/security/tools/policytool/Resources.java similarity index 100% rename from jdk/src/jdk.dev/share/classes/sun/security/tools/policytool/Resources.java rename to jdk/src/jdk.policytool/share/classes/sun/security/tools/policytool/Resources.java diff --git a/jdk/src/jdk.dev/share/classes/sun/security/tools/policytool/Resources_de.java b/jdk/src/jdk.policytool/share/classes/sun/security/tools/policytool/Resources_de.java similarity index 100% rename from jdk/src/jdk.dev/share/classes/sun/security/tools/policytool/Resources_de.java rename to jdk/src/jdk.policytool/share/classes/sun/security/tools/policytool/Resources_de.java diff --git a/jdk/src/jdk.dev/share/classes/sun/security/tools/policytool/Resources_es.java b/jdk/src/jdk.policytool/share/classes/sun/security/tools/policytool/Resources_es.java similarity index 100% rename from jdk/src/jdk.dev/share/classes/sun/security/tools/policytool/Resources_es.java rename to jdk/src/jdk.policytool/share/classes/sun/security/tools/policytool/Resources_es.java diff --git a/jdk/src/jdk.dev/share/classes/sun/security/tools/policytool/Resources_fr.java b/jdk/src/jdk.policytool/share/classes/sun/security/tools/policytool/Resources_fr.java similarity index 100% rename from jdk/src/jdk.dev/share/classes/sun/security/tools/policytool/Resources_fr.java rename to jdk/src/jdk.policytool/share/classes/sun/security/tools/policytool/Resources_fr.java diff --git a/jdk/src/jdk.dev/share/classes/sun/security/tools/policytool/Resources_it.java b/jdk/src/jdk.policytool/share/classes/sun/security/tools/policytool/Resources_it.java similarity index 100% rename from jdk/src/jdk.dev/share/classes/sun/security/tools/policytool/Resources_it.java rename to jdk/src/jdk.policytool/share/classes/sun/security/tools/policytool/Resources_it.java diff --git a/jdk/src/jdk.dev/share/classes/sun/security/tools/policytool/Resources_ja.java b/jdk/src/jdk.policytool/share/classes/sun/security/tools/policytool/Resources_ja.java similarity index 100% rename from jdk/src/jdk.dev/share/classes/sun/security/tools/policytool/Resources_ja.java rename to jdk/src/jdk.policytool/share/classes/sun/security/tools/policytool/Resources_ja.java diff --git a/jdk/src/jdk.dev/share/classes/sun/security/tools/policytool/Resources_ko.java b/jdk/src/jdk.policytool/share/classes/sun/security/tools/policytool/Resources_ko.java similarity index 100% rename from jdk/src/jdk.dev/share/classes/sun/security/tools/policytool/Resources_ko.java rename to jdk/src/jdk.policytool/share/classes/sun/security/tools/policytool/Resources_ko.java diff --git a/jdk/src/jdk.dev/share/classes/sun/security/tools/policytool/Resources_pt_BR.java b/jdk/src/jdk.policytool/share/classes/sun/security/tools/policytool/Resources_pt_BR.java similarity index 100% rename from jdk/src/jdk.dev/share/classes/sun/security/tools/policytool/Resources_pt_BR.java rename to jdk/src/jdk.policytool/share/classes/sun/security/tools/policytool/Resources_pt_BR.java diff --git a/jdk/src/jdk.dev/share/classes/sun/security/tools/policytool/Resources_sv.java b/jdk/src/jdk.policytool/share/classes/sun/security/tools/policytool/Resources_sv.java similarity index 100% rename from jdk/src/jdk.dev/share/classes/sun/security/tools/policytool/Resources_sv.java rename to jdk/src/jdk.policytool/share/classes/sun/security/tools/policytool/Resources_sv.java diff --git a/jdk/src/jdk.dev/share/classes/sun/security/tools/policytool/Resources_zh_CN.java b/jdk/src/jdk.policytool/share/classes/sun/security/tools/policytool/Resources_zh_CN.java similarity index 100% rename from jdk/src/jdk.dev/share/classes/sun/security/tools/policytool/Resources_zh_CN.java rename to jdk/src/jdk.policytool/share/classes/sun/security/tools/policytool/Resources_zh_CN.java diff --git a/jdk/src/jdk.dev/share/classes/sun/security/tools/policytool/Resources_zh_HK.java b/jdk/src/jdk.policytool/share/classes/sun/security/tools/policytool/Resources_zh_HK.java similarity index 100% rename from jdk/src/jdk.dev/share/classes/sun/security/tools/policytool/Resources_zh_HK.java rename to jdk/src/jdk.policytool/share/classes/sun/security/tools/policytool/Resources_zh_HK.java diff --git a/jdk/src/jdk.dev/share/classes/sun/security/tools/policytool/Resources_zh_TW.java b/jdk/src/jdk.policytool/share/classes/sun/security/tools/policytool/Resources_zh_TW.java similarity index 100% rename from jdk/src/jdk.dev/share/classes/sun/security/tools/policytool/Resources_zh_TW.java rename to jdk/src/jdk.policytool/share/classes/sun/security/tools/policytool/Resources_zh_TW.java From f9a9e68c05a9b72e907e70e81059fd9f89089c72 Mon Sep 17 00:00:00 2001 From: Brian Burkhalter Date: Fri, 6 Mar 2015 16:00:58 -0800 Subject: [PATCH 07/76] 8074460: Always print seeds used in [Splittable]Random instances in java.math tests Create a utility class which creates a pseudorandom number generator (PRNG) and retains the seed. Use this class in java.math tests which use a PRNG. Always print the seed value before the PRNG is used. Reviewed-by: darcy --- .../math/BigDecimal/StringConstructor.java | 22 ++--- .../java/math/BigInteger/BigIntegerTest.java | 96 ++++++++++--------- .../java/math/BigInteger/ModPow65537.java | 12 ++- jdk/test/java/math/BigInteger/PrimeTest.java | 12 ++- .../math/BigInteger/SymmetricRangeTests.java | 13 +-- jdk/test/java/math/RandomSeed.java | 81 ++++++++++++++++ 6 files changed, 162 insertions(+), 74 deletions(-) create mode 100644 jdk/test/java/math/RandomSeed.java diff --git a/jdk/test/java/math/BigDecimal/StringConstructor.java b/jdk/test/java/math/BigDecimal/StringConstructor.java index 992eb9dc1b8..c8051eb98a5 100644 --- a/jdk/test/java/math/BigDecimal/StringConstructor.java +++ b/jdk/test/java/math/BigDecimal/StringConstructor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,19 +23,20 @@ /* * @test - * @bug 4103117 4331084 4488017 4490929 6255285 6268365 - * @summary Tests the BigDecimal string constructor. + * @library .. + * @bug 4103117 4331084 4488017 4490929 6255285 6268365 8074460 + * @summary Tests the BigDecimal string constructor (use -Dseed=X to set PRNG seed). */ import java.math.*; -import java.util.Random; public class StringConstructor { - private static int seed = new Random().nextInt(); - private static Random rnd = new Random(seed); + private static RandomSeed rndSeed = new RandomSeed(false); public static void main(String[] args) throws Exception { + System.out.println("Random number generator seed = " + rndSeed.getSeed()); + constructWithError(""); constructWithError("+"); constructWithError("-"); @@ -71,19 +72,18 @@ public class StringConstructor { // Roundtrip tests for (int i=0; i<100; i++) { - int size = rnd.nextInt(100) + 1; - BigInteger bi = new BigInteger(size, rnd); - if (rnd.nextBoolean()) + int size = rndSeed.getRandom().nextInt(100) + 1; + BigInteger bi = new BigInteger(size, rndSeed.getRandom()); + if (rndSeed.getRandom().nextBoolean()) bi = bi.negate(); int decimalLength = bi.toString().length(); - int scale = rnd.nextInt(decimalLength); + int scale = rndSeed.getRandom().nextInt(decimalLength); BigDecimal bd = new BigDecimal(bi, scale); String bdString = bd.toString(); // System.err.println("bi" + bi.toString() + "\tscale " + scale); // System.err.println("bd string: " + bdString); BigDecimal bdDoppel = new BigDecimal(bdString); if (!bd.equals(bdDoppel)) { - System.err.println("Random number seed = " + seed); System.err.println("bd string: scale: " + bd.scale() + "\t" + bdString); System.err.println("bd doppel: scale: " + bdDoppel.scale() + diff --git a/jdk/test/java/math/BigInteger/BigIntegerTest.java b/jdk/test/java/math/BigInteger/BigIntegerTest.java index 4de80fad4fd..e1b36c0812b 100644 --- a/jdk/test/java/math/BigInteger/BigIntegerTest.java +++ b/jdk/test/java/math/BigInteger/BigIntegerTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,8 +23,9 @@ /* * @test - * @bug 4181191 4161971 4227146 4194389 4823171 4624738 4812225 4837946 4026465 - * @summary tests methods in BigInteger + * @library .. + * @bug 4181191 4161971 4227146 4194389 4823171 4624738 4812225 4837946 4026465 8074460 + * @summary tests methods in BigInteger (use -Dseed=X to set PRNG seed) * @run main/timeout=400 BigIntegerTest * @author madbot */ @@ -35,7 +36,6 @@ import java.io.FileOutputStream; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.math.BigInteger; -import java.util.Random; /** * This is a simple test class created to ensure that the results @@ -86,7 +86,8 @@ public class BigIntegerTest { static final int SIZE = 1000; // numbers per batch - static Random rnd = new Random(); + private static RandomSeed rndSeed = new RandomSeed(false); + static boolean failure = false; public static void constructor() { @@ -97,7 +98,7 @@ public class BigIntegerTest { int arrayLength = 23; int halfLength = arrayLength/2; byte[] array = new byte[arrayLength]; - rnd.nextBytes(array); + rndSeed.getRandom().nextBytes(array); int[][] offLen = new int[][] { // offset, length, num exceptions {-1, arrayLength, 1}, // negative offset @@ -161,7 +162,7 @@ public class BigIntegerTest { } byte[] magNonZeroLength = new byte[42]; - rnd.nextBytes(magNonZeroLength); + rndSeed.getRandom().nextBytes(magNonZeroLength); for (int signum = -1; signum <= 1; signum++) { BigInteger bi = new BigInteger(signum, magNonZeroLength, 0, 0); if (bi.compareTo(BigInteger.ZERO) != 0) { @@ -174,13 +175,13 @@ public class BigIntegerTest { for (int i = 0; i < SIZE; i++) { // create reference value via a different code path from those tested - BigInteger reference = new BigInteger(2 + rnd.nextInt(336), 4, rnd); + BigInteger reference = new BigInteger(2 + rndSeed.getRandom().nextInt(336), 4, rndSeed.getRandom()); byte[] refArray = reference.toByteArray(); int refLen = refArray.length; - int factor = rnd.nextInt(5); - int objLen = refArray.length + factor*rnd.nextInt(refArray.length) + 1; - int offset = rnd.nextInt(objLen - refLen); + int factor = rndSeed.getRandom().nextInt(5); + int objLen = refArray.length + factor*rndSeed.getRandom().nextInt(refArray.length) + 1; + int offset = rndSeed.getRandom().nextInt(objLen - refLen); byte[] objArray = new byte[objLen]; System.arraycopy(refArray, 0, objArray, offset, refLen); @@ -191,7 +192,7 @@ public class BigIntegerTest { failCount++; } - boolean isNegative = rnd.nextBoolean(); + boolean isNegative = rndSeed.getRandom().nextBoolean(); BigInteger signMag = new BigInteger(isNegative ? -1 : 1, objArray, offset, refLen); if (signMag.compareTo(isNegative ? reference.negate() : reference) != 0) { System.err.println("Sign-magnitude BigInteger not equal for offset " + @@ -208,7 +209,7 @@ public class BigIntegerTest { for (int i=0; i= lower; bits--) { for (int i = 0; i < 50; i++) { - BigInteger x = BigInteger.ONE.shiftLeft(bits - 1).or(new BigInteger(bits - 2, rnd)); + BigInteger x = BigInteger.ONE.shiftLeft(bits - 1).or(new BigInteger(bits - 2, rndSeed.getRandom())); for (int radix = Character.MIN_RADIX; radix < Character.MAX_RADIX; radix++) { String result = x.toString(radix); @@ -764,9 +765,9 @@ public class BigIntegerTest { int failCount = 0; for (int i=0; i<10; i++) { - BigInteger m = new BigInteger(100, 5, rnd); + BigInteger m = new BigInteger(100, 5, rndSeed.getRandom()); while(m.compareTo(BigInteger.ONE) != 1) - m = new BigInteger(100, 5, rnd); + m = new BigInteger(100, 5, rndSeed.getRandom()); BigInteger exp = m.subtract(BigInteger.ONE); BigInteger base = fetchNumber(order).abs(); while(base.compareTo(m) != -1) @@ -826,7 +827,7 @@ public class BigIntegerTest { // Test consistency for(int i=0; i<10; i++) { - p1 = BigInteger.probablePrime(100, rnd); + p1 = BigInteger.probablePrime(100, rndSeed.getRandom()); if (!p1.isProbablePrime(100)) { System.err.println("Consistency "+p1.toString(16)); failCount++; @@ -867,7 +868,7 @@ public class BigIntegerTest { // Numbers of the form (6k+1)(12k+1)(18k+1) are Carmichael numbers if // each of the factors is prime int found = 0; - BigInteger f1 = new BigInteger(40, 100, rnd); + BigInteger f1 = new BigInteger(40, 100, rndSeed.getRandom()); while (found < NUM_CARMICHAELS_TO_TEST) { BigInteger k = null; BigInteger f2, f3; @@ -894,8 +895,8 @@ public class BigIntegerTest { // Test some composites that are products of 2 primes for (int i=0; i<50; i++) { - p1 = BigInteger.probablePrime(100, rnd); - p2 = BigInteger.probablePrime(100, rnd); + p1 = BigInteger.probablePrime(100, rndSeed.getRandom()); + p2 = BigInteger.probablePrime(100, rndSeed.getRandom()); c1 = p1.multiply(p2); if (c1.isProbablePrime(100)) { System.err.println("Composite failed "+c1.toString(16)); @@ -904,8 +905,8 @@ public class BigIntegerTest { } for (int i=0; i<4; i++) { - p1 = BigInteger.probablePrime(600, rnd); - p2 = BigInteger.probablePrime(600, rnd); + p1 = BigInteger.probablePrime(600, rndSeed.getRandom()); + p2 = BigInteger.probablePrime(600, rndSeed.getRandom()); c1 = p1.multiply(p2); if (c1.isProbablePrime(100)) { System.err.println("Composite failed "+c1.toString(16)); @@ -960,7 +961,7 @@ public class BigIntegerTest { // Next, pick some large primes, use nextProbablePrime to find the // next one, and make sure there are no primes in between for (int i=0; i<100; i+=10) { - p1 = BigInteger.probablePrime(50 + i, rnd); + p1 = BigInteger.probablePrime(50 + i, rndSeed.getRandom()); p2 = p1.add(ONE); p3 = p1.nextProbablePrime(); while(p2.compareTo(p3) < 0) { @@ -1025,7 +1026,7 @@ public class BigIntegerTest { } for(int i=0; i<10; i++) { - BigInteger b1 = fetchNumber(rnd.nextInt(100)); + BigInteger b1 = fetchNumber(rndSeed.getRandom().nextInt(100)); BigInteger b2 = null; File f = new File("serialtest"); try (FileOutputStream fos = new FileOutputStream(f)) { @@ -1059,6 +1060,7 @@ public class BigIntegerTest { * */ public static void main(String[] args) throws Exception { + System.out.println("Random number generator seed = " + rndSeed.getSeed()); // Some variables for sizing test numbers in bits int order1 = ORDER_MEDIUM; @@ -1131,8 +1133,8 @@ public class BigIntegerTest { * If order is less than 2, order is changed to 2. */ private static BigInteger fetchNumber(int order) { - boolean negative = rnd.nextBoolean(); - int numType = rnd.nextInt(7); + boolean negative = rndSeed.getRandom().nextBoolean(); + int numType = rndSeed.getRandom().nextInt(7); BigInteger result = null; if (order < 2) order = 2; @@ -1156,14 +1158,14 @@ public class BigIntegerTest { break; case 3: // One bit in number - result = BigInteger.ONE.shiftLeft(rnd.nextInt(order)); + result = BigInteger.ONE.shiftLeft(rndSeed.getRandom().nextInt(order)); break; case 4: // Random bit density byte[] val = new byte[(order+7)/8]; - int iterations = rnd.nextInt(order); + int iterations = rndSeed.getRandom().nextInt(order); for (int i=0; i 0) { - int runLength = Math.min(remaining, rnd.nextInt(order)); + int runLength = Math.min(remaining, rndSeed.getRandom().nextInt(order)); result = result.shiftLeft(runLength); if (bit > 0) result = result.add(ONE.shiftLeft(runLength).subtract(ONE)); @@ -1183,7 +1185,7 @@ public class BigIntegerTest { break; default: // random bits - result = new BigInteger(order, rnd); + result = new BigInteger(order, rndSeed.getRandom()); } if (negative) diff --git a/jdk/test/java/math/BigInteger/ModPow65537.java b/jdk/test/java/math/BigInteger/ModPow65537.java index ec962e2a5ff..f8e4a5422d1 100644 --- a/jdk/test/java/math/BigInteger/ModPow65537.java +++ b/jdk/test/java/math/BigInteger/ModPow65537.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,13 +23,13 @@ /* * @test - * @bug 4891312 - * @summary verify that modPow() not broken by the special case for 65537 + * @library .. + * @bug 4891312 8074460 + * @summary verify that modPow() not broken by the special case for 65537 (use -Dseed=X to set PRNG seed) * @author Andreas Sterbenz */ import java.math.BigInteger; -import java.util.*; import java.security.*; import java.security.spec.*; @@ -78,7 +78,9 @@ public class ModPow65537 { private static void testSigning(KeyPair kp) throws Exception { System.out.println(kp.getPublic()); byte[] data = new byte[1024]; - new Random().nextBytes(data); + RandomSeed rndSeed = new RandomSeed(false); + System.out.println("Random number generator seed = " + rndSeed.getSeed()); + rndSeed.getRandom().nextBytes(data); Signature sig = Signature.getInstance("SHA1withRSA", "SunRsaSign"); sig.initSign(kp.getPrivate()); diff --git a/jdk/test/java/math/BigInteger/PrimeTest.java b/jdk/test/java/math/BigInteger/PrimeTest.java index 5f5affeb240..fae4fd7979b 100644 --- a/jdk/test/java/math/BigInteger/PrimeTest.java +++ b/jdk/test/java/math/BigInteger/PrimeTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,13 +25,13 @@ /* * @test - * @bug 8026236 - * @summary test primality verification methods in BigInteger + * @library .. + * @bug 8026236 8074460 + * @summary test primality verification methods in BigInteger (use -Dseed=X to set PRNG seed) * @author bpb */ import java.math.BigInteger; import java.util.BitSet; -import java.util.HashSet; import java.util.List; import java.util.NavigableSet; import java.util.Set; @@ -178,7 +178,9 @@ public class PrimeTest { } // Create a list of non-prime BigIntegers. - List nonPrimeBigInts = (new SplittableRandom()) + RandomSeed rndSeed = new RandomSeed(true); + System.out.println("Random number generator seed = " + rndSeed.getSeed()); + List nonPrimeBigInts = (rndSeed.getSplittableRandom()) .ints(NUM_NON_PRIMES, 2, maxPrime).mapToObj(BigInteger::valueOf) .filter(b -> !b.isProbablePrime(certainty)).collect(toList()); diff --git a/jdk/test/java/math/BigInteger/SymmetricRangeTests.java b/jdk/test/java/math/BigInteger/SymmetricRangeTests.java index b944a95d32f..d3cb73cbef2 100644 --- a/jdk/test/java/math/BigInteger/SymmetricRangeTests.java +++ b/jdk/test/java/math/BigInteger/SymmetricRangeTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 1025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -24,9 +24,10 @@ /* * @test * @ignore This test has huge memory requirements + * @library .. * @run main/timeout=180/othervm -Xmx8g SymmetricRangeTests - * @bug 6910473 8021204 8021203 9005933 - * @summary Test range of BigInteger values + * @bug 6910473 8021204 8021203 9005933 8074460 + * @summary Test range of BigInteger values (use -Dseed=X to set PRNG seed) * @author Dmitry Nadezhin */ import java.io.ByteArrayInputStream; @@ -35,7 +36,6 @@ import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.util.Arrays; -import java.util.Random; import java.math.BigInteger; public class SymmetricRangeTests { @@ -114,8 +114,9 @@ public class SymmetricRangeTests { System.out.println("Testing overflow in BitSieve.sieveSingle"); int bitLength = (5 << 27) - 1; try { - Random rnd = new Random(); - BigInteger actual = new BigInteger(bitLength, 0, rnd); + RandomSeed rndSeed = new RandomSeed(false); + System.out.println("Random number generator seed = " + rndSeed.getSeed()); + BigInteger actual = new BigInteger(bitLength, 0, rndSeed.getRandom()); throw new RuntimeException("new BigInteger(bitLength, 0, null).bitLength()=" + actual.bitLength()); } catch (ArithmeticException e) { // expected diff --git a/jdk/test/java/math/RandomSeed.java b/jdk/test/java/math/RandomSeed.java new file mode 100644 index 00000000000..494705c5fd6 --- /dev/null +++ b/jdk/test/java/math/RandomSeed.java @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.util.Random; +import java.util.SplittableRandom; + +public class RandomSeed { + private long seed = 0L; + private Random rnd = null; + private SplittableRandom srnd = null; + + public RandomSeed(boolean isSplittableRandom) { + init(isSplittableRandom); + } + + private void init(boolean isSplittableRandom) { + // obtain seed from environment if supplied + boolean isSeedProvided = false; + try { + // note that Long.valueOf(null) also throws a NumberFormatException + // so if the property is undefined this will still work correctly + seed = Long.valueOf(System.getProperty("seed")); + isSeedProvided = true; + } catch (NumberFormatException e) { + // do nothing: isSeedProvided is already false + } + + // if no seed from environment, create a fresh one + Random tmpRnd = null; + if (!isSeedProvided) { + tmpRnd = new Random(); + seed = tmpRnd.nextLong(); + } + + // create the PRNG + if (isSplittableRandom) { + srnd = new SplittableRandom(seed); + } else { + rnd = tmpRnd != null ? tmpRnd : new Random(); + rnd.setSeed(seed); + } + } + + public Random getRandom() { + if (rnd == null) { + throw new IllegalStateException("Variable of type Random not initialized"); + } + return rnd; + } + + public SplittableRandom getSplittableRandom() { + if (srnd == null) { + throw new IllegalStateException("Variable of type SplittableRandom not initialized"); + } + return srnd; + } + + public long getSeed() { + return seed; + } +} From 011b337a5120fceef4ea68883efc302f7f39846c Mon Sep 17 00:00:00 2001 From: Xueming Shen Date: Sat, 7 Mar 2015 10:11:03 -0800 Subject: [PATCH 08/76] 8074406: DateTimeFormatter.appendZoneOrOffsetId() fails to resolve a ZoneOffset for OffsetDateTime To support resolve OffsetDateTime from DTF.appendZoneOrOffset() Reviewed-by: rriggs --- .../classes/java/time/format/Parsed.java | 11 +- .../time/format/TCKZoneIdPrinterParser.java | 231 ++++++++++-------- 2 files changed, 144 insertions(+), 98 deletions(-) diff --git a/jdk/src/java.base/share/classes/java/time/format/Parsed.java b/jdk/src/java.base/share/classes/java/time/format/Parsed.java index 1eb88454414..58cbfaffbef 100644 --- a/jdk/src/java.base/share/classes/java/time/format/Parsed.java +++ b/jdk/src/java.base/share/classes/java/time/format/Parsed.java @@ -216,7 +216,16 @@ final class Parsed implements TemporalAccessor { return (R) (date != null ? LocalDate.from(date) : null); } else if (query == TemporalQueries.localTime()) { return (R) time; - } else if (query == TemporalQueries.zone() || query == TemporalQueries.offset()) { + } else if (query == TemporalQueries.offset()) { + Long offsetSecs = fieldValues.get(OFFSET_SECONDS); + if (offsetSecs != null) { + return (R) ZoneOffset.ofTotalSeconds(offsetSecs.intValue()); + } + if (zone instanceof ZoneOffset) { + return (R)zone; + } + return query.queryFrom(this); + } else if (query == TemporalQueries.zone()) { return query.queryFrom(this); } else if (query == TemporalQueries.precision()) { return null; // not a complete date/time diff --git a/jdk/test/java/time/tck/java/time/format/TCKZoneIdPrinterParser.java b/jdk/test/java/time/tck/java/time/format/TCKZoneIdPrinterParser.java index 122da8608c2..11e2dcd9620 100644 --- a/jdk/test/java/time/tck/java/time/format/TCKZoneIdPrinterParser.java +++ b/jdk/test/java/time/tck/java/time/format/TCKZoneIdPrinterParser.java @@ -152,144 +152,181 @@ public class TCKZoneIdPrinterParser { @DataProvider(name="parseSuccess") Object[][] data_parseSuccess() { return new Object[][] { - {"Z", 1, -1, ZoneId.of("Z")}, - {"UTC", 3, -1, ZoneId.of("UTC")}, - {"UT", 2, -1, ZoneId.of("UT")}, - {"GMT", 3, -1, ZoneId.of("GMT")}, + {"Z", 1, -1, ZoneId.of("Z"), true}, + {"UTC", 3, -1, ZoneId.of("UTC"), false}, + {"UT", 2, -1, ZoneId.of("UT"), false}, + {"GMT", 3, -1, ZoneId.of("GMT"), false}, - {"+00:00", 6, -1, ZoneOffset.UTC}, - {"UTC+00:00", 9, -1, ZoneId.of("UTC")}, - {"UT+00:00", 8, -1, ZoneId.of("UT")}, - {"GMT+00:00", 9, -1, ZoneId.of("GMT")}, - {"-00:00", 6, -1, ZoneOffset.UTC}, - {"UTC-00:00", 9, -1, ZoneId.of("UTC")}, - {"UT-00:00", 8, -1, ZoneId.of("UT")}, - {"GMT-00:00", 9, -1, ZoneId.of("GMT")}, + {"+00:00", 6, -1, ZoneOffset.UTC, true}, + {"UTC+00:00", 9, -1, ZoneId.of("UTC"), false}, + {"UT+00:00", 8, -1, ZoneId.of("UT"), false}, + {"GMT+00:00", 9, -1, ZoneId.of("GMT"), false}, + {"-00:00", 6, -1, ZoneOffset.UTC, true}, + {"UTC-00:00", 9, -1, ZoneId.of("UTC"), false}, + {"UT-00:00", 8, -1, ZoneId.of("UT"), false}, + {"GMT-00:00", 9, -1, ZoneId.of("GMT"), false}, - {"+01:30", 6, -1, ZoneOffset.ofHoursMinutes(1, 30)}, - {"UTC+01:30", 9, -1, ZoneId.of("UTC+01:30")}, - {"UT+02:30", 8, -1, ZoneId.of("UT+02:30")}, - {"GMT+03:30", 9, -1, ZoneId.of("GMT+03:30")}, - {"-01:30", 6, -1, ZoneOffset.ofHoursMinutes(-1, -30)}, - {"UTC-01:30", 9, -1, ZoneId.of("UTC-01:30")}, - {"UT-02:30", 8, -1, ZoneId.of("UT-02:30")}, - {"GMT-03:30", 9, -1, ZoneId.of("GMT-03:30")}, + {"+01:30", 6, -1, ZoneOffset.ofHoursMinutes(1, 30), true}, + {"UTC+01:30", 9, -1, ZoneId.of("UTC+01:30"), false}, + {"UT+02:30", 8, -1, ZoneId.of("UT+02:30"), false}, + {"GMT+03:30", 9, -1, ZoneId.of("GMT+03:30"), false}, + {"-01:30", 6, -1, ZoneOffset.ofHoursMinutes(-1, -30), true}, + {"UTC-01:30", 9, -1, ZoneId.of("UTC-01:30"), false}, + {"UT-02:30", 8, -1, ZoneId.of("UT-02:30"), false}, + {"GMT-03:30", 9, -1, ZoneId.of("GMT-03:30"), false}, // fallback to UTC - {"UTC-01:WW", 3, -1, ZoneId.of("UTC")}, - {"UT-02:WW", 2, -1, ZoneId.of("UT")}, - {"GMT-03:WW", 3, -1, ZoneId.of("GMT")}, - {"Z0", 1, -1, ZoneOffset.UTC}, - {"UTC1", 3, -1, ZoneId.of("UTC")}, + {"UTC-01:WW", 3, -1, ZoneId.of("UTC"), false}, + {"UT-02:WW", 2, -1, ZoneId.of("UT"), false}, + {"GMT-03:WW", 3, -1, ZoneId.of("GMT"), false}, + {"Z0", 1, -1, ZoneOffset.UTC, true}, + {"UTC1", 3, -1, ZoneId.of("UTC"), false}, // Z not parsed as zero - {"UTCZ", 3, -1, ZoneId.of("UTC")}, - {"UTZ", 2, -1, ZoneId.of("UT")}, - {"GMTZ", 3, -1, ZoneId.of("GMT")}, + {"UTCZ", 3, -1, ZoneId.of("UTC"), false}, + {"UTZ", 2, -1, ZoneId.of("UT"), false}, + {"GMTZ", 3, -1, ZoneId.of("GMT"), false}, // 0 not parsed - {"UTC0", 3, -1, ZoneId.of("UTC")}, - {"UT0", 2, -1, ZoneId.of("UT")}, + {"UTC0", 3, -1, ZoneId.of("UTC"), false}, + {"UT0", 2, -1, ZoneId.of("UT"), false}, // fail to parse - {"", 0, 0, null}, - {"A", 0, 0, null}, - {"UZ", 0, 0, null}, - {"GMA", 0, 0, null}, - {"0", 0, 0, null}, - {"+", 0, 0, null}, - {"-", 0, 0, null}, + {"", 0, 0, null, false}, + {"A", 0, 0, null, false}, + {"UZ", 0, 0, null, false}, + {"GMA", 0, 0, null, false}, + {"0", 0, 0, null, false}, + {"+", 0, 0, null, false}, + {"-", 0, 0, null, false}, // zone IDs - {"Europe/London", 13, -1, ZoneId.of("Europe/London")}, - {"America/New_York", 16, -1, ZoneId.of("America/New_York")}, - {"America/Bogusville", 0, 0, null}, + {"Europe/London", 13, -1, ZoneId.of("Europe/London"), false}, + {"America/New_York", 16, -1, ZoneId.of("America/New_York"), false}, + {"America/Bogusville", 0, 0, null, false}, }; } @Test(dataProvider="parseSuccess") - public void test_parseSuccess_plain(String text, int expectedIndex, int expectedErrorIndex, ZoneId expected) { + public void test_ZoneId_parseSuccess_plain( + String text, int expectedIndex, int expectedErrorIndex, ZoneId expected, boolean isZoneOffset) + { builder.appendZoneId(); - TemporalAccessor parsed = builder.toFormatter().parseUnresolved(text, pos); - assertEquals(pos.getErrorIndex(), expectedErrorIndex, "Incorrect error index parsing: " + text); - assertEquals(pos.getIndex(), expectedIndex, "Incorrect index parsing: " + text); - if (expected != null) { - assertEquals(parsed.query(TemporalQueries.zoneId()), expected, "Incorrect zoneId parsing: " + text); - assertEquals(parsed.query(TemporalQueries.offset()), null, "Incorrect offset parsing: " + text); - assertEquals(parsed.query(TemporalQueries.zone()), expected, "Incorrect zone parsing: " + text); - } else { - assertEquals(parsed, null); - } + test(text, expectedIndex, expectedErrorIndex, expected, isZoneOffset); } @Test(dataProvider="parseSuccess") - public void test_parseSuccess_prefix(String text, int expectedIndex, int expectedErrorIndex, ZoneId expected) { + public void test_ZoneId_parseSuccess_prefix( + String text, int expectedIndex, int expectedErrorIndex, ZoneId expected, boolean isZoneOffset) + { builder.appendZoneId(); pos.setIndex(3); - String prefixText = "XXX" + text; - TemporalAccessor parsed = builder.toFormatter().parseUnresolved(prefixText, pos); - assertEquals(pos.getErrorIndex(), expectedErrorIndex >= 0 ? expectedErrorIndex + 3 : expectedErrorIndex, "Incorrect error index parsing: " + prefixText); - assertEquals(pos.getIndex(), expectedIndex + 3, "Incorrect index parsing: " + prefixText); - if (expected != null) { - assertEquals(parsed.query(TemporalQueries.zoneId()), expected, "Incorrect zoneId parsing: " + prefixText); - assertEquals(parsed.query(TemporalQueries.offset()), null, "Incorrect offset parsing: " + prefixText); - assertEquals(parsed.query(TemporalQueries.zone()), expected, "Incorrect zone parsing: " + prefixText); - } else { - assertEquals(parsed, null); - } + test("XXX" + text, + expectedIndex + 3, + expectedErrorIndex >= 0 ? expectedErrorIndex + 3 : expectedErrorIndex, + expected, isZoneOffset); } @Test(dataProvider="parseSuccess") - public void test_parseSuccess_suffix(String text, int expectedIndex, int expectedErrorIndex, ZoneId expected) { + public void test_ZoneId_parseSuccess_suffix( + String text, int expectedIndex, int expectedErrorIndex, ZoneId expected, boolean isZoneOffset) + { builder.appendZoneId(); - String suffixText = text + "XXX"; - TemporalAccessor parsed = builder.toFormatter().parseUnresolved(suffixText, pos); - assertEquals(pos.getErrorIndex(), expectedErrorIndex, "Incorrect error index parsing: " + suffixText); - assertEquals(pos.getIndex(), expectedIndex, "Incorrect index parsing: " + suffixText); - if (expected != null) { - assertEquals(parsed.query(TemporalQueries.zoneId()), expected, "Incorrect zoneId parsing: " + suffixText); - assertEquals(parsed.query(TemporalQueries.offset()), null, "Incorrect offset parsing: " + suffixText); - assertEquals(parsed.query(TemporalQueries.zone()), expected, "Incorrect zone parsing: " + suffixText); - } else { - assertEquals(parsed, null); - } + test(text + "XXX", expectedIndex, expectedErrorIndex, expected, isZoneOffset); } @Test(dataProvider="parseSuccess") - public void test_parseSuccess_caseSensitive(String text, int expectedIndex, int expectedErrorIndex, ZoneId expected) { + public void test_ZoneId_parseSuccess_caseSensitive( + String text, int expectedIndex, int expectedErrorIndex, ZoneId expected, boolean isZoneOffset) + { builder.parseCaseSensitive().appendZoneId(); - String lcText = text.toLowerCase(Locale.ENGLISH); - TemporalAccessor parsed = builder.toFormatter().parseUnresolved(lcText, pos); + if (text.matches("[^A-Z]*[A-Z].*")) { // if input has letters + String lcText = text.toLowerCase(Locale.ENGLISH); + TemporalAccessor parsed = builder.toFormatter().parseUnresolved(lcText, pos); assertEquals(pos.getErrorIndex() >= 0, true); assertEquals(pos.getIndex(), 0); assertEquals(parsed, null); } else { - // case sensitive made no difference - assertEquals(pos.getIndex(), expectedIndex, "Incorrect index parsing: " + lcText); - assertEquals(pos.getErrorIndex(), expectedErrorIndex, "Incorrect error index parsing: " + lcText); - if (expected != null) { - assertEquals(parsed.query(TemporalQueries.zoneId()), expected); - assertEquals(parsed.query(TemporalQueries.offset()), null); - assertEquals(parsed.query(TemporalQueries.zone()), expected); - } else { - assertEquals(parsed, null); - } + test(text.toLowerCase(Locale.ENGLISH), expectedIndex, expectedErrorIndex, expected, isZoneOffset); } } @Test(dataProvider="parseSuccess") - public void test_parseSuccess_caseInsensitive(String text, int expectedIndex, int expectedErrorIndex, ZoneId expected) { + public void test_ZoneId_parseSuccess_caseInsensitive( + String text, int expectedIndex, int expectedErrorIndex, ZoneId expected, boolean isZoneOffset) + { builder.parseCaseInsensitive().appendZoneId(); - String lcText = text.toLowerCase(Locale.ENGLISH); - TemporalAccessor parsed = builder.toFormatter().parseUnresolved(lcText, pos); - assertEquals(pos.getErrorIndex(), expectedErrorIndex, "Incorrect error index parsing: " + lcText); - assertEquals(pos.getIndex(), expectedIndex, "Incorrect index parsing: " + lcText); + test(text.toLowerCase(Locale.ENGLISH), expectedIndex, expectedErrorIndex, expected, isZoneOffset); + } + + @Test(dataProvider="parseSuccess") + public void test_ZoneOrOffsetId_parseSuccess_plain( + String text, int expectedIndex, int expectedErrorIndex, ZoneId expected, boolean isZoneOffset) + { + builder.appendZoneOrOffsetId(); + test(text, expectedIndex, expectedErrorIndex, expected, isZoneOffset); + } + + @Test(dataProvider="parseSuccess") + public void test_ZoneOrOffsetId_parseSuccess_prefix( + String text, int expectedIndex, int expectedErrorIndex, ZoneId expected, boolean isZoneOffset) + { + builder.appendZoneOrOffsetId(); + pos.setIndex(3); + test("XXX" + text, + expectedIndex + 3, + expectedErrorIndex >= 0 ? expectedErrorIndex + 3 : expectedErrorIndex, + expected, isZoneOffset); + } + + @Test(dataProvider="parseSuccess") + public void test_ZoneOrOffsetId_parseSuccess_suffix( + String text, int expectedIndex, int expectedErrorIndex, ZoneId expected, boolean isZoneOffset) + { + builder.appendZoneOrOffsetId(); + test(text + "XXX", expectedIndex, expectedErrorIndex, expected, isZoneOffset); + } + + @Test(dataProvider="parseSuccess") + public void test_ZoneOrOffsetId_parseSuccess_caseSensitive( + String text, int expectedIndex, int expectedErrorIndex, ZoneId expected, boolean isZoneOffset) + { + builder.parseCaseSensitive().appendZoneOrOffsetId(); + if (text.matches("[^A-Z]*[A-Z].*")) { // if input has letters + String lcText = text.toLowerCase(Locale.ENGLISH); + TemporalAccessor parsed = builder.toFormatter().parseUnresolved(lcText, pos); + assertEquals(pos.getErrorIndex() >= 0, true); + assertEquals(pos.getIndex(), 0); + assertEquals(parsed, null); + } else { + test(text.toLowerCase(Locale.ENGLISH), expectedIndex, expectedErrorIndex, expected, isZoneOffset); + } + } + + @Test(dataProvider="parseSuccess") + public void test_ZoneOrOffsetIdparseSuccess_caseInsensitive( + String text, int expectedIndex, int expectedErrorIndex, ZoneId expected, boolean isZoneOffset) + { + builder.parseCaseInsensitive().appendZoneOrOffsetId(); + test(text.toLowerCase(Locale.ENGLISH), expectedIndex, expectedErrorIndex, expected, isZoneOffset); + } + + private void test(String text, int expectedIndex, int expectedErrorIndex, ZoneId expected, + boolean isZoneOffset) { + TemporalAccessor parsed = builder.toFormatter().parseUnresolved(text, pos); + assertEquals(pos.getErrorIndex(), expectedErrorIndex, "Incorrect error index parsing: " + text); + assertEquals(pos.getIndex(), expectedIndex, "Incorrect index parsing: " + text); if (expected != null) { - ZoneId zid = parsed.query(TemporalQueries.zoneId()); - assertEquals(parsed.query(TemporalQueries.zoneId()), expected, "Incorrect zoneId parsing: " + lcText); - assertEquals(parsed.query(TemporalQueries.offset()), null, "Incorrect offset parsing: " + lcText); - assertEquals(parsed.query(TemporalQueries.zone()), expected, "Incorrect zone parsing: " + lcText); + assertEquals(parsed.query(TemporalQueries.zoneId()), + expected, + "Incorrect zoneId parsing: " + text); + assertEquals(parsed.query(TemporalQueries.offset()), + isZoneOffset ? expected : null, + "Incorrect offset parsing: " + text); + assertEquals(parsed.query(TemporalQueries.zone()), + expected, + "Incorrect zone parsing: " + text); } else { assertEquals(parsed, null); } From 64c0d9763008081556d73bd20b8f45f3994b7abe Mon Sep 17 00:00:00 2001 From: Kumar Srinivasan Date: Sat, 7 Mar 2015 15:21:36 -0800 Subject: [PATCH 09/76] 8074373: NMT is not enabled if NMT option is specified after class path specifiers Reviewed-by: dholmes --- jdk/src/java.base/share/native/libjli/java.c | 27 +++++++++++++------- jdk/test/tools/launcher/TestSpecialArgs.java | 20 ++++++++++++++- 2 files changed, 37 insertions(+), 10 deletions(-) diff --git a/jdk/src/java.base/share/native/libjli/java.c b/jdk/src/java.base/share/native/libjli/java.c index 27e828fd60a..846e6835855 100644 --- a/jdk/src/java.base/share/native/libjli/java.c +++ b/jdk/src/java.base/share/native/libjli/java.c @@ -661,15 +661,24 @@ SetJvmEnvironment(int argc, char **argv) { * arguments are for the application (i.e. the main class name, or * the -jar argument). */ - if ((i > 0 && *arg != '-') - || JLI_StrCmp(arg, "-version") == 0 - || JLI_StrCmp(arg, "-fullversion") == 0 - || JLI_StrCmp(arg, "-help") == 0 - || JLI_StrCmp(arg, "-?") == 0 - || JLI_StrCmp(arg, "-jar") == 0 - || JLI_StrCmp(arg, "-X") == 0 - ) { - return; + if (i > 0) { + char *prev = argv[i - 1]; + // skip non-dash arg preceded by class path specifiers + if (*arg != '-' && + ((JLI_StrCmp(prev, "-cp") == 0 + || JLI_StrCmp(prev, "-classpath") == 0))) { + continue; + } + + if (*arg != '-' + || JLI_StrCmp(arg, "-version") == 0 + || JLI_StrCmp(arg, "-fullversion") == 0 + || JLI_StrCmp(arg, "-help") == 0 + || JLI_StrCmp(arg, "-?") == 0 + || JLI_StrCmp(arg, "-jar") == 0 + || JLI_StrCmp(arg, "-X") == 0) { + return; + } } /* * The following case checks for "-XX:NativeMemoryTracking=value". diff --git a/jdk/test/tools/launcher/TestSpecialArgs.java b/jdk/test/tools/launcher/TestSpecialArgs.java index 0e35f028521..307a4e06fb4 100644 --- a/jdk/test/tools/launcher/TestSpecialArgs.java +++ b/jdk/test/tools/launcher/TestSpecialArgs.java @@ -23,7 +23,7 @@ /* * @test - * @bug 7124089 7131021 8042469 8066185 + * @bug 7124089 7131021 8042469 8066185 8074373 * @summary Checks for Launcher special flags, such as MacOSX specific flags, * and JVM NativeMemoryTracking flags. * @compile -XDignore.symbol.file TestSpecialArgs.java EnvironmentVariables.java @@ -270,6 +270,16 @@ public class TestSpecialArgs extends TestHelper { tr = doExec(envMap, javaCmd, "Foo", "-XX:NativeMemoryTracking=summary"); checkTestResult(tr); + // should accept with no warnings + tr = doExec(javaCmd, "-cp", jarFile.getName(), + "-XX:NativeMemoryTracking=summary", "Foo"); + ensureNoWarnings(tr); + + // should accept with no warnings + tr = doExec(javaCmd, "-classpath", jarFile.getName(), + "-XX:NativeMemoryTracking=summary", "Foo"); + ensureNoWarnings(tr); + // make sure a missing class is handled correctly, because the class // resolution is performed by the JVM. tr = doExec(javaCmd, "AbsentClass", "-XX:NativeMemoryTracking=summary"); @@ -278,6 +288,14 @@ public class TestSpecialArgs extends TestHelper { } } + void ensureNoWarnings(TestResult tr) { + checkTestResult(tr); + if (tr.contains("warning: Native Memory Tracking")) { + System.err.println(tr.toString()); + throw new RuntimeException("Test Fails"); + } + } + void checkTestResult(TestResult tr) { if (!tr.isOK()) { System.err.println(tr.toString()); From 84afe48e4ffc2b9b2dd119d556c1112e5c7a188d Mon Sep 17 00:00:00 2001 From: Magnus Ihse Bursie Date: Mon, 9 Mar 2015 10:39:50 +0100 Subject: [PATCH 10/76] 8074096: Disable (most) native warnings in JDK on a per-library basis Reviewed-by: erikj, tbell --- jdk/make/CompileDemos.gmk | 12 +++++-- jdk/make/launcher/Launcher-jdk.pack200.gmk | 5 ++- jdk/make/lib/Awt2dLibraries.gmk | 40 +++++++++++++++++++--- jdk/make/lib/CoreLibraries.gmk | 24 +++++++++++-- jdk/make/lib/Lib-java.security.jgss.gmk | 4 ++- jdk/make/lib/Lib-jdk.crypto.ec.gmk | 4 ++- jdk/make/lib/Lib-jdk.crypto.pkcs11.gmk | 4 ++- jdk/make/lib/Lib-jdk.deploy.osx.gmk | 4 ++- jdk/make/lib/Lib-jdk.pack200.gmk | 7 +++- jdk/make/lib/NetworkingLibraries.gmk | 5 ++- jdk/make/lib/NioLibraries.gmk | 6 ++-- jdk/make/lib/PlatformLibraries.gmk | 4 +-- jdk/make/lib/SoundLibraries.gmk | 3 ++ 13 files changed, 101 insertions(+), 21 deletions(-) diff --git a/jdk/make/CompileDemos.gmk b/jdk/make/CompileDemos.gmk index ed7ba13082c..a56b020e09d 100644 --- a/jdk/make/CompileDemos.gmk +++ b/jdk/make/CompileDemos.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -219,6 +219,9 @@ define SetupJVMTIDemo # Param 7 = libs for solaris # Param 8 = libs for linux # Param 9 = extra directories with required sources + # Param 10 = DISABLED_WARNINGS_gcc + # Param 11 = DISABLED_WARNINGS_microsoft + # Param 12 = DISABLED_WARNINGS_clang BUILD_DEMO_JVMTI_$1_EXTRA_SRC := \ $$(wildcard $(DEMO_OS_TYPE_SRC)/jvmti/$1) \ $$(wildcard $$(addprefix $(DEMO_SHARE_SRC)/jvmti/, $2)) \ @@ -254,6 +257,9 @@ define SetupJVMTIDemo LANG := $$(BUILD_DEMO_JVMTI_$1_LANG), \ OPTIMIZATION := LOW, \ CXXFLAGS := $$($1_CXXFLAGS), \ + DISABLED_WARNINGS_gcc := $(10), \ + DISABLED_WARNINGS_clang := $(12), \ + DISABLED_WARNINGS_microsoft := $(11), \ LDFLAGS := $(filter-out -incremental:no -opt:ref, $(LDFLAGS_JDKLIB)), \ LDFLAGS_macosx := $(call SET_EXECUTABLE_ORIGIN), \ LDFLAGS_SUFFIX := $$($1_EXTRA_CXX), \ @@ -310,13 +316,13 @@ define SetupJVMTIDemo endif endef -$(eval $(call SetupJVMTIDemo,compiledMethodLoad, agent_util)) +$(eval $(call SetupJVMTIDemo,compiledMethodLoad, agent_util, , , , , , , , pointer-to-int-cast format, , format)) $(eval $(call SetupJVMTIDemo,gctest, agent_util)) $(eval $(call SetupJVMTIDemo,heapTracker, agent_util java_crw_demo)) $(eval $(call SetupJVMTIDemo,heapViewer, agent_util)) $(eval $(call SetupJVMTIDemo,minst, agent_util java_crw_demo)) $(eval $(call SetupJVMTIDemo,mtrace, agent_util java_crw_demo)) -$(eval $(call SetupJVMTIDemo,waiters, agent_util, , C++)) +$(eval $(call SetupJVMTIDemo,waiters, agent_util, , C++, , , , , , , 4101)) $(eval $(call SetupJVMTIDemo,versionCheck, agent_util)) ################################################################################################## diff --git a/jdk/make/launcher/Launcher-jdk.pack200.gmk b/jdk/make/launcher/Launcher-jdk.pack200.gmk index 1e6c21820cb..6ee00f7ccd0 100644 --- a/jdk/make/launcher/Launcher-jdk.pack200.gmk +++ b/jdk/make/launcher/Launcher-jdk.pack200.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -79,6 +79,9 @@ $(eval $(call SetupNativeCompilation,BUILD_UNPACKEXE, \ CFLAGS_linux := -fPIC, \ CFLAGS_solaris := -KPIC, \ CFLAGS_macosx := -fPIC, \ + DISABLED_WARNINGS_gcc := sign-compare unused-result format-nonliteral \ + format-security parentheses, \ + DISABLED_WARNINGS_microsoft := 4267 4018, \ MAPFILE := $(UNPACK_MAPFILE),\ LDFLAGS := $(UNPACKEXE_ZIPOBJS) \ $(LDFLAGS_JDKEXE) $(LDFLAGS_CXX_JDK) \ diff --git a/jdk/make/lib/Awt2dLibraries.gmk b/jdk/make/lib/Awt2dLibraries.gmk index d7e50779625..549068675fd 100644 --- a/jdk/make/lib/Awt2dLibraries.gmk +++ b/jdk/make/lib/Awt2dLibraries.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -55,6 +55,9 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBMLIB_IMAGE, \ OPTIMIZATION := HIGHEST, \ CFLAGS := $(CFLAGS_JDKLIB) \ $(BUILD_LIBMLIB_CFLAGS), \ + DISABLED_WARNINGS_gcc := parentheses, \ + DISABLED_WARNINGS_clang := parentheses, \ + DISABLED_WARNINGS_solstudio := E_STATEMENT_NOT_REACHED, \ MAPFILE := $(BUILD_LIBMLIB_IMAGE_MAPFILE), \ LDFLAGS := $(LDFLAGS_JDKLIB) \ $(call SET_SHARED_LIBRARY_ORIGIN), \ @@ -127,6 +130,7 @@ ifeq ($(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU_ARCH), solaris-sparc) CFLAGS := -xarch=sparcvis \ $(LIBMLIB_IMAGE_V_CFLAGS) \ $(CFLAGS_JDKLIB), \ + DISABLED_WARNINGS_solstudio := E_STATEMENT_NOT_REACHED, \ MAPFILE := $(BUILD_LIBMLIB_IMAGE_MAPFILE), \ LDFLAGS := $(LDFLAGS_JDKLIB) \ $(BUILD_LIBMLIB_LDLIBS) -ljava -ljvm \ @@ -175,9 +179,6 @@ LIBAWT_CFLAGS += -I$(SUPPORT_OUTPUTDIR)/headers/java.desktop \ LIBAWT_CFLAGS += -D__MEDIALIB_OLD_NAMES -D__USE_J2D_NAMES $(X_CFLAGS) -ifeq ($(OPENJDK_TARGET_OS), macosx) -endif - ifeq ($(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU_ARCH), solaris-sparc) LIBAWT_CFLAGS += -DMLIB_ADD_SUFF LIBAWT_CFLAGS += -xarch=sparcvis @@ -253,6 +254,11 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBAWT, \ LANG := $(LIBAWT_LANG), \ OPTIMIZATION := LOW, \ CFLAGS := $(CFLAGS_JDKLIB) $(LIBAWT_CFLAGS), \ + DISABLED_WARNINGS_gcc := sign-compare unused-result maybe-uninitialized \ + format-nonliteral parentheses, \ + DISABLED_WARNINGS_clang := logical-op-parentheses, \ + DISABLED_WARNINGS_solstudio := E_DECLARATION_IN_CODE, \ + DISABLED_WARNINGS_microsoft := 4297 4244 4267, \ ASFLAGS := $(LIBAWT_ASFLAGS), \ MAPFILE := $(LIBAWT_MAPFILE), \ LDFLAGS := $(LDFLAGS_JDKLIB) $(call SET_SHARED_LIBRARY_ORIGIN), \ @@ -361,6 +367,11 @@ ifeq ($(findstring $(OPENJDK_TARGET_OS),windows macosx),) OPTIMIZATION := LOW, \ CFLAGS := $(CFLAGS_JDKLIB) $(LIBAWT_XAWT_CFLAGS) \ $(X_CFLAGS), \ + DISABLED_WARNINGS_gcc := type-limits pointer-to-int-cast \ + deprecated-declarations unused-result maybe-uninitialized format \ + format-security int-to-pointer-cast parentheses, \ + DISABLED_WARNINGS_solstudio := E_DECLARATION_IN_CODE \ + E_ASSIGNMENT_TYPE_MISMATCH E_NON_CONST_INIT, \ MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libawt_xawt/mapfile-vers, \ LDFLAGS := $(LDFLAGS_JDKLIB) \ $(X_LIBS) $(LIBAWT_XAWT_LDFLAGS) \ @@ -417,6 +428,9 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBLCMS, \ $(LCMS_CFLAGS), \ CFLAGS_solaris := -xc99=no_lib, \ CFLAGS_windows := -DCMS_IS_WINDOWS_, \ + DISABLED_WARNINGS_gcc := format-nonliteral, \ + DISABLED_WARNINGS_clang := tautological-compare, \ + DISABLED_WARNINGS_solstudio := E_STATEMENT_NOT_REACHED, \ MAPFILE := $(JDK_TOPDIR)/make/mapfiles/liblcms/mapfile-vers, \ LDFLAGS := $(LDFLAGS_JDKLIB) \ $(call SET_SHARED_LIBRARY_ORIGIN), \ @@ -495,6 +509,9 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBJAVAJPEG, \ CFLAGS := $(CFLAGS_JDKLIB) $(addprefix -I, $(LIBJAVAJPEG_SRC)) \ $(LIBJAVA_HEADER_FLAGS) \ -I$(SUPPORT_OUTPUTDIR)/headers/java.desktop, \ + DISABLED_WARNINGS_gcc := clobbered parentheses, \ + DISABLED_WARNINGS_clang := logical-op-parentheses, \ + DISABLED_WARNINGS_microsoft := 4267, \ MAPFILE := $(BUILD_LIBJAVAJPEG_MAPFILE), \ LDFLAGS := $(LDFLAGS_JDKLIB) $(LIBJPEG_LIBS) \ $(call SET_SHARED_LIBRARY_ORIGIN), \ @@ -563,6 +580,9 @@ ifeq ($(BUILD_HEADLESS), true) $(CUPS_CFLAGS) \ $(X_CFLAGS) \ $(LIBAWT_HEADLESS_CFLAGS), \ + DISABLED_WARNINGS_gcc := maybe-uninitialized int-to-pointer-cast, \ + DISABLED_WARNINGS_solstudio := E_DECLARATION_IN_CODE \ + E_EMPTY_TRANSLATION_UNIT, \ MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libawt_headless/mapfile-vers, \ LDFLAGS := $(LDFLAGS_JDKLIB) \ $(call SET_SHARED_LIBRARY_ORIGIN), \ @@ -644,6 +664,11 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBFONTMANAGER, \ CXXFLAGS := $(CXXFLAGS_JDKLIB) $(LIBFONTMANAGER_CFLAGS), \ OPTIMIZATION := $(LIBFONTMANAGER_OPTIMIZATION), \ CFLAGS_windows = -DCC_NOEX, \ + DISABLED_WARNINGS_gcc := sign-compare int-to-pointer-cast reorder \ + delete-non-virtual-dtor, \ + DISABLED_WARNINGS_clang := unused-value incompatible-pointer-types, \ + DISABLED_WARNINGS_solstudio := truncwarn, \ + DISABLED_WARNINGS_microsoft := 4267 4244 4018 4090, \ MAPFILE := $(BUILD_LIBFONTMANAGER_MAPFILE), \ LDFLAGS := $(subst -Xlinker -z -Xlinker defs,,$(LDFLAGS_JDKLIB)) $(LDFLAGS_CXX_JDK) \ $(call SET_SHARED_LIBRARY_ORIGIN), \ @@ -876,6 +901,10 @@ ifndef BUILD_HEADLESS_ONLY OPTIMIZATION := LOW, \ CFLAGS := $(LIBSPLASHSCREEN_CFLAGS) $(CFLAGS_JDKLIB) \ $(GIFLIB_CFLAGS) $(LIBJPEG_CFLAGS) $(PNG_CFLAGS), \ + DISABLED_WARNINGS_gcc := type-limits unused-result maybe-uninitialized, \ + DISABLED_WARNINGS_clang := incompatible-pointer-types, \ + DISABLED_WARNINGS_solstudio := E_NEWLINE_NOT_LAST, \ + DISABLED_WARNINGS_microsoft := 4244 4267, \ MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libsplashscreen/mapfile-vers, \ LDFLAGS := $(LDFLAGS_JDKLIB) \ $(call SET_SHARED_LIBRARY_ORIGIN), \ @@ -946,6 +975,9 @@ ifeq ($(OPENJDK_TARGET_OS), macosx) $(X_CFLAGS) \ $(X_LIBS) \ $(LIBAWT_LWAWT_CFLAGS), \ + DISABLED_WARNINGS_clang := incomplete-implementation \ + deprecated-declarations objc-method-access bitwise-op-parentheses \ + incompatible-pointer-types parentheses-equality extra-tokens, \ LDFLAGS := $(LDFLAGS_JDKLIB) \ $(call SET_SHARED_LIBRARY_ORIGIN) \ -L$(INSTALL_LIBRARIES_HERE), \ diff --git a/jdk/make/lib/CoreLibraries.gmk b/jdk/make/lib/CoreLibraries.gmk index 7046e35b785..678af20a830 100644 --- a/jdk/make/lib/CoreLibraries.gmk +++ b/jdk/make/lib/CoreLibraries.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -26,7 +26,7 @@ WIN_VERIFY_LIB := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libverify/verify.lib ########################################################################################## -# libfdlibm is statically linked with libjava below and not delivered into the +# libfdlibm is statically linked with libjava below and not delivered into the # product on its own. BUILD_LIBFDLIBM_OPTIMIZATION := HIGH @@ -48,6 +48,8 @@ ifneq ($(OPENJDK_TARGET_OS), macosx) CFLAGS := $(CFLAGS_JDKLIB) $(LIBFDLIBM_CFLAGS), \ CFLAGS_windows_debug := -DLOGGING, \ CFLAGS_aix := -qfloat=nomaf, \ + DISABLED_WARNINGS_gcc := sign-compare, \ + DISABLED_WARNINGS_microsoft := 4146 4244 4018, \ ARFLAGS := $(ARFLAGS), \ OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libfdlibm, \ DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) @@ -94,6 +96,7 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBVERIFY, \ LANG := C, \ OPTIMIZATION := $(LIBVERIFY_OPTIMIZATION), \ CFLAGS := $(CFLAGS_JDKLIB), \ + DISABLED_WARNINGS_microsoft := 4244 4267, \ MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libverify/mapfile-vers, \ LDFLAGS := $(LDFLAGS_JDKLIB) \ $(call SET_SHARED_LIBRARY_ORIGIN), \ @@ -147,6 +150,10 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBJAVA, \ OPTIMIZATION := HIGH, \ CFLAGS := $(CFLAGS_JDKLIB) \ $(LIBJAVA_CFLAGS), \ + DISABLED_WARNINGS_gcc := type-limits format-nonliteral, \ + DISABLED_WARNINGS_clang := int-conversion, \ + DISABLED_WARNINGS_solstudio := E_DECLARATION_IN_CODE, \ + DISABLED_WARNINGS_microsoft := 4022 4267, \ MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libjava/mapfile-vers, \ LDFLAGS := $(LDFLAGS_JDKLIB) \ $(call SET_SHARED_LIBRARY_ORIGIN), \ @@ -209,6 +216,9 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBZIP, \ -I$(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/libjava \ -I$(SUPPORT_OUTPUTDIR)/headers/java.base, \ CFLAGS_unix := $(BUILD_LIBZIP_MMAP) -UDEBUG, \ + DISABLED_WARNINGS_gcc := parentheses, \ + DISABLED_WARNINGS_clang := dangling-else, \ + DISABLED_WARNINGS_microsoft := 4267, \ MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libzip/mapfile-vers, \ REORDER := $(BUILD_LIBZIP_REORDER), \ LDFLAGS := $(LDFLAGS_JDKLIB) \ @@ -307,6 +317,12 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBJLI, \ LANG := C, \ OPTIMIZATION := HIGH, \ CFLAGS := $(LIBJLI_CFLAGS), \ + DISABLED_WARNINGS_gcc := pointer-to-int-cast sign-compare format-nonliteral \ + parentheses, \ + DISABLED_WARNINGS_clang := implicit-function-declaration parentheses \ + int-conversion, \ + DISABLED_WARNINGS_solstudio := E_ASM_DISABLES_OPTIMIZATION E_NEWLINE_NOT_LAST, \ + DISABLED_WARNINGS_microsoft := 4244 4047 4267, \ MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libjli/mapfile-vers, \ LDFLAGS := $(LDFLAGS_JDKLIB) \ $(call SET_SHARED_LIBRARY_ORIGIN), \ @@ -355,6 +371,7 @@ ifeq ($(OPENJDK_TARGET_OS), windows) LANG := C, \ OPTIMIZATION := HIGH, \ CFLAGS := $(STATIC_LIBRARY_FLAGS) $(LIBJLI_CFLAGS), \ + DISABLED_WARNINGS_microsoft := 4244 4047 4267, \ ARFLAGS := $(ARFLAGS), \ OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjli_static, \ DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) @@ -375,6 +392,8 @@ else ifeq ($(OPENJDK_TARGET_OS), macosx) LANG := C, \ OPTIMIZATION := HIGH, \ CFLAGS := $(CFLAGS_JDKLIB) $(LIBJLI_CFLAGS), \ + DISABLED_WARNINGS_clang := implicit-function-declaration parentheses \ + int-conversion, \ LDFLAGS := -nostdlib -r, \ OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjli_static, \ DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) @@ -401,4 +420,3 @@ else ifeq ($(OPENJDK_TARGET_OS), aix) TARGETS += $(BUILD_LIBJLI_STATIC) endif - diff --git a/jdk/make/lib/Lib-java.security.jgss.gmk b/jdk/make/lib/Lib-java.security.jgss.gmk index ba78eb4cc39..a92212f4b0e 100644 --- a/jdk/make/lib/Lib-java.security.jgss.gmk +++ b/jdk/make/lib/Lib-java.security.jgss.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -41,6 +41,7 @@ ifneq ($(OPENJDK_TARGET_OS), windows) CFLAGS := $(CFLAGS_JDKLIB) $(addprefix -I, $(LIBJ2GSS_SRC)) \ $(LIBJAVA_HEADER_FLAGS) \ -I$(SUPPORT_OUTPUTDIR)/headers/java.security.jgss, \ + DISABLED_WARNINGS_gcc := pointer-to-int-cast, \ MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libj2gss/mapfile-vers, \ LDFLAGS := $(LDFLAGS_JDKLIB) \ $(call SET_SHARED_LIBRARY_ORIGIN), \ @@ -82,6 +83,7 @@ ifneq ($(BUILD_CRYPTO), no) CFLAGS := $(CFLAGS_JDKLIB) \ $(addprefix -I, $(BUILD_LIBKRB5_SRC)) \ -I$(SUPPORT_OUTPUTDIR)/headers/java.security.jgss, \ + DISABLED_WARNINGS_clang := implicit-function-declaration, \ LDFLAGS := $(LDFLAGS_JDKLIB) \ $(call SET_SHARED_LIBRARY_ORIGIN), \ LDFLAGS_SUFFIX := $(BUILD_LIBKRB5_LIBS), \ diff --git a/jdk/make/lib/Lib-jdk.crypto.ec.gmk b/jdk/make/lib/Lib-jdk.crypto.ec.gmk index db75429ab6a..564eb402ae0 100644 --- a/jdk/make/lib/Lib-jdk.crypto.ec.gmk +++ b/jdk/make/lib/Lib-jdk.crypto.ec.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -54,6 +54,8 @@ ifeq ($(ENABLE_INTREE_EC), yes) -DMP_API_COMPATIBLE -DNSS_ECC_MORE_THAN_SUITE_B, \ CXXFLAGS := $(filter-out $(ECC_JNI_SOLSPARC_FILTER), $(CXXFLAGS_JDKLIB)) \ $(BUILD_LIBSUNEC_FLAGS), \ + DISABLED_WARNINGS_gcc := sign-compare, \ + DISABLED_WARNINGS_microsoft := 4101 4244 4146 4018, \ MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libsunec/mapfile-vers, \ LDFLAGS := $(LDFLAGS_JDKLIB) $(LDFLAGS_CXX_JDK), \ LDFLAGS_macosx := $(call SET_SHARED_LIBRARY_ORIGIN), \ diff --git a/jdk/make/lib/Lib-jdk.crypto.pkcs11.gmk b/jdk/make/lib/Lib-jdk.crypto.pkcs11.gmk index bbd6bc37c88..0672aa3a359 100644 --- a/jdk/make/lib/Lib-jdk.crypto.pkcs11.gmk +++ b/jdk/make/lib/Lib-jdk.crypto.pkcs11.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -39,6 +39,8 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBJ2PKCS11, \ CFLAGS := $(CFLAGS_JDKLIB) $(addprefix -I, $(LIBJ2PKCS11_SRC)) \ $(LIBJAVA_HEADER_FLAGS) \ -I$(SUPPORT_OUTPUTDIR)/headers/jdk.crypto.pkcs11, \ + DISABLED_WARNINGS_solstudio := E_DECLARATION_IN_CODE, \ + DISABLED_WARNINGS_microsoft := 4013 4267, \ MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libj2pkcs11/mapfile-vers, \ LDFLAGS := $(LDFLAGS_JDKLIB) \ $(call SET_SHARED_LIBRARY_ORIGIN), \ diff --git a/jdk/make/lib/Lib-jdk.deploy.osx.gmk b/jdk/make/lib/Lib-jdk.deploy.osx.gmk index 628c17fbced..f68b9c065e3 100644 --- a/jdk/make/lib/Lib-jdk.deploy.osx.gmk +++ b/jdk/make/lib/Lib-jdk.deploy.osx.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -40,6 +40,7 @@ ifeq ($(OPENJDK_TARGET_OS), macosx) CFLAGS := $(CFLAGS_JDKLIB) \ -I$(LIBAPPLESCRIPTENGINE_SRC) \ -I$(SUPPORT_OUTPUTDIR)/headers/jdk.deploy.osx, \ + DISABLED_WARNINGS_clang := implicit-function-declaration format, \ LDFLAGS := $(LDFLAGS_JDKLIB) \ $(call SET_SHARED_LIBRARY_ORIGIN), \ LDFLAGS_SUFFIX := -framework Cocoa \ @@ -71,6 +72,7 @@ ifeq ($(OPENJDK_TARGET_OS), macosx) OPTIMIZATION := LOW, \ CFLAGS := $(CFLAGS_JDKLIB) \ $(LIBOSX_CFLAGS), \ + DISABLED_WARNINGS_clang := deprecated-declarations, \ LDFLAGS := $(LDFLAGS_JDKLIB) \ -L$(SUPPORT_OUTPUTDIR)/modules_libs/java.desktop \ $(call SET_SHARED_LIBRARY_ORIGIN), \ diff --git a/jdk/make/lib/Lib-jdk.pack200.gmk b/jdk/make/lib/Lib-jdk.pack200.gmk index eb8caa61485..37e32d0a725 100644 --- a/jdk/make/lib/Lib-jdk.pack200.gmk +++ b/jdk/make/lib/Lib-jdk.pack200.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -40,6 +40,11 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBUNPACK, \ -I$(JDK_TOPDIR)/src/jdk.pack200/share/native/common-unpack \ $(LIBJAVA_HEADER_FLAGS), \ CFLAGS_release := -DPRODUCT, \ + DISABLED_WARNINGS_gcc := conversion-null sign-compare format-security \ + format-nonliteral parentheses, \ + DISABLED_WARNINGS_clang := bool-conversion format-security, \ + DISABLED_WARNINGS_solstudio := truncwarn, \ + DISABLED_WARNINGS_microsoft := 4267 4018, \ MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libunpack/mapfile-vers, \ LDFLAGS := $(LDFLAGS_JDKLIB) $(LDFLAGS_CXX_JDK) \ $(call SET_SHARED_LIBRARY_ORIGIN), \ diff --git a/jdk/make/lib/NetworkingLibraries.gmk b/jdk/make/lib/NetworkingLibraries.gmk index 57d86eabfb5..4231121123e 100644 --- a/jdk/make/lib/NetworkingLibraries.gmk +++ b/jdk/make/lib/NetworkingLibraries.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -33,6 +33,9 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBNET, \ OPTIMIZATION := LOW, \ CFLAGS := $(CFLAGS_JDKLIB) -I$(SUPPORT_OUTPUTDIR)/headers/java.base \ $(LIBJAVA_HEADER_FLAGS) $(addprefix -I, $(LIBNET_SRC_DIRS)), \ + DISABLED_WARNINGS_gcc := format-nonliteral, \ + DISABLED_WARNINGS_clang := parentheses-equality constant-logical-operand, \ + DISABLED_WARNINGS_microsoft := 4244 4047 4133, \ MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libnet/mapfile-vers, \ LDFLAGS := $(LDFLAGS_JDKLIB) \ $(call SET_SHARED_LIBRARY_ORIGIN), \ diff --git a/jdk/make/lib/NioLibraries.gmk b/jdk/make/lib/NioLibraries.gmk index 9a6e3e07ced..fd973ccc535 100644 --- a/jdk/make/lib/NioLibraries.gmk +++ b/jdk/make/lib/NioLibraries.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -69,6 +69,9 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBNIO, \ OPTIMIZATION := HIGH, \ CFLAGS := $(CFLAGS_JDKLIB) \ $(BUILD_LIBNIO_CFLAGS), \ + DISABLED_WARNINGS_gcc := type-limits, \ + DISABLED_WARNINGS_clang := tautological-compare, \ + DISABLED_WARNINGS_microsoft := 4244, \ MAPFILE := $(BUILD_LIBNIO_MAPFILE), \ LDFLAGS := $(LDFLAGS_JDKLIB) $(BUILD_LIBNIO_LDFLAGS) \ $(call SET_SHARED_LIBRARY_ORIGIN), \ @@ -92,4 +95,3 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBNIO, \ TARGETS += $(BUILD_LIBNIO) $(BUILD_LIBNIO): $(BUILD_LIBNET) - diff --git a/jdk/make/lib/PlatformLibraries.gmk b/jdk/make/lib/PlatformLibraries.gmk index 14592213e40..0035b1dfbbb 100644 --- a/jdk/make/lib/PlatformLibraries.gmk +++ b/jdk/make/lib/PlatformLibraries.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -38,6 +38,7 @@ ifeq ($(OPENJDK_TARGET_OS), macosx) CFLAGS := $(CFLAGS_JDKLIB) \ $(addprefix -I, $(LIBOSXAPP_SRC)) \ -I$(SUPPORT_OUTPUTDIR)/headers/java.desktop, \ + DISABLED_WARNINGS_clang := objc-method-access objc-root-class, \ LDFLAGS := $(LDFLAGS_JDKLIB) \ $(call SET_SHARED_LIBRARY_ORIGIN), \ LDFLAGS_SUFFIX_macosx := \ @@ -59,4 +60,3 @@ ifeq ($(OPENJDK_TARGET_OS), macosx) TARGETS += $(BUILD_LIBOSXAPP) endif - diff --git a/jdk/make/lib/SoundLibraries.gmk b/jdk/make/lib/SoundLibraries.gmk index ec3b99d8447..f123d179d7a 100644 --- a/jdk/make/lib/SoundLibraries.gmk +++ b/jdk/make/lib/SoundLibraries.gmk @@ -129,6 +129,8 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBJSOUND, \ CFLAGS := $(CFLAGS_JDKLIB) \ $(LIBJSOUND_CFLAGS), \ CXXFLAGS := $(CXXFLAGS_JDKLIB) $(LIBJSOUND_CFLAGS), \ + DISABLED_WARNINGS_clang := implicit-function-declaration \ + deprecated-writable-strings, \ MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libjsound/mapfile-vers, \ LDFLAGS := $(LDFLAGS_JDKLIB) \ $(call SET_SHARED_LIBRARY_ORIGIN), \ @@ -175,6 +177,7 @@ ifneq ($(filter jsoundalsa, $(EXTRA_SOUND_JNI_LIBS)), ) -DUSE_PORTS=TRUE \ -DUSE_PLATFORM_MIDI_OUT=TRUE \ -DUSE_PLATFORM_MIDI_IN=TRUE, \ + DISABLED_WARNINGS_gcc := parentheses, \ MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libjsoundalsa/mapfile-vers, \ LDFLAGS := $(LDFLAGS_JDKLIB) \ $(call SET_SHARED_LIBRARY_ORIGIN), \ From d0ff6ad56574d8c7e6371d9b2f75ab8adbe5da8e Mon Sep 17 00:00:00 2001 From: Magnus Ihse Bursie Date: Mon, 9 Mar 2015 16:18:33 +0100 Subject: [PATCH 11/76] 8074690: Fix for JDK-8074429 was not complete Reviewed-by: alanb, erikj --- jdk/make/gensrc/Gensrc-jdk.dev.gmk | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/jdk/make/gensrc/Gensrc-jdk.dev.gmk b/jdk/make/gensrc/Gensrc-jdk.dev.gmk index 0c956abbc12..b8f57aa529e 100644 --- a/jdk/make/gensrc/Gensrc-jdk.dev.gmk +++ b/jdk/make/gensrc/Gensrc-jdk.dev.gmk @@ -32,8 +32,7 @@ include GensrcProperties.gmk $(eval $(call SetupCompileProperties,COMPILE_PROPERTIES, \ $(filter %.properties, \ $(call CacheFind, \ - $(JDK_TOPDIR)/src/jdk.dev/share/classes/jdk/tools/jimage/resources \ - $(JDK_TOPDIR)/src/jdk.dev/share/classes/sun/tools/jar/resources)), \ + $(JDK_TOPDIR)/src/jdk.dev/share/classes/jdk/tools/jimage/resources)), \ ListResourceBundle)) TARGETS += $(COMPILE_PROPERTIES) From 6e61892373ebff644d85c636479d8d4c5c30e188 Mon Sep 17 00:00:00 2001 From: Mark Sheppard Date: Mon, 9 Mar 2015 18:48:40 +0000 Subject: [PATCH 12/76] 8065078: NetworkInterface.getNetworkInterfaces() triggers intermittent test failures Reviewed-by: chegar --- .../native/libnet/NetworkInterface_winXP.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/jdk/src/java.base/windows/native/libnet/NetworkInterface_winXP.c b/jdk/src/java.base/windows/native/libnet/NetworkInterface_winXP.c index 2308a59b44b..c245045696e 100644 --- a/jdk/src/java.base/windows/native/libnet/NetworkInterface_winXP.c +++ b/jdk/src/java.base/windows/native/libnet/NetworkInterface_winXP.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,6 +28,7 @@ #include /* needed for htonl */ #include #include +#include #include "java_net_NetworkInterface.h" #include "jni_util.h" @@ -70,7 +71,7 @@ void printnifs (netif *netifPP, char *str) { #endif -static int bufsize = 1024; +static int bufsize = 4096; /* * return an array of IP_ADAPTER_ADDRESSES containing one element @@ -102,7 +103,11 @@ static int getAdapters (JNIEnv *env, IP_ADAPTER_ADDRESSES **adapters) { ret = GetAdaptersAddresses(AF_UNSPEC, flags, NULL, adapterInfo, &len); if (ret == ERROR_BUFFER_OVERFLOW) { - IP_ADAPTER_ADDRESSES * newAdapterInfo = + IP_ADAPTER_ADDRESSES * newAdapterInfo = NULL; + if (len < (ULONG_MAX - bufsize)) { + len = len + bufsize; + } + newAdapterInfo = (IP_ADAPTER_ADDRESSES *) realloc (adapterInfo, len); if (newAdapterInfo == NULL) { free(adapterInfo); @@ -113,7 +118,6 @@ static int getAdapters (JNIEnv *env, IP_ADAPTER_ADDRESSES **adapters) { adapterInfo = newAdapterInfo; - bufsize = len; ret = GetAdaptersAddresses(AF_UNSPEC, flags, NULL, adapterInfo, &len); } @@ -176,7 +180,11 @@ IP_ADAPTER_ADDRESSES *getAdapter (JNIEnv *env, jint index) { flags |= GAA_FLAG_INCLUDE_PREFIX; val = GetAdaptersAddresses(AF_UNSPEC, flags, NULL, adapterInfo, &len); if (val == ERROR_BUFFER_OVERFLOW) { - IP_ADAPTER_ADDRESSES * newAdapterInfo = + IP_ADAPTER_ADDRESSES * newAdapterInfo = NULL; + if (len < (ULONG_MAX - bufsize)) { + len = len + bufsize; + } + newAdapterInfo = (IP_ADAPTER_ADDRESSES *) realloc (adapterInfo, len); if (newAdapterInfo == NULL) { free(adapterInfo); @@ -187,7 +195,6 @@ IP_ADAPTER_ADDRESSES *getAdapter (JNIEnv *env, jint index) { adapterInfo = newAdapterInfo; - bufsize = len; val = GetAdaptersAddresses(AF_UNSPEC, flags, NULL, adapterInfo, &len); } From 47e85e2963edaa88cfc5a541d59f11db5d1b183b Mon Sep 17 00:00:00 2001 From: Jason Uh Date: Mon, 9 Mar 2015 17:21:07 -0700 Subject: [PATCH 13/76] 8073430: Deprecate security APIs that have been superseded Reviewed-by: mullan, weijun --- .../security/cert/internal/x509/X509V1CertImpl.java | 7 ++++++- .../share/classes/java/security/acl/Acl.java | 4 ++++ .../share/classes/java/security/acl/AclEntry.java | 6 +++++- .../java/security/acl/AclNotFoundException.java | 6 +++++- .../share/classes/java/security/acl/Group.java | 6 +++++- .../java/security/acl/LastOwnerException.java | 6 +++++- .../java/security/acl/NotOwnerException.java | 6 +++++- .../share/classes/java/security/acl/Owner.java | 5 ++++- .../share/classes/java/security/acl/Permission.java | 6 +++++- .../classes/java/security/acl/package-info.java | 10 ++++++---- .../javax/net/ssl/HandshakeCompletedEvent.java | 6 +++++- .../share/classes/javax/net/ssl/SSLSession.java | 6 +++++- .../classes/javax/security/cert/Certificate.java | 4 +++- .../security/cert/CertificateEncodingException.java | 4 +++- .../javax/security/cert/CertificateException.java | 4 +++- .../security/cert/CertificateExpiredException.java | 4 +++- .../cert/CertificateNotYetValidException.java | 4 +++- .../security/cert/CertificateParsingException.java | 4 +++- .../javax/security/cert/X509Certificate.java | 4 +++- .../classes/javax/security/cert/package-info.java | 11 ++++++----- .../https/AbstractDelegateHttpsURLConnection.java | 13 ++++++++++--- .../sun/net/www/protocol/https/HttpsClient.java | 7 ++++++- .../www/protocol/https/HttpsURLConnectionImpl.java | 7 ++++++- .../classes/sun/security/ssl/SSLSessionImpl.java | 7 ++++++- 24 files changed, 115 insertions(+), 32 deletions(-) diff --git a/jdk/src/java.base/share/classes/com/sun/security/cert/internal/x509/X509V1CertImpl.java b/jdk/src/java.base/share/classes/com/sun/security/cert/internal/x509/X509V1CertImpl.java index 07a31a0ef34..b9ffb200a81 100644 --- a/jdk/src/java.base/share/classes/com/sun/security/cert/internal/x509/X509V1CertImpl.java +++ b/jdk/src/java.base/share/classes/com/sun/security/cert/internal/x509/X509V1CertImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -45,8 +45,13 @@ import java.util.Vector; * The X509V1CertImpl class is used as a conversion wrapper around * sun.security.x509.X509Cert certificates when running under JDK1.1.x. * + * @deprecated This is the implementation class for the deprecated + * {@code javax.security.cert.X509Certificate} class. The classes in the + * {@code java.security.cert} package should be used instead. + * * @author Jeff Nisewanger */ +@Deprecated public class X509V1CertImpl extends X509Certificate implements Serializable { static final long serialVersionUID = -2048442350420423405L; private java.security.cert.X509Certificate wrappedCert; diff --git a/jdk/src/java.base/share/classes/java/security/acl/Acl.java b/jdk/src/java.base/share/classes/java/security/acl/Acl.java index cffb48e46a7..9131966a08e 100644 --- a/jdk/src/java.base/share/classes/java/security/acl/Acl.java +++ b/jdk/src/java.base/share/classes/java/security/acl/Acl.java @@ -82,8 +82,12 @@ import java.security.Principal; * @see java.security.acl.Acl#getPermissions * * @author Satish Dharmaraj + * + * @deprecated This package has been replaced by {@code java.security.Policy} + * and related classes since 1.2. */ +@Deprecated public interface Acl extends Owner { /** diff --git a/jdk/src/java.base/share/classes/java/security/acl/AclEntry.java b/jdk/src/java.base/share/classes/java/security/acl/AclEntry.java index cd9675f34a1..dd4e548ab47 100644 --- a/jdk/src/java.base/share/classes/java/security/acl/AclEntry.java +++ b/jdk/src/java.base/share/classes/java/security/acl/AclEntry.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -50,7 +50,11 @@ import java.security.Principal; * @see java.security.acl.Acl * * @author Satish Dharmaraj + * + * @deprecated This package has been replaced by {@code java.security.Policy} + * and related classes since 1.2. */ +@Deprecated public interface AclEntry extends Cloneable { /** diff --git a/jdk/src/java.base/share/classes/java/security/acl/AclNotFoundException.java b/jdk/src/java.base/share/classes/java/security/acl/AclNotFoundException.java index 6f08e178e71..0a153e25665 100644 --- a/jdk/src/java.base/share/classes/java/security/acl/AclNotFoundException.java +++ b/jdk/src/java.base/share/classes/java/security/acl/AclNotFoundException.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -30,7 +30,11 @@ package java.security.acl; * non-existent ACL (Access Control List). * * @author Satish Dharmaraj + * + * @deprecated This package has been replaced by {@code java.security.Policy} + * and related classes since 1.2. */ +@Deprecated public class AclNotFoundException extends Exception { private static final long serialVersionUID = 5684295034092681791L; diff --git a/jdk/src/java.base/share/classes/java/security/acl/Group.java b/jdk/src/java.base/share/classes/java/security/acl/Group.java index ebd9c445282..9ff69f563cb 100644 --- a/jdk/src/java.base/share/classes/java/security/acl/Group.java +++ b/jdk/src/java.base/share/classes/java/security/acl/Group.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -39,7 +39,11 @@ import java.security.Principal; * Principal or Group. * * @author Satish Dharmaraj + * + * @deprecated This package has been replaced by {@code java.security.Policy} + * and related classes since 1.2. */ +@Deprecated public interface Group extends Principal { /** diff --git a/jdk/src/java.base/share/classes/java/security/acl/LastOwnerException.java b/jdk/src/java.base/share/classes/java/security/acl/LastOwnerException.java index 196c8f1bd86..b25bf84d46c 100644 --- a/jdk/src/java.base/share/classes/java/security/acl/LastOwnerException.java +++ b/jdk/src/java.base/share/classes/java/security/acl/LastOwnerException.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -32,7 +32,11 @@ package java.security.acl; * @see java.security.acl.Owner#deleteOwner * * @author Satish Dharmaraj + * + * @deprecated This package has been replaced by {@code java.security.Policy} + * and related classes since 1.2. */ +@Deprecated public class LastOwnerException extends Exception { private static final long serialVersionUID = -5141997548211140359L; diff --git a/jdk/src/java.base/share/classes/java/security/acl/NotOwnerException.java b/jdk/src/java.base/share/classes/java/security/acl/NotOwnerException.java index 0a4b04b22d5..68d214d7185 100644 --- a/jdk/src/java.base/share/classes/java/security/acl/NotOwnerException.java +++ b/jdk/src/java.base/share/classes/java/security/acl/NotOwnerException.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -31,7 +31,11 @@ package java.security.acl; * the object, but the Principal attempting the modification is not an owner. * * @author Satish Dharmaraj + * + * @deprecated This package has been replaced by {@code java.security.Policy} + * and related classes since 1.2. */ +@Deprecated public class NotOwnerException extends Exception { private static final long serialVersionUID = -5555597911163362399L; diff --git a/jdk/src/java.base/share/classes/java/security/acl/Owner.java b/jdk/src/java.base/share/classes/java/security/acl/Owner.java index 2f649d40b33..2a4999b277d 100644 --- a/jdk/src/java.base/share/classes/java/security/acl/Owner.java +++ b/jdk/src/java.base/share/classes/java/security/acl/Owner.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -36,7 +36,10 @@ import java.security.Principal; * * @see java.security.acl.Acl * + * @deprecated This package has been replaced by {@code java.security.Policy} + * and related classes since 1.2. */ +@Deprecated public interface Owner { /** diff --git a/jdk/src/java.base/share/classes/java/security/acl/Permission.java b/jdk/src/java.base/share/classes/java/security/acl/Permission.java index 380a0102cd0..236f10795f0 100644 --- a/jdk/src/java.base/share/classes/java/security/acl/Permission.java +++ b/jdk/src/java.base/share/classes/java/security/acl/Permission.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -31,7 +31,11 @@ package java.security.acl; * a particular type of access to a resource. * * @author Satish Dharmaraj + * + * @deprecated This package has been replaced by {@code java.security.Policy} + * and related classes since 1.2. */ +@Deprecated public interface Permission { /** diff --git a/jdk/src/java.base/share/classes/java/security/acl/package-info.java b/jdk/src/java.base/share/classes/java/security/acl/package-info.java index fbe5a8de6b9..f0362fdf0b6 100644 --- a/jdk/src/java.base/share/classes/java/security/acl/package-info.java +++ b/jdk/src/java.base/share/classes/java/security/acl/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -24,10 +24,12 @@ */ /** - * The classes and interfaces in this package have been - * superseded by classes in the java.security package. - * See that package and, for example, java.security.Permission for details. + * The classes and interfaces in this package have been deprecated. + * The {@code java.security} package contains suitable replacements. + * See that package and, for example, {@code java.security.Permission} + * for details. * * @since 1.1 */ +@Deprecated package java.security.acl; diff --git a/jdk/src/java.base/share/classes/javax/net/ssl/HandshakeCompletedEvent.java b/jdk/src/java.base/share/classes/javax/net/ssl/HandshakeCompletedEvent.java index f6abafaea85..fb5b8ed704d 100644 --- a/jdk/src/java.base/share/classes/javax/net/ssl/HandshakeCompletedEvent.java +++ b/jdk/src/java.base/share/classes/javax/net/ssl/HandshakeCompletedEvent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -152,7 +152,11 @@ public class HandshakeCompletedEvent extends EventObject * {@link javax.security.cert.X509Certificate} format). * @exception SSLPeerUnverifiedException if the peer is not verified. * @see #getPeerPrincipal() + * @deprecated The {@link #getPeerCertificates()} method that returns an + * array of {@code java.security.cert.Certificate} should + * be used instead. */ + @Deprecated public javax.security.cert.X509Certificate [] getPeerCertificateChain() throws SSLPeerUnverifiedException { diff --git a/jdk/src/java.base/share/classes/javax/net/ssl/SSLSession.java b/jdk/src/java.base/share/classes/javax/net/ssl/SSLSession.java index d98edf0b365..5f6317dd295 100644 --- a/jdk/src/java.base/share/classes/javax/net/ssl/SSLSession.java +++ b/jdk/src/java.base/share/classes/javax/net/ssl/SSLSession.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -272,7 +272,11 @@ public interface SSLSession { * @exception SSLPeerUnverifiedException if the peer's identity * has not been verified * @see #getPeerPrincipal() + * @deprecated The {@link #getPeerCertificates()} method that returns an + * array of {@code java.security.cert.Certificate} should + * be used instead. */ + @Deprecated public javax.security.cert.X509Certificate [] getPeerCertificateChain() throws SSLPeerUnverifiedException; diff --git a/jdk/src/java.base/share/classes/javax/security/cert/Certificate.java b/jdk/src/java.base/share/classes/javax/security/cert/Certificate.java index 10fd767c157..84fdefde609 100644 --- a/jdk/src/java.base/share/classes/javax/security/cert/Certificate.java +++ b/jdk/src/java.base/share/classes/javax/security/cert/Certificate.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -57,9 +57,11 @@ import java.security.SignatureException; * * @since 1.4 * @see X509Certificate + * @deprecated Use the classes in {@code java.security.cert} instead. * * @author Hemma Prafullchandra */ +@Deprecated public abstract class Certificate { /** diff --git a/jdk/src/java.base/share/classes/javax/security/cert/CertificateEncodingException.java b/jdk/src/java.base/share/classes/javax/security/cert/CertificateEncodingException.java index 1496c754181..95fbcfbeb1e 100644 --- a/jdk/src/java.base/share/classes/javax/security/cert/CertificateEncodingException.java +++ b/jdk/src/java.base/share/classes/javax/security/cert/CertificateEncodingException.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -38,7 +38,9 @@ package javax.security.cert; * * @since 1.4 * @author Hemma Prafullchandra + * @deprecated Use the classes in {@code java.security.cert} instead. */ +@Deprecated public class CertificateEncodingException extends CertificateException { private static final long serialVersionUID = -8187642723048403470L; diff --git a/jdk/src/java.base/share/classes/javax/security/cert/CertificateException.java b/jdk/src/java.base/share/classes/javax/security/cert/CertificateException.java index 68ee6798b8c..144bb97fe6a 100644 --- a/jdk/src/java.base/share/classes/javax/security/cert/CertificateException.java +++ b/jdk/src/java.base/share/classes/javax/security/cert/CertificateException.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -38,7 +38,9 @@ package javax.security.cert; * @author Hemma Prafullchandra * @since 1.4 * @see Certificate + * @deprecated Use the classes in {@code java.security.cert} instead. */ +@Deprecated public class CertificateException extends Exception { private static final long serialVersionUID = -5757213374030785290L; diff --git a/jdk/src/java.base/share/classes/javax/security/cert/CertificateExpiredException.java b/jdk/src/java.base/share/classes/javax/security/cert/CertificateExpiredException.java index 7e4579f2ebe..9f4eb7d4aed 100644 --- a/jdk/src/java.base/share/classes/javax/security/cert/CertificateExpiredException.java +++ b/jdk/src/java.base/share/classes/javax/security/cert/CertificateExpiredException.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -40,7 +40,9 @@ package javax.security.cert; * * @since 1.4 * @author Hemma Prafullchandra + * @deprecated Use the classes in {@code java.security.cert} instead. */ +@Deprecated public class CertificateExpiredException extends CertificateException { private static final long serialVersionUID = 5091601212177261883L; diff --git a/jdk/src/java.base/share/classes/javax/security/cert/CertificateNotYetValidException.java b/jdk/src/java.base/share/classes/javax/security/cert/CertificateNotYetValidException.java index 9a53daa661d..c5c67c7f61e 100644 --- a/jdk/src/java.base/share/classes/javax/security/cert/CertificateNotYetValidException.java +++ b/jdk/src/java.base/share/classes/javax/security/cert/CertificateNotYetValidException.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -40,7 +40,9 @@ package javax.security.cert; * * @since 1.4 * @author Hemma Prafullchandra + * @deprecated Use the classes in {@code java.security.cert} instead. */ +@Deprecated public class CertificateNotYetValidException extends CertificateException { private static final long serialVersionUID = -8976172474266822818L; diff --git a/jdk/src/java.base/share/classes/javax/security/cert/CertificateParsingException.java b/jdk/src/java.base/share/classes/javax/security/cert/CertificateParsingException.java index 4378587bb70..cd1f6ac507c 100644 --- a/jdk/src/java.base/share/classes/javax/security/cert/CertificateParsingException.java +++ b/jdk/src/java.base/share/classes/javax/security/cert/CertificateParsingException.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -39,7 +39,9 @@ package javax.security.cert; * * @since 1.4 * @author Hemma Prafullchandra + * @deprecated Use the classes in {@code java.security.cert} instead. */ +@Deprecated public class CertificateParsingException extends CertificateException { private static final long serialVersionUID = -8449352422951136229L; diff --git a/jdk/src/java.base/share/classes/javax/security/cert/X509Certificate.java b/jdk/src/java.base/share/classes/javax/security/cert/X509Certificate.java index 1ef7ddcb56a..666524a084c 100644 --- a/jdk/src/java.base/share/classes/javax/security/cert/X509Certificate.java +++ b/jdk/src/java.base/share/classes/javax/security/cert/X509Certificate.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -124,7 +124,9 @@ import java.util.Date; * @see Certificate * @see java.security.cert.X509Extension * @see java.security.Security security properties + * @deprecated Use the classes in {@code java.security.cert} instead. */ +@Deprecated public abstract class X509Certificate extends Certificate { /* diff --git a/jdk/src/java.base/share/classes/javax/security/cert/package-info.java b/jdk/src/java.base/share/classes/javax/security/cert/package-info.java index c09a0eafabc..a1d7a34fae1 100644 --- a/jdk/src/java.base/share/classes/javax/security/cert/package-info.java +++ b/jdk/src/java.base/share/classes/javax/security/cert/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,15 +26,16 @@ /** * Provides classes for public key certificates. * - * These classes include a simplified version of the - * java.security.cert package. These classes were developed - * as part of the Java Secure Socket + * This package has been deprecated. These classes include a simplified + * version of the {@code java.security.cert} package. These classes were + * developed as part of the Java Secure Socket * Extension (JSSE). When JSSE was added to the J2SE version 1.4, this * package was added for backward-compatibility reasons only. * * New applications should not use this package, but rather - * java.security.cert. + * {@code java.security.cert}. * * @since 1.4 */ +@Deprecated package javax.security.cert; diff --git a/jdk/src/java.base/share/classes/sun/net/www/protocol/https/AbstractDelegateHttpsURLConnection.java b/jdk/src/java.base/share/classes/sun/net/www/protocol/https/AbstractDelegateHttpsURLConnection.java index 3b8ff0c09af..9d70053d35f 100644 --- a/jdk/src/java.base/share/classes/sun/net/www/protocol/https/AbstractDelegateHttpsURLConnection.java +++ b/jdk/src/java.base/share/classes/sun/net/www/protocol/https/AbstractDelegateHttpsURLConnection.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -244,7 +244,9 @@ 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 { @@ -262,7 +264,12 @@ public abstract class AbstractDelegateHttpsURLConnection extends /** * Returns the server's X.509 certificate chain, or null if * the server did not authenticate. + * + * @deprecated This method returns the deprecated + * {@code javax.security.cert.X509Certificate} type. + * Use {@code getServerCertificates()} instead. */ + @Deprecated public javax.security.cert.X509Certificate[] getServerCertificateChain() throws SSLPeerUnverifiedException { if (cachedResponse != null) { @@ -271,7 +278,7 @@ public abstract class AbstractDelegateHttpsURLConnection extends if (http == null) { throw new IllegalStateException("connection not yet open"); } else { - return ((HttpsClient)http).getServerCertificateChain (); + return ((HttpsClient)http).getServerCertificateChain(); } } diff --git a/jdk/src/java.base/share/classes/sun/net/www/protocol/https/HttpsClient.java b/jdk/src/java.base/share/classes/sun/net/www/protocol/https/HttpsClient.java index 30e9fb0840a..5bc55ed9e50 100644 --- a/jdk/src/java.base/share/classes/sun/net/www/protocol/https/HttpsClient.java +++ b/jdk/src/java.base/share/classes/sun/net/www/protocol/https/HttpsClient.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -699,7 +699,12 @@ final class HttpsClient extends HttpClient /** * Returns the X.509 certificate chain with which the server * authenticated itself, or null if the server did not authenticate. + * + * @deprecated This method returns the deprecated + * {@code javax.security.cert.X509Certificate} type. + * Use {@code getServerCertificates()} instead. */ + @Deprecated javax.security.cert.X509Certificate [] getServerCertificateChain() throws SSLPeerUnverifiedException { diff --git a/jdk/src/java.base/share/classes/sun/net/www/protocol/https/HttpsURLConnectionImpl.java b/jdk/src/java.base/share/classes/sun/net/www/protocol/https/HttpsURLConnectionImpl.java index c3067c044e0..5477b2cab80 100644 --- a/jdk/src/java.base/share/classes/sun/net/www/protocol/https/HttpsURLConnectionImpl.java +++ b/jdk/src/java.base/share/classes/sun/net/www/protocol/https/HttpsURLConnectionImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -204,7 +204,12 @@ public class HttpsURLConnectionImpl * NOTE: This method is not necessary for the version of this class * implementing javax.net.ssl.HttpsURLConnection, but provided for * compatibility with the com.sun.net.ssl.HttpsURLConnection version. + * + * @deprecated This method returns the deprecated + * {@code javax.security.cert.X509Certificate} type. + * Use {@code getServerCertificates()} instead. */ + @Deprecated public javax.security.cert.X509Certificate[] getServerCertificateChain() { try { return delegate.getServerCertificateChain(); diff --git a/jdk/src/java.base/share/classes/sun/security/ssl/SSLSessionImpl.java b/jdk/src/java.base/share/classes/sun/security/ssl/SSLSessionImpl.java index b5f304b6b97..881c4bf82fb 100644 --- a/jdk/src/java.base/share/classes/sun/security/ssl/SSLSessionImpl.java +++ b/jdk/src/java.base/share/classes/sun/security/ssl/SSLSessionImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -464,8 +464,13 @@ final class SSLSessionImpl extends ExtendedSSLSession { * * @return array of peer X.509 certs, with the peer's own cert * first in the chain, and with the "root" CA last. + * + * @deprecated This method returns the deprecated + * {@code javax.security.cert.X509Certificate} type. + * Use {@code getPeerCertificates()} instead. */ @Override + @Deprecated public javax.security.cert.X509Certificate[] getPeerCertificateChain() throws SSLPeerUnverifiedException { // From 24bf7ba966548dfde80a87c1b718031a1d200454 Mon Sep 17 00:00:00 2001 From: Joe Darcy Date: Mon, 9 Mar 2015 17:37:34 -0700 Subject: [PATCH 14/76] 8074714: Add javax/xml/jaxp/testng/validation to othervm.dirs in TEST.ROOT Reviewed-by: lancea --- jdk/test/TEST.ROOT | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jdk/test/TEST.ROOT b/jdk/test/TEST.ROOT index 6df529bccbd..7b89da112cf 100644 --- a/jdk/test/TEST.ROOT +++ b/jdk/test/TEST.ROOT @@ -8,7 +8,7 @@ keys=2d dnd i18n othervm.dirs=java/awt java/beans javax/accessibility javax/imageio javax/sound javax/print javax/management com/sun/awt sun/awt sun/java2d sun/pisces # Tests that cannot run concurrently -exclusiveAccess.dirs=java/rmi/Naming java/util/prefs sun/management/jmxremote sun/tools/jstatd sun/security/mscapi java/util/stream +exclusiveAccess.dirs=java/rmi/Naming java/util/prefs sun/management/jmxremote sun/tools/jstatd sun/security/mscapi java/util/stream javax/xml/jaxp/testng/validation # Group definitions groups=TEST.groups [closed/TEST.groups] From f54b0ebdc29407bdcb83be5e43787dd957e6fe30 Mon Sep 17 00:00:00 2001 From: Joe Darcy Date: Mon, 9 Mar 2015 18:16:52 -0700 Subject: [PATCH 15/76] 8074788: Javadoc typo in PKCS8EncodedKeySpec Reviewed-by: xuelei --- .../share/classes/java/security/spec/PKCS8EncodedKeySpec.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jdk/src/java.base/share/classes/java/security/spec/PKCS8EncodedKeySpec.java b/jdk/src/java.base/share/classes/java/security/spec/PKCS8EncodedKeySpec.java index 90a94ed3436..89bf11d94ae 100644 --- a/jdk/src/java.base/share/classes/java/security/spec/PKCS8EncodedKeySpec.java +++ b/jdk/src/java.base/share/classes/java/security/spec/PKCS8EncodedKeySpec.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -89,7 +89,7 @@ public class PKCS8EncodedKeySpec extends EncodedKeySpec { * Java Cryptography Architecture Standard Algorithm Name Documentation * for information about standard algorithm names. * @throws NullPointerException if {@code encodedKey} - * or {@algorithm} is null. + * or {@code algorithm} is null. * @throws IllegalArgumentException if {@code algorithm} is * the empty string {@code ""} * @since 1.9 From 71d53d5bb7d4f2c91ab3017e8b88e7cce50d1ad6 Mon Sep 17 00:00:00 2001 From: Amy Lu Date: Tue, 10 Mar 2015 13:30:21 +0100 Subject: [PATCH 16/76] 8074674: Doclint regression in java/util/regex/Matcher.java Reviewed-by: psandoz --- jdk/src/java.base/share/classes/java/util/regex/Matcher.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jdk/src/java.base/share/classes/java/util/regex/Matcher.java b/jdk/src/java.base/share/classes/java/util/regex/Matcher.java index 0fcd3eac11f..96cf39a6338 100644 --- a/jdk/src/java.base/share/classes/java/util/regex/Matcher.java +++ b/jdk/src/java.base/share/classes/java/util/regex/Matcher.java @@ -1183,7 +1183,7 @@ public final class Matcher implements MatchResult { * *

Given the regular expression dog, the input * "zzzdogzzzdogzzz", and the function - * mr -> mr.group().toUpperCase(), an invocation of this method on + * {@code mr -> mr.group().toUpperCase()}, an invocation of this method on * a matcher for that expression would yield the string * "zzzDOGzzzDOGzzz". * @@ -1405,7 +1405,7 @@ public final class Matcher implements MatchResult { * *

Given the regular expression dog, the input * "zzzdogzzzdogzzz", and the function - * mr -> mr.group().toUpperCase(), an invocation of this method on + * {@code mr -> mr.group().toUpperCase()}, an invocation of this method on * a matcher for that expression would yield the string * "zzzDOGzzzdogzzz". * From 367a429ff43ebb2b684914d607e11b608c0e2de0 Mon Sep 17 00:00:00 2001 From: Roger Riggs Date: Tue, 10 Mar 2015 16:44:45 -0400 Subject: [PATCH 17/76] 8058464: (process spec) ProcessBuilder.redirectXXX throws unspecified NPE Add a class level spec for null arguments throwing NPE in ProcessBuilder Reviewed-by: martin, alanb --- .../share/classes/java/lang/ProcessBuilder.java | 11 +++++------ jdk/test/java/lang/ProcessBuilder/Basic.java | 10 +++++++++- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/jdk/src/java.base/share/classes/java/lang/ProcessBuilder.java b/jdk/src/java.base/share/classes/java/lang/ProcessBuilder.java index 72b260309d6..940084cfbc6 100644 --- a/jdk/src/java.base/share/classes/java/lang/ProcessBuilder.java +++ b/jdk/src/java.base/share/classes/java/lang/ProcessBuilder.java @@ -171,6 +171,11 @@ import java.util.Map; * variables, first call {@link java.util.Map#clear() Map.clear()} * before adding environment variables. * + *

+ * Unless otherwise noted, passing a {@code null} argument to a constructor + * or method in this class will cause a {@link NullPointerException} to be + * thrown. + * * @author Martin Buchholz * @since 1.5 */ @@ -193,7 +198,6 @@ public final class ProcessBuilder * command. * * @param command the list containing the program and its arguments - * @throws NullPointerException if the argument is null */ public ProcessBuilder(List command) { if (command == null) @@ -228,8 +232,6 @@ public final class ProcessBuilder * * @param command the list containing the program and its arguments * @return this process builder - * - * @throws NullPointerException if the argument is null */ public ProcessBuilder command(List command) { if (command == null) @@ -554,7 +556,6 @@ public final class ProcessBuilder * } * * @param file The {@code File} for the {@code Redirect}. - * @throws NullPointerException if the specified file is null * @return a redirect to read from the specified file */ public static Redirect from(final File file) { @@ -581,7 +582,6 @@ public final class ProcessBuilder * } * * @param file The {@code File} for the {@code Redirect}. - * @throws NullPointerException if the specified file is null * @return a redirect to write to the specified file */ public static Redirect to(final File file) { @@ -612,7 +612,6 @@ public final class ProcessBuilder * } * * @param file The {@code File} for the {@code Redirect}. - * @throws NullPointerException if the specified file is null * @return a redirect to append to the specified file */ public static Redirect appendTo(final File file) { diff --git a/jdk/test/java/lang/ProcessBuilder/Basic.java b/jdk/test/java/lang/ProcessBuilder/Basic.java index 03d165f7111..cfc4d443ff8 100644 --- a/jdk/test/java/lang/ProcessBuilder/Basic.java +++ b/jdk/test/java/lang/ProcessBuilder/Basic.java @@ -26,7 +26,7 @@ * @bug 4199068 4738465 4937983 4930681 4926230 4931433 4932663 4986689 * 5026830 5023243 5070673 4052517 4811767 6192449 6397034 6413313 * 6464154 6523983 6206031 4960438 6631352 6631966 6850957 6850958 - * 4947220 7018606 7034570 4244896 5049299 8003488 8054494 + * 4947220 7018606 7034570 4244896 5049299 8003488 8054494 8058464 * @summary Basic tests for Process and Environment Variable code * @run main/othervm/timeout=300 Basic * @run main/othervm/timeout=300 -Djdk.lang.Process.launchMechanism=fork Basic @@ -941,6 +941,14 @@ public class Basic { () -> pb.redirectOutput(Redirect.from(ifile)), () -> pb.redirectError(Redirect.from(ifile))); + THROWS(NullPointerException.class, + () -> pb.redirectInput((File)null), + () -> pb.redirectOutput((File)null), + () -> pb.redirectError((File)null), + () -> pb.redirectInput((Redirect)null), + () -> pb.redirectOutput((Redirect)null), + () -> pb.redirectError((Redirect)null)); + THROWS(IOException.class, // Input file does not exist () -> pb.start()); From 8db87d223f2363ef654d66a2937de02a9c0b73ea Mon Sep 17 00:00:00 2001 From: Joe Darcy Date: Tue, 10 Mar 2015 13:55:47 -0700 Subject: [PATCH 18/76] 8074870: Really add javax/xml/jaxp/testng/validation to othervm.dirs in TEST.ROOT Reviewed-by: rriggs --- jdk/test/TEST.ROOT | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jdk/test/TEST.ROOT b/jdk/test/TEST.ROOT index 7b89da112cf..20863c62a87 100644 --- a/jdk/test/TEST.ROOT +++ b/jdk/test/TEST.ROOT @@ -5,10 +5,10 @@ keys=2d dnd i18n # Tests that must run in othervm mode -othervm.dirs=java/awt java/beans javax/accessibility javax/imageio javax/sound javax/print javax/management com/sun/awt sun/awt sun/java2d sun/pisces +othervm.dirs=java/awt java/beans javax/accessibility javax/imageio javax/sound javax/print javax/management com/sun/awt sun/awt sun/java2d sun/pisces javax/xml/jaxp/testng/validation # Tests that cannot run concurrently -exclusiveAccess.dirs=java/rmi/Naming java/util/prefs sun/management/jmxremote sun/tools/jstatd sun/security/mscapi java/util/stream javax/xml/jaxp/testng/validation +exclusiveAccess.dirs=java/rmi/Naming java/util/prefs sun/management/jmxremote sun/tools/jstatd sun/security/mscapi java/util/stream # Group definitions groups=TEST.groups [closed/TEST.groups] From f825d1ff35e6f7a899dfc8e39ee3999b0c9916e4 Mon Sep 17 00:00:00 2001 From: Martin Buchholz Date: Wed, 4 Mar 2015 17:35:40 -0800 Subject: [PATCH 19/76] 8074577: Modernize Unsafe internal javadoc Use modern javadoc style Reviewed-by: jrose --- .../share/classes/sun/misc/Unsafe.java | 137 +++++++++--------- 1 file changed, 67 insertions(+), 70 deletions(-) diff --git a/jdk/src/java.base/share/classes/sun/misc/Unsafe.java b/jdk/src/java.base/share/classes/sun/misc/Unsafe.java index 15402d168cd..ef25c517f03 100644 --- a/jdk/src/java.base/share/classes/sun/misc/Unsafe.java +++ b/jdk/src/java.base/share/classes/sun/misc/Unsafe.java @@ -57,31 +57,29 @@ public final class Unsafe { * Provides the caller with the capability of performing unsafe * operations. * - *

The returned Unsafe object should be carefully guarded + *

The returned {@code Unsafe} object should be carefully guarded * by the caller, since it can be used to read and write data at arbitrary * memory addresses. It must never be passed to untrusted code. * - *

Most methods in this class are very low-level, and correspond to a + *

Most methods in this class are very low-level, and correspond to a * small number of hardware instructions (on typical machines). Compilers * are encouraged to optimize these methods accordingly. * - *

Here is a suggested idiom for using unsafe operations: + *

Here is a suggested idiom for using unsafe operations: * - *

+     * 
 {@code
      * class MyTrustedClass {
      *   private static final Unsafe unsafe = Unsafe.getUnsafe();
      *   ...
      *   private long myCountAddress = ...;
      *   public int getCount() { return unsafe.getByte(myCountAddress); }
-     * }
-     * 
+ * }} * - * (It may assist compilers to make the local variable be - * final.) + * (It may assist compilers to make the local variable {@code final}.) * - * @exception SecurityException if a security manager exists and its - * checkPropertiesAccess method doesn't allow - * access to the system properties. + * @throws SecurityException if a security manager exists and its + * {@code checkPropertiesAccess} method doesn't allow + * access to the system properties. */ @CallerSensitive public static Unsafe getUnsafe() { @@ -100,28 +98,27 @@ public final class Unsafe { /** * Fetches a value from a given Java variable. * More specifically, fetches a field or array element within the given - * object o at the given offset, or (if o is - * null) from the memory address whose numerical value is the given - * offset. + * object {@code o} at the given offset, or (if {@code o} is null) + * from the memory address whose numerical value is the given offset. *

* The results are undefined unless one of the following cases is true: *

    *
  • The offset was obtained from {@link #objectFieldOffset} on * the {@link java.lang.reflect.Field} of some Java field and the object - * referred to by o is of a class compatible with that + * referred to by {@code o} is of a class compatible with that * field's class. * - *
  • The offset and object reference o (either null or + *
  • The offset and object reference {@code o} (either null or * non-null) were both obtained via {@link #staticFieldOffset} * and {@link #staticFieldBase} (respectively) from the * reflective {@link Field} representation of some Java field. * - *
  • The object referred to by o is an array, and the offset - * is an integer of the form B+N*S, where N is - * a valid index into the array, and B and S are + *
  • The object referred to by {@code o} is an array, and the offset + * is an integer of the form {@code B+N*S}, where {@code N} is + * a valid index into the array, and {@code B} and {@code S} are * the values obtained by {@link #arrayBaseOffset} and {@link * #arrayIndexScale} (respectively) from the array's class. The value - * referred to is the Nth element of the array. + * referred to is the {@code N}th element of the array. * *
*

@@ -162,7 +159,7 @@ public final class Unsafe { * is stored into that variable. *

* The variable must be of the same type as the method - * parameter x. + * parameter {@code x}. * * @param o Java heap object in which the variable resides, if any, else * null @@ -184,9 +181,9 @@ public final class Unsafe { /** * Stores a reference value into a given Java variable. *

- * Unless the reference x being stored is either null + * Unless the reference {@code x} being stored is either null * or matches the field type, the results are undefined. - * If the reference o is non-null, car marks or + * If the reference {@code o} is non-null, car marks or * other store barriers for that object (if the VM requires them) * are updated. * @see #putInt(Object, long, int) @@ -272,11 +269,11 @@ public final class Unsafe { * zero, or does not point into a block obtained from {@link * #allocateMemory}, the results are undefined. * - *

If the native pointer is less than 64 bits wide, it is extended as + *

If the native pointer is less than 64 bits wide, it is extended as * an unsigned number to a Java long. The pointer may be indexed by any * given byte offset, simply by adding that offset (as a simple integer) to * the long representing the pointer. The number of bytes actually read - * from the target address maybe determined by consulting {@link + * from the target address may be determined by consulting {@link * #addressSize}. * * @see #allocateMemory @@ -288,7 +285,7 @@ public final class Unsafe { * zero, or does not point into a block obtained from {@link * #allocateMemory}, the results are undefined. * - *

The number of bytes actually written at the target address maybe + *

The number of bytes actually written at the target address may be * determined by consulting {@link #addressSize}. * * @see #getAddress(long) @@ -357,7 +354,7 @@ public final class Unsafe { * (usually zero). This provides a single-register addressing mode, * as discussed in {@link #getInt(Object,long)}. * - *

Equivalent to setMemory(null, address, bytes, value). + *

Equivalent to {@code setMemory(null, address, bytes, value)}. */ public void setMemory(long address, long bytes, byte value) { setMemory(null, address, bytes, value); @@ -388,7 +385,7 @@ public final class Unsafe { * block. This provides a single-register addressing mode, * as discussed in {@link #getInt(Object,long)}. * - * Equivalent to copyMemory(null, srcAddress, null, destAddress, bytes). + * Equivalent to {@code copyMemory(null, srcAddress, null, destAddress, bytes)}. */ public void copyMemory(long srcAddress, long destAddress, long bytes) { copyMemory(null, srcAddress, null, destAddress, bytes); @@ -413,7 +410,7 @@ public final class Unsafe { public static final int INVALID_FIELD_OFFSET = -1; /** - * Report the location of a given field in the storage allocation of its + * Reports the location of a given field in the storage allocation of its * class. Do not expect to perform any sort of arithmetic on this offset; * it is just a cookie which is passed to the unsafe heap memory accessors. * @@ -433,7 +430,7 @@ public final class Unsafe { public native long objectFieldOffset(Field f); /** - * Report the location of a given static field, in conjunction with {@link + * Reports the location of a given static field, in conjunction with {@link * #staticFieldBase}. *

Do not expect to perform any sort of arithmetic on this offset; * it is just a cookie which is passed to the unsafe heap memory accessors. @@ -452,7 +449,7 @@ public final class Unsafe { public native long staticFieldOffset(Field f); /** - * Report the location of a given static field, in conjunction with {@link + * Reports the location of a given static field, in conjunction with {@link * #staticFieldOffset}. *

Fetch the base "Object", if any, with which static fields of the * given class can be accessed via methods like {@link #getInt(Object, @@ -464,7 +461,7 @@ public final class Unsafe { public native Object staticFieldBase(Field f); /** - * Detect if the given class may need to be initialized. This is often + * Detects if the given class may need to be initialized. This is often * needed in conjunction with obtaining the static field base of a * class. * @return false only if a call to {@code ensureClassInitialized} would have no effect @@ -472,14 +469,14 @@ public final class Unsafe { public native boolean shouldBeInitialized(Class c); /** - * Ensure the given class has been initialized. This is often + * Ensures the given class has been initialized. This is often * needed in conjunction with obtaining the static field base of a * class. */ public native void ensureClassInitialized(Class c); /** - * Report the offset of the first element in the storage allocation of a + * Reports the offset of the first element in the storage allocation of a * given array class. If {@link #arrayIndexScale} returns a non-zero value * for the same class, you may use that scale factor, together with this * base offset, to form new offsets to access elements of arrays of the @@ -527,7 +524,7 @@ public final class Unsafe { = theUnsafe.arrayBaseOffset(Object[].class); /** - * Report the scale factor for addressing elements in the storage + * Reports the scale factor for addressing elements in the storage * allocation of a given array class. However, arrays of "narrow" types * will generally not work properly with accessors like {@link * #getByte(Object, long)}, so the scale factor for such classes is reported @@ -576,7 +573,7 @@ public final class Unsafe { = theUnsafe.arrayIndexScale(Object[].class); /** - * Report the size in bytes of a native pointer, as stored via {@link + * Reports the size in bytes of a native pointer, as stored via {@link * #putAddress}. This value will be either 4 or 8. Note that the sizes of * other primitive types (as stored in native memory blocks) is determined * fully by their information content. @@ -587,7 +584,7 @@ public final class Unsafe { public static final int ADDRESS_SIZE = theUnsafe.addressSize(); /** - * Report the size in bytes of a native memory page (whatever that is). + * Reports the size in bytes of a native memory page (whatever that is). * This value will always be a power of two. */ public native int pageSize(); @@ -596,7 +593,7 @@ public final class Unsafe { /// random trusted operations from JNI: /** - * Tell the VM to define a class, without security checks. By default, the + * Tells the VM to define a class, without security checks. By default, the * class loader and protection domain come from the caller's class. */ public native Class defineClass(String name, byte[] b, int off, int len, @@ -604,7 +601,7 @@ public final class Unsafe { ProtectionDomain protectionDomain); /** - * Define a class but do not make it known to the class loader or system dictionary. + * Defines a class but does not make it known to the class loader or system dictionary. *

* For each CP entry, the corresponding CP patch must either be null or have * the a format that matches its tag: @@ -621,38 +618,38 @@ public final class Unsafe { */ public native Class defineAnonymousClass(Class hostClass, byte[] data, Object[] cpPatches); - - /** Allocate an instance but do not run any constructor. - Initializes the class if it has not yet been. */ + /** + * Allocates an instance but does not run any constructor. + * Initializes the class if it has not yet been. + */ public native Object allocateInstance(Class cls) throws InstantiationException; - /** Throw the exception without telling the verifier. */ + /** Throws the exception without telling the verifier. */ public native void throwException(Throwable ee); - /** - * Atomically update Java variable to x if it is currently - * holding expected. - * @return true if successful + * Atomically updates Java variable to {@code x} if it is currently + * holding {@code expected}. + * @return {@code true} if successful */ public final native boolean compareAndSwapObject(Object o, long offset, Object expected, Object x); /** - * Atomically update Java variable to x if it is currently - * holding expected. - * @return true if successful + * Atomically updates Java variable to {@code x} if it is currently + * holding {@code expected}. + * @return {@code true} if successful */ public final native boolean compareAndSwapInt(Object o, long offset, int expected, int x); /** - * Atomically update Java variable to x if it is currently - * holding expected. - * @return true if successful + * Atomically updates Java variable to {@code x} if it is currently + * holding {@code expected}. + * @return {@code true} if successful */ public final native boolean compareAndSwapLong(Object o, long offset, long expected, @@ -736,28 +733,28 @@ public final class Unsafe { public native void putOrderedLong(Object o, long offset, long x); /** - * Unblock the given thread blocked on park, or, if it is - * not blocked, cause the subsequent call to park not to + * Unblocks the given thread blocked on {@code park}, or, if it is + * not blocked, causes the subsequent call to {@code park} not to * block. Note: this operation is "unsafe" solely because the * caller must somehow ensure that the thread has not been * destroyed. Nothing special is usually required to ensure this * when called from Java (in which there will ordinarily be a live * reference to the thread) but this is not nearly-automatically * so when calling from native code. - * @param thread the thread to unpark. * + * @param thread the thread to unpark. */ public native void unpark(Object thread); /** - * Block current thread, returning when a balancing - * unpark occurs, or a balancing unpark has + * Blocks current thread, returning when a balancing + * {@code unpark} occurs, or a balancing {@code unpark} has * already occurred, or the thread is interrupted, or, if not * absolute and time is not zero, the given time nanoseconds have * elapsed, or if absolute, the given deadline in milliseconds * since Epoch has passed, or spuriously (i.e., returning for no * "reason"). Note: This operation is in the Unsafe class only - * because unpark is, so it would be strange to place it + * because {@code unpark} is, so it would be strange to place it * elsewhere. */ public native void park(boolean isAbsolute, long time); @@ -765,8 +762,8 @@ public final class Unsafe { /** * Gets the load average in the system run queue assigned * to the available processors averaged over various periods of time. - * This method retrieves the given nelem samples and - * assigns to the elements of the given loadavg array. + * This method retrieves the given {@code nelem} samples and + * assigns to the elements of the given {@code loadavg} array. * The system imposes a maximum of 3 samples, representing * averages over the last 1, 5, and 15 minutes, respectively. * @@ -784,8 +781,8 @@ public final class Unsafe { /** * Atomically adds the given value to the current value of a field - * or array element within the given object o - * at the given offset. + * or array element within the given object {@code o} + * at the given {@code offset}. * * @param o object/array to update the field/element in * @param offset field/element offset @@ -803,8 +800,8 @@ public final class Unsafe { /** * Atomically adds the given value to the current value of a field - * or array element within the given object o - * at the given offset. + * or array element within the given object {@code o} + * at the given {@code offset}. * * @param o object/array to update the field/element in * @param offset field/element offset @@ -822,8 +819,8 @@ public final class Unsafe { /** * Atomically exchanges the given value with the current value of - * a field or array element within the given object o - * at the given offset. + * a field or array element within the given object {@code o} + * at the given {@code offset}. * * @param o object/array to update the field/element in * @param offset field/element offset @@ -841,8 +838,8 @@ public final class Unsafe { /** * Atomically exchanges the given value with the current value of - * a field or array element within the given object o - * at the given offset. + * a field or array element within the given object {@code o} + * at the given {@code offset}. * * @param o object/array to update the field/element in * @param offset field/element offset @@ -861,7 +858,7 @@ public final class Unsafe { /** * Atomically exchanges the given reference value with the current * reference value of a field or array element within the given - * object o at the given offset. + * object {@code o} at the given {@code offset}. * * @param o object/array to update the field/element in * @param offset field/element offset From 0d022c42c9d3cfa4a0be4eff49309fd132496cbc Mon Sep 17 00:00:00 2001 From: Martin Buchholz Date: Tue, 10 Mar 2015 14:23:03 -0700 Subject: [PATCH 20/76] 8074579: Use more efficient and readable way of checking PKZIP signatures Reviewed-by: sherman --- .../share/native/libjli/manifest_info.h | 15 +++++++++------ .../share/native/libjli/parse_manifest.c | 17 +++++++---------- .../java.base/share/native/libzip/zip_util.c | 13 +++++-------- .../java.base/share/native/libzip/zip_util.h | 15 ++++++++------- jdk/src/java.base/unix/native/launcher/jexec.c | 2 +- 5 files changed, 30 insertions(+), 32 deletions(-) diff --git a/jdk/src/java.base/share/native/libjli/manifest_info.h b/jdk/src/java.base/share/native/libjli/manifest_info.h index cd951d5cb9f..5f9773e0bca 100644 --- a/jdk/src/java.base/share/native/libjli/manifest_info.h +++ b/jdk/src/java.base/share/native/libjli/manifest_info.h @@ -32,13 +32,16 @@ * Zip file header signatures */ #define SIGSIZ 4 /* size of all header signatures */ -#define LOCSIG 0x04034b50L /* "PK\003\004" */ -#define EXTSIG 0x08074b50L /* "PK\007\008" */ -#define CENSIG 0x02014b50L /* "PK\001\002" */ -#define ENDSIG 0x06054b50L /* "PK\005\006" */ -#define ZIP64_ENDSIG 0x06064b50L /* "PK\006\006" */ -#define ZIP64_LOCSIG 0x07064b50L /* "PK\006\007" */ +#define PKZIP_SIGNATURE_AT(p, b2, b3) \ + (((p)[0] == 'P') & ((p)[1] == 'K') & ((p)[2] == b2) & ((p)[3] == b3)) +#define CENSIG_AT(p) PKZIP_SIGNATURE_AT(p, 1, 2) +#define LOCSIG_AT(p) PKZIP_SIGNATURE_AT(p, 3, 4) +#define ENDSIG_AT(p) PKZIP_SIGNATURE_AT(p, 5, 6) +#define EXTSIG_AT(p) PKZIP_SIGNATURE_AT(p, 7, 8) +#define ZIP64_ENDSIG_AT(p) PKZIP_SIGNATURE_AT(p, 6, 6) +#define ZIP64_LOCSIG_AT(p) PKZIP_SIGNATURE_AT(p, 6, 7) + /* * Header sizes including signatures */ diff --git a/jdk/src/java.base/share/native/libjli/parse_manifest.c b/jdk/src/java.base/share/native/libjli/parse_manifest.c index a8e17b89b25..9ce82c1a1d6 100644 --- a/jdk/src/java.base/share/native/libjli/parse_manifest.c +++ b/jdk/src/java.base/share/native/libjli/parse_manifest.c @@ -138,7 +138,7 @@ find_end64(int fd, Byte *ep, jlong pos) return -1; if ((bytes = read(fd, ep, ZIP64_LOCHDR)) < 0) return -1; - if (GETSIG(ep) == ZIP64_LOCSIG) + if (ZIP64_LOCSIG_AT(ep)) return end64pos; return -1; } @@ -176,7 +176,7 @@ find_end(int fd, Byte *eb) return (-1); if ((bytes = read(fd, eb, ENDHDR)) < 0) return (-1); - if (GETSIG(eb) == ENDSIG) { + if (ENDSIG_AT(eb)) { return haveZIP64(eb) ? find_end64(fd, eb, pos) : pos; } @@ -200,14 +200,11 @@ find_end(int fd, Byte *eb) /* * Search backwards from the end of file stopping when the END header - * signature is found. (The first condition of the "if" is just a - * fast fail, because the GETSIG macro isn't always cheap. The - * final condition protects against false positives.) + * signature is found. */ endpos = &buffer[bytes]; for (cp = &buffer[bytes - ENDHDR]; cp >= &buffer[0]; cp--) - if ((*cp == (ENDSIG & 0xFF)) && (GETSIG(cp) == ENDSIG) && - (cp + ENDHDR + ENDCOM(cp) == endpos)) { + if (ENDSIG_AT(cp) && (cp + ENDHDR + ENDCOM(cp) == endpos)) { (void) memcpy(eb, cp, ENDHDR); free(buffer); pos = flen - (endpos - cp); @@ -267,7 +264,7 @@ compute_cen(int fd, Byte *bp) if ((bytes = read(fd, buffer, MINREAD)) < 0) { return (-1); } - if (GETSIG(buffer) != ZIP64_ENDSIG) { + if (!ZIP64_ENDSIG_AT(buffer)) { return -1; } if ((offset = ZIP64_ENDOFF(buffer)) < (jlong)0) { @@ -356,7 +353,7 @@ find_file(int fd, zentry *entry, const char *file_name) * Loop through the Central Directory Headers. Note that a valid zip/jar * must have an ENDHDR (with ENDSIG) after the Central Directory. */ - while (GETSIG(p) == CENSIG) { + while (CENSIG_AT(p)) { /* * If a complete header isn't in the buffer, shift the contents @@ -403,7 +400,7 @@ find_file(int fd, zentry *entry, const char *file_name) free(buffer); return (-1); } - if (GETSIG(locbuf) != LOCSIG) { + if (!LOCSIG_AT(locbuf)) { free(buffer); return (-1); } diff --git a/jdk/src/java.base/share/native/libzip/zip_util.c b/jdk/src/java.base/share/native/libzip/zip_util.c index 51ee1d5276f..d99a5cd66a7 100644 --- a/jdk/src/java.base/share/native/libzip/zip_util.c +++ b/jdk/src/java.base/share/native/libzip/zip_util.c @@ -281,9 +281,9 @@ static jboolean verifyEND(jzfile *zip, jlong endpos, char *endbuf) { return (cenpos >= 0 && locpos >= 0 && readFullyAt(zip->zfd, buf, sizeof(buf), cenpos) != -1 && - GETSIG(buf) == CENSIG && + CENSIG_AT(buf) && readFullyAt(zip->zfd, buf, sizeof(buf), locpos) != -1 && - GETSIG(buf) == LOCSIG); + LOCSIG_AT(buf)); } /* @@ -674,7 +674,7 @@ readCEN(jzfile *zip, jint knownTotal) method = CENHOW(cp); nlen = CENNAM(cp); - if (GETSIG(cp) != CENSIG) + if (!CENSIG_AT(cp)) ZIP_FORMAT_ERROR("invalid CEN header (bad signature)"); if (CENFLG(cp) & 1) ZIP_FORMAT_ERROR("invalid CEN header (encrypted entry)"); @@ -827,10 +827,7 @@ ZIP_Put_In_Cache0(const char *name, ZFILE zfd, char **pmsg, jlong lastModified, // Assumption, zfd refers to start of file. Trivially, reuse errbuf. if (readFully(zfd, errbuf, 4) != -1) { // errors will be handled later - if (GETSIG(errbuf) == LOCSIG) - zip->locsig = JNI_TRUE; - else - zip->locsig = JNI_FALSE; + zip->locsig = LOCSIG_AT(errbuf) ? JNI_TRUE : JNI_FALSE; } len = zip->len = IO_Lseek(zfd, 0, SEEK_END); @@ -1284,7 +1281,7 @@ ZIP_GetEntryDataOffset(jzfile *zip, jzentry *entry) zip->msg = "error reading zip file"; return -1; } - if (GETSIG(loc) != LOCSIG) { + if (!LOCSIG_AT(loc)) { zip->msg = "invalid LOC header (bad signature)"; return -1; } diff --git a/jdk/src/java.base/share/native/libzip/zip_util.h b/jdk/src/java.base/share/native/libzip/zip_util.h index 1287d3aa29e..1f5f3bd6cab 100644 --- a/jdk/src/java.base/share/native/libzip/zip_util.h +++ b/jdk/src/java.base/share/native/libzip/zip_util.h @@ -33,13 +33,14 @@ /* * Header signatures */ -#define LOCSIG 0x04034b50L /* "PK\003\004" */ -#define EXTSIG 0x08074b50L /* "PK\007\008" */ -#define CENSIG 0x02014b50L /* "PK\001\002" */ -#define ENDSIG 0x06054b50L /* "PK\005\006" */ - -#define ZIP64_ENDSIG 0x06064b50L /* "PK\006\006" */ -#define ZIP64_LOCSIG 0x07064b50L /* "PK\006\007" */ +#define PKZIP_SIGNATURE_AT(p, b2, b3) \ + (((p)[0] == 'P') & ((p)[1] == 'K') & ((p)[2] == b2) & ((p)[3] == b3)) +#define CENSIG_AT(p) PKZIP_SIGNATURE_AT(p, 1, 2) +#define LOCSIG_AT(p) PKZIP_SIGNATURE_AT(p, 3, 4) +#define ENDSIG_AT(p) PKZIP_SIGNATURE_AT(p, 5, 6) +#define EXTSIG_AT(p) PKZIP_SIGNATURE_AT(p, 7, 8) +#define ZIP64_ENDSIG_AT(p) PKZIP_SIGNATURE_AT(p, 6, 6) +#define ZIP64_LOCSIG_AT(p) PKZIP_SIGNATURE_AT(p, 6, 7) /* * Header sizes including signatures diff --git a/jdk/src/java.base/unix/native/launcher/jexec.c b/jdk/src/java.base/unix/native/launcher/jexec.c index a30617de7b9..179ae4f893c 100644 --- a/jdk/src/java.base/unix/native/launcher/jexec.c +++ b/jdk/src/java.base/unix/native/launcher/jexec.c @@ -323,7 +323,7 @@ const char * isJar(const char * path) { result = BAD_MAGIC_MSG; // be sure the file is at least a ZIP file - if (GETSIG(buf) == LOCSIG) { + if (LOCSIG_AT(buf)) { off_t flen = LOCNAM(buf); off_t xlen = LOCEXT(buf); From 665dc6f6279ac6d253a18190e71a1bc5545b5509 Mon Sep 17 00:00:00 2001 From: Xue-Lei Andrew Fan Date: Wed, 11 Mar 2015 04:52:39 +0000 Subject: [PATCH 21/76] 8072385: Only the first DNSName entry is checked for endpoint identification Reviewed-by: weijun, jnimeh --- .../share/classes/sun/security/ssl/ClientHandshaker.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/jdk/src/java.base/share/classes/sun/security/ssl/ClientHandshaker.java b/jdk/src/java.base/share/classes/sun/security/ssl/ClientHandshaker.java index 7f1577beb83..cb4f54eb125 100644 --- a/jdk/src/java.base/share/classes/sun/security/ssl/ClientHandshaker.java +++ b/jdk/src/java.base/share/classes/sun/security/ssl/ClientHandshaker.java @@ -1569,6 +1569,9 @@ final class ClientHandshaker extends Handshaker { /* * Returns the subject alternative name of the specified type in the * subjectAltNames extension of a certificate. + * + * Note that only those subjectAltName types that use String data + * should be passed into this function. */ private static Collection getSubjectAltNames( Collection> subjectAltNames, int type) { From 6a297b5c2bafe626e5e28b81fb59775b5932e975 Mon Sep 17 00:00:00 2001 From: Masayoshi Okutsu Date: Wed, 11 Mar 2015 14:33:14 +0900 Subject: [PATCH 22/76] 8074791: Long-form date format incorrect month string for Finnish locale Reviewed-by: naoto --- .../sun/text/resources/fi/FormatData_fi.java | 6 +- .../sun/text/resources/Format/Bug8074791.java | 69 +++++++++++++++++++ jdk/test/sun/text/resources/LocaleData | 6 ++ .../sun/text/resources/LocaleDataTest.java | 4 +- 4 files changed, 80 insertions(+), 5 deletions(-) create mode 100644 jdk/test/sun/text/resources/Format/Bug8074791.java diff --git a/jdk/src/jdk.localedata/share/classes/sun/text/resources/fi/FormatData_fi.java b/jdk/src/jdk.localedata/share/classes/sun/text/resources/fi/FormatData_fi.java index f80df887abf..c9a520a8388 100644 --- a/jdk/src/jdk.localedata/share/classes/sun/text/resources/fi/FormatData_fi.java +++ b/jdk/src/jdk.localedata/share/classes/sun/text/resources/fi/FormatData_fi.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -295,8 +295,8 @@ public class FormatData_fi extends ParallelListResourceBundle { }, { "DatePatterns", new String[] { - "d. MMMM'ta 'yyyy", // full date pattern - "d. MMMM'ta 'yyyy", // long date pattern + "d. MMMM yyyy", // full date pattern + "d. MMMM yyyy", // long date pattern "d.M.yyyy", // medium date pattern "d.M.yyyy", // short date pattern } diff --git a/jdk/test/sun/text/resources/Format/Bug8074791.java b/jdk/test/sun/text/resources/Format/Bug8074791.java new file mode 100644 index 00000000000..138158ca090 --- /dev/null +++ b/jdk/test/sun/text/resources/Format/Bug8074791.java @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8074791 + * @summary Make sure that Finnish month names are correct in formatted text. + */ + +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.GregorianCalendar; +import java.util.Locale; +import static java.text.DateFormat.*; +import static java.util.Calendar.JANUARY; + +public class Bug8074791 { + private static Locale FINNISH = new Locale("fi"); + private static String JAN_FORMAT = "tammikuuta"; + private static String JAN_STANDALONE = "tammikuu"; + + public static void main(String[] arg) { + int errors = 0; + + DateFormat df = DateFormat.getDateInstance(LONG, FINNISH); + Date jan20 = new GregorianCalendar(2015, JANUARY, 20).getTime(); + String str = df.format(jan20).toString(); + // Extract the month name (locale data dependent) + String month = str.replaceAll(".+\\s([a-z]+)\\s\\d+$", "$1"); + if (!month.equals(JAN_FORMAT)) { + errors++; + System.err.println("wrong format month name: got '" + month + + "', expected '" + JAN_FORMAT + "'"); + } + + SimpleDateFormat sdf = new SimpleDateFormat("LLLL", FINNISH); // stand-alone month name + month = sdf.format(jan20); + if (!month.equals(JAN_STANDALONE)) { + errors++; + System.err.println("wrong stand-alone month name: got '" + month + + "', expected '" + JAN_STANDALONE + "'"); + } + + if (errors > 0) { + throw new RuntimeException(); + } + } +} diff --git a/jdk/test/sun/text/resources/LocaleData b/jdk/test/sun/text/resources/LocaleData index 205932144d3..719cc3df066 100644 --- a/jdk/test/sun/text/resources/LocaleData +++ b/jdk/test/sun/text/resources/LocaleData @@ -8273,3 +8273,9 @@ FormatData/zh/MonthNarrows/9=10 FormatData/zh/MonthNarrows/10=11 FormatData/zh/MonthNarrows/11=12 FormatData/zh/MonthNarrows/12= + +# bug #8074791 +FormatData/fi/DatePatterns/0=d. MMMM yyyy +FormatData/fi/DatePatterns/1=d. MMMM yyyy +FormatData/fi/DatePatterns/2=d.M.yyyy +FormatData/fi/DatePatterns/3=d.M.yyyy diff --git a/jdk/test/sun/text/resources/LocaleDataTest.java b/jdk/test/sun/text/resources/LocaleDataTest.java index abfdd97943d..96d6d1d9a75 100644 --- a/jdk/test/sun/text/resources/LocaleDataTest.java +++ b/jdk/test/sun/text/resources/LocaleDataTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -36,7 +36,7 @@ * 6919624 6998391 7019267 7020960 7025837 7020583 7036905 7066203 7101495 * 7003124 7085757 7028073 7171028 7189611 8000983 7195759 8004489 8006509 * 7114053 7074882 7040556 8013836 8021121 6192407 6931564 8027695 8017142 - * 8037343 8055222 8042126 + * 8037343 8055222 8042126 8074791 * @summary Verify locale data * */ From e8b15600ac394449663c4a1f4c6a955746640c5f Mon Sep 17 00:00:00 2001 From: Staffan Larsen Date: Wed, 11 Mar 2015 08:09:35 +0100 Subject: [PATCH 23/76] 8074841: Resolve disabled warnings for the JVMTI demo compiledMethodLoad 8074842: Resolve disabled warnings for the JVMTI demo waiters Reviewed-by: alanb, ihse, dsamersoff --- jdk/make/CompileDemos.gmk | 4 ++-- .../demo/share/jvmti/compiledMethodLoad/compiledMethodLoad.c | 2 +- jdk/src/demo/share/jvmti/waiters/Agent.cpp | 4 ---- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/jdk/make/CompileDemos.gmk b/jdk/make/CompileDemos.gmk index a56b020e09d..2d10867948f 100644 --- a/jdk/make/CompileDemos.gmk +++ b/jdk/make/CompileDemos.gmk @@ -316,13 +316,13 @@ define SetupJVMTIDemo endif endef -$(eval $(call SetupJVMTIDemo,compiledMethodLoad, agent_util, , , , , , , , pointer-to-int-cast format, , format)) +$(eval $(call SetupJVMTIDemo,compiledMethodLoad, agent_util)) $(eval $(call SetupJVMTIDemo,gctest, agent_util)) $(eval $(call SetupJVMTIDemo,heapTracker, agent_util java_crw_demo)) $(eval $(call SetupJVMTIDemo,heapViewer, agent_util)) $(eval $(call SetupJVMTIDemo,minst, agent_util java_crw_demo)) $(eval $(call SetupJVMTIDemo,mtrace, agent_util java_crw_demo)) -$(eval $(call SetupJVMTIDemo,waiters, agent_util, , C++, , , , , , , 4101)) +$(eval $(call SetupJVMTIDemo,waiters, agent_util, , C++)) $(eval $(call SetupJVMTIDemo,versionCheck, agent_util)) ################################################################################################## diff --git a/jdk/src/demo/share/jvmti/compiledMethodLoad/compiledMethodLoad.c b/jdk/src/demo/share/jvmti/compiledMethodLoad/compiledMethodLoad.c index 0f78bc953f7..72c9717a5cb 100644 --- a/jdk/src/demo/share/jvmti/compiledMethodLoad/compiledMethodLoad.c +++ b/jdk/src/demo/share/jvmti/compiledMethodLoad/compiledMethodLoad.c @@ -143,7 +143,7 @@ print_inline_info_record(jvmtiCompiledMethodLoadInlineRecord* record, for (i = 0; i < numpcs; i++) { PCStackInfo pcrecord = (record->pcinfo[i]); - fprintf(fp, "PcDescriptor(pc=0x%lx):\n", (jint)(pcrecord.pc)); + fprintf(fp, "PcDescriptor(pc=%p):\n", pcrecord.pc); print_stack_frames(&pcrecord, jvmti, fp); } } diff --git a/jdk/src/demo/share/jvmti/waiters/Agent.cpp b/jdk/src/demo/share/jvmti/waiters/Agent.cpp index cf2285c6ca6..8f67f5480a5 100644 --- a/jdk/src/demo/share/jvmti/waiters/Agent.cpp +++ b/jdk/src/demo/share/jvmti/waiters/Agent.cpp @@ -111,8 +111,6 @@ Agent::get_monitor(jvmtiEnv *jvmti, JNIEnv *env, jobject object) /* VM initialization and VM death calls to Agent */ Agent::Agent(jvmtiEnv *jvmti, JNIEnv *env, jthread thread) { - jvmtiError err; - stdout_message("Agent created..\n"); stdout_message("VMInit...\n"); /* Start monitor list */ @@ -129,8 +127,6 @@ Agent::~Agent() void Agent::vm_death(jvmtiEnv *jvmti, JNIEnv *env) { - jvmtiError err; - /* Delete all Monitors we allocated */ for ( int i = 0; i < (int)monitor_count; i++ ) { delete monitor_list[i]; From d7388dd061807da09fb53cdfc34aab4bd9d2e766 Mon Sep 17 00:00:00 2001 From: Mandy Chung Date: Wed, 11 Mar 2015 08:33:12 -0700 Subject: [PATCH 24/76] 8074993: policytool launcher missing Reviewed-by: weijun --- jdk/make/launcher/Launcher-jdk.policytool.gmk | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 jdk/make/launcher/Launcher-jdk.policytool.gmk diff --git a/jdk/make/launcher/Launcher-jdk.policytool.gmk b/jdk/make/launcher/Launcher-jdk.policytool.gmk new file mode 100644 index 00000000000..133e3f612d8 --- /dev/null +++ b/jdk/make/launcher/Launcher-jdk.policytool.gmk @@ -0,0 +1,32 @@ +# +# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + +include LauncherCommon.gmk + +ifndef BUILD_HEADLESS_ONLY + $(eval $(call SetupLauncher,policytool, \ + -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.security.tools.policytool.PolicyTool"$(COMMA) }',, \ + $(XLIBS))) +endif From acb7e7eccd80308a2727475744bdc931f2f3b304 Mon Sep 17 00:00:00 2001 From: Erik Joelsson Date: Thu, 12 Mar 2015 12:13:48 +0100 Subject: [PATCH 25/76] 8074988: Reduce boilerplate in Setup* macro definitions Reviewed-by: tbell, ihse --- jdk/make/gendata/GendataPolicyJars.gmk | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/jdk/make/gendata/GendataPolicyJars.gmk b/jdk/make/gendata/GendataPolicyJars.gmk index 9364159f129..256b32e2b58 100644 --- a/jdk/make/gendata/GendataPolicyJars.gmk +++ b/jdk/make/gendata/GendataPolicyJars.gmk @@ -77,7 +77,7 @@ US_EXPORT_POLICY_JAR_DEPS := \ $(US_EXPORT_POLICY_JAR_TMP)/default_US_export.policy $(eval $(call SetupArchive,BUILD_US_EXPORT_POLICY_JAR, \ - $(US_EXPORT_POLICY_JAR_DEPS), \ + DEPENDENCIES := $(US_EXPORT_POLICY_JAR_DEPS), \ SRCS := $(US_EXPORT_POLICY_JAR_TMP), \ SUFFIXES := .policy, \ JAR := $(US_EXPORT_POLICY_JAR_UNLIMITED), \ @@ -139,8 +139,8 @@ $(LOCAL_POLICY_JAR_UNLIMITED_TMP)/%: \ $(install-file) $(eval $(call SetupArchive,BUILD_LOCAL_POLICY_JAR_LIMITED, \ - $(LOCAL_POLICY_JAR_LIMITED_TMP)/exempt_local.policy \ - $(LOCAL_POLICY_JAR_LIMITED_TMP)/default_local.policy, \ + DEPENDENCIES := $(LOCAL_POLICY_JAR_LIMITED_TMP)/exempt_local.policy \ + $(LOCAL_POLICY_JAR_LIMITED_TMP)/default_local.policy, \ SRCS := $(LOCAL_POLICY_JAR_LIMITED_TMP), \ SUFFIXES := .policy, \ JAR := $(LOCAL_POLICY_JAR_LIMITED), \ @@ -148,7 +148,7 @@ $(eval $(call SetupArchive,BUILD_LOCAL_POLICY_JAR_LIMITED, \ SKIP_METAINF := true)) $(eval $(call SetupArchive,BUILD_LOCAL_POLICY_JAR_UNLIMITED, \ - $(LOCAL_POLICY_JAR_UNLIMITED_TMP)/default_local.policy, \ + DEPENDENCIES := $(LOCAL_POLICY_JAR_UNLIMITED_TMP)/default_local.policy, \ SRCS := $(LOCAL_POLICY_JAR_UNLIMITED_TMP), \ SUFFIXES := .policy, \ JAR := $(LOCAL_POLICY_JAR_UNLIMITED), \ From e7472cc455aaa732ad35d185c76e0f7ef379a223 Mon Sep 17 00:00:00 2001 From: Magnus Ihse Bursie Date: Thu, 12 Mar 2015 16:25:24 +0100 Subject: [PATCH 26/76] 8074796: Disabling warnings on clang triggers compiler bug for libunpack Reviewed-by: erikj --- jdk/make/lib/Lib-jdk.pack200.gmk | 1 - 1 file changed, 1 deletion(-) diff --git a/jdk/make/lib/Lib-jdk.pack200.gmk b/jdk/make/lib/Lib-jdk.pack200.gmk index 37e32d0a725..b8bab611310 100644 --- a/jdk/make/lib/Lib-jdk.pack200.gmk +++ b/jdk/make/lib/Lib-jdk.pack200.gmk @@ -42,7 +42,6 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBUNPACK, \ CFLAGS_release := -DPRODUCT, \ DISABLED_WARNINGS_gcc := conversion-null sign-compare format-security \ format-nonliteral parentheses, \ - DISABLED_WARNINGS_clang := bool-conversion format-security, \ DISABLED_WARNINGS_solstudio := truncwarn, \ DISABLED_WARNINGS_microsoft := 4267 4018, \ MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libunpack/mapfile-vers, \ From 55f8f159ca01b6cb0eb288fd0f94528f15addae9 Mon Sep 17 00:00:00 2001 From: Joe Darcy Date: Thu, 12 Mar 2015 09:39:48 -0700 Subject: [PATCH 27/76] 8075034: Bad javadoc tags in javax.xml.crypto.dsig Reviewed-by: mullan --- .../share/classes/javax/xml/crypto/dsig/Manifest.java | 2 +- .../share/classes/javax/xml/crypto/dsig/XMLObject.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/jdk/src/java.xml.crypto/share/classes/javax/xml/crypto/dsig/Manifest.java b/jdk/src/java.xml.crypto/share/classes/javax/xml/crypto/dsig/Manifest.java index 351b3a9a674..f1a7f16d24d 100644 --- a/jdk/src/java.xml.crypto/share/classes/javax/xml/crypto/dsig/Manifest.java +++ b/jdk/src/java.xml.crypto/share/classes/javax/xml/crypto/dsig/Manifest.java @@ -52,7 +52,7 @@ import java.util.List; *

  *   XMLSignatureFactory factory = XMLSignatureFactory.getInstance("DOM");
  *   Reference ref = factory.newReference("#reference-1", DigestMethod.SHA1);
- *   List references = Collections.singletonList(ref);
+ *   List<Reference> references = Collections.singletonList(ref);
  *   Manifest manifest = factory.newManifest(references, "manifest-1");
  * 
* diff --git a/jdk/src/java.xml.crypto/share/classes/javax/xml/crypto/dsig/XMLObject.java b/jdk/src/java.xml.crypto/share/classes/javax/xml/crypto/dsig/XMLObject.java index 572be86f207..4117c8b1901 100644 --- a/jdk/src/java.xml.crypto/share/classes/javax/xml/crypto/dsig/XMLObject.java +++ b/jdk/src/java.xml.crypto/share/classes/javax/xml/crypto/dsig/XMLObject.java @@ -65,7 +65,7 @@ import javax.xml.crypto.XMLStructure; *
  *   XMLSignatureFactory fac = XMLSignatureFactory.getInstance("DOM");
  *   Manifest manifest = fac.newManifest(references);
- *   List content = Collections.singletonList(manifest);
+ *   List<XMLStructure> content = Collections.singletonList(manifest);
  *   XMLObject object = factory.newXMLObject(content, "object-1", null, null);
  * 
* From 68ef8f60358ff88311655c87781f71db7dc68bb1 Mon Sep 17 00:00:00 2001 From: Brian Burkhalter Date: Thu, 12 Feb 2015 12:56:48 -0800 Subject: [PATCH 28/76] 8068373: (prefs) FileSystemPreferences writes \0 to XML storage, causing loss of all preferences Disallow entries whose key or value contains the null control character '\u0000' from being stored in the preferences node. Reviewed-by: psandoz, rriggs --- .../classes/java/util/prefs/Preferences.java | 4 +- .../util/prefs/FileSystemPreferences.java | 14 ++- .../util/prefs/CodePointZeroPrefsTest.java | 89 +++++++++++++++++++ 3 files changed, 105 insertions(+), 2 deletions(-) create mode 100644 jdk/test/java/util/prefs/CodePointZeroPrefsTest.java diff --git a/jdk/src/java.prefs/share/classes/java/util/prefs/Preferences.java b/jdk/src/java.prefs/share/classes/java/util/prefs/Preferences.java index 3b7b47f30cf..beb0b0fa1a9 100644 --- a/jdk/src/java.prefs/share/classes/java/util/prefs/Preferences.java +++ b/jdk/src/java.prefs/share/classes/java/util/prefs/Preferences.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -489,6 +489,8 @@ public abstract class Preferences { * MAX_VALUE_LENGTH. * @throws IllegalStateException if this node (or an ancestor) has been * removed with the {@link #removeNode()} method. + * @throws IllegalArgumentException if either the key or the value contain + * the null control character, code point U+0000. */ public abstract void put(String key, String value); diff --git a/jdk/src/java.prefs/unix/classes/java/util/prefs/FileSystemPreferences.java b/jdk/src/java.prefs/unix/classes/java/util/prefs/FileSystemPreferences.java index ebbca48a255..7bcd1d3ad24 100644 --- a/jdk/src/java.prefs/unix/classes/java/util/prefs/FileSystemPreferences.java +++ b/jdk/src/java.prefs/unix/classes/java/util/prefs/FileSystemPreferences.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -49,6 +49,13 @@ import sun.util.logging.PlatformLogger; */ class FileSystemPreferences extends AbstractPreferences { + /** + * The code point U+0000, assigned to the null control character, is the + * only character encoded in Unicode and ISO/IEC 10646 that is always + * invalid in any XML 1.0 and 1.1 document. + */ + private static final String CODE_POINT_U0000 = String.valueOf('\u0000'); + static { PrivilegedAction load = () -> { System.loadLibrary("prefs"); @@ -525,6 +532,11 @@ class FileSystemPreferences extends AbstractPreferences { } protected void putSpi(String key, String value) { + if (key.indexOf(CODE_POINT_U0000) != -1) { + throw new IllegalArgumentException("Key contains code point U+0000"); + } else if (value.indexOf(CODE_POINT_U0000) != -1) { + throw new IllegalArgumentException("Value contains code point U+0000"); + } initCacheIfNecessary(); changeLog.add(new Put(key, value)); prefsCache.put(key, value); diff --git a/jdk/test/java/util/prefs/CodePointZeroPrefsTest.java b/jdk/test/java/util/prefs/CodePointZeroPrefsTest.java new file mode 100644 index 00000000000..8a63b86caf9 --- /dev/null +++ b/jdk/test/java/util/prefs/CodePointZeroPrefsTest.java @@ -0,0 +1,89 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +import java.lang.reflect.Constructor; +import java.util.prefs.Preferences; +import java.util.prefs.PreferencesFactory; + +/* + * @test + * @bug 8068373 + * @summary Ensure writing a code point U+0000 null control character is detected. + */ +public class CodePointZeroPrefsTest +{ + public static void main(String[] args) throws Exception + { + int failures = 0; + + // Deliberately reflect so you can reproduce it on any platform. + Constructor constructor = + Class.forName("java.util.prefs.FileSystemPreferencesFactory").asSubclass(PreferencesFactory.class).getDeclaredConstructor(); + constructor.setAccessible(true); + PreferencesFactory factory = constructor.newInstance(); + + Preferences node = factory.userRoot().node("com/acme/testing"); + + // legal key and value + try { + node.put("a", "1"); + } catch (IllegalArgumentException iae) { + System.err.println("Unexpected IllegalArgumentException for legal key"); + failures++; + } + + // illegal key only + int numIAEs = 0; + try { + node.put("a\u0000b", "1"); + System.err.println("IllegalArgumentException not thrown for illegal key"); + failures++; + } catch (IllegalArgumentException iae) { + // do nothing + } + + // illegal value only + numIAEs = 0; + try { + node.put("ab", "2\u00003"); + System.err.println("IllegalArgumentException not thrown for illegal value"); + failures++; + } catch (IllegalArgumentException iae) { + // do nothing + } + + // illegal key and value + numIAEs = 0; + try { + node.put("a\u0000b", "2\u00003"); + System.err.println("IllegalArgumentException not thrown for illegal entry"); + failures++; + } catch (IllegalArgumentException iae) { + // do nothing + } + + if (failures != 0) { + throw new RuntimeException("CodePointZeroPrefsTest failed with " + + failures + " errors!"); + } + } +} From ccaded21d2775604246c4ef042de1ca74eceeadd Mon Sep 17 00:00:00 2001 From: Tobias Hartmann Date: Mon, 23 Feb 2015 08:48:19 +0100 Subject: [PATCH 29/76] 8072774: bigapps/Weblogic+medrec/nowarnings fails due to CodeHeap 'profiled nmethods' exhaustion Store profiled code in the non-profiled code heap (and vice versa) if the code cache is really full. Reviewed-by: kvn, iveresov --- test/lib/sun/hotspot/code/BlobType.java | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/test/lib/sun/hotspot/code/BlobType.java b/test/lib/sun/hotspot/code/BlobType.java index 905f0ca00d1..511aafd4f30 100644 --- a/test/lib/sun/hotspot/code/BlobType.java +++ b/test/lib/sun/hotspot/code/BlobType.java @@ -32,15 +32,28 @@ import sun.hotspot.WhiteBox; public enum BlobType { // Execution level 1 and 4 (non-profiled) nmethods (including native nmethods) - MethodNonProfiled(0, "CodeHeap 'non-profiled nmethods'", "NonProfiledCodeHeapSize"), + MethodNonProfiled(0, "CodeHeap 'non-profiled nmethods'", "NonProfiledCodeHeapSize") { + @Override + public boolean allowTypeWhenOverflow(BlobType type) { + return super.allowTypeWhenOverflow(type) + || type == BlobType.MethodProfiled; + } + }, // Execution level 2 and 3 (profiled) nmethods - MethodProfiled(1, "CodeHeap 'profiled nmethods'", "ProfiledCodeHeapSize"), + MethodProfiled(1, "CodeHeap 'profiled nmethods'", "ProfiledCodeHeapSize") { + @Override + public boolean allowTypeWhenOverflow(BlobType type) { + return super.allowTypeWhenOverflow(type) + || type == BlobType.MethodNonProfiled; + } + }, // Non-nmethods like Buffers, Adapters and Runtime Stubs NonNMethod(2, "CodeHeap 'non-nmethods'", "NonNMethodCodeHeapSize") { @Override public boolean allowTypeWhenOverflow(BlobType type) { return super.allowTypeWhenOverflow(type) - || type == BlobType.MethodNonProfiled; + || type == BlobType.MethodNonProfiled + || type == BlobType.MethodProfiled; } }, // All types (No code cache segmentation) From a953097a8960cd0013fa28ddc7ee54277a82fb67 Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Thu, 5 Mar 2015 17:18:19 -0800 Subject: [PATCH 30/76] 8049378: Examine references to ${java.home}/lib in JAXP Reviewed-by: lancea, alanb --- .../share/classes/javax/xml/XMLConstants.java | 26 ++++--- .../javax/xml/datatype/DatatypeFactory.java | 54 ++++++++------ .../xml/parsers/DocumentBuilderFactory.java | 71 ++++++++++--------- .../javax/xml/parsers/SAXParserFactory.java | 54 ++++++++------ .../javax/xml/stream/XMLEventFactory.java | 62 +++++++++++----- .../javax/xml/stream/XMLInputFactory.java | 59 +++++++++++---- .../javax/xml/stream/XMLOutputFactory.java | 63 +++++++++++----- .../xml/transform/TransformerFactory.java | 67 +++++++++-------- .../javax/xml/validation/SchemaFactory.java | 30 +++++--- .../classes/javax/xml/xpath/XPathFactory.java | 71 +++++++++++-------- 10 files changed, 356 insertions(+), 201 deletions(-) diff --git a/jaxp/src/java.xml/share/classes/javax/xml/XMLConstants.java b/jaxp/src/java.xml/share/classes/javax/xml/XMLConstants.java index 4cb5800200d..cca303c5d66 100644 --- a/jaxp/src/java.xml/share/classes/javax/xml/XMLConstants.java +++ b/jaxp/src/java.xml/share/classes/javax/xml/XMLConstants.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -247,9 +247,11 @@ public final class XMLConstants { *

* *

- * ${JAVA_HOME}/conf/jaxp.properties: This configuration file is in standard - * {@link java.util.Properties} format. If the file exists and the system property is specified, - * its value will be used to override the default of the property. + * jaxp.properties: This configuration file is in standard + * {@link java.util.Properties} format and typically located in the {@code conf} + * directory of the Java installation. If the file exists and the system + * property is specified, its value will be used to override the default + * of the property. *

* *

@@ -314,9 +316,11 @@ public final class XMLConstants { *

* *

- * ${JAVA_HOME}/conf/jaxp.properties: This configuration file is in standard - * java.util.Properties format. If the file exists and the system property is specified, - * its value will be used to override the default of the property. + * jaxp.properties: This configuration file is in standard + * {@link java.util.Properties} format and typically located in the {@code conf} + * directory of the Java installation. If the file exists and the system + * property is specified, its value will be used to override the default + * of the property. * * @since 1.7 *

@@ -380,9 +384,11 @@ public final class XMLConstants { *

* *

- * ${JAVA_HOME}/conf/jaxp.properties: This configuration file is in standard - * java.util.Properties format. If the file exists and the system property is specified, - * its value will be used to override the default of the property. + * jaxp.properties: This configuration file is in standard + * {@link java.util.Properties} format and typically located in the {@code conf} + * directory of the Java installation. If the file exists and the system + * property is specified, its value will be used to override the default + * of the property. * * @since 1.7 */ diff --git a/jaxp/src/java.xml/share/classes/javax/xml/datatype/DatatypeFactory.java b/jaxp/src/java.xml/share/classes/javax/xml/datatype/DatatypeFactory.java index de6050ac4e8..d3afb25888e 100644 --- a/jaxp/src/java.xml/share/classes/javax/xml/datatype/DatatypeFactory.java +++ b/jaxp/src/java.xml/share/classes/javax/xml/datatype/DatatypeFactory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -32,23 +32,34 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; /** - *

Factory that creates new javax.xml.datatype Objects that map XML to/from Java Objects.

- * - *

A new instance of the DatatypeFactory is created through the {@link #newInstance()} method - * that uses the following implementation resolution mechanisms to determine an implementation:

+ * Factory that creates new javax.xml.datatype Objects that map XML to/from Java Objects. + *

+ * A new instance of the {@code DatatypeFactory} is created through the {@link #newInstance()} method + * that uses the following implementation resolution mechanisms to determine an implementation: + *

*

    *
  1. - * If the system property specified by {@link #DATATYPEFACTORY_PROPERTY}, "javax.xml.datatype.DatatypeFactory", + * If the system property specified by {@link #DATATYPEFACTORY_PROPERTY}, "{@code javax.xml.datatype.DatatypeFactory}", * exists, a class with the name of the property value is instantiated. * Any Exception thrown during the instantiation process is wrapped as a {@link DatatypeConfigurationException}. *
  2. *
  3. - * If the file ${JAVA_HOME}/conf/jaxp.properties exists, it is loaded in a {@link java.util.Properties} Object. - * The Properties Object is then queried for the property as documented in the prior step - * and processed as documented in the prior step. + *

    + * Use the configuration file "jaxp.properties". The file is in standard + * {@link java.util.Properties} format and typically located in the + * {@code conf} directory of the Java installation. It contains the fully qualified + * name of the implementation class with the key being the system property + * defined above. + *

    + * The jaxp.properties file is read only once by the JAXP implementation + * and its values are then cached for future use. If the file does not exist + * when the first attempt is made to read from it, no further attempts are + * made to check for its existence. It is not possible to change the value + * of any property in jaxp.properties after it has been read for the first time. *

  4. *
  5. - * Uses the service-provider loading facilities, defined by the {@link java.util.ServiceLoader} class, to attempt + *

    + * Use the service-provider loading facility, defined by the {@link java.util.ServiceLoader} class, to attempt * to locate and load an implementation of the service using the {@linkplain * java.util.ServiceLoader#load(java.lang.Class) default loading mechanism}: * the service-provider loading facility will use the {@linkplain @@ -56,13 +67,14 @@ import java.util.regex.Pattern; * to attempt to load the service. If the context class * loader is null, the {@linkplain * ClassLoader#getSystemClassLoader() system class loader} will be used. - *
    + *

    * In case of {@link java.util.ServiceConfigurationError service - * configuration error} a {@link javax.xml.datatype.DatatypeConfigurationException} + * configuration error}, a {@link javax.xml.datatype.DatatypeConfigurationException} * will be thrown. *

  6. *
  7. - * The final mechanism is to attempt to instantiate the Class specified by + *

    + * The final mechanism is to attempt to instantiate the {@code Class} specified by * {@link #DATATYPEFACTORY_IMPLEMENTATION_CLASS}. * Any Exception thrown during the instantiation process is wrapped as a {@link DatatypeConfigurationException}. *

  8. @@ -79,7 +91,7 @@ public abstract class DatatypeFactory { /** *

    Default property name as defined in JSR 206: Java(TM) API for XML Processing (JAXP) 1.3.

    * - *

    Default value is javax.xml.datatype.DatatypeFactory.

    + *

    Default value is {@code javax.xml.datatype.DatatypeFactory}.

    */ public static final String DATATYPEFACTORY_PROPERTY = // We use a String constant here, rather than calling @@ -120,18 +132,18 @@ public abstract class DatatypeFactory { /** *

    Protected constructor to prevent instantiation outside of package.

    * - *

    Use {@link #newInstance()} to create a DatatypeFactory.

    + *

    Use {@link #newInstance()} to create a {@code DatatypeFactory}.

    */ protected DatatypeFactory() { } /** - *

    Obtain a new instance of a DatatypeFactory.

    + *

    Obtain a new instance of a {@code DatatypeFactory}.

    * *

    The implementation resolution mechanisms are defined in this * Class's documentation.

    * - * @return New instance of a DatatypeFactory + * @return New instance of a {@code DatatypeFactory} * * @throws DatatypeConfigurationException If the implementation is not * available or cannot be instantiated. @@ -149,12 +161,12 @@ public abstract class DatatypeFactory { } /** - *

    Obtain a new instance of a DatatypeFactory from class name. + *

    Obtain a new instance of a {@code DatatypeFactory} from class name. * This function is useful when there are multiple providers in the classpath. * It gives more control to the application as it can specify which provider * should be loaded.

    * - *

    Once an application has obtained a reference to a DatatypeFactory + *

    Once an application has obtained a reference to a {@code DatatypeFactory} * it can use the factory to configure and obtain datatype instances.

    * * @@ -168,12 +180,12 @@ public abstract class DatatypeFactory { * java -Djaxp.debug=1 YourProgram .... * * - * @param factoryClassName fully qualified factory class name that provides implementation of javax.xml.datatype.DatatypeFactory. + * @param factoryClassName fully qualified factory class name that provides implementation of {@code javax.xml.datatype.DatatypeFactory}. * * @param classLoader ClassLoader used to load the factory class. If null * current Thread's context classLoader is used to load the factory class. * - * @return New instance of a DatatypeFactory + * @return New instance of a {@code DatatypeFactory} * * @throws DatatypeConfigurationException if factoryClassName is null, or * the factory class cannot be loaded, instantiated. diff --git a/jaxp/src/java.xml/share/classes/javax/xml/parsers/DocumentBuilderFactory.java b/jaxp/src/java.xml/share/classes/javax/xml/parsers/DocumentBuilderFactory.java index 62bd3bd27c0..c500869cd7f 100644 --- a/jaxp/src/java.xml/share/classes/javax/xml/parsers/DocumentBuilderFactory.java +++ b/jaxp/src/java.xml/share/classes/javax/xml/parsers/DocumentBuilderFactory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -55,31 +55,34 @@ public abstract class DocumentBuilderFactory { /** * Obtain a new instance of a - * DocumentBuilderFactory. This static method creates + * {@code DocumentBuilderFactory}. This static method creates * a new factory instance. * This method uses the following ordered lookup procedure to determine - * the DocumentBuilderFactory implementation class to + * the {@code DocumentBuilderFactory} implementation class to * load: + *

    *

      *
    • - * Use the javax.xml.parsers.DocumentBuilderFactory system + * Use the {@code javax.xml.parsers.DocumentBuilderFactory} system * property. *
    • *
    • - * Use the properties file "conf/jaxp.properties" in the JRE directory. - * This configuration file is in standard java.util.Properties - * format and contains the fully qualified name of the - * implementation class with the key being the system property defined - * above. - * + *

      + * Use the configuration file "jaxp.properties". The file is in standard + * {@link java.util.Properties} format and typically located in the + * {@code conf} directory of the Java installation. It contains the fully qualified + * name of the implementation class with the key being the system property + * defined above. + *

      * The jaxp.properties file is read only once by the JAXP implementation - * and it's values are then cached for future use. If the file does not exist + * and its values are then cached for future use. If the file does not exist * when the first attempt is made to read from it, no further attempts are * made to check for its existence. It is not possible to change the value * of any property in jaxp.properties after it has been read for the first time. *

    • *
    • - * Uses the service-provider loading facilities, defined by the + *

      + * Use the service-provider loading facility, defined by the * {@link java.util.ServiceLoader} class, to attempt to locate and load an * implementation of the service using the {@linkplain * java.util.ServiceLoader#load(java.lang.Class) default loading mechanism}: @@ -90,26 +93,30 @@ public abstract class DocumentBuilderFactory { * ClassLoader#getSystemClassLoader() system class loader} will be used. *

    • *
    • + *

      * Otherwise, the system-default implementation is returned. *

    • *
    * + *

    * Once an application has obtained a reference to a - * DocumentBuilderFactory it can use the factory to + * {@code DocumentBuilderFactory} it can use the factory to * configure and obtain parser instances. * * *

    Tip for Trouble-shooting

    - *

    Setting the jaxp.debug system property will cause + *

    + * Setting the {@code jaxp.debug} system property will cause * this method to print a lot of debug messages - * to System.err about what it is doing and where it is looking at.

    + * to {@code System.err} about what it is doing and where it is looking at. * - *

    If you have problems loading {@link DocumentBuilder}s, try:

    + *

    + * If you have problems loading {@link DocumentBuilder}s, try: *

          * java -Djaxp.debug=1 YourProgram ....
          * 
    * - * @return New instance of a DocumentBuilderFactory + * @return New instance of a {@code DocumentBuilderFactory} * * @throws FactoryConfigurationError in case of {@linkplain * java.util.ServiceConfigurationError service configuration error} or if @@ -124,31 +131,31 @@ public abstract class DocumentBuilderFactory { } /** - *

    Obtain a new instance of a DocumentBuilderFactory from class name. + *

    Obtain a new instance of a {@code DocumentBuilderFactory} from class name. * This function is useful when there are multiple providers in the classpath. * It gives more control to the application as it can specify which provider - * should be loaded.

    + * should be loaded. * - *

    Once an application has obtained a reference to a DocumentBuilderFactory - * it can use the factory to configure and obtain parser instances.

    + *

    Once an application has obtained a reference to a {@code DocumentBuilderFactory} + * it can use the factory to configure and obtain parser instances. * * *

    Tip for Trouble-shooting

    - *

    Setting the jaxp.debug system property will cause + *

    Setting the {@code jaxp.debug} system property will cause * this method to print a lot of debug messages - * to System.err about what it is doing and where it is looking at.

    + * to {@code System.err} about what it is doing and where it is looking at.

    * *

    If you have problems try:

    *
          * java -Djaxp.debug=1 YourProgram ....
          * 
    * - * @param factoryClassName fully qualified factory class name that provides implementation of javax.xml.parsers.DocumentBuilderFactory. + * @param factoryClassName fully qualified factory class name that provides implementation of {@code javax.xml.parsers.DocumentBuilderFactory}. * * @param classLoader ClassLoader used to load the factory class. If null * current Thread's context classLoader is used to load the factory class. * - * @return New instance of a DocumentBuilderFactory + * @return New instance of a {@code DocumentBuilderFactory} * * @throws FactoryConfigurationError if factoryClassName is null, or * the factory class cannot be loaded, instantiated. @@ -406,14 +413,14 @@ public abstract class DocumentBuilderFactory { throws IllegalArgumentException; /** - *

    Set a feature for this DocumentBuilderFactory and DocumentBuilders created by this factory.

    + *

    Set a feature for this {@code DocumentBuilderFactory} and DocumentBuilders created by this factory.

    * *

    * Feature names are fully qualified {@link java.net.URI}s. * Implementations may define their own features. - * A {@link ParserConfigurationException} is thrown if this DocumentBuilderFactory or the + * A {@link ParserConfigurationException} is thrown if this {@code DocumentBuilderFactory} or the * DocumentBuilders it creates cannot support the feature. - * It is possible for a DocumentBuilderFactory to expose a feature value but be unable to change its state. + * It is possible for a {@code DocumentBuilderFactory} to expose a feature value but be unable to change its state. *

    * *

    @@ -436,7 +443,7 @@ public abstract class DocumentBuilderFactory { * @param name Feature name. * @param value Is feature state true or false. * - * @throws ParserConfigurationException if this DocumentBuilderFactory or the DocumentBuilders + * @throws ParserConfigurationException if this {@code DocumentBuilderFactory} or the DocumentBuilders * it creates cannot support this feature. * @throws NullPointerException If the name parameter is null. * @since 1.5 @@ -450,16 +457,16 @@ public abstract class DocumentBuilderFactory { *

    * Feature names are fully qualified {@link java.net.URI}s. * Implementations may define their own features. - * An {@link ParserConfigurationException} is thrown if this DocumentBuilderFactory or the + * An {@link ParserConfigurationException} is thrown if this {@code DocumentBuilderFactory} or the * DocumentBuilders it creates cannot support the feature. - * It is possible for an DocumentBuilderFactory to expose a feature value but be unable to change its state. + * It is possible for an {@code DocumentBuilderFactory} to expose a feature value but be unable to change its state. *

    * * @param name Feature name. * * @return State of the named feature. * - * @throws ParserConfigurationException if this DocumentBuilderFactory + * @throws ParserConfigurationException if this {@code DocumentBuilderFactory} * or the DocumentBuilders it creates cannot support this feature. * @since 1.5 */ diff --git a/jaxp/src/java.xml/share/classes/javax/xml/parsers/SAXParserFactory.java b/jaxp/src/java.xml/share/classes/javax/xml/parsers/SAXParserFactory.java index f2e9120a02f..1160a62edf4 100644 --- a/jaxp/src/java.xml/share/classes/javax/xml/parsers/SAXParserFactory.java +++ b/jaxp/src/java.xml/share/classes/javax/xml/parsers/SAXParserFactory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -59,31 +59,34 @@ public abstract class SAXParserFactory { } /** - * Obtain a new instance of a SAXParserFactory. This + * Obtain a new instance of a {@code SAXParserFactory}. This * static method creates a new factory instance * This method uses the following ordered lookup procedure to determine - * the SAXParserFactory implementation class to + * the {@code SAXParserFactory} implementation class to * load: + *

    *

      *
    • - * Use the javax.xml.parsers.SAXParserFactory system + * Use the {@code javax.xml.parsers.SAXParserFactory} system * property. *
    • *
    • - * Use the properties file "conf/jaxp.properties" in the JRE directory. - * This configuration file is in standard java.util.Properties - * format and contains the fully qualified name of the - * implementation class with the key being the system property defined - * above. - * + *

      + * Use the configuration file "jaxp.properties". The file is in standard + * {@link java.util.Properties} format and typically located in the + * {@code conf} directory of the Java installation. It contains the fully qualified + * name of the implementation class with the key being the system property + * defined above. + *

      * The jaxp.properties file is read only once by the JAXP implementation - * and it's values are then cached for future use. If the file does not exist + * and its values are then cached for future use. If the file does not exist * when the first attempt is made to read from it, no further attempts are * made to check for its existence. It is not possible to change the value * of any property in jaxp.properties after it has been read for the first time. *

    • *
    • - * Use the service-provider loading facilities, defined by the + *

      + * Use the service-provider loading facility, defined by the * {@link java.util.ServiceLoader} class, to attempt to locate and load an * implementation of the service using the {@linkplain * java.util.ServiceLoader#load(java.lang.Class) default loading mechanism}: @@ -94,22 +97,26 @@ public abstract class SAXParserFactory { * ClassLoader#getSystemClassLoader() system class loader} will be used. *

    • *
    • + *

      * Otherwise the system-default implementation is returned. *

    • *
    * + *

    * Once an application has obtained a reference to a - * SAXParserFactory it can use the factory to + * {@code SAXParserFactory} it can use the factory to * configure and obtain parser instances. * * * *

    Tip for Trouble-shooting

    - *

    Setting the jaxp.debug system property will cause + *

    + * Setting the {@code jaxp.debug} system property will cause * this method to print a lot of debug messages - * to System.err about what it is doing and where it is looking at.

    + * to {@code System.err} about what it is doing and where it is looking at. * - *

    If you have problems loading {@link SAXParser}s, try:

    + *

    + * If you have problems loading {@link SAXParser}s, try: *

          * java -Djaxp.debug=1 YourProgram ....
          * 
    @@ -131,31 +138,32 @@ public abstract class SAXParserFactory { } /** - *

    Obtain a new instance of a SAXParserFactory from class name. + *

    Obtain a new instance of a {@code SAXParserFactory} from class name. * This function is useful when there are multiple providers in the classpath. * It gives more control to the application as it can specify which provider * should be loaded.

    * - *

    Once an application has obtained a reference to a SAXParserFactory + *

    Once an application has obtained a reference to a {@code SAXParserFactory} * it can use the factory to configure and obtain parser instances.

    * * *

    Tip for Trouble-shooting

    - *

    Setting the jaxp.debug system property will cause + *

    Setting the {@code jaxp.debug} system property will cause * this method to print a lot of debug messages - * to System.err about what it is doing and where it is looking at.

    + * to {@code System.err} about what it is doing and where it is looking at.

    * - *

    If you have problems, try:

    + *

    + * If you have problems, try: *

          * java -Djaxp.debug=1 YourProgram ....
          * 
    * - * @param factoryClassName fully qualified factory class name that provides implementation of javax.xml.parsers.SAXParserFactory. + * @param factoryClassName fully qualified factory class name that provides implementation of {@code javax.xml.parsers.SAXParserFactory}. * * @param classLoader ClassLoader used to load the factory class. If null * current Thread's context classLoader is used to load the factory class. * - * @return New instance of a SAXParserFactory + * @return New instance of a {@code SAXParserFactory} * * @throws FactoryConfigurationError if factoryClassName is null, or * the factory class cannot be loaded, instantiated. diff --git a/jaxp/src/java.xml/share/classes/javax/xml/stream/XMLEventFactory.java b/jaxp/src/java.xml/share/classes/javax/xml/stream/XMLEventFactory.java index 548feeb272a..fc14bc620bc 100644 --- a/jaxp/src/java.xml/share/classes/javax/xml/stream/XMLEventFactory.java +++ b/jaxp/src/java.xml/share/classes/javax/xml/stream/XMLEventFactory.java @@ -23,7 +23,7 @@ */ /* - * Copyright (c) 2009, 2013, by Oracle Corporation. All Rights Reserved. + * Copyright (c) 2009, 2015, by Oracle Corporation. All Rights Reserved. */ package javax.xml.stream; @@ -70,19 +70,34 @@ public abstract class XMLEventFactory { * This static method creates a new factory instance. * This method uses the following ordered lookup procedure to determine * the XMLEventFactory implementation class to load: - *

    + *

    *

      *
    • * Use the javax.xml.stream.XMLEventFactory system property. *
    • *
    • - * Use the properties file "lib/stax.properties" in the JRE directory. - * This configuration file is in standard java.util.Properties format - * and contains the fully qualified name of the implementation class - * with the key being the system property defined above. + *

      + * Use the configuration file "stax.properties". The file is in standard + * {@link java.util.Properties} format and typically located in the + * {@code conf} directory of the Java installation. It contains the fully qualified + * name of the implementation class with the key being the system property + * defined above. + * + *

      + * The stax.properties file is read only once by the implementation + * and its values are then cached for future use. If the file does not exist + * when the first attempt is made to read from it, no further attempts are + * made to check for its existence. It is not possible to change the value + * of any property in stax.properties after it has been read for the first time. + * + *

      + * Use the jaxp configuration file "jaxp.properties". The file is in the same + * format as stax.properties and will only be read if stax.properties does + * not exist. *

    • *
    • - * Use the service-provider loading facilities, defined by the + *

      + * Use the service-provider loading facility, defined by the * {@link java.util.ServiceLoader} class, to attempt to locate and load an * implementation of the service using the {@linkplain * java.util.ServiceLoader#load(java.lang.Class) default loading mechanism}: @@ -93,18 +108,18 @@ public abstract class XMLEventFactory { * ClassLoader#getSystemClassLoader() system class loader} will be used. *

    • *
    • + *

      * Otherwise, the system-default implementation is returned. *

    • *
    *

    * Once an application has obtained a reference to a XMLEventFactory it * can use the factory to configure and obtain stream instances. - *

    *

    * Note that this is a new method that replaces the deprecated newInstance() method. * No changes in behavior are defined by this replacement method relative to * the deprecated method. - *

    + * * @throws FactoryConfigurationError in case of {@linkplain * java.util.ServiceConfigurationError service configuration error} or if * the implementation is not available or cannot be instantiated. @@ -143,20 +158,35 @@ public abstract class XMLEventFactory { *

    * This method uses the following ordered lookup procedure to determine * the XMLEventFactory implementation class to load: - *

    + *

    *

      *
    • * Use the value of the system property identified by {@code factoryId}. *
    • *
    • - * Use the properties file "lib/stax.properties" in the JRE directory. - * This configuration file is in standard java.util.Properties format - * and contains the fully qualified name of the implementation class - * with the key being the given {@code factoryId}. + *

      + * Use the configuration file "stax.properties". The file is in standard + * {@link java.util.Properties} format and typically located in the + * conf directory of the Java installation. It contains the fully qualified + * name of the implementation class with the key being the system property + * defined above. + * + *

      + * The stax.properties file is read only once by the implementation + * and its values are then cached for future use. If the file does not exist + * when the first attempt is made to read from it, no further attempts are + * made to check for its existence. It is not possible to change the value + * of any property in stax.properties after it has been read for the first time. + * + *

      + * Use the jaxp configuration file "jaxp.properties". The file is in the same + * format as stax.properties and will only be read if stax.properties does + * not exist. *

    • *
    • + *

      * If {@code factoryId} is "javax.xml.stream.XMLEventFactory", - * use the service-provider loading facilities, defined by the + * use the service-provider loading facility, defined by the * {@link java.util.ServiceLoader} class, to attempt to {@linkplain * java.util.ServiceLoader#load(java.lang.Class, java.lang.ClassLoader) locate and load} * an implementation of the service using the specified {@code ClassLoader}. @@ -169,6 +199,7 @@ public abstract class XMLEventFactory { * ClassLoader#getSystemClassLoader() system class loader} will be used. *

    • *
    • + *

      * Otherwise, throws a {@link FactoryConfigurationError}. *

    • *
    @@ -179,7 +210,6 @@ public abstract class XMLEventFactory { * newInstance(String factoryId, ClassLoader classLoader)} method. * No changes in behavior are defined by this replacement method relative * to the deprecated method. - *

    * * @apiNote The parameter factoryId defined here is inconsistent with that * of other JAXP factories where the first parameter is fully qualified diff --git a/jaxp/src/java.xml/share/classes/javax/xml/stream/XMLInputFactory.java b/jaxp/src/java.xml/share/classes/javax/xml/stream/XMLInputFactory.java index 20af7a052b2..90030378467 100644 --- a/jaxp/src/java.xml/share/classes/javax/xml/stream/XMLInputFactory.java +++ b/jaxp/src/java.xml/share/classes/javax/xml/stream/XMLInputFactory.java @@ -68,7 +68,7 @@ import javax.xml.transform.Source; * * * @version 1.2 - * @author Copyright (c) 2009 by Oracle Corporation. All Rights Reserved. + * @author Copyright (c) 2009, 2015 by Oracle Corporation. All Rights Reserved. * @see XMLOutputFactory * @see XMLEventReader * @see XMLStreamReader @@ -163,16 +163,28 @@ public abstract class XMLInputFactory { *

    *
      *
    • - * Use the javax.xml.stream.XMLInputFactory system property. + *

      Use the javax.xml.stream.XMLInputFactory system property. *

    • *
    • - * Use the properties file "lib/stax.properties" in the JRE directory. - * This configuration file is in standard java.util.Properties format - * and contains the fully qualified name of the implementation class - * with the key being the system property defined above. + *

      Use the configuration file "stax.properties". The file is in standard + * {@link java.util.Properties} format and typically located in the + * {@code conf} directory of the Java installation. It contains the fully qualified + * name of the implementation class with the key being the system property + * defined above. + * + *

      The stax.properties file is read only once by the implementation + * and its values are then cached for future use. If the file does not exist + * when the first attempt is made to read from it, no further attempts are + * made to check for its existence. It is not possible to change the value + * of any property in stax.properties after it has been read for the first time. + * + *

      + * Use the jaxp configuration file "jaxp.properties". The file is in the same + * format as stax.properties and will only be read if stax.properties does + * not exist. *

    • *
    • - * Use the service-provider loading facilities, defined by the + *

      Use the service-provider loading facility, defined by the * {@link java.util.ServiceLoader} class, to attempt to locate and load an * implementation of the service using the {@linkplain * java.util.ServiceLoader#load(java.lang.Class) default loading mechanism}: @@ -183,7 +195,7 @@ public abstract class XMLInputFactory { * ClassLoader#getSystemClassLoader() system class loader} will be used. *

    • *
    • - * Otherwise, the system-default implementation is returned. + *

      Otherwise, the system-default implementation is returned. *

    • *
    *

    @@ -233,20 +245,36 @@ public abstract class XMLInputFactory { *

    * This method uses the following ordered lookup procedure to determine * the XMLInputFactory implementation class to load: - *

    + *

    *

      *
    • + *

      * Use the value of the system property identified by {@code factoryId}. *

    • *
    • - * Use the properties file "lib/stax.properties" in the JRE directory. - * This configuration file is in standard java.util.Properties format - * and contains the fully qualified name of the implementation class - * with the key being the given {@code factoryId}. + *

      + * Use the configuration file "stax.properties". The file is in standard + * {@link java.util.Properties} format and typically located in the + * {@code conf} directory of the Java installation. It contains the fully qualified + * name of the implementation class with the key being the system property + * defined above. + * + *

      + * The stax.properties file is read only once by the implementation + * and its values are then cached for future use. If the file does not exist + * when the first attempt is made to read from it, no further attempts are + * made to check for its existence. It is not possible to change the value + * of any property in stax.properties after it has been read for the first time. + * + *

      + * Use the jaxp configuration file "jaxp.properties". The file is in the same + * format as stax.properties and will only be read if stax.properties does + * not exist. *

    • *
    • + *

      * If {@code factoryId} is "javax.xml.stream.XMLInputFactory", - * use the service-provider loading facilities, defined by the + * use the service-provider loading facility, defined by the * {@link java.util.ServiceLoader} class, to attempt to {@linkplain * java.util.ServiceLoader#load(java.lang.Class, java.lang.ClassLoader) locate and load} * an implementation of the service using the specified {@code ClassLoader}. @@ -259,6 +287,7 @@ public abstract class XMLInputFactory { * ClassLoader#getSystemClassLoader() system class loader} will be used. *

    • *
    • + *

      * Otherwise, throws a {@link FactoryConfigurationError}. *

    • *
    @@ -269,7 +298,7 @@ public abstract class XMLInputFactory { * newInstance(String factoryId, ClassLoader classLoader)} method. * No changes in behavior are defined by this replacement method relative * to the deprecated method. - *

    + * * * @apiNote The parameter factoryId defined here is inconsistent with that * of other JAXP factories where the first parameter is fully qualified diff --git a/jaxp/src/java.xml/share/classes/javax/xml/stream/XMLOutputFactory.java b/jaxp/src/java.xml/share/classes/javax/xml/stream/XMLOutputFactory.java index e875ac2c277..4524a4e8315 100644 --- a/jaxp/src/java.xml/share/classes/javax/xml/stream/XMLOutputFactory.java +++ b/jaxp/src/java.xml/share/classes/javax/xml/stream/XMLOutputFactory.java @@ -102,7 +102,7 @@ import javax.xml.transform.Result; * namespace URI of the element or attribute using that prefix.

    * * @version 1.2 - * @author Copyright (c) 2009 by Oracle Corporation. All Rights Reserved. + * @author Copyright (c) 2009, 2015 by Oracle Corporation. All Rights Reserved. * @see XMLInputFactory * @see XMLEventWriter * @see XMLStreamWriter @@ -136,19 +136,34 @@ public abstract class XMLOutputFactory { * This static method creates a new factory instance. This method uses the * following ordered lookup procedure to determine the XMLOutputFactory * implementation class to load: - *

    + *

    *

      *
    • * Use the javax.xml.stream.XMLOutputFactory system property. *
    • *
    • - * Use the properties file "lib/stax.properties" in the JRE directory. - * This configuration file is in standard java.util.Properties format - * and contains the fully qualified name of the implementation class - * with the key being the system property defined above. + *

      + * Use the configuration file "stax.properties". The file is in standard + * {@link java.util.Properties} format and typically located in the + * {@code conf} directory of the Java installation. It contains the fully qualified + * name of the implementation class with the key being the system property + * defined above. + * + *

      + * The stax.properties file is read only once by the implementation + * and its values are then cached for future use. If the file does not exist + * when the first attempt is made to read from it, no further attempts are + * made to check for its existence. It is not possible to change the value + * of any property in stax.properties after it has been read for the first time. + * + *

      + * Use the jaxp configuration file "jaxp.properties". The file is in the same + * format as stax.properties and will only be read if stax.properties does + * not exist. *

    • *
    • - * Use the service-provider loading facilities, defined by the + *

      + * Use the service-provider loading facility, defined by the * {@link java.util.ServiceLoader} class, to attempt to locate and load an * implementation of the service using the {@linkplain * java.util.ServiceLoader#load(java.lang.Class) default loading mechanism}: @@ -159,17 +174,17 @@ public abstract class XMLOutputFactory { * ClassLoader#getSystemClassLoader() system class loader} will be used. *

    • *
    • + *

      * Otherwise, the system-default implementation is returned. *

    • *

      * Once an application has obtained a reference to a XMLOutputFactory it * can use the factory to configure and obtain stream instances. - *

      *

      * Note that this is a new method that replaces the deprecated newInstance() method. * No changes in behavior are defined by this replacement method relative to the * deprecated method. - *

      + * * @throws FactoryConfigurationError in case of {@linkplain * java.util.ServiceConfigurationError service configuration error} or if * the implementation is not available or cannot be instantiated. @@ -207,20 +222,35 @@ public abstract class XMLOutputFactory { *

      * This method uses the following ordered lookup procedure to determine * the XMLOutputFactory implementation class to load: - *

      + *

      *

        *
      • * Use the value of the system property identified by {@code factoryId}. *
      • *
      • - * Use the properties file "lib/stax.properties" in the JRE directory. - * This configuration file is in standard java.util.Properties format - * and contains the fully qualified name of the implementation class - * with the key being the given {@code factoryId}. + *

        + * Use the configuration file "stax.properties". The file is in standard + * {@link java.util.Properties} format and typically located in the + * {@code conf} directory of the Java installation. It contains the fully qualified + * name of the implementation class with the key being the system property + * defined above. + * + *

        + * The stax.properties file is read only once by the implementation + * and its values are then cached for future use. If the file does not exist + * when the first attempt is made to read from it, no further attempts are + * made to check for its existence. It is not possible to change the value + * of any property in stax.properties after it has been read for the first time. + * + *

        + * Use the jaxp configuration file "jaxp.properties". The file is in the same + * format as stax.properties and will only be read if stax.properties does + * not exist. *

      • *
      • + *

        * If {@code factoryId} is "javax.xml.stream.XMLOutputFactory", - * use the service-provider loading facilities, defined by the + * use the service-provider loading facility, defined by the * {@link java.util.ServiceLoader} class, to attempt to {@linkplain * java.util.ServiceLoader#load(java.lang.Class, java.lang.ClassLoader) locate and load} * an implementation of the service using the specified {@code ClassLoader}. @@ -233,6 +263,7 @@ public abstract class XMLOutputFactory { * ClassLoader#getSystemClassLoader() system class loader} will be used. *

      • *
      • + *

        * Otherwise, throws a {@link FactoryConfigurationError}. *

      • *
      @@ -246,7 +277,7 @@ public abstract class XMLOutputFactory { * {@link #newInstance(java.lang.String, java.lang.ClassLoader) * newInstance(String factoryId, ClassLoader classLoader)} method. * The original method was incorrectly defined to return XMLInputFactory. - *

      + * * * @param factoryId Name of the factory to find, same as * a property name diff --git a/jaxp/src/java.xml/share/classes/javax/xml/transform/TransformerFactory.java b/jaxp/src/java.xml/share/classes/javax/xml/transform/TransformerFactory.java index 846cda11048..2fd931df891 100644 --- a/jaxp/src/java.xml/share/classes/javax/xml/transform/TransformerFactory.java +++ b/jaxp/src/java.xml/share/classes/javax/xml/transform/TransformerFactory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -33,7 +33,7 @@ package javax.xml.transform; *

      The system property that determines which Factory implementation * to create is named "javax.xml.transform.TransformerFactory". * This property names a concrete subclass of the - * TransformerFactory abstract class. If the property is not + * {@code TransformerFactory} abstract class. If the property is not * defined, a platform default is be used.

      * * @author Jeff Suttor @@ -51,31 +51,36 @@ public abstract class TransformerFactory { /** - *

      Obtain a new instance of a TransformerFactory. - * This static method creates a new factory instance.

      - *

      This method uses the following ordered lookup procedure to determine - * the TransformerFactory implementation class to - * load:

      + *

      + * Obtain a new instance of a {@code TransformerFactory}. + * This static method creates a new factory instance. + *

      + * This method uses the following ordered lookup procedure to determine + * the {@code TransformerFactory} implementation class to + * load: + *

      *

        *
      • - * Use the javax.xml.transform.TransformerFactory system + * Use the {@code javax.xml.transform.TransformerFactory} system * property. *
      • *
      • - * Use the properties file "conf/jaxp.properties" in the JRE directory. - * This configuration file is in standard java.util.Properties - * format and contains the fully qualified name of the - * implementation class with the key being the system property defined - * above. - *
        + *

        + * Use the configuration file "jaxp.properties". The file is in standard + * {@link java.util.Properties} format and typically located in the + * {@code conf} directory of the Java installation. It contains the fully qualified + * name of the implementation class with the key being the system property + * defined above. + *

        * The jaxp.properties file is read only once by the JAXP implementation - * and it's values are then cached for future use. If the file does not exist + * and its values are then cached for future use. If the file does not exist * when the first attempt is made to read from it, no further attempts are * made to check for its existence. It is not possible to change the value * of any property in jaxp.properties after it has been read for the first time. *

      • *
      • - * Use the service-provider loading facilities, defined by the + *

        + * Use the service-provider loading facility, defined by the * {@link java.util.ServiceLoader} class, to attempt to locate and load an * implementation of the service using the {@linkplain * java.util.ServiceLoader#load(java.lang.Class) default loading mechanism}: @@ -86,13 +91,15 @@ public abstract class TransformerFactory { * ClassLoader#getSystemClassLoader() system class loader} will be used. *

      • *
      • + *

        * Otherwise, the system-default implementation is returned. *

      • *
      * - *

      Once an application has obtained a reference to a - * TransformerFactory it can use the factory to configure - * and obtain transformer instances.

      + *

      + * Once an application has obtained a reference to a + * {@code TransformerFactory} it can use the factory to configure + * and obtain transformer instances. * * @return new TransformerFactory instance, never null. * @@ -111,13 +118,13 @@ public abstract class TransformerFactory { } /** - *

      Obtain a new instance of a TransformerFactory from factory class name. + *

      Obtain a new instance of a {@code TransformerFactory} from factory class name. * This function is useful when there are multiple providers in the classpath. * It gives more control to the application as it can specify which provider * should be loaded.

      * - *

      Once an application has obtained a reference to a - * TransformerFactory it can use the factory to configure + *

      Once an application has obtained a reference to a + * {@code TransformerFactory} it can use the factory to configure * and obtain transformer instances.

      * *

      Tip for Trouble-shooting

      @@ -130,7 +137,7 @@ public abstract class TransformerFactory { * java -Djaxp.debug=1 YourProgram .... * * - * @param factoryClassName fully qualified factory class name that provides implementation of javax.xml.transform.TransformerFactory. + * @param factoryClassName fully qualified factory class name that provides implementation of {@code javax.xml.transform.TransformerFactory}. * * @param classLoader ClassLoader used to load the factory class. If null * current Thread's context classLoader is used to load the factory class. @@ -232,7 +239,7 @@ public abstract class TransformerFactory { * @param charset The value of the charset attribute to match. May be null. * * @return A Source Object suitable for passing - * to the TransformerFactory. + * to the {@code TransformerFactory}. * * @throws TransformerConfigurationException An Exception * is thrown if an error occurings during parsing of the @@ -268,15 +275,15 @@ public abstract class TransformerFactory { //======= CONFIGURATION METHODS ======= /** - *

      Set a feature for this TransformerFactory and Transformers + *

      Set a feature for this {@code TransformerFactory} and Transformers * or Templates created by this factory.

      * *

      * Feature names are fully qualified {@link java.net.URI}s. * Implementations may define their own features. - * An {@link TransformerConfigurationException} is thrown if this TransformerFactory or the + * An {@link TransformerConfigurationException} is thrown if this {@code TransformerFactory} or the * Transformers or Templates it creates cannot support the feature. - * It is possible for an TransformerFactory to expose a feature value but be unable to change its state. + * It is possible for an {@code TransformerFactory} to expose a feature value but be unable to change its state. *

      * *

      All implementations are required to support the {@link javax.xml.XMLConstants#FEATURE_SECURE_PROCESSING} feature. @@ -299,7 +306,7 @@ public abstract class TransformerFactory { * @param name Feature name. * @param value Is feature state true or false. * - * @throws TransformerConfigurationException if this TransformerFactory + * @throws TransformerConfigurationException if this {@code TransformerFactory} * or the Transformers or Templates it creates cannot support this feature. * @throws NullPointerException If the name parameter is null. */ @@ -312,9 +319,9 @@ public abstract class TransformerFactory { *

      * Feature names are fully qualified {@link java.net.URI}s. * Implementations may define their own features. - * false is returned if this TransformerFactory or the + * false is returned if this {@code TransformerFactory} or the * Transformers or Templates it creates cannot support the feature. - * It is possible for an TransformerFactory to expose a feature value but be unable to change its state. + * It is possible for an {@code TransformerFactory} to expose a feature value but be unable to change its state. *

      * * @param name Feature name. diff --git a/jaxp/src/java.xml/share/classes/javax/xml/validation/SchemaFactory.java b/jaxp/src/java.xml/share/classes/javax/xml/validation/SchemaFactory.java index 527c6c73a02..ad7e61f9a7f 100644 --- a/jaxp/src/java.xml/share/classes/javax/xml/validation/SchemaFactory.java +++ b/jaxp/src/java.xml/share/classes/javax/xml/validation/SchemaFactory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -132,8 +132,9 @@ public abstract class SchemaFactory { * where "the class loader" refers to the context class loader:

      *
        *
      1. + *

        * If the system property - * "javax.xml.validation.SchemaFactory:schemaLanguage" + * {@code "javax.xml.validation.SchemaFactory:schemaLanguage"} * is present (where schemaLanguage is the parameter * to this method), then its value is read * as a class name. The method will try to @@ -141,12 +142,22 @@ public abstract class SchemaFactory { * and returns it if it is successfully created. *

      2. *
      3. - * $java.home/conf/jaxp.properties is read and - * the value associated with the key being the system property above - * is looked for. If present, the value is processed just like above. + *

        + * Use the configuration file "jaxp.properties". The file is in standard + * {@link java.util.Properties} format and typically located in the + * conf directory of the Java installation. It contains the fully qualified + * name of the implementation class with the key being the system property + * defined above. + *

        + * The jaxp.properties file is read only once by the JAXP implementation + * and its values are then cached for future use. If the file does not exist + * when the first attempt is made to read from it, no further attempts are + * made to check for its existence. It is not possible to change the value + * of any property in jaxp.properties after it has been read for the first time. *

      4. *
      5. - * Use the service-provider loading facilities, defined by the + *

        + * Use the service-provider loading facility, defined by the * {@link java.util.ServiceLoader} class, to attempt to locate and load an * implementation of the service using the {@linkplain * java.util.ServiceLoader#load(java.lang.Class) default loading mechanism}: @@ -166,19 +177,20 @@ public abstract class SchemaFactory { * {@link SchemaFactoryConfigurationError} will be thrown. *

      6. *
      7. + *

        * Platform default SchemaFactory is located * in a implementation specific way. There must be a platform default * SchemaFactory for W3C XML Schema. *

      8. *
      * - *

      If everything fails, {@link IllegalArgumentException} will be thrown.

      + *

      If everything fails, {@link IllegalArgumentException} will be thrown. * - *

      Tip for Trouble-shooting:

      + *

      Tip for Trouble-shooting: *

      See {@link java.util.Properties#load(java.io.InputStream)} for * exactly how a property file is parsed. In particular, colons ':' * need to be escaped in a property file, so make sure schema language - * URIs are properly escaped in it. For example:

      + * URIs are properly escaped in it. For example: *
            * http\://www.w3.org/2001/XMLSchema=org.acme.foo.XSSchemaFactory
            * 
      diff --git a/jaxp/src/java.xml/share/classes/javax/xml/xpath/XPathFactory.java b/jaxp/src/java.xml/share/classes/javax/xml/xpath/XPathFactory.java index ea7370e06e7..05f7a4e52c0 100644 --- a/jaxp/src/java.xml/share/classes/javax/xml/xpath/XPathFactory.java +++ b/jaxp/src/java.xml/share/classes/javax/xml/xpath/XPathFactory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,7 +26,7 @@ package javax.xml.xpath; /** - *

      An XPathFactory instance can be used to create + *

      An {@code XPathFactory} instance can be used to create * {@link javax.xml.xpath.XPath} objects.

      * *

      See {@link #newInstance(String uri)} for lookup mechanism.

      @@ -68,13 +68,13 @@ public abstract class XPathFactory { /** *

      Protected constructor as {@link #newInstance()} or {@link #newInstance(String uri)} * or {@link #newInstance(String uri, String factoryClassName, ClassLoader classLoader)} - * should be used to create a new instance of an XPathFactory.

      + * should be used to create a new instance of an {@code XPathFactory}.

      */ protected XPathFactory() { } /** - *

      Get a new XPathFactory instance using the default object model, + *

      Get a new {@code XPathFactory} instance using the default object model, * {@link #DEFAULT_OBJECT_MODEL_URI}, * the W3C DOM.

      * @@ -85,10 +85,10 @@ public abstract class XPathFactory { * *

      Since the implementation for the W3C DOM is always available, this method will never fail.

      * - * @return Instance of an XPathFactory. + * @return Instance of an {@code XPathFactory}. * * @throws RuntimeException When there is a failure in creating an - * XPathFactory for the default object model. + * {@code XPathFactory} for the default object model. */ public static XPathFactory newInstance() { @@ -105,23 +105,35 @@ public abstract class XPathFactory { } /** - *

      Get a new XPathFactory instance using the specified object model.

      + *

      Get a new {@code XPathFactory} instance using the specified object model.

      * - *

      To find a XPathFactory object, + *

      To find a {@code XPathFactory} object, * this method looks the following places in the following order where "the class loader" refers to the context class loader:

      *
        *
      1. + *

        * If the system property {@link #DEFAULT_PROPERTY_NAME} + ":uri" is present, * where uri is the parameter to this method, then its value is read as a class name. * The method will try to create a new instance of this class by using the class loader, * and returns it if it is successfully created. *

      2. *
      3. - * ${java.home}/lib/jaxp.properties is read and the value associated with the key being the system property above is looked for. - * If present, the value is processed just like above. + *

        + * Use the configuration file "jaxp.properties". The file is in standard + * {@link java.util.Properties} format and typically located in the + * conf directory of the Java installation. It contains the fully qualified + * name of the implementation class with the key being the system property + * defined above. + *

        + * The jaxp.properties file is read only once by the JAXP implementation + * and its values are then cached for future use. If the file does not exist + * when the first attempt is made to read from it, no further attempts are + * made to check for its existence. It is not possible to change the value + * of any property in jaxp.properties after it has been read for the first time. *

      4. *
      5. - * Use the service-provider loading facilities, defined by the + *

        + * Use the service-provider loading facility, defined by the * {@link java.util.ServiceLoader} class, to attempt to locate and load an * implementation of the service using the {@linkplain * java.util.ServiceLoader#load(java.lang.Class) default loading mechanism}: @@ -140,16 +152,17 @@ public abstract class XPathFactory { * {@link XPathFactoryConfigurationException} will be thrown. *

      6. *
      7. - * Platform default XPathFactory is located in a platform specific way. + *

        + * Platform default {@code XPathFactory} is located in a platform specific way. * There must be a platform default XPathFactory for the W3C DOM, i.e. {@link #DEFAULT_OBJECT_MODEL_URI}. *

      8. *
      - *

      If everything fails, an XPathFactoryConfigurationException will be thrown.

      + *

      If everything fails, an {@code XPathFactoryConfigurationException} will be thrown. * - *

      Tip for Trouble-shooting:

      + *

      Tip for Trouble-shooting: *

      See {@link java.util.Properties#load(java.io.InputStream)} for exactly how a property file is parsed. * In particular, colons ':' need to be escaped in a property file, so make sure the URIs are properly escaped in it. - * For example:

      + * For example: *
           *   http\://java.sun.com/jaxp/xpath/dom=org.acme.DomXPathFactory
           * 
      @@ -159,7 +172,7 @@ public abstract class XPathFactory { * http://java.sun.com/jaxp/xpath/dom for the W3C DOM, * the org.w3c.dom package, and implementations are free to introduce other URIs for other object models. * - * @return Instance of an XPathFactory. + * @return Instance of an {@code XPathFactory}. * * @throws XPathFactoryConfigurationException If the specified object model * is unavailable, or if there is a configuration error. @@ -199,7 +212,7 @@ public abstract class XPathFactory { } /** - *

      Obtain a new instance of a XPathFactory from a factory class name. XPathFactory + *

      Obtain a new instance of a {@code XPathFactory} from a factory class name. {@code XPathFactory} * is returned if specified factory class supports the specified object model. * This function is useful when there are multiple providers in the classpath. * It gives more control to the application as it can specify which provider @@ -227,7 +240,7 @@ public abstract class XPathFactory { * current Thread's context classLoader is used to load the factory class. * * - * @return New instance of a XPathFactory + * @return New instance of a {@code XPathFactory} * * @throws XPathFactoryConfigurationException * if factoryClassName is null, or @@ -281,11 +294,11 @@ public abstract class XPathFactory { } /** - *

      Is specified object model supported by this XPathFactory?

      + *

      Is specified object model supported by this {@code XPathFactory}?

      * - * @param objectModel Specifies the object model which the returned XPathFactory will understand. + * @param objectModel Specifies the object model which the returned {@code XPathFactory} will understand. * - * @return true if XPathFactory supports objectModel, else false. + * @return true if {@code XPathFactory} supports objectModel, else false. * * @throws NullPointerException If objectModel is null. * @throws IllegalArgumentException If objectModel.length() == 0. @@ -293,16 +306,16 @@ public abstract class XPathFactory { public abstract boolean isObjectModelSupported(String objectModel); /** - *

      Set a feature for this XPathFactory and + *

      Set a feature for this {@code XPathFactory} and * XPaths created by this factory.

      * *

      * Feature names are fully qualified {@link java.net.URI}s. * Implementations may define their own features. * An {@link XPathFactoryConfigurationException} is thrown if this - * XPathFactory or the XPaths + * {@code XPathFactory} or the XPaths * it creates cannot support the feature. - * It is possible for an XPathFactory to expose a feature value + * It is possible for an {@code XPathFactory} to expose a feature value * but be unable to change its state. *

      * @@ -316,7 +329,7 @@ public abstract class XPathFactory { * @param name Feature name. * @param value Is feature state true or false. * - * @throws XPathFactoryConfigurationException if this XPathFactory or the XPaths + * @throws XPathFactoryConfigurationException if this {@code XPathFactory} or the XPaths * it creates cannot support this feature. * @throws NullPointerException if name is null. */ @@ -330,9 +343,9 @@ public abstract class XPathFactory { * Feature names are fully qualified {@link java.net.URI}s. * Implementations may define their own features. * An {@link XPathFactoryConfigurationException} is thrown if this - * XPathFactory or the XPaths + * {@code XPathFactory} or the XPaths * it creates cannot support the feature. - * It is possible for an XPathFactory to expose a feature value + * It is possible for an {@code XPathFactory} to expose a feature value * but be unable to change its state. *

      * @@ -341,7 +354,7 @@ public abstract class XPathFactory { * @return State of the named feature. * * @throws XPathFactoryConfigurationException if this - * XPathFactory or the XPaths + * {@code XPathFactory} or the XPaths * it creates cannot support this feature. * @throws NullPointerException if name is null. */ @@ -382,7 +395,7 @@ public abstract class XPathFactory { /** *

      Return a new XPath using the underlying object - * model determined when the XPathFactory was instantiated.

      + * model determined when the {@code XPathFactory} was instantiated.

      * * @return New instance of an XPath. */ From 2972cb3840d1f0d24e71f22bd667ef11ca8a5482 Mon Sep 17 00:00:00 2001 From: Attila Szegedi Date: Fri, 6 Mar 2015 09:59:07 +0100 Subject: [PATCH 31/76] 8074491: run-nasgen in ant doesn't see the right Nashorn classes Reviewed-by: hannesw, lagergren --- nashorn/make/build-nasgen.xml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/nashorn/make/build-nasgen.xml b/nashorn/make/build-nasgen.xml index d98333719bd..003201199f4 100644 --- a/nashorn/make/build-nasgen.xml +++ b/nashorn/make/build-nasgen.xml @@ -35,11 +35,10 @@ - - + @@ -52,8 +51,8 @@ - + From e776a10ce338c2031f531192725b62bc3cf109a7 Mon Sep 17 00:00:00 2001 From: Attila Szegedi Date: Fri, 6 Mar 2015 10:18:47 +0100 Subject: [PATCH 32/76] 8074487: Static analysis of IfNode should consider terminating branches Reviewed-by: hannesw, lagergren --- .../codegen/LocalVariableTypesCalculator.java | 78 ++++++++++--------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/LocalVariableTypesCalculator.java b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/LocalVariableTypesCalculator.java index 379d3aca20e..67adc4aca21 100644 --- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/LocalVariableTypesCalculator.java +++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/LocalVariableTypesCalculator.java @@ -206,7 +206,6 @@ final class LocalVariableTypesCalculator extends NodeVisitor{ // continuations (since RewriteException's byteCodeSlots carries an array and not a name-value map). symbolIsConverted(symbol, branchLvarType, targetType); - //symbolIsUsed(symbol, branchLvarType); return new LocalVariableConversion(symbol, branchLvarType.type, targetType.type, next); } @@ -229,7 +228,7 @@ final class LocalVariableTypesCalculator extends NodeVisitor{ for(final Symbol symbol: commonSymbols) { final LvarType type1 = types1.get(symbol); final LvarType type2 = types2.get(symbol); - final LvarType widest = widestLvarType(type1, type2); + final LvarType widest = widestLvarType(type1, type2); if(widest != type1 && matches1) { matches1 = false; if(!matches2) { @@ -242,7 +241,7 @@ final class LocalVariableTypesCalculator extends NodeVisitor{ union = cloneMap(types2); } } - if(!(matches1 || matches2) && union != null) { //remove overly enthusiastic "union can be null" warning + if(!(matches1 || matches2)) { assert union != null; union.put(symbol, widest); } @@ -711,8 +710,13 @@ final class LocalVariableTypesCalculator extends NodeVisitor{ @Override public boolean enterIfNode(final IfNode ifNode) { + processIfNode(ifNode); + return false; + } + + private void processIfNode(final IfNode ifNode) { if(!reachable) { - return false; + return; } final Expression test = ifNode.getTest(); @@ -721,48 +725,48 @@ final class LocalVariableTypesCalculator extends NodeVisitor{ visitExpressionOnEmptyStack(test); - final Map afterTestLvarTypes = localVariableTypes; - if(!isAlwaysFalse(test)) { + final Map passLvarTypes; + final boolean reachableFromPass; + final boolean isTestAlwaysTrue = isAlwaysTrue(test); + if(isAlwaysFalse(test)) { + passLvarTypes = null; + reachableFromPass = false; + } else { + final Map afterTestLvarTypes = localVariableTypes; pass.accept(this); assertTypeStackIsEmpty(); + if (isTestAlwaysTrue) { + return; + } + passLvarTypes = localVariableTypes; + reachableFromPass = reachable; + localVariableTypes = afterTestLvarTypes; + reachable = true; } - final Map passLvarTypes = localVariableTypes; - final boolean reachableFromPass = reachable; - reachable = true; - localVariableTypes = afterTestLvarTypes; - if(!isAlwaysTrue(test) && fail != null) { + // If we get here, then we need to consider the case where pass block is not executed + assert !isTestAlwaysTrue; + + if (fail != null) { fail.accept(this); assertTypeStackIsEmpty(); - final boolean reachableFromFail = reachable; - reachable |= reachableFromPass; - if(!reachable) { - return false; - } - - if(reachableFromFail) { - if(reachableFromPass) { - final Map failLvarTypes = localVariableTypes; - localVariableTypes = getUnionTypes(passLvarTypes, failLvarTypes); - setConversion(pass, passLvarTypes, localVariableTypes); - setConversion(fail, failLvarTypes, localVariableTypes); - } - return false; - } } - if(reachableFromPass) { - localVariableTypes = getUnionTypes(afterTestLvarTypes, passLvarTypes); - // IfNode itself is associated with conversions that might need to be performed after the test if there's no - // else branch. E.g. - // if(x = 1, cond) { x = 1.0 } must widen "x = 1" to a double. - setConversion(pass, passLvarTypes, localVariableTypes); - setConversion(ifNode, afterTestLvarTypes, localVariableTypes); - } else { - localVariableTypes = afterTestLvarTypes; + if(reachable) { + if(reachableFromPass) { + final Map failLvarTypes = localVariableTypes; + localVariableTypes = getUnionTypes(passLvarTypes, failLvarTypes); + setConversion(pass, passLvarTypes, localVariableTypes); + // IfNode itself is associated with conversions that might need to be performed after the test if + // there's no else branch. E.g. + // if(x = 1, cond) { x = 1.0 } must widen "x = 1" to a double. + setConversion(fail != null ? fail : ifNode, failLvarTypes, localVariableTypes); + } + } else if (reachableFromPass) { + assert passLvarTypes != null; + localVariableTypes = passLvarTypes; + reachable = true; } - - return false; } @Override From a98187119402a1c60482128abdefe72e370d869e Mon Sep 17 00:00:00 2001 From: Maurizio Cimadamore Date: Fri, 6 Mar 2015 10:30:44 +0000 Subject: [PATCH 33/76] 8074306: NULLCHK is emitted as Object.getClass 8074501: Javac fix for 8073432 is missing right test BugIDs Correct test bugIds Reviewed-by: jjg --- langtools/test/tools/javac/8074306/TestSyntheticNullChecks.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/langtools/test/tools/javac/8074306/TestSyntheticNullChecks.java b/langtools/test/tools/javac/8074306/TestSyntheticNullChecks.java index 539dd419b71..823740f0d3b 100644 --- a/langtools/test/tools/javac/8074306/TestSyntheticNullChecks.java +++ b/langtools/test/tools/javac/8074306/TestSyntheticNullChecks.java @@ -25,7 +25,7 @@ /* * @test - * @bug 8074306 + * @bug 8074306 8073432 8074501 * @summary NULLCHK is emitted as Object.getClass * @compile -source 6 -target 6 TestSyntheticNullChecks.java * @run main TestSyntheticNullChecks 6 From e1ac257862a7b48fac62b2c7d444179a9cda2445 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hannes=20Walln=C3=B6fer?= Date: Fri, 6 Mar 2015 15:26:51 +0100 Subject: [PATCH 34/76] 8074545: Undefined object values in object literals with spill properties Reviewed-by: lagergren, attila --- .../nashorn/internal/codegen/MapCreator.java | 5 +- .../nashorn/internal/parser/JSONParser.java | 9 +- .../internal/runtime/SpillProperty.java | 9 +- nashorn/test/script/basic/JDK-8074545.js | 1038 +++++++++++++++++ 4 files changed, 1051 insertions(+), 10 deletions(-) create mode 100644 nashorn/test/script/basic/JDK-8074545.js diff --git a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/MapCreator.java b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/MapCreator.java index 1bec86fcf05..ae96dc46607 100644 --- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/MapCreator.java +++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/MapCreator.java @@ -100,15 +100,16 @@ public class MapCreator { for (final MapTuple tuple : tuples) { final String key = tuple.key; final Symbol symbol = tuple.symbol; + final Class initialType = tuple.getValueType(); - //TODO initial type is object here no matter what. Is that right? if (symbol != null && !isValidArrayIndex(getArrayIndex(key))) { final int flags = getPropertyFlags(symbol, hasArguments, false); properties.add( new SpillProperty( key, flags, - spillIndex++)); + spillIndex++, + initialType)); } } diff --git a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/parser/JSONParser.java b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/parser/JSONParser.java index f1f46ea6fad..524381873fb 100644 --- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/parser/JSONParser.java +++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/parser/JSONParser.java @@ -244,20 +244,15 @@ public class JSONParser { private static PropertyMap addObjectProperty(final PropertyMap propertyMap, final List values, final String id, final Object value) { final Property oldProperty = propertyMap.findProperty(id); - final Property newProperty; final PropertyMap newMap; final Class type = ObjectClassGenerator.OBJECT_FIELDS_ONLY ? Object.class : getType(value); if (oldProperty != null) { values.set(oldProperty.getSlot(), value); - newProperty = new SpillProperty(id, 0, oldProperty.getSlot()); - newProperty.setType(type); - newMap = propertyMap.replaceProperty(oldProperty, newProperty);; + newMap = propertyMap.replaceProperty(oldProperty, new SpillProperty(id, 0, oldProperty.getSlot(), type));; } else { values.add(value); - newProperty = new SpillProperty(id, 0, propertyMap.size()); - newProperty.setType(type); - newMap = propertyMap.addProperty(newProperty); + newMap = propertyMap.addProperty(new SpillProperty(id, 0, propertyMap.size(), type)); } return newMap; diff --git a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/SpillProperty.java b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/SpillProperty.java index 7b42b2bfa30..856504a3b0d 100644 --- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/SpillProperty.java +++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/SpillProperty.java @@ -164,7 +164,14 @@ public class SpillProperty extends AccessorProperty { assert !OBJECT_FIELDS_ONLY || getLocalType() == Object.class; } - SpillProperty(final String key, final int flags, final int slot, final Class initialType) { + /** + * Constructor for spill properties with an initial type. + * @param key the property key + * @param flags the property flags + * @param slot spill slot + * @param initialType initial type + */ + public SpillProperty(final String key, final int flags, final int slot, final Class initialType) { this(key, flags, slot); setType(OBJECT_FIELDS_ONLY ? Object.class : initialType); } diff --git a/nashorn/test/script/basic/JDK-8074545.js b/nashorn/test/script/basic/JDK-8074545.js new file mode 100644 index 00000000000..e2ea38cddf0 --- /dev/null +++ b/nashorn/test/script/basic/JDK-8074545.js @@ -0,0 +1,1038 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * JDK-8074545: Undefined object values in object literals with spill properties + * + * @test + * @run + */ + +var obj = { + "p0": { "x" : 0 }, + "p1": { "x" : 1 }, + "p2": { "x" : 2 }, + "p3": { "x" : 3 }, + "p4": { "x" : 4 }, + "p5": { "x" : 5 }, + "p6": { "x" : 6 }, + "p7": { "x" : 7 }, + "p8": { "x" : 8 }, + "p9": { "x" : 9 }, + "p10": { "x" : 10 }, + "p11": { "x" : 11 }, + "p12": { "x" : 12 }, + "p13": { "x" : 13 }, + "p14": { "x" : 14 }, + "p15": { "x" : 15 }, + "p16": { "x" : 16 }, + "p17": { "x" : 17 }, + "p18": { "x" : 18 }, + "p19": { "x" : 19 }, + "p20": { "x" : 20 }, + "p21": { "x" : 21 }, + "p22": { "x" : 22 }, + "p23": { "x" : 23 }, + "p24": { "x" : 24 }, + "p25": { "x" : 25 }, + "p26": { "x" : 26 }, + "p27": { "x" : 27 }, + "p28": { "x" : 28 }, + "p29": { "x" : 29 }, + "p30": { "x" : 30 }, + "p31": { "x" : 31 }, + "p32": { "x" : 32 }, + "p33": { "x" : 33 }, + "p34": { "x" : 34 }, + "p35": { "x" : 35 }, + "p36": { "x" : 36 }, + "p37": { "x" : 37 }, + "p38": { "x" : 38 }, + "p39": { "x" : 39 }, + "p40": { "x" : 40 }, + "p41": { "x" : 41 }, + "p42": { "x" : 42 }, + "p43": { "x" : 43 }, + "p44": { "x" : 44 }, + "p45": { "x" : 45 }, + "p46": { "x" : 46 }, + "p47": { "x" : 47 }, + "p48": { "x" : 48 }, + "p49": { "x" : 49 }, + "p50": { "x" : 50 }, + "p51": { "x" : 51 }, + "p52": { "x" : 52 }, + "p53": { "x" : 53 }, + "p54": { "x" : 54 }, + "p55": { "x" : 55 }, + "p56": { "x" : 56 }, + "p57": { "x" : 57 }, + "p58": { "x" : 58 }, + "p59": { "x" : 59 }, + "p60": { "x" : 60 }, + "p61": { "x" : 61 }, + "p62": { "x" : 62 }, + "p63": { "x" : 63 }, + "p64": { "x" : 64 }, + "p65": { "x" : 65 }, + "p66": { "x" : 66 }, + "p67": { "x" : 67 }, + "p68": { "x" : 68 }, + "p69": { "x" : 69 }, + "p70": { "x" : 70 }, + "p71": { "x" : 71 }, + "p72": { "x" : 72 }, + "p73": { "x" : 73 }, + "p74": { "x" : 74 }, + "p75": { "x" : 75 }, + "p76": { "x" : 76 }, + "p77": { "x" : 77 }, + "p78": { "x" : 78 }, + "p79": { "x" : 79 }, + "p80": { "x" : 80 }, + "p81": { "x" : 81 }, + "p82": { "x" : 82 }, + "p83": { "x" : 83 }, + "p84": { "x" : 84 }, + "p85": { "x" : 85 }, + "p86": { "x" : 86 }, + "p87": { "x" : 87 }, + "p88": { "x" : 88 }, + "p89": { "x" : 89 }, + "p90": { "x" : 90 }, + "p91": { "x" : 91 }, + "p92": { "x" : 92 }, + "p93": { "x" : 93 }, + "p94": { "x" : 94 }, + "p95": { "x" : 95 }, + "p96": { "x" : 96 }, + "p97": { "x" : 97 }, + "p98": { "x" : 98 }, + "p99": { "x" : 99 }, + "p100": { "x" : 100 }, + "p101": { "x" : 101 }, + "p102": { "x" : 102 }, + "p103": { "x" : 103 }, + "p104": { "x" : 104 }, + "p105": { "x" : 105 }, + "p106": { "x" : 106 }, + "p107": { "x" : 107 }, + "p108": { "x" : 108 }, + "p109": { "x" : 109 }, + "p110": { "x" : 110 }, + "p111": { "x" : 111 }, + "p112": { "x" : 112 }, + "p113": { "x" : 113 }, + "p114": { "x" : 114 }, + "p115": { "x" : 115 }, + "p116": { "x" : 116 }, + "p117": { "x" : 117 }, + "p118": { "x" : 118 }, + "p119": { "x" : 119 }, + "p120": { "x" : 120 }, + "p121": { "x" : 121 }, + "p122": { "x" : 122 }, + "p123": { "x" : 123 }, + "p124": { "x" : 124 }, + "p125": { "x" : 125 }, + "p126": { "x" : 126 }, + "p127": { "x" : 127 }, + "p128": { "x" : 128 }, + "p129": { "x" : 129 }, + "p130": { "x" : 130 }, + "p131": { "x" : 131 }, + "p132": { "x" : 132 }, + "p133": { "x" : 133 }, + "p134": { "x" : 134 }, + "p135": { "x" : 135 }, + "p136": { "x" : 136 }, + "p137": { "x" : 137 }, + "p138": { "x" : 138 }, + "p139": { "x" : 139 }, + "p140": { "x" : 140 }, + "p141": { "x" : 141 }, + "p142": { "x" : 142 }, + "p143": { "x" : 143 }, + "p144": { "x" : 144 }, + "p145": { "x" : 145 }, + "p146": { "x" : 146 }, + "p147": { "x" : 147 }, + "p148": { "x" : 148 }, + "p149": { "x" : 149 }, + "p150": { "x" : 150 }, + "p151": { "x" : 151 }, + "p152": { "x" : 152 }, + "p153": { "x" : 153 }, + "p154": { "x" : 154 }, + "p155": { "x" : 155 }, + "p156": { "x" : 156 }, + "p157": { "x" : 157 }, + "p158": { "x" : 158 }, + "p159": { "x" : 159 }, + "p160": { "x" : 160 }, + "p161": { "x" : 161 }, + "p162": { "x" : 162 }, + "p163": { "x" : 163 }, + "p164": { "x" : 164 }, + "p165": { "x" : 165 }, + "p166": { "x" : 166 }, + "p167": { "x" : 167 }, + "p168": { "x" : 168 }, + "p169": { "x" : 169 }, + "p170": { "x" : 170 }, + "p171": { "x" : 171 }, + "p172": { "x" : 172 }, + "p173": { "x" : 173 }, + "p174": { "x" : 174 }, + "p175": { "x" : 175 }, + "p176": { "x" : 176 }, + "p177": { "x" : 177 }, + "p178": { "x" : 178 }, + "p179": { "x" : 179 }, + "p180": { "x" : 180 }, + "p181": { "x" : 181 }, + "p182": { "x" : 182 }, + "p183": { "x" : 183 }, + "p184": { "x" : 184 }, + "p185": { "x" : 185 }, + "p186": { "x" : 186 }, + "p187": { "x" : 187 }, + "p188": { "x" : 188 }, + "p189": { "x" : 189 }, + "p190": { "x" : 190 }, + "p191": { "x" : 191 }, + "p192": { "x" : 192 }, + "p193": { "x" : 193 }, + "p194": { "x" : 194 }, + "p195": { "x" : 195 }, + "p196": { "x" : 196 }, + "p197": { "x" : 197 }, + "p198": { "x" : 198 }, + "p199": { "x" : 199 }, + "p200": { "x" : 200 }, + "p201": { "x" : 201 }, + "p202": { "x" : 202 }, + "p203": { "x" : 203 }, + "p204": { "x" : 204 }, + "p205": { "x" : 205 }, + "p206": { "x" : 206 }, + "p207": { "x" : 207 }, + "p208": { "x" : 208 }, + "p209": { "x" : 209 }, + "p210": { "x" : 210 }, + "p211": { "x" : 211 }, + "p212": { "x" : 212 }, + "p213": { "x" : 213 }, + "p214": { "x" : 214 }, + "p215": { "x" : 215 }, + "p216": { "x" : 216 }, + "p217": { "x" : 217 }, + "p218": { "x" : 218 }, + "p219": { "x" : 219 }, + "p220": { "x" : 220 }, + "p221": { "x" : 221 }, + "p222": { "x" : 222 }, + "p223": { "x" : 223 }, + "p224": { "x" : 224 }, + "p225": { "x" : 225 }, + "p226": { "x" : 226 }, + "p227": { "x" : 227 }, + "p228": { "x" : 228 }, + "p229": { "x" : 229 }, + "p230": { "x" : 230 }, + "p231": { "x" : 231 }, + "p232": { "x" : 232 }, + "p233": { "x" : 233 }, + "p234": { "x" : 234 }, + "p235": { "x" : 235 }, + "p236": { "x" : 236 }, + "p237": { "x" : 237 }, + "p238": { "x" : 238 }, + "p239": { "x" : 239 }, + "p240": { "x" : 240 }, + "p241": { "x" : 241 }, + "p242": { "x" : 242 }, + "p243": { "x" : 243 }, + "p244": { "x" : 244 }, + "p245": { "x" : 245 }, + "p246": { "x" : 246 }, + "p247": { "x" : 247 }, + "p248": { "x" : 248 }, + "p249": { "x" : 249 }, + "p250": { "x" : 250 }, + "p251": { "x" : 251 }, + "p252": { "x" : 252 }, + "p253": { "x" : 253 }, + "p254": { "x" : 254 }, + "p255": { "x" : 255 }, + "p256": { "x" : 256 }, + "p257": { "x" : 257 }, + "p258": { "x" : 258 }, + "p259": { "x" : 259 }, + "p260": { "x" : 260 }, + "p261": { "x" : 261 }, + "p262": { "x" : 262 }, + "p263": { "x" : 263 }, + "p264": { "x" : 264 }, + "p265": { "x" : 265 }, + "p266": { "x" : 266 }, + "p267": { "x" : 267 }, + "p268": { "x" : 268 }, + "p269": { "x" : 269 }, + "p270": { "x" : 270 }, + "p271": { "x" : 271 }, + "p272": { "x" : 272 }, + "p273": { "x" : 273 }, + "p274": { "x" : 274 }, + "p275": { "x" : 275 }, + "p276": { "x" : 276 }, + "p277": { "x" : 277 }, + "p278": { "x" : 278 }, + "p279": { "x" : 279 }, + "p280": { "x" : 280 }, + "p281": { "x" : 281 }, + "p282": { "x" : 282 }, + "p283": { "x" : 283 }, + "p284": { "x" : 284 }, + "p285": { "x" : 285 }, + "p286": { "x" : 286 }, + "p287": { "x" : 287 }, + "p288": { "x" : 288 }, + "p289": { "x" : 289 }, + "p290": { "x" : 290 }, + "p291": { "x" : 291 }, + "p292": { "x" : 292 }, + "p293": { "x" : 293 }, + "p294": { "x" : 294 }, + "p295": { "x" : 295 }, + "p296": { "x" : 296 }, + "p297": { "x" : 297 }, + "p298": { "x" : 298 }, + "p299": { "x" : 299 }, + "p300": { "x" : 300 }, + "p301": { "x" : 301 }, + "p302": { "x" : 302 }, + "p303": { "x" : 303 }, + "p304": { "x" : 304 }, + "p305": { "x" : 305 }, + "p306": { "x" : 306 }, + "p307": { "x" : 307 }, + "p308": { "x" : 308 }, + "p309": { "x" : 309 }, + "p310": { "x" : 310 }, + "p311": { "x" : 311 }, + "p312": { "x" : 312 }, + "p313": { "x" : 313 }, + "p314": { "x" : 314 }, + "p315": { "x" : 315 }, + "p316": { "x" : 316 }, + "p317": { "x" : 317 }, + "p318": { "x" : 318 }, + "p319": { "x" : 319 }, + "p320": { "x" : 320 }, + "p321": { "x" : 321 }, + "p322": { "x" : 322 }, + "p323": { "x" : 323 }, + "p324": { "x" : 324 }, + "p325": { "x" : 325 }, + "p326": { "x" : 326 }, + "p327": { "x" : 327 }, + "p328": { "x" : 328 }, + "p329": { "x" : 329 }, + "p330": { "x" : 330 }, + "p331": { "x" : 331 }, + "p332": { "x" : 332 }, + "p333": { "x" : 333 }, + "p334": { "x" : 334 }, + "p335": { "x" : 335 }, + "p336": { "x" : 336 }, + "p337": { "x" : 337 }, + "p338": { "x" : 338 }, + "p339": { "x" : 339 }, + "p340": { "x" : 340 }, + "p341": { "x" : 341 }, + "p342": { "x" : 342 }, + "p343": { "x" : 343 }, + "p344": { "x" : 344 }, + "p345": { "x" : 345 }, + "p346": { "x" : 346 }, + "p347": { "x" : 347 }, + "p348": { "x" : 348 }, + "p349": { "x" : 349 }, + "p350": { "x" : 350 }, + "p351": { "x" : 351 }, + "p352": { "x" : 352 }, + "p353": { "x" : 353 }, + "p354": { "x" : 354 }, + "p355": { "x" : 355 }, + "p356": { "x" : 356 }, + "p357": { "x" : 357 }, + "p358": { "x" : 358 }, + "p359": { "x" : 359 }, + "p360": { "x" : 360 }, + "p361": { "x" : 361 }, + "p362": { "x" : 362 }, + "p363": { "x" : 363 }, + "p364": { "x" : 364 }, + "p365": { "x" : 365 }, + "p366": { "x" : 366 }, + "p367": { "x" : 367 }, + "p368": { "x" : 368 }, + "p369": { "x" : 369 }, + "p370": { "x" : 370 }, + "p371": { "x" : 371 }, + "p372": { "x" : 372 }, + "p373": { "x" : 373 }, + "p374": { "x" : 374 }, + "p375": { "x" : 375 }, + "p376": { "x" : 376 }, + "p377": { "x" : 377 }, + "p378": { "x" : 378 }, + "p379": { "x" : 379 }, + "p380": { "x" : 380 }, + "p381": { "x" : 381 }, + "p382": { "x" : 382 }, + "p383": { "x" : 383 }, + "p384": { "x" : 384 }, + "p385": { "x" : 385 }, + "p386": { "x" : 386 }, + "p387": { "x" : 387 }, + "p388": { "x" : 388 }, + "p389": { "x" : 389 }, + "p390": { "x" : 390 }, + "p391": { "x" : 391 }, + "p392": { "x" : 392 }, + "p393": { "x" : 393 }, + "p394": { "x" : 394 }, + "p395": { "x" : 395 }, + "p396": { "x" : 396 }, + "p397": { "x" : 397 }, + "p398": { "x" : 398 }, + "p399": { "x" : 399 }, + "p400": { "x" : 400 }, + "p401": { "x" : 401 }, + "p402": { "x" : 402 }, + "p403": { "x" : 403 }, + "p404": { "x" : 404 }, + "p405": { "x" : 405 }, + "p406": { "x" : 406 }, + "p407": { "x" : 407 }, + "p408": { "x" : 408 }, + "p409": { "x" : 409 }, + "p410": { "x" : 410 }, + "p411": { "x" : 411 }, + "p412": { "x" : 412 }, + "p413": { "x" : 413 }, + "p414": { "x" : 414 }, + "p415": { "x" : 415 }, + "p416": { "x" : 416 }, + "p417": { "x" : 417 }, + "p418": { "x" : 418 }, + "p419": { "x" : 419 }, + "p420": { "x" : 420 }, + "p421": { "x" : 421 }, + "p422": { "x" : 422 }, + "p423": { "x" : 423 }, + "p424": { "x" : 424 }, + "p425": { "x" : 425 }, + "p426": { "x" : 426 }, + "p427": { "x" : 427 }, + "p428": { "x" : 428 }, + "p429": { "x" : 429 }, + "p430": { "x" : 430 }, + "p431": { "x" : 431 }, + "p432": { "x" : 432 }, + "p433": { "x" : 433 }, + "p434": { "x" : 434 }, + "p435": { "x" : 435 }, + "p436": { "x" : 436 }, + "p437": { "x" : 437 }, + "p438": { "x" : 438 }, + "p439": { "x" : 439 }, + "p440": { "x" : 440 }, + "p441": { "x" : 441 }, + "p442": { "x" : 442 }, + "p443": { "x" : 443 }, + "p444": { "x" : 444 }, + "p445": { "x" : 445 }, + "p446": { "x" : 446 }, + "p447": { "x" : 447 }, + "p448": { "x" : 448 }, + "p449": { "x" : 449 }, + "p450": { "x" : 450 }, + "p451": { "x" : 451 }, + "p452": { "x" : 452 }, + "p453": { "x" : 453 }, + "p454": { "x" : 454 }, + "p455": { "x" : 455 }, + "p456": { "x" : 456 }, + "p457": { "x" : 457 }, + "p458": { "x" : 458 }, + "p459": { "x" : 459 }, + "p460": { "x" : 460 }, + "p461": { "x" : 461 }, + "p462": { "x" : 462 }, + "p463": { "x" : 463 }, + "p464": { "x" : 464 }, + "p465": { "x" : 465 }, + "p466": { "x" : 466 }, + "p467": { "x" : 467 }, + "p468": { "x" : 468 }, + "p469": { "x" : 469 }, + "p470": { "x" : 470 }, + "p471": { "x" : 471 }, + "p472": { "x" : 472 }, + "p473": { "x" : 473 }, + "p474": { "x" : 474 }, + "p475": { "x" : 475 }, + "p476": { "x" : 476 }, + "p477": { "x" : 477 }, + "p478": { "x" : 478 }, + "p479": { "x" : 479 }, + "p480": { "x" : 480 }, + "p481": { "x" : 481 }, + "p482": { "x" : 482 }, + "p483": { "x" : 483 }, + "p484": { "x" : 484 }, + "p485": { "x" : 485 }, + "p486": { "x" : 486 }, + "p487": { "x" : 487 }, + "p488": { "x" : 488 }, + "p489": { "x" : 489 }, + "p490": { "x" : 490 }, + "p491": { "x" : 491 }, + "p492": { "x" : 492 }, + "p493": { "x" : 493 }, + "p494": { "x" : 494 }, + "p495": { "x" : 495 }, + "p496": { "x" : 496 }, + "p497": { "x" : 497 }, + "p498": { "x" : 498 }, + "p499": { "x" : 499 }, + "p500": { "x" : 500 }, + "p501": { "x" : 501 }, + "p502": { "x" : 502 }, + "p503": { "x" : 503 }, + "p504": { "x" : 504 }, + "p505": { "x" : 505 }, + "p506": { "x" : 506 }, + "p507": { "x" : 507 }, + "p508": { "x" : 508 }, + "p509": { "x" : 509 }, + "p510": { "x" : 510 }, + "p511": { "x" : 511 }, + "p512": { "x" : 512 }, + "p513": { "x" : 513 }, + "p514": { "x" : 514 }, + "p515": { "x" : 515 }, + "p516": { "x" : 516 }, + "p517": { "x" : 517 }, + "p518": { "x" : 518 }, + "p519": { "x" : 519 }, + "p520": { "x" : 520 }, + "p521": { "x" : 521 }, + "p522": { "x" : 522 }, + "p523": { "x" : 523 }, + "p524": { "x" : 524 }, + "p525": { "x" : 525 }, + "p526": { "x" : 526 }, + "p527": { "x" : 527 }, + "p528": { "x" : 528 }, + "p529": { "x" : 529 }, + "p530": { "x" : 530 }, + "p531": { "x" : 531 }, + "p532": { "x" : 532 }, + "p533": { "x" : 533 }, + "p534": { "x" : 534 }, + "p535": { "x" : 535 }, + "p536": { "x" : 536 }, + "p537": { "x" : 537 }, + "p538": { "x" : 538 }, + "p539": { "x" : 539 }, + "p540": { "x" : 540 }, + "p541": { "x" : 541 }, + "p542": { "x" : 542 }, + "p543": { "x" : 543 }, + "p544": { "x" : 544 }, + "p545": { "x" : 545 }, + "p546": { "x" : 546 }, + "p547": { "x" : 547 }, + "p548": { "x" : 548 }, + "p549": { "x" : 549 }, + "p550": { "x" : 550 }, + "p551": { "x" : 551 }, + "p552": { "x" : 552 }, + "p553": { "x" : 553 }, + "p554": { "x" : 554 }, + "p555": { "x" : 555 }, + "p556": { "x" : 556 }, + "p557": { "x" : 557 }, + "p558": { "x" : 558 }, + "p559": { "x" : 559 }, + "p560": { "x" : 560 }, + "p561": { "x" : 561 }, + "p562": { "x" : 562 }, + "p563": { "x" : 563 }, + "p564": { "x" : 564 }, + "p565": { "x" : 565 }, + "p566": { "x" : 566 }, + "p567": { "x" : 567 }, + "p568": { "x" : 568 }, + "p569": { "x" : 569 }, + "p570": { "x" : 570 }, + "p571": { "x" : 571 }, + "p572": { "x" : 572 }, + "p573": { "x" : 573 }, + "p574": { "x" : 574 }, + "p575": { "x" : 575 }, + "p576": { "x" : 576 }, + "p577": { "x" : 577 }, + "p578": { "x" : 578 }, + "p579": { "x" : 579 }, + "p580": { "x" : 580 }, + "p581": { "x" : 581 }, + "p582": { "x" : 582 }, + "p583": { "x" : 583 }, + "p584": { "x" : 584 }, + "p585": { "x" : 585 }, + "p586": { "x" : 586 }, + "p587": { "x" : 587 }, + "p588": { "x" : 588 }, + "p589": { "x" : 589 }, + "p590": { "x" : 590 }, + "p591": { "x" : 591 }, + "p592": { "x" : 592 }, + "p593": { "x" : 593 }, + "p594": { "x" : 594 }, + "p595": { "x" : 595 }, + "p596": { "x" : 596 }, + "p597": { "x" : 597 }, + "p598": { "x" : 598 }, + "p599": { "x" : 599 }, + "p600": { "x" : 600 }, + "p601": { "x" : 601 }, + "p602": { "x" : 602 }, + "p603": { "x" : 603 }, + "p604": { "x" : 604 }, + "p605": { "x" : 605 }, + "p606": { "x" : 606 }, + "p607": { "x" : 607 }, + "p608": { "x" : 608 }, + "p609": { "x" : 609 }, + "p610": { "x" : 610 }, + "p611": { "x" : 611 }, + "p612": { "x" : 612 }, + "p613": { "x" : 613 }, + "p614": { "x" : 614 }, + "p615": { "x" : 615 }, + "p616": { "x" : 616 }, + "p617": { "x" : 617 }, + "p618": { "x" : 618 }, + "p619": { "x" : 619 }, + "p620": { "x" : 620 }, + "p621": { "x" : 621 }, + "p622": { "x" : 622 }, + "p623": { "x" : 623 }, + "p624": { "x" : 624 }, + "p625": { "x" : 625 }, + "p626": { "x" : 626 }, + "p627": { "x" : 627 }, + "p628": { "x" : 628 }, + "p629": { "x" : 629 }, + "p630": { "x" : 630 }, + "p631": { "x" : 631 }, + "p632": { "x" : 632 }, + "p633": { "x" : 633 }, + "p634": { "x" : 634 }, + "p635": { "x" : 635 }, + "p636": { "x" : 636 }, + "p637": { "x" : 637 }, + "p638": { "x" : 638 }, + "p639": { "x" : 639 }, + "p640": { "x" : 640 }, + "p641": { "x" : 641 }, + "p642": { "x" : 642 }, + "p643": { "x" : 643 }, + "p644": { "x" : 644 }, + "p645": { "x" : 645 }, + "p646": { "x" : 646 }, + "p647": { "x" : 647 }, + "p648": { "x" : 648 }, + "p649": { "x" : 649 }, + "p650": { "x" : 650 }, + "p651": { "x" : 651 }, + "p652": { "x" : 652 }, + "p653": { "x" : 653 }, + "p654": { "x" : 654 }, + "p655": { "x" : 655 }, + "p656": { "x" : 656 }, + "p657": { "x" : 657 }, + "p658": { "x" : 658 }, + "p659": { "x" : 659 }, + "p660": { "x" : 660 }, + "p661": { "x" : 661 }, + "p662": { "x" : 662 }, + "p663": { "x" : 663 }, + "p664": { "x" : 664 }, + "p665": { "x" : 665 }, + "p666": { "x" : 666 }, + "p667": { "x" : 667 }, + "p668": { "x" : 668 }, + "p669": { "x" : 669 }, + "p670": { "x" : 670 }, + "p671": { "x" : 671 }, + "p672": { "x" : 672 }, + "p673": { "x" : 673 }, + "p674": { "x" : 674 }, + "p675": { "x" : 675 }, + "p676": { "x" : 676 }, + "p677": { "x" : 677 }, + "p678": { "x" : 678 }, + "p679": { "x" : 679 }, + "p680": { "x" : 680 }, + "p681": { "x" : 681 }, + "p682": { "x" : 682 }, + "p683": { "x" : 683 }, + "p684": { "x" : 684 }, + "p685": { "x" : 685 }, + "p686": { "x" : 686 }, + "p687": { "x" : 687 }, + "p688": { "x" : 688 }, + "p689": { "x" : 689 }, + "p690": { "x" : 690 }, + "p691": { "x" : 691 }, + "p692": { "x" : 692 }, + "p693": { "x" : 693 }, + "p694": { "x" : 694 }, + "p695": { "x" : 695 }, + "p696": { "x" : 696 }, + "p697": { "x" : 697 }, + "p698": { "x" : 698 }, + "p699": { "x" : 699 }, + "p700": { "x" : 700 }, + "p701": { "x" : 701 }, + "p702": { "x" : 702 }, + "p703": { "x" : 703 }, + "p704": { "x" : 704 }, + "p705": { "x" : 705 }, + "p706": { "x" : 706 }, + "p707": { "x" : 707 }, + "p708": { "x" : 708 }, + "p709": { "x" : 709 }, + "p710": { "x" : 710 }, + "p711": { "x" : 711 }, + "p712": { "x" : 712 }, + "p713": { "x" : 713 }, + "p714": { "x" : 714 }, + "p715": { "x" : 715 }, + "p716": { "x" : 716 }, + "p717": { "x" : 717 }, + "p718": { "x" : 718 }, + "p719": { "x" : 719 }, + "p720": { "x" : 720 }, + "p721": { "x" : 721 }, + "p722": { "x" : 722 }, + "p723": { "x" : 723 }, + "p724": { "x" : 724 }, + "p725": { "x" : 725 }, + "p726": { "x" : 726 }, + "p727": { "x" : 727 }, + "p728": { "x" : 728 }, + "p729": { "x" : 729 }, + "p730": { "x" : 730 }, + "p731": { "x" : 731 }, + "p732": { "x" : 732 }, + "p733": { "x" : 733 }, + "p734": { "x" : 734 }, + "p735": { "x" : 735 }, + "p736": { "x" : 736 }, + "p737": { "x" : 737 }, + "p738": { "x" : 738 }, + "p739": { "x" : 739 }, + "p740": { "x" : 740 }, + "p741": { "x" : 741 }, + "p742": { "x" : 742 }, + "p743": { "x" : 743 }, + "p744": { "x" : 744 }, + "p745": { "x" : 745 }, + "p746": { "x" : 746 }, + "p747": { "x" : 747 }, + "p748": { "x" : 748 }, + "p749": { "x" : 749 }, + "p750": { "x" : 750 }, + "p751": { "x" : 751 }, + "p752": { "x" : 752 }, + "p753": { "x" : 753 }, + "p754": { "x" : 754 }, + "p755": { "x" : 755 }, + "p756": { "x" : 756 }, + "p757": { "x" : 757 }, + "p758": { "x" : 758 }, + "p759": { "x" : 759 }, + "p760": { "x" : 760 }, + "p761": { "x" : 761 }, + "p762": { "x" : 762 }, + "p763": { "x" : 763 }, + "p764": { "x" : 764 }, + "p765": { "x" : 765 }, + "p766": { "x" : 766 }, + "p767": { "x" : 767 }, + "p768": { "x" : 768 }, + "p769": { "x" : 769 }, + "p770": { "x" : 770 }, + "p771": { "x" : 771 }, + "p772": { "x" : 772 }, + "p773": { "x" : 773 }, + "p774": { "x" : 774 }, + "p775": { "x" : 775 }, + "p776": { "x" : 776 }, + "p777": { "x" : 777 }, + "p778": { "x" : 778 }, + "p779": { "x" : 779 }, + "p780": { "x" : 780 }, + "p781": { "x" : 781 }, + "p782": { "x" : 782 }, + "p783": { "x" : 783 }, + "p784": { "x" : 784 }, + "p785": { "x" : 785 }, + "p786": { "x" : 786 }, + "p787": { "x" : 787 }, + "p788": { "x" : 788 }, + "p789": { "x" : 789 }, + "p790": { "x" : 790 }, + "p791": { "x" : 791 }, + "p792": { "x" : 792 }, + "p793": { "x" : 793 }, + "p794": { "x" : 794 }, + "p795": { "x" : 795 }, + "p796": { "x" : 796 }, + "p797": { "x" : 797 }, + "p798": { "x" : 798 }, + "p799": { "x" : 799 }, + "p800": { "x" : 800 }, + "p801": { "x" : 801 }, + "p802": { "x" : 802 }, + "p803": { "x" : 803 }, + "p804": { "x" : 804 }, + "p805": { "x" : 805 }, + "p806": { "x" : 806 }, + "p807": { "x" : 807 }, + "p808": { "x" : 808 }, + "p809": { "x" : 809 }, + "p810": { "x" : 810 }, + "p811": { "x" : 811 }, + "p812": { "x" : 812 }, + "p813": { "x" : 813 }, + "p814": { "x" : 814 }, + "p815": { "x" : 815 }, + "p816": { "x" : 816 }, + "p817": { "x" : 817 }, + "p818": { "x" : 818 }, + "p819": { "x" : 819 }, + "p820": { "x" : 820 }, + "p821": { "x" : 821 }, + "p822": { "x" : 822 }, + "p823": { "x" : 823 }, + "p824": { "x" : 824 }, + "p825": { "x" : 825 }, + "p826": { "x" : 826 }, + "p827": { "x" : 827 }, + "p828": { "x" : 828 }, + "p829": { "x" : 829 }, + "p830": { "x" : 830 }, + "p831": { "x" : 831 }, + "p832": { "x" : 832 }, + "p833": { "x" : 833 }, + "p834": { "x" : 834 }, + "p835": { "x" : 835 }, + "p836": { "x" : 836 }, + "p837": { "x" : 837 }, + "p838": { "x" : 838 }, + "p839": { "x" : 839 }, + "p840": { "x" : 840 }, + "p841": { "x" : 841 }, + "p842": { "x" : 842 }, + "p843": { "x" : 843 }, + "p844": { "x" : 844 }, + "p845": { "x" : 845 }, + "p846": { "x" : 846 }, + "p847": { "x" : 847 }, + "p848": { "x" : 848 }, + "p849": { "x" : 849 }, + "p850": { "x" : 850 }, + "p851": { "x" : 851 }, + "p852": { "x" : 852 }, + "p853": { "x" : 853 }, + "p854": { "x" : 854 }, + "p855": { "x" : 855 }, + "p856": { "x" : 856 }, + "p857": { "x" : 857 }, + "p858": { "x" : 858 }, + "p859": { "x" : 859 }, + "p860": { "x" : 860 }, + "p861": { "x" : 861 }, + "p862": { "x" : 862 }, + "p863": { "x" : 863 }, + "p864": { "x" : 864 }, + "p865": { "x" : 865 }, + "p866": { "x" : 866 }, + "p867": { "x" : 867 }, + "p868": { "x" : 868 }, + "p869": { "x" : 869 }, + "p870": { "x" : 870 }, + "p871": { "x" : 871 }, + "p872": { "x" : 872 }, + "p873": { "x" : 873 }, + "p874": { "x" : 874 }, + "p875": { "x" : 875 }, + "p876": { "x" : 876 }, + "p877": { "x" : 877 }, + "p878": { "x" : 878 }, + "p879": { "x" : 879 }, + "p880": { "x" : 880 }, + "p881": { "x" : 881 }, + "p882": { "x" : 882 }, + "p883": { "x" : 883 }, + "p884": { "x" : 884 }, + "p885": { "x" : 885 }, + "p886": { "x" : 886 }, + "p887": { "x" : 887 }, + "p888": { "x" : 888 }, + "p889": { "x" : 889 }, + "p890": { "x" : 890 }, + "p891": { "x" : 891 }, + "p892": { "x" : 892 }, + "p893": { "x" : 893 }, + "p894": { "x" : 894 }, + "p895": { "x" : 895 }, + "p896": { "x" : 896 }, + "p897": { "x" : 897 }, + "p898": { "x" : 898 }, + "p899": { "x" : 899 }, + "p900": { "x" : 900 }, + "p901": { "x" : 901 }, + "p902": { "x" : 902 }, + "p903": { "x" : 903 }, + "p904": { "x" : 904 }, + "p905": { "x" : 905 }, + "p906": { "x" : 906 }, + "p907": { "x" : 907 }, + "p908": { "x" : 908 }, + "p909": { "x" : 909 }, + "p910": { "x" : 910 }, + "p911": { "x" : 911 }, + "p912": { "x" : 912 }, + "p913": { "x" : 913 }, + "p914": { "x" : 914 }, + "p915": { "x" : 915 }, + "p916": { "x" : 916 }, + "p917": { "x" : 917 }, + "p918": { "x" : 918 }, + "p919": { "x" : 919 }, + "p920": { "x" : 920 }, + "p921": { "x" : 921 }, + "p922": { "x" : 922 }, + "p923": { "x" : 923 }, + "p924": { "x" : 924 }, + "p925": { "x" : 925 }, + "p926": { "x" : 926 }, + "p927": { "x" : 927 }, + "p928": { "x" : 928 }, + "p929": { "x" : 929 }, + "p930": { "x" : 930 }, + "p931": { "x" : 931 }, + "p932": { "x" : 932 }, + "p933": { "x" : 933 }, + "p934": { "x" : 934 }, + "p935": { "x" : 935 }, + "p936": { "x" : 936 }, + "p937": { "x" : 937 }, + "p938": { "x" : 938 }, + "p939": { "x" : 939 }, + "p940": { "x" : 940 }, + "p941": { "x" : 941 }, + "p942": { "x" : 942 }, + "p943": { "x" : 943 }, + "p944": { "x" : 944 }, + "p945": { "x" : 945 }, + "p946": { "x" : 946 }, + "p947": { "x" : 947 }, + "p948": { "x" : 948 }, + "p949": { "x" : 949 }, + "p950": { "x" : 950 }, + "p951": { "x" : 951 }, + "p952": { "x" : 952 }, + "p953": { "x" : 953 }, + "p954": { "x" : 954 }, + "p955": { "x" : 955 }, + "p956": { "x" : 956 }, + "p957": { "x" : 957 }, + "p958": { "x" : 958 }, + "p959": { "x" : 959 }, + "p960": { "x" : 960 }, + "p961": { "x" : 961 }, + "p962": { "x" : 962 }, + "p963": { "x" : 963 }, + "p964": { "x" : 964 }, + "p965": { "x" : 965 }, + "p966": { "x" : 966 }, + "p967": { "x" : 967 }, + "p968": { "x" : 968 }, + "p969": { "x" : 969 }, + "p970": { "x" : 970 }, + "p971": { "x" : 971 }, + "p972": { "x" : 972 }, + "p973": { "x" : 973 }, + "p974": { "x" : 974 }, + "p975": { "x" : 975 }, + "p976": { "x" : 976 }, + "p977": { "x" : 977 }, + "p978": { "x" : 978 }, + "p979": { "x" : 979 }, + "p980": { "x" : 980 }, + "p981": { "x" : 981 }, + "p982": { "x" : 982 }, + "p983": { "x" : 983 }, + "p984": { "x" : 984 }, + "p985": { "x" : 985 }, + "p986": { "x" : 986 }, + "p987": { "x" : 987 }, + "p988": { "x" : 988 }, + "p989": { "x" : 989 }, + "p990": { "x" : 990 }, + "p991": { "x" : 991 }, + "p992": { "x" : 992 }, + "p993": { "x" : 993 }, + "p994": { "x" : 994 }, + "p995": { "x" : 995 }, + "p996": { "x" : 996 }, + "p997": { "x" : 997 }, + "p998": { "x" : 998 }, + "p999": { "x" : 999 } +}; + +for (var i = 0; i < 1000; i++) { + var value = obj["p" + i]; + Assert.assertTrue(typeof value === "object"); + Assert.assertTrue(value.x === i); +} From 392dc6864ed32ba4278f4cc559b10bce59d7a068 Mon Sep 17 00:00:00 2001 From: Mandy Chung Date: Fri, 6 Mar 2015 09:02:09 -0800 Subject: [PATCH 35/76] 8074428: Move pack200, unpack200, libpack200 to jdk.pack200 Reviewed-by: alanb, weijun, erikj, ihse --- common/bin/unshuffle_list.txt | 42 +++++++++++++++++------------------ make/Images.gmk | 2 +- modules.xml | 10 ++++----- 3 files changed, 26 insertions(+), 28 deletions(-) diff --git a/common/bin/unshuffle_list.txt b/common/bin/unshuffle_list.txt index 8f1872dc6da..b2cc1e2b9b8 100644 --- a/common/bin/unshuffle_list.txt +++ b/common/bin/unshuffle_list.txt @@ -1433,6 +1433,26 @@ jdk/src/jdk.naming.dns/share/classes/META-INF/services : jdk/src/share/classes/s jdk/src/jdk.naming.dns/share/classes/sun/net/spi/nameservice/dns : jdk/src/share/classes/sun/net/spi/nameservice/dns jdk/src/jdk.naming.rmi/share/classes/com/sun/jndi/rmi/registry : jdk/src/share/classes/com/sun/jndi/rmi/registry jdk/src/jdk.naming.rmi/share/classes/com/sun/jndi/url/rmi : jdk/src/share/classes/com/sun/jndi/url/rmi +jdk/src/jdk.pack200/share/native/common-unpack/bands.cpp : jdk/src/share/native/com/sun/java/util/jar/pack/bands.cpp +jdk/src/jdk.pack200/share/native/common-unpack/bands.h : jdk/src/share/native/com/sun/java/util/jar/pack/bands.h +jdk/src/jdk.pack200/share/native/common-unpack/bytes.cpp : jdk/src/share/native/com/sun/java/util/jar/pack/bytes.cpp +jdk/src/jdk.pack200/share/native/common-unpack/bytes.h : jdk/src/share/native/com/sun/java/util/jar/pack/bytes.h +jdk/src/jdk.pack200/share/native/common-unpack/coding.cpp : jdk/src/share/native/com/sun/java/util/jar/pack/coding.cpp +jdk/src/jdk.pack200/share/native/common-unpack/coding.h : jdk/src/share/native/com/sun/java/util/jar/pack/coding.h +jdk/src/jdk.pack200/share/native/common-unpack/constants.h : jdk/src/share/native/com/sun/java/util/jar/pack/constants.h +jdk/src/jdk.pack200/share/native/common-unpack/defines.h : jdk/src/share/native/com/sun/java/util/jar/pack/defines.h +jdk/src/jdk.pack200/share/native/common-unpack/unpack.cpp : jdk/src/share/native/com/sun/java/util/jar/pack/unpack.cpp +jdk/src/jdk.pack200/share/native/common-unpack/unpack.h : jdk/src/share/native/com/sun/java/util/jar/pack/unpack.h +jdk/src/jdk.pack200/share/native/common-unpack/utils.cpp : jdk/src/share/native/com/sun/java/util/jar/pack/utils.cpp +jdk/src/jdk.pack200/share/native/common-unpack/utils.h : jdk/src/share/native/com/sun/java/util/jar/pack/utils.h +jdk/src/jdk.pack200/share/native/common-unpack/zip.cpp : jdk/src/share/native/com/sun/java/util/jar/pack/zip.cpp +jdk/src/jdk.pack200/share/native/common-unpack/zip.h : jdk/src/share/native/com/sun/java/util/jar/pack/zip.h +jdk/src/jdk.pack200/share/native/libjsdt : jdk/src/share/native/sun/tracing/dtrace +jdk/src/jdk.pack200/share/native/libunpack/jni.cpp : jdk/src/share/native/com/sun/java/util/jar/pack/jni.cpp +jdk/src/jdk.pack200/share/native/unpack200/main.cpp : jdk/src/share/native/com/sun/java/util/jar/pack/main.cpp +jdk/src/jdk.pack200/unix/native/libjsdt/jvm_symbols_md.c : jdk/src/solaris/native/sun/tracing/dtrace/jvm_symbols_md.c +jdk/src/jdk.pack200/windows/native/libjsdt/jvm_symbols_md.c : jdk/src/windows/native/sun/tracing/dtrace/jvm_symbols_md.c +jdk/src/jdk.pack200/windows/native/unpack200/unpack200_proto.exe.manifest : jdk/src/windows/resource/unpack200_proto.exe.manifest jdk/src/jdk.rmic/share/classes/sun/rmi/rmic : jdk/src/share/classes/sun/rmi/rmic jdk/src/jdk.rmic/share/classes/sun/rmi/rmic/newrmic : jdk/src/share/classes/sun/rmi/rmic/newrmic jdk/src/jdk.rmic/share/classes/sun/rmi/rmic/newrmic/jrmp : jdk/src/share/classes/sun/rmi/rmic/newrmic/jrmp @@ -1442,28 +1462,6 @@ jdk/src/jdk.rmic/share/classes/sun/tools/javac : jdk/src/share/classes/sun/tools jdk/src/jdk.rmic/share/classes/sun/tools/java : jdk/src/share/classes/sun/tools/java jdk/src/jdk.rmic/share/classes/sun/tools/tree : jdk/src/share/classes/sun/tools/tree jdk/src/jdk.rmic/share/classes/sun/tools/util : jdk/src/share/classes/sun/tools/util -jdk/src/jdk.runtime/share/classes/com/sun/tracing : jdk/src/share/classes/com/sun/tracing -jdk/src/jdk.runtime/share/classes/sun/tracing : jdk/src/share/classes/sun/tracing -jdk/src/jdk.runtime/share/native/common-unpack/bands.cpp : jdk/src/share/native/com/sun/java/util/jar/pack/bands.cpp -jdk/src/jdk.runtime/share/native/common-unpack/bands.h : jdk/src/share/native/com/sun/java/util/jar/pack/bands.h -jdk/src/jdk.runtime/share/native/common-unpack/bytes.cpp : jdk/src/share/native/com/sun/java/util/jar/pack/bytes.cpp -jdk/src/jdk.runtime/share/native/common-unpack/bytes.h : jdk/src/share/native/com/sun/java/util/jar/pack/bytes.h -jdk/src/jdk.runtime/share/native/common-unpack/coding.cpp : jdk/src/share/native/com/sun/java/util/jar/pack/coding.cpp -jdk/src/jdk.runtime/share/native/common-unpack/coding.h : jdk/src/share/native/com/sun/java/util/jar/pack/coding.h -jdk/src/jdk.runtime/share/native/common-unpack/constants.h : jdk/src/share/native/com/sun/java/util/jar/pack/constants.h -jdk/src/jdk.runtime/share/native/common-unpack/defines.h : jdk/src/share/native/com/sun/java/util/jar/pack/defines.h -jdk/src/jdk.runtime/share/native/common-unpack/unpack.cpp : jdk/src/share/native/com/sun/java/util/jar/pack/unpack.cpp -jdk/src/jdk.runtime/share/native/common-unpack/unpack.h : jdk/src/share/native/com/sun/java/util/jar/pack/unpack.h -jdk/src/jdk.runtime/share/native/common-unpack/utils.cpp : jdk/src/share/native/com/sun/java/util/jar/pack/utils.cpp -jdk/src/jdk.runtime/share/native/common-unpack/utils.h : jdk/src/share/native/com/sun/java/util/jar/pack/utils.h -jdk/src/jdk.runtime/share/native/common-unpack/zip.cpp : jdk/src/share/native/com/sun/java/util/jar/pack/zip.cpp -jdk/src/jdk.runtime/share/native/common-unpack/zip.h : jdk/src/share/native/com/sun/java/util/jar/pack/zip.h -jdk/src/jdk.runtime/share/native/libjsdt : jdk/src/share/native/sun/tracing/dtrace -jdk/src/jdk.runtime/share/native/libunpack/jni.cpp : jdk/src/share/native/com/sun/java/util/jar/pack/jni.cpp -jdk/src/jdk.runtime/share/native/unpack200/main.cpp : jdk/src/share/native/com/sun/java/util/jar/pack/main.cpp -jdk/src/jdk.runtime/unix/native/libjsdt/jvm_symbols_md.c : jdk/src/solaris/native/sun/tracing/dtrace/jvm_symbols_md.c -jdk/src/jdk.runtime/windows/native/libjsdt/jvm_symbols_md.c : jdk/src/windows/native/sun/tracing/dtrace/jvm_symbols_md.c -jdk/src/jdk.runtime/windows/native/unpack200/unpack200_proto.exe.manifest : jdk/src/windows/resource/unpack200_proto.exe.manifest jdk/src/jdk.sctp/macosx/classes/sun/nio/ch/sctp : jdk/src/macosx/classes/sun/nio/ch/sctp jdk/src/jdk.sctp/share/classes/com/sun/nio/sctp : jdk/src/share/classes/com/sun/nio/sctp jdk/src/jdk.sctp/share/classes/sun/nio/ch/sctp : jdk/src/share/classes/sun/nio/ch/sctp diff --git a/make/Images.gmk b/make/Images.gmk index 56704b08f8e..de140d671ef 100644 --- a/make/Images.gmk +++ b/make/Images.gmk @@ -38,7 +38,7 @@ $(eval $(call IncludeCustomExtension, , Images-pre.gmk)) ############################################################################ MAIN_MODULES += java.se java.smartcardio jdk.httpserver jdk.sctp \ - jdk.security.auth jdk.security.jgss jdk.runtime + jdk.security.auth jdk.security.jgss jdk.pack200 # providers PROVIDER_MODULES += jdk.charsets jdk.crypto.ec jdk.crypto.pkcs11 jdk.jvmstat jdk.localedata \ diff --git a/modules.xml b/modules.xml index d1df1e70529..70630b21ee4 100644 --- a/modules.xml +++ b/modules.xml @@ -257,7 +257,7 @@ jdk.dev jdk.jconsole jdk.jvmstat - jdk.runtime + jdk.pack200 jdk.security.auth jdk.security.jgss @@ -1719,6 +1719,10 @@ java.naming java.rmi + + jdk.pack200 + java.base + jdk.rmic java.base @@ -1726,10 +1730,6 @@ jdk.compiler jdk.javadoc - - jdk.runtime - java.base - jdk.scripting.nashorn java.base From 04e7f3d87182983d87bd10db8b630a0431cde1b7 Mon Sep 17 00:00:00 2001 From: Mandy Chung Date: Fri, 6 Mar 2015 09:11:22 -0800 Subject: [PATCH 36/76] 8074429: Move jar, jarsigner tool to jdk.jartool module Reviewed-by: alanb, weijun, erikj, ihse --- common/bin/unshuffle_list.txt | 6 +++--- make/Images.gmk | 4 ++-- modules.xml | 27 ++++++++++++++------------- 3 files changed, 19 insertions(+), 18 deletions(-) diff --git a/common/bin/unshuffle_list.txt b/common/bin/unshuffle_list.txt index b2cc1e2b9b8..214d6f52c04 100644 --- a/common/bin/unshuffle_list.txt +++ b/common/bin/unshuffle_list.txt @@ -1299,15 +1299,15 @@ jdk/src/jdk.deploy.osx/macosx/native/libosx/CFileManager.m : jdk/src/macosx/nati jdk/src/jdk.deploy.osx/macosx/native/libosx/Dispatch.m : jdk/src/macosx/native/com/apple/concurrent/Dispatch.m jdk/src/jdk.deploy.osx/macosx/native/libosx/JavaAppLauncher.m : jdk/src/macosx/native/apple/launcher/JavaAppLauncher.m jdk/src/jdk.deploy.osx/macosx/native/libosx/KeystoreImpl.m : jdk/src/macosx/native/apple/security/KeystoreImpl.m -jdk/src/jdk.dev/share/classes/com/sun/jarsigner : jdk/src/share/classes/com/sun/jarsigner jdk/src/jdk.dev/share/classes/com/sun/tools/hat : jdk/src/share/classes/com/sun/tools/hat -jdk/src/jdk.dev/share/classes/sun/security/tools/jarsigner : jdk/src/share/classes/sun/security/tools/jarsigner jdk/src/jdk.dev/share/classes/sun/security/tools/policytool : jdk/src/share/classes/sun/security/tools/policytool -jdk/src/jdk.dev/share/classes/sun/tools/jar : jdk/src/share/classes/sun/tools/jar jdk/src/jdk.dev/share/classes/sun/tools/native2ascii : jdk/src/share/classes/sun/tools/native2ascii jdk/src/jdk.hprof.agent/share/classes/com/sun/demo/jvmti/hprof : jdk/src/share/classes/com/sun/demo/jvmti/hprof jdk/src/jdk.httpserver/share/classes/com/sun/net/httpserver : jdk/src/share/classes/com/sun/net/httpserver jdk/src/jdk.httpserver/share/classes/sun/net/httpserver : jdk/src/share/classes/sun/net/httpserver +jdk/src/jdk.jartool/share/classes/com/sun/jarsigner : jdk/src/share/classes/com/sun/jarsigner +jdk/src/jdk.jartool/share/classes/sun/security/tools/jarsigner : jdk/src/share/classes/sun/security/tools/jarsigner +jdk/src/jdk.jartool/share/classes/sun/tools/jar : jdk/src/share/classes/sun/tools/jar jdk/src/jdk.jcmd/share/classes/sun/tools/jcmd : jdk/src/share/classes/sun/tools/jcmd jdk/src/jdk.jcmd/share/classes/sun/tools/jinfo : jdk/src/share/classes/sun/tools/jinfo jdk/src/jdk.jcmd/share/classes/sun/tools/jmap : jdk/src/share/classes/sun/tools/jmap diff --git a/make/Images.gmk b/make/Images.gmk index de140d671ef..58d7398a11d 100644 --- a/make/Images.gmk +++ b/make/Images.gmk @@ -46,8 +46,8 @@ PROVIDER_MODULES += jdk.charsets jdk.crypto.ec jdk.crypto.pkcs11 jdk.jvmstat jdk # tools TOOLS_MODULES += jdk.attach jdk.compiler jdk.dev jdk.javadoc jdk.jcmd jdk.jconsole \ - jdk.hotspot.agent jdk.hprof.agent jdk.jdi jdk.jdwp.agent jdk.rmic \ - jdk.xml.bind jdk.xml.ws + jdk.hotspot.agent jdk.hprof.agent jdk.jartool jdk.jdi jdk.jdwp.agent \ + jdk.rmic jdk.xml.bind jdk.xml.ws ifeq ($(OPENJDK_TARGET_OS), windows) PROVIDER_MODULES += jdk.crypto.mscapi diff --git a/modules.xml b/modules.xml index 70630b21ee4..d3febe019aa 100644 --- a/modules.xml +++ b/modules.xml @@ -254,7 +254,7 @@ java.sql jdk.charsets jdk.deploy.osx - jdk.dev + jdk.jartool jdk.jconsole jdk.jvmstat jdk.pack200 @@ -279,7 +279,7 @@ sun.net.www java.desktop jdk.compiler - jdk.dev + jdk.jartool sun.net.www.protocol.http @@ -353,7 +353,7 @@ sun.security.pkcs jdk.crypto.ec jdk.deploy.osx - jdk.dev + jdk.jartool sun.security.provider @@ -361,6 +361,7 @@ java.security.jgss jdk.crypto.pkcs11 jdk.dev + jdk.jartool jdk.security.auth @@ -378,7 +379,7 @@ sun.security.tools - jdk.dev + jdk.jartool sun.security.util @@ -393,6 +394,7 @@ jdk.crypto.ucrypto jdk.deploy.osx jdk.dev + jdk.jartool jdk.security.auth @@ -401,7 +403,7 @@ jdk.crypto.ec jdk.crypto.pkcs11 jdk.deploy.osx - jdk.dev + jdk.jartool jdk.security.auth @@ -1591,16 +1593,8 @@ jdk.dev java.base - java.scripting java.xml - java.desktop jdk.compiler - jdk.rmic - jdk.xml.bind - jdk.xml.ws - - com.sun.jarsigner - jdk.hotspot.agent @@ -1626,6 +1620,13 @@ com.sun.net.httpserver.spi + + jdk.jartool + java.base + + com.sun.jarsigner + + jdk.javadoc java.base From 78dff0df2492e09b63f11578a51ac33ba63cca11 Mon Sep 17 00:00:00 2001 From: Mandy Chung Date: Fri, 6 Mar 2015 11:00:42 -0800 Subject: [PATCH 37/76] 8074430: Move policytool to jdk.policytool module Reviewed-by: alanb, weijun, erikj, ihse --- common/bin/unshuffle_list.txt | 2 +- make/Images.gmk | 2 +- modules.xml | 9 +++++++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/common/bin/unshuffle_list.txt b/common/bin/unshuffle_list.txt index 214d6f52c04..a27c192e7fc 100644 --- a/common/bin/unshuffle_list.txt +++ b/common/bin/unshuffle_list.txt @@ -1300,7 +1300,6 @@ jdk/src/jdk.deploy.osx/macosx/native/libosx/Dispatch.m : jdk/src/macosx/native/c jdk/src/jdk.deploy.osx/macosx/native/libosx/JavaAppLauncher.m : jdk/src/macosx/native/apple/launcher/JavaAppLauncher.m jdk/src/jdk.deploy.osx/macosx/native/libosx/KeystoreImpl.m : jdk/src/macosx/native/apple/security/KeystoreImpl.m jdk/src/jdk.dev/share/classes/com/sun/tools/hat : jdk/src/share/classes/com/sun/tools/hat -jdk/src/jdk.dev/share/classes/sun/security/tools/policytool : jdk/src/share/classes/sun/security/tools/policytool jdk/src/jdk.dev/share/classes/sun/tools/native2ascii : jdk/src/share/classes/sun/tools/native2ascii jdk/src/jdk.hprof.agent/share/classes/com/sun/demo/jvmti/hprof : jdk/src/share/classes/com/sun/demo/jvmti/hprof jdk/src/jdk.httpserver/share/classes/com/sun/net/httpserver : jdk/src/share/classes/com/sun/net/httpserver @@ -1453,6 +1452,7 @@ jdk/src/jdk.pack200/share/native/unpack200/main.cpp : jdk/src/share/native/com/s jdk/src/jdk.pack200/unix/native/libjsdt/jvm_symbols_md.c : jdk/src/solaris/native/sun/tracing/dtrace/jvm_symbols_md.c jdk/src/jdk.pack200/windows/native/libjsdt/jvm_symbols_md.c : jdk/src/windows/native/sun/tracing/dtrace/jvm_symbols_md.c jdk/src/jdk.pack200/windows/native/unpack200/unpack200_proto.exe.manifest : jdk/src/windows/resource/unpack200_proto.exe.manifest +jdk/src/jdk.policytool/share/classes/sun/security/tools/policytool : jdk/src/share/classes/sun/security/tools/policytool jdk/src/jdk.rmic/share/classes/sun/rmi/rmic : jdk/src/share/classes/sun/rmi/rmic jdk/src/jdk.rmic/share/classes/sun/rmi/rmic/newrmic : jdk/src/share/classes/sun/rmi/rmic/newrmic jdk/src/jdk.rmic/share/classes/sun/rmi/rmic/newrmic/jrmp : jdk/src/share/classes/sun/rmi/rmic/newrmic/jrmp diff --git a/make/Images.gmk b/make/Images.gmk index 58d7398a11d..9ee57d3fb29 100644 --- a/make/Images.gmk +++ b/make/Images.gmk @@ -47,7 +47,7 @@ PROVIDER_MODULES += jdk.charsets jdk.crypto.ec jdk.crypto.pkcs11 jdk.jvmstat jdk # tools TOOLS_MODULES += jdk.attach jdk.compiler jdk.dev jdk.javadoc jdk.jcmd jdk.jconsole \ jdk.hotspot.agent jdk.hprof.agent jdk.jartool jdk.jdi jdk.jdwp.agent \ - jdk.rmic jdk.xml.bind jdk.xml.ws + jdk.policytool jdk.rmic jdk.xml.bind jdk.xml.ws ifeq ($(OPENJDK_TARGET_OS), windows) PROVIDER_MODULES += jdk.crypto.mscapi diff --git a/modules.xml b/modules.xml index d3febe019aa..389112a748c 100644 --- a/modules.xml +++ b/modules.xml @@ -360,8 +360,8 @@ java.rmi java.security.jgss jdk.crypto.pkcs11 - jdk.dev jdk.jartool + jdk.policytool jdk.security.auth @@ -393,8 +393,8 @@ jdk.crypto.pkcs11 jdk.crypto.ucrypto jdk.deploy.osx - jdk.dev jdk.jartool + jdk.policytool jdk.security.auth @@ -1724,6 +1724,11 @@ jdk.pack200 java.base + + jdk.policytool + java.base + java.desktop + jdk.rmic java.base From 06b2c14db0d49810393482e5160df88f824cdd28 Mon Sep 17 00:00:00 2001 From: Magnus Ihse Bursie Date: Mon, 9 Mar 2015 10:39:16 +0100 Subject: [PATCH 38/76] 8074096: Disable (most) native warnings in JDK on a per-library basis Reviewed-by: erikj, tbell --- common/autoconf/flags.m4 | 21 ++++++- common/autoconf/generated-configure.sh | 86 ++++++++++++++++++++++++-- common/autoconf/spec.gmk.in | 1 + make/common/MakeBase.gmk | 4 +- make/common/NativeCompilation.gmk | 17 +++-- 5 files changed, 115 insertions(+), 14 deletions(-) diff --git a/common/autoconf/flags.m4 b/common/autoconf/flags.m4 index aa1bc2b849f..28666d4320a 100644 --- a/common/autoconf/flags.m4 +++ b/common/autoconf/flags.m4 @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -478,6 +478,8 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK], CFLAGS_JDKLIB_EXTRA="${CFLAGS_JDKLIB_EXTRA} -xregs=no%appl" CXXFLAGS_JDKLIB_EXTRA="${CXXFLAGS_JDKLIB_EXTRA} -xregs=no%appl" fi + CFLAGS_JDKLIB_EXTRA="${CFLAGS_JDKLIB_EXTRA} -errtags=yes -errfmt" + CXXFLAGS_JDKLIB_EXTRA="${CXXFLAGS_JDKLIB_EXTRA} -errtags=yes -errfmt" elif test "x$TOOLCHAIN_TYPE" = xxlc; then LDFLAGS_JDK="${LDFLAGS_JDK} -q64 -brtl -bnolibpath -liconv -bexpall" CFLAGS_JDK="${CFLAGS_JDK} -qchars=signed -q64 -qfullpath -qsaveopt" @@ -529,7 +531,7 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK], # CXXFLAGS_JDK - C++ Compiler flags # COMMON_CCXXFLAGS_JDK - common to C and C++ if test "x$TOOLCHAIN_TYPE" = xgcc; then - COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS $COMMON_CCXXFLAGS_JDK -Wall -Wno-parentheses -Wextra -Wno-unused -Wno-unused-parameter -Wformat=2 \ + COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS $COMMON_CCXXFLAGS_JDK -Wall -Wextra -Wno-unused -Wno-unused-parameter -Wformat=2 \ -pipe -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE" case $OPENJDK_TARGET_CPU_ARCH in arm ) @@ -549,7 +551,6 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK], COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS $COMMON_CCXXFLAGS_JDK -DTRACING -DMACRO_MEMSYS_OPS -DBREAKPTS" if test "x$OPENJDK_TARGET_CPU_ARCH" = xx86; then COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -DcpuIntel -Di586 -D$OPENJDK_TARGET_CPU_LEGACY_LIB" - CFLAGS_JDK="$CFLAGS_JDK -erroff=E_BAD_PRAGMA_PACK_VALUE" fi CFLAGS_JDK="$CFLAGS_JDK -xc99=%none -xCC -errshort=tags -Xa -v -mt -W0,-noglobal" @@ -883,17 +884,31 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_MISC], case "${TOOLCHAIN_TYPE}" in microsoft) + DISABLE_WARNING_PREFIX="-wd" CFLAGS_WARNINGS_ARE_ERRORS="-WX" ;; solstudio) + DISABLE_WARNING_PREFIX="-erroff=" CFLAGS_WARNINGS_ARE_ERRORS="-errtags -errwarn=%all" ;; gcc) + # Prior to gcc 4.4, a -Wno-X where X is unknown for that version of gcc will cause an error + FLAGS_COMPILER_CHECK_ARGUMENTS([-Wno-this-is-a-warning-that-do-not-exist], + [GCC_CAN_DISABLE_WARNINGS=true], + [GCC_CAN_DISABLE_WARNINGS=false] + ) + if test "x$GCC_CAN_DISABLE_WARNINGS" = "xtrue"; then + DISABLE_WARNING_PREFIX="-Wno-" + else + DISABLE_WARNING_PREFIX= + fi CFLAGS_WARNINGS_ARE_ERRORS="-Werror" ;; clang) + DISABLE_WARNING_PREFIX="-Wno-" CFLAGS_WARNINGS_ARE_ERRORS="-Werror" ;; esac + AC_SUBST(DISABLE_WARNING_PREFIX) AC_SUBST(CFLAGS_WARNINGS_ARE_ERRORS) ]) diff --git a/common/autoconf/generated-configure.sh b/common/autoconf/generated-configure.sh index 47ae5cee7cc..578bbf978e6 100644 --- a/common/autoconf/generated-configure.sh +++ b/common/autoconf/generated-configure.sh @@ -683,6 +683,7 @@ FIXPATH ZIP_DEBUGINFO_FILES ENABLE_DEBUG_SYMBOLS CFLAGS_WARNINGS_ARE_ERRORS +DISABLE_WARNING_PREFIX COMPILER_SUPPORTS_TARGET_BITS_FLAG ZERO_ARCHFLAG LDFLAGS_CXX_JDK @@ -3736,7 +3737,7 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # -# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -4348,7 +4349,7 @@ VS_SDK_PLATFORM_NAME_2013= #CUSTOM_AUTOCONF_INCLUDE # Do not change or remove the following line, it is needed for consistency checks: -DATE_WHEN_GENERATED=1425490712 +DATE_WHEN_GENERATED=1425893864 ############################################################################### # @@ -42349,6 +42350,8 @@ $as_echo "$ac_cv_c_bigendian" >&6; } CFLAGS_JDKLIB_EXTRA="${CFLAGS_JDKLIB_EXTRA} -xregs=no%appl" CXXFLAGS_JDKLIB_EXTRA="${CXXFLAGS_JDKLIB_EXTRA} -xregs=no%appl" fi + CFLAGS_JDKLIB_EXTRA="${CFLAGS_JDKLIB_EXTRA} -errtags=yes -errfmt" + CXXFLAGS_JDKLIB_EXTRA="${CXXFLAGS_JDKLIB_EXTRA} -errtags=yes -errfmt" elif test "x$TOOLCHAIN_TYPE" = xxlc; then LDFLAGS_JDK="${LDFLAGS_JDK} -q64 -brtl -bnolibpath -liconv -bexpall" CFLAGS_JDK="${CFLAGS_JDK} -qchars=signed -q64 -qfullpath -qsaveopt" @@ -42415,7 +42418,7 @@ fi # CXXFLAGS_JDK - C++ Compiler flags # COMMON_CCXXFLAGS_JDK - common to C and C++ if test "x$TOOLCHAIN_TYPE" = xgcc; then - COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS $COMMON_CCXXFLAGS_JDK -Wall -Wno-parentheses -Wextra -Wno-unused -Wno-unused-parameter -Wformat=2 \ + COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS $COMMON_CCXXFLAGS_JDK -Wall -Wextra -Wno-unused -Wno-unused-parameter -Wformat=2 \ -pipe -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE" case $OPENJDK_TARGET_CPU_ARCH in arm ) @@ -42435,7 +42438,6 @@ fi COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS $COMMON_CCXXFLAGS_JDK -DTRACING -DMACRO_MEMSYS_OPS -DBREAKPTS" if test "x$OPENJDK_TARGET_CPU_ARCH" = xx86; then COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -DcpuIntel -Di586 -D$OPENJDK_TARGET_CPU_LEGACY_LIB" - CFLAGS_JDK="$CFLAGS_JDK -erroff=E_BAD_PRAGMA_PACK_VALUE" fi CFLAGS_JDK="$CFLAGS_JDK -xc99=%none -xCC -errshort=tags -Xa -v -mt -W0,-noglobal" @@ -42835,21 +42837,97 @@ $as_echo "$supports" >&6; } case "${TOOLCHAIN_TYPE}" in microsoft) + DISABLE_WARNING_PREFIX="-wd" CFLAGS_WARNINGS_ARE_ERRORS="-WX" ;; solstudio) + DISABLE_WARNING_PREFIX="-erroff=" CFLAGS_WARNINGS_ARE_ERRORS="-errtags -errwarn=%all" ;; gcc) + # Prior to gcc 4.4, a -Wno-X where X is unknown for that version of gcc will cause an error + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports \"-Wno-this-is-a-warning-that-do-not-exist\"" >&5 +$as_echo_n "checking if compiler supports \"-Wno-this-is-a-warning-that-do-not-exist\"... " >&6; } + supports=yes + + saved_cflags="$CFLAGS" + CFLAGS="$CFLAGS -Wno-this-is-a-warning-that-do-not-exist" + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int i; +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + supports=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + CFLAGS="$saved_cflags" + + saved_cxxflags="$CXXFLAGS" + CXXFLAGS="$CXXFLAG -Wno-this-is-a-warning-that-do-not-exist" + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int i; +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + +else + supports=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + CXXFLAGS="$saved_cxxflags" + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supports" >&5 +$as_echo "$supports" >&6; } + if test "x$supports" = "xyes" ; then + GCC_CAN_DISABLE_WARNINGS=true + else + GCC_CAN_DISABLE_WARNINGS=false + + fi + + if test "x$GCC_CAN_DISABLE_WARNINGS" = "xtrue"; then + DISABLE_WARNING_PREFIX="-Wno-" + else + DISABLE_WARNING_PREFIX= + fi CFLAGS_WARNINGS_ARE_ERRORS="-Werror" ;; clang) + DISABLE_WARNING_PREFIX="-Wno-" CFLAGS_WARNINGS_ARE_ERRORS="-Werror" ;; esac + # Setup debug symbols (need objcopy from the toolchain for that) # diff --git a/common/autoconf/spec.gmk.in b/common/autoconf/spec.gmk.in index c83407340a3..4ea1e35191c 100644 --- a/common/autoconf/spec.gmk.in +++ b/common/autoconf/spec.gmk.in @@ -324,6 +324,7 @@ CXX_O_FLAG_NONE:=@CXX_O_FLAG_NONE@ C_FLAG_DEPS:=@C_FLAG_DEPS@ CXX_FLAG_DEPS:=@CXX_FLAG_DEPS@ +DISABLE_WARNING_PREFIX := @DISABLE_WARNING_PREFIX@ CFLAGS_WARNINGS_ARE_ERRORS:=@CFLAGS_WARNINGS_ARE_ERRORS@ CFLAGS_CCACHE:=@CFLAGS_CCACHE@ diff --git a/make/common/MakeBase.gmk b/make/common/MakeBase.gmk index 482be9b3f3b..e58abdfca2e 100644 --- a/make/common/MakeBase.gmk +++ b/make/common/MakeBase.gmk @@ -376,8 +376,8 @@ $(eval $(call SetupLogging)) # This is to be called by all SetupFoo macros define LogSetupMacroEntry - $(if $(27),$(error Internal makefile error: Too many arguments to LogSetupMacroEntry, please update MakeBase.gmk)) - $(if $(findstring $(LOG_LEVEL),debug trace), $(info $1 $(foreach i,2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26,$(if $(strip $($i)),$(NEWLINE) $(strip [$i] $($i)))))) + $(if $(30),$(error Internal makefile error: Too many arguments to LogSetupMacroEntry, please update MakeBase.gmk)) + $(if $(findstring $(LOG_LEVEL),debug trace), $(info $1 $(foreach i,2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29,$(if $(strip $($i)),$(NEWLINE) $(strip [$i] $($i)))))) endef # Support macro for all SetupFoo macros. diff --git a/make/common/NativeCompilation.gmk b/make/common/NativeCompilation.gmk index faf83c2378c..8dd5d5cbf30 100644 --- a/make/common/NativeCompilation.gmk +++ b/make/common/NativeCompilation.gmk @@ -194,15 +194,16 @@ endef # CC the compiler to use, default is $(CC) # LDEXE the linker to use for linking executables, default is $(LDEXE) # OPTIMIZATION sets optimization level to NONE, LOW, HIGH, HIGHEST +# DISABLED_WARNINGS_ Disable the given warnings for the specified toolchain define SetupNativeCompilation - $(if $(27),$(error Internal makefile error: Too many arguments to SetupNativeCompilation, please update NativeCompilation.gmk)) - $(call EvalDebugWrapper,$(strip $1),$(call SetupNativeCompilationInner,$(strip $1),$2,$3,$4,$5,$6,$7,$8,$9,$(10),$(11),$(12),$(13),$(14),$(15),$(16),$(17),$(18),$(19),$(20),$(21),$(22),$(23),$(24),$(25),$(26))) + $(if $(30),$(error Internal makefile error: Too many arguments to SetupNativeCompilation, please update NativeCompilation.gmk)) + $(call EvalDebugWrapper,$(strip $1),$(call SetupNativeCompilationInner,$(strip $1),$2,$3,$4,$5,$6,$7,$8,$9,$(10),$(11),$(12),$(13),$(14),$(15),$(16),$(17),$(18),$(19),$(20),$(21),$(22),$(23),$(24),$(25),$(26),$(27),$(28),$(29))) endef define SetupNativeCompilationInner - $(foreach i,2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26, $(if $(strip $($i)),$1_$(strip $($i)))$(NEWLINE)) - $(call LogSetupMacroEntry,SetupNativeCompilation($1),$2,$3,$4,$5,$6,$7,$8,$9,$(10),$(11),$(12),$(13),$(14),$(15),$(16),$(17),$(18),$(19),$(20),$(21),$(22),$(23),$(24),$(25),$(26)) - $(if $(27),$(error Internal makefile error: Too many arguments to SetupNativeCompilation, please update NativeCompilation.gmk)) + $(foreach i,2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29, $(if $(strip $($i)),$1_$(strip $($i)))$(NEWLINE)) + $(call LogSetupMacroEntry,SetupNativeCompilation($1),$2,$3,$4,$5,$6,$7,$8,$9,$(10),$(11),$(12),$(13),$(14),$(15),$(16),$(17),$(18),$(19),$(20),$(21),$(22),$(23),$(24),$(25),$(26),$(27),$(28),$(29)) + $(if $(30),$(error Internal makefile error: Too many arguments to SetupNativeCompilation, please update NativeCompilation.gmk)) ifneq (,$$($1_BIN)) $$(error BIN has been replaced with OBJECT_DIR) @@ -398,6 +399,12 @@ define SetupNativeCompilationInner $1_EXTRA_CXXFLAGS+=$$($1_CXXFLAGS_$(OPENJDK_TARGET_OS)_release) endif + # Pick up disabled warnings, if possible on this platform. + ifneq ($(DISABLE_WARNING_PREFIX),) + $1_EXTRA_CFLAGS += $$(addprefix $(DISABLE_WARNING_PREFIX), $$($1_DISABLED_WARNINGS_$(TOOLCHAIN_TYPE))) + $1_EXTRA_CXXFLAGS += $$(addprefix $(DISABLE_WARNING_PREFIX), $$($1_DISABLED_WARNINGS_$(TOOLCHAIN_TYPE))) + endif + ifeq ($$($1_DEBUG_SYMBOLS), true) ifeq ($(ENABLE_DEBUG_SYMBOLS), true) ifdef OPENJDK From d6aef89288c0f71dc4dc0dd7dc5a3e041f0c91a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hannes=20Walln=C3=B6fer?= Date: Mon, 9 Mar 2015 11:34:48 +0100 Subject: [PATCH 39/76] 8074556: Functions should not share allocator maps Reviewed-by: lagergren, sundar --- .../internal/codegen/FindScopeDepths.java | 3 +- .../codegen/ObjectClassGenerator.java | 46 ++++------------ .../internal/runtime/AllocationStrategy.java | 39 ++++---------- .../RecompilableScriptFunctionData.java | 7 ++- nashorn/test/script/basic/JDK-8074556.js | 52 +++++++++++++++++++ 5 files changed, 75 insertions(+), 72 deletions(-) create mode 100644 nashorn/test/script/basic/JDK-8074556.js diff --git a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/FindScopeDepths.java b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/FindScopeDepths.java index 431244dc3c6..b45b9867116 100644 --- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/FindScopeDepths.java +++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/FindScopeDepths.java @@ -32,7 +32,6 @@ import java.util.HashSet; import java.util.Iterator; import java.util.Map; import java.util.Set; -import jdk.nashorn.internal.codegen.ObjectClassGenerator.AllocatorDescriptor; import jdk.nashorn.internal.ir.Block; import jdk.nashorn.internal.ir.FunctionNode; import jdk.nashorn.internal.ir.FunctionNode.CompilationState; @@ -208,7 +207,7 @@ final class FindScopeDepths extends NodeVisitor implements Logga final RecompilableScriptFunctionData data = new RecompilableScriptFunctionData( newFunctionNode, compiler.getCodeInstaller(), - new AllocatorDescriptor(newFunctionNode.getThisProperties()), + ObjectClassGenerator.createAllocationStrategy(newFunctionNode.getThisProperties()), nestedFunctions, externalSymbolDepths.get(fnId), internalSymbols.get(fnId), diff --git a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/ObjectClassGenerator.java b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/ObjectClassGenerator.java index a5a5cf6f31e..f1265132442 100644 --- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/ObjectClassGenerator.java +++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/ObjectClassGenerator.java @@ -56,6 +56,7 @@ import java.util.List; import jdk.nashorn.internal.codegen.ClassEmitter.Flag; import jdk.nashorn.internal.codegen.types.Type; import jdk.nashorn.internal.runtime.AccessorProperty; +import jdk.nashorn.internal.runtime.AllocationStrategy; import jdk.nashorn.internal.runtime.Context; import jdk.nashorn.internal.runtime.FunctionScope; import jdk.nashorn.internal.runtime.JSType; @@ -826,44 +827,15 @@ public final class ObjectClassGenerator implements Loggable { } /** - * Describes the allocator class name and property map for a constructor function with the specified + * Creates the allocator class name and property map for a constructor function with the specified * number of "this" properties that it initializes. - * + * @param thisProperties number of properties assigned to "this" + * @return the allocation strategy */ - public static class AllocatorDescriptor { - private final String allocatorClassName; - private final PropertyMap allocatorMap; - - /** - * Creates a new allocator descriptor - * @param thisProperties the number of "this" properties that the function initializes - */ - public AllocatorDescriptor(final int thisProperties) { - final int paddedFieldCount = getPaddedFieldCount(thisProperties); - this.allocatorClassName = Compiler.binaryName(getClassName(paddedFieldCount)); - this.allocatorMap = PropertyMap.newMap(null, allocatorClassName, 0, paddedFieldCount, 0); - } - - /** - * Returns the name of the class that the function allocates - * @return the name of the class that the function allocates - */ - public String getAllocatorClassName() { - return allocatorClassName; - } - - /** - * Returns the allocator map for the function. - * @return the allocator map for the function. - */ - public PropertyMap getAllocatorMap() { - return allocatorMap; - } - - @Override - public String toString() { - return "AllocatorDescriptor[allocatorClassName=" + allocatorClassName + ", allocatorMap.size=" + - allocatorMap.size() + "]"; - } + static AllocationStrategy createAllocationStrategy(final int thisProperties) { + final int paddedFieldCount = getPaddedFieldCount(thisProperties); + final String allocatorClassName = Compiler.binaryName(getClassName(paddedFieldCount)); + final PropertyMap allocatorMap = PropertyMap.newMap(null, allocatorClassName, 0, paddedFieldCount, 0); + return new AllocationStrategy(allocatorMap, allocatorClassName); } } diff --git a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/AllocationStrategy.java b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/AllocationStrategy.java index e4d6ccb10ef..32f73459519 100644 --- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/AllocationStrategy.java +++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/AllocationStrategy.java @@ -30,22 +30,15 @@ import java.io.Serializable; import java.lang.invoke.MethodHandle; import java.lang.invoke.MethodHandles; import jdk.nashorn.internal.codegen.CompilerConstants; -import jdk.nashorn.internal.codegen.ObjectClassGenerator.AllocatorDescriptor; /** - * Encapsulates the allocation strategy for a function when used as a constructor. Basically the same as - * {@link AllocatorDescriptor}, but with an additionally cached resolved method handle. There is also a - * canonical default allocation strategy for functions that don't assign any "this" properties (vast majority - * of all functions), therefore saving some storage space in {@link RecompilableScriptFunctionData} that would - * otherwise be lost to identical tuples of (map, className, handle) fields. + * Encapsulates the allocation strategy for a function when used as a constructor. */ -final class AllocationStrategy implements Serializable { +final public class AllocationStrategy implements Serializable { private static final long serialVersionUID = 1L; private static final MethodHandles.Lookup LOOKUP = MethodHandles.lookup(); - private static final AllocationStrategy DEFAULT_STRATEGY = new AllocationStrategy(new AllocatorDescriptor(0)); - /** Allocator map from allocator descriptor */ private final PropertyMap allocatorMap; @@ -55,19 +48,15 @@ final class AllocationStrategy implements Serializable { /** lazily generated allocator */ private transient MethodHandle allocator; - private AllocationStrategy(final AllocatorDescriptor desc) { - this.allocatorMap = desc.getAllocatorMap(); + /** + * Construct an allocation strategy with the given map and class name. + * @param allocatorMap the property map + * @param className the class name + */ + public AllocationStrategy(final PropertyMap allocatorMap, final String className) { + this.allocatorMap = allocatorMap; // These classes get loaded, so an interned variant of their name is most likely around anyway. - this.allocatorClassName = desc.getAllocatorClassName().intern(); - } - - private boolean matches(final AllocatorDescriptor desc) { - return desc.getAllocatorMap().size() == allocatorMap.size() && - desc.getAllocatorClassName().equals(allocatorClassName); - } - - static AllocationStrategy get(final AllocatorDescriptor desc) { - return DEFAULT_STRATEGY.matches(desc) ? DEFAULT_STRATEGY : new AllocationStrategy(desc); + this.allocatorClassName = className.intern(); } PropertyMap getAllocatorMap() { @@ -88,14 +77,6 @@ final class AllocationStrategy implements Serializable { } } - private Object readResolve() { - if(allocatorMap.size() == DEFAULT_STRATEGY.allocatorMap.size() && - allocatorClassName.equals(DEFAULT_STRATEGY.allocatorClassName)) { - return DEFAULT_STRATEGY; - } - return this; - } - @Override public String toString() { return "AllocationStrategy[allocatorClassName=" + allocatorClassName + ", allocatorMap.size=" + diff --git a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/RecompilableScriptFunctionData.java b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/RecompilableScriptFunctionData.java index 06414edbca0..c65b031e010 100644 --- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/RecompilableScriptFunctionData.java +++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/RecompilableScriptFunctionData.java @@ -43,7 +43,6 @@ import jdk.nashorn.internal.codegen.Compiler.CompilationPhases; import jdk.nashorn.internal.codegen.CompilerConstants; import jdk.nashorn.internal.codegen.FunctionSignature; import jdk.nashorn.internal.codegen.Namespace; -import jdk.nashorn.internal.codegen.ObjectClassGenerator.AllocatorDescriptor; import jdk.nashorn.internal.codegen.OptimisticTypesPersistence; import jdk.nashorn.internal.codegen.TypeMap; import jdk.nashorn.internal.codegen.types.Type; @@ -126,7 +125,7 @@ public final class RecompilableScriptFunctionData extends ScriptFunctionData imp * * @param functionNode functionNode that represents this function code * @param installer installer for code regeneration versions of this function - * @param allocationDescriptor descriptor for the allocation behavior when this function is used as a constructor + * @param allocationStrategy strategy for the allocation behavior when this function is used as a constructor * @param nestedFunctions nested function map * @param externalScopeDepths external scope depths * @param internalSymbols internal symbols to method, defined in its scope @@ -135,7 +134,7 @@ public final class RecompilableScriptFunctionData extends ScriptFunctionData imp public RecompilableScriptFunctionData( final FunctionNode functionNode, final CodeInstaller installer, - final AllocatorDescriptor allocationDescriptor, + final AllocationStrategy allocationStrategy, final Map nestedFunctions, final Map externalScopeDepths, final Set internalSymbols, @@ -153,7 +152,7 @@ public final class RecompilableScriptFunctionData extends ScriptFunctionData imp this.endParserState = functionNode.getEndParserState(); this.token = tokenFor(functionNode); this.installer = installer; - this.allocationStrategy = AllocationStrategy.get(allocationDescriptor); + this.allocationStrategy = allocationStrategy; this.nestedFunctions = smallMap(nestedFunctions); this.externalScopeDepths = smallMap(externalScopeDepths); this.internalSymbols = smallSet(new HashSet<>(internalSymbols)); diff --git a/nashorn/test/script/basic/JDK-8074556.js b/nashorn/test/script/basic/JDK-8074556.js new file mode 100644 index 00000000000..e3fb0d94fbb --- /dev/null +++ b/nashorn/test/script/basic/JDK-8074556.js @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * JDK-8074556: Functions should not share allocator maps + * + * @test + * @run + */ + +function A () { + return this; +} + +function B() { + return this; +} + +A.prototype.x = "x"; +A.prototype.y = "y"; +B.prototype.y = "y"; // same properties but different order +B.prototype.x = "x"; + +function test(o) { + Assert.assertEquals(o.x, "x"); + Assert.assertEquals(o.y, "y"); +} + +test(new A()); +test(new B()); +test(new A()); +test(new B()); From 0ed9eb856c9566abe8e493c1aaa693b81ee00fa2 Mon Sep 17 00:00:00 2001 From: Athijegannathan Sundararajan Date: Mon, 9 Mar 2015 20:14:10 +0530 Subject: [PATCH 40/76] 8074671: Nashorn Parser API Reviewed-by: darcy, forax, attila, hannesw --- nashorn/make/build.xml | 22 +- nashorn/make/nbproject/project.xml | 10 +- nashorn/make/project.properties | 30 +- nashorn/samples/evalcheck.js | 58 + nashorn/samples/withcheck.js | 38 + .../jdk/nashorn/api/tree/ArrayAccessTree.java | 53 + .../nashorn/api/tree/ArrayAccessTreeImpl.java | 59 + .../nashorn/api/tree/ArrayLiteralTree.java | 43 + .../api/tree/ArrayLiteralTreeImpl.java | 53 + .../jdk/nashorn/api/tree/AssignmentTree.java | 53 + .../nashorn/api/tree/AssignmentTreeImpl.java | 61 + .../jdk/nashorn/api/tree/BinaryTree.java | 54 + .../jdk/nashorn/api/tree/BinaryTreeImpl.java | 61 + .../jdk/nashorn/api/tree/BlockTree.java | 50 + .../jdk/nashorn/api/tree/BlockTreeImpl.java | 59 + .../jdk/nashorn/api/tree/BreakTree.java | 49 + .../jdk/nashorn/api/tree/BreakTreeImpl.java | 53 + .../jdk/nashorn/api/tree/CaseTree.java | 59 + .../jdk/nashorn/api/tree/CaseTreeImpl.java | 62 + .../jdk/nashorn/api/tree/CatchTree.java | 62 + .../jdk/nashorn/api/tree/CatchTreeImpl.java | 69 + .../nashorn/api/tree/CompilationUnitTree.java | 66 + .../api/tree/CompilationUnitTreeImpl.java | 73 + .../api/tree/CompoundAssignmentTree.java | 54 + .../api/tree/CompoundAssignmentTreeImpl.java | 63 + .../api/tree/ConditionalExpressionTree.java | 60 + .../tree/ConditionalExpressionTreeImpl.java | 67 + .../nashorn/api/tree/ConditionalLoopTree.java | 41 + .../jdk/nashorn/api/tree/ContinueTree.java | 48 + .../nashorn/api/tree/ContinueTreeImpl.java | 53 + .../jdk/nashorn/api/tree/DebuggerTree.java | 40 + .../nashorn/api/tree/DebuggerTreeImpl.java | 44 + .../jdk/nashorn/api/tree/Diagnostic.java | 151 + .../jdk/nashorn/api/tree/DiagnosticImpl.java | 81 + .../nashorn/api/tree/DiagnosticListener.java | 42 + .../jdk/nashorn/api/tree/DoWhileLoopTree.java | 55 + .../nashorn/api/tree/DoWhileLoopTreeImpl.java | 60 + .../nashorn/api/tree/EmptyStatementTree.java | 39 + .../api/tree/EmptyStatementTreeImpl.java | 44 + .../jdk/nashorn/api/tree/ErroneousTree.java | 35 + .../nashorn/api/tree/ErroneousTreeImpl.java | 44 + .../api/tree/ExpressionStatementTree.java | 46 + .../api/tree/ExpressionStatementTreeImpl.java | 52 + .../jdk/nashorn/api/tree/ExpressionTree.java | 35 + .../nashorn/api/tree/ExpressionTreeImpl.java | 34 + .../jdk/nashorn/api/tree/ForInLoopTree.java | 68 + .../nashorn/api/tree/ForInLoopTreeImpl.java | 77 + .../jdk/nashorn/api/tree/ForLoopTree.java | 68 + .../jdk/nashorn/api/tree/ForLoopTreeImpl.java | 79 + .../nashorn/api/tree/FunctionCallTree.java | 57 + .../api/tree/FunctionCallTreeImpl.java | 61 + .../api/tree/FunctionDeclarationTree.java | 71 + .../api/tree/FunctionDeclarationTreeImpl.java | 80 + .../api/tree/FunctionExpressionTree.java | 71 + .../api/tree/FunctionExpressionTreeImpl.java | 85 + .../jdk/nashorn/api/tree/GotoTree.java | 45 + .../jdk/nashorn/api/tree/IRTranslator.java | 517 ++ .../jdk/nashorn/api/tree/IdentifierTree.java | 46 + .../nashorn/api/tree/IdentifierTreeImpl.java | 53 + .../classes/jdk/nashorn/api/tree/IfTree.java | 67 + .../jdk/nashorn/api/tree/IfTreeImpl.java | 69 + .../jdk/nashorn/api/tree/InstanceOfTree.java | 53 + .../nashorn/api/tree/InstanceOfTreeImpl.java | 58 + .../api/tree/LabeledStatementTree.java | 53 + .../api/tree/LabeledStatementTreeImpl.java | 60 + .../classes/jdk/nashorn/api/tree/LineMap.java | 54 + .../jdk/nashorn/api/tree/LineMapImpl.java | 46 + .../jdk/nashorn/api/tree/LiteralTree.java | 47 + .../jdk/nashorn/api/tree/LiteralTreeImpl.java | 67 + .../jdk/nashorn/api/tree/LoopTree.java | 41 + .../nashorn/api/tree/MemberSelectTree.java | 53 + .../api/tree/MemberSelectTreeImpl.java | 59 + .../classes/jdk/nashorn/api/tree/NewTree.java | 50 + .../jdk/nashorn/api/tree/NewTreeImpl.java | 53 + .../nashorn/api/tree/ObjectLiteralTree.java | 43 + .../api/tree/ObjectLiteralTreeImpl.java | 53 + .../nashorn/api/tree/ParenthesizedTree.java | 47 + .../classes/jdk/nashorn/api/tree/Parser.java | 160 + .../jdk/nashorn/api/tree/ParserImpl.java | 145 + .../jdk/nashorn/api/tree/PropertyTree.java | 64 + .../nashorn/api/tree/PropertyTreeImpl.java | 76 + .../nashorn/api/tree/RegExpLiteralTree.java | 48 + .../api/tree/RegExpLiteralTreeImpl.java | 62 + .../jdk/nashorn/api/tree/ReturnTree.java | 48 + .../jdk/nashorn/api/tree/ReturnTreeImpl.java | 52 + .../api/tree/SimpleTreeVisitorES5_1.java | 390 + .../jdk/nashorn/api/tree/StatementTree.java | 36 + .../nashorn/api/tree/StatementTreeImpl.java | 39 + .../jdk/nashorn/api/tree/SwitchTree.java | 58 + .../jdk/nashorn/api/tree/SwitchTreeImpl.java | 61 + .../jdk/nashorn/api/tree/ThrowTree.java | 46 + .../jdk/nashorn/api/tree/ThrowTreeImpl.java | 51 + .../classes/jdk/nashorn/api/tree/Tree.java | 599 ++ .../jdk/nashorn/api/tree/TreeImpl.java | 154 + .../jdk/nashorn/api/tree/TreeVisitor.java | 438 + .../classes/jdk/nashorn/api/tree/TryTree.java | 67 + .../jdk/nashorn/api/tree/TryTreeImpl.java | 69 + .../jdk/nashorn/api/tree/UnaryTree.java | 49 + .../jdk/nashorn/api/tree/UnaryTreeImpl.java | 53 + .../api/tree/UnknownTreeException.java | 83 + .../jdk/nashorn/api/tree/VariableTree.java | 54 + .../nashorn/api/tree/VariableTreeImpl.java | 59 + .../jdk/nashorn/api/tree/WhileLoopTree.java | 54 + .../nashorn/api/tree/WhileLoopTreeImpl.java | 60 + .../jdk/nashorn/api/tree/WithTree.java | 54 + .../jdk/nashorn/api/tree/WithTreeImpl.java | 59 + .../jdk/nashorn/api/tree/package-info.java | 75 + .../jdk/nashorn/internal/codegen/Lower.java | 10 + .../jdk/nashorn/internal/ir/Block.java | 20 +- .../nashorn/internal/ir/BlockStatement.java | 9 + .../jdk/nashorn/internal/ir/DebuggerNode.java | 63 + .../jdk/nashorn/internal/ir/ErrorNode.java | 69 + .../jdk/nashorn/internal/ir/LiteralNode.java | 29 + .../nashorn/internal/ir/debug/JSONWriter.java | 30 +- .../internal/ir/visitor/NodeVisitor.java | 43 + .../jdk/nashorn/internal/parser/Parser.java | 24 +- .../jdk/nashorn/internal/runtime/Source.java | 26 +- .../internal/runtime/options/Options.java | 1 + .../basic/parser/tryCatchStat.js.EXPECTED | 486 +- nashorn/test/script/basic/parser/util.js | 2 +- nashorn/test/script/nosecurity/parserapi.js | 126 + .../script/nosecurity/parserapi.js.EXPECTED | 7015 +++++++++++++++++ .../nosecurity/parserapi_const_as_var.js | 39 + .../parserapi_const_as_var.js.EXPECTED | 3 + .../script/nosecurity/parserapi_empty_stat.js | 45 + .../parserapi_empty_stat.js.EXPECTED | 1 + .../test/script/nosecurity/parserapi_nse.js | 102 + .../nosecurity/parserapi_nse.js.EXPECTED | 43 + .../script/nosecurity/parserapi_scripting.js | 47 + .../parserapi_scripting.js.EXPECTED | 9 + .../script/nosecurity/parserapi_strict.js | 59 + .../nosecurity/parserapi_strict.js.EXPECTED | 16 + .../parsernegativetests/caseoutofswitch.js | 32 + .../parsernegativetests/illegalbreak.js | 30 + .../parsernegativetests/illegalcontinue.js | 30 + .../parsernegativetests/illegallvalue.js | 31 + .../parsernegativetests/illegaloperator.js | 29 + .../parsernegativetests/keywordident.js | 30 + .../parsernegativetests/parenmissing.js | 30 + .../parsernegativetests/repeatedproperty.js | 33 + .../strict_repeatedproperty.js | 32 + .../parsernegativetests/strict_repeatparam.js | 31 + .../parsernegativetests/strict_with.js | 31 + .../parsernegativetests/toplevelreturn.js | 30 + .../nosecurity/parsertests/array_literal.js | 33 + .../nosecurity/parsertests/assignmentExpr.js | 42 + .../nosecurity/parsertests/binaryExpr.js | 51 + .../script/nosecurity/parsertests/block.js | 31 + .../nosecurity/parsertests/breakStat.js | 32 + .../script/nosecurity/parsertests/condExpr.js | 31 + .../nosecurity/parsertests/continueStat.js | 32 + .../nosecurity/parsertests/debuggerStat.js | 30 + .../nosecurity/parsertests/functions.js | 36 + .../script/nosecurity/parsertests/ifStat.js | 31 + .../nosecurity/parsertests/labelledStat.js | 31 + .../script/nosecurity/parsertests/lhsExpr.js | 44 + .../script/nosecurity/parsertests/loopStat.js | 34 + .../nosecurity/parsertests/objectLitExpr.js | 34 + .../nosecurity/parsertests/parenExpr.js | 31 + .../nosecurity/parsertests/primaryExpr.js | 42 + .../nosecurity/parsertests/regexp_literal.js | 32 + .../nosecurity/parsertests/returnStat.js | 32 + .../nosecurity/parsertests/switchStat.js | 32 + .../nosecurity/parsertests/throwStat.js | 34 + .../nosecurity/parsertests/tryCatchStat.js | 35 + .../nosecurity/parsertests/unaryExpr.js | 40 + .../nosecurity/parsertests/useStrict.js | 31 + .../script/nosecurity/parsertests/varDecl.js | 37 + .../script/nosecurity/parsertests/withStat.js | 30 + .../test/script/nosecurity/parservisitor.js | 380 + .../nosecurity/parservisitor.js.EXPECTED | 87 + .../jdk/nashorn/api/tree/ParseAPITest.java | 188 + .../internal/codegen/CompilerTest.java | 1 - .../nashorn/internal/parser/ParserTest.java | 1 - 174 files changed, 17893 insertions(+), 317 deletions(-) create mode 100644 nashorn/samples/evalcheck.js create mode 100644 nashorn/samples/withcheck.js create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ArrayAccessTree.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ArrayAccessTreeImpl.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ArrayLiteralTree.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ArrayLiteralTreeImpl.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/AssignmentTree.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/AssignmentTreeImpl.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/BinaryTree.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/BinaryTreeImpl.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/BlockTree.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/BlockTreeImpl.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/BreakTree.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/BreakTreeImpl.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/CaseTree.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/CaseTreeImpl.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/CatchTree.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/CatchTreeImpl.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/CompilationUnitTree.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/CompilationUnitTreeImpl.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/CompoundAssignmentTree.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/CompoundAssignmentTreeImpl.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ConditionalExpressionTree.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ConditionalExpressionTreeImpl.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ConditionalLoopTree.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ContinueTree.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ContinueTreeImpl.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/DebuggerTree.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/DebuggerTreeImpl.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/Diagnostic.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/DiagnosticImpl.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/DiagnosticListener.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/DoWhileLoopTree.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/DoWhileLoopTreeImpl.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/EmptyStatementTree.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/EmptyStatementTreeImpl.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ErroneousTree.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ErroneousTreeImpl.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ExpressionStatementTree.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ExpressionStatementTreeImpl.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ExpressionTree.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ExpressionTreeImpl.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ForInLoopTree.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ForInLoopTreeImpl.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ForLoopTree.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ForLoopTreeImpl.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/FunctionCallTree.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/FunctionCallTreeImpl.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/FunctionDeclarationTree.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/FunctionDeclarationTreeImpl.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/FunctionExpressionTree.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/FunctionExpressionTreeImpl.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/GotoTree.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/IRTranslator.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/IdentifierTree.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/IdentifierTreeImpl.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/IfTree.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/IfTreeImpl.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/InstanceOfTree.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/InstanceOfTreeImpl.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/LabeledStatementTree.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/LabeledStatementTreeImpl.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/LineMap.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/LineMapImpl.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/LiteralTree.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/LiteralTreeImpl.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/LoopTree.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/MemberSelectTree.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/MemberSelectTreeImpl.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/NewTree.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/NewTreeImpl.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ObjectLiteralTree.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ObjectLiteralTreeImpl.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ParenthesizedTree.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/Parser.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ParserImpl.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/PropertyTree.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/PropertyTreeImpl.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/RegExpLiteralTree.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/RegExpLiteralTreeImpl.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ReturnTree.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ReturnTreeImpl.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/SimpleTreeVisitorES5_1.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/StatementTree.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/StatementTreeImpl.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/SwitchTree.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/SwitchTreeImpl.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ThrowTree.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ThrowTreeImpl.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/Tree.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/TreeImpl.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/TreeVisitor.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/TryTree.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/TryTreeImpl.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/UnaryTree.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/UnaryTreeImpl.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/UnknownTreeException.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/VariableTree.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/VariableTreeImpl.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/WhileLoopTree.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/WhileLoopTreeImpl.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/WithTree.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/WithTreeImpl.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/package-info.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/DebuggerNode.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/ErrorNode.java create mode 100644 nashorn/test/script/nosecurity/parserapi.js create mode 100644 nashorn/test/script/nosecurity/parserapi.js.EXPECTED create mode 100644 nashorn/test/script/nosecurity/parserapi_const_as_var.js create mode 100644 nashorn/test/script/nosecurity/parserapi_const_as_var.js.EXPECTED create mode 100644 nashorn/test/script/nosecurity/parserapi_empty_stat.js create mode 100644 nashorn/test/script/nosecurity/parserapi_empty_stat.js.EXPECTED create mode 100644 nashorn/test/script/nosecurity/parserapi_nse.js create mode 100644 nashorn/test/script/nosecurity/parserapi_nse.js.EXPECTED create mode 100644 nashorn/test/script/nosecurity/parserapi_scripting.js create mode 100644 nashorn/test/script/nosecurity/parserapi_scripting.js.EXPECTED create mode 100644 nashorn/test/script/nosecurity/parserapi_strict.js create mode 100644 nashorn/test/script/nosecurity/parserapi_strict.js.EXPECTED create mode 100644 nashorn/test/script/nosecurity/parsernegativetests/caseoutofswitch.js create mode 100644 nashorn/test/script/nosecurity/parsernegativetests/illegalbreak.js create mode 100644 nashorn/test/script/nosecurity/parsernegativetests/illegalcontinue.js create mode 100644 nashorn/test/script/nosecurity/parsernegativetests/illegallvalue.js create mode 100644 nashorn/test/script/nosecurity/parsernegativetests/illegaloperator.js create mode 100644 nashorn/test/script/nosecurity/parsernegativetests/keywordident.js create mode 100644 nashorn/test/script/nosecurity/parsernegativetests/parenmissing.js create mode 100644 nashorn/test/script/nosecurity/parsernegativetests/repeatedproperty.js create mode 100644 nashorn/test/script/nosecurity/parsernegativetests/strict_repeatedproperty.js create mode 100644 nashorn/test/script/nosecurity/parsernegativetests/strict_repeatparam.js create mode 100644 nashorn/test/script/nosecurity/parsernegativetests/strict_with.js create mode 100644 nashorn/test/script/nosecurity/parsernegativetests/toplevelreturn.js create mode 100644 nashorn/test/script/nosecurity/parsertests/array_literal.js create mode 100644 nashorn/test/script/nosecurity/parsertests/assignmentExpr.js create mode 100644 nashorn/test/script/nosecurity/parsertests/binaryExpr.js create mode 100644 nashorn/test/script/nosecurity/parsertests/block.js create mode 100644 nashorn/test/script/nosecurity/parsertests/breakStat.js create mode 100644 nashorn/test/script/nosecurity/parsertests/condExpr.js create mode 100644 nashorn/test/script/nosecurity/parsertests/continueStat.js create mode 100644 nashorn/test/script/nosecurity/parsertests/debuggerStat.js create mode 100644 nashorn/test/script/nosecurity/parsertests/functions.js create mode 100644 nashorn/test/script/nosecurity/parsertests/ifStat.js create mode 100644 nashorn/test/script/nosecurity/parsertests/labelledStat.js create mode 100644 nashorn/test/script/nosecurity/parsertests/lhsExpr.js create mode 100644 nashorn/test/script/nosecurity/parsertests/loopStat.js create mode 100644 nashorn/test/script/nosecurity/parsertests/objectLitExpr.js create mode 100644 nashorn/test/script/nosecurity/parsertests/parenExpr.js create mode 100644 nashorn/test/script/nosecurity/parsertests/primaryExpr.js create mode 100644 nashorn/test/script/nosecurity/parsertests/regexp_literal.js create mode 100644 nashorn/test/script/nosecurity/parsertests/returnStat.js create mode 100644 nashorn/test/script/nosecurity/parsertests/switchStat.js create mode 100644 nashorn/test/script/nosecurity/parsertests/throwStat.js create mode 100644 nashorn/test/script/nosecurity/parsertests/tryCatchStat.js create mode 100644 nashorn/test/script/nosecurity/parsertests/unaryExpr.js create mode 100644 nashorn/test/script/nosecurity/parsertests/useStrict.js create mode 100644 nashorn/test/script/nosecurity/parsertests/varDecl.js create mode 100644 nashorn/test/script/nosecurity/parsertests/withStat.js create mode 100644 nashorn/test/script/nosecurity/parservisitor.js create mode 100644 nashorn/test/script/nosecurity/parservisitor.js.EXPECTED create mode 100644 nashorn/test/src/jdk/nashorn/api/tree/ParseAPITest.java diff --git a/nashorn/make/build.xml b/nashorn/make/build.xml index 9bc4d670618..bd85a06aba9 100644 --- a/nashorn/make/build.xml +++ b/nashorn/make/build.xml @@ -98,7 +98,7 @@ - + @@ -209,7 +209,7 @@ - @@ -227,7 +227,7 @@ - @@ -314,6 +314,15 @@ grant codeBase "file:/${basedir}/${nashorn.internal.tests.jar}" { permission java.security.AllPermission; }; +grant codeBase "file:/${basedir}/${nashorn.api.tests.jar}" { + permission java.util.PropertyPermission "parserapitest.*", "read"; + permission java.util.PropertyPermission "test.*", "read"; + permission java.util.PropertyPermission "test262.*", "read"; + permission java.io.FilePermission "${basedir}/test/-","read"; + permission java.io.FilePermission "$${user.dir}", "read"; + permission java.util.PropertyPermission "user.dir", "read"; +}; + grant codeBase "file:/${basedir}/${file.reference.testng.jar}" { permission java.security.AllPermission; }; @@ -395,6 +404,7 @@ grant codeBase "file:/${basedir}/test/script/markdown.js" { + @@ -440,7 +450,7 @@ grant codeBase "file:/${basedir}/test/script/markdown.js" { + verbose="${testng.verbose}" haltonfailure="true" useDefaultListeners="false" listeners="${testng.listeners}" workingDir="${basedir}"> @@ -466,7 +476,7 @@ grant codeBase "file:/${basedir}/test/script/markdown.js" { - + @@ -478,7 +488,7 @@ grant codeBase "file:/${basedir}/test/script/markdown.js" { - + diff --git a/nashorn/make/nbproject/project.xml b/nashorn/make/nbproject/project.xml index 94d0c147019..b39e8734cb6 100644 --- a/nashorn/make/nbproject/project.xml +++ b/nashorn/make/nbproject/project.xml @@ -2,21 +2,21 @@