diff -r ea7475564d07 -r ca0e16b2d5d6 hotspot/test/compiler/arraycopy/TestACSameSrcDst.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/compiler/arraycopy/TestACSameSrcDst.java Wed Jul 05 23:40:06 2017 +0200
@@ -0,0 +1,106 @@
+/*
+ * Copyright (c) 2017, Red Hat, 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.
+ */
+
+/**
+ * @test
+ * @bug 8179678
+ * @summary ArrayCopy with same src and dst can cause incorrect execution or compiler crash
+ *
+ * @run main/othervm -XX:CompileCommand=compileonly,TestACSameSrcDst::test* TestACSameSrcDst
+ *
+ */
+
+public class TestACSameSrcDst {
+
+ static int test1(int[] src, int[] dst) {
+ System.arraycopy(src, 5, dst, 0, 10);
+ // this shouldn't be transformed to src[5] because the copy
+ // can modify src[5] if src and dst are the same.
+ return dst[0];
+ }
+
+ static int test2(int[] src) {
+ System.arraycopy(src, 0, src, 0, 10);
+ // same source and destination. If load from destination is
+ // transformed to load of source, the compiler performs that
+ // optimization in an infinite loop.
+ return src[0];
+ }
+
+ static int test3() {
+ int[] src = new int[15];
+ src[5] = 0x42;
+ System.arraycopy(src, 5, src, 0, 10);
+ // That load can't bypass the arraycopy
+ return src[0];
+ }
+
+ static int test4() {
+ int[] src = new int[15];
+ System.arraycopy(src, 0, src, 5, 10);
+ return src[0];
+ }
+
+ // The dst[0] load can't bypass the arraycopy. After ArrayCopyNode
+ // is expanded, C2 looks for a stub call on the control paths of
+ // the array copy subgraph to decide whether the load's memory
+ // input can bypass the arraycopy. This test verifies the case of
+ // a source array that's not declared as an array.
+ static int test5(Object src, int l, boolean flag) {
+ int[] dst = new int[10];
+ if (flag) {
+ dst[0] = 0x42;
+ System.arraycopy(src, 0, dst, 0, l);
+ return dst[0];
+ }
+ return 0;
+ }
+
+ public static void main(String[] args) {
+ int[] array = new int[15];
+ for (int i = 0; i < 20000; i++) {
+ int res;
+ for (int j = 0; j < array.length; j++) {
+ array[j] = j;
+ }
+ int expected = array[5];
+ res = test1(array, array);
+ if (res != expected) {
+ throw new RuntimeException("bad result: " + res + " != " + expected);
+ }
+ test2(array);
+ res = test3();
+ if (res != 0x42) {
+ throw new RuntimeException("bad result: " + res + " != " + 0x42);
+ }
+ test4();
+ for (int j = 0; j < array.length; j++) {
+ array[j] = j;
+ }
+ res = test5(array, 10, (i%2) == 0);
+ if (res != 0) {
+ throw new RuntimeException("bad result: " + res + " != " + 0);
+ }
+ }
+ }
+}
diff -r ea7475564d07 -r ca0e16b2d5d6 jaxp/.hgtags
--- a/jaxp/.hgtags Thu Jun 15 13:44:42 2017 +0200
+++ b/jaxp/.hgtags Wed Jul 05 23:40:06 2017 +0200
@@ -426,3 +426,5 @@
c27321c889cf4c8e465a61b84572c00ef7ee6004 jdk-9+171
bd4b2c8835f35760a51c1475b03a16cc20c62973 jdk-10+10
eedb6e54c8bd6197ecba5fc0d8568bac8ae852dd jdk-9+172
+95bab8bf9201ae8bfdf28e164bf33b78e49477e7 jdk-10+11
+9788347e0629d0cb3a0e55a903494ff741d4fa15 jdk-9+173
diff -r ea7475564d07 -r ca0e16b2d5d6 jaxp/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/generic/ReferenceType.java
--- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/generic/ReferenceType.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/generic/ReferenceType.java Wed Jul 05 23:40:06 2017 +0200
@@ -1,6 +1,5 @@
/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@@ -262,6 +261,7 @@
* @deprecated use getFirstCommonSuperclass(ReferenceType t) which has
* slightly changed semantics.
*/
+ @Deprecated
public ReferenceType firstCommonSuperclass(ReferenceType t) {
if (this.equals(Type.NULL)) return t;
if (t.equals(Type.NULL)) return this;
diff -r ea7475564d07 -r ca0e16b2d5d6 jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/lib/ExsltSets.java
--- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/lib/ExsltSets.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/lib/ExsltSets.java Wed Jul 05 23:40:06 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@@ -22,7 +22,7 @@
*/
package com.sun.org.apache.xalan.internal.lib;
-import com.sun.org.apache.xml.internal.utils.DOMHelper;
+import com.sun.org.apache.xml.internal.utils.DOM2Helper;
import com.sun.org.apache.xpath.internal.NodeSet;
import java.util.HashMap;
import java.util.Map;
@@ -72,8 +72,8 @@
for (int i = 0; i < nl1.getLength(); i++)
{
Node testNode = nl1.item(i);
- if (DOMHelper.isNodeAfter(testNode, endNode)
- && !DOMHelper.isNodeTheSame(testNode, endNode))
+ if (DOM2Helper.isNodeAfter(testNode, endNode)
+ && !DOM2Helper.isNodeTheSame(testNode, endNode))
leadNodes.addElement(testNode);
}
return leadNodes;
@@ -107,8 +107,8 @@
for (int i = 0; i < nl1.getLength(); i++)
{
Node testNode = nl1.item(i);
- if (DOMHelper.isNodeAfter(startNode, testNode)
- && !DOMHelper.isNodeTheSame(startNode, testNode))
+ if (DOM2Helper.isNodeAfter(startNode, testNode)
+ && !DOM2Helper.isNodeTheSame(startNode, testNode))
trailNodes.addElement(testNode);
}
return trailNodes;
diff -r ea7475564d07 -r ca0e16b2d5d6 jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/res/XSLTErrorResources.java
--- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/res/XSLTErrorResources.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/res/XSLTErrorResources.java Wed Jul 05 23:40:06 2017 +0200
@@ -1,6 +1,5 @@
/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@@ -22,9 +21,6 @@
package com.sun.org.apache.xalan.internal.res;
import java.util.ListResourceBundle;
-import java.util.Locale;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
/**
* Set up error messages.
@@ -1426,24 +1422,4 @@
/** String for use when formatting of the error string failed. */
public static final String FORMAT_FAILED = "FORMAT_FAILED";
- /** General error string. */
- public static final String ERROR_STRING = "#error";
-
- /** String to prepend to error messages. */
- public static final String ERROR_HEADER = "Error: ";
-
- /** String to prepend to warning messages. */
- public static final String WARNING_HEADER = "Warning: ";
-
- /** String to specify the XSLT module. */
- public static final String XSL_HEADER = "XSLT ";
-
- /** String to specify the XML parser module. */
- public static final String XML_HEADER = "XML ";
-
- /** I don't think this is used any more.
- * @deprecated */
- public static final String QUERY_HEADER = "PATTERN ";
-
-
}
diff -r ea7475564d07 -r ca0e16b2d5d6 jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_de.java
--- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_de.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_de.java Wed Jul 05 23:40:06 2017 +0200
@@ -1,6 +1,5 @@
/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@@ -22,9 +21,6 @@
package com.sun.org.apache.xalan.internal.res;
import java.util.ListResourceBundle;
-import java.util.Locale;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
/**
* Set up error messages.
@@ -1426,24 +1422,4 @@
/** String for use when formatting of the error string failed. */
public static final String FORMAT_FAILED = "FORMAT_FAILED";
- /** General error string. */
- public static final String ERROR_STRING = "#error";
-
- /** String to prepend to error messages. */
- public static final String ERROR_HEADER = "Error: ";
-
- /** String to prepend to warning messages. */
- public static final String WARNING_HEADER = "Warning: ";
-
- /** String to specify the XSLT module. */
- public static final String XSL_HEADER = "XSLT ";
-
- /** String to specify the XML parser module. */
- public static final String XML_HEADER = "XML ";
-
- /** I don't think this is used any more.
- * @deprecated */
- public static final String QUERY_HEADER = "PATTERN ";
-
-
- }
+}
diff -r ea7475564d07 -r ca0e16b2d5d6 jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_es.java
--- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_es.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_es.java Wed Jul 05 23:40:06 2017 +0200
@@ -1,6 +1,5 @@
/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@@ -22,9 +21,6 @@
package com.sun.org.apache.xalan.internal.res;
import java.util.ListResourceBundle;
-import java.util.Locale;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
/**
* Set up error messages.
@@ -1425,25 +1421,4 @@
/** String for use when formatting of the error string failed. */
public static final String FORMAT_FAILED = "FORMAT_FAILED";
-
- /** General error string. */
- public static final String ERROR_STRING = "#error";
-
- /** String to prepend to error messages. */
- public static final String ERROR_HEADER = "Error: ";
-
- /** String to prepend to warning messages. */
- public static final String WARNING_HEADER = "Warning: ";
-
- /** String to specify the XSLT module. */
- public static final String XSL_HEADER = "XSLT ";
-
- /** String to specify the XML parser module. */
- public static final String XML_HEADER = "XML ";
-
- /** I don't think this is used any more.
- * @deprecated */
- public static final String QUERY_HEADER = "PATTERN ";
-
-
}
diff -r ea7475564d07 -r ca0e16b2d5d6 jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_fr.java
--- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_fr.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_fr.java Wed Jul 05 23:40:06 2017 +0200
@@ -1,6 +1,5 @@
/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@@ -22,9 +21,6 @@
package com.sun.org.apache.xalan.internal.res;
import java.util.ListResourceBundle;
-import java.util.Locale;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
/**
* Set up error messages.
@@ -1425,25 +1421,4 @@
/** String for use when formatting of the error string failed. */
public static final String FORMAT_FAILED = "FORMAT_FAILED";
-
- /** General error string. */
- public static final String ERROR_STRING = "#error";
-
- /** String to prepend to error messages. */
- public static final String ERROR_HEADER = "Error: ";
-
- /** String to prepend to warning messages. */
- public static final String WARNING_HEADER = "Warning: ";
-
- /** String to specify the XSLT module. */
- public static final String XSL_HEADER = "XSLT ";
-
- /** String to specify the XML parser module. */
- public static final String XML_HEADER = "XML ";
-
- /** I don't think this is used any more.
- * @deprecated */
- public static final String QUERY_HEADER = "PATTERN ";
-
-
- }
+}
diff -r ea7475564d07 -r ca0e16b2d5d6 jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_it.java
--- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_it.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_it.java Wed Jul 05 23:40:06 2017 +0200
@@ -1,6 +1,5 @@
/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@@ -22,9 +21,6 @@
package com.sun.org.apache.xalan.internal.res;
import java.util.ListResourceBundle;
-import java.util.Locale;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
/**
* Set up error messages.
@@ -1425,25 +1421,4 @@
/** String for use when formatting of the error string failed. */
public static final String FORMAT_FAILED = "FORMAT_FAILED";
-
- /** General error string. */
- public static final String ERROR_STRING = "#error";
-
- /** String to prepend to error messages. */
- public static final String ERROR_HEADER = "Error: ";
-
- /** String to prepend to warning messages. */
- public static final String WARNING_HEADER = "Warning: ";
-
- /** String to specify the XSLT module. */
- public static final String XSL_HEADER = "XSLT ";
-
- /** String to specify the XML parser module. */
- public static final String XML_HEADER = "XML ";
-
- /** I don't think this is used any more.
- * @deprecated */
- public static final String QUERY_HEADER = "PATTERN ";
-
-
- }
+}
diff -r ea7475564d07 -r ca0e16b2d5d6 jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_ja.java
--- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_ja.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_ja.java Wed Jul 05 23:40:06 2017 +0200
@@ -1,6 +1,5 @@
/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@@ -22,9 +21,6 @@
package com.sun.org.apache.xalan.internal.res;
import java.util.ListResourceBundle;
-import java.util.Locale;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
/**
* Set up error messages.
@@ -1425,25 +1421,4 @@
/** String for use when formatting of the error string failed. */
public static final String FORMAT_FAILED = "FORMAT_FAILED";
-
- /** General error string. */
- public static final String ERROR_STRING = "#error";
-
- /** String to prepend to error messages. */
- public static final String ERROR_HEADER = "Error: ";
-
- /** String to prepend to warning messages. */
- public static final String WARNING_HEADER = "Warning: ";
-
- /** String to specify the XSLT module. */
- public static final String XSL_HEADER = "XSLT ";
-
- /** String to specify the XML parser module. */
- public static final String XML_HEADER = "XML ";
-
- /** I don't think this is used any more.
- * @deprecated */
- public static final String QUERY_HEADER = "PATTERN ";
-
-
- }
+}
diff -r ea7475564d07 -r ca0e16b2d5d6 jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_ko.java
--- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_ko.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_ko.java Wed Jul 05 23:40:06 2017 +0200
@@ -1,6 +1,5 @@
/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@@ -22,9 +21,6 @@
package com.sun.org.apache.xalan.internal.res;
import java.util.ListResourceBundle;
-import java.util.Locale;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
/**
* Set up error messages.
@@ -1015,7 +1011,7 @@
"\uC2DC\uC2A4\uD15C \uC18D\uC131 org.xml.sax.parser\uAC00 \uC9C0\uC815\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4."},
{ ER_PARSER_ARG_CANNOT_BE_NULL,
- "\uAD6C\uBB38\uBD84\uC11D\uAE30 \uC778\uC218\uB294 \uB110\uC774 \uC544\uB2C8\uC5B4\uC57C \uD569\uB2C8\uB2E4."},
+ "\uAD6C\uBB38 \uBD84\uC11D\uAE30 \uC778\uC218\uB294 \uB110\uC774 \uC544\uB2C8\uC5B4\uC57C \uD569\uB2C8\uB2E4."},
{ ER_FEATURE,
"\uAE30\uB2A5: {0}"},
@@ -1252,7 +1248,7 @@
"\uD2B9\uC218 \uCDA9\uB3CC\uC774 \uBC1C\uACAC\uB428: {0}. \uC2A4\uD0C0\uC77C\uC2DC\uD2B8\uC5D0\uC11C \uBC1C\uACAC\uB41C \uB9C8\uC9C0\uB9C9 \uD56D\uBAA9\uC774 \uC0AC\uC6A9\uB429\uB2C8\uB2E4."},
{ WG_PARSING_AND_PREPARING,
- "========= \uAD6C\uBB38\uBD84\uC11D \uD6C4 {0} \uC900\uBE44 \uC911 =========="},
+ "========= \uAD6C\uBB38 \uBD84\uC11D \uD6C4 {0} \uC900\uBE44 \uC911 =========="},
{ WG_ATTR_TEMPLATE,
"\uC18D\uC131 \uD15C\uD50C\uB9AC\uD2B8, {0}"},
@@ -1357,7 +1353,7 @@
{ "optionOUT", " [-OUT outputFileName]"},
{ "optionLXCIN", " [-LXCIN compiledStylesheetFileNameIn]"},
{ "optionLXCOUT", " [-LXCOUT compiledStylesheetFileNameOutOut]"},
- { "optionPARSER", " [-PARSER \uAD6C\uBB38\uBD84\uC11D\uAE30 \uC5F0\uACB0\uC758 \uC804\uCCB4 \uD074\uB798\uC2A4 \uC774\uB984]"},
+ { "optionPARSER", " [-PARSER \uAD6C\uBB38 \uBD84\uC11D\uAE30 \uC5F0\uACB0\uC758 \uC804\uCCB4 \uD074\uB798\uC2A4 \uC774\uB984]"},
{ "optionE", " [-E(\uC5D4\uD2F0\uD2F0 \uCC38\uC870 \uD655\uC7A5 \uC548\uD568)]"},
{ "optionV", " [-E(\uC5D4\uD2F0\uD2F0 \uCC38\uC870 \uD655\uC7A5 \uC548\uD568)]"},
{ "optionQC", " [-QC(\uC790\uB3D9 \uD328\uD134 \uCDA9\uB3CC \uACBD\uACE0)]"},
@@ -1378,9 +1374,9 @@
{ "optionHTML", " [-HTML(HTML \uD3EC\uB9F7\uD130 \uC0AC\uC6A9)]"},
{ "optionPARAM", " [-PARAM \uC774\uB984 \uD45C\uD604\uC2DD(\uC2A4\uD0C0\uC77C\uC2DC\uD2B8 \uB9E4\uAC1C\uBCC0\uC218 \uC124\uC815)]"},
{ "noParsermsg1", "XSL \uD504\uB85C\uC138\uC2A4\uB97C \uC2E4\uD328\uD588\uC2B5\uB2C8\uB2E4."},
- { "noParsermsg2", "** \uAD6C\uBB38\uBD84\uC11D\uAE30\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC74C **"},
+ { "noParsermsg2", "** \uAD6C\uBB38 \uBD84\uC11D\uAE30\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC74C **"},
{ "noParsermsg3", "\uD074\uB798\uC2A4 \uACBD\uB85C\uB97C \uD655\uC778\uD558\uC2ED\uC2DC\uC624."},
- { "noParsermsg4", "IBM\uC758 Java\uC6A9 XML \uAD6C\uBB38\uBD84\uC11D\uAE30\uAC00 \uC5C6\uC744 \uACBD\uC6B0 \uB2E4\uC74C \uC704\uCE58\uC5D0\uC11C \uB2E4\uC6B4\uB85C\uB4DC\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4."},
+ { "noParsermsg4", "IBM\uC758 Java\uC6A9 XML \uAD6C\uBB38 \uBD84\uC11D\uAE30\uAC00 \uC5C6\uC744 \uACBD\uC6B0 \uB2E4\uC74C \uC704\uCE58\uC5D0\uC11C \uB2E4\uC6B4\uB85C\uB4DC\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4."},
{ "noParsermsg5", "IBM AlphaWorks: http://www.alphaworks.ibm.com/formula/xml"},
{ "optionURIRESOLVER", " [-URIRESOLVER \uC804\uCCB4 \uD074\uB798\uC2A4 \uC774\uB984(URI \uBD84\uC11D\uC5D0 \uC0AC\uC6A9\uD560 URIResolver)]"},
{ "optionENTITYRESOLVER", " [-ENTITYRESOLVER \uC804\uCCB4 \uD074\uB798\uC2A4 \uC774\uB984(\uC5D4\uD2F0\uD2F0 \uBD84\uC11D\uC5D0 \uC0AC\uC6A9\uD560 EntityResolver)]"},
@@ -1425,25 +1421,4 @@
/** String for use when formatting of the error string failed. */
public static final String FORMAT_FAILED = "FORMAT_FAILED";
-
- /** General error string. */
- public static final String ERROR_STRING = "#error";
-
- /** String to prepend to error messages. */
- public static final String ERROR_HEADER = "Error: ";
-
- /** String to prepend to warning messages. */
- public static final String WARNING_HEADER = "Warning: ";
-
- /** String to specify the XSLT module. */
- public static final String XSL_HEADER = "XSLT ";
-
- /** String to specify the XML parser module. */
- public static final String XML_HEADER = "XML ";
-
- /** I don't think this is used any more.
- * @deprecated */
- public static final String QUERY_HEADER = "PATTERN ";
-
-
- }
+}
diff -r ea7475564d07 -r ca0e16b2d5d6 jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_pt_BR.java
--- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_pt_BR.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_pt_BR.java Wed Jul 05 23:40:06 2017 +0200
@@ -1,6 +1,5 @@
/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@@ -22,9 +21,6 @@
package com.sun.org.apache.xalan.internal.res;
import java.util.ListResourceBundle;
-import java.util.Locale;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
/**
* Set up error messages.
@@ -1425,25 +1421,4 @@
/** String for use when formatting of the error string failed. */
public static final String FORMAT_FAILED = "FORMAT_FAILED";
-
- /** General error string. */
- public static final String ERROR_STRING = "#error";
-
- /** String to prepend to error messages. */
- public static final String ERROR_HEADER = "Error: ";
-
- /** String to prepend to warning messages. */
- public static final String WARNING_HEADER = "Warning: ";
-
- /** String to specify the XSLT module. */
- public static final String XSL_HEADER = "XSLT ";
-
- /** String to specify the XML parser module. */
- public static final String XML_HEADER = "XML ";
-
- /** I don't think this is used any more.
- * @deprecated */
- public static final String QUERY_HEADER = "PATTERN ";
-
-
- }
+}
diff -r ea7475564d07 -r ca0e16b2d5d6 jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_sv.java
--- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_sv.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_sv.java Wed Jul 05 23:40:06 2017 +0200
@@ -1,6 +1,5 @@
/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@@ -22,9 +21,6 @@
package com.sun.org.apache.xalan.internal.res;
import java.util.ListResourceBundle;
-import java.util.Locale;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
/**
* Set up error messages.
@@ -482,7 +478,7 @@
{"ER0000" , "{0}" },
{ ER_NO_CURLYBRACE,
- "Fel: Uttryck f\u00E5r inte inneh\u00E5lla '{'"},
+ "Fel: Uttryck kan inte inneh\u00E5lla '{'"},
{ ER_ILLEGAL_ATTRIBUTE ,
"{0} har ett otill\u00E5tet attribut: {1}"},
@@ -1426,24 +1422,4 @@
/** String for use when formatting of the error string failed. */
public static final String FORMAT_FAILED = "FORMAT_FAILED";
- /** General error string. */
- public static final String ERROR_STRING = "#error";
-
- /** String to prepend to error messages. */
- public static final String ERROR_HEADER = "Error: ";
-
- /** String to prepend to warning messages. */
- public static final String WARNING_HEADER = "Warning: ";
-
- /** String to specify the XSLT module. */
- public static final String XSL_HEADER = "XSLT ";
-
- /** String to specify the XML parser module. */
- public static final String XML_HEADER = "XML ";
-
- /** I don't think this is used any more.
- * @deprecated */
- public static final String QUERY_HEADER = "PATTERN ";
-
-
- }
+}
diff -r ea7475564d07 -r ca0e16b2d5d6 jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_zh_CN.java
--- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_zh_CN.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_zh_CN.java Wed Jul 05 23:40:06 2017 +0200
@@ -1,6 +1,5 @@
/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@@ -22,9 +21,6 @@
package com.sun.org.apache.xalan.internal.res;
import java.util.ListResourceBundle;
-import java.util.Locale;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
/**
* Set up error messages.
@@ -1425,25 +1421,4 @@
/** String for use when formatting of the error string failed. */
public static final String FORMAT_FAILED = "FORMAT_FAILED";
-
- /** General error string. */
- public static final String ERROR_STRING = "#error";
-
- /** String to prepend to error messages. */
- public static final String ERROR_HEADER = "Error: ";
-
- /** String to prepend to warning messages. */
- public static final String WARNING_HEADER = "Warning: ";
-
- /** String to specify the XSLT module. */
- public static final String XSL_HEADER = "XSLT ";
-
- /** String to specify the XML parser module. */
- public static final String XML_HEADER = "XML ";
-
- /** I don't think this is used any more.
- * @deprecated */
- public static final String QUERY_HEADER = "PATTERN ";
-
-
- }
+}
diff -r ea7475564d07 -r ca0e16b2d5d6 jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_zh_TW.java
--- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_zh_TW.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_zh_TW.java Wed Jul 05 23:40:06 2017 +0200
@@ -1,6 +1,5 @@
/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@@ -22,9 +21,6 @@
package com.sun.org.apache.xalan.internal.res;
import java.util.ListResourceBundle;
-import java.util.Locale;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
/**
* Set up error messages.
@@ -1425,25 +1421,4 @@
/** String for use when formatting of the error string failed. */
public static final String FORMAT_FAILED = "FORMAT_FAILED";
-
- /** General error string. */
- public static final String ERROR_STRING = "#error";
-
- /** String to prepend to error messages. */
- public static final String ERROR_HEADER = "Error: ";
-
- /** String to prepend to warning messages. */
- public static final String WARNING_HEADER = "Warning: ";
-
- /** String to specify the XSLT module. */
- public static final String XSL_HEADER = "XSLT ";
-
- /** String to specify the XML parser module. */
- public static final String XML_HEADER = "XML ";
-
- /** I don't think this is used any more.
- * @deprecated */
- public static final String QUERY_HEADER = "PATTERN ";
-
-
- }
+}
diff -r ea7475564d07 -r ca0e16b2d5d6 jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/ForwardPositionIterator.java
--- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/ForwardPositionIterator.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/ForwardPositionIterator.java Wed Jul 05 23:40:06 2017 +0200
@@ -1,6 +1,5 @@
/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@@ -60,6 +59,7 @@
* @deprecated This class exists only for backwards compatibility with old
* translets. New code should not reference it.
*/
+@Deprecated
public final class ForwardPositionIterator extends DTMAxisIteratorBase {
private DTMAxisIterator _source;
diff -r ea7475564d07 -r ca0e16b2d5d6 jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/KeyIndex.java
--- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/KeyIndex.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/KeyIndex.java Wed Jul 05 23:40:06 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@@ -115,6 +115,7 @@
* Merge the current value's nodeset set by lookupKey() with _nodes.
* @deprecated
*/
+ @Deprecated
public void merge(KeyIndex other) {
if (other == null) return;
@@ -136,6 +137,7 @@
* key() function.
* @deprecated
*/
+ @Deprecated
public void lookupId(Object value) {
// Clear _nodes array
_nodes = null;
@@ -205,6 +207,7 @@
* deprecated.
* @deprecated
*/
+ @Deprecated
public void lookupKey(Object value) {
IntegerArray nodes = _index.get(value);
_nodes = (nodes != null) ? (IntegerArray) nodes.clone() : null;
@@ -217,6 +220,7 @@
* deprecated.
* @deprecated
*/
+ @Deprecated
public int next() {
if (_nodes == null) return DTMAxisIterator.END;
@@ -313,6 +317,7 @@
* deprecated.
* @deprecated
*/
+ @Deprecated
public DTMAxisIterator reset() {
_position = 0;
return this;
@@ -324,6 +329,7 @@
* deprecated.
* @deprecated
*/
+ @Deprecated
public int getLast() {
return (_nodes == null) ? 0 : _nodes.cardinality();
}
@@ -334,6 +340,7 @@
* deprecated.
* @deprecated
*/
+ @Deprecated
public int getPosition() {
return _position;
}
@@ -344,6 +351,7 @@
* deprecated.
* @deprecated
*/
+ @Deprecated
public void setMark() {
_markedPosition = _position;
}
@@ -354,6 +362,7 @@
* deprecated.
* @deprecated
*/
+ @Deprecated
public void gotoMark() {
_position = _markedPosition;
}
@@ -365,6 +374,7 @@
* deprecated.
* @deprecated
*/
+ @Deprecated
public DTMAxisIterator setStartNode(int start) {
if (start == DTMAxisIterator.END) {
_nodes = null;
@@ -382,6 +392,7 @@
* deprecated.
* @deprecated
*/
+ @Deprecated
public int getStartNode() {
return 0;
}
@@ -392,6 +403,7 @@
* deprecated.
* @deprecated
*/
+ @Deprecated
public boolean isReverse() {
return(false);
}
@@ -402,6 +414,7 @@
* deprecated.
* @deprecated
*/
+ @Deprecated
public DTMAxisIterator cloneIterator() {
KeyIndex other = new KeyIndex(0);
other._index = _index;
diff -r ea7475564d07 -r ca0e16b2d5d6 jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/NodeSortRecord.java
--- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/NodeSortRecord.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/NodeSortRecord.java Wed Jul 05 23:40:06 2017 +0200
@@ -1,6 +1,5 @@
/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@@ -49,6 +48,7 @@
* @deprecated This field continues to exist for binary compatibility.
* New code should not refer to it.
*/
+ @Deprecated
private static final Collator DEFAULT_COLLATOR = Collator.getInstance();
/**
@@ -56,6 +56,7 @@
* @deprecated This field continues to exist for binary compatibility.
* New code should not refer to it.
*/
+ @Deprecated
protected Collator _collator = DEFAULT_COLLATOR;
protected Collator[] _collators;
@@ -64,6 +65,7 @@
* @deprecated This field continues to exist for binary compatibility.
* New code should not refer to it.
*/
+ @Deprecated
protected Locale _locale;
protected CollatorFactory _collatorFactory;
diff -r ea7475564d07 -r ca0e16b2d5d6 jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/NodeSortRecordFactory.java
--- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/NodeSortRecordFactory.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/NodeSortRecordFactory.java Wed Jul 05 23:40:06 2017 +0200
@@ -1,6 +1,5 @@
/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@@ -55,6 +54,7 @@
* @deprecated This constructor is no longer used in generated code. It
* exists only for backwards compatibility.
*/
+ @Deprecated
public NodeSortRecordFactory(DOM dom, String className, Translet translet,
String order[], String type[])
throws TransletException
diff -r ea7475564d07 -r ca0e16b2d5d6 jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/runtime/BasisLibrary.java
--- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/runtime/BasisLibrary.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/runtime/BasisLibrary.java Wed Jul 05 23:40:06 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@@ -100,6 +100,7 @@
* @deprecated This method exists only for backwards compatibility with old
* translets. New code should not reference it.
*/
+ @Deprecated
public static int positionF(DTMAxisIterator iterator) {
return iterator.isReverse()
? iterator.getLast() - iterator.getPosition() + 1
diff -r ea7475564d07 -r ca0e16b2d5d6 jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/dom/AttrImpl.java
--- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/dom/AttrImpl.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/dom/AttrImpl.java Wed Jul 05 23:40:06 2017 +0200
@@ -1,6 +1,5 @@
/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@@ -516,6 +515,7 @@
* @deprecated Previous working draft of DOM Level 2. New method
* is getOwnerElement().
*/
+ @Deprecated
public Element getElement() {
// if we have an owner, ownerNode is our ownerElement, otherwise it's
// our ownerDocument and we don't have an ownerElement
diff -r ea7475564d07 -r ca0e16b2d5d6 jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/dom/CoreDocumentImpl.java
--- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/dom/CoreDocumentImpl.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/dom/CoreDocumentImpl.java Wed Jul 05 23:40:06 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2009, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2017, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@@ -832,6 +832,7 @@
* compatibility with older applications. New applications
* should never call this method.
*/
+ @Deprecated
public void setEncoding(String value) {
setXmlEncoding(value);
}
@@ -849,6 +850,7 @@
* compatibility with older applications. New applications
* should never call this method.
*/
+ @Deprecated
public String getEncoding() {
return getXmlEncoding();
}
@@ -890,6 +892,7 @@
* compatibility with older applications. New applications
* should never call this method.
*/
+ @Deprecated
public void setVersion(String value) {
setXmlVersion(value);
}
@@ -908,6 +911,7 @@
* compatibility with older applications. New applications
* should never call this method.
*/
+ @Deprecated
public String getVersion() {
return getXmlVersion();
}
@@ -932,6 +936,7 @@
* compatibility with older applications. New applications
* should never call this method.
*/
+ @Deprecated
public void setStandalone(boolean value) {
setXmlStandalone(value);
}
@@ -950,6 +955,7 @@
* compatibility with older applications. New applications
* should never call this method.
*/
+ @Deprecated
public boolean getStandalone() {
return getXmlStandalone();
}
diff -r ea7475564d07 -r ca0e16b2d5d6 jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/dom/DeferredDocumentImpl.java
--- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/dom/DeferredDocumentImpl.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/dom/DeferredDocumentImpl.java Wed Jul 05 23:40:06 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017 Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@@ -369,6 +369,7 @@
* Creates an element node with a URI in the table and type information.
* @deprecated
*/
+ @Deprecated
public int createDeferredElement(String elementURI, String elementName,
Object type) {
@@ -389,6 +390,7 @@
* Creates an element node in the table.
* @deprecated
*/
+ @Deprecated
public int createDeferredElement(String elementName) {
return createDeferredElement(null, elementName);
}
@@ -474,6 +476,7 @@
* Sets an attribute on an element node.
* @deprecated
*/
+ @Deprecated
public int setDeferredAttribute(int elementNodeIndex,
String attrName, String attrURI,
String attrValue, boolean specified) {
diff -r ea7475564d07 -r ca0e16b2d5d6 jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/dom/NodeImpl.java
--- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/dom/NodeImpl.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/dom/NodeImpl.java Wed Jul 05 23:40:06 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017 Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@@ -763,6 +763,7 @@
* @since DOM Level 3
* @deprecated
*/
+ @Deprecated
public short compareTreePosition(Node other) {
// Questions of clarification for this method - to be answered by the
// DOM WG. Current assumptions listed - LM
diff -r ea7475564d07 -r ca0e16b2d5d6 jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/xs/ItemPSVI.java
--- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/xs/ItemPSVI.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/xs/ItemPSVI.java Wed Jul 05 23:40:06 2017 +0200
@@ -1,6 +1,5 @@
/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@@ -116,6 +115,7 @@
*
* @deprecated Use getSchemaValue().getNormalizedValue() instead
*/
+ @Deprecated
public String getSchemaNormalizedValue();
/**
@@ -127,6 +127,7 @@
*
* @deprecated Use getSchemaValue().getActualValue() instead
*/
+ @Deprecated
public Object getActualNormalizedValue()
throws XSException;
@@ -146,6 +147,7 @@
*
* @deprecated Use getSchemaValue().getActualValueType() instead
*/
+ @Deprecated
public short getActualNormalizedValueType()
throws XSException;
@@ -182,6 +184,7 @@
*
* @deprecated Use getSchemaValue().getListValueTypes() instead
*/
+ @Deprecated
public ShortList getItemValueTypes()
throws XSException;
diff -r ea7475564d07 -r ca0e16b2d5d6 jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/xs/XSAttributeDeclaration.java
--- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/xs/XSAttributeDeclaration.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/xs/XSAttributeDeclaration.java Wed Jul 05 23:40:06 2017 +0200
@@ -1,6 +1,5 @@
/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@@ -55,6 +54,7 @@
*
* @deprecated Use getValueConstraintValue().getNormalizedValue() instead
*/
+ @Deprecated
public String getConstraintValue();
/**
@@ -67,6 +67,7 @@
*
* @deprecated Use getValueConstraintValue().getActualValue() instead
*/
+ @Deprecated
public Object getActualVC()
throws XSException;
@@ -86,6 +87,7 @@
*
* @deprecated Use getValueConstraintValue().getActualValueType() instead
*/
+ @Deprecated
public short getActualVCType()
throws XSException;
@@ -104,6 +106,7 @@
*
* @deprecated Use getValueConstraintValue().getListValueTypes() instead
*/
+ @Deprecated
public ShortList getItemValueTypes()
throws XSException;
diff -r ea7475564d07 -r ca0e16b2d5d6 jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/xs/XSAttributeUse.java
--- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/xs/XSAttributeUse.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/xs/XSAttributeUse.java Wed Jul 05 23:40:06 2017 +0200
@@ -1,6 +1,5 @@
/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@@ -48,6 +47,7 @@
*
* @deprecated Use getValueConstraintValue().getNormalizedValue() instead
*/
+ @Deprecated
public String getConstraintValue();
/**
@@ -60,6 +60,7 @@
*
* @deprecated Use getValueConstraintValue().getActualValue() instead
*/
+ @Deprecated
public Object getActualVC()
throws XSException;
@@ -79,6 +80,7 @@
*
* @deprecated Use getValueConstraintValue().getActualValueType() instead
*/
+ @Deprecated
public short getActualVCType()
throws XSException;
@@ -97,6 +99,7 @@
*
* @deprecated Use getValueConstraintValue().getListValueTypes() instead
*/
+ @Deprecated
public ShortList getItemValueTypes()
throws XSException;
diff -r ea7475564d07 -r ca0e16b2d5d6 jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/xs/XSElementDeclaration.java
--- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/xs/XSElementDeclaration.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/xs/XSElementDeclaration.java Wed Jul 05 23:40:06 2017 +0200
@@ -1,6 +1,5 @@
/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@@ -56,6 +55,7 @@
*
* @deprecated Use getValueConstraintValue().getNormalizedValue() instead
*/
+ @Deprecated
public String getConstraintValue();
/**
@@ -68,6 +68,7 @@
*
* @deprecated Use getValueConstraintValue().getActualValue() instead
*/
+ @Deprecated
public Object getActualVC()
throws XSException;
@@ -87,6 +88,7 @@
*
* @deprecated Use getValueConstraintValue().getActualValueType() instead
*/
+ @Deprecated
public short getActualVCType()
throws XSException;
@@ -105,6 +107,7 @@
*
* @deprecated Use getValueConstraintValue().getListValueTypes() instead
*/
+ @Deprecated
public ShortList getItemValueTypes()
throws XSException;
diff -r ea7475564d07 -r ca0e16b2d5d6 jaxp/src/java.xml/share/classes/com/sun/org/apache/xml/internal/dtm/ref/CoroutineParser.java
--- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xml/internal/dtm/ref/CoroutineParser.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xml/internal/dtm/ref/CoroutineParser.java Wed Jul 05 23:40:06 2017 +0200
@@ -1,6 +1,5 @@
/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@@ -45,6 +44,7 @@
* coroutine protocol was not being used and was complicating design.
* See {@link IncrementalSAXSource}.
* */
+@Deprecated
public interface CoroutineParser {
/** @return the coroutine ID number for this CoroutineParser object.
diff -r ea7475564d07 -r ca0e16b2d5d6 jaxp/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serialize/BaseMarkupSerializer.java
--- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serialize/BaseMarkupSerializer.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serialize/BaseMarkupSerializer.java Wed Jul 05 23:40:06 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017 Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@@ -128,6 +128,7 @@
* {@link com.sun.org.apache.xml.internal.serialize.DOMSerializerImpl} is replaced
* by {@link com.sun.org.apache.xml.internal.serializer.dom3.LSSerializerImpl}.
*/
+@Deprecated
public abstract class BaseMarkupSerializer
implements ContentHandler, DocumentHandler, LexicalHandler,
DTDHandler, DeclHandler, DOMSerializer, Serializer
diff -r ea7475564d07 -r ca0e16b2d5d6 jaxp/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serialize/DOMSerializer.java
--- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serialize/DOMSerializer.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serialize/DOMSerializer.java Wed Jul 05 23:40:06 2017 +0200
@@ -1,6 +1,5 @@
/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@@ -42,6 +41,7 @@
* {@link com.sun.org.apache.xml.internal.serialize.DOMSerializerImpl} is replaced
* by {@link com.sun.org.apache.xml.internal.serializer.dom3.LSSerializerImpl}.
*/
+@Deprecated
public interface DOMSerializer
{
diff -r ea7475564d07 -r ca0e16b2d5d6 jaxp/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serialize/DOMSerializerImpl.java
--- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serialize/DOMSerializerImpl.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serialize/DOMSerializerImpl.java Wed Jul 05 23:40:06 2017 +0200
@@ -1,6 +1,5 @@
/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@@ -76,6 +75,7 @@
* @deprecated As of JDK 9, Xerces 2.9.0, replaced by
* {@link com.sun.org.apache.xml.internal.serializer.dom3.LSSerializerImpl}
*/
+@Deprecated
public class DOMSerializerImpl implements LSSerializer, DOMConfiguration {
// TODO: When DOM Level 3 goes to REC replace method calls using
diff -r ea7475564d07 -r ca0e16b2d5d6 jaxp/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serialize/ElementState.java
--- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serialize/ElementState.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serialize/ElementState.java Wed Jul 05 23:40:06 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017 Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@@ -36,6 +36,7 @@
* {@link com.sun.org.apache.xml.internal.serialize.DOMSerializerImpl} is replaced
* by {@link com.sun.org.apache.xml.internal.serializer.dom3.LSSerializerImpl}.
*/
+@Deprecated
public class ElementState
{
diff -r ea7475564d07 -r ca0e16b2d5d6 jaxp/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serialize/EncodingInfo.java
--- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serialize/EncodingInfo.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serialize/EncodingInfo.java Wed Jul 05 23:40:06 2017 +0200
@@ -1,6 +1,5 @@
/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@@ -37,6 +36,7 @@
* {@link com.sun.org.apache.xml.internal.serialize.DOMSerializerImpl} is replaced
* by {@link com.sun.org.apache.xml.internal.serializer.dom3.LSSerializerImpl}.
*/
+@Deprecated
public class EncodingInfo {
// name of encoding as registered with IANA;
diff -r ea7475564d07 -r ca0e16b2d5d6 jaxp/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serialize/Encodings.java
--- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serialize/Encodings.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serialize/Encodings.java Wed Jul 05 23:40:06 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017 Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@@ -42,6 +42,7 @@
* {@link com.sun.org.apache.xml.internal.serialize.DOMSerializerImpl} is replaced
* by {@link com.sun.org.apache.xml.internal.serializer.dom3.LSSerializerImpl}.
*/
+@Deprecated
class Encodings
{
diff -r ea7475564d07 -r ca0e16b2d5d6 jaxp/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serialize/HTMLSerializer.java
--- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serialize/HTMLSerializer.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serialize/HTMLSerializer.java Wed Jul 05 23:40:06 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017 Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@@ -92,6 +92,7 @@
* @author Assaf Arkin
* @see Serializer
*/
+@Deprecated
public class HTMLSerializer
extends BaseMarkupSerializer
{
diff -r ea7475564d07 -r ca0e16b2d5d6 jaxp/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serialize/HTMLdtd.java
--- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serialize/HTMLdtd.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serialize/HTMLdtd.java Wed Jul 05 23:40:06 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017 Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@@ -51,6 +51,7 @@
* {@link com.sun.org.apache.xml.internal.serialize.DOMSerializerImpl} is replaced
* by {@link com.sun.org.apache.xml.internal.serializer.dom3.LSSerializerImpl}.
*/
+@Deprecated
public final class HTMLdtd
{
diff -r ea7475564d07 -r ca0e16b2d5d6 jaxp/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serialize/IndentPrinter.java
--- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serialize/IndentPrinter.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serialize/IndentPrinter.java Wed Jul 05 23:40:06 2017 +0200
@@ -1,6 +1,5 @@
/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@@ -39,6 +38,7 @@
* {@link com.sun.org.apache.xml.internal.serialize.DOMSerializerImpl} is replaced
* by {@link com.sun.org.apache.xml.internal.serializer.dom3.LSSerializerImpl}.
*/
+@Deprecated
public class IndentPrinter
extends Printer
{
diff -r ea7475564d07 -r ca0e16b2d5d6 jaxp/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serialize/LineSeparator.java
--- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serialize/LineSeparator.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serialize/LineSeparator.java Wed Jul 05 23:40:06 2017 +0200
@@ -1,6 +1,5 @@
/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@@ -32,6 +31,7 @@
* {@link com.sun.org.apache.xml.internal.serialize.DOMSerializerImpl} is replaced
* by {@link com.sun.org.apache.xml.internal.serializer.dom3.LSSerializerImpl}.
*/
+@Deprecated
public final class LineSeparator
{
diff -r ea7475564d07 -r ca0e16b2d5d6 jaxp/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serialize/Method.java
--- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serialize/Method.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serialize/Method.java Wed Jul 05 23:40:06 2017 +0200
@@ -1,6 +1,5 @@
/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@@ -32,6 +31,7 @@
* {@link com.sun.org.apache.xml.internal.serialize.DOMSerializerImpl} is replaced
* by {@link com.sun.org.apache.xml.internal.serializer.dom3.LSSerializerImpl}.
*/
+@Deprecated
public final class Method
{
diff -r ea7475564d07 -r ca0e16b2d5d6 jaxp/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serialize/OutputFormat.java
--- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serialize/OutputFormat.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serialize/OutputFormat.java Wed Jul 05 23:40:06 2017 +0200
@@ -1,6 +1,5 @@
/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@@ -65,6 +64,7 @@
* {@link com.sun.org.apache.xml.internal.serialize.DOMSerializerImpl} is replaced
* by {@link com.sun.org.apache.xml.internal.serializer.dom3.LSSerializerImpl}.
*/
+@Deprecated
public class OutputFormat
{
diff -r ea7475564d07 -r ca0e16b2d5d6 jaxp/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serialize/Printer.java
--- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serialize/Printer.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serialize/Printer.java Wed Jul 05 23:40:06 2017 +0200
@@ -1,6 +1,5 @@
/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@@ -47,6 +46,7 @@
* {@link com.sun.org.apache.xml.internal.serialize.DOMSerializerImpl} is replaced
* by {@link com.sun.org.apache.xml.internal.serializer.dom3.LSSerializerImpl}.
*/
+@Deprecated
public class Printer
{
diff -r ea7475564d07 -r ca0e16b2d5d6 jaxp/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serialize/Serializer.java
--- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serialize/Serializer.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serialize/Serializer.java Wed Jul 05 23:40:06 2017 +0200
@@ -1,6 +1,5 @@
/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@@ -67,6 +66,7 @@
* {@link com.sun.org.apache.xml.internal.serialize.DOMSerializerImpl} is replaced
* by {@link com.sun.org.apache.xml.internal.serializer.dom3.LSSerializerImpl}.
*/
+@Deprecated
public interface Serializer
{
diff -r ea7475564d07 -r ca0e16b2d5d6 jaxp/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serialize/SerializerFactory.java
--- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serialize/SerializerFactory.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serialize/SerializerFactory.java Wed Jul 05 23:40:06 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017 Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@@ -42,6 +42,7 @@
* {@link com.sun.org.apache.xml.internal.serialize.DOMSerializerImpl} is replaced
* by {@link com.sun.org.apache.xml.internal.serializer.dom3.LSSerializerImpl}.
*/
+@Deprecated
public abstract class SerializerFactory
{
diff -r ea7475564d07 -r ca0e16b2d5d6 jaxp/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serialize/SerializerFactoryImpl.java
--- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serialize/SerializerFactoryImpl.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serialize/SerializerFactoryImpl.java Wed Jul 05 23:40:06 2017 +0200
@@ -1,6 +1,5 @@
/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@@ -41,6 +40,7 @@
* {@link com.sun.org.apache.xml.internal.serialize.DOMSerializerImpl} is replaced
* by {@link com.sun.org.apache.xml.internal.serializer.dom3.LSSerializerImpl}.
*/
+@Deprecated
final class SerializerFactoryImpl
extends SerializerFactory
{
diff -r ea7475564d07 -r ca0e16b2d5d6 jaxp/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serialize/TextSerializer.java
--- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serialize/TextSerializer.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serialize/TextSerializer.java Wed Jul 05 23:40:06 2017 +0200
@@ -1,6 +1,5 @@
/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@@ -65,6 +64,7 @@
* {@link com.sun.org.apache.xml.internal.serialize.DOMSerializerImpl} is replaced
* by {@link com.sun.org.apache.xml.internal.serializer.dom3.LSSerializerImpl}.
*/
+@Deprecated
public class TextSerializer
extends BaseMarkupSerializer
{
diff -r ea7475564d07 -r ca0e16b2d5d6 jaxp/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serialize/XHTMLSerializer.java
--- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serialize/XHTMLSerializer.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serialize/XHTMLSerializer.java Wed Jul 05 23:40:06 2017 +0200
@@ -1,6 +1,5 @@
/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@@ -39,6 +38,7 @@
* @author Assaf Arkin
* @see Serializer
*/
+@Deprecated
public class XHTMLSerializer
extends HTMLSerializer
{
diff -r ea7475564d07 -r ca0e16b2d5d6 jaxp/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serialize/XML11Serializer.java
--- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serialize/XML11Serializer.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serialize/XML11Serializer.java Wed Jul 05 23:40:06 2017 +0200
@@ -1,6 +1,5 @@
/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@@ -84,6 +83,7 @@
* {@link com.sun.org.apache.xml.internal.serialize.DOMSerializerImpl} is replaced
* by {@link com.sun.org.apache.xml.internal.serializer.dom3.LSSerializerImpl}.
*/
+@Deprecated
public class XML11Serializer
extends XMLSerializer {
diff -r ea7475564d07 -r ca0e16b2d5d6 jaxp/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serialize/XMLSerializer.java
--- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serialize/XMLSerializer.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serialize/XMLSerializer.java Wed Jul 05 23:40:06 2017 +0200
@@ -1,6 +1,5 @@
/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@@ -95,6 +94,7 @@
* {@link com.sun.org.apache.xml.internal.serialize.DOMSerializerImpl} is replaced
* by {@link com.sun.org.apache.xml.internal.serializer.dom3.LSSerializerImpl}.
*/
+@Deprecated
public class XMLSerializer
extends BaseMarkupSerializer {
diff -r ea7475564d07 -r ca0e16b2d5d6 jaxp/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serializer/TreeWalker.java
--- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serializer/TreeWalker.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serializer/TreeWalker.java Wed Jul 05 23:40:06 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@@ -17,13 +17,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+
package com.sun.org.apache.xml.internal.serializer;
-import com.sun.org.apache.xalan.internal.utils.SecuritySupport;
-import java.io.File;
-
-import com.sun.org.apache.xml.internal.serializer.utils.AttList;
-import com.sun.org.apache.xml.internal.serializer.utils.DOM2Helper;
+import com.sun.org.apache.xml.internal.utils.AttList;
+import com.sun.org.apache.xml.internal.utils.DOM2Helper;
+import javax.xml.transform.Result;
import org.w3c.dom.Comment;
import org.w3c.dom.Element;
import org.w3c.dom.EntityReference;
@@ -31,7 +30,6 @@
import org.w3c.dom.Node;
import org.w3c.dom.ProcessingInstruction;
import org.w3c.dom.Text;
-
import org.xml.sax.ContentHandler;
import org.xml.sax.Locator;
import org.xml.sax.ext.LexicalHandler;
@@ -58,12 +56,6 @@
*/
final private SerializationHandler m_Serializer;
- // ARGHH!! JAXP Uses Xerces without setting the namespace processing to ON!
- // DOM2Helper m_dh = new DOM2Helper();
-
- /** DomHelper for this TreeWalker */
- final protected DOM2Helper m_dh;
-
/** Locator object for this TreeWalker */
final private LocatorImpl m_locator = new LocatorImpl();
@@ -78,7 +70,7 @@
}
public TreeWalker(ContentHandler ch) {
- this(ch,null);
+ this(ch, null);
}
/**
* Constructor.
@@ -99,8 +91,6 @@
if (systemId != null) {
m_locator.setSystemId(systemId);
}
-
- m_dh = new DOM2Helper();
}
/**
@@ -209,7 +199,7 @@
this.m_contentHandler.endDocument();
}
- /** Flag indicating whether following text to be processed is raw text */
+ // Flag indicating whether following text to be processed is raw text
boolean nextIsRaw = false;
/**
@@ -313,7 +303,6 @@
final int colon = attrName.indexOf(':');
final String prefix;
- // System.out.println("TreeWalker#startNode: attr["+i+"] = "+attrName+", "+attr.getNodeValue());
if (attrName.equals("xmlns") || attrName.startsWith("xmlns:"))
{
// Use "" instead of null, as Xerces likes "" for the
@@ -335,13 +324,13 @@
}
}
- String ns = m_dh.getNamespaceOfNode(node);
+ String ns = DOM2Helper.getNamespaceOfNode(node);
if(null == ns)
ns = "";
this.m_contentHandler.startElement(ns,
- m_dh.getLocalNameOfNode(node),
+ DOM2Helper.getLocalNameOfNode(node),
node.getNodeName(),
- new AttList(atts, m_dh));
+ new AttList(atts));
break;
case Node.PROCESSING_INSTRUCTION_NODE :
{
@@ -389,9 +378,9 @@
{
nextIsRaw = false;
- m_contentHandler.processingInstruction(javax.xml.transform.Result.PI_DISABLE_OUTPUT_ESCAPING, "");
+ m_contentHandler.processingInstruction(Result.PI_DISABLE_OUTPUT_ESCAPING, "");
dispatachChars(node);
- m_contentHandler.processingInstruction(javax.xml.transform.Result.PI_ENABLE_OUTPUT_ESCAPING, "");
+ m_contentHandler.processingInstruction(Result.PI_ENABLE_OUTPUT_ESCAPING, "");
}
else
{
@@ -436,12 +425,12 @@
break;
case Node.ELEMENT_NODE :
- String ns = m_dh.getNamespaceOfNode(node);
+ String ns = DOM2Helper.getNamespaceOfNode(node);
if(null == ns)
ns = "";
this.m_contentHandler.endElement(ns,
- m_dh.getLocalNameOfNode(node),
- node.getNodeName());
+ DOM2Helper.getLocalNameOfNode(node),
+ node.getNodeName());
if (m_Serializer == null) {
// Don't bother with endPrefixMapping calls if the ContentHandler is a
diff -r ea7475564d07 -r ca0e16b2d5d6 jaxp/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serializer/utils/AttList.java
--- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serializer/utils/AttList.java Thu Jun 15 13:44:42 2017 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,264 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xml.internal.serializer.utils;
-
-import org.w3c.dom.Attr;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-
-import org.xml.sax.Attributes;
-
-/**
- * Wraps a DOM attribute list in a SAX Attributes.
- *
- * This class is a copy of the one in com.sun.org.apache.xml.internal.utils.
- * It exists to cut the serializers dependancy on that package.
- * A minor changes from that package are:
- * DOMHelper reference changed to DOM2Helper, class is not "public"
- *
- * This class is not a public API, it is only public because it is
- * used in com.sun.org.apache.xml.internal.serializer.
- *
- * @xsl.usage internal
- */
-public final class AttList implements Attributes
-{
-
- /** List of attribute nodes */
- NamedNodeMap m_attrs;
-
- /** Index of last attribute node */
- int m_lastIndex;
-
- // ARGHH!! JAXP Uses Xerces without setting the namespace processing to ON!
- // DOM2Helper m_dh = new DOM2Helper();
-
- /** Local reference to DOMHelper */
- DOM2Helper m_dh;
-
-// /**
-// * Constructor AttList
-// *
-// *
-// * @param attrs List of attributes this will contain
-// */
-// public AttList(NamedNodeMap attrs)
-// {
-//
-// m_attrs = attrs;
-// m_lastIndex = m_attrs.getLength() - 1;
-// m_dh = new DOM2Helper();
-// }
-
- /**
- * Constructor AttList
- *
- *
- * @param attrs List of attributes this will contain
- * @param dh DOMHelper
- */
- public AttList(NamedNodeMap attrs, DOM2Helper dh)
- {
-
- m_attrs = attrs;
- m_lastIndex = m_attrs.getLength() - 1;
- m_dh = dh;
- }
-
- /**
- * Get the number of attribute nodes in the list
- *
- *
- * @return number of attribute nodes
- */
- public int getLength()
- {
- return m_attrs.getLength();
- }
-
- /**
- * Look up an attribute's Namespace URI by index.
- *
- * @param index The attribute index (zero-based).
- * @return The Namespace URI, or the empty string if none
- * is available, or null if the index is out of
- * range.
- */
- public String getURI(int index)
- {
- String ns = m_dh.getNamespaceOfNode(((Attr) m_attrs.item(index)));
- if(null == ns)
- ns = "";
- return ns;
- }
-
- /**
- * Look up an attribute's local name by index.
- *
- * @param index The attribute index (zero-based).
- * @return The local name, or the empty string if Namespace
- * processing is not being performed, or null
- * if the index is out of range.
- */
- public String getLocalName(int index)
- {
- return m_dh.getLocalNameOfNode(((Attr) m_attrs.item(index)));
- }
-
- /**
- * Look up an attribute's qualified name by index.
- *
- *
- * @param i The attribute index (zero-based).
- *
- * @return The attribute's qualified name
- */
- public String getQName(int i)
- {
- return ((Attr) m_attrs.item(i)).getName();
- }
-
- /**
- * Get the attribute's node type by index
- *
- *
- * @param i The attribute index (zero-based)
- *
- * @return the attribute's node type
- */
- public String getType(int i)
- {
- return "CDATA"; // for the moment
- }
-
- /**
- * Get the attribute's node value by index
- *
- *
- * @param i The attribute index (zero-based)
- *
- * @return the attribute's node value
- */
- public String getValue(int i)
- {
- return ((Attr) m_attrs.item(i)).getValue();
- }
-
- /**
- * Get the attribute's node type by name
- *
- *
- * @param name Attribute name
- *
- * @return the attribute's node type
- */
- public String getType(String name)
- {
- return "CDATA"; // for the moment
- }
-
- /**
- * Look up an attribute's type by Namespace name.
- *
- * @param uri The Namespace URI, or the empty String if the
- * name has no Namespace URI.
- * @param localName The local name of the attribute.
- * @return The attribute type as a string, or null if the
- * attribute is not in the list or if Namespace
- * processing is not being performed.
- */
- public String getType(String uri, String localName)
- {
- return "CDATA"; // for the moment
- }
-
- /**
- * Look up an attribute's value by name.
- *
- *
- * @param name The attribute node's name
- *
- * @return The attribute node's value
- */
- public String getValue(String name)
- {
- Attr attr = ((Attr) m_attrs.getNamedItem(name));
- return (null != attr)
- ? attr.getValue() : null;
- }
-
- /**
- * Look up an attribute's value by Namespace name.
- *
- * @param uri The Namespace URI, or the empty String if the
- * name has no Namespace URI.
- * @param localName The local name of the attribute.
- * @return The attribute value as a string, or null if the
- * attribute is not in the list.
- */
- public String getValue(String uri, String localName)
- {
- Node a=m_attrs.getNamedItemNS(uri,localName);
- return (a==null) ? null : a.getNodeValue();
- }
-
- /**
- * Look up the index of an attribute by Namespace name.
- *
- * @param uri The Namespace URI, or the empty string if
- * the name has no Namespace URI.
- * @param localPart The attribute's local name.
- * @return The index of the attribute, or -1 if it does not
- * appear in the list.
- */
- public int getIndex(String uri, String localPart)
- {
- for(int i=m_attrs.getLength()-1;i>=0;--i)
- {
- Node a=m_attrs.item(i);
- String u=a.getNamespaceURI();
- if( (u==null ? uri==null : u.equals(uri))
- &&
- a.getLocalName().equals(localPart) )
- return i;
- }
- return -1;
- }
-
- /**
- * Look up the index of an attribute by raw XML 1.0 name.
- *
- * @param qName The qualified (prefixed) name.
- * @return The index of the attribute, or -1 if it does not
- * appear in the list.
- */
- public int getIndex(String qName)
- {
- for(int i=m_attrs.getLength()-1;i>=0;--i)
- {
- Node a=m_attrs.item(i);
- if(a.getNodeName().equals(qName) )
- return i;
- }
- return -1;
- }
-}
diff -r ea7475564d07 -r ca0e16b2d5d6 jaxp/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serializer/utils/DOM2Helper.java
--- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serializer/utils/DOM2Helper.java Thu Jun 15 13:44:42 2017 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,135 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xml.internal.serializer.utils;
-
-import java.io.IOException;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.transform.TransformerException;
-
-import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-import org.xml.sax.InputSource;
-
-/**
- * This class provides a DOM level 2 "helper", which provides services currently
- * not provided be the DOM standard.
- *
- * This class is a copy of the one in com.sun.org.apache.xml.internal.utils.
- * It exists to cut the serializers dependancy on that package.
- *
- * The differences from the original class are:
- * it doesn't extend DOMHelper, not depricated,
- * dropped method isNodeAfter(Node node1, Node node2)
- * dropped method parse(InputSource)
- * dropped method supportSAX()
- * dropped method setDocument(doc)
- * dropped method checkNode(Node)
- * dropped method getDocument()
- * dropped method getElementByID(String id, Document doc)
- * dropped method getParentOfNode(Node node)
- * dropped field Document m_doc;
- * made class non-public
- *
- * This class is not a public API, it is only public because it is
- * used in com.sun.org.apache.xml.internal.serializer.
- *
- * @xsl.usage internal
- */
-public final class DOM2Helper
-{
-
- /**
- * Construct an instance.
- */
- public DOM2Helper(){}
-
- /**
- * Returns the local name of the given node, as defined by the
- * XML Namespaces specification. This is prepared to handle documents
- * built using DOM Level 1 methods by falling back upon explicitly
- * parsing the node name.
- *
- * @param n Node to be examined
- *
- * @return String containing the local name, or null if the node
- * was not assigned a Namespace.
- */
- public String getLocalNameOfNode(Node n)
- {
-
- String name = n.getLocalName();
-
- return (null == name) ? getLocalNameOfNodeFallback(n) : name;
- }
-
- /**
- * Returns the local name of the given node. If the node's name begins
- * with a namespace prefix, this is the part after the colon; otherwise
- * it's the full node name.
- *
- * This method is copied from com.sun.org.apache.xml.internal.utils.DOMHelper
- *
- * @param n the node to be examined.
- *
- * @return String containing the Local Name
- */
- private String getLocalNameOfNodeFallback(Node n)
- {
-
- String qname = n.getNodeName();
- int index = qname.indexOf(':');
-
- return (index < 0) ? qname : qname.substring(index + 1);
- }
-
- /**
- * Returns the Namespace Name (Namespace URI) for the given node.
- * In a Level 2 DOM, you can ask the node itself. Note, however, that
- * doing so conflicts with our decision in getLocalNameOfNode not
- * to trust the that the DOM was indeed created using the Level 2
- * methods. If Level 1 methods were used, these two functions will
- * disagree with each other.
- *
- * TODO: Reconcile with getLocalNameOfNode.
- *
- * @param n Node to be examined
- *
- * @return String containing the Namespace URI bound to this DOM node
- * at the time the Node was created.
- */
- public String getNamespaceOfNode(Node n)
- {
- return n.getNamespaceURI();
- }
-
- /** Field m_useDOM2getNamespaceURI is a compile-time flag which
- * gates some of the parser options used to build a DOM -- but
- * that code is commented out at this time and nobody else
- * references it, so I've commented this out as well. */
- //private boolean m_useDOM2getNamespaceURI = false;
-}
diff -r ea7475564d07 -r ca0e16b2d5d6 jaxp/src/java.xml/share/classes/com/sun/org/apache/xml/internal/utils/AttList.java
--- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xml/internal/utils/AttList.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xml/internal/utils/AttList.java Wed Jul 05 23:40:06 2017 +0200
@@ -1,6 +1,5 @@
/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@@ -40,26 +39,9 @@
/** Index of last attribute node */
int m_lastIndex;
- // ARGHH!! JAXP Uses Xerces without setting the namespace processing to ON!
+ // JAXP Uses Xerces without setting the namespace processing to ON!
// DOM2Helper m_dh = new DOM2Helper();
- /** Local reference to DOMHelper */
- DOMHelper m_dh;
-
-// /**
-// * Constructor AttList
-// *
-// *
-// * @param attrs List of attributes this will contain
-// */
-// public AttList(NamedNodeMap attrs)
-// {
-//
-// m_attrs = attrs;
-// m_lastIndex = m_attrs.getLength() - 1;
-// m_dh = new DOM2Helper();
-// }
-
/**
* Constructor AttList
*
@@ -67,12 +49,10 @@
* @param attrs List of attributes this will contain
* @param dh DOMHelper
*/
- public AttList(NamedNodeMap attrs, DOMHelper dh)
+ public AttList(NamedNodeMap attrs)
{
-
m_attrs = attrs;
m_lastIndex = m_attrs.getLength() - 1;
- m_dh = dh;
}
/**
@@ -96,7 +76,7 @@
*/
public String getURI(int index)
{
- String ns = m_dh.getNamespaceOfNode(((Attr) m_attrs.item(index)));
+ String ns = DOM2Helper.getNamespaceOfNode(((Attr) m_attrs.item(index)));
if(null == ns)
ns = "";
return ns;
@@ -112,7 +92,7 @@
*/
public String getLocalName(int index)
{
- return m_dh.getLocalNameOfNode(((Attr) m_attrs.item(index)));
+ return DOM2Helper.getLocalNameOfNode(((Attr) m_attrs.item(index)));
}
/**
diff -r ea7475564d07 -r ca0e16b2d5d6 jaxp/src/java.xml/share/classes/com/sun/org/apache/xml/internal/utils/DOM2Helper.java
--- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xml/internal/utils/DOM2Helper.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xml/internal/utils/DOM2Helper.java Wed Jul 05 23:40:06 2017 +0200
@@ -1,6 +1,5 @@
/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@@ -18,298 +17,327 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package com.sun.org.apache.xml.internal.utils;
-import java.io.IOException;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.transform.TransformerException;
-
+import com.sun.org.apache.xml.internal.dtm.ref.DTMNodeProxy;
import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
-import org.xml.sax.InputSource;
/**
- * @deprecated Since the introduction of the DTM, this class will be removed.
- * This class provides a DOM level 2 "helper", which provides services currently
- * not provided be the DOM standard.
+ * This class provides a DOM level 2 "helper", which provides several services.
+ *
+ * The original class extended DOMHelper that was deprecated and then removed.
*/
-public class DOM2Helper extends DOMHelper
-{
-
- /**
- * Construct an instance.
- */
- public DOM2Helper(){}
+public final class DOM2Helper {
- /**
- * Check node to see if it was created by a DOM implementation
- * that this helper is intended to support. This is currently
- * disabled, and assumes all nodes are acceptable rather than checking
- * that they implement com.sun.org.apache.xerces.internal.dom.NodeImpl.
- *
- * @param node The node to be tested.
- *
- * @throws TransformerException if the node is not one which this
- * DOM2Helper can support. If we return without throwing the exception,
- * the node is compatable.
- * @xsl.usage internal
- */
- public void checkNode(Node node) throws TransformerException
- {
-
- // if(!(node instanceof com.sun.org.apache.xerces.internal.dom.NodeImpl))
- // throw new TransformerException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_XERCES_CANNOT_HANDLE_NODES, new Object[]{((Object)node).getClass()})); //"DOM2Helper can not handle nodes of type"
- //+((Object)node).getClass());
- }
+ /**
+ * Construct an instance.
+ */
+ private DOM2Helper() {
+ }
- /**
- * Returns true if the DOM implementation handled by this helper
- * supports the SAX ContentHandler interface.
- *
- * @return true (since Xerces does).
- */
- public boolean supportsSAX()
- {
- return true;
- }
-
- /** Field m_doc: Document Node for the document this helper is currently
- * accessing or building
- * @see #setDocument
- * @see #getDocument
- * */
- private Document m_doc;
+ /**
+ * Returns the local name of the given node, as defined by the XML
+ * Namespaces specification. This is prepared to handle documents built
+ * using DOM Level 1 methods by falling back upon explicitly parsing the
+ * node name.
+ *
+ * @param n Node to be examined
+ *
+ * @return String containing the local name, or null if the node was not
+ * assigned a Namespace.
+ */
+ public static String getLocalNameOfNode(Node n) {
- /**
- * Specify which document this helper is currently operating on.
- *
- * @param doc The DOM Document node for this document.
- * @see #getDocument
- */
- public void setDocument(Document doc)
- {
- m_doc = doc;
- }
+ String name = n.getLocalName();
- /**
- * Query which document this helper is currently operating on.
- *
- * @return The DOM Document node for this document.
- * @see #setDocument
- */
- public Document getDocument()
- {
- return m_doc;
- }
+ return (null == name) ? getLocalNameOfNodeFallback(n) : name;
+ }
- /**
- * Parse an XML document.
- *
- *
Right now the Xerces DOMParser class is used. This needs
- * fixing, either via jaxp, or via some other, standard method.
- *
- * The application can use this method to instruct the SAX parser
- * to begin parsing an XML document from any valid input
- * source (a character stream, a byte stream, or a URI).
- *
- * Applications may not invoke this method while a parse is in
- * progress (they should create a new Parser instead for each
- * additional XML document). Once a parse is complete, an
- * application may reuse the same Parser object, possibly with a
- * different input source.
- *
- * @param source The input source for the top-level of the
- * XML document.
- *
- * @throws TransformerException if any checked exception is thrown.
- * @xsl.usage internal
- */
- public void parse(InputSource source) throws TransformerException
- {
+ /**
+ * Returns the local name of the given node. If the node's name begins with
+ * a namespace prefix, this is the part after the colon; otherwise it's the
+ * full node name.
+ *
+ * This method is copied from
+ * com.sun.org.apache.xml.internal.utils.DOMHelper
+ *
+ * @param n the node to be examined.
+ *
+ * @return String containing the Local Name
+ */
+ private static String getLocalNameOfNodeFallback(Node n) {
- try
- {
-
- // I guess I should use JAXP factory here... when it's legal.
- // com.sun.org.apache.xerces.internal.parsers.DOMParser parser
- // = new com.sun.org.apache.xerces.internal.parsers.DOMParser();
- DocumentBuilderFactory builderFactory =
- DocumentBuilderFactory.newInstance();
-
- builderFactory.setNamespaceAware(true);
- builderFactory.setValidating(true);
+ String qname = n.getNodeName();
+ int index = qname.indexOf(':');
- DocumentBuilder parser = builderFactory.newDocumentBuilder();
-
- /*
- // domParser.setFeature("http://apache.org/xml/features/dom/create-entity-ref-nodes", getShouldExpandEntityRefs()? false : true);
- if(m_useDOM2getNamespaceURI)
- {
- parser.setFeature("http://apache.org/xml/features/dom/defer-node-expansion", true);
- parser.setFeature("http://xml.org/sax/features/namespaces", true);
- }
- else
- {
- parser.setFeature("http://apache.org/xml/features/dom/defer-node-expansion", false);
- }
-
- parser.setFeature("http://apache.org/xml/features/allow-java-encodings", true);
- */
+ return (index < 0) ? qname : qname.substring(index + 1);
+ }
- parser.setErrorHandler(
- new com.sun.org.apache.xml.internal.utils.DefaultErrorHandler());
-
- // if(null != m_entityResolver)
- // {
- // System.out.println("Setting the entity resolver.");
- // parser.setEntityResolver(m_entityResolver);
- // }
- setDocument(parser.parse(source));
- }
- catch (org.xml.sax.SAXException se)
- {
- throw new TransformerException(se);
- }
- catch (ParserConfigurationException pce)
- {
- throw new TransformerException(pce);
- }
- catch (IOException ioe)
- {
- throw new TransformerException(ioe);
+ /**
+ * Returns the Namespace Name (Namespace URI) for the given node. In a Level
+ * 2 DOM, you can ask the node itself. Note, however, that doing so
+ * conflicts with our decision in getLocalNameOfNode not to trust the that
+ * the DOM was indeed created using the Level 2 methods. If Level 1 methods
+ * were used, these two functions will disagree with each other.
+ *
+ * TODO: Reconcile with getLocalNameOfNode.
+ *
+ * @param n Node to be examined
+ *
+ * @return String containing the Namespace URI bound to this DOM node at the
+ * time the Node was created.
+ */
+ public static String getNamespaceOfNode(Node n) {
+ return n.getNamespaceURI();
}
- // setDocument(((com.sun.org.apache.xerces.internal.parsers.DOMParser)parser).getDocument());
- }
+ /**
+ * Figure out whether node2 should be considered as being later in the
+ * document than node1, in Document Order as defined by the XPath model.
+ * This may not agree with the ordering defined by other XML applications.
+ *
+ * There are some cases where ordering isn't defined, and neither are the
+ * results of this function -- though we'll generally return true.
+ *
+ * @param node1 DOM Node to perform position comparison on.
+ * @param node2 DOM Node to perform position comparison on .
+ *
+ * @return false if node2 comes before node1, otherwise return true. You can
+ * think of this as
+ * {@code (node1.documentOrderPosition <= node2.documentOrderPosition)}.
+ */
+ public static boolean isNodeAfter(Node node1, Node node2) {
+ if (node1 == node2 || isNodeTheSame(node1, node2)) {
+ return true;
+ }
+
+ // Default return value, if there is no defined ordering
+ boolean isNodeAfter = true;
+
+ Node parent1 = getParentOfNode(node1);
+ Node parent2 = getParentOfNode(node2);
- /**
- * Given an XML ID, return the element. This requires assistance from the
- * DOM and parser, and is meaningful only in the context of a DTD
- * or schema which declares attributes as being of type ID. This
- * information may or may not be available in all parsers, may or
- * may not be available for specific documents, and may or may not
- * be available when validation is not turned on.
- *
- * @param id The ID to search for, as a String.
- * @param doc The document to search within, as a DOM Document node.
- * @return DOM Element node with an attribute of type ID whose value
- * uniquely matches the requested id string, or null if there isn't
- * such an element or if the DOM can't answer the question for other
- * reasons.
- */
- public Element getElementByID(String id, Document doc)
- {
- return doc.getElementById(id);
- }
+ // Optimize for most common case
+ if (parent1 == parent2 || isNodeTheSame(parent1, parent2)) // then we know they are siblings
+ {
+ if (null != parent1) {
+ isNodeAfter = isNodeAfterSibling(parent1, node1, node2);
+ }
+ } else {
+ // General strategy: Figure out the lengths of the two
+ // ancestor chains, reconcile the lengths, and look for
+ // the lowest common ancestor. If that ancestor is one of
+ // the nodes being compared, it comes before the other.
+ // Otherwise perform a sibling compare.
+ //
+ // NOTE: If no common ancestor is found, ordering is undefined
+ // and we return the default value of isNodeAfter.
+ // Count parents in each ancestor chain
+ int nParents1 = 2, nParents2 = 2; // include node & parent obtained above
+
+ while (parent1 != null) {
+ nParents1++;
+
+ parent1 = getParentOfNode(parent1);
+ }
+
+ while (parent2 != null) {
+ nParents2++;
- /**
- * Figure out whether node2 should be considered as being later
- * in the document than node1, in Document Order as defined
- * by the XPath model. This may not agree with the ordering defined
- * by other XML applications.
- *
- * There are some cases where ordering isn't defined, and neither are
- * the results of this function -- though we'll generally return true.
- *
- * TODO: Make sure this does the right thing with attribute nodes!!!
- *
- * @param node1 DOM Node to perform position comparison on.
- * @param node2 DOM Node to perform position comparison on .
- *
- * @return false if node2 comes before node1, otherwise return true.
- * You can think of this as
- * (node1.documentOrderPosition <= node2.documentOrderPosition)
.
- */
- public static boolean isNodeAfter(Node node1, Node node2)
- {
+ parent2 = getParentOfNode(parent2);
+ }
+
+ // Initially assume scan for common ancestor starts with
+ // the input nodes.
+ Node startNode1 = node1, startNode2 = node2;
+
+ // If one ancestor chain is longer, adjust its start point
+ // so we're comparing at the same depths
+ if (nParents1 < nParents2) {
+ // Adjust startNode2 to depth of startNode1
+ int adjust = nParents2 - nParents1;
+
+ for (int i = 0; i < adjust; i++) {
+ startNode2 = getParentOfNode(startNode2);
+ }
+ } else if (nParents1 > nParents2) {
+ // adjust startNode1 to depth of startNode2
+ int adjust = nParents1 - nParents2;
+
+ for (int i = 0; i < adjust; i++) {
+ startNode1 = getParentOfNode(startNode1);
+ }
+ }
+
+ Node prevChild1 = null, prevChild2 = null; // so we can "back up"
- // Assume first that the nodes are DTM nodes, since discovering node
- // order is massivly faster for the DTM.
- if(node1 instanceof DOMOrder && node2 instanceof DOMOrder)
- {
- int index1 = ((DOMOrder) node1).getUid();
- int index2 = ((DOMOrder) node2).getUid();
+ // Loop up the ancestor chain looking for common parent
+ while (null != startNode1) {
+ if (startNode1 == startNode2 || isNodeTheSame(startNode1, startNode2)) // common parent?
+ {
+ if (null == prevChild1) // first time in loop?
+ {
+
+ // Edge condition: one is the ancestor of the other.
+ isNodeAfter = (nParents1 < nParents2) ? true : false;
- return index1 <= index2;
- }
- else
- {
+ break; // from while loop
+ } else {
+ // Compare ancestors below lowest-common as siblings
+ isNodeAfter = isNodeAfterSibling(startNode1, prevChild1,
+ prevChild2);
+
+ break; // from while loop
+ }
+ } // end if(startNode1 == startNode2)
- // isNodeAfter will return true if node is after countedNode
- // in document order. The base isNodeAfter is sloooow (relatively).
- return DOMHelper.isNodeAfter(node1, node2);
- }
- }
+ // Move up one level and try again
+ prevChild1 = startNode1;
+ startNode1 = getParentOfNode(startNode1);
+ prevChild2 = startNode2;
+ startNode2 = getParentOfNode(startNode2);
+ } // end while(parents exist to examine)
+ } // end big else (not immediate siblings)
+
+ return isNodeAfter;
+ } // end isNodeAfter(Node node1, Node node2)
- /**
- * Get the XPath-model parent of a node. This version takes advantage
- * of the DOM Level 2 Attr.ownerElement() method; the base version we
- * would otherwise inherit is prepared to fall back on exhaustively
- * walking the document to find an Attr's parent.
- *
- * @param node Node to be examined
- *
- * @return the DOM parent of the input node, if there is one, or the
- * ownerElement if the input node is an Attr, or null if the node is
- * a Document, a DocumentFragment, or an orphan.
- */
- public static Node getParentOfNode(Node node)
- {
- Node parent=node.getParentNode();
- if(parent==null && (Node.ATTRIBUTE_NODE == node.getNodeType()) )
- parent=((Attr) node).getOwnerElement();
- return parent;
- }
+ /**
+ * Use DTMNodeProxy to determine whether two nodes are the same.
+ *
+ * @param node1 The first DOM node to compare.
+ * @param node2 The second DOM node to compare.
+ * @return true if the two nodes are the same.
+ */
+ public static boolean isNodeTheSame(Node node1, Node node2) {
+ if (node1 instanceof DTMNodeProxy && node2 instanceof DTMNodeProxy) {
+ return ((DTMNodeProxy) node1).equals((DTMNodeProxy) node2);
+ } else {
+ return (node1 == node2);
+ }
+ }
+
+ /**
+ * Get the XPath-model parent of a node. This version takes advantage of the
+ * DOM Level 2 Attr.ownerElement() method; the base version we would
+ * otherwise inherit is prepared to fall back on exhaustively walking the
+ * document to find an Attr's parent.
+ *
+ * @param node Node to be examined
+ *
+ * @return the DOM parent of the input node, if there is one, or the
+ * ownerElement if the input node is an Attr, or null if the node is a
+ * Document, a DocumentFragment, or an orphan.
+ */
+ public static Node getParentOfNode(Node node) {
+ Node parent = node.getParentNode();
+ if (parent == null && (Node.ATTRIBUTE_NODE == node.getNodeType())) {
+ parent = ((Attr) node).getOwnerElement();
+ }
+ return parent;
+ }
+
+ /**
+ * Figure out if child2 is after child1 in document order.
+ *
+ * Warning: Some aspects of "document order" are not well defined. For
+ * example, the order of attributes is considered meaningless in XML, and
+ * the order reported by our model will be consistent for a given invocation
+ * but may not match that of either the source file or the serialized
+ * output.
+ *
+ * @param parent Must be the parent of both child1 and child2.
+ * @param child1 Must be the child of parent and not equal to child2.
+ * @param child2 Must be the child of parent and not equal to child1.
+ * @return true if child 2 is after child1 in document order.
+ */
+ private static boolean isNodeAfterSibling(Node parent, Node child1,
+ Node child2) {
+
+ boolean isNodeAfterSibling = false;
+ short child1type = child1.getNodeType();
+ short child2type = child2.getNodeType();
+
+ if ((Node.ATTRIBUTE_NODE != child1type)
+ && (Node.ATTRIBUTE_NODE == child2type)) {
+
+ // always sort attributes before non-attributes.
+ isNodeAfterSibling = false;
+ } else if ((Node.ATTRIBUTE_NODE == child1type)
+ && (Node.ATTRIBUTE_NODE != child2type)) {
- /**
- * Returns the local name of the given node, as defined by the
- * XML Namespaces specification. This is prepared to handle documents
- * built using DOM Level 1 methods by falling back upon explicitly
- * parsing the node name.
- *
- * @param n Node to be examined
- *
- * @return String containing the local name, or null if the node
- * was not assigned a Namespace.
- */
- public String getLocalNameOfNode(Node n)
- {
+ // always sort attributes before non-attributes.
+ isNodeAfterSibling = true;
+ } else if (Node.ATTRIBUTE_NODE == child1type) {
+ NamedNodeMap children = parent.getAttributes();
+ int nNodes = children.getLength();
+ boolean found1 = false, found2 = false;
+
+ // Count from the start until we find one or the other.
+ for (int i = 0; i < nNodes; i++) {
+ Node child = children.item(i);
- String name = n.getLocalName();
+ if (child1 == child || isNodeTheSame(child1, child)) {
+ if (found2) {
+ isNodeAfterSibling = false;
+
+ break;
+ }
- return (null == name) ? super.getLocalNameOfNode(n) : name;
- }
+ found1 = true;
+ } else if (child2 == child || isNodeTheSame(child2, child)) {
+ if (found1) {
+ isNodeAfterSibling = true;
+
+ break;
+ }
- /**
- * Returns the Namespace Name (Namespace URI) for the given node.
- * In a Level 2 DOM, you can ask the node itself. Note, however, that
- * doing so conflicts with our decision in getLocalNameOfNode not
- * to trust the that the DOM was indeed created using the Level 2
- * methods. If Level 1 methods were used, these two functions will
- * disagree with each other.
- *
- * TODO: Reconcile with getLocalNameOfNode.
- *
- * @param n Node to be examined
- *
- * @return String containing the Namespace URI bound to this DOM node
- * at the time the Node was created.
- */
- public String getNamespaceOfNode(Node n)
- {
- return n.getNamespaceURI();
- }
+ found2 = true;
+ }
+ }
+ } else {
+ // TODO: Check performance of alternate solution:
+ // There are two choices here: Count from the start of
+ // the document until we find one or the other, or count
+ // from one until we find or fail to find the other.
+ // Either can wind up scanning all the siblings in the worst
+ // case, which on a wide document can be a lot of work but
+ // is more typically is a short list.
+ // Scanning from the start involves two tests per iteration,
+ // but it isn't clear that scanning from the middle doesn't
+ // yield more iterations on average.
+ // We should run some testcases.
+ Node child = parent.getFirstChild();
+ boolean found1 = false, found2 = false;
+
+ while (null != child) {
- /** Field m_useDOM2getNamespaceURI is a compile-time flag which
- * gates some of the parser options used to build a DOM -- but
- * that code is commented out at this time and nobody else
- * references it, so I've commented this out as well. */
- //private boolean m_useDOM2getNamespaceURI = false;
+ // Node child = children.item(i);
+ if (child1 == child || isNodeTheSame(child1, child)) {
+ if (found2) {
+ isNodeAfterSibling = false;
+
+ break;
+ }
+
+ found1 = true;
+ } else if (child2 == child || isNodeTheSame(child2, child)) {
+ if (found1) {
+ isNodeAfterSibling = true;
+
+ break;
+ }
+
+ found2 = true;
+ }
+
+ child = child.getNextSibling();
+ }
+ }
+
+ return isNodeAfterSibling;
+ } // end isNodeAfterSibling(Node parent, Node child1, Node child2)
}
diff -r ea7475564d07 -r ca0e16b2d5d6 jaxp/src/java.xml/share/classes/com/sun/org/apache/xml/internal/utils/DOMHelper.java
--- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xml/internal/utils/DOMHelper.java Thu Jun 15 13:44:42 2017 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,1330 +0,0 @@
-/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: DOMHelper.java,v 1.2.4.1 2005/09/15 08:15:40 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.utils;
-
-import com.sun.org.apache.xml.internal.dtm.ref.DTMNodeProxy;
-import com.sun.org.apache.xml.internal.res.XMLErrorResources;
-import com.sun.org.apache.xml.internal.res.XMLMessages;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Vector;
-import javax.xml.XMLConstants;
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-import org.w3c.dom.Attr;
-import org.w3c.dom.DOMImplementation;
-import org.w3c.dom.Document;
-import org.w3c.dom.DocumentType;
-import org.w3c.dom.Element;
-import org.w3c.dom.Entity;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.Text;
-
-/**
- * @deprecated Since the introduction of the DTM, this class will be removed.
- * This class provides a front-end to DOM implementations, providing
- * a number of utility functions that either aren't yet standardized
- * by the DOM spec or that are defined in optional DOM modules and
- * hence may not be present in all DOMs.
- */
-public class DOMHelper
-{
-
- /**
- * DOM Level 1 did not have a standard mechanism for creating a new
- * Document object. This function provides a DOM-implementation-independent
- * abstraction for that for that concept. It's typically used when
- * outputting a new DOM as the result of an operation.
- *
- * TODO: This isn't directly compatable with DOM Level 2.
- * The Level 2 createDocument call also creates the root
- * element, and thus requires that you know what that element will be
- * before creating the Document. We should think about whether we want
- * to change this code, and the callers, so we can use the DOM's own
- * method. (It's also possible that DOM Level 3 may relax this
- * sequence, but you may give up some intelligence in the DOM by
- * doing so; the intent was that knowing the document type and root
- * element might let the DOM automatically switch to a specialized
- * subclass for particular kinds of documents.)
- *
- * @param isSecureProcessing state of the secure processing feature.
- * @return The newly created DOM Document object, with no children, or
- * null if we can't find a DOM implementation that permits creating
- * new empty Documents.
- */
- public static Document createDocument(boolean isSecureProcessing)
- {
-
- try
- {
-
- // Use an implementation of the JAVA API for XML Parsing 1.0 to
- // create a DOM Document node to contain the result.
- DocumentBuilderFactory dfactory = DocumentBuilderFactory.newInstance();
-
- dfactory.setNamespaceAware(true);
- dfactory.setValidating(true);
-
- if (isSecureProcessing)
- {
- try
- {
- dfactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
- }
- catch (ParserConfigurationException pce) {}
- }
-
- DocumentBuilder docBuilder = dfactory.newDocumentBuilder();
- Document outNode = docBuilder.newDocument();
-
- return outNode;
- }
- catch (ParserConfigurationException pce)
- {
- throw new RuntimeException(
- XMLMessages.createXMLMessage(
- XMLErrorResources.ER_CREATEDOCUMENT_NOT_SUPPORTED, null)); //"createDocument() not supported in XPathContext!");
-
- // return null;
- }
- }
-
- /**
- * DOM Level 1 did not have a standard mechanism for creating a new
- * Document object. This function provides a DOM-implementation-independent
- * abstraction for that for that concept. It's typically used when
- * outputting a new DOM as the result of an operation.
- *
- * @return The newly created DOM Document object, with no children, or
- * null if we can't find a DOM implementation that permits creating
- * new empty Documents.
- */
- public static Document createDocument()
- {
- return createDocument(false);
- }
-
- /**
- * Tells, through the combination of the default-space attribute
- * on xsl:stylesheet, xsl:strip-space, xsl:preserve-space, and the
- * xml:space attribute, whether or not extra whitespace should be stripped
- * from the node. Literal elements from template elements should
- * not be tested with this function.
- * @param textNode A text node from the source tree.
- * @return true if the text node should be stripped of extra whitespace.
- *
- * @throws javax.xml.transform.TransformerException
- * @xsl.usage advanced
- */
- public boolean shouldStripSourceNode(Node textNode)
- throws javax.xml.transform.TransformerException
- {
-
- // return (null == m_envSupport) ? false : m_envSupport.shouldStripSourceNode(textNode);
- return false;
- }
-
- /**
- * Supports the XPath function GenerateID by returning a unique
- * identifier string for any given DOM Node.
- *
- * Warning: The base implementation uses the Node object's hashCode(),
- * which is NOT guaranteed to be unique. If that method hasn't been
- * overridden in this DOM ipmlementation, most Java implementions will
- * derive it from the object's address and should be OK... but if
- * your DOM uses a different definition of hashCode (eg hashing the
- * contents of the subtree), or if your DOM may have multiple objects
- * that represent a single Node in the data structure (eg via proxying),
- * you may need to find another way to assign a unique identifier.
- *
- * Also, be aware that if nodes are destroyed and recreated, there is
- * an open issue regarding whether an ID may be reused. Currently
- * we're assuming that the input document is stable for the duration
- * of the XPath/XSLT operation, so this shouldn't arise in this context.
- *
- * (DOM Level 3 is investigating providing a unique node "key", but
- * that won't help Level 1 and Level 2 implementations.)
- *
- * @param node whose identifier you want to obtain
- *
- * @return a string which should be different for every Node object.
- */
- public String getUniqueID(Node node)
- {
- return "N" + Integer.toHexString(node.hashCode()).toUpperCase();
- }
-
- /**
- * Figure out whether node2 should be considered as being later
- * in the document than node1, in Document Order as defined
- * by the XPath model. This may not agree with the ordering defined
- * by other XML applications.
- *
- * There are some cases where ordering isn't defined, and neither are
- * the results of this function -- though we'll generally return true.
- *
- * TODO: Make sure this does the right thing with attribute nodes!!!
- *
- * @param node1 DOM Node to perform position comparison on.
- * @param node2 DOM Node to perform position comparison on .
- *
- * @return false if node2 comes before node1, otherwise return true.
- * You can think of this as
- * (node1.documentOrderPosition <= node2.documentOrderPosition)
.
- */
- public static boolean isNodeAfter(Node node1, Node node2)
- {
- if (node1 == node2 || isNodeTheSame(node1, node2))
- return true;
-
- // Default return value, if there is no defined ordering
- boolean isNodeAfter = true;
-
- Node parent1 = getParentOfNode(node1);
- Node parent2 = getParentOfNode(node2);
-
- // Optimize for most common case
- if (parent1 == parent2 || isNodeTheSame(parent1, parent2)) // then we know they are siblings
- {
- if (null != parent1)
- isNodeAfter = isNodeAfterSibling(parent1, node1, node2);
- else
- {
- // If both parents are null, ordering is not defined.
- // We're returning a value in lieu of throwing an exception.
- // Not a case we expect to arise in XPath, but beware if you
- // try to reuse this method.
-
- // We can just fall through in this case, which allows us
- // to hit the debugging code at the end of the function.
- //return isNodeAfter;
- }
- }
- else
- {
-
- // General strategy: Figure out the lengths of the two
- // ancestor chains, reconcile the lengths, and look for
- // the lowest common ancestor. If that ancestor is one of
- // the nodes being compared, it comes before the other.
- // Otherwise perform a sibling compare.
- //
- // NOTE: If no common ancestor is found, ordering is undefined
- // and we return the default value of isNodeAfter.
-
- // Count parents in each ancestor chain
- int nParents1 = 2, nParents2 = 2; // include node & parent obtained above
-
- while (parent1 != null)
- {
- nParents1++;
-
- parent1 = getParentOfNode(parent1);
- }
-
- while (parent2 != null)
- {
- nParents2++;
-
- parent2 = getParentOfNode(parent2);
- }
-
- // Initially assume scan for common ancestor starts with
- // the input nodes.
- Node startNode1 = node1, startNode2 = node2;
-
- // If one ancestor chain is longer, adjust its start point
- // so we're comparing at the same depths
- if (nParents1 < nParents2)
- {
- // Adjust startNode2 to depth of startNode1
- int adjust = nParents2 - nParents1;
-
- for (int i = 0; i < adjust; i++)
- {
- startNode2 = getParentOfNode(startNode2);
- }
- }
- else if (nParents1 > nParents2)
- {
- // adjust startNode1 to depth of startNode2
- int adjust = nParents1 - nParents2;
-
- for (int i = 0; i < adjust; i++)
- {
- startNode1 = getParentOfNode(startNode1);
- }
- }
-
- Node prevChild1 = null, prevChild2 = null; // so we can "back up"
-
- // Loop up the ancestor chain looking for common parent
- while (null != startNode1)
- {
- if (startNode1 == startNode2 || isNodeTheSame(startNode1, startNode2)) // common parent?
- {
- if (null == prevChild1) // first time in loop?
- {
-
- // Edge condition: one is the ancestor of the other.
- isNodeAfter = (nParents1 < nParents2) ? true : false;
-
- break; // from while loop
- }
- else
- {
- // Compare ancestors below lowest-common as siblings
- isNodeAfter = isNodeAfterSibling(startNode1, prevChild1,
- prevChild2);
-
- break; // from while loop
- }
- } // end if(startNode1 == startNode2)
-
- // Move up one level and try again
- prevChild1 = startNode1;
- startNode1 = getParentOfNode(startNode1);
- prevChild2 = startNode2;
- startNode2 = getParentOfNode(startNode2);
- } // end while(parents exist to examine)
- } // end big else (not immediate siblings)
-
- // WARNING: The following diagnostic won't report the early
- // "same node" case. Fix if/when needed.
-
- /* -- please do not remove... very useful for diagnostics --
- System.out.println("node1 = "+node1.getNodeName()+"("+node1.getNodeType()+")"+
- ", node2 = "+node2.getNodeName()
- +"("+node2.getNodeType()+")"+
- ", isNodeAfter = "+isNodeAfter); */
- return isNodeAfter;
- } // end isNodeAfter(Node node1, Node node2)
-
- /**
- * Use DTMNodeProxy to determine whether two nodes are the same.
- *
- * @param node1 The first DOM node to compare.
- * @param node2 The second DOM node to compare.
- * @return true if the two nodes are the same.
- */
- public static boolean isNodeTheSame(Node node1, Node node2)
- {
- if (node1 instanceof DTMNodeProxy && node2 instanceof DTMNodeProxy)
- return ((DTMNodeProxy)node1).equals((DTMNodeProxy)node2);
- else
- return (node1 == node2);
- }
-
- /**
- * Figure out if child2 is after child1 in document order.
- *
- * Warning: Some aspects of "document order" are not well defined.
- * For example, the order of attributes is considered
- * meaningless in XML, and the order reported by our model will
- * be consistant for a given invocation but may not
- * match that of either the source file or the serialized output.
- *
- * @param parent Must be the parent of both child1 and child2.
- * @param child1 Must be the child of parent and not equal to child2.
- * @param child2 Must be the child of parent and not equal to child1.
- * @return true if child 2 is after child1 in document order.
- */
- private static boolean isNodeAfterSibling(Node parent, Node child1,
- Node child2)
- {
-
- boolean isNodeAfterSibling = false;
- short child1type = child1.getNodeType();
- short child2type = child2.getNodeType();
-
- if ((Node.ATTRIBUTE_NODE != child1type)
- && (Node.ATTRIBUTE_NODE == child2type))
- {
-
- // always sort attributes before non-attributes.
- isNodeAfterSibling = false;
- }
- else if ((Node.ATTRIBUTE_NODE == child1type)
- && (Node.ATTRIBUTE_NODE != child2type))
- {
-
- // always sort attributes before non-attributes.
- isNodeAfterSibling = true;
- }
- else if (Node.ATTRIBUTE_NODE == child1type)
- {
- NamedNodeMap children = parent.getAttributes();
- int nNodes = children.getLength();
- boolean found1 = false, found2 = false;
-
- // Count from the start until we find one or the other.
- for (int i = 0; i < nNodes; i++)
- {
- Node child = children.item(i);
-
- if (child1 == child || isNodeTheSame(child1, child))
- {
- if (found2)
- {
- isNodeAfterSibling = false;
-
- break;
- }
-
- found1 = true;
- }
- else if (child2 == child || isNodeTheSame(child2, child))
- {
- if (found1)
- {
- isNodeAfterSibling = true;
-
- break;
- }
-
- found2 = true;
- }
- }
- }
- else
- {
- // TODO: Check performance of alternate solution:
- // There are two choices here: Count from the start of
- // the document until we find one or the other, or count
- // from one until we find or fail to find the other.
- // Either can wind up scanning all the siblings in the worst
- // case, which on a wide document can be a lot of work but
- // is more typically is a short list.
- // Scanning from the start involves two tests per iteration,
- // but it isn't clear that scanning from the middle doesn't
- // yield more iterations on average.
- // We should run some testcases.
- Node child = parent.getFirstChild();
- boolean found1 = false, found2 = false;
-
- while (null != child)
- {
-
- // Node child = children.item(i);
- if (child1 == child || isNodeTheSame(child1, child))
- {
- if (found2)
- {
- isNodeAfterSibling = false;
-
- break;
- }
-
- found1 = true;
- }
- else if (child2 == child || isNodeTheSame(child2, child))
- {
- if (found1)
- {
- isNodeAfterSibling = true;
-
- break;
- }
-
- found2 = true;
- }
-
- child = child.getNextSibling();
- }
- }
-
- return isNodeAfterSibling;
- } // end isNodeAfterSibling(Node parent, Node child1, Node child2)
-
- //==========================================================
- // SECTION: Namespace resolution
- //==========================================================
-
- /**
- * Get the depth level of this node in the tree (equals 1 for
- * a parentless node).
- *
- * @param n Node to be examined.
- * @return the number of ancestors, plus one
- * @xsl.usage internal
- */
- public short getLevel(Node n)
- {
-
- short level = 1;
-
- while (null != (n = getParentOfNode(n)))
- {
- level++;
- }
-
- return level;
- }
-
- /**
- * Given an XML Namespace prefix and a context in which the prefix
- * is to be evaluated, return the Namespace Name this prefix was
- * bound to. Note that DOM Level 3 is expected to provide a version of
- * this which deals with the DOM's "early binding" behavior.
- *
- * Default handling:
- *
- * @param prefix String containing namespace prefix to be resolved,
- * without the ':' which separates it from the localname when used
- * in a Node Name. The empty sting signifies the default namespace
- * at this point in the document.
- * @param namespaceContext Element which provides context for resolution.
- * (We could extend this to work for other nodes by first seeking their
- * nearest Element ancestor.)
- *
- * @return a String containing the Namespace URI which this prefix
- * represents in the specified context.
- */
- public String getNamespaceForPrefix(String prefix, Element namespaceContext)
- {
-
- int type;
- Node parent = namespaceContext;
- String namespace = null;
-
- if (prefix.equals("xml"))
- {
- namespace = QName.S_XMLNAMESPACEURI; // Hardcoded, per Namespace spec
- }
- else if(prefix.equals("xmlns"))
- {
- // Hardcoded in the DOM spec, expected to be adopted by
- // Namespace spec. NOTE: Namespace declarations _must_ use
- // the xmlns: prefix; other prefixes declared as belonging
- // to this namespace will not be recognized and should
- // probably be rejected by parsers as erroneous declarations.
- namespace = "http://www.w3.org/2000/xmlns/";
- }
- else
- {
- // Attribute name for this prefix's declaration
- String declname=(prefix=="")
- ? "xmlns"
- : "xmlns:"+prefix;
-
- // Scan until we run out of Elements or have resolved the namespace
- while ((null != parent) && (null == namespace)
- && (((type = parent.getNodeType()) == Node.ELEMENT_NODE)
- || (type == Node.ENTITY_REFERENCE_NODE)))
- {
- if (type == Node.ELEMENT_NODE)
- {
-
- // Look for the appropriate Namespace Declaration attribute,
- // either "xmlns:prefix" or (if prefix is "") "xmlns".
- // TODO: This does not handle "implicit declarations"
- // which may be created when the DOM is edited. DOM Level
- // 3 will define how those should be interpreted. But
- // this issue won't arise in freshly-parsed DOMs.
-
- // NOTE: declname is set earlier, outside the loop.
- Attr attr=((Element)parent).getAttributeNode(declname);
- if(attr!=null)
- {
- namespace = attr.getNodeValue();
- break;
- }
- }
-
- parent = getParentOfNode(parent);
- }
- }
-
- return namespace;
- }
-
- /**
- * An experiment for the moment.
- */
- Map m_NSInfos = new HashMap<>();
-
- /** Object to put into the m_NSInfos table that tells that a node has not been
- * processed, but has xmlns namespace decls. */
- protected static final NSInfo m_NSInfoUnProcWithXMLNS = new NSInfo(false,
- true);
-
- /** Object to put into the m_NSInfos table that tells that a node has not been
- * processed, but has no xmlns namespace decls. */
- protected static final NSInfo m_NSInfoUnProcWithoutXMLNS = new NSInfo(false,
- false);
-
- /** Object to put into the m_NSInfos table that tells that a node has not been
- * processed, and has no xmlns namespace decls, and has no ancestor decls. */
- protected static final NSInfo m_NSInfoUnProcNoAncestorXMLNS =
- new NSInfo(false, false, NSInfo.ANCESTORNOXMLNS);
-
- /** Object to put into the m_NSInfos table that tells that a node has been
- * processed, and has xmlns namespace decls. */
- protected static final NSInfo m_NSInfoNullWithXMLNS = new NSInfo(true,
- true);
-
- /** Object to put into the m_NSInfos table that tells that a node has been
- * processed, and has no xmlns namespace decls. */
- protected static final NSInfo m_NSInfoNullWithoutXMLNS = new NSInfo(true,
- false);
-
- /** Object to put into the m_NSInfos table that tells that a node has been
- * processed, and has no xmlns namespace decls. and has no ancestor decls. */
- protected static final NSInfo m_NSInfoNullNoAncestorXMLNS =
- new NSInfo(true, false, NSInfo.ANCESTORNOXMLNS);
-
- /** Vector of node (odd indexes) and NSInfos (even indexes) that tell if
- * the given node is a candidate for ancestor namespace processing. */
- protected Vector m_candidateNoAncestorXMLNS = new Vector();
-
- /**
- * Returns the namespace of the given node. Differs from simply getting
- * the node's prefix and using getNamespaceForPrefix in that it attempts
- * to cache some of the data in NSINFO objects, to avoid repeated lookup.
- * TODO: Should we consider moving that logic into getNamespaceForPrefix?
- *
- * @param n Node to be examined.
- *
- * @return String containing the Namespace Name (uri) for this node.
- * Note that this is undefined for any nodes other than Elements and
- * Attributes.
- */
- public String getNamespaceOfNode(Node n)
- {
-
- String namespaceOfPrefix;
- boolean hasProcessedNS;
- NSInfo nsInfo;
- short ntype = n.getNodeType();
-
- if (Node.ATTRIBUTE_NODE != ntype)
- {
- nsInfo = m_NSInfos.get(n);
- hasProcessedNS = (nsInfo == null) ? false : nsInfo.m_hasProcessedNS;
- }
- else
- {
- hasProcessedNS = false;
- nsInfo = null;
- }
-
- if (hasProcessedNS)
- {
- namespaceOfPrefix = nsInfo.m_namespace;
- }
- else
- {
- namespaceOfPrefix = null;
-
- String nodeName = n.getNodeName();
- int indexOfNSSep = nodeName.indexOf(':');
- String prefix;
-
- if (Node.ATTRIBUTE_NODE == ntype)
- {
- if (indexOfNSSep > 0)
- {
- prefix = nodeName.substring(0, indexOfNSSep);
- }
- else
- {
-
- // Attributes don't use the default namespace, so if
- // there isn't a prefix, we're done.
- return namespaceOfPrefix;
- }
- }
- else
- {
- prefix = (indexOfNSSep >= 0)
- ? nodeName.substring(0, indexOfNSSep) : "";
- }
-
- boolean ancestorsHaveXMLNS = false;
- boolean nHasXMLNS = false;
-
- if (prefix.equals("xml"))
- {
- namespaceOfPrefix = QName.S_XMLNAMESPACEURI;
- }
- else
- {
- int parentType;
- Node parent = n;
-
- while ((null != parent) && (null == namespaceOfPrefix))
- {
- if ((null != nsInfo)
- && (nsInfo.m_ancestorHasXMLNSAttrs
- == NSInfo.ANCESTORNOXMLNS))
- {
- break;
- }
-
- parentType = parent.getNodeType();
-
- if ((null == nsInfo) || nsInfo.m_hasXMLNSAttrs)
- {
- boolean elementHasXMLNS = false;
-
- if (parentType == Node.ELEMENT_NODE)
- {
- NamedNodeMap nnm = parent.getAttributes();
-
- for (int i = 0; i < nnm.getLength(); i++)
- {
- Node attr = nnm.item(i);
- String aname = attr.getNodeName();
-
- if (aname.charAt(0) == 'x')
- {
- boolean isPrefix = aname.startsWith("xmlns:");
-
- if (aname.equals("xmlns") || isPrefix)
- {
- if (n == parent)
- nHasXMLNS = true;
-
- elementHasXMLNS = true;
- ancestorsHaveXMLNS = true;
-
- String p = isPrefix ? aname.substring(6) : "";
-
- if (p.equals(prefix))
- {
- namespaceOfPrefix = attr.getNodeValue();
-
- break;
- }
- }
- }
- }
- }
-
- if ((Node.ATTRIBUTE_NODE != parentType) && (null == nsInfo)
- && (n != parent))
- {
- nsInfo = elementHasXMLNS
- ? m_NSInfoUnProcWithXMLNS : m_NSInfoUnProcWithoutXMLNS;
-
- m_NSInfos.put(parent, nsInfo);
- }
- }
-
- if (Node.ATTRIBUTE_NODE == parentType)
- {
- parent = getParentOfNode(parent);
- }
- else
- {
- m_candidateNoAncestorXMLNS.addElement(parent);
- m_candidateNoAncestorXMLNS.addElement(nsInfo);
-
- parent = parent.getParentNode();
- }
-
- if (null != parent)
- {
- nsInfo = m_NSInfos.get(parent);
- }
- }
-
- int nCandidates = m_candidateNoAncestorXMLNS.size();
-
- if (nCandidates > 0)
- {
- if ((false == ancestorsHaveXMLNS) && (null == parent))
- {
- for (int i = 0; i < nCandidates; i += 2)
- {
- Object candidateInfo = m_candidateNoAncestorXMLNS.elementAt(i
- + 1);
-
- if (candidateInfo == m_NSInfoUnProcWithoutXMLNS)
- {
- m_NSInfos.put((Node)m_candidateNoAncestorXMLNS.elementAt(i),
- m_NSInfoUnProcNoAncestorXMLNS);
- }
- else if (candidateInfo == m_NSInfoNullWithoutXMLNS)
- {
- m_NSInfos.put((Node)m_candidateNoAncestorXMLNS.elementAt(i),
- m_NSInfoNullNoAncestorXMLNS);
- }
- }
- }
-
- m_candidateNoAncestorXMLNS.removeAllElements();
- }
- }
-
- if (Node.ATTRIBUTE_NODE != ntype)
- {
- if (null == namespaceOfPrefix)
- {
- if (ancestorsHaveXMLNS)
- {
- if (nHasXMLNS)
- m_NSInfos.put(n, m_NSInfoNullWithXMLNS);
- else
- m_NSInfos.put(n, m_NSInfoNullWithoutXMLNS);
- }
- else
- {
- m_NSInfos.put(n, m_NSInfoNullNoAncestorXMLNS);
- }
- }
- else
- {
- m_NSInfos.put(n, new NSInfo(namespaceOfPrefix, nHasXMLNS));
- }
- }
- }
-
- return namespaceOfPrefix;
- }
-
- /**
- * Returns the local name of the given node. If the node's name begins
- * with a namespace prefix, this is the part after the colon; otherwise
- * it's the full node name.
- *
- * @param n the node to be examined.
- *
- * @return String containing the Local Name
- */
- public String getLocalNameOfNode(Node n)
- {
-
- String qname = n.getNodeName();
- int index = qname.indexOf(':');
-
- return (index < 0) ? qname : qname.substring(index + 1);
- }
-
- /**
- * Returns the element name with the namespace prefix (if any) replaced
- * by the Namespace URI it was bound to. This is not a standard
- * representation of a node name, but it allows convenient
- * single-string comparison of the "universal" names of two nodes.
- *
- * @param elem Element to be examined.
- *
- * @return String in the form "namespaceURI:localname" if the node
- * belongs to a namespace, or simply "localname" if it doesn't.
- * @see #getExpandedAttributeName
- */
- public String getExpandedElementName(Element elem)
- {
-
- String namespace = getNamespaceOfNode(elem);
-
- return (null != namespace)
- ? namespace + ":" + getLocalNameOfNode(elem)
- : getLocalNameOfNode(elem);
- }
-
- /**
- * Returns the attribute name with the namespace prefix (if any) replaced
- * by the Namespace URI it was bound to. This is not a standard
- * representation of a node name, but it allows convenient
- * single-string comparison of the "universal" names of two nodes.
- *
- * @param attr Attr to be examined
- *
- * @return String in the form "namespaceURI:localname" if the node
- * belongs to a namespace, or simply "localname" if it doesn't.
- * @see #getExpandedElementName
- */
- public String getExpandedAttributeName(Attr attr)
- {
-
- String namespace = getNamespaceOfNode(attr);
-
- return (null != namespace)
- ? namespace + ":" + getLocalNameOfNode(attr)
- : getLocalNameOfNode(attr);
- }
-
- //==========================================================
- // SECTION: DOM Helper Functions
- //==========================================================
-
- /**
- * Tell if the node is ignorable whitespace. Note that this can
- * be determined only in the context of a DTD or other Schema,
- * and that DOM Level 2 has nostandardized DOM API which can
- * return that information.
- * @deprecated
- *
- * @param node Node to be examined
- *
- * @return CURRENTLY HARDCODED TO FALSE, but should return true if
- * and only if the node is of type Text, contains only whitespace,
- * and does not appear as part of the #PCDATA content of an element.
- * (Note that determining this last may require allowing for
- * Entity References.)
- */
- public boolean isIgnorableWhitespace(Text node)
- {
-
- boolean isIgnorable = false; // return value
-
- // TODO: I can probably do something to figure out if this
- // space is ignorable from just the information in
- // the DOM tree.
- // -- You need to be able to distinguish whitespace
- // that is #PCDATA from whitespace that isn't. That requires
- // DTD support, which won't be standardized until DOM Level 3.
- return isIgnorable;
- }
-
- /**
- * Get the first unparented node in the ancestor chain.
- * @deprecated
- *
- * @param node Starting node, to specify which chain to chase
- *
- * @return the topmost ancestor.
- */
- public Node getRoot(Node node)
- {
-
- Node root = null;
-
- while (node != null)
- {
- root = node;
- node = getParentOfNode(node);
- }
-
- return root;
- }
-
- /**
- * Get the root node of the document tree, regardless of
- * whether or not the node passed in is a document node.
- *
- * TODO: This doesn't handle DocumentFragments or "orphaned" subtrees
- * -- it's currently returning ownerDocument even when the tree is
- * not actually part of the main Document tree. We should either
- * rewrite the description to say that it finds the Document node,
- * or change the code to walk up the ancestor chain.
-
- *
- * @param n Node to be examined
- *
- * @return the Document node. Note that this is not the correct answer
- * if n was (or was a child of) a DocumentFragment or an orphaned node,
- * as can arise if the DOM has been edited rather than being generated
- * by a parser.
- */
- public Node getRootNode(Node n)
- {
- int nt = n.getNodeType();
- return ( (Node.DOCUMENT_NODE == nt) || (Node.DOCUMENT_FRAGMENT_NODE == nt) )
- ? n : n.getOwnerDocument();
- }
-
- /**
- * Test whether the given node is a namespace decl node. In DOM Level 2
- * this can be done in a namespace-aware manner, but in Level 1 DOMs
- * it has to be done by testing the node name.
- *
- * @param n Node to be examined.
- *
- * @return boolean -- true iff the node is an Attr whose name is
- * "xmlns" or has the "xmlns:" prefix.
- */
- public boolean isNamespaceNode(Node n)
- {
-
- if (Node.ATTRIBUTE_NODE == n.getNodeType())
- {
- String attrName = n.getNodeName();
-
- return (attrName.startsWith("xmlns:") || attrName.equals("xmlns"));
- }
-
- return false;
- }
-
- /**
- * Obtain the XPath-model parent of a DOM node -- ownerElement for Attrs,
- * parent for other nodes.
- *
- * Background: The DOM believes that you must be your Parent's
- * Child, and thus Attrs don't have parents. XPath said that Attrs
- * do have their owning Element as their parent. This function
- * bridges the difference, either by using the DOM Level 2 ownerElement
- * function or by using a "silly and expensive function" in Level 1
- * DOMs.
- *
- * (There's some discussion of future DOMs generalizing ownerElement
- * into ownerNode and making it work on all types of nodes. This
- * still wouldn't help the users of Level 1 or Level 2 DOMs)
- *
- *
- * @param node Node whose XPath parent we want to obtain
- *
- * @return the parent of the node, or the ownerElement if it's an
- * Attr node, or null if the node is an orphan.
- *
- * @throws RuntimeException if the Document has no root element.
- * This can't arise if the Document was created
- * via the DOM Level 2 factory methods, but is possible if other
- * mechanisms were used to obtain it
- */
- public static Node getParentOfNode(Node node) throws RuntimeException
- {
- Node parent;
- short nodeType = node.getNodeType();
-
- if (Node.ATTRIBUTE_NODE == nodeType)
- {
- Document doc = node.getOwnerDocument();
- /*
- TBD:
- if(null == doc)
- {
- throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_CHILD_HAS_NO_OWNER_DOCUMENT, null));//"Attribute child does not have an owner document!");
- }
- */
-
- // Given how expensive the tree walk may be, we should first ask
- // whether this DOM can answer the question for us. The additional
- // test does slow down Level 1 DOMs slightly. DOMHelper2, which
- // is currently specialized for Xerces, assumes it can use the
- // Level 2 solution. We might want to have an intermediate stage,
- // which would assume DOM Level 2 but not assume Xerces.
- //
- // (Shouldn't have to check whether impl is null in a compliant DOM,
- // but let's be paranoid for a moment...)
- DOMImplementation impl=doc.getImplementation();
- if(impl!=null && impl.hasFeature("Core","2.0"))
- {
- parent=((Attr)node).getOwnerElement();
- return parent;
- }
-
- // DOM Level 1 solution, as fallback. Hugely expensive.
-
- Element rootElem = doc.getDocumentElement();
-
- if (null == rootElem)
- {
- throw new RuntimeException(
- XMLMessages.createXMLMessage(
- XMLErrorResources.ER_CHILD_HAS_NO_OWNER_DOCUMENT_ELEMENT,
- null)); //"Attribute child does not have an owner document element!");
- }
-
- parent = locateAttrParent(rootElem, node);
-
- }
- else
- {
- parent = node.getParentNode();
-
- // if((Node.DOCUMENT_NODE != nodeType) && (null == parent))
- // {
- // throw new RuntimeException("Child does not have parent!");
- // }
- }
-
- return parent;
- }
-
- /**
- * Given an ID, return the element. This can work only if the document
- * is interpreted in the context of a DTD or Schema, since otherwise
- * we don't know which attributes are or aren't IDs.
- *
- * Note that DOM Level 1 had no ability to retrieve this information.
- * DOM Level 2 introduced it but does not promise that it will be
- * supported in all DOMs; those which can't support it will always
- * return null.
- *
- * TODO: getElementByID is currently unimplemented. Support DOM Level 2?
- *
- * @param id The unique identifier to be searched for.
- * @param doc The document to search within.
- * @return CURRENTLY HARDCODED TO NULL, but it should be:
- * The node which has this unique identifier, or null if there
- * is no such node or this DOM can't reliably recognize it.
- */
- public Element getElementByID(String id, Document doc)
- {
- return null;
- }
-
- /**
- * The getUnparsedEntityURI function returns the URI of the unparsed
- * entity with the specified name in the same document as the context
- * node (see [3.3 Unparsed Entities]). It returns the empty string if
- * there is no such entity.
- *
- * XML processors may choose to use the System Identifier (if one
- * is provided) to resolve the entity, rather than the URI in the
- * Public Identifier. The details are dependent on the processor, and
- * we would have to support some form of plug-in resolver to handle
- * this properly. Currently, we simply return the System Identifier if
- * present, and hope that it a usable URI or that our caller can
- * map it to one.
- * TODO: Resolve Public Identifiers... or consider changing function name.
- *
- * If we find a relative URI
- * reference, XML expects it to be resolved in terms of the base URI
- * of the document. The DOM doesn't do that for us, and it isn't
- * entirely clear whether that should be done here; currently that's
- * pushed up to a higher levelof our application. (Note that DOM Level
- * 1 didn't store the document's base URI.)
- * TODO: Consider resolving Relative URIs.
- *
- * (The DOM's statement that "An XML processor may choose to
- * completely expand entities before the structure model is passed
- * to the DOM" refers only to parsed entities, not unparsed, and hence
- * doesn't affect this function.)
- *
- * @param name A string containing the Entity Name of the unparsed
- * entity.
- * @param doc Document node for the document to be searched.
- *
- * @return String containing the URI of the Unparsed Entity, or an
- * empty string if no such entity exists.
- */
- public String getUnparsedEntityURI(String name, Document doc)
- {
-
- String url = "";
- DocumentType doctype = doc.getDoctype();
-
- if (null != doctype)
- {
- NamedNodeMap entities = doctype.getEntities();
- if(null == entities)
- return url;
- Entity entity = (Entity) entities.getNamedItem(name);
- if(null == entity)
- return url;
-
- String notationName = entity.getNotationName();
-
- if (null != notationName) // then it's unparsed
- {
- // The draft says: "The XSLT processor may use the public
- // identifier to generate a URI for the entity instead of the URI
- // specified in the system identifier. If the XSLT processor does
- // not use the public identifier to generate the URI, it must use
- // the system identifier; if the system identifier is a relative
- // URI, it must be resolved into an absolute URI using the URI of
- // the resource containing the entity declaration as the base
- // URI [RFC2396]."
- // So I'm falling a bit short here.
- url = entity.getSystemId();
-
- if (null == url)
- {
- url = entity.getPublicId();
- }
- else
- {
- // This should be resolved to an absolute URL, but that's hard
- // to do from here.
- }
- }
- }
-
- return url;
- }
-
- /**
- * Support for getParentOfNode; walks a DOM tree until it finds
- * the Element which owns the Attr. This is hugely expensive, and
- * if at all possible you should use the DOM Level 2 Attr.ownerElement()
- * method instead.
- *
- * The DOM Level 1 developers expected that folks would keep track
- * of the last Element they'd seen and could recover the info from
- * that source. Obviously that doesn't work very well if the only
- * information you've been presented with is the Attr. The DOM Level 2
- * getOwnerElement() method fixes that, but only for Level 2 and
- * later DOMs.
- *
- * @param elem Element whose subtree is to be searched for this Attr
- * @param attr Attr whose owner is to be located.
- *
- * @return the first Element whose attribute list includes the provided
- * attr. In modern DOMs, this will also be the only such Element. (Early
- * DOMs had some hope that Attrs might be sharable, but this idea has
- * been abandoned.)
- */
- private static Node locateAttrParent(Element elem, Node attr)
- {
-
- Node parent = null;
-
- // This should only be called for Level 1 DOMs, so we don't have to
- // worry about namespace issues. In later levels, it's possible
- // for a DOM to have two Attrs with the same NodeName but
- // different namespaces, and we'd need to get getAttributeNodeNS...
- // but later levels also have Attr.getOwnerElement.
- Attr check=elem.getAttributeNode(attr.getNodeName());
- if(check==attr)
- parent = elem;
-
- if (null == parent)
- {
- for (Node node = elem.getFirstChild(); null != node;
- node = node.getNextSibling())
- {
- if (Node.ELEMENT_NODE == node.getNodeType())
- {
- parent = locateAttrParent((Element) node, attr);
-
- if (null != parent)
- break;
- }
- }
- }
-
- return parent;
- }
-
- /**
- * The factory object used for creating nodes
- * in the result tree.
- */
- protected Document m_DOMFactory = null;
-
- /**
- * Store the factory object required to create DOM nodes
- * in the result tree. In fact, that's just the result tree's
- * Document node...
- *
- * @param domFactory The DOM Document Node within whose context
- * the result tree will be built.
- */
- public void setDOMFactory(Document domFactory)
- {
- this.m_DOMFactory = domFactory;
- }
-
- /**
- * Retrieve the factory object required to create DOM nodes
- * in the result tree.
- *
- * @return The result tree's DOM Document Node.
- */
- public Document getDOMFactory()
- {
-
- if (null == this.m_DOMFactory)
- {
- this.m_DOMFactory = createDocument();
- }
-
- return this.m_DOMFactory;
- }
-
- /**
- * Get the textual contents of the node. See
- * getNodeData(Node,FastStringBuffer) for discussion of how
- * whitespace nodes are handled.
- *
- * @param node DOM Node to be examined
- * @return String containing a concatenation of all the
- * textual content within that node.
- * @see #getNodeData(Node,FastStringBuffer)
- *
- */
- public static String getNodeData(Node node)
- {
-
- FastStringBuffer buf = StringBufferPool.get();
- String s;
-
- try
- {
- getNodeData(node, buf);
-
- s = (buf.length() > 0) ? buf.toString() : "";
- }
- finally
- {
- StringBufferPool.free(buf);
- }
-
- return s;
- }
-
- /**
- * Retrieve the text content of a DOM subtree, appending it into a
- * user-supplied FastStringBuffer object. Note that attributes are
- * not considered part of the content of an element.
- *
- * There are open questions regarding whitespace stripping.
- * Currently we make no special effort in that regard, since the standard
- * DOM doesn't yet provide DTD-based information to distinguish
- * whitespace-in-element-context from genuine #PCDATA. Note that we
- * should probably also consider xml:space if/when we address this.
- * DOM Level 3 may solve the problem for us.
- *
- * @param node Node whose subtree is to be walked, gathering the
- * contents of all Text or CDATASection nodes.
- * @param buf FastStringBuffer into which the contents of the text
- * nodes are to be concatenated.
- */
- public static void getNodeData(Node node, FastStringBuffer buf)
- {
-
- switch (node.getNodeType())
- {
- case Node.DOCUMENT_FRAGMENT_NODE :
- case Node.DOCUMENT_NODE :
- case Node.ELEMENT_NODE :
- {
- for (Node child = node.getFirstChild(); null != child;
- child = child.getNextSibling())
- {
- getNodeData(child, buf);
- }
- }
- break;
- case Node.TEXT_NODE :
- case Node.CDATA_SECTION_NODE :
- buf.append(node.getNodeValue());
- break;
- case Node.ATTRIBUTE_NODE :
- buf.append(node.getNodeValue());
- break;
- case Node.PROCESSING_INSTRUCTION_NODE :
- // warning(XPATHErrorResources.WG_PARSING_AND_PREPARING);
- break;
- default :
- // ignore
- break;
- }
- }
-}
diff -r ea7475564d07 -r ca0e16b2d5d6 jaxp/src/java.xml/share/classes/com/sun/org/apache/xml/internal/utils/DOMOrder.java
--- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xml/internal/utils/DOMOrder.java Thu Jun 15 13:44:42 2017 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,42 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xml.internal.utils;
-
-/**
- * @deprecated Since the introduction of the DTM, this class will be removed.
- * Nodes that implement this index can return a document order index.
- * Eventually, this will be replaced by DOM 3 methods.
- * (compareDocumentOrder and/or compareTreePosition.)
- */
-public interface DOMOrder
-{
-
- /**
- * Get the UID (document order index).
- *
- * @return integer whose relative value corresponds to document order
- * -- that is, if node1.getUid() excludes = Arrays.asList(
+ "deploy.jar",
+ "javaws.jar",
+ "plugin.jar",
+ "cldrdata.jar",
+ "localedata.jar"
+ );
+ private static void usage() {
+ System.out.println("ListPackages [-o ] [-jdkinternals] []*");
+ }
+
+ private static final Set EXPORTED_PACKAGES = new HashSet<>();
+
+ public static void main(String... args) throws IOException {
+ List paths = new ArrayList<>();
+ Path outFile = null;
+ boolean jdkinternals = false;
+ int i=0;
+ while (i < args.length) {
+ String arg = args[i++];
+ if (arg.equals("-o")) {
+ outFile = Paths.get(args[i++]);
+ } else if (arg.equals("-jdkinternals")) {
+ jdkinternals = true;
+ } else {
+ Path p = Paths.get(arg);
+ if (Files.notExists(p))
+ throw new IllegalArgumentException(p + " not exist");
+ paths.add(p);
+ }
+ }
+ if (paths.isEmpty()) {
+ usage();
+ System.exit(1);
+ }
+
+ // Get the exported APIs from the current JDK releases
+ Path javaHome = Paths.get(System.getProperty("java.home"));
+ ModuleFinder.ofSystem().findAll()
+ .stream()
+ .map(ModuleReference::descriptor)
+ .filter(md -> !md.name().equals("jdk.unsupported"))
+ .flatMap(md -> md.exports().stream())
+ .filter(exp -> !exp.isQualified())
+ .map(ModuleDescriptor.Exports::source)
+ .forEach(EXPORTED_PACKAGES::add);
+
+ ListPackages listPackages = new ListPackages(paths);
+ Stream pkgs = listPackages.packages().stream();
+ if (jdkinternals) {
+ pkgs = pkgs.filter(pn -> !EXPORTED_PACKAGES.contains(pn));
+ }
+ if (outFile != null) {
+ try (OutputStream out = Files.newOutputStream(outFile);
+ PrintStream pw = new PrintStream(out)) {
+ write(pw, pkgs);
+ }
+ } else {
+ write(System.out, pkgs);
+ }
+ }
+
+
+ private static void write(PrintStream pw, Stream packages) {
+ pw.println("# This file is auto-generated by ListPackages tool on " +
+ LocalDateTime.now().toString());
+ packages.sorted().forEach(pw::println);
+ }
+
+ private final Set packages = new HashSet<>();
+ ListPackages(List dirs) throws IOException {
+ for (Path p : dirs) {
+ packages.addAll(list(p));
+ }
+ }
+
+ Set packages() {
+ return packages;
+ }
+
+ private Set list(Path javaHome) throws IOException {
+ Path jrt = javaHome.resolve("lib").resolve("modules");
+ Path jre = javaHome.resolve("jre");
+
+ if (Files.exists(jrt)) {
+ return listModularRuntime(javaHome);
+ } else if (Files.exists(jre.resolve("lib").resolve("rt.jar"))) {
+ return listLegacyRuntime(javaHome);
+ }
+ throw new IllegalArgumentException("invalid " + javaHome);
+ }
+
+ private Set listModularRuntime(Path javaHome) throws IOException {
+ Map env = new HashMap<>();
+ env.put("java.home", javaHome.toString());
+ FileSystem fs = FileSystems.newFileSystem(URI.create("jrt:/"), env);
+ Path root = fs.getPath("packages");
+ return Files.walk(root, 1)
+ .map(Path::getFileName)
+ .map(Path::toString)
+ .collect(Collectors.toSet());
+ }
+
+ private Set listLegacyRuntime(Path javaHome) throws IOException {
+ List dirs = new ArrayList<>();
+ Path jre = javaHome.resolve("jre");
+ Path lib = javaHome.resolve("lib");
+
+ dirs.add(jre.resolve("lib"));
+ dirs.add(jre.resolve("lib").resolve("ext"));
+ dirs.add(lib.resolve("tools.jar"));
+ dirs.add(lib.resolve("jconsole.jar"));
+ Set packages = new HashSet<>();
+ for (Path d : dirs) {
+ Files.find(d, 1, (Path p, BasicFileAttributes attr)
+ -> p.getFileName().toString().endsWith(".jar") &&
+ !excludes.contains(p.getFileName().toString()))
+ .map(ListPackages::walkJarFile)
+ .forEach(packages::addAll);
+ }
+ return packages;
+ }
+
+ static Set walkJarFile(Path jarfile) {
+ try (JarFile jf = new JarFile(jarfile.toFile())) {
+ return jf.stream()
+ .map(JarEntry::getName)
+ .filter(n -> n.endsWith(".class"))
+ .map(ListPackages::toPackage)
+ .collect(Collectors.toSet());
+ } catch (IOException e) {
+ throw new UncheckedIOException(e);
+ }
+ }
+
+ static String toPackage(String name) {
+ int i = name.lastIndexOf('/');
+ if (i < 0) {
+ System.err.format("Warning: unnamed package %s%n", name);
+ }
+ return i >= 0 ? name.substring(0, i).replace("/", ".") : "";
+ }
+}
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/lang/RuntimePermission.java
--- a/jdk/src/java.base/share/classes/java/lang/RuntimePermission.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/lang/RuntimePermission.java Wed Jul 05 23:40:06 2017 +0200
@@ -403,6 +403,7 @@
*
* @author Marianne Mueller
* @author Roland Schemers
+ * @since 1.2
*/
public final class RuntimePermission extends BasicPermission {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/lang/invoke/LambdaForm.java
--- a/jdk/src/java.base/share/classes/java/lang/invoke/LambdaForm.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/lang/invoke/LambdaForm.java Wed Jul 05 23:40:06 2017 +0200
@@ -1092,13 +1092,24 @@
final MemberName member;
private @Stable MethodHandle resolvedHandle;
@Stable MethodHandle invoker;
+ private final MethodHandleImpl.Intrinsic intrinsicName;
NamedFunction(MethodHandle resolvedHandle) {
- this(resolvedHandle.internalMemberName(), resolvedHandle);
+ this(resolvedHandle.internalMemberName(), resolvedHandle, MethodHandleImpl.Intrinsic.NONE);
+ }
+ NamedFunction(MethodHandle resolvedHandle, MethodHandleImpl.Intrinsic intrinsic) {
+ this(resolvedHandle.internalMemberName(), resolvedHandle, intrinsic);
}
NamedFunction(MemberName member, MethodHandle resolvedHandle) {
+ this(member, resolvedHandle, MethodHandleImpl.Intrinsic.NONE);
+ }
+ NamedFunction(MemberName member, MethodHandle resolvedHandle, MethodHandleImpl.Intrinsic intrinsic) {
this.member = member;
this.resolvedHandle = resolvedHandle;
+ this.intrinsicName = intrinsic;
+ assert(resolvedHandle == null ||
+ resolvedHandle.intrinsicName() == MethodHandleImpl.Intrinsic.NONE ||
+ resolvedHandle.intrinsicName() == intrinsic) : resolvedHandle.intrinsicName() + " != " + intrinsic;
// The following assert is almost always correct, but will fail for corner cases, such as PrivateInvokeTest.
//assert(!isInvokeBasic(member));
}
@@ -1111,6 +1122,7 @@
// necessary to pass BigArityTest
this.member = Invokers.invokeBasicMethod(basicInvokerType);
}
+ this.intrinsicName = MethodHandleImpl.Intrinsic.NONE;
assert(isInvokeBasic(member));
}
@@ -1263,8 +1275,7 @@
}
public MethodHandleImpl.Intrinsic intrinsicName() {
- return resolvedHandle == null ? MethodHandleImpl.Intrinsic.NONE
- : resolvedHandle.intrinsicName();
+ return intrinsicName;
}
}
@@ -1741,15 +1752,15 @@
Name[] idNames = new Name[] { argument(0, L_TYPE), argument(1, type) };
idForm = new LambdaForm(2, idNames, 1, Kind.IDENTITY);
idForm.compileToBytecode();
- idFun = new NamedFunction(idMem, MethodHandleImpl.makeIntrinsic(
- idMem.getInvocationType(), idForm, MethodHandleImpl.Intrinsic.IDENTITY));
+ idFun = new NamedFunction(idMem, SimpleMethodHandle.make(idMem.getInvocationType(), idForm),
+ MethodHandleImpl.Intrinsic.IDENTITY);
Object zeValue = Wrapper.forBasicType(btChar).zero();
Name[] zeNames = new Name[] { argument(0, L_TYPE), new Name(idFun, zeValue) };
zeForm = new LambdaForm(1, zeNames, 1, Kind.ZERO);
zeForm.compileToBytecode();
- zeFun = new NamedFunction(zeMem, MethodHandleImpl.makeIntrinsic(
- zeMem.getInvocationType(), zeForm, MethodHandleImpl.Intrinsic.ZERO));
+ zeFun = new NamedFunction(zeMem, SimpleMethodHandle.make(zeMem.getInvocationType(), zeForm),
+ MethodHandleImpl.Intrinsic.ZERO);
}
LF_zero[ord] = zeForm;
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/lang/invoke/LambdaFormEditor.java
--- a/jdk/src/java.base/share/classes/java/lang/invoke/LambdaFormEditor.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/lang/invoke/LambdaFormEditor.java Wed Jul 05 23:40:06 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -541,7 +541,7 @@
// adjust the arguments
MethodHandle aload = MethodHandles.arrayElementGetter(erasedArrayType);
for (int i = 0; i < arrayLength; i++) {
- Name loadArgument = new Name(aload, spreadParam, i);
+ Name loadArgument = new Name(new NamedFunction(aload, Intrinsic.ARRAY_LOAD), spreadParam, i);
buf.insertExpression(exprPos + i, loadArgument);
buf.replaceParameterByCopy(pos + i, exprPos + i);
}
@@ -604,7 +604,8 @@
for (int i = 0; i < collectorArity; i++) {
newParams[i] = new Name(pos + i, argType);
}
- Name callCombiner = new Name(arrayCollector, (Object[]) /*...*/ newParams);
+ Name callCombiner = new Name(new NamedFunction(arrayCollector, Intrinsic.NEW_ARRAY),
+ (Object[]) /*...*/ newParams);
// insert the new expression
int exprPos = lambdaForm.arity();
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/lang/invoke/MethodHandleImpl.java
--- a/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandleImpl.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandleImpl.java Wed Jul 05 23:40:06 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -592,7 +592,7 @@
names[nameCursor++] = new Name(getFunction(NF_checkSpreadArgument), array, spreadArgCount);
for (int j = 0; j < spreadArgCount; i++, j++) {
indexes[i] = nameCursor;
- names[nameCursor++] = new Name(aload, array, j);
+ names[nameCursor++] = new Name(new NamedFunction(aload, Intrinsic.ARRAY_LOAD), array, j);
}
} else if (i < indexes.length) {
indexes[i] = argIndex;
@@ -937,7 +937,7 @@
names[PROFILE] = new Name(getFunction(NF_profileBoolean), names[CALL_TEST], names[GET_COUNTERS]);
}
// call selectAlternative
- names[SELECT_ALT] = new Name(getConstantHandle(MH_selectAlternative), names[TEST], names[GET_TARGET], names[GET_FALLBACK]);
+ names[SELECT_ALT] = new Name(new NamedFunction(getConstantHandle(MH_selectAlternative), Intrinsic.SELECT_ALTERNATIVE), names[TEST], names[GET_TARGET], names[GET_FALLBACK]);
// call target or fallback
invokeArgs[0] = names[SELECT_ALT];
@@ -1008,7 +1008,7 @@
Object[] args = new Object[invokeBasic.type().parameterCount()];
args[0] = names[GET_COLLECT_ARGS];
System.arraycopy(names, ARG_BASE, args, 1, ARG_LIMIT-ARG_BASE);
- names[BOXED_ARGS] = new Name(makeIntrinsic(invokeBasic, Intrinsic.GUARD_WITH_CATCH), args);
+ names[BOXED_ARGS] = new Name(new NamedFunction(invokeBasic, Intrinsic.GUARD_WITH_CATCH), args);
// t_{i+1}:L=MethodHandleImpl.guardWithCatch(target:L,exType:L,catcher:L,t_{i}:L);
Object[] gwcArgs = new Object[] {names[GET_TARGET], names[GET_CLASS], names[GET_CATCHER], names[BOXED_ARGS]};
@@ -1896,7 +1896,7 @@
Object[] args = new Object[invokeBasic.type().parameterCount()];
args[0] = names[GET_COLLECT_ARGS];
System.arraycopy(names, ARG_BASE, args, 1, ARG_LIMIT - ARG_BASE);
- names[BOXED_ARGS] = new Name(makeIntrinsic(invokeBasic, Intrinsic.LOOP), args);
+ names[BOXED_ARGS] = new Name(new NamedFunction(invokeBasic, Intrinsic.LOOP), args);
// t_{i+1}:L=MethodHandleImpl.loop(localTypes:L,clauses:L,t_{i}:L);
Object[] lArgs =
@@ -2133,7 +2133,7 @@
Object[] args = new Object[invokeBasic.type().parameterCount()];
args[0] = names[GET_COLLECT_ARGS];
System.arraycopy(names, ARG_BASE, args, 1, ARG_LIMIT-ARG_BASE);
- names[BOXED_ARGS] = new Name(makeIntrinsic(invokeBasic, Intrinsic.TRY_FINALLY), args);
+ names[BOXED_ARGS] = new Name(new NamedFunction(invokeBasic, Intrinsic.TRY_FINALLY), args);
// t_{i+1}:L=MethodHandleImpl.tryFinally(target:L,exType:L,catcher:L,t_{i}:L);
Object[] tfArgs = new Object[] {names[GET_TARGET], names[GET_CLEANUP], names[BOXED_ARGS]};
@@ -2225,9 +2225,8 @@
return IMPL_LOOKUP.findStatic(MethodHandleImpl.class, "fillNewTypedArray",
MethodType.methodType(Object[].class, Object[].class, Integer.class, Object[].class));
case MH_selectAlternative:
- return makeIntrinsic(IMPL_LOOKUP.findStatic(MethodHandleImpl.class, "selectAlternative",
- MethodType.methodType(MethodHandle.class, boolean.class, MethodHandle.class, MethodHandle.class)),
- Intrinsic.SELECT_ALTERNATIVE);
+ return IMPL_LOOKUP.findStatic(MethodHandleImpl.class, "selectAlternative",
+ MethodType.methodType(MethodHandle.class, boolean.class, MethodHandle.class, MethodHandle.class));
case MH_countedLoopPred:
return IMPL_LOOKUP.findStatic(MethodHandleImpl.class, "countedLoopPredicate",
MethodType.methodType(boolean.class, int.class, int.class));
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/lang/invoke/package-info.java
--- a/jdk/src/java.base/share/classes/java/lang/invoke/package-info.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/lang/invoke/package-info.java Wed Jul 05 23:40:06 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -44,13 +44,13 @@
*
*
*
- * Summary of relevant Java Virtual Machine changes
+ * Summary of relevant Java Virtual Machine changes
* The following low-level information summarizes relevant parts of the
* Java Virtual Machine specification. For full details, please see the
* current version of that specification.
*
* Each occurrence of an {@code invokedynamic} instruction is called a dynamic call site.
- * {@code invokedynamic} instructions
+ * {@code invokedynamic} instructions
* A dynamic call site is originally in an unlinked state. In this state, there is
* no target method for the call site to invoke.
*
@@ -77,7 +77,8 @@
*
* The bootstrap method is invoked on at least three values:
*
- * - a {@code MethodHandles.Lookup}, a lookup object on the caller class in which dynamic call site occurs
+ * - a {@code MethodHandles.Lookup}, a lookup object on the caller class
+ * in which dynamic call site occurs
* - a {@code String}, the method name mentioned in the call site
* - a {@code MethodType}, the resolved type descriptor of the call
* - optionally, between 1 and 251 additional static arguments taken from the constant pool
@@ -165,17 +166,27 @@
* Given these rules, here are examples of legal bootstrap method declarations,
* given various numbers {@code N} of extra arguments.
* The first rows (marked {@code *}) will work for any number of extra arguments.
- *
- * N | sample bootstrap method |
- * * | CallSite bootstrap(Lookup caller, String name, MethodType type, Object... args) |
- * * | CallSite bootstrap(Object... args) |
- * * | CallSite bootstrap(Object caller, Object... nameAndTypeWithArgs) |
- * 0 | CallSite bootstrap(Lookup caller, String name, MethodType type) |
- * 0 | CallSite bootstrap(Lookup caller, Object... nameAndType) |
- * 1 | CallSite bootstrap(Lookup caller, String name, MethodType type, Object arg) |
- * 2 | CallSite bootstrap(Lookup caller, String name, MethodType type, Object... args) |
- * 2 | CallSite bootstrap(Lookup caller, String name, MethodType type, String... args) |
- * 2 | CallSite bootstrap(Lookup caller, String name, MethodType type, String x, int y) |
+ *
+ * Static argument types
+ * N | Sample bootstrap method |
+ * * |
+ * CallSite bootstrap(Lookup caller, String name, MethodType type, Object... args) |
+ * * |
+ * CallSite bootstrap(Object... args) |
+ * * |
+ * CallSite bootstrap(Object caller, Object... nameAndTypeWithArgs) |
+ * 0 |
+ * CallSite bootstrap(Lookup caller, String name, MethodType type) |
+ * 0 |
+ * CallSite bootstrap(Lookup caller, Object... nameAndType) |
+ * 1 |
+ * CallSite bootstrap(Lookup caller, String name, MethodType type, Object arg) |
+ * 2 |
+ * CallSite bootstrap(Lookup caller, String name, MethodType type, Object... args) |
+ * 2 |
+ * CallSite bootstrap(Lookup caller, String name, MethodType type, String... args) |
+ * 2 |
+ * CallSite bootstrap(Lookup caller, String name, MethodType type, String x, int y) |
*
* The last example assumes that the extra arguments are of type
* {@code CONSTANT_String} and {@code CONSTANT_Integer}, respectively.
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/lang/module/package-info.java
--- a/jdk/src/java.base/share/classes/java/lang/module/package-info.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/lang/module/package-info.java Wed Jul 05 23:40:06 2017 +0200
@@ -27,7 +27,7 @@
* Classes to support module descriptors and creating configurations of modules
* by means of resolution and service binding.
*
- *
+ *
*
* Resolution is the process of computing the transitive closure of a set
* of root modules over a set of observable modules by resolving the
@@ -97,7 +97,7 @@
* resolved so that it reads all other modules in the resulting configuration and
* all modules in parent configurations.
*
- *
+ *
*
* Service binding is the process of augmenting a graph of resolved modules
* from the set of observable modules induced by the service-use dependence
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/lang/package-info.java
--- a/jdk/src/java.base/share/classes/java/lang/package-info.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/lang/package-info.java Wed Jul 05 23:40:06 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
* 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,7 +57,7 @@
* by the {@code throw} statement. Subclasses of {@code Throwable}
* represent errors and exceptions.
*
- *
+ *
*
Character Encodings
*
* The specification of the {@link java.nio.charset.Charset
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/lang/reflect/Array.java
--- a/jdk/src/java.base/share/classes/java/lang/reflect/Array.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/lang/reflect/Array.java Wed Jul 05 23:40:06 2017 +0200
@@ -36,6 +36,7 @@
* conversion would occur.
*
* @author Nakul Saraiya
+ * @since 1.1
*/
public final
class Array {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/lang/reflect/Constructor.java
--- a/jdk/src/java.base/share/classes/java/lang/reflect/Constructor.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/lang/reflect/Constructor.java Wed Jul 05 23:40:06 2017 +0200
@@ -59,6 +59,7 @@
*
* @author Kenneth Russell
* @author Nakul Saraiya
+ * @since 1.1
*/
public final class Constructor extends Executable {
private Class clazz;
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/lang/reflect/Field.java
--- a/jdk/src/java.base/share/classes/java/lang/reflect/Field.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/lang/reflect/Field.java Wed Jul 05 23:40:06 2017 +0200
@@ -60,6 +60,7 @@
*
* @author Kenneth Russell
* @author Nakul Saraiya
+ * @since 1.1
*/
public final
class Field extends AccessibleObject implements Member {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/lang/reflect/InvocationTargetException.java
--- a/jdk/src/java.base/share/classes/java/lang/reflect/InvocationTargetException.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/lang/reflect/InvocationTargetException.java Wed Jul 05 23:40:06 2017 +0200
@@ -38,6 +38,7 @@
*
* @see Method
* @see Constructor
+ * @since 1.1
*/
public class InvocationTargetException extends ReflectiveOperationException {
/**
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/lang/reflect/Member.java
--- a/jdk/src/java.base/share/classes/java/lang/reflect/Member.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/lang/reflect/Member.java Wed Jul 05 23:40:06 2017 +0200
@@ -35,6 +35,7 @@
* @see Constructor
*
* @author Nakul Saraiya
+ * @since 1.1
*/
public
interface Member {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/lang/reflect/Method.java
--- a/jdk/src/java.base/share/classes/java/lang/reflect/Method.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/lang/reflect/Method.java Wed Jul 05 23:40:06 2017 +0200
@@ -63,6 +63,7 @@
*
* @author Kenneth Russell
* @author Nakul Saraiya
+ * @since 1.1
*/
public final class Method extends Executable {
private Class> clazz;
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/lang/reflect/Modifier.java
--- a/jdk/src/java.base/share/classes/java/lang/reflect/Modifier.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/lang/reflect/Modifier.java Wed Jul 05 23:40:06 2017 +0200
@@ -43,6 +43,7 @@
*
* @author Nakul Saraiya
* @author Kenneth Russell
+ * @since 1.1
*/
public class Modifier {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/math/BigDecimal.java
--- a/jdk/src/java.base/share/classes/java/math/BigDecimal.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/math/BigDecimal.java Wed Jul 05 23:40:06 2017 +0200
@@ -222,6 +222,7 @@
* @author Mike Cowlishaw
* @author Joseph D. Darcy
* @author Sergey V. Kuksenko
+ * @since 1.1
*/
public class BigDecimal extends Number implements Comparable {
/**
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/net/InetAddress.java
--- a/jdk/src/java.base/share/classes/java/net/InetAddress.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/net/InetAddress.java Wed Jul 05 23:40:06 2017 +0200
@@ -75,7 +75,7 @@
*
* Description of unicast and multicast address types
*
- * unicast |
+ *
---|
unicast |
* An identifier for a single interface. A packet sent to
* a unicast address is delivered to the interface identified by
* that address.
@@ -94,7 +94,7 @@
* IP address loops around and becomes IP input on the local
* host. This address is often used when testing a
* client. |
- * multicast |
+ *
---|
multicast |
* An identifier for a set of interfaces (typically belonging
* to different nodes). A packet sent to a multicast address is
* delivered to all interfaces identified by that address. |
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/net/NetPermission.java
--- a/jdk/src/java.base/share/classes/java/net/NetPermission.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/net/NetPermission.java Wed Jul 05 23:40:06 2017 +0200
@@ -167,6 +167,7 @@
*
* @author Marianne Mueller
* @author Roland Schemers
+ * @since 1.2
*/
public final class NetPermission extends BasicPermission {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/net/SocketOptions.java
--- a/jdk/src/java.base/share/classes/java/net/SocketOptions.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/net/SocketOptions.java Wed Jul 05 23:40:06 2017 +0200
@@ -40,6 +40,7 @@
* DatagramSocket and MulticastSocket.
*
* @author David Brown
+ * @since 1.1
*/
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/net/SocketPermission.java
--- a/jdk/src/java.base/share/classes/java/net/SocketPermission.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/net/SocketPermission.java Wed Jul 05 23:40:06 2017 +0200
@@ -142,6 +142,7 @@
*
* @author Marianne Mueller
* @author Roland Schemers
+ * @since 1.2
*
* @serial exclude
*/
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/net/URI.java
--- a/jdk/src/java.base/share/classes/java/net/URI.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/net/URI.java Wed Jul 05 23:40:06 2017 +0200
@@ -253,32 +253,32 @@
* which are taken from that specification, are used below to describe these
* constraints:
*
- *
+ *
* Describes categories alpha,digit,alphanum,unreserved,punct,reserved,escaped,and other
*
- * alpha |
+ *
---|
alpha |
* The US-ASCII alphabetic characters,
* {@code 'A'} through {@code 'Z'}
* and {@code 'a'} through {@code 'z'} |
- * digit |
+ *
---|
digit |
* The US-ASCII decimal digit characters,
* {@code '0'} through {@code '9'} |
- * alphanum |
+ *
---|
alphanum |
* All alpha and digit characters |
- * unreserved |
+ *
---|
unreserved |
* All alphanum characters together with those in the string
* {@code "_-!.~'()*"} |
- * punct |
+ *
---|
punct |
* The characters in the string {@code ",;:$&+="} |
- * reserved |
+ *
---|
reserved |
* All punct characters together with those in the string
* {@code "?/[]@"} |
- * escaped |
+ *
---|
escaped |
* Escaped octets, that is, triplets consisting of the percent
* character ({@code '%'}) followed by two hexadecimal digits
* ({@code '0'}-{@code '9'}, {@code 'A'}-{@code 'F'}, and
* {@code 'a'}-{@code 'f'}) |
- * other |
+ *
---|
other |
* The Unicode characters that are not in the US-ASCII character set,
* are not control characters (according to the {@link
* java.lang.Character#isISOControl(char) Character.isISOControl}
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/net/doc-files/net-properties.html
--- a/jdk/src/java.base/share/classes/java/net/doc-files/net-properties.html Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/net/doc-files/net-properties.html Wed Jul 05 23:40:06 2017 +0200
@@ -1,5 +1,6 @@
+
-
Networking Properties
-Networking Properties
-There are a few standard system properties used to
+ Networking Properties
+There are a few standard system properties used to
alter the mechanisms and behavior of the various classes of the
java.net package. Some are checked only once at startup of the VM,
and therefore are best set using the -D option of the java command,
@@ -39,7 +39,7 @@
The purpose of this document is to list
and detail all of these properties.
If there is no special note, a property value is checked every time it is used.
-
+
IPv4 / IPv6
Both of these properties are checked only once, at startup.
-
+
Proxies
A proxy server allows indirect connection to network services and
is used mainly for security (to get through firewalls) and
@@ -155,7 +155,7 @@
globally through their user interface). Note that this property is
checked only once at startup.
-
+
Misc HTTP properties
All these properties are checked only once at startup.
-
+
Address Cache
The java.net package, when doing name resolution, uses an address
cache for both security and performance reasons. Any address
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/nio/channels/package-info.java
--- a/jdk/src/java.base/share/classes/java/nio/channels/package-info.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/nio/channels/package-info.java Wed Jul 05 23:40:06 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved.
* 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,33 +28,46 @@
* performing I/O operations, such as files and sockets; defines selectors, for
* multiplexed, non-blocking I/O operations.
*
- *
+ *
*
- *
- * Channels | Description |
- * {@link java.nio.channels.Channel} |
+ *
+ * Lists channels and their descriptions
+ * Channels |
+ * Description |
+ * {@link java.nio.channels.Channel} |
* A nexus for I/O operations |
- * {@link java.nio.channels.ReadableByteChannel} |
+ *
+ * {@link java.nio.channels.ReadableByteChannel} |
* Can read into a buffer |
- * {@link java.nio.channels.ScatteringByteChannel} |
+ *
+ * {@link java.nio.channels.ScatteringByteChannel} |
* Can read into a sequence of buffers |
- * {@link java.nio.channels.WritableByteChannel} |
+ *
+ * {@link java.nio.channels.WritableByteChannel} |
* Can write from a buffer |
- * {@link java.nio.channels.GatheringByteChannel} |
+ *
+ * {@link java.nio.channels.GatheringByteChannel} |
* Can write from a sequence of buffers |
- * {@link java.nio.channels.ByteChannel} |
+ *
+ * {@link java.nio.channels.ByteChannel} |
* Can read/write to/from a buffer |
- * {@link java.nio.channels.SeekableByteChannel} |
- * A {@code ByteChannel} connected to an entity that contains a variable-length sequence of bytes |
- * {@link java.nio.channels.AsynchronousChannel} |
+ *
+ * {@link java.nio.channels.SeekableByteChannel} |
+ * A {@code ByteChannel} connected to an entity that contains a variable-length
+ * sequence of bytes |
+ *
+ * {@link java.nio.channels.AsynchronousChannel} |
* Supports asynchronous I/O operations. |
- * {@link java.nio.channels.AsynchronousByteChannel} |
+ *
+ * {@link java.nio.channels.AsynchronousByteChannel} |
* Can read and write bytes asynchronously |
- * {@link java.nio.channels.NetworkChannel} |
+ *
+ * {@link java.nio.channels.NetworkChannel} |
* A channel to a network socket |
- * {@link java.nio.channels.MulticastChannel} |
+ *
+ * {@link java.nio.channels.MulticastChannel} |
* Can join Internet Protocol (IP) multicast groups |
- * {@link java.nio.channels.Channels} |
+ * {@link java.nio.channels.Channels} |
* Utility methods for channel/stream interoperation |
*
*
@@ -109,13 +122,19 @@
* be constructed that uses a given charset to encode characters into bytes and
* write them to a given writable byte channel.
*
- *
- * File channels | Description |
- * {@link java.nio.channels.FileChannel} |
+ *
+ *
+ * Lists file channels and their descriptions
+ * File channels |
+ * Description |
+ *
+ * {@link java.nio.channels.FileChannel} |
* Reads, writes, maps, and manipulates files |
- * {@link java.nio.channels.FileLock} |
+ *
+ * {@link java.nio.channels.FileLock} |
* A lock on a (region of a) file |
- * {@link java.nio.MappedByteBuffer} |
+ *
+ * {@link java.nio.MappedByteBuffer} |
* A direct byte buffer mapped to a region of a file |
*
*
@@ -136,27 +155,35 @@
* file channel connected to the same underlying file as the {@link java.io}
* class.
*
- *
- *
- * Multiplexed, non-blocking I/O | Description |
- * {@link java.nio.channels.SelectableChannel} |
+ *
+ *
+ *
+ * Lists multiplexed, non-blocking channels and their descriptions
+ * Multiplexed, non-blocking I/O |
+ * Description |
+ * {@link java.nio.channels.SelectableChannel} |
* A channel that can be multiplexed |
- * {@link java.nio.channels.DatagramChannel} |
+ *
+ * {@link java.nio.channels.DatagramChannel} |
* A channel to a datagram-oriented socket |
- * {@link java.nio.channels.Pipe.SinkChannel} |
+ *
+ * {@link java.nio.channels.Pipe.SinkChannel} |
* The write end of a pipe |
- * {@link java.nio.channels.Pipe.SourceChannel} |
+ *
+ * {@link java.nio.channels.Pipe.SourceChannel} |
* The read end of a pipe |
- * {@link java.nio.channels.ServerSocketChannel} |
+ *
+ * {@link java.nio.channels.ServerSocketChannel} |
* A channel to a stream-oriented listening socket |
- * {@link java.nio.channels.SocketChannel} |
+ *
+ * {@link java.nio.channels.SocketChannel} |
* A channel for a stream-oriented connecting socket |
- * {@link java.nio.channels.Selector} |
+ * {@link java.nio.channels.Selector} |
* A multiplexor of selectable channels |
- * {@link java.nio.channels.SelectionKey} |
+ * {@link java.nio.channels.SelectionKey} |
* A token representing the registration of a channel
* with a selector |
- * {@link java.nio.channels.Pipe} |
+ * {@link java.nio.channels.Pipe} |
* Two channels that form a unidirectional pipe |
*
*
@@ -222,19 +249,27 @@
* directly; custom channel classes should extend the appropriate {@link
* java.nio.channels.SelectableChannel} subclasses defined in this package.
*
- *
+ *
*
- *
- * Asynchronous I/O | Description |
- * {@link java.nio.channels.AsynchronousFileChannel} |
+ *
+ *
+ * Lists asynchronous channels and their descriptions
+ *
+ * Asynchronous I/O | Description |
+ *
+ * {@link java.nio.channels.AsynchronousFileChannel} |
* An asynchronous channel for reading, writing, and manipulating a file |
- * {@link java.nio.channels.AsynchronousSocketChannel} |
+ *
+ * {@link java.nio.channels.AsynchronousSocketChannel} |
* An asynchronous channel to a stream-oriented connecting socket |
- * {@link java.nio.channels.AsynchronousServerSocketChannel} |
+ *
+ * {@link java.nio.channels.AsynchronousServerSocketChannel} |
* An asynchronous channel to a stream-oriented listening socket |
- * {@link java.nio.channels.CompletionHandler} |
+ *
+ * {@link java.nio.channels.CompletionHandler} |
* A handler for consuming the result of an asynchronous operation |
- * {@link java.nio.channels.AsynchronousChannelGroup} |
+ *
+ * {@link java.nio.channels.AsynchronousChannelGroup} |
* A grouping of asynchronous channels for the purpose of resource sharing |
*
*
@@ -277,7 +312,6 @@
* so that sophisticated users can take advantage of operating-system-specific
* asynchronous I/O mechanisms when very high performance is required.
*
- *
* Unless otherwise noted, passing a {@code null} argument to a constructor
* or method in any class or interface in this package will cause a {@link
* java.lang.NullPointerException NullPointerException} to be thrown.
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/nio/charset/package-info.java
--- a/jdk/src/java.base/share/classes/java/nio/charset/package-info.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/nio/charset/package-info.java Wed Jul 05 23:40:06 2017 +0200
@@ -27,17 +27,19 @@
* Defines charsets, decoders, and encoders, for translating between
* bytes and Unicode characters.
*
- *
- * Class name | Description |
- * {@link java.nio.charset.Charset} |
+ *
+ * Summary of charsets, decoders, and encoders in this package
+ * Class name |
+ * | DescriptiPath
+ * |
---|
{@link java.nio.charset.Charset} |
* A named mapping between characters and bytes |
- * {@link java.nio.charset.CharsetDecoder} |
+ * {@link java.nio.charset.CharsetDecoder} |
* Decodes bytes into characters |
- * {@link java.nio.charset.CharsetEncoder} |
+ * {@link java.nio.charset.CharsetEncoder} |
* Encodes characters into bytes |
- * {@link java.nio.charset.CoderResult} |
+ * {@link java.nio.charset.CoderResult} |
* Describes coder results |
- * {@link java.nio.charset.CodingErrorAction} |
+ * {@link java.nio.charset.CodingErrorAction} |
* Describes actions to take when coding errors are detected |
*
*
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/nio/file/attribute/package-info.java
--- a/jdk/src/java.base/share/classes/java/nio/file/attribute/package-info.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/nio/file/attribute/package-info.java Wed Jul 05 23:40:06 2017 +0200
@@ -26,25 +26,41 @@
/**
* Interfaces and classes providing access to file and file system attributes.
*
- *
- * Attribute views | Description |
- * {@link java.nio.file.attribute.AttributeView} |
+ *
+ * Attribute views
+ * Attribute views |
+ * Description |
+ * {@link java.nio.file.attribute.AttributeView} |
* Can read or update non-opaque values associated with objects in a file system |
- * {@link java.nio.file.attribute.FileAttributeView} |
+ *
+ * {@link java.nio.file.attribute.FileAttributeView} |
* Can read or update file attributes |
- * {@link java.nio.file.attribute.BasicFileAttributeView} |
+ *
+ *
+ * {@link java.nio.file.attribute.BasicFileAttributeView} |
* Can read or update a basic set of file attributes |
- * {@link java.nio.file.attribute.PosixFileAttributeView} |
+ *
+ *
+ * {@link java.nio.file.attribute.PosixFileAttributeView} |
* Can read or update POSIX defined file attributes |
- * {@link java.nio.file.attribute.DosFileAttributeView} |
+ *
+ *
+ * {@link java.nio.file.attribute.DosFileAttributeView} |
* Can read or update FAT file attributes |
- * {@link java.nio.file.attribute.FileOwnerAttributeView} |
+ *
+ *
+ * {@link java.nio.file.attribute.FileOwnerAttributeView} |
* Can read or update the owner of a file |
- * {@link java.nio.file.attribute.AclFileAttributeView} |
+ *
+ *
+ * {@link java.nio.file.attribute.AclFileAttributeView} |
* Can read or update Access Control Lists |
- * {@link java.nio.file.attribute.UserDefinedFileAttributeView} |
+ *
+ *
+ * {@link java.nio.file.attribute.UserDefinedFileAttributeView} |
* Can read or update user-defined file attributes |
- * {@link java.nio.file.attribute.FileStoreAttributeView} |
+ *
+ * {@link java.nio.file.attribute.FileStoreAttributeView} |
* Can read or update file system attributes |
*
*
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/nio/file/package-info.java
--- a/jdk/src/java.base/share/classes/java/nio/file/package-info.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/nio/file/package-info.java Wed Jul 05 23:40:06 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
* 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 is used by service provider implementors wishing to extend the
* platform default provider, or to construct other provider implementations.
*
- *
+ *
* Many operating systems and file systems support for symbolic links.
* A symbolic link is a special file that serves as a reference to another file.
* For the most part, symbolic links are transparent to applications and
@@ -45,7 +45,7 @@
* that are semantically close but support for these other types of links is
* not included in this package.
*
- *
+ *
* The {@link java.io.File} class defines the {@link java.io.File#toPath
* toPath} method to construct a {@link java.nio.file.Path} by converting
* the abstract path represented by the {@code java.io.File} object. The resulting
@@ -65,7 +65,7 @@
* or on some other machine. The exact nature of any such inconsistencies are
* system-dependent and are therefore unspecified.
*
- *
+ *
* The {@link java.nio.file.StandardOpenOption#SYNC SYNC} and {@link
* java.nio.file.StandardOpenOption#DSYNC DSYNC} options are used when opening a file
* to require that updates to the file are written synchronously to the underlying
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/nio/package-info.java
--- a/jdk/src/java.base/share/classes/java/nio/package-info.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/nio/package-info.java Wed Jul 05 23:40:06 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -60,30 +60,33 @@
* the contents of which can be used to extend the platform's default
* implementations or to construct alternative implementations.
*
- *
+ *
*
- *
- * Buffers | Description |
- * {@link java.nio.Buffer} |
+ *
+ * Description of the various buffers
+ * Buffers |
+ * Description |
+ * {@link java.nio.Buffer} |
* Position, limit, and capacity;
* clear, flip, rewind, and mark/reset |
- * {@link java.nio.ByteBuffer} |
+ * {@link java.nio.ByteBuffer} |
* Get/put, compact, views; allocate, wrap |
- * {@link java.nio.MappedByteBuffer} |
+ *
+ * {@link java.nio.MappedByteBuffer} |
* A byte buffer mapped to a file |
- * {@link java.nio.CharBuffer} |
+ * {@link java.nio.CharBuffer} |
* Get/put, compact; allocate, wrap |
- * {@link java.nio.DoubleBuffer} |
+ * {@link java.nio.DoubleBuffer} |
* ' ' |
- * {@link java.nio.FloatBuffer} |
+ * {@link java.nio.FloatBuffer} |
* ' ' |
- * {@link java.nio.IntBuffer} |
+ * {@link java.nio.IntBuffer} |
* ' ' |
- * {@link java.nio.LongBuffer} |
+ * {@link java.nio.LongBuffer} |
* ' ' |
- * {@link java.nio.ShortBuffer} |
+ * {@link java.nio.ShortBuffer} |
* ' ' |
- * {@link java.nio.ByteOrder} |
+ * {@link java.nio.ByteOrder} |
* Typesafe enumeration for byte orders |
*
*
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/security/AccessControlContext.java
--- a/jdk/src/java.base/share/classes/java/security/AccessControlContext.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/security/AccessControlContext.java Wed Jul 05 23:40:06 2017 +0200
@@ -74,6 +74,7 @@
* @see AccessController
*
* @author Roland Schemers
+ * @since 1.2
*/
public final class AccessControlContext {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/security/AccessControlException.java
--- a/jdk/src/java.base/share/classes/java/security/AccessControlException.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/security/AccessControlException.java Wed Jul 05 23:40:06 2017 +0200
@@ -38,6 +38,7 @@
*
* @author Li Gong
* @author Roland Schemers
+ * @since 1.2
*/
public class AccessControlException extends SecurityException {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/security/AccessController.java
--- a/jdk/src/java.base/share/classes/java/security/AccessController.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/security/AccessController.java Wed Jul 05 23:40:06 2017 +0200
@@ -259,6 +259,7 @@
*
* @author Li Gong
* @author Roland Schemers
+ * @since 1.2
*/
public final class AccessController {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/security/AlgorithmParameterGenerator.java
--- a/jdk/src/java.base/share/classes/java/security/AlgorithmParameterGenerator.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/security/AlgorithmParameterGenerator.java Wed Jul 05 23:40:06 2017 +0200
@@ -61,11 +61,17 @@
*
*
* In case the client does not explicitly initialize the
- * AlgorithmParameterGenerator
- * (via a call to an {@code init} method), each provider must supply (and
- * document) a default initialization. For example, the Sun provider uses a
- * default modulus prime size of 1024 bits for the generation of DSA
- * parameters.
+ * AlgorithmParameterGenerator (via a call to an {@code init} method),
+ * each provider must supply (and document) a default initialization.
+ * See the Keysize Restriction sections of the
+ *
+ * JDK Providers
+ * document for information on the AlgorithmParameterGenerator defaults
+ * used by JDK providers.
+ * However, note that defaults may vary across different providers.
+ * Additionally, the default value for a provider may change in a future
+ * version. Therefore, it is recommended to explicitly initialize the
+ * AlgorithmParameterGenerator instead of relying on provider-specific defaults.
*
* Every implementation of the Java platform is required to support the
* following standard {@code AlgorithmParameterGenerator} algorithms and
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/security/AlgorithmParameterGeneratorSpi.java
--- a/jdk/src/java.base/share/classes/java/security/AlgorithmParameterGeneratorSpi.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/security/AlgorithmParameterGeneratorSpi.java Wed Jul 05 23:40:06 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
* 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,8 +39,15 @@
* In case the client does not explicitly initialize the
* AlgorithmParameterGenerator (via a call to an {@code engineInit}
* method), each provider must supply (and document) a default initialization.
- * For example, the Sun provider uses a default modulus prime size of 1024
- * bits for the generation of DSA parameters.
+ * See the Keysize Restriction sections of the
+ *
+ * JDK Providers
+ * document for information on the AlgorithmParameterGenerator defaults
+ * used by JDK providers.
+ * However, note that defaults may vary across different providers.
+ * Additionally, the default value for a provider may change in a future
+ * version. Therefore, it is recommended to explicitly initialize the
+ * AlgorithmParameterGenerator instead of relying on provider-specific defaults.
*
* @author Jan Luehe
*
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/security/AllPermission.java
--- a/jdk/src/java.base/share/classes/java/security/AllPermission.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/security/AllPermission.java Wed Jul 05 23:40:06 2017 +0200
@@ -51,6 +51,7 @@
*
*
* @author Roland Schemers
+ * @since 1.2
*
* @serial exclude
*/
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/security/BasicPermission.java
--- a/jdk/src/java.base/share/classes/java/security/BasicPermission.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/security/BasicPermission.java Wed Jul 05 23:40:06 2017 +0200
@@ -62,6 +62,7 @@
*
* @author Marianne Mueller
* @author Roland Schemers
+ * @since 1.2
*/
public abstract class BasicPermission extends Permission
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/security/Certificate.java
--- a/jdk/src/java.base/share/classes/java/security/Certificate.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/security/Certificate.java Wed Jul 05 23:40:06 2017 +0200
@@ -56,6 +56,7 @@
* the certificate and satisfy itself of its validity.
*
* @author Benjamin Renaud
+ * @since 1.1
* @deprecated A new certificate handling package is created in the Java platform.
* This Certificate interface is entirely deprecated and
* is here to allow for a smooth transition to the new
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/security/CodeSource.java
--- a/jdk/src/java.base/share/classes/java/security/CodeSource.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/security/CodeSource.java Wed Jul 05 23:40:06 2017 +0200
@@ -44,6 +44,7 @@
*
* @author Li Gong
* @author Roland Schemers
+ * @since 1.2
*/
public class CodeSource implements java.io.Serializable {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/security/DigestException.java
--- a/jdk/src/java.base/share/classes/java/security/DigestException.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/security/DigestException.java Wed Jul 05 23:40:06 2017 +0200
@@ -29,6 +29,7 @@
* This is the generic Message Digest exception.
*
* @author Benjamin Renaud
+ * @since 1.1
*/
public class DigestException extends GeneralSecurityException {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/security/DigestInputStream.java
--- a/jdk/src/java.base/share/classes/java/security/DigestInputStream.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/security/DigestInputStream.java Wed Jul 05 23:40:06 2017 +0200
@@ -59,6 +59,7 @@
* @see DigestOutputStream
*
* @author Benjamin Renaud
+ * @since 1.2
*/
public class DigestInputStream extends FilterInputStream {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/security/DigestOutputStream.java
--- a/jdk/src/java.base/share/classes/java/security/DigestOutputStream.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/security/DigestOutputStream.java Wed Jul 05 23:40:06 2017 +0200
@@ -51,6 +51,7 @@
* @see DigestInputStream
*
* @author Benjamin Renaud
+ * @since 1.2
*/
public class DigestOutputStream extends FilterOutputStream {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/security/GeneralSecurityException.java
--- a/jdk/src/java.base/share/classes/java/security/GeneralSecurityException.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/security/GeneralSecurityException.java Wed Jul 05 23:40:06 2017 +0200
@@ -31,6 +31,7 @@
* security-related exception classes that extend from it.
*
* @author Jan Luehe
+ * @since 1.2
*/
public class GeneralSecurityException extends Exception {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/security/Guard.java
--- a/jdk/src/java.base/share/classes/java/security/Guard.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/security/Guard.java Wed Jul 05 23:40:06 2017 +0200
@@ -38,6 +38,7 @@
*
* @author Roland Schemers
* @author Li Gong
+ * @since 1.2
*/
public interface Guard {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/security/GuardedObject.java
--- a/jdk/src/java.base/share/classes/java/security/GuardedObject.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/security/GuardedObject.java Wed Jul 05 23:40:06 2017 +0200
@@ -44,6 +44,7 @@
*
* @author Roland Schemers
* @author Li Gong
+ * @since 1.2
*/
public class GuardedObject implements java.io.Serializable {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/security/Identity.java
--- a/jdk/src/java.base/share/classes/java/security/Identity.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/security/Identity.java Wed Jul 05 23:40:06 2017 +0200
@@ -51,6 +51,7 @@
* @see Principal
*
* @author Benjamin Renaud
+ * @since 1.1
* @deprecated This class is no longer used. Its functionality has been
* replaced by {@code java.security.KeyStore}, the
* {@code java.security.cert} package, and
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/security/IdentityScope.java
--- a/jdk/src/java.base/share/classes/java/security/IdentityScope.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/security/IdentityScope.java Wed Jul 05 23:40:06 2017 +0200
@@ -55,6 +55,7 @@
* @see Key
*
* @author Benjamin Renaud
+ * @since 1.1
*
* @deprecated This class is no longer used. Its functionality has been
* replaced by {@code java.security.KeyStore}, the
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/security/InvalidKeyException.java
--- a/jdk/src/java.base/share/classes/java/security/InvalidKeyException.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/security/InvalidKeyException.java Wed Jul 05 23:40:06 2017 +0200
@@ -31,6 +31,7 @@
* length, uninitialized, etc).
*
* @author Benjamin Renaud
+ * @since 1.1
*/
public class InvalidKeyException extends KeyException {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/security/InvalidParameterException.java
--- a/jdk/src/java.base/share/classes/java/security/InvalidParameterException.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/security/InvalidParameterException.java Wed Jul 05 23:40:06 2017 +0200
@@ -31,6 +31,7 @@
* to a method.
*
* @author Benjamin Renaud
+ * @since 1.1
*/
public class InvalidParameterException extends IllegalArgumentException {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/security/Key.java
--- a/jdk/src/java.base/share/classes/java/security/Key.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/security/Key.java Wed Jul 05 23:40:06 2017 +0200
@@ -97,6 +97,7 @@
* @see Signer
*
* @author Benjamin Renaud
+ * @since 1.1
*/
public interface Key extends java.io.Serializable {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/security/KeyException.java
--- a/jdk/src/java.base/share/classes/java/security/KeyException.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/security/KeyException.java Wed Jul 05 23:40:06 2017 +0200
@@ -33,6 +33,7 @@
* @see KeyManagementException
*
* @author Benjamin Renaud
+ * @since 1.1
*/
public class KeyException extends GeneralSecurityException {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/security/KeyManagementException.java
--- a/jdk/src/java.base/share/classes/java/security/KeyManagementException.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/security/KeyManagementException.java Wed Jul 05 23:40:06 2017 +0200
@@ -38,6 +38,7 @@
*
*
* @author Benjamin Renaud
+ * @since 1.1
*
* @see Key
* @see KeyException
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/security/KeyPair.java
--- a/jdk/src/java.base/share/classes/java/security/KeyPair.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/security/KeyPair.java Wed Jul 05 23:40:06 2017 +0200
@@ -36,6 +36,7 @@
* @see PrivateKey
*
* @author Benjamin Renaud
+ * @since 1.1
*/
public final class KeyPair implements java.io.Serializable {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/security/KeyPairGenerator.java
--- a/jdk/src/java.base/share/classes/java/security/KeyPairGenerator.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/security/KeyPairGenerator.java Wed Jul 05 23:40:06 2017 +0200
@@ -95,8 +95,15 @@
* In case the client does not explicitly initialize the KeyPairGenerator
* (via a call to an {@code initialize} method), each provider must
* supply (and document) a default initialization.
- * For example, the Sun provider uses a default modulus size (keysize)
- * of 1024 bits for DSA key pairs.
+ * See the Keysize Restriction sections of the
+ *
+ * JDK Providers
+ * document for information on the KeyPairGenerator defaults used by
+ * JDK providers.
+ * However, note that defaults may vary across different providers.
+ * Additionally, the default value for a provider may change in a future
+ * version. Therefore, it is recommended to explicitly initialize the
+ * KeyPairGenerator instead of relying on provider-specific defaults.
*
* Note that this class is abstract and extends from
* {@code KeyPairGeneratorSpi} for historical reasons.
@@ -121,6 +128,7 @@
* other algorithms are supported.
*
* @author Benjamin Renaud
+ * @since 1.1
*
* @see java.security.spec.AlgorithmParameterSpec
*/
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/security/KeyPairGeneratorSpi.java
--- a/jdk/src/java.base/share/classes/java/security/KeyPairGeneratorSpi.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/security/KeyPairGeneratorSpi.java Wed Jul 05 23:40:06 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
* 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,10 +39,18 @@
* In case the client does not explicitly initialize the KeyPairGenerator
* (via a call to an {@code initialize} method), each provider must
* supply (and document) a default initialization.
- * For example, the Sun provider uses a default modulus size (keysize)
- * of 1024 bits.
+ * See the Keysize Restriction sections of the
+ *
+ * JDK Providers
+ * document for information on the KeyPairGenerator defaults used by
+ * JDK providers.
+ * However, note that defaults may vary across different providers.
+ * Additionally, the default value for a provider may change in a future
+ * version. Therefore, it is recommended to explicitly initialize the
+ * KeyPairGenerator instead of relying on provider-specific defaults.
*
* @author Benjamin Renaud
+ * @since 1.2
*
*
* @see KeyPairGenerator
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/security/MessageDigest.java
--- a/jdk/src/java.base/share/classes/java/security/MessageDigest.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/security/MessageDigest.java Wed Jul 05 23:40:06 2017 +0200
@@ -96,6 +96,7 @@
* other algorithms are supported.
*
* @author Benjamin Renaud
+ * @since 1.1
*
* @see DigestInputStream
* @see DigestOutputStream
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/security/MessageDigestSpi.java
--- a/jdk/src/java.base/share/classes/java/security/MessageDigestSpi.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/security/MessageDigestSpi.java Wed Jul 05 23:40:06 2017 +0200
@@ -43,6 +43,7 @@
* Implementations are free to implement the Cloneable interface.
*
* @author Benjamin Renaud
+ * @since 1.2
*
*
* @see MessageDigest
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/security/NoSuchAlgorithmException.java
--- a/jdk/src/java.base/share/classes/java/security/NoSuchAlgorithmException.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/security/NoSuchAlgorithmException.java Wed Jul 05 23:40:06 2017 +0200
@@ -30,6 +30,7 @@
* requested but is not available in the environment.
*
* @author Benjamin Renaud
+ * @since 1.1
*/
public class NoSuchAlgorithmException extends GeneralSecurityException {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/security/NoSuchProviderException.java
--- a/jdk/src/java.base/share/classes/java/security/NoSuchProviderException.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/security/NoSuchProviderException.java Wed Jul 05 23:40:06 2017 +0200
@@ -30,6 +30,7 @@
* requested but is not available in the environment.
*
* @author Benjamin Renaud
+ * @since 1.1
*/
public class NoSuchProviderException extends GeneralSecurityException {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/security/Permission.java
--- a/jdk/src/java.base/share/classes/java/security/Permission.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/security/Permission.java Wed Jul 05 23:40:06 2017 +0200
@@ -60,6 +60,7 @@
*
* @author Marianne Mueller
* @author Roland Schemers
+ * @since 1.2
*/
public abstract class Permission implements Guard, java.io.Serializable {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/security/PermissionCollection.java
--- a/jdk/src/java.base/share/classes/java/security/PermissionCollection.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/security/PermissionCollection.java Wed Jul 05 23:40:06 2017 +0200
@@ -91,6 +91,7 @@
*
*
* @author Roland Schemers
+ * @since 1.2
*/
public abstract class PermissionCollection implements java.io.Serializable {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/security/Permissions.java
--- a/jdk/src/java.base/share/classes/java/security/Permissions.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/security/Permissions.java Wed Jul 05 23:40:06 2017 +0200
@@ -75,6 +75,7 @@
*
* @author Marianne Mueller
* @author Roland Schemers
+ * @since 1.2
*
* @serial exclude
*/
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/security/Policy.java
--- a/jdk/src/java.base/share/classes/java/security/Policy.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/security/Policy.java Wed Jul 05 23:40:06 2017 +0200
@@ -78,6 +78,7 @@
*
* @author Roland Schemers
* @author Gary Ellison
+ * @since 1.2
* @see java.security.Provider
* @see java.security.ProtectionDomain
* @see java.security.Permission
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/security/Principal.java
--- a/jdk/src/java.base/share/classes/java/security/Principal.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/security/Principal.java Wed Jul 05 23:40:06 2017 +0200
@@ -35,6 +35,7 @@
* @see java.security.cert.X509Certificate
*
* @author Li Gong
+ * @since 1.1
*/
public interface Principal {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/security/PrivateKey.java
--- a/jdk/src/java.base/share/classes/java/security/PrivateKey.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/security/PrivateKey.java Wed Jul 05 23:40:06 2017 +0200
@@ -54,6 +54,7 @@
*
* @author Benjamin Renaud
* @author Josh Bloch
+ * @since 1.1
*/
public interface PrivateKey extends Key, javax.security.auth.Destroyable {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/security/PrivilegedAction.java
--- a/jdk/src/java.base/share/classes/java/security/PrivilegedAction.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/security/PrivilegedAction.java Wed Jul 05 23:40:06 2017 +0200
@@ -34,6 +34,7 @@
* throw checked exceptions must use {@code PrivilegedExceptionAction}
* instead.
*
+ * @since 1.2
* @see AccessController
* @see AccessController#doPrivileged(PrivilegedAction)
* @see PrivilegedExceptionAction
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/security/PrivilegedActionException.java
--- a/jdk/src/java.base/share/classes/java/security/PrivilegedActionException.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/security/PrivilegedActionException.java Wed Jul 05 23:40:06 2017 +0200
@@ -43,6 +43,7 @@
* cause, and may be accessed via the {@link Throwable#getCause()}
* method, as well as the aforementioned "legacy method."
*
+ * @since 1.2
* @see PrivilegedExceptionAction
* @see AccessController#doPrivileged(PrivilegedExceptionAction)
* @see AccessController#doPrivileged(PrivilegedExceptionAction,AccessControlContext)
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/security/PrivilegedExceptionAction.java
--- a/jdk/src/java.base/share/classes/java/security/PrivilegedExceptionAction.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/security/PrivilegedExceptionAction.java Wed Jul 05 23:40:06 2017 +0200
@@ -35,6 +35,7 @@
* computations that do not throw
* checked exceptions should use {@code PrivilegedAction} instead.
*
+ * @since 1.2
* @see AccessController
* @see AccessController#doPrivileged(PrivilegedExceptionAction)
* @see AccessController#doPrivileged(PrivilegedExceptionAction,
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/security/ProtectionDomain.java
--- a/jdk/src/java.base/share/classes/java/security/ProtectionDomain.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/security/ProtectionDomain.java Wed Jul 05 23:40:06 2017 +0200
@@ -59,6 +59,7 @@
* @author Li Gong
* @author Roland Schemers
* @author Gary Ellison
+ * @since 1.2
*/
public class ProtectionDomain {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/security/Provider.java
--- a/jdk/src/java.base/share/classes/java/security/Provider.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/security/Provider.java Wed Jul 05 23:40:06 2017 +0200
@@ -102,6 +102,7 @@
*
* @author Benjamin Renaud
* @author Andreas Sterbenz
+ * @since 1.1
*/
public abstract class Provider extends Properties {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/security/ProviderException.java
--- a/jdk/src/java.base/share/classes/java/security/ProviderException.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/security/ProviderException.java Wed Jul 05 23:40:06 2017 +0200
@@ -32,6 +32,7 @@
* throw specialized, provider-specific runtime errors.
*
* @author Benjamin Renaud
+ * @since 1.1
*/
public class ProviderException extends RuntimeException {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/security/PublicKey.java
--- a/jdk/src/java.base/share/classes/java/security/PublicKey.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/security/PublicKey.java Wed Jul 05 23:40:06 2017 +0200
@@ -34,6 +34,7 @@
* See, for example, the DSAPublicKey interface in
* {@code java.security.interfaces}.
*
+ * @since 1.1
* @see Key
* @see PrivateKey
* @see Certificate
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/security/SecureClassLoader.java
--- a/jdk/src/java.base/share/classes/java/security/SecureClassLoader.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/security/SecureClassLoader.java Wed Jul 05 23:40:06 2017 +0200
@@ -39,6 +39,7 @@
*
* @author Li Gong
* @author Roland Schemers
+ * @since 1.2
*/
public class SecureClassLoader extends ClassLoader {
/*
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/security/SecureRandom.java
--- a/jdk/src/java.base/share/classes/java/security/SecureRandom.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/security/SecureRandom.java Wed Jul 05 23:40:06 2017 +0200
@@ -143,6 +143,7 @@
*
* @author Benjamin Renaud
* @author Josh Bloch
+ * @since 1.1
*/
public class SecureRandom extends java.util.Random {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/security/Security.java
--- a/jdk/src/java.base/share/classes/java/security/Security.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/security/Security.java Wed Jul 05 23:40:06 2017 +0200
@@ -45,6 +45,7 @@
* {@code conf/security/java.security} in the Java installation directory.
*
* @author Benjamin Renaud
+ * @since 1.1
*/
public final class Security {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/security/SecurityPermission.java
--- a/jdk/src/java.base/share/classes/java/security/SecurityPermission.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/security/SecurityPermission.java Wed Jul 05 23:40:06 2017 +0200
@@ -333,6 +333,7 @@
*
* @author Marianne Mueller
* @author Roland Schemers
+ * @since 1.2
*/
public final class SecurityPermission extends BasicPermission {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/security/Signature.java
--- a/jdk/src/java.base/share/classes/java/security/Signature.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/security/Signature.java Wed Jul 05 23:40:06 2017 +0200
@@ -113,6 +113,7 @@
* other algorithms are supported.
*
* @author Benjamin Renaud
+ * @since 1.1
*
*/
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/security/SignatureException.java
--- a/jdk/src/java.base/share/classes/java/security/SignatureException.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/security/SignatureException.java Wed Jul 05 23:40:06 2017 +0200
@@ -29,6 +29,7 @@
* This is the generic Signature exception.
*
* @author Benjamin Renaud
+ * @since 1.1
*/
public class SignatureException extends GeneralSecurityException {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/security/SignatureSpi.java
--- a/jdk/src/java.base/share/classes/java/security/SignatureSpi.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/security/SignatureSpi.java Wed Jul 05 23:40:06 2017 +0200
@@ -44,6 +44,7 @@
* of a particular signature algorithm.
*
* @author Benjamin Renaud
+ * @since 1.2
*
*
* @see Signature
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/security/SignedObject.java
--- a/jdk/src/java.base/share/classes/java/security/SignedObject.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/security/SignedObject.java Wed Jul 05 23:40:06 2017 +0200
@@ -114,6 +114,7 @@
* @see Signature
*
* @author Li Gong
+ * @since 1.2
*/
public final class SignedObject implements Serializable {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/security/Signer.java
--- a/jdk/src/java.base/share/classes/java/security/Signer.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/security/Signer.java Wed Jul 05 23:40:06 2017 +0200
@@ -38,6 +38,7 @@
* @see Identity
*
* @author Benjamin Renaud
+ * @since 1.1
*
* @deprecated This class is no longer used. Its functionality has been
* replaced by {@code java.security.KeyStore}, the
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/security/UnresolvedPermission.java
--- a/jdk/src/java.base/share/classes/java/security/UnresolvedPermission.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/security/UnresolvedPermission.java Wed Jul 05 23:40:06 2017 +0200
@@ -96,6 +96,7 @@
*
*
* @author Roland Schemers
+ * @since 1.2
*/
public final class UnresolvedPermission extends Permission
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/security/UnresolvedPermissionCollection.java
--- a/jdk/src/java.base/share/classes/java/security/UnresolvedPermissionCollection.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/security/UnresolvedPermissionCollection.java Wed Jul 05 23:40:06 2017 +0200
@@ -43,6 +43,7 @@
*
*
* @author Roland Schemers
+ * @since 1.2
*
* @serial include
*/
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/security/acl/Acl.java
--- a/jdk/src/java.base/share/classes/java/security/acl/Acl.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/security/acl/Acl.java Wed Jul 05 23:40:06 2017 +0200
@@ -82,6 +82,7 @@
* @see java.security.acl.Acl#getPermissions
*
* @author Satish Dharmaraj
+ * @since 1.1
*
* @deprecated This package has been replaced by {@code java.security.Policy}
* and related classes since 1.2.
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/security/acl/AclEntry.java
--- a/jdk/src/java.base/share/classes/java/security/acl/AclEntry.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/security/acl/AclEntry.java Wed Jul 05 23:40:06 2017 +0200
@@ -50,6 +50,7 @@
* @see java.security.acl.Acl
*
* @author Satish Dharmaraj
+ * @since 1.1
*
* @deprecated This package has been replaced by {@code java.security.Policy}
* and related classes since 1.2.
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/security/acl/AclNotFoundException.java
--- a/jdk/src/java.base/share/classes/java/security/acl/AclNotFoundException.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/security/acl/AclNotFoundException.java Wed Jul 05 23:40:06 2017 +0200
@@ -30,6 +30,7 @@
* non-existent ACL (Access Control List).
*
* @author Satish Dharmaraj
+ * @since 1.1
*
* @deprecated This package has been replaced by {@code java.security.Policy}
* and related classes since 1.2.
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/security/acl/Group.java
--- a/jdk/src/java.base/share/classes/java/security/acl/Group.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/security/acl/Group.java Wed Jul 05 23:40:06 2017 +0200
@@ -39,6 +39,7 @@
* Principal or Group.
*
* @author Satish Dharmaraj
+ * @since 1.1
*
* @deprecated This package has been replaced by {@code java.security.Policy}
* and related classes since 1.2.
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/security/acl/LastOwnerException.java
--- a/jdk/src/java.base/share/classes/java/security/acl/LastOwnerException.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/security/acl/LastOwnerException.java Wed Jul 05 23:40:06 2017 +0200
@@ -32,6 +32,7 @@
* @see java.security.acl.Owner#deleteOwner
*
* @author Satish Dharmaraj
+ * @since 1.1
*
* @deprecated This package has been replaced by {@code java.security.Policy}
* and related classes since 1.2.
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/security/acl/NotOwnerException.java
--- a/jdk/src/java.base/share/classes/java/security/acl/NotOwnerException.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/security/acl/NotOwnerException.java Wed Jul 05 23:40:06 2017 +0200
@@ -31,6 +31,7 @@
* the object, but the Principal attempting the modification is not an owner.
*
* @author Satish Dharmaraj
+ * @since 1.1
*
* @deprecated This package has been replaced by {@code java.security.Policy}
* and related classes since 1.2.
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/security/acl/Owner.java
--- a/jdk/src/java.base/share/classes/java/security/acl/Owner.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/security/acl/Owner.java Wed Jul 05 23:40:06 2017 +0200
@@ -34,6 +34,7 @@
* interface.) The initial owner Principal should be specified as an
* argument to the constructor of the class implementing this interface.
*
+ * @since 1.1
* @see java.security.acl.Acl
*
* @deprecated This package has been replaced by {@code java.security.Policy}
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/security/acl/Permission.java
--- a/jdk/src/java.base/share/classes/java/security/acl/Permission.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/security/acl/Permission.java Wed Jul 05 23:40:06 2017 +0200
@@ -31,6 +31,7 @@
* a particular type of access to a resource.
*
* @author Satish Dharmaraj
+ * @since 1.1
*
* @deprecated This package has been replaced by {@code java.security.Policy}
* and related classes since 1.2.
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/security/cert/CRLException.java
--- a/jdk/src/java.base/share/classes/java/security/cert/CRLException.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/security/cert/CRLException.java Wed Jul 05 23:40:06 2017 +0200
@@ -31,6 +31,7 @@
* CRL (Certificate Revocation List) Exception.
*
* @author Hemma Prafullchandra
+ * @since 1.2
*/
public class CRLException extends GeneralSecurityException {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/security/cert/Certificate.java
--- a/jdk/src/java.base/share/classes/java/security/cert/Certificate.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/security/cert/Certificate.java Wed Jul 05 23:40:06 2017 +0200
@@ -57,6 +57,7 @@
* @see CertificateFactory
*
* @author Hemma Prafullchandra
+ * @since 1.2
*/
public abstract class Certificate implements java.io.Serializable {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/security/cert/CertificateEncodingException.java
--- a/jdk/src/java.base/share/classes/java/security/cert/CertificateEncodingException.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/security/cert/CertificateEncodingException.java Wed Jul 05 23:40:06 2017 +0200
@@ -30,6 +30,7 @@
* occurs while attempting to encode a certificate.
*
* @author Hemma Prafullchandra
+ * @since 1.2
*/
public class CertificateEncodingException extends CertificateException {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/security/cert/CertificateException.java
--- a/jdk/src/java.base/share/classes/java/security/cert/CertificateException.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/security/cert/CertificateException.java Wed Jul 05 23:40:06 2017 +0200
@@ -31,6 +31,7 @@
* This exception indicates one of a variety of certificate problems.
*
* @author Hemma Prafullchandra
+ * @since 1.2
* @see Certificate
*/
public class CertificateException extends GeneralSecurityException {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/security/cert/CertificateExpiredException.java
--- a/jdk/src/java.base/share/classes/java/security/cert/CertificateExpiredException.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/security/cert/CertificateExpiredException.java Wed Jul 05 23:40:06 2017 +0200
@@ -32,6 +32,7 @@
* of the certificate.
*
* @author Hemma Prafullchandra
+ * @since 1.2
*/
public class CertificateExpiredException extends CertificateException {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/security/cert/CertificateNotYetValidException.java
--- a/jdk/src/java.base/share/classes/java/security/cert/CertificateNotYetValidException.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/security/cert/CertificateNotYetValidException.java Wed Jul 05 23:40:06 2017 +0200
@@ -32,6 +32,7 @@
* validity period.
*
* @author Hemma Prafullchandra
+ * @since 1.2
*/
public class CertificateNotYetValidException extends CertificateException {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/security/cert/CertificateParsingException.java
--- a/jdk/src/java.base/share/classes/java/security/cert/CertificateParsingException.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/security/cert/CertificateParsingException.java Wed Jul 05 23:40:06 2017 +0200
@@ -31,6 +31,7 @@
* are found in the Certificate.
*
* @author Hemma Prafullchandra
+ * @since 1.2
*/
public class CertificateParsingException extends CertificateException {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/security/cert/X509CRL.java
--- a/jdk/src/java.base/share/classes/java/security/cert/X509CRL.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/security/cert/X509CRL.java Wed Jul 05 23:40:06 2017 +0200
@@ -103,6 +103,7 @@
* }
*
* @author Hemma Prafullchandra
+ * @since 1.2
*
*
* @see CRL
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/security/cert/X509CRLEntry.java
--- a/jdk/src/java.base/share/classes/java/security/cert/X509CRLEntry.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/security/cert/X509CRLEntry.java Wed Jul 05 23:40:06 2017 +0200
@@ -62,6 +62,7 @@
* @see X509Extension
*
* @author Hemma Prafullchandra
+ * @since 1.2
*/
public abstract class X509CRLEntry implements X509Extension {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/security/cert/X509Certificate.java
--- a/jdk/src/java.base/share/classes/java/security/cert/X509Certificate.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/security/cert/X509Certificate.java Wed Jul 05 23:40:06 2017 +0200
@@ -95,6 +95,7 @@
*
*
* @author Hemma Prafullchandra
+ * @since 1.2
*
*
* @see Certificate
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/security/cert/X509Extension.java
--- a/jdk/src/java.base/share/classes/java/security/cert/X509Extension.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/security/cert/X509Extension.java Wed Jul 05 23:40:06 2017 +0200
@@ -65,6 +65,7 @@
* be handled by a Class that understands the extension.
*
* @author Hemma Prafullchandra
+ * @since 1.2
*/
public interface X509Extension {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/security/interfaces/DSAKey.java
--- a/jdk/src/java.base/share/classes/java/security/interfaces/DSAKey.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/security/interfaces/DSAKey.java Wed Jul 05 23:40:06 2017 +0200
@@ -35,6 +35,7 @@
*
* @author Benjamin Renaud
* @author Josh Bloch
+ * @since 1.1
*/
public interface DSAKey {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/security/interfaces/DSAKeyPairGenerator.java
--- a/jdk/src/java.base/share/classes/java/security/interfaces/DSAKeyPairGenerator.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/security/interfaces/DSAKeyPairGenerator.java Wed Jul 05 23:40:06 2017 +0200
@@ -65,6 +65,7 @@
* Note: Some earlier implementations of this interface may not support
* larger sizes of DSA parameters such as 2048 and 3072-bit.
*
+ * @since 1.1
* @see java.security.KeyPairGenerator
*/
public interface DSAKeyPairGenerator {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/security/interfaces/DSAParams.java
--- a/jdk/src/java.base/share/classes/java/security/interfaces/DSAParams.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/security/interfaces/DSAParams.java Wed Jul 05 23:40:06 2017 +0200
@@ -38,6 +38,7 @@
*
* @author Benjamin Renaud
* @author Josh Bloch
+ * @since 1.1
*/
public interface DSAParams {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/security/interfaces/DSAPrivateKey.java
--- a/jdk/src/java.base/share/classes/java/security/interfaces/DSAPrivateKey.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/security/interfaces/DSAPrivateKey.java Wed Jul 05 23:40:06 2017 +0200
@@ -37,6 +37,7 @@
* @see DSAPublicKey
*
* @author Benjamin Renaud
+ * @since 1.1
*/
public interface DSAPrivateKey extends DSAKey, java.security.PrivateKey {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/security/interfaces/DSAPublicKey.java
--- a/jdk/src/java.base/share/classes/java/security/interfaces/DSAPublicKey.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/security/interfaces/DSAPublicKey.java Wed Jul 05 23:40:06 2017 +0200
@@ -37,6 +37,7 @@
* @see DSAPrivateKey
*
* @author Benjamin Renaud
+ * @since 1.1
*/
public interface DSAPublicKey extends DSAKey, java.security.PublicKey {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/security/interfaces/RSAPrivateCrtKey.java
--- a/jdk/src/java.base/share/classes/java/security/interfaces/RSAPrivateCrtKey.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/security/interfaces/RSAPrivateCrtKey.java Wed Jul 05 23:40:06 2017 +0200
@@ -32,6 +32,7 @@
* using the Chinese Remainder Theorem (CRT) information values.
*
* @author Jan Luehe
+ * @since 1.2
*
*
* @see RSAPrivateKey
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/security/interfaces/RSAPrivateKey.java
--- a/jdk/src/java.base/share/classes/java/security/interfaces/RSAPrivateKey.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/security/interfaces/RSAPrivateKey.java Wed Jul 05 23:40:06 2017 +0200
@@ -31,6 +31,7 @@
* The interface to an RSA private key.
*
* @author Jan Luehe
+ * @since 1.2
*
*
* @see RSAPrivateCrtKey
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/security/interfaces/RSAPublicKey.java
--- a/jdk/src/java.base/share/classes/java/security/interfaces/RSAPublicKey.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/security/interfaces/RSAPublicKey.java Wed Jul 05 23:40:06 2017 +0200
@@ -31,6 +31,7 @@
* The interface to an RSA public key.
*
* @author Jan Luehe
+ * @since 1.2
*
*/
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/security/spec/RSAPrivateCrtKeySpec.java
--- a/jdk/src/java.base/share/classes/java/security/spec/RSAPrivateCrtKeySpec.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/security/spec/RSAPrivateCrtKeySpec.java Wed Jul 05 23:40:06 2017 +0200
@@ -33,6 +33,7 @@
* efficiency.
*
* @author Jan Luehe
+ * @since 1.2
*
*
* @see java.security.Key
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/security/spec/RSAPrivateKeySpec.java
--- a/jdk/src/java.base/share/classes/java/security/spec/RSAPrivateKeySpec.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/security/spec/RSAPrivateKeySpec.java Wed Jul 05 23:40:06 2017 +0200
@@ -31,6 +31,7 @@
* This class specifies an RSA private key.
*
* @author Jan Luehe
+ * @since 1.2
*
*
* @see java.security.Key
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/security/spec/RSAPublicKeySpec.java
--- a/jdk/src/java.base/share/classes/java/security/spec/RSAPublicKeySpec.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/security/spec/RSAPublicKeySpec.java Wed Jul 05 23:40:06 2017 +0200
@@ -31,6 +31,7 @@
* This class specifies an RSA public key.
*
* @author Jan Luehe
+ * @since 1.2
*
*
* @see java.security.Key
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/text/BreakIterator.java
--- a/jdk/src/java.base/share/classes/java/text/BreakIterator.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/text/BreakIterator.java Wed Jul 05 23:40:06 2017 +0200
@@ -221,6 +221,7 @@
* and the next is a word; otherwise, it's the material between words.)
*
*
+ * @since 1.1
* @see CharacterIterator
*
*/
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/text/CharacterIterator.java
--- a/jdk/src/java.base/share/classes/java/text/CharacterIterator.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/text/CharacterIterator.java Wed Jul 05 23:40:06 2017 +0200
@@ -98,6 +98,7 @@
* }
* }
*
+ * @since 1.1
* @see StringCharacterIterator
* @see AttributedCharacterIterator
*/
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/text/ChoiceFormat.java
--- a/jdk/src/java.base/share/classes/java/text/ChoiceFormat.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/text/ChoiceFormat.java Wed Jul 05 23:40:06 2017 +0200
@@ -163,6 +163,7 @@
* @see DecimalFormat
* @see MessageFormat
* @author Mark Davis
+ * @since 1.1
*/
public class ChoiceFormat extends NumberFormat {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/text/CollationElementIterator.java
--- a/jdk/src/java.base/share/classes/java/text/CollationElementIterator.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/text/CollationElementIterator.java Wed Jul 05 23:40:06 2017 +0200
@@ -104,6 +104,7 @@
* @see Collator
* @see RuleBasedCollator
* @author Helena Shih, Laura Werner, Richard Gillam
+ * @since 1.1
*/
public final class CollationElementIterator
{
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/text/CollationKey.java
--- a/jdk/src/java.base/share/classes/java/text/CollationKey.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/text/CollationKey.java Wed Jul 05 23:40:06 2017 +0200
@@ -95,6 +95,7 @@
* @see Collator
* @see RuleBasedCollator
* @author Helena Shih
+ * @since 1.1
*/
public abstract class CollationKey implements Comparable {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/text/Collator.java
--- a/jdk/src/java.base/share/classes/java/text/Collator.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/text/Collator.java Wed Jul 05 23:40:06 2017 +0200
@@ -123,6 +123,7 @@
* @see CollationElementIterator
* @see Locale
* @author Helena Shih, Laura Werner, Richard Gillam
+ * @since 1.1
*/
public abstract class Collator
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/text/DateFormat.java
--- a/jdk/src/java.base/share/classes/java/text/DateFormat.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/text/DateFormat.java Wed Jul 05 23:40:06 2017 +0200
@@ -167,6 +167,7 @@
* @see java.util.GregorianCalendar
* @see java.util.TimeZone
* @author Mark Davis, Chen-Lieh Huang, Alan Liu
+ * @since 1.1
*/
public abstract class DateFormat extends Format {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/text/DateFormatSymbols.java
--- a/jdk/src/java.base/share/classes/java/text/DateFormatSymbols.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/text/DateFormatSymbols.java Wed Jul 05 23:40:06 2017 +0200
@@ -98,6 +98,7 @@
* @see SimpleDateFormat
* @see java.util.SimpleTimeZone
* @author Chen-Lieh Huang
+ * @since 1.1
*/
public class DateFormatSymbols implements Serializable, Cloneable {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/text/DecimalFormat.java
--- a/jdk/src/java.base/share/classes/java/text/DecimalFormat.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/text/DecimalFormat.java Wed Jul 05 23:40:06 2017 +0200
@@ -381,6 +381,7 @@
* @see ParsePosition
* @author Mark Davis
* @author Alan Liu
+ * @since 1.1
*/
public class DecimalFormat extends NumberFormat {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/text/DecimalFormatSymbols.java
--- a/jdk/src/java.base/share/classes/java/text/DecimalFormatSymbols.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/text/DecimalFormatSymbols.java Wed Jul 05 23:40:06 2017 +0200
@@ -60,6 +60,7 @@
* @see DecimalFormat
* @author Mark Davis
* @author Alan Liu
+ * @since 1.1
*/
public class DecimalFormatSymbols implements Cloneable, Serializable {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/text/FieldPosition.java
--- a/jdk/src/java.base/share/classes/java/text/FieldPosition.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/text/FieldPosition.java Wed Jul 05 23:40:06 2017 +0200
@@ -68,6 +68,7 @@
* formatToCharacterIterator .
*
* @author Mark Davis
+ * @since 1.1
* @see java.text.Format
*/
public class FieldPosition {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/text/Format.java
--- a/jdk/src/java.base/share/classes/java/text/Format.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/text/Format.java Wed Jul 05 23:40:06 2017 +0200
@@ -129,6 +129,7 @@
* @see java.text.DateFormat
* @see java.text.MessageFormat
* @author Mark Davis
+ * @since 1.1
*/
public abstract class Format implements Serializable, Cloneable {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/text/MessageFormat.java
--- a/jdk/src/java.base/share/classes/java/text/MessageFormat.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/text/MessageFormat.java Wed Jul 05 23:40:06 2017 +0200
@@ -344,6 +344,7 @@
* @see SimpleDateFormat
*
* @author Mark Davis
+ * @since 1.1
*/
public class MessageFormat extends Format {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/text/NumberFormat.java
--- a/jdk/src/java.base/share/classes/java/text/NumberFormat.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/text/NumberFormat.java Wed Jul 05 23:40:06 2017 +0200
@@ -185,6 +185,7 @@
* @see ChoiceFormat
* @author Mark Davis
* @author Helena Shih
+ * @since 1.1
*/
public abstract class NumberFormat extends Format {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/text/ParseException.java
--- a/jdk/src/java.base/share/classes/java/text/ParseException.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/text/ParseException.java Wed Jul 05 23:40:06 2017 +0200
@@ -45,6 +45,7 @@
* @see java.text.Format
* @see java.text.FieldPosition
* @author Mark Davis
+ * @since 1.1
*/
public
class ParseException extends Exception {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/text/ParsePosition.java
--- a/jdk/src/java.base/share/classes/java/text/ParsePosition.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/text/ParsePosition.java Wed Jul 05 23:40:06 2017 +0200
@@ -51,6 +51,7 @@
* records the current position.
*
* @author Mark Davis
+ * @since 1.1
* @see java.text.Format
*/
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/text/RuleBasedCollator.java
--- a/jdk/src/java.base/share/classes/java/text/RuleBasedCollator.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/text/RuleBasedCollator.java Wed Jul 05 23:40:06 2017 +0200
@@ -242,6 +242,7 @@
* @see Collator
* @see CollationElementIterator
* @author Helena Shih, Laura Werner, Richard Gillam
+ * @since 1.1
*/
public class RuleBasedCollator extends Collator{
// IMPLEMENTATION NOTES: The implementation of the collation algorithm is
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/text/SimpleDateFormat.java
--- a/jdk/src/java.base/share/classes/java/text/SimpleDateFormat.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/text/SimpleDateFormat.java Wed Jul 05 23:40:06 2017 +0200
@@ -434,6 +434,7 @@
* @see DateFormat
* @see DateFormatSymbols
* @author Mark Davis, Chen-Lieh Huang, Alan Liu
+ * @since 1.1
*/
public class SimpleDateFormat extends DateFormat {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/text/StringCharacterIterator.java
--- a/jdk/src/java.base/share/classes/java/text/StringCharacterIterator.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/text/StringCharacterIterator.java Wed Jul 05 23:40:06 2017 +0200
@@ -47,6 +47,7 @@
* entire String .
*
* @see CharacterIterator
+ * @since 1.1
*/
public final class StringCharacterIterator implements CharacterIterator
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/util/ResourceBundle.java
--- a/jdk/src/java.base/share/classes/java/util/ResourceBundle.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/util/ResourceBundle.java Wed Jul 05 23:40:06 2017 +0200
@@ -216,16 +216,17 @@
* the caller module, those resource bundles need to be loaded from service
* providers of {@link ResourceBundleProvider}. The caller module must declare
* "{@code uses}" and the service interface name is the concatenation of the
- * base name of the bundles and the string "{@code Provider}". The
+ * package name of the base name, string "{@code .spi.}", the simple class
+ * name of the base name, and the string "{@code Provider}". The
* bundle provider modules containing resource bundles must
* declare "{@code provides}" with the service interface name and
* its implementation class name. For example, if the base name is
* "{@code com.example.app.MyResources}", the caller module must declare
- * "{@code uses com.example.app.MyResourcesProvider;}" and a module containing resource
- * bundles must declare "{@code provides com.example.app.MyResourcesProvider
+ * "{@code uses com.example.app.spi.MyResourcesProvider;}" and a module containing resource
+ * bundles must declare "{@code provides com.example.app.spi.MyResourcesProvider
* with com.example.app.internal.MyResourcesProviderImpl;}"
* where {@code com.example.app.internal.MyResourcesProviderImpl} is an
- * implementation class of {@code com.example.app.MyResourcesProvider}.
+ * implementation class of {@code com.example.app.spi.MyResourcesProvider}.
* - If you want to use non-standard formats in named modules, such as XML,
* {@link ResourceBundleProvider} needs to be used.
* - The {@code getBundle} method with a {@code ClassLoader} may not be able to
@@ -243,9 +244,10 @@
*
* The {@code getBundle} factory methods load service providers of
* {@link ResourceBundleProvider}, if available, using {@link ServiceLoader}.
- * The service type is designated by {@code basename+"Provider"}. For
+ * The service type is designated by
+ * {@code + ".spi." + + "Provider"}. For
* example, if the base name is "{@code com.example.app.MyResources}", the service
- * type is {@code com.example.app.MyResourcesProvider}.
+ * type is {@code com.example.app.spi.MyResourcesProvider}.
*
* In named modules, the loaded service providers for the given base name are
* used to load resource bundles. If no service provider is available, or if
@@ -923,7 +925,12 @@
* Resource bundles in named modules may be encapsulated. When
* the resource bundle is loaded from a provider, the caller module
* must have an appropriate uses clause in its module descriptor
- * to declare that the module uses implementations of {@code "baseName"Provider}.
+ * to declare that the module uses implementations of
+ * {@code + ".spi." + + "Provider"}.
+ * Otherwise, it will load the resource bundles that are local in the
+ * given module or that are visible to the class loader of the given module
+ * (refer to the Resource Bundles in Named Modules
+ * section for details).
* When the resource bundle is loaded from the specified module, it is
* subject to the encapsulation rules specified by
* {@link Module#getResourceAsStream Module.getResourceAsStream}.
@@ -958,20 +965,17 @@
* Resource bundles in named modules may be encapsulated. When
* the resource bundle is loaded from a provider, the caller module
* must have an appropriate uses clause in its module descriptor
- * to declare that the module uses implementations of {@code "baseName"Provider}.
+ * to declare that the module uses implementations of
+ * {@code + ".spi." + + "Provider"}.
+ * Otherwise, it will load the resource bundles that are local in the
+ * given module or that are visible to the class loader of the given module
+ * (refer to the Resource Bundles in Named Modules
+ * section for details).
* When the resource bundle is loaded from the specified module, it is
* subject to the encapsulation rules specified by
* {@link Module#getResourceAsStream Module.getResourceAsStream}.
*
*
- * If the given {@code module} is a named module, this method will
- * load the service providers for {@link java.util.spi.ResourceBundleProvider}
- * and also resource bundles that are local in the given module or that
- * are visible to the class loader of the given module (refer to the
- * Resource Bundles in Named Modules section
- * for details).
- *
- *
* If the given {@code module} is an unnamed module, then this method is
* equivalent to calling {@link #getBundle(String, Locale, ClassLoader)
* getBundle(baseName, targetLocale, module.getClassLoader()} to load
@@ -1070,8 +1074,10 @@
* Resource bundles in a named module are private to that module. If
* the caller is in a named module, this method will find resource bundles
* from the service providers of {@link java.util.spi.ResourceBundleProvider}
- * and also find resource bundles that are in the caller's module or
- * that are visible to the given class loader.
+ * if any. Otherwise, it will load the resource bundles that are visible to
+ * the given {@code loader} (refer to the
+ * Resource Bundles in Named Modules section
+ * for details).
* If the caller is in a named module and the given {@code loader} is
* different than the caller's class loader, or if the caller is not in
* a named module, this method will not find resource bundles from named
@@ -1883,8 +1889,15 @@
private static Class
getResourceBundleProviderType(String baseName, ClassLoader loader)
{
- // Look up + "Provider"
- String providerName = baseName + "Provider";
+ // Look up + ".spi." + "Provider"
+ int i = baseName.lastIndexOf('.');
+ if (i <= 0) {
+ return null;
+ }
+
+ String name = baseName.substring(i+1, baseName.length()) + "Provider";
+ String providerName = baseName.substring(0, i) + ".spi." + name;
+
// Use the class loader of the getBundle caller so that the caller's
// visibility of the provider type is checked.
return AccessController.doPrivileged(
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/util/concurrent/CompletionService.java
--- a/jdk/src/java.base/share/classes/java/util/concurrent/CompletionService.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/util/concurrent/CompletionService.java Wed Jul 05 23:40:06 2017 +0200
@@ -57,6 +57,8 @@
* happen-before
* actions taken by that task, which in turn happen-before
* actions following a successful return from the corresponding {@code take()}.
+ *
+ * @since 1.5
*/
public interface CompletionService {
/**
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/util/concurrent/ExecutorCompletionService.java
--- a/jdk/src/java.base/share/classes/java/util/concurrent/ExecutorCompletionService.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/util/concurrent/ExecutorCompletionService.java Wed Jul 05 23:40:06 2017 +0200
@@ -97,6 +97,8 @@
* if (result != null)
* use(result);
* }}
+ *
+ * @since 1.5
*/
public class ExecutorCompletionService implements CompletionService {
private final Executor executor;
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/util/concurrent/locks/LockSupport.java
--- a/jdk/src/java.base/share/classes/java/util/concurrent/locks/LockSupport.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/util/concurrent/locks/LockSupport.java Wed Jul 05 23:40:06 2017 +0200
@@ -133,6 +133,8 @@
* Class> ensureLoaded = LockSupport.class;
* }
* }}
+ *
+ * @since 1.5
*/
public class LockSupport {
private LockSupport() {} // Cannot be instantiated.
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/util/jar/JarEntry.java
--- a/jdk/src/java.base/share/classes/java/util/jar/JarEntry.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/util/jar/JarEntry.java Wed Jul 05 23:40:06 2017 +0200
@@ -32,6 +32,8 @@
/**
* This class is used to represent a JAR file entry.
+ *
+ * @since 1.2
*/
public
class JarEntry extends ZipEntry {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/util/package-info.java
--- a/jdk/src/java.base/share/classes/java/util/package-info.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/util/package-info.java Wed Jul 05 23:40:06 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -29,7 +29,7 @@
* miscellaneous utility classes (a string tokenizer, a random-number
* generator, and a bit array).
*
- * {@index "Java Collections Framework"}
+ * {@index "Java Collections Framework"}
*
* - Collections Framework Overview
*
-
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/util/spi/CalendarNameProvider.java
--- a/jdk/src/java.base/share/classes/java/util/spi/CalendarNameProvider.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/util/spi/CalendarNameProvider.java Wed Jul 05 23:40:06 2017 +0200
@@ -46,7 +46,7 @@
* Calendar}. The following are calendar-common fields and their values to be
* supported for each calendar system.
*
- *
+ *
* Field values
*
*
@@ -57,8 +57,8 @@
*
*
*
- * {@link Calendar#MONTH} |
- * {@link Calendar#JANUARY} to {@link Calendar#UNDECIMBER} |
+ * {@link Calendar#MONTH} |
+ * {@link Calendar#JANUARY} to {@link Calendar#UNDECIMBER} |
* Month numbering is 0-based (e.g., 0 - January, ..., 11 -
* December). Some calendar systems have 13 months. Month
* names need to be supported in both the formatting and
@@ -67,14 +67,14 @@
* in both of the forms. |
*
*
- * {@link Calendar#DAY_OF_WEEK} |
- * {@link Calendar#SUNDAY} to {@link Calendar#SATURDAY} |
+ * {@link Calendar#DAY_OF_WEEK} |
+ * {@link Calendar#SUNDAY} to {@link Calendar#SATURDAY} |
* Day-of-week numbering is 1-based starting from Sunday (i.e., 1 - Sunday,
* ..., 7 - Saturday). |
*
*
- * {@link Calendar#AM_PM} |
- * {@link Calendar#AM} to {@link Calendar#PM} |
+ * {@link Calendar#AM_PM} |
+ * {@link Calendar#AM} to {@link Calendar#PM} |
* 0 - AM, 1 - PM |
*
*
@@ -82,7 +82,7 @@
*
* The following are calendar-specific fields and their values to be supported.
*
- *
+ *
* Calendar type and field values
*
*
@@ -94,8 +94,8 @@
*
*
*
- * {@code "gregory"} |
- * {@link Calendar#ERA} |
+ * {@code "gregory"} |
+ * {@link Calendar#ERA} |
* 0 |
* {@link java.util.GregorianCalendar#BC} (BCE) |
*
@@ -104,8 +104,8 @@
* {@link java.util.GregorianCalendar#AD} (CE) |
*
*
- * {@code "buddhist"} |
- * {@link Calendar#ERA} |
+ * {@code "buddhist"} |
+ * {@link Calendar#ERA} |
* 0 |
* BC (BCE) |
*
@@ -114,8 +114,8 @@
* B.E. (Buddhist Era) |
*
*
- * {@code "japanese"} |
- * {@link Calendar#ERA} |
+ * {@code "japanese"} |
+ * {@link Calendar#ERA} |
* 0 |
* Seireki (Before Meiji) |
*
@@ -144,8 +144,8 @@
* Year representation in {@code SimpleDateFormat}.
*
*
- * {@code "roc"} |
- * {@link Calendar#ERA} |
+ * {@code "roc"} |
+ * {@link Calendar#ERA} |
* 0 |
* Before R.O.C. |
*
@@ -154,8 +154,8 @@
* R.O.C. |
*
*
- * {@code "islamic"} |
- * {@link Calendar#ERA} |
+ * {@code "islamic"} |
+ * {@link Calendar#ERA} |
* 0 |
* Before AH |
*
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/util/spi/ResourceBundleProvider.java
--- a/jdk/src/java.base/share/classes/java/util/spi/ResourceBundleProvider.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/util/spi/ResourceBundleProvider.java Wed Jul 05 23:40:06 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -35,11 +35,11 @@
* during a call to the
* {@link ResourceBundle#getBundle(String, Locale, ClassLoader)
* ResourceBundle.getBundle} method. The provider service type is determined by
- * {@code basename+"Provider"}.
+ * {@code + ".spi." + + "Provider"}.
*
*
* For example, if the base name is "com.example.app.MyResources",
- * {@code com.example.app.MyResourcesProvider} will be the provider service type:
+ * {@code com.example.app.spi.MyResourcesProvider} will be the provider service type:
* {@code
* public interface MyResourcesProvider extends ResourceBundleProvider {
* }
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/util/zip/Adler32.java
--- a/jdk/src/java.base/share/classes/java/util/zip/Adler32.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/util/zip/Adler32.java Wed Jul 05 23:40:06 2017 +0200
@@ -39,6 +39,7 @@
* a {@link NullPointerException} to be thrown.
*
* @author David Connelly
+ * @since 1.1
*/
public
class Adler32 implements Checksum {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/util/zip/CRC32.java
--- a/jdk/src/java.base/share/classes/java/util/zip/CRC32.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/util/zip/CRC32.java Wed Jul 05 23:40:06 2017 +0200
@@ -38,6 +38,7 @@
* a {@link NullPointerException} to be thrown.
*
* @author David Connelly
+ * @since 1.1
*/
public
class CRC32 implements Checksum {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/util/zip/CheckedInputStream.java
--- a/jdk/src/java.base/share/classes/java/util/zip/CheckedInputStream.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/util/zip/CheckedInputStream.java Wed Jul 05 23:40:06 2017 +0200
@@ -35,6 +35,7 @@
*
* @see Checksum
* @author David Connelly
+ * @since 1.1
*/
public
class CheckedInputStream extends FilterInputStream {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/util/zip/CheckedOutputStream.java
--- a/jdk/src/java.base/share/classes/java/util/zip/CheckedOutputStream.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/util/zip/CheckedOutputStream.java Wed Jul 05 23:40:06 2017 +0200
@@ -36,6 +36,7 @@
*
* @see Checksum
* @author David Connelly
+ * @since 1.1
*/
public
class CheckedOutputStream extends FilterOutputStream {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/util/zip/Checksum.java
--- a/jdk/src/java.base/share/classes/java/util/zip/Checksum.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/util/zip/Checksum.java Wed Jul 05 23:40:06 2017 +0200
@@ -30,6 +30,7 @@
* An interface representing a data checksum.
*
* @author David Connelly
+ * @since 1.1
*/
public interface Checksum {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/util/zip/DataFormatException.java
--- a/jdk/src/java.base/share/classes/java/util/zip/DataFormatException.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/util/zip/DataFormatException.java Wed Jul 05 23:40:06 2017 +0200
@@ -29,6 +29,7 @@
* Signals that a data format error has occurred.
*
* @author David Connelly
+ * @since 1.1
*/
public
class DataFormatException extends Exception {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/util/zip/Deflater.java
--- a/jdk/src/java.base/share/classes/java/util/zip/Deflater.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/util/zip/Deflater.java Wed Jul 05 23:40:06 2017 +0200
@@ -69,6 +69,7 @@
*
* @see Inflater
* @author David Connelly
+ * @since 1.1
*/
public
class Deflater {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/util/zip/DeflaterOutputStream.java
--- a/jdk/src/java.base/share/classes/java/util/zip/DeflaterOutputStream.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/util/zip/DeflaterOutputStream.java Wed Jul 05 23:40:06 2017 +0200
@@ -37,6 +37,7 @@
*
* @see Deflater
* @author David Connelly
+ * @since 1.1
*/
public
class DeflaterOutputStream extends FilterOutputStream {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/util/zip/GZIPInputStream.java
--- a/jdk/src/java.base/share/classes/java/util/zip/GZIPInputStream.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/util/zip/GZIPInputStream.java Wed Jul 05 23:40:06 2017 +0200
@@ -38,6 +38,7 @@
*
* @see InflaterInputStream
* @author David Connelly
+ * @since 1.1
*
*/
public
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/util/zip/GZIPOutputStream.java
--- a/jdk/src/java.base/share/classes/java/util/zip/GZIPOutputStream.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/util/zip/GZIPOutputStream.java Wed Jul 05 23:40:06 2017 +0200
@@ -32,6 +32,7 @@
* This class implements a stream filter for writing compressed data in
* the GZIP file format.
* @author David Connelly
+ * @since 1.1
*
*/
public
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/util/zip/Inflater.java
--- a/jdk/src/java.base/share/classes/java/util/zip/Inflater.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/util/zip/Inflater.java Wed Jul 05 23:40:06 2017 +0200
@@ -68,6 +68,7 @@
*
* @see Deflater
* @author David Connelly
+ * @since 1.1
*
*/
public
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/util/zip/InflaterInputStream.java
--- a/jdk/src/java.base/share/classes/java/util/zip/InflaterInputStream.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/util/zip/InflaterInputStream.java Wed Jul 05 23:40:06 2017 +0200
@@ -37,6 +37,7 @@
*
* @see Inflater
* @author David Connelly
+ * @since 1.1
*/
public
class InflaterInputStream extends FilterInputStream {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/util/zip/ZipConstants.java
--- a/jdk/src/java.base/share/classes/java/util/zip/ZipConstants.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/util/zip/ZipConstants.java Wed Jul 05 23:40:06 2017 +0200
@@ -30,6 +30,7 @@
* which manipulate ZIP files.
*
* @author David Connelly
+ * @since 1.1
*/
interface ZipConstants {
/*
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/util/zip/ZipEntry.java
--- a/jdk/src/java.base/share/classes/java/util/zip/ZipEntry.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/util/zip/ZipEntry.java Wed Jul 05 23:40:06 2017 +0200
@@ -39,6 +39,7 @@
* This class is used to represent a ZIP file entry.
*
* @author David Connelly
+ * @since 1.1
*/
public
class ZipEntry implements ZipConstants, Cloneable {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/util/zip/ZipFile.java
--- a/jdk/src/java.base/share/classes/java/util/zip/ZipFile.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/util/zip/ZipFile.java Wed Jul 05 23:40:06 2017 +0200
@@ -70,6 +70,7 @@
* thrown.
*
* @author David Connelly
+ * @since 1.1
*/
public
class ZipFile implements ZipConstants, Closeable {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/util/zip/ZipInputStream.java
--- a/jdk/src/java.base/share/classes/java/util/zip/ZipInputStream.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/util/zip/ZipInputStream.java Wed Jul 05 23:40:06 2017 +0200
@@ -40,6 +40,7 @@
* entries.
*
* @author David Connelly
+ * @since 1.1
*/
public
class ZipInputStream extends InflaterInputStream implements ZipConstants {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/util/zip/ZipOutputStream.java
--- a/jdk/src/java.base/share/classes/java/util/zip/ZipOutputStream.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/util/zip/ZipOutputStream.java Wed Jul 05 23:40:06 2017 +0200
@@ -41,6 +41,7 @@
* entries.
*
* @author David Connelly
+ * @since 1.1
*/
public
class ZipOutputStream extends DeflaterOutputStream implements ZipConstants {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/java/util/zip/package-info.java
--- a/jdk/src/java.base/share/classes/java/util/zip/package-info.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/util/zip/package-info.java Wed Jul 05 23:40:06 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -37,13 +37,13 @@
* Info-ZIP Application Note 970311 - a detailed description of
* the Info-ZIP format upon which the {@code java.util.zip} classes
* are based.
- * - An implementation may optionally support the
+ *
- An implementation may optionally support the
* ZIP64(tm) format extensions defined by the
*
* PKWARE ZIP File Format Specification. The ZIP64(tm) format
* extensions are used to overcome the size limitations of the
* original ZIP format.
- *
- APPENDIX D of
+ *
- APPENDIX D of
*
* PKWARE ZIP File Format Specification - Language Encoding Flag
* (EFS) to encode ZIP entry filename and comment fields using UTF-8.
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/javax/crypto/KeyGenerator.java
--- a/jdk/src/java.base/share/classes/javax/crypto/KeyGenerator.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/javax/crypto/KeyGenerator.java Wed Jul 05 23:40:06 2017 +0200
@@ -83,6 +83,15 @@
*
In case the client does not explicitly initialize the KeyGenerator
* (via a call to an {@code init} method), each provider must
* supply (and document) a default initialization.
+ * See the Keysize Restriction sections of the
+ *
+ * JDK Providers
+ * document for information on the KeyGenerator defaults used by
+ * JDK providers.
+ * However, note that defaults may vary across different providers.
+ * Additionally, the default value for a provider may change in a future
+ * version. Therefore, it is recommended to explicitly initialize the
+ * KeyGenerator instead of relying on provider-specific defaults.
*
* Every implementation of the Java platform is required to support the
* following standard {@code KeyGenerator} algorithms with the keysizes in
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/javax/crypto/KeyGeneratorSpi.java
--- a/jdk/src/java.base/share/classes/javax/crypto/KeyGeneratorSpi.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/javax/crypto/KeyGeneratorSpi.java Wed Jul 05 23:40:06 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -35,6 +35,19 @@
* cryptographic service provider who wishes to supply the implementation
* of a key generator for a particular algorithm.
*
+ * In case the client does not explicitly initialize the KeyGenerator
+ * (via a call to an {@code init} method), each provider must
+ * supply (and document) a default initialization.
+ * See the Keysize Restriction sections of the
+ *
+ * JDK Providers
+ * document for information on the KeyGenerator defaults used by
+ * JDK providers.
+ * However, note that defaults may vary across different providers.
+ * Additionally, the default value for a provider may change in a future
+ * version. Therefore, it is recommended to explicitly initialize the
+ * KeyGenerator instead of relying on provider-specific defaults.
+ *
* @author Jan Luehe
*
* @see SecretKey
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/javax/security/auth/AuthPermission.java
--- a/jdk/src/java.base/share/classes/javax/security/auth/AuthPermission.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/javax/security/auth/AuthPermission.java Wed Jul 05 23:40:06 2017 +0200
@@ -139,6 +139,7 @@
* @implNote
* Implementations may define additional target names, but should use naming
* conventions such as reverse domain name notation to avoid name clashes.
+ * @since 1.4
*/
public final class AuthPermission extends
java.security.BasicPermission {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/javax/security/auth/DestroyFailedException.java
--- a/jdk/src/java.base/share/classes/javax/security/auth/DestroyFailedException.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/javax/security/auth/DestroyFailedException.java Wed Jul 05 23:40:06 2017 +0200
@@ -32,6 +32,7 @@
* the {@code Destroyable} interface when the {@code destroy}
* method fails.
*
+ * @since 1.4
*/
public class DestroyFailedException extends Exception {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/javax/security/auth/Destroyable.java
--- a/jdk/src/java.base/share/classes/javax/security/auth/Destroyable.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/javax/security/auth/Destroyable.java Wed Jul 05 23:40:06 2017 +0200
@@ -29,6 +29,7 @@
* Objects such as credentials may optionally implement this interface
* to provide the capability to destroy its contents.
*
+ * @since 1.4
* @see javax.security.auth.Subject
*/
public interface Destroyable {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/javax/security/auth/Policy.java
--- a/jdk/src/java.base/share/classes/javax/security/auth/Policy.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/javax/security/auth/Policy.java Wed Jul 05 23:40:06 2017 +0200
@@ -153,6 +153,7 @@
* These two APIs provide callers the means to query the
* Policy for Principal-based Permission entries.
*
+ * @since 1.4
* @see java.security.Security security properties
*/
@Deprecated(since="1.4")
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/javax/security/auth/PrivateCredentialPermission.java
--- a/jdk/src/java.base/share/classes/javax/security/auth/PrivateCredentialPermission.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/javax/security/auth/PrivateCredentialPermission.java Wed Jul 05 23:40:06 2017 +0200
@@ -100,6 +100,7 @@
* "a.b.Principal" with the name, "duke", and "c.d.Principal", with the name,
* "dukette".
*
+ * @since 1.4
*/
public final class PrivateCredentialPermission extends Permission {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/javax/security/auth/RefreshFailedException.java
--- a/jdk/src/java.base/share/classes/javax/security/auth/RefreshFailedException.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/javax/security/auth/RefreshFailedException.java Wed Jul 05 23:40:06 2017 +0200
@@ -32,6 +32,7 @@
* the {@code Refreshable} interface when the {@code refresh}
* method fails.
*
+ * @since 1.4
*/
public class RefreshFailedException extends Exception {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/javax/security/auth/Refreshable.java
--- a/jdk/src/java.base/share/classes/javax/security/auth/Refreshable.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/javax/security/auth/Refreshable.java Wed Jul 05 23:40:06 2017 +0200
@@ -32,6 +32,7 @@
* may implement this interface to allow callers to refresh the time period
* for which it is valid.
*
+ * @since 1.4
* @see javax.security.auth.Subject
*/
public interface Refreshable {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/javax/security/auth/Subject.java
--- a/jdk/src/java.base/share/classes/javax/security/auth/Subject.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/javax/security/auth/Subject.java Wed Jul 05 23:40:06 2017 +0200
@@ -94,6 +94,7 @@
* {@code Principal} implementations associated with Subjects
* must implement {@code Serializable}.
*
+ * @since 1.4
* @see java.security.Principal
* @see java.security.DomainCombiner
*/
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/javax/security/auth/SubjectDomainCombiner.java
--- a/jdk/src/java.base/share/classes/javax/security/auth/SubjectDomainCombiner.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/javax/security/auth/SubjectDomainCombiner.java Wed Jul 05 23:40:06 2017 +0200
@@ -43,6 +43,7 @@
* with Principals from the {@code Subject} associated with this
* {@code SubjectDomainCombiner}.
*
+ * @since 1.4
*/
public class SubjectDomainCombiner implements java.security.DomainCombiner {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/javax/security/auth/callback/Callback.java
--- a/jdk/src/java.base/share/classes/javax/security/auth/callback/Callback.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/javax/security/auth/callback/Callback.java Wed Jul 05 23:40:06 2017 +0200
@@ -40,6 +40,7 @@
* if appropriate, to return requested information back to the
* underlying security services.
*
+ * @since 1.4
* @see javax.security.auth.callback.CallbackHandler
* @see javax.security.auth.callback.ChoiceCallback
* @see javax.security.auth.callback.ConfirmationCallback
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/javax/security/auth/callback/CallbackHandler.java
--- a/jdk/src/java.base/share/classes/javax/security/auth/callback/CallbackHandler.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/javax/security/auth/callback/CallbackHandler.java Wed Jul 05 23:40:06 2017 +0200
@@ -63,6 +63,7 @@
* All default handler implementations must provide a public
* zero-argument constructor.
*
+ * @since 1.4
* @see java.security.Security security properties
*/
public interface CallbackHandler {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/javax/security/auth/callback/ChoiceCallback.java
--- a/jdk/src/java.base/share/classes/javax/security/auth/callback/ChoiceCallback.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/javax/security/auth/callback/ChoiceCallback.java Wed Jul 05 23:40:06 2017 +0200
@@ -31,6 +31,7 @@
* method of a {@code CallbackHandler} to display a list of choices
* and to retrieve the selected choice(s).
*
+ * @since 1.4
* @see javax.security.auth.callback.CallbackHandler
*/
public class ChoiceCallback implements Callback, java.io.Serializable {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/javax/security/auth/callback/ConfirmationCallback.java
--- a/jdk/src/java.base/share/classes/javax/security/auth/callback/ConfirmationCallback.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/javax/security/auth/callback/ConfirmationCallback.java Wed Jul 05 23:40:06 2017 +0200
@@ -31,6 +31,7 @@
* method of a {@code CallbackHandler} to ask for YES/NO,
* OK/CANCEL, YES/NO/CANCEL or other similar confirmations.
*
+ * @since 1.4
* @see javax.security.auth.callback.CallbackHandler
*/
public class ConfirmationCallback implements Callback, java.io.Serializable {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/javax/security/auth/callback/LanguageCallback.java
--- a/jdk/src/java.base/share/classes/javax/security/auth/callback/LanguageCallback.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/javax/security/auth/callback/LanguageCallback.java Wed Jul 05 23:40:06 2017 +0200
@@ -33,6 +33,7 @@
* method of a {@code CallbackHandler} to retrieve the {@code Locale}
* used for localizing text.
*
+ * @since 1.4
* @see javax.security.auth.callback.CallbackHandler
*/
public class LanguageCallback implements Callback, java.io.Serializable {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/javax/security/auth/callback/NameCallback.java
--- a/jdk/src/java.base/share/classes/javax/security/auth/callback/NameCallback.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/javax/security/auth/callback/NameCallback.java Wed Jul 05 23:40:06 2017 +0200
@@ -30,6 +30,7 @@
* {@code NameCallback} to the {@code handle}
* method of a {@code CallbackHandler} to retrieve name information.
*
+ * @since 1.4
* @see javax.security.auth.callback.CallbackHandler
*/
public class NameCallback implements Callback, java.io.Serializable {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/javax/security/auth/callback/PasswordCallback.java
--- a/jdk/src/java.base/share/classes/javax/security/auth/callback/PasswordCallback.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/javax/security/auth/callback/PasswordCallback.java Wed Jul 05 23:40:06 2017 +0200
@@ -30,6 +30,7 @@
* {@code PasswordCallback} to the {@code handle}
* method of a {@code CallbackHandler} to retrieve password information.
*
+ * @since 1.4
* @see javax.security.auth.callback.CallbackHandler
*/
public class PasswordCallback implements Callback, java.io.Serializable {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/javax/security/auth/callback/TextInputCallback.java
--- a/jdk/src/java.base/share/classes/javax/security/auth/callback/TextInputCallback.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/javax/security/auth/callback/TextInputCallback.java Wed Jul 05 23:40:06 2017 +0200
@@ -31,6 +31,7 @@
* method of a {@code CallbackHandler} to retrieve generic text
* information.
*
+ * @since 1.4
* @see javax.security.auth.callback.CallbackHandler
*/
public class TextInputCallback implements Callback, java.io.Serializable {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/javax/security/auth/callback/TextOutputCallback.java
--- a/jdk/src/java.base/share/classes/javax/security/auth/callback/TextOutputCallback.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/javax/security/auth/callback/TextOutputCallback.java Wed Jul 05 23:40:06 2017 +0200
@@ -31,6 +31,7 @@
* method of a {@code CallbackHandler} to display information messages,
* warning messages and error messages.
*
+ * @since 1.4
* @see javax.security.auth.callback.CallbackHandler
*/
public class TextOutputCallback implements Callback, java.io.Serializable {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/javax/security/auth/callback/UnsupportedCallbackException.java
--- a/jdk/src/java.base/share/classes/javax/security/auth/callback/UnsupportedCallbackException.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/javax/security/auth/callback/UnsupportedCallbackException.java Wed Jul 05 23:40:06 2017 +0200
@@ -29,6 +29,7 @@
* Signals that a {@code CallbackHandler} does not
* recognize a particular {@code Callback}.
*
+ * @since 1.4
*/
public class UnsupportedCallbackException extends Exception {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/javax/security/auth/login/AccountExpiredException.java
--- a/jdk/src/java.base/share/classes/javax/security/auth/login/AccountExpiredException.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/javax/security/auth/login/AccountExpiredException.java Wed Jul 05 23:40:06 2017 +0200
@@ -35,6 +35,7 @@
* throws this exception to notify the application. The application can
* then take the appropriate steps to notify the user.
*
+ * @since 1.4
*/
public class AccountExpiredException extends AccountException {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/javax/security/auth/login/AppConfigurationEntry.java
--- a/jdk/src/java.base/share/classes/javax/security/auth/login/AppConfigurationEntry.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/javax/security/auth/login/AppConfigurationEntry.java Wed Jul 05 23:40:06 2017 +0200
@@ -39,6 +39,7 @@
* options. Please refer to the {@code Configuration} class for
* more information on the different control flags and their semantics.
*
+ * @since 1.4
* @see javax.security.auth.login.Configuration
*/
public class AppConfigurationEntry {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/javax/security/auth/login/Configuration.java
--- a/jdk/src/java.base/share/classes/javax/security/auth/login/Configuration.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/javax/security/auth/login/Configuration.java Wed Jul 05 23:40:06 2017 +0200
@@ -182,6 +182,7 @@
* Java Security Standard Algorithm Names Specification
* for a list of standard Configuration types.
*
+ * @since 1.4
* @see javax.security.auth.login.LoginContext
* @see java.security.Security security properties
*/
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/javax/security/auth/login/CredentialExpiredException.java
--- a/jdk/src/java.base/share/classes/javax/security/auth/login/CredentialExpiredException.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/javax/security/auth/login/CredentialExpiredException.java Wed Jul 05 23:40:06 2017 +0200
@@ -37,6 +37,7 @@
* the application. The application can then take the appropriate
* steps to assist the user in updating the password.
*
+ * @since 1.4
*/
public class CredentialExpiredException extends CredentialException {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/javax/security/auth/login/FailedLoginException.java
--- a/jdk/src/java.base/share/classes/javax/security/auth/login/FailedLoginException.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/javax/security/auth/login/FailedLoginException.java Wed Jul 05 23:40:06 2017 +0200
@@ -32,6 +32,7 @@
* For example, a {@code LoginModule} throws this exception if
* the user entered an incorrect password.
*
+ * @since 1.4
*/
public class FailedLoginException extends LoginException {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/javax/security/auth/login/LoginContext.java
--- a/jdk/src/java.base/share/classes/javax/security/auth/login/LoginContext.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/javax/security/auth/login/LoginContext.java Wed Jul 05 23:40:06 2017 +0200
@@ -182,6 +182,7 @@
*
*
*
+ * @since 1.4
* @see java.security.Security
* @see javax.security.auth.AuthPermission
* @see javax.security.auth.Subject
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/javax/security/auth/login/LoginException.java
--- a/jdk/src/java.base/share/classes/javax/security/auth/login/LoginException.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/javax/security/auth/login/LoginException.java Wed Jul 05 23:40:06 2017 +0200
@@ -28,6 +28,7 @@
/**
* This is the basic login exception.
*
+ * @since 1.4
* @see javax.security.auth.login.LoginContext
*/
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/javax/security/auth/spi/LoginModule.java
--- a/jdk/src/java.base/share/classes/javax/security/auth/spi/LoginModule.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/javax/security/auth/spi/LoginModule.java Wed Jul 05 23:40:06 2017 +0200
@@ -122,6 +122,7 @@
* no arguments. This allows classes which load the {@code LoginModule}
* to instantiate it.
*
+ * @since 1.4
* @see javax.security.auth.login.LoginContext
* @see javax.security.auth.login.Configuration
*/
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/javax/security/auth/x500/X500PrivateCredential.java
--- a/jdk/src/java.base/share/classes/javax/security/auth/x500/X500PrivateCredential.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/javax/security/auth/x500/X500PrivateCredential.java Wed Jul 05 23:40:06 2017 +0200
@@ -36,6 +36,7 @@
* This enables looking up the private credentials for an X.500 principal
* in a subject.
*
+ * @since 1.4
*/
public final class X500PrivateCredential implements Destroyable {
private X509Certificate cert;
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/sun/security/tools/keytool/Main.java
--- a/jdk/src/java.base/share/classes/sun/security/tools/keytool/Main.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/tools/keytool/Main.java Wed Jul 05 23:40:06 2017 +0200
@@ -181,7 +181,7 @@
enum Command {
CERTREQ("Generates.a.certificate.request",
ALIAS, SIGALG, FILEOUT, KEYPASS, KEYSTORE, DNAME,
- STOREPASS, STORETYPE, PROVIDERNAME, ADDPROVIDER,
+ EXT, STOREPASS, STORETYPE, PROVIDERNAME, ADDPROVIDER,
PROVIDERCLASS, PROVIDERPATH, V, PROTECTED),
CHANGEALIAS("Changes.an.entry.s.alias",
ALIAS, DESTALIAS, KEYPASS, KEYSTORE, CACERTS, STOREPASS,
@@ -250,12 +250,12 @@
KEYSTORE, STOREPASS, PROVIDERNAME, ADDPROVIDER,
PROVIDERCLASS, PROVIDERPATH, V),
SELFCERT("Generates.a.self.signed.certificate",
- ALIAS, SIGALG, DNAME, STARTDATE, VALIDITY, KEYPASS,
+ ALIAS, SIGALG, DNAME, STARTDATE, EXT, VALIDITY, KEYPASS,
STORETYPE, KEYSTORE, STOREPASS, PROVIDERNAME,
ADDPROVIDER, PROVIDERCLASS, PROVIDERPATH, V),
GENCRL("Generates.CRL",
RFC, FILEOUT, ID,
- ALIAS, SIGALG, EXT, KEYPASS, KEYSTORE,
+ ALIAS, SIGALG, KEYPASS, KEYSTORE,
STOREPASS, STORETYPE, PROVIDERNAME, ADDPROVIDER,
PROVIDERCLASS, PROVIDERPATH, V, PROTECTED),
IDENTITYDB("Imports.entries.from.a.JDK.1.1.x.style.identity.database",
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/classes/sun/security/util/DerInputBuffer.java
--- a/jdk/src/java.base/share/classes/sun/security/util/DerInputBuffer.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/util/DerInputBuffer.java Wed Jul 05 23:40:06 2017 +0200
@@ -27,7 +27,6 @@
import java.io.ByteArrayInputStream;
import java.io.IOException;
-import java.io.OutputStream;
import java.math.BigInteger;
import java.util.Date;
import sun.util.calendar.CalendarDate;
@@ -275,7 +274,7 @@
if (len > available())
throw new IOException("short read of DER Generalized Time");
- if (len < 13 || len > 23)
+ if (len < 13)
throw new IOException("DER Generalized Time length error");
return getTime(len, true);
@@ -350,7 +349,7 @@
*/
millis = 0;
- if (len > 2 && len < 12) {
+ if (len > 2) {
second = 10 * Character.digit((char)buf[pos++], 10);
second += Character.digit((char)buf[pos++], 10);
len -= 2;
@@ -358,31 +357,30 @@
if (buf[pos] == '.' || buf[pos] == ',') {
len --;
pos++;
- // handle upto milisecond precision only
int precision = 0;
- int peek = pos;
- while (buf[peek] != 'Z' &&
- buf[peek] != '+' &&
- buf[peek] != '-') {
- peek++;
+ while (buf[pos] != 'Z' &&
+ buf[pos] != '+' &&
+ buf[pos] != '-') {
+ // Validate all digits in the fractional part but
+ // store millisecond precision only
+ int thisDigit = Character.digit((char)buf[pos], 10);
precision++;
+ pos++;
+ switch (precision) {
+ case 1:
+ millis += 100 * thisDigit;
+ break;
+ case 2:
+ millis += 10 * thisDigit;
+ break;
+ case 3:
+ millis += thisDigit;
+ break;
+ }
}
- switch (precision) {
- case 3:
- millis += 100 * Character.digit((char)buf[pos++], 10);
- millis += 10 * Character.digit((char)buf[pos++], 10);
- millis += Character.digit((char)buf[pos++], 10);
- break;
- case 2:
- millis += 100 * Character.digit((char)buf[pos++], 10);
- millis += 10 * Character.digit((char)buf[pos++], 10);
- break;
- case 1:
- millis += 100 * Character.digit((char)buf[pos++], 10);
- break;
- default:
- throw new IOException("Parse " + type +
- " time, unsupported precision for seconds value");
+ if (precision == 0) {
+ throw new IOException("Parse " + type +
+ " time, empty fractional part");
}
len -= precision;
}
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/native/launcher/defines.h
--- a/jdk/src/java.base/share/native/launcher/defines.h Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/native/launcher/defines.h Wed Jul 05 23:40:06 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -44,17 +44,24 @@
#define DOT_VERSION "0.0"
#ifdef JAVA_ARGS
-#define HAS_JAVA_ARGS JNI_TRUE
#ifdef PROGNAME
static const char* const_progname = PROGNAME;
#else
static char* const_progname = NULL;
#endif
static const char* const_jargs[] = JAVA_ARGS;
+#ifdef EXTRA_JAVA_ARGS
+static const char* const_extra_jargs[] = EXTRA_JAVA_ARGS;
+#else
+static const char** const_extra_jargs = NULL;
+#endif
#else /* !JAVA_ARGS */
-#define HAS_JAVA_ARGS JNI_FALSE
+#ifdef EXTRA_JAVA_ARGS
+#error "EXTRA_JAVA_ARGS defined without JAVA_ARGS"
+#endif
static const char* const_progname = "java";
static const char** const_jargs = NULL;
+static const char** const_extra_jargs = NULL;
static const char* const_appclasspath[] = { NULL };
#endif /* JAVA_ARGS */
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/native/launcher/main.c
--- a/jdk/src/java.base/share/native/launcher/main.c Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/native/launcher/main.c Wed Jul 05 23:40:06 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1995, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -85,6 +85,8 @@
{
int margc;
char** margv;
+ int jargc;
+ char** jargv;
const jboolean const_javaw = JNI_TRUE;
__initenv = _environ;
@@ -95,10 +97,47 @@
{
int margc;
char** margv;
+ int jargc;
+ char** jargv;
const jboolean const_javaw = JNI_FALSE;
#endif /* JAVAW */
+ {
+ int i, main_jargc, extra_jargc;
+ JLI_List list;
- JLI_InitArgProcessing(!HAS_JAVA_ARGS, const_disable_argfile);
+ main_jargc = (sizeof(const_jargs) / sizeof(char *)) > 1
+ ? sizeof(const_jargs) / sizeof(char *)
+ : 0; // ignore the null terminator index
+
+ extra_jargc = (sizeof(const_extra_jargs) / sizeof(char *)) > 1
+ ? sizeof(const_extra_jargs) / sizeof(char *)
+ : 0; // ignore the null terminator index
+
+ if (main_jargc > 0 && extra_jargc > 0) { // combine extra java args
+ jargc = main_jargc + extra_jargc;
+ list = JLI_List_new(jargc + 1);
+
+ for (i = 0 ; i < extra_jargc; i++) {
+ JLI_List_add(list, JLI_StringDup(const_extra_jargs[i]));
+ }
+
+ for (i = 0 ; i < main_jargc ; i++) {
+ JLI_List_add(list, JLI_StringDup(const_jargs[i]));
+ }
+
+ // terminate the list
+ JLI_List_add(list, NULL);
+ jargv = list->elements;
+ } else if (extra_jargc > 0) { // should never happen
+ fprintf(stderr, "EXTRA_JAVA_ARGS defined without JAVA_ARGS");
+ abort();
+ } else { // no extra args, business as usual
+ jargc = main_jargc;
+ jargv = (char **) const_jargs;
+ }
+ }
+
+ JLI_InitArgProcessing(jargc > 0, const_disable_argfile);
#ifdef _WIN32
{
@@ -164,12 +203,12 @@
}
#endif /* WIN32 */
return JLI_Launch(margc, margv,
- sizeof(const_jargs) / sizeof(char *), const_jargs,
+ jargc, (const char**) jargv,
0, NULL,
VERSION_STRING,
DOT_VERSION,
(const_progname != NULL) ? const_progname : *margv,
(const_launcher != NULL) ? const_launcher : *margv,
- HAS_JAVA_ARGS,
+ jargc > 0,
const_cpwildcard, const_javaw, 0);
}
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/native/libjli/args.c
--- a/jdk/src/java.base/share/native/libjli/args.c Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/native/libjli/args.c Wed Jul 05 23:40:06 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -78,7 +78,7 @@
static jboolean stopExpansion = JNI_FALSE;
static jboolean relaunch = JNI_FALSE;
-void JLI_InitArgProcessing(jboolean isJava, jboolean disableArgFile) {
+void JLI_InitArgProcessing(jboolean hasJavaArgs, jboolean disableArgFile) {
// No expansion for relaunch
if (argsCount != 1) {
relaunch = JNI_TRUE;
@@ -91,7 +91,7 @@
expectingNoDashArg = JNI_FALSE;
// for tools, this value remains 0 all the time.
- firstAppArgIndex = isJava ? NOT_FOUND : 0;
+ firstAppArgIndex = hasJavaArgs ? 0: NOT_FOUND;
}
int JLI_GetAppArgIndex() {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/native/libjli/java.c
--- a/jdk/src/java.base/share/native/libjli/java.c Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/native/libjli/java.c Wed Jul 05 23:40:06 2017 +0200
@@ -246,6 +246,10 @@
DumpState();
if (JLI_IsTraceLauncher()) {
int i;
+ printf("Java args:\n");
+ for (i = 0; i < jargc ; i++) {
+ printf("jargv[%d] = %s\n", i, jargv[i]);
+ }
printf("Command line args:\n");
for (i = 0; i < argc ; i++) {
printf("argv[%d] = %s\n", i, argv[i]);
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.base/share/native/libjli/jli_util.h
--- a/jdk/src/java.base/share/native/libjli/jli_util.h Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.base/share/native/libjli/jli_util.h Wed Jul 05 23:40:06 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -133,7 +133,7 @@
char *JLI_List_join(JLI_List l, char sep);
JLI_List JLI_List_split(const char *str, char sep);
-void JLI_InitArgProcessing(jboolean isJava, jboolean disableArgFile);
+void JLI_InitArgProcessing(jboolean hasJavaArgs, jboolean disableArgFile);
JLI_List JLI_PreprocessArg(const char *arg);
jboolean JLI_AddArgsFromEnvVar(JLI_List args, const char *var_name);
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.datatransfer/share/classes/java/awt/datatransfer/Clipboard.java
--- a/jdk/src/java.datatransfer/share/classes/java/awt/datatransfer/Clipboard.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.datatransfer/share/classes/java/awt/datatransfer/Clipboard.java Wed Jul 05 23:40:06 2017 +0200
@@ -48,6 +48,7 @@
*
* @author Amy Fowler
* @author Alexander Gerasimov
+ * @since 1.1
*/
public class Clipboard {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.datatransfer/share/classes/java/awt/datatransfer/ClipboardOwner.java
--- a/jdk/src/java.datatransfer/share/classes/java/awt/datatransfer/ClipboardOwner.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.datatransfer/share/classes/java/awt/datatransfer/ClipboardOwner.java Wed Jul 05 23:40:06 2017 +0200
@@ -39,6 +39,7 @@
* @see java.awt.datatransfer.Clipboard
*
* @author Amy Fowler
+ * @since 1.1
*/
public interface ClipboardOwner {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.datatransfer/share/classes/java/awt/datatransfer/DataFlavor.java
--- a/jdk/src/java.datatransfer/share/classes/java/awt/datatransfer/DataFlavor.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.datatransfer/share/classes/java/awt/datatransfer/DataFlavor.java Wed Jul 05 23:40:06 2017 +0200
@@ -112,6 +112,7 @@
* @author Blake Sullivan
* @author Laurence P. G. Cable
* @author Jeff Dunn
+ * @since 1.1
*/
public class DataFlavor implements Externalizable, Cloneable {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.datatransfer/share/classes/java/awt/datatransfer/StringSelection.java
--- a/jdk/src/java.datatransfer/share/classes/java/awt/datatransfer/StringSelection.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.datatransfer/share/classes/java/awt/datatransfer/StringSelection.java Wed Jul 05 23:40:06 2017 +0200
@@ -39,6 +39,7 @@
* and all equivalent flavors is deprecated. No other
* DataFlavor s are supported.
*
+ * @since 1.1
* @see java.awt.datatransfer.DataFlavor#stringFlavor
* @see java.awt.datatransfer.DataFlavor#plainTextFlavor
*/
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.datatransfer/share/classes/java/awt/datatransfer/Transferable.java
--- a/jdk/src/java.datatransfer/share/classes/java/awt/datatransfer/Transferable.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.datatransfer/share/classes/java/awt/datatransfer/Transferable.java Wed Jul 05 23:40:06 2017 +0200
@@ -37,6 +37,7 @@
* a section in The Java Tutorial, for more information.
*
* @author Amy Fowler
+ * @since 1.1
*/
public interface Transferable {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.datatransfer/share/classes/java/awt/datatransfer/UnsupportedFlavorException.java
--- a/jdk/src/java.datatransfer/share/classes/java/awt/datatransfer/UnsupportedFlavorException.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.datatransfer/share/classes/java/awt/datatransfer/UnsupportedFlavorException.java Wed Jul 05 23:40:06 2017 +0200
@@ -30,6 +30,7 @@
* @see Transferable#getTransferData
*
* @author Amy Fowler
+ * @since 1.1
*/
public class UnsupportedFlavorException extends Exception {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/java.rmi/share/classes/sun/rmi/registry/RegistryImpl.java
--- a/jdk/src/java.rmi/share/classes/sun/rmi/registry/RegistryImpl.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/java.rmi/share/classes/sun/rmi/registry/RegistryImpl.java Wed Jul 05 23:40:06 2017 +0200
@@ -102,10 +102,10 @@
private static final String REGISTRY_FILTER_PROPNAME = "sun.rmi.registry.registryFilter";
/** Registry max depth of remote invocations. **/
- private static int REGISTRY_MAX_DEPTH = 5;
+ private static final int REGISTRY_MAX_DEPTH = 20;
/** Registry maximum array size in remote invocations. **/
- private static int REGISTRY_MAX_ARRAY_SIZE = 10000;
+ private static final int REGISTRY_MAX_ARRAY_SIZE = 10000;
/**
* The registryFilter created from the value of the {@code "sun.rmi.registry.registryFilter"}
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/MultiExchange.java
--- a/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/MultiExchange.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/MultiExchange.java Wed Jul 05 23:40:06 2017 +0200
@@ -316,13 +316,14 @@
})
// 5. Handle errors and cancel any timer set
.handle((response, ex) -> {
- if (response != null) {
+ cancelTimer();
+ if (ex == null) {
+ assert response != null;
return MinimalFuture.completedFuture(response);
}
// all exceptions thrown are handled here
CompletableFuture error = getExceptionalCF(ex);
if (error == null) {
- cancelTimer();
return responseAsyncImpl();
} else {
return error;
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/SSLDelegate.java
--- a/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/SSLDelegate.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/SSLDelegate.java Wed Jul 05 23:40:06 2017 +0200
@@ -274,9 +274,7 @@
int x;
do {
if (needData) {
- do {
- x = chan.read (unwrap_src);
- } while (x == 0);
+ x = chan.read (unwrap_src);
if (x == -1) {
throw new IOException ("connection closed for reading");
}
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/internal/websocket/Receiver.java
--- a/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/internal/websocket/Receiver.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/internal/websocket/Receiver.java Wed Jul 05 23:40:06 2017 +0200
@@ -28,7 +28,6 @@
import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.channels.SelectionKey;
-import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicLong;
/*
@@ -58,23 +57,24 @@
private final Frame.Reader reader = new Frame.Reader();
private final RawChannel.RawEvent event = createHandler();
private final AtomicLong demand = new AtomicLong();
- private final CooperativeHandler handler =
- new CooperativeHandler(this::pushContinuously);
- /*
- * Used to ensure registering the channel event at most once (i.e. to avoid
- * multiple registrations).
- */
- private final AtomicBoolean readable = new AtomicBoolean();
+ private final CooperativeHandler handler;
+
private ByteBuffer data;
+ private volatile int state;
+
+ private static final int UNREGISTERED = 0;
+ private static final int AVAILABLE = 1;
+ private static final int WAITING = 2;
Receiver(MessageStreamConsumer messageConsumer, RawChannel channel) {
this.messageConsumer = messageConsumer;
this.channel = channel;
+ this.frameConsumer = new FrameConsumer(this.messageConsumer);
this.data = channel.initialByteBuffer();
- this.frameConsumer = new FrameConsumer(this.messageConsumer);
- // To ensure the initial non-final `data` will be read correctly
- // (happens-before) by reader after executing readable.get()
- readable.set(true);
+ // To ensure the initial non-final `data` will be visible
+ // (happens-before) when `handler` invokes `pushContinuously`
+ // the following assignment is done last:
+ handler = new CooperativeHandler(this::pushContinuously);
}
private RawChannel.RawEvent createHandler() {
@@ -87,7 +87,7 @@
@Override
public void handle() {
- readable.set(true);
+ state = AVAILABLE;
handler.handle();
}
};
@@ -110,54 +110,63 @@
/*
* Stops the machinery from reading and delivering messages permanently,
- * regardless of the current demand.
+ * regardless of the current demand and data availability.
*/
void close() {
handler.stop();
}
private void pushContinuously() {
- while (readable.get() && demand.get() > 0 && !handler.isStopped()) {
- pushOnce();
- }
- }
-
- private void pushOnce() {
- if (data == null && !readData()) {
- return;
- }
- try {
- reader.readFrame(data, frameConsumer); // Pushing frame parts to the consumer
- } catch (FailWebSocketException e) {
- messageConsumer.onError(e);
- return;
- }
- if (!data.hasRemaining()) {
- data = null;
+ while (!handler.isStopped()) {
+ if (data.hasRemaining()) {
+ if (demand.get() > 0) {
+ try {
+ int oldPos = data.position();
+ reader.readFrame(data, frameConsumer);
+ int newPos = data.position();
+ assert oldPos != newPos : data; // reader always consumes bytes
+ } catch (FailWebSocketException e) {
+ handler.stop();
+ messageConsumer.onError(e);
+ }
+ continue;
+ }
+ break;
+ }
+ switch (state) {
+ case WAITING:
+ return;
+ case UNREGISTERED:
+ try {
+ state = WAITING;
+ channel.registerEvent(event);
+ } catch (IOException e) {
+ handler.stop();
+ messageConsumer.onError(e);
+ }
+ return;
+ case AVAILABLE:
+ try {
+ data = channel.read();
+ } catch (IOException e) {
+ handler.stop();
+ messageConsumer.onError(e);
+ return;
+ }
+ if (data == null) { // EOF
+ handler.stop();
+ messageConsumer.onComplete();
+ return;
+ } else if (!data.hasRemaining()) { // No data at the moment
+ // Pretty much a "goto", reusing the existing code path
+ // for registration
+ state = UNREGISTERED;
+ }
+ continue;
+ default:
+ throw new InternalError(String.valueOf(state));
+ }
}
}
+}
- private boolean readData() {
- try {
- data = channel.read();
- } catch (IOException e) {
- messageConsumer.onError(e);
- return false;
- }
- if (data == null) { // EOF
- messageConsumer.onComplete();
- return false;
- } else if (!data.hasRemaining()) { // No data in the socket at the moment
- data = null;
- readable.set(false);
- try {
- channel.registerEvent(event);
- } catch (IOException e) {
- messageConsumer.onError(e);
- }
- return false;
- }
- assert data.hasRemaining();
- return true;
- }
-}
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/TEST.ROOT
--- a/jdk/test/TEST.ROOT Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/TEST.ROOT Wed Jul 05 23:40:06 2017 +0200
@@ -10,7 +10,7 @@
# randomness tests.
#
# A "headful" test requires a graphical environment to meaningfully
-# run. Tests that are not headful are "headless."
+# run. Tests that are not headful are "headless."
keys=2d dnd i18n intermittent randomness headful
@@ -18,7 +18,7 @@
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 java/lang/ProcessHandle
# 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 java/util/BitSet/stream javax/rmi com/sun/corba/cachedSocket
+exclusiveAccess.dirs=java/rmi/Naming java/util/prefs sun/management/jmxremote sun/tools/jstatd sun/security/mscapi java/util/stream java/util/Arrays/largeMemory java/util/BitSet/stream javax/rmi com/sun/corba/cachedSocket
# Group definitions
groups=TEST.groups [closed/TEST.groups]
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/TEST.groups
--- a/jdk/test/TEST.groups Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/TEST.groups Wed Jul 05 23:40:06 2017 +0200
@@ -1,4 +1,4 @@
-# Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@@ -641,6 +641,7 @@
java/security/PermissionCollection/Concurrent.java \
java/security/Principal/Implies.java \
java/security/cert/GetInstance.java \
+ java/util/Arrays/largeMemory/ParallelPrefix.java \
java/util/logging/DrainFindDeadlockTest.java \
java/util/logging/LoggingMXBeanTest.java \
java/util/logging/TestLogConfigurationDeadLock.java \
@@ -709,7 +710,6 @@
java/nio/Buffer/Chars.java \
java/nio/file/Files/StreamTest.java \
java/security/BasicPermission/Wildcard.java \
- java/util/Arrays/ParallelPrefix.java \
java/util/Arrays/SetAllTest.java \
java/util/BitSet/stream/BitSetStreamTest.java \
java/util/Collection/CollectionDefaults.java \
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/com/sun/corba/7130985/CorbaExceptionsCompileTest.java
--- a/jdk/test/com/sun/corba/7130985/CorbaExceptionsCompileTest.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/com/sun/corba/7130985/CorbaExceptionsCompileTest.java Wed Jul 05 23:40:06 2017 +0200
@@ -26,8 +26,10 @@
* @bug 7130985
* @summary Four helper classes missing in Sun JDK
* @library /lib/testlibrary /test/lib
- * @build jdk.testlibrary.*
* @modules java.corba
+ * @build jdk.test.lib.Platform
+ * jdk.test.lib.util.FileUtils
+ * jdk.testlibrary.*
* @run main CorbaExceptionsCompileTest
*/
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/com/sun/crypto/provider/CICO/PBEFunc/CipherNCFuncTest.java
--- a/jdk/test/com/sun/crypto/provider/CICO/PBEFunc/CipherNCFuncTest.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/com/sun/crypto/provider/CICO/PBEFunc/CipherNCFuncTest.java Wed Jul 05 23:40:06 2017 +0200
@@ -25,6 +25,8 @@
* @test
* @bug 8048604
* @library ../ /test/lib
+ * @build jdk.test.lib.RandomFactory
+ * @run main CipherNCFuncTest
* @summary This test verifies the assertion "There should be no transformation
* on the plaintext/ciphertext in encryption/decryption mechanism" for
* feature "NullCipher".
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/io/FilePermission/FilePermissionCollectionMerge.java
--- a/jdk/test/java/io/FilePermission/FilePermissionCollectionMerge.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/io/FilePermission/FilePermissionCollectionMerge.java Wed Jul 05 23:40:06 2017 +0200
@@ -28,6 +28,8 @@
* @summary FilePermissionCollection merges incorrectly
* @modules java.base/sun.security.util
* @library /test/lib
+ * @build jdk.test.lib.Asserts
+ * @run main FilePermissionCollectionMerge
*/
import sun.security.util.FilePermCompat;
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/io/FilePermission/Invalid.java
--- a/jdk/test/java/io/FilePermission/Invalid.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/io/FilePermission/Invalid.java Wed Jul 05 23:40:06 2017 +0200
@@ -27,6 +27,8 @@
* @bug 8167646
* @summary Better invalid FilePermission
* @library /test/lib
+ * @build jdk.test.lib.Asserts
+ * @run main Invalid
*/
import jdk.test.lib.Asserts;
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/io/FilePermission/MergeName.java
--- a/jdk/test/java/io/FilePermission/MergeName.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/io/FilePermission/MergeName.java Wed Jul 05 23:40:06 2017 +0200
@@ -37,6 +37,13 @@
* @bug 8170364
* @summary FilePermission path modified during merge
* @library /test/lib
+ * @build jdk.test.lib.Utils
+ * jdk.test.lib.Asserts
+ * jdk.test.lib.JDKToolFinder
+ * jdk.test.lib.JDKToolLauncher
+ * jdk.test.lib.Platform
+ * jdk.test.lib.process.*
+ * @run main MergeName
*/
public class MergeName {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/io/FilePermission/ReadFileOnPath.java
--- a/jdk/test/java/io/FilePermission/ReadFileOnPath.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/io/FilePermission/ReadFileOnPath.java Wed Jul 05 23:40:06 2017 +0200
@@ -27,6 +27,13 @@
* @library /lib/testlibrary /test/lib
* @modules java.base/jdk.internal.misc
* jdk.compiler
+ * @build jdk.test.lib.compiler.CompilerUtils
+ * jdk.test.lib.Utils
+ * jdk.test.lib.Asserts
+ * jdk.test.lib.JDKToolFinder
+ * jdk.test.lib.JDKToolLauncher
+ * jdk.test.lib.Platform
+ * jdk.test.lib.process.*
* @run main ReadFileOnPath
* @summary Still able to read file on the same path
*/
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/io/InputStream/ReadAllBytes.java
--- a/jdk/test/java/io/InputStream/ReadAllBytes.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/io/InputStream/ReadAllBytes.java Wed Jul 05 23:40:06 2017 +0200
@@ -33,6 +33,7 @@
* @test
* @bug 8080835
* @library /test/lib
+ * @build jdk.test.lib.RandomFactory
* @run main ReadAllBytes
* @summary Basic test for InputStream.readAllBytes
* @key randomness
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/io/InputStream/ReadNBytes.java
--- a/jdk/test/java/io/InputStream/ReadNBytes.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/io/InputStream/ReadNBytes.java Wed Jul 05 23:40:06 2017 +0200
@@ -33,6 +33,7 @@
* @test
* @bug 8080835
* @library /test/lib
+ * @build jdk.test.lib.RandomFactory
* @run main ReadNBytes
* @summary Basic test for InputStream.readNBytes
* @key randomness
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/io/Serializable/class/NonSerializableTest.java
--- a/jdk/test/java/io/Serializable/class/NonSerializableTest.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/io/Serializable/class/NonSerializableTest.java Wed Jul 05 23:40:06 2017 +0200
@@ -25,8 +25,13 @@
* @test
* @bug 4075221
* @library /test/lib
- * @build jdk.test.lib.compiler.*
- * @build jdk.test.lib.process.*
+ * @build jdk.test.lib.compiler.CompilerUtils
+ * jdk.test.lib.Utils
+ * jdk.test.lib.Asserts
+ * jdk.test.lib.JDKToolFinder
+ * jdk.test.lib.JDKToolLauncher
+ * jdk.test.lib.Platform
+ * jdk.test.lib.process.*
* @run testng/timeout=300 NonSerializableTest
* @summary Enable serialize of nonSerializable Class descriptor.
*/
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/io/Serializable/evolution/RenamePackage/RenamePackageTest.java
--- a/jdk/test/java/io/Serializable/evolution/RenamePackage/RenamePackageTest.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/io/Serializable/evolution/RenamePackage/RenamePackageTest.java Wed Jul 05 23:40:06 2017 +0200
@@ -26,7 +26,12 @@
* @bug 4087295 4785472
* @library /test/lib
* @build jdk.test.lib.compiler.CompilerUtils
- * @build jdk.test.lib.process.ProcessTools
+ * jdk.test.lib.Utils
+ * jdk.test.lib.Asserts
+ * jdk.test.lib.JDKToolFinder
+ * jdk.test.lib.JDKToolLauncher
+ * jdk.test.lib.Platform
+ * jdk.test.lib.process.*
* @build RenamePackageTest
* @run main RenamePackageTest
* @summary Enable resolveClass() to accommodate package renaming.
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/io/Serializable/failureAtomicity/FailureAtomicity.java
--- a/jdk/test/java/io/Serializable/failureAtomicity/FailureAtomicity.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/io/Serializable/failureAtomicity/FailureAtomicity.java Wed Jul 05 23:40:06 2017 +0200
@@ -27,6 +27,8 @@
* @summary Better failure atomicity for default read object.
* @modules jdk.compiler
* @library /test/lib
+ * @build jdk.test.lib.Platform
+ * jdk.test.lib.util.FileUtils
* @compile FailureAtomicity.java SerialRef.java
* @run main failureAtomicity.FailureAtomicity
*/
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/io/Serializable/serialver/classpath/ClasspathTest.java
--- a/jdk/test/java/io/Serializable/serialver/classpath/ClasspathTest.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/io/Serializable/serialver/classpath/ClasspathTest.java Wed Jul 05 23:40:06 2017 +0200
@@ -25,8 +25,12 @@
* @test
* @bug 4035147 4785472
* @library /test/lib
+ * @build jdk.test.lib.Utils
+ * @build jdk.test.lib.Asserts
+ * @build jdk.test.lib.JDKToolFinder
* @build jdk.test.lib.JDKToolLauncher
- * @build jdk.test.lib.process.ProcessTools
+ * @build jdk.test.lib.Platform
+ * @build jdk.test.lib.process.*
* @build ClasspathTest
* @run main serialver.ClasspathTest
* @summary Test the use of the -classpath switch in the serialver application.
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/io/Serializable/serialver/nested/NestedTest.java
--- a/jdk/test/java/io/Serializable/serialver/nested/NestedTest.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/io/Serializable/serialver/nested/NestedTest.java Wed Jul 05 23:40:06 2017 +0200
@@ -25,8 +25,12 @@
* @test
* @bug 4312217 4785473
* @library /test/lib
- * @build jdk.test.lib.JDKToolLauncher
- * @build jdk.test.lib.process.ProcessTools
+ * @build jdk.test.lib.Utils
+ * jdk.test.lib.Asserts
+ * jdk.test.lib.JDKToolFinder
+ * jdk.test.lib.JDKToolLauncher
+ * jdk.test.lib.Platform
+ * jdk.test.lib.process.*
* @build NestedTest
* @run main serialver.NestedTest
* @summary To test the use of nested class specification using the '.'
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/lang/Class/forName/modules/TestDriver.java
--- a/jdk/test/java/lang/Class/forName/modules/TestDriver.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/lang/Class/forName/modules/TestDriver.java Wed Jul 05 23:40:06 2017 +0200
@@ -43,7 +43,10 @@
* @summary Tests for Class.forName(Module,String)
* @library /lib/testlibrary /test/lib
* @modules jdk.compiler
- * @build jdk.test.lib.compiler.CompilerUtils jdk.testlibrary.ProcessTools
+ * @build jdk.test.lib.Platform
+ * jdk.test.lib.util.FileUtils
+ * jdk.test.lib.compiler.CompilerUtils
+ * jdk.testlibrary.ProcessTools
* TestDriver TestMain TestLayer
* @run testng TestDriver
*/
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/lang/Double/ParseHexFloatingPoint.java
--- a/jdk/test/java/lang/Double/ParseHexFloatingPoint.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/lang/Double/ParseHexFloatingPoint.java Wed Jul 05 23:40:06 2017 +0200
@@ -24,6 +24,7 @@
/*
* @test
* @library /test/lib
+ * @build jdk.test.lib.RandomFactory
* @run main ParseHexFloatingPoint
* @bug 4826774 8078672
* @summary Numerical tests for hexadecimal inputs to parse{Double, Float} (use -Dseed=X to set PRNG seed)
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/lang/Integer/BitTwiddle.java
--- a/jdk/test/java/lang/Integer/BitTwiddle.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/lang/Integer/BitTwiddle.java Wed Jul 05 23:40:06 2017 +0200
@@ -24,6 +24,7 @@
/*
* @test
* @library /test/lib
+ * @build jdk.test.lib.RandomFactory
* @run main BitTwiddle
* @bug 4495754 8078672
* @summary Basic test for int bit twiddling (use -Dseed=X to set PRNG seed)
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/lang/Long/BitTwiddle.java
--- a/jdk/test/java/lang/Long/BitTwiddle.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/lang/Long/BitTwiddle.java Wed Jul 05 23:40:06 2017 +0200
@@ -24,6 +24,7 @@
/*
* @test
* @library /test/lib
+ * @build jdk.test.lib.RandomFactory
* @run main BitTwiddle
* @bug 4495754 8078672
* @summary Basic test for long bit twiddling (use -Dseed=X to set PRNG seed)
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/lang/Math/CubeRootTests.java
--- a/jdk/test/java/lang/Math/CubeRootTests.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/lang/Math/CubeRootTests.java Wed Jul 05 23:40:06 2017 +0200
@@ -24,6 +24,7 @@
/*
* @test
* @library /test/lib
+ * @build jdk.test.lib.RandomFactory
* @run main CubeRootTests
* @bug 4347132 4939441 8078672
* @summary Tests for {Math, StrictMath}.cbrt (use -Dseed=X to set PRNG seed)
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/lang/Math/HypotTests.java
--- a/jdk/test/java/lang/Math/HypotTests.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/lang/Math/HypotTests.java Wed Jul 05 23:40:06 2017 +0200
@@ -24,6 +24,7 @@
/*
* @test
* @library /test/lib
+ * @build jdk.test.lib.RandomFactory
* @run main HypotTests
* @bug 4851638 4939441 8078672
* @summary Tests for {Math, StrictMath}.hypot (use -Dseed=X to set PRNG seed)
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/lang/Math/IeeeRecommendedTests.java
--- a/jdk/test/java/lang/Math/IeeeRecommendedTests.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/lang/Math/IeeeRecommendedTests.java Wed Jul 05 23:40:06 2017 +0200
@@ -24,6 +24,7 @@
/*
* @test
* @library /test/lib
+ * @build jdk.test.lib.RandomFactory
* @run main IeeeRecommendedTests
* @bug 4860891 4826732 4780454 4939441 4826652 8078672
* @summary Tests for IEEE 754[R] recommended functions and similar methods (use -Dseed=X to set PRNG seed)
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/lang/Math/Log1pTests.java
--- a/jdk/test/java/lang/Math/Log1pTests.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/lang/Math/Log1pTests.java Wed Jul 05 23:40:06 2017 +0200
@@ -24,6 +24,7 @@
/*
* @test
* @library /test/lib
+ * @build jdk.test.lib.RandomFactory
* @run main Log1pTests
* @bug 4851638 4939441 8078672
* @summary Tests for {Math, StrictMath}.log1p (use -Dseed=X to set PRNG seed)
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/lang/Math/MultiplicationTests.java
--- a/jdk/test/java/lang/Math/MultiplicationTests.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/lang/Math/MultiplicationTests.java Wed Jul 05 23:40:06 2017 +0200
@@ -24,6 +24,7 @@
/*
* @test
* @library /test/lib
+ * @build jdk.test.lib.RandomFactory
* @run main MultiplicationTests
* @bug 5100935
* @summary Tests for multiplication methods (use -Dseed=X to set PRNG seed)
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/lang/ProcessHandle/Basic.java
--- a/jdk/test/java/lang/ProcessHandle/Basic.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/lang/ProcessHandle/Basic.java Wed Jul 05 23:40:06 2017 +0200
@@ -39,6 +39,12 @@
* @library /test/lib
* @modules java.base/jdk.internal.misc
* jdk.management
+ * @build jdk.test.lib.Utils
+ * jdk.test.lib.Asserts
+ * jdk.test.lib.JDKToolFinder
+ * jdk.test.lib.JDKToolLauncher
+ * jdk.test.lib.Platform
+ * jdk.test.lib.process.*
* @run testng Basic
* @summary Basic tests for ProcessHandler
* @author Roger Riggs
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/lang/ProcessHandle/InfoTest.java
--- a/jdk/test/java/lang/ProcessHandle/InfoTest.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/lang/ProcessHandle/InfoTest.java Wed Jul 05 23:40:06 2017 +0200
@@ -51,7 +51,12 @@
* @library /test/lib
* @modules java.base/jdk.internal.misc
* jdk.management
- * @build jdk.test.lib.Platform jdk.test.lib.Utils
+ * @build jdk.test.lib.Utils
+ * jdk.test.lib.Asserts
+ * jdk.test.lib.JDKToolFinder
+ * jdk.test.lib.JDKToolLauncher
+ * jdk.test.lib.Platform
+ * jdk.test.lib.process.*
* @run testng InfoTest
* @summary Functions of ProcessHandle.Info
* @author Roger Riggs
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/lang/ProcessHandle/OnExitTest.java
--- a/jdk/test/java/lang/ProcessHandle/OnExitTest.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/lang/ProcessHandle/OnExitTest.java Wed Jul 05 23:40:06 2017 +0200
@@ -43,7 +43,12 @@
* @library /test/lib
* @modules java.base/jdk.internal.misc
* jdk.management
- * @build jdk.test.lib.Platform jdk.test.lib.Utils
+ * @build jdk.test.lib.Utils
+ * jdk.test.lib.Asserts
+ * jdk.test.lib.JDKToolFinder
+ * jdk.test.lib.JDKToolLauncher
+ * jdk.test.lib.Platform
+ * jdk.test.lib.process.*
* @run testng OnExitTest
* @summary Functions of Process.onExit and ProcessHandle.onExit
* @author Roger Riggs
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/lang/ProcessHandle/TreeTest.java
--- a/jdk/test/java/lang/ProcessHandle/TreeTest.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/lang/ProcessHandle/TreeTest.java Wed Jul 05 23:40:06 2017 +0200
@@ -48,6 +48,11 @@
* @modules java.base/jdk.internal.misc
* jdk.management
* @build jdk.test.lib.Utils
+ * jdk.test.lib.Asserts
+ * jdk.test.lib.JDKToolFinder
+ * jdk.test.lib.JDKToolLauncher
+ * jdk.test.lib.Platform
+ * jdk.test.lib.process.*
* @run testng/othervm TreeTest
* @summary Test counting and JavaChild.spawning and counting of Processes.
* @author Roger Riggs
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/lang/StackTraceElement/WithClassLoaderName.java
--- a/jdk/test/java/lang/StackTraceElement/WithClassLoaderName.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/lang/StackTraceElement/WithClassLoaderName.java Wed Jul 05 23:40:06 2017 +0200
@@ -27,7 +27,8 @@
* @summary Basic test StackTraceElement with class loader names
* @library lib /lib/testlibrary /test/lib
* @modules jdk.compiler
- * @build m1/* WithClassLoaderName
+ * @build jdk.test.lib.compiler.CompilerUtils
+ * m1/* WithClassLoaderName
* @run main/othervm m1/com.app.Main
* @run main/othervm WithClassLoaderName
*/
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/lang/StackWalker/StackWalkTest.java
--- a/jdk/test/java/lang/StackWalker/StackWalkTest.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/lang/StackWalker/StackWalkTest.java Wed Jul 05 23:40:06 2017 +0200
@@ -38,6 +38,7 @@
* @bug 8140450
* @summary Stack Walk Test (use -Dseed=X to set PRNG seed)
* @library /test/lib
+ * @build jdk.test.lib.RandomFactory
* @compile StackRecorderUtil.java
* @run main/othervm StackWalkTest
* @run main/othervm/java.security.policy=stackwalktest.policy StackWalkTest
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/lang/StrictMath/CubeRootTests.java
--- a/jdk/test/java/lang/StrictMath/CubeRootTests.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/lang/StrictMath/CubeRootTests.java Wed Jul 05 23:40:06 2017 +0200
@@ -26,6 +26,7 @@
* @bug 4347132 8136799
* @key randomness
* @library /test/lib
+ * @build jdk.test.lib.RandomFactory
* @build Tests
* @build FdlibmTranslit
* @build CubeRootTests
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/lang/StrictMath/ExpTests.java
--- a/jdk/test/java/lang/StrictMath/ExpTests.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/lang/StrictMath/ExpTests.java Wed Jul 05 23:40:06 2017 +0200
@@ -26,6 +26,7 @@
* @bug 8139688
* @key randomness
* @library /test/lib
+ * @build jdk.test.lib.RandomFactory
* @build Tests
* @build FdlibmTranslit
* @build ExpTests
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/lang/StrictMath/HypotTests.java
--- a/jdk/test/java/lang/StrictMath/HypotTests.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/lang/StrictMath/HypotTests.java Wed Jul 05 23:40:06 2017 +0200
@@ -27,6 +27,7 @@
* @key randomness
* @summary Tests for StrictMath.hypot
* @library /test/lib
+ * @build jdk.test.lib.RandomFactory
* @build Tests
* @build FdlibmTranslit
* @build HypotTests
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/lang/String/CompactString/SerializationTest.java
--- a/jdk/test/java/lang/String/CompactString/SerializationTest.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/lang/String/CompactString/SerializationTest.java Wed Jul 05 23:40:06 2017 +0200
@@ -31,6 +31,7 @@
* @test
* @bug 8077559
* @library /test/lib
+ * @build jdk.test.lib.util.SerializationUtils
* @summary Tests Compact String. This one is testing String serialization
* among -XX:+CompactStrings/-XX:-CompactStrings/LegacyString
* @run testng/othervm -XX:+CompactStrings SerializationTest
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/lang/String/LiteralReplace.java
--- a/jdk/test/java/lang/String/LiteralReplace.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/lang/String/LiteralReplace.java Wed Jul 05 23:40:06 2017 +0200
@@ -24,6 +24,7 @@
/* @test
* @bug 8058779 8054307
* @library /test/lib
+ * @build jdk.test.lib.RandomFactory
* @run testng LiteralReplace
* @summary Basic tests of String.replace(CharSequence, CharSequence)
* @key randomness
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/lang/StringBuffer/CompactStringBufferSerialization.java
--- a/jdk/test/java/lang/StringBuffer/CompactStringBufferSerialization.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/lang/StringBuffer/CompactStringBufferSerialization.java Wed Jul 05 23:40:06 2017 +0200
@@ -33,6 +33,7 @@
* @test
* @bug 8077559
* @library /test/lib
+ * @build jdk.test.lib.util.SerializationUtils
* @summary Tests Compact String. This one is testing StringBuffer serialization
* among -XX:+CompactStrings/-XX:-CompactStrings/LegacyStringBuffer
* @run testng/othervm -XX:+CompactStrings CompactStringBufferSerialization
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/lang/StringBuilder/CompactStringBuilderSerialization.java
--- a/jdk/test/java/lang/StringBuilder/CompactStringBuilderSerialization.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/lang/StringBuilder/CompactStringBuilderSerialization.java Wed Jul 05 23:40:06 2017 +0200
@@ -33,6 +33,7 @@
* @test
* @bug 8077559
* @library /test/lib
+ * @build jdk.test.lib.util.SerializationUtils
* @summary Tests Compact String. This one is testing StringBuilder serialization
* among -XX:+CompactStrings/-XX:-CompactStrings/LegacyStringBuilder
* @run testng/othervm -XX:+CompactStrings CompactStringBuilderSerialization
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/lang/Thread/ThreadStateTest.java
--- a/jdk/test/java/lang/Thread/ThreadStateTest.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/lang/Thread/ThreadStateTest.java Wed Jul 05 23:40:06 2017 +0200
@@ -33,6 +33,7 @@
* @library /lib/testlibrary
* @library /test/lib
* @build jdk.testlibrary.*
+ * @build jdk.test.lib.LockFreeLogger
* @build ThreadStateTest ThreadStateController
* @run main/othervm -Xmixed ThreadStateTest
*/
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/lang/invoke/LFCaching/LFGarbageCollectedTest.java
--- a/jdk/test/java/lang/invoke/LFCaching/LFGarbageCollectedTest.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/lang/invoke/LFCaching/LFGarbageCollectedTest.java Wed Jul 05 23:40:06 2017 +0200
@@ -29,6 +29,7 @@
* @summary Test verifies that lambda forms are garbage collected
* @author kshefov
* @library /lib/testlibrary /java/lang/invoke/common
+ * @build jdk.test.lib.TimeLimitedRunner
* @build TestMethods
* @build LambdaFormTestCase
* @build LFGarbageCollectedTest
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/lang/invoke/LFCaching/LFMultiThreadCachingTest.java
--- a/jdk/test/java/lang/invoke/LFCaching/LFMultiThreadCachingTest.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/lang/invoke/LFCaching/LFMultiThreadCachingTest.java Wed Jul 05 23:40:06 2017 +0200
@@ -27,10 +27,11 @@
* @key randomness
* @summary Test verifies that lambda forms are cached when run with multiple threads
* @author kshefov
- * @library /lib/testlibrary /java/lang/invoke/common
+ * @library /lib/testlibrary /java/lang/invoke/common /test/lib
* @modules java.base/java.lang.invoke:open
* java.base/java.lang.ref:open
* java.management
+ * @build jdk.test.lib.TimeLimitedRunner
* @build TestMethods
* @build LambdaFormTestCase
* @build LFCachingTestCase
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/lang/invoke/LFCaching/LFSingleThreadCachingTest.java
--- a/jdk/test/java/lang/invoke/LFCaching/LFSingleThreadCachingTest.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/lang/invoke/LFCaching/LFSingleThreadCachingTest.java Wed Jul 05 23:40:06 2017 +0200
@@ -27,10 +27,11 @@
* @key randomness
* @summary Test verifies that lambda forms are cached when run with single thread
* @author kshefov
- * @library /lib/testlibrary /java/lang/invoke/common
+ * @library /lib/testlibrary /java/lang/invoke/common /test/lib
* @modules java.base/java.lang.ref:open
* java.base/java.lang.invoke:open
* java.management
+ * @build jdk.test.lib.TimeLimitedRunner
* @build TestMethods
* @build LambdaFormTestCase
* @build LFCachingTestCase
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/lang/invoke/LFCaching/LambdaFormTestCase.java
--- a/jdk/test/java/lang/invoke/LFCaching/LambdaFormTestCase.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/lang/invoke/LFCaching/LambdaFormTestCase.java Wed Jul 05 23:40:06 2017 +0200
@@ -21,7 +21,7 @@
* questions.
*/
-import jdk.testlibrary.TimeLimitedRunner;
+import jdk.test.lib.TimeLimitedRunner;
import jdk.testlibrary.Utils;
import test.java.lang.invoke.lib.CodeCacheOverflowProcessor;
import test.java.lang.invoke.lib.Helper;
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/lang/invoke/MethodHandles/CatchExceptionTest.java
--- a/jdk/test/java/lang/invoke/MethodHandles/CatchExceptionTest.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/lang/invoke/MethodHandles/CatchExceptionTest.java Wed Jul 05 23:40:06 2017 +0200
@@ -23,8 +23,8 @@
package test.java.lang.invoke.MethodHandles;
+import jdk.test.lib.TimeLimitedRunner;
import jdk.testlibrary.Asserts;
-import jdk.testlibrary.TimeLimitedRunner;
import jdk.testlibrary.Utils;
import test.java.lang.invoke.lib.CodeCacheOverflowProcessor;
import test.java.lang.invoke.lib.Helper;
@@ -43,7 +43,8 @@
import java.util.function.Supplier;
/* @test
- * @library /lib/testlibrary /java/lang/invoke/common
+ * @library /lib/testlibrary /java/lang/invoke/common /test/lib
+ * @build jdk.test.lib.TimeLimitedRunner
* @compile CatchExceptionTest.java
* @run main/othervm -esa test.java.lang.invoke.MethodHandles.CatchExceptionTest
* @key intermittent randomness
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/lang/ref/CleanerTest.java
--- a/jdk/test/java/lang/ref/CleanerTest.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/lang/ref/CleanerTest.java Wed Jul 05 23:40:06 2017 +0200
@@ -51,7 +51,12 @@
* @test
* @library /lib/testlibrary /test/lib
* @build sun.hotspot.WhiteBox
- * @build jdk.test.lib.Utils
+ * jdk.test.lib.Utils
+ * jdk.test.lib.Asserts
+ * jdk.test.lib.JDKToolFinder
+ * jdk.test.lib.JDKToolLauncher
+ * jdk.test.lib.Platform
+ * jdk.test.lib.process.*
* @modules java.base/jdk.internal
* java.base/jdk.internal.misc
* java.base/jdk.internal.ref
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/math/BigDecimal/StringConstructor.java
--- a/jdk/test/java/math/BigDecimal/StringConstructor.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/math/BigDecimal/StringConstructor.java Wed Jul 05 23:40:06 2017 +0200
@@ -24,6 +24,7 @@
/*
* @test
* @library /test/lib
+ * @build jdk.test.lib.RandomFactory
* @run main StringConstructor
* @bug 4103117 4331084 4488017 4490929 6255285 6268365 8074460 8078672
* @summary Tests the BigDecimal string constructor (use -Dseed=X to set PRNG seed).
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/math/BigInteger/BigIntegerTest.java
--- a/jdk/test/java/math/BigInteger/BigIntegerTest.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/math/BigInteger/BigIntegerTest.java Wed Jul 05 23:40:06 2017 +0200
@@ -24,6 +24,7 @@
/*
* @test
* @library /test/lib
+ * @build jdk.test.lib.RandomFactory
* @run main BigIntegerTest
* @bug 4181191 4161971 4227146 4194389 4823171 4624738 4812225 4837946 4026465 8074460 8078672 8032027
* @summary tests methods in BigInteger (use -Dseed=X to set PRNG seed)
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/math/BigInteger/ModPow65537.java
--- a/jdk/test/java/math/BigInteger/ModPow65537.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/math/BigInteger/ModPow65537.java Wed Jul 05 23:40:06 2017 +0200
@@ -24,6 +24,7 @@
/*
* @test
* @library /test/lib
+ * @build jdk.test.lib.RandomFactory
* @run main ModPow65537
* @bug 4891312 8074460 8078672
* @summary verify that modPow() not broken by the special case for 65537 (use -Dseed=X to set PRNG seed)
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/math/BigInteger/PrimeTest.java
--- a/jdk/test/java/math/BigInteger/PrimeTest.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/math/BigInteger/PrimeTest.java Wed Jul 05 23:40:06 2017 +0200
@@ -26,6 +26,7 @@
/*
* @test
* @library /test/lib
+ * @build jdk.test.lib.RandomFactory
* @run main PrimeTest
* @bug 8026236 8074460 8078672
* @summary test primality verification methods in BigInteger (use -Dseed=X to set PRNG seed)
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/net/Inet6Address/B6206527.java
--- a/jdk/test/java/net/Inet6Address/B6206527.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/net/Inet6Address/B6206527.java Wed Jul 05 23:40:06 2017 +0200
@@ -26,6 +26,8 @@
* @bug 6206527
* @summary "cannot assign address" when binding ServerSocket on Suse 9
* @library /test/lib
+ * @build jdk.test.lib.NetworkConfiguration
+ * jdk.test.lib.Platform
* @run main B6206527
*/
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/net/Inet6Address/B6558853.java
--- a/jdk/test/java/net/Inet6Address/B6558853.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/net/Inet6Address/B6558853.java Wed Jul 05 23:40:06 2017 +0200
@@ -26,6 +26,8 @@
* @bug 6558853
* @summary getHostAddress() on connections using IPv6 link-local addrs should have zone id
* @library /test/lib
+ * @build jdk.test.lib.NetworkConfiguration
+ * jdk.test.lib.Platform
* @run main B6558853
*/
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/net/InetAddress/CheckJNI.java
--- a/jdk/test/java/net/InetAddress/CheckJNI.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/net/InetAddress/CheckJNI.java Wed Jul 05 23:40:06 2017 +0200
@@ -25,6 +25,8 @@
* @bug 4889870 4890033
* @summary java -Xcheck:jni failing in net code on Solaris / [Datagram]Socket.getLocalAddress() failure
* @library /test/lib
+ * @build jdk.test.lib.NetworkConfiguration
+ * jdk.test.lib.Platform
* @run main/othervm -Xcheck:jni CheckJNI
*/
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/net/InetAddress/ptr/Lookup.java
--- a/jdk/test/java/net/InetAddress/ptr/Lookup.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/net/InetAddress/ptr/Lookup.java Wed Jul 05 23:40:06 2017 +0200
@@ -28,8 +28,12 @@
* @summary Test that reverse lookups of IPv4 addresses work when IPv6
* is enabled
* @library /test/lib
- * @build jdk.test.lib.JDKToolFinder
- * jdk.test.lib.process.OutputAnalyzer
+ * @build jdk.test.lib.Utils
+ * jdk.test.lib.Asserts
+ * jdk.test.lib.JDKToolFinder
+ * jdk.test.lib.JDKToolLauncher
+ * jdk.test.lib.Platform
+ * jdk.test.lib.process.*
* Lookup
* @run main Lookup root
*
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/net/MulticastSocket/JoinLeave.java
--- a/jdk/test/java/net/MulticastSocket/JoinLeave.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/net/MulticastSocket/JoinLeave.java Wed Jul 05 23:40:06 2017 +0200
@@ -26,6 +26,8 @@
* @bug 4091811 4148753 4102731
* @summary Test java.net.MulticastSocket joinGroup and leaveGroup
* @library /test/lib
+ * @build jdk.test.lib.NetworkConfiguration
+ * jdk.test.lib.Platform
* @run main JoinLeave
*/
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/net/MulticastSocket/SetLoopbackMode.java
--- a/jdk/test/java/net/MulticastSocket/SetLoopbackMode.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/net/MulticastSocket/SetLoopbackMode.java Wed Jul 05 23:40:06 2017 +0200
@@ -26,6 +26,8 @@
* @bug 4686717
* @summary Test MulticastSocket.setLoopbackMode
* @library /test/lib
+ * @build jdk.test.lib.NetworkConfiguration
+ * jdk.test.lib.Platform
* @run main/othervm SetLoopbackMode
*/
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/net/NetworkConfigurationProbe.java
--- a/jdk/test/java/net/NetworkConfigurationProbe.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/net/NetworkConfigurationProbe.java Wed Jul 05 23:40:06 2017 +0200
@@ -25,6 +25,13 @@
* @test
* @summary NOT A TEST. Captures the network interface configuration.
* @library /test/lib
+ * @build jdk.test.lib.NetworkConfiguration
+ * jdk.test.lib.Utils
+ * jdk.test.lib.Asserts
+ * jdk.test.lib.JDKToolFinder
+ * jdk.test.lib.JDKToolLauncher
+ * jdk.test.lib.Platform
+ * jdk.test.lib.process.*
* @run main NetworkConfigurationProbe
*/
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java
--- a/jdk/test/java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java Wed Jul 05 23:40:06 2017 +0200
@@ -30,8 +30,12 @@
* can cause fd leak
* @requires (os.family != "windows")
* @library /test/lib
- * @build jdk.test.lib.JDKToolFinder
- * jdk.test.lib.process.OutputAnalyzer
+ * @build jdk.test.lib.Utils
+ * jdk.test.lib.Asserts
+ * jdk.test.lib.JDKToolFinder
+ * jdk.test.lib.JDKToolLauncher
+ * jdk.test.lib.Platform
+ * jdk.test.lib.process.*
* AcceptCauseFileDescriptorLeak
* @run main/othervm AcceptCauseFileDescriptorLeak root
*/
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/net/Socket/LinkLocal.java
--- a/jdk/test/java/net/Socket/LinkLocal.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/net/Socket/LinkLocal.java Wed Jul 05 23:40:06 2017 +0200
@@ -27,6 +27,8 @@
* @summary Connecting to a link-local IPv6 address should not
* causes a SocketException to be thrown.
* @library /test/lib
+ * @build jdk.test.lib.NetworkConfiguration
+ * jdk.test.lib.Platform
* @run main LinkLocal
*/
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/net/Socket/OldSocketImplTestDriver.java
--- a/jdk/test/java/net/Socket/OldSocketImplTestDriver.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/net/Socket/OldSocketImplTestDriver.java Wed Jul 05 23:40:06 2017 +0200
@@ -30,7 +30,12 @@
* @test
* @bug 6449565
* @library /test/lib
- * @build jdk.test.lib.process.ProcessTools
+ * @build jdk.test.lib.Utils
+ * jdk.test.lib.Asserts
+ * jdk.test.lib.JDKToolFinder
+ * jdk.test.lib.JDKToolLauncher
+ * jdk.test.lib.Platform
+ * jdk.test.lib.process.*
* @run main OldSocketImplTestDriver
* @summary Test driver for OdlSocketImpl
*/
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/net/SocketPermission/SocketPermissionTest.java
--- a/jdk/test/java/net/SocketPermission/SocketPermissionTest.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/net/SocketPermission/SocketPermissionTest.java Wed Jul 05 23:40:06 2017 +0200
@@ -26,6 +26,8 @@
* @bug 8047031
* @summary SocketPermission tests for legacy socket types
* @library /test/lib
+ * @build jdk.test.lib.NetworkConfiguration
+ * jdk.test.lib.Platform
* @run testng/othervm SocketPermissionTest
*/
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/net/URLClassLoader/closetest/CloseTest.java
--- a/jdk/test/java/net/URLClassLoader/closetest/CloseTest.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/net/URLClassLoader/closetest/CloseTest.java Wed Jul 05 23:40:06 2017 +0200
@@ -30,7 +30,10 @@
* @library ../../../../com/sun/net/httpserver
* /lib/testlibrary
* /test/lib
- * @build FileServerHandler JarUtils jdk.test.lib.compiler.CompilerUtils
+ * @build jdk.test.lib.compiler.CompilerUtils
+ * jdk.test.lib.util.FileUtils
+ * jdk.test.lib.Platform
+ * FileServerHandler JarUtils
* @run main/othervm CloseTest
* @summary URL-downloaded jar files can consume all available file descriptors
*/
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/net/URLClassLoader/closetest/GetResourceAsStream.java
--- a/jdk/test/java/net/URLClassLoader/closetest/GetResourceAsStream.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/net/URLClassLoader/closetest/GetResourceAsStream.java Wed Jul 05 23:40:06 2017 +0200
@@ -26,7 +26,10 @@
* @bug 6899919
* @library /lib/testlibrary /test/lib
* @modules jdk.compiler
- * @build JarUtils jdk.test.lib.compiler.CompilerUtils
+ * @build jdk.test.lib.compiler.CompilerUtils
+ * jdk.test.lib.util.FileUtils
+ * jdk.test.lib.Platform
+ * JarUtils
* @run main/othervm GetResourceAsStream
*/
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/net/URLClassLoader/getresourceasstream/TestDriver.java
--- a/jdk/test/java/net/URLClassLoader/getresourceasstream/TestDriver.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/net/URLClassLoader/getresourceasstream/TestDriver.java Wed Jul 05 23:40:06 2017 +0200
@@ -26,8 +26,12 @@
* @bug 5103449
* @summary REGRESSION: getResourceAsStream is broken in JDK1.5.0-rc
* @library /test/lib
- * @build jdk.test.lib.JDKToolFinder
- * jdk.test.lib.process.ProcessTools
+ * @build jdk.test.lib.Utils
+ * jdk.test.lib.Asserts
+ * jdk.test.lib.JDKToolFinder
+ * jdk.test.lib.JDKToolLauncher
+ * jdk.test.lib.Platform
+ * jdk.test.lib.process.*
* Test
* @run main/othervm TestDriver
*/
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/net/URLClassLoader/sealing/CheckSealedTest.java
--- a/jdk/test/java/net/URLClassLoader/sealing/CheckSealedTest.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/net/URLClassLoader/sealing/CheckSealedTest.java Wed Jul 05 23:40:06 2017 +0200
@@ -26,8 +26,12 @@
* @bug 4244970
* @summary Test to see if sealing violation is detected correctly
* @library /test/lib
- * @build jdk.test.lib.JDKToolFinder
- * jdk.test.lib.process.OutputAnalyzer
+ * @build jdk.test.lib.Utils
+ * jdk.test.lib.Asserts
+ * jdk.test.lib.JDKToolFinder
+ * jdk.test.lib.JDKToolLauncher
+ * jdk.test.lib.Platform
+ * jdk.test.lib.process.*
* @run main CheckSealedTest
*/
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/net/URLConnection/6212146/TestDriver.java
--- a/jdk/test/java/net/URLConnection/6212146/TestDriver.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/net/URLConnection/6212146/TestDriver.java Wed Jul 05 23:40:06 2017 +0200
@@ -27,8 +27,12 @@
* @summary URLConnection.connect() fails on JAR Entry it creates
* file handler leak
* @library /test/lib
- * @build jdk.test.lib.JDKToolFinder
- * jdk.test.lib.process.ProcessTools
+ * @build jdk.test.lib.Utils
+ * jdk.test.lib.Asserts
+ * jdk.test.lib.JDKToolFinder
+ * jdk.test.lib.JDKToolLauncher
+ * jdk.test.lib.Platform
+ * jdk.test.lib.process.*
* Test
* @run main/othervm TestDriver
*/
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/net/httpclient/RequestBodyTest.java
--- a/jdk/test/java/net/httpclient/RequestBodyTest.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/net/httpclient/RequestBodyTest.java Wed Jul 05 23:40:06 2017 +0200
@@ -29,6 +29,8 @@
* @library /lib/testlibrary/ /test/lib
* @compile ../../../com/sun/net/httpserver/LogFilter.java
* @compile ../../../com/sun/net/httpserver/FileServerHandler.java
+ * @build jdk.test.lib.Platform
+ * @build jdk.test.lib.util.FileUtils
* @build LightWeightHttpServer
* @build jdk.testlibrary.SimpleSSLContext
* @run testng/othervm RequestBodyTest
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/net/ipv6tests/B6521014.java
--- a/jdk/test/java/net/ipv6tests/B6521014.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/net/ipv6tests/B6521014.java Wed Jul 05 23:40:06 2017 +0200
@@ -26,6 +26,8 @@
* @bug 6521014 6543428
* @summary IOException thrown when Socket tries to bind to an local IPv6 address on SuSE Linux
* @library /test/lib
+ * @build jdk.test.lib.NetworkConfiguration
+ * jdk.test.lib.Platform
* @run main B6521014
*/
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/net/spi/URLStreamHandlerProvider/Basic.java
--- a/jdk/test/java/net/spi/URLStreamHandlerProvider/Basic.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/net/spi/URLStreamHandlerProvider/Basic.java Wed Jul 05 23:40:06 2017 +0200
@@ -56,7 +56,9 @@
* @modules jdk.compiler
* @summary Basic test for URLStreamHandlerProvider
* @library /lib/testlibrary /test/lib
- * @build jdk.testlibrary.JDKToolFinder
+ * @build jdk.test.lib.Platform
+ * jdk.test.lib.util.FileUtils
+ * jdk.testlibrary.JDKToolFinder
* @compile Basic.java Child.java
* @run main Basic
*/
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/nio/Buffer/LimitDirectMemoryNegativeTest.java
--- a/jdk/test/java/nio/Buffer/LimitDirectMemoryNegativeTest.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/nio/Buffer/LimitDirectMemoryNegativeTest.java Wed Jul 05 23:40:06 2017 +0200
@@ -28,6 +28,12 @@
* various bad values fail to launch the VM
* @requires (os.arch == "x86_64") | (os.arch == "amd64") | (os.arch == "sparcv9")
* @library /test/lib
+ * @build jdk.test.lib.Utils
+ * jdk.test.lib.Asserts
+ * jdk.test.lib.JDKToolFinder
+ * jdk.test.lib.JDKToolLauncher
+ * jdk.test.lib.Platform
+ * jdk.test.lib.process.*
*
* @run main LimitDirectMemoryNegativeTest foo
* @run main LimitDirectMemoryNegativeTest 10kmt
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/nio/channels/AsynchronousSocketChannel/Basic.java
--- a/jdk/test/java/nio/channels/AsynchronousSocketChannel/Basic.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/nio/channels/AsynchronousSocketChannel/Basic.java Wed Jul 05 23:40:06 2017 +0200
@@ -25,6 +25,7 @@
* @bug 4607272 6842687 6878369 6944810 7023403
* @summary Unit test for AsynchronousSocketChannel(use -Dseed=X to set PRNG seed)
* @library /test/lib
+ * @build jdk.test.lib.RandomFactory
* @run main Basic -skipSlowConnectTest
* @key randomness intermittent
*/
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/nio/channels/DatagramChannel/BasicMulticastTests.java
--- a/jdk/test/java/nio/channels/DatagramChannel/BasicMulticastTests.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/nio/channels/DatagramChannel/BasicMulticastTests.java Wed Jul 05 23:40:06 2017 +0200
@@ -25,7 +25,9 @@
* @bug 4527345
* @summary Unit test for DatagramChannel's multicast support
* @library /test/lib
- * @build BasicMulticastTests
+ * @build jdk.test.lib.NetworkConfiguration
+ * jdk.test.lib.Platform
+ * BasicMulticastTests
* @run main BasicMulticastTests
*/
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/nio/channels/DatagramChannel/MulticastSendReceiveTests.java
--- a/jdk/test/java/nio/channels/DatagramChannel/MulticastSendReceiveTests.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/nio/channels/DatagramChannel/MulticastSendReceiveTests.java Wed Jul 05 23:40:06 2017 +0200
@@ -25,7 +25,9 @@
* @bug 4527345 7026376 6633549
* @summary Unit test for DatagramChannel's multicast support
* @library /test/lib
- * @build MulticastSendReceiveTests
+ * @build jdk.test.lib.NetworkConfiguration
+ * jdk.test.lib.Platform
+ * MulticastSendReceiveTests
* @run main MulticastSendReceiveTests
* @run main/othervm -Djava.net.preferIPv4Stack=true MulticastSendReceiveTests
* @key randomness
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/nio/channels/DatagramChannel/Promiscuous.java
--- a/jdk/test/java/nio/channels/DatagramChannel/Promiscuous.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/nio/channels/DatagramChannel/Promiscuous.java Wed Jul 05 23:40:06 2017 +0200
@@ -26,7 +26,9 @@
* @summary Test for interference when two sockets are bound to the same
* port but joined to different multicast groups
* @library /test/lib
- * @build Promiscuous
+ * @build jdk.test.lib.NetworkConfiguration
+ * jdk.test.lib.Platform
+ * Promiscuous
* @run main Promiscuous
* @run main/othervm -Djava.net.preferIPv4Stack=true Promiscuous
* @key randomness
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/nio/channels/FileChannel/Transfer.java
--- a/jdk/test/java/nio/channels/FileChannel/Transfer.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/nio/channels/FileChannel/Transfer.java Wed Jul 05 23:40:06 2017 +0200
@@ -26,6 +26,7 @@
* @summary Test FileChannel.transferFrom and transferTo (use -Dseed=X to set PRNG seed)
* @library ..
* @library /test/lib
+ * @build jdk.test.lib.RandomFactory
* @run testng/timeout=300 Transfer
* @key randomness
*/
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/nio/channels/Selector/LotsOfUpdatesTest.java
--- a/jdk/test/java/nio/channels/Selector/LotsOfUpdatesTest.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/nio/channels/Selector/LotsOfUpdatesTest.java Wed Jul 05 23:40:06 2017 +0200
@@ -28,7 +28,13 @@
* Solaris if maximum number of file descriptors is less than 10000
* @requires (os.family != "windows")
* @library /test/lib
- * @build LotsOfUpdates
+ * @build jdk.test.lib.Utils
+ * jdk.test.lib.Asserts
+ * jdk.test.lib.JDKToolFinder
+ * jdk.test.lib.JDKToolLauncher
+ * jdk.test.lib.Platform
+ * jdk.test.lib.process.*
+ * LotsOfUpdates
* @run main LotsOfUpdatesTest
*/
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/nio/channels/SocketChannel/VectorIO.java
--- a/jdk/test/java/nio/channels/SocketChannel/VectorIO.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/nio/channels/SocketChannel/VectorIO.java Wed Jul 05 23:40:06 2017 +0200
@@ -24,6 +24,7 @@
/* @test
* @summary Test socketchannel vector IO (use -Dseed=X to set PRNG seed)
* @library .. /test/lib
+ * @build jdk.test.lib.RandomFactory
* @run main VectorIO
* @key randomness
*/
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/nio/file/FileStore/Basic.java
--- a/jdk/test/java/nio/file/FileStore/Basic.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/nio/file/FileStore/Basic.java Wed Jul 05 23:40:06 2017 +0200
@@ -26,6 +26,8 @@
* @summary Unit test for java.nio.file.FileStore
* @key intermittent
* @library .. /test/lib
+ * @build jdk.test.lib.Platform
+ * jdk.test.lib.util.FileUtils
* @run main Basic
*/
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/nio/file/FileSystem/Basic.java
--- a/jdk/test/java/nio/file/FileSystem/Basic.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/nio/file/FileSystem/Basic.java Wed Jul 05 23:40:06 2017 +0200
@@ -25,6 +25,8 @@
* @bug 4313887 6838333 8132497
* @summary Unit test for java.nio.file.FileSystem
* @library .. /test/lib
+ * @build jdk.test.lib.Platform
+ * jdk.test.lib.util.FileUtils
* @run main/othervm Basic
*/
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/nio/file/Files/CopyAndMove.java
--- a/jdk/test/java/nio/file/Files/CopyAndMove.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/nio/file/Files/CopyAndMove.java Wed Jul 05 23:40:06 2017 +0200
@@ -25,7 +25,8 @@
* @bug 4313887 6838333 6917021 7006126 6950237 8006645
* @summary Unit test for java.nio.file.Files copy and move methods (use -Dseed=X to set PRNG seed)
* @library .. /test/lib
- * @build CopyAndMove PassThroughFileSystem
+ * @build jdk.test.lib.RandomFactory
+ * CopyAndMove PassThroughFileSystem
* @run main/othervm CopyAndMove
* @key randomness
*/
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/nio/file/Files/DeleteOnClose.java
--- a/jdk/test/java/nio/file/Files/DeleteOnClose.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/nio/file/Files/DeleteOnClose.java Wed Jul 05 23:40:06 2017 +0200
@@ -26,6 +26,13 @@
* @bug 4313887
* @summary Unit test for DELETE_ON_CLOSE open option
* @library /test/lib ..
+ * @build jdk.test.lib.Utils
+ * jdk.test.lib.Asserts
+ * jdk.test.lib.JDKToolFinder
+ * jdk.test.lib.JDKToolLauncher
+ * jdk.test.lib.Platform
+ * jdk.test.lib.process.*
+ * @run main DeleteOnClose
*/
import java.io.IOException;
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/nio/file/Files/StreamLinesTest.java
--- a/jdk/test/java/nio/file/Files/StreamLinesTest.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/nio/file/Files/StreamLinesTest.java Wed Jul 05 23:40:06 2017 +0200
@@ -25,6 +25,7 @@
* @bug 8072773
* @library /test/lib /lib/testlibrary/bootlib
* @build java.base/java.util.stream.OpTestCase
+ * jdk.test.lib.RandomFactory
* @run testng/othervm StreamLinesTest
* @summary Tests streams returned from Files.lines, primarily focused on
* testing the file-channel-based stream stream with supported
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/nio/file/Files/walkFileTree/FindTest.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/nio/file/Files/walkFileTree/FindTest.java Wed Jul 05 23:40:06 2017 +0200
@@ -0,0 +1,172 @@
+/*
+ * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
+ * 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 4313887 6907737
+ * @summary Tests that walkFileTree is consistent with the native find program
+ * @requires (os.family != "windows")
+ * @library /test/lib
+ * @build jdk.test.lib.Utils
+ * jdk.test.lib.Asserts
+ * jdk.test.lib.JDKToolFinder
+ * jdk.test.lib.JDKToolLauncher
+ * jdk.test.lib.Platform
+ * jdk.test.lib.process.*
+ * CreateFileTree
+ * @run testng/othervm -Djava.io.tmpdir=. FindTest
+ */
+
+import java.io.IOException;
+import java.nio.file.FileSystemLoopException;
+import java.nio.file.FileVisitOption;
+import java.nio.file.FileVisitResult;
+import java.nio.file.FileVisitor;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.attribute.BasicFileAttributes;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Random;
+import java.util.Set;
+import java.util.stream.Collectors;
+
+import jdk.test.lib.process.OutputAnalyzer;
+import jdk.test.lib.process.ProcessTools;
+
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertTrue;
+
+public class FindTest {
+
+ private static final Random rand = new Random();
+ private static final boolean isAIX = System.getProperty("os.name").equals("AIX");
+ private static Path top;
+ private static String TOP;
+
+ @BeforeClass
+ public static void createFileTree() throws Exception {
+ top = CreateFileTree.create();
+ TOP = top.toAbsolutePath().toString();
+ }
+
+ @Test
+ public void printTreeTest() throws Throwable {
+ // print the file tree and compare output with find(1)
+ assertOutputEquals(printFileTree(top), runFind("find", TOP));
+ }
+
+ @Test
+ public void printTreeFollowLinkTest() throws Throwable {
+ // print the file tree, following links, and compare output with find(1).
+
+ // On AIX "find -follow" may core dump on recursive links without '-L'
+ // see: http://www-01.ibm.com/support/docview.wss?uid=isg1IV28143
+ String[] cmds = isAIX
+ ? new String[]{"find", "-L", TOP, "-follow"}
+ : new String[]{"find", TOP, "-follow"};
+ OutputAnalyzer expected = runFind(cmds);
+
+ // Some versions of find(1) output cycles (sym links to ancestor
+ // directories), other versions do not. For that reason we run
+ // PrintFileTree with the -printCycles option when the output without
+ // this option differs to find(1).
+ try {
+ assertOutputEquals(printFileTree(top, "-follow"), expected);
+ } catch (AssertionError x) {
+ assertOutputEquals(printFileTree(top, "-follow", "-printCycles"), expected);
+ }
+ }
+
+ private void assertOutputEquals(List actual, OutputAnalyzer expected)
+ throws IOException {
+ List expectedList = Arrays.asList(expected.getStdout()
+ .split(System.lineSeparator()));
+ assertEquals(actual.size(), expectedList.size());
+ assertTrue(actual.removeAll(expectedList));
+ }
+
+ private OutputAnalyzer runFind(String... cmds) throws Throwable {
+ return ProcessTools.executeCommand(cmds);
+ }
+
+ /**
+ * Invokes Files.walkFileTree to traverse a file tree and prints
+ * each of the directories and files. The -follow option causes symbolic
+ * links to be followed and the -printCycles option will print links
+ * where the target of the link is an ancestor directory.
+ */
+ private static List printFileTree(Path dir, String... opts) throws Exception {
+ List fileTreeList = new ArrayList<>();
+
+ List optsList = Arrays.asList(opts);
+ boolean followLinks = optsList.contains("-follow");
+ boolean reportCycles = optsList.contains("-printCycles");
+
+ Set options = new HashSet<>();
+ if (followLinks)
+ options.add(FileVisitOption.FOLLOW_LINKS);
+
+ Files.walkFileTree(dir, options, Integer.MAX_VALUE, new FileVisitor() {
+ @Override
+ public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) {
+ fileTreeList.add(dir);
+ return FileVisitResult.CONTINUE;
+ }
+ @Override
+ public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) {
+ fileTreeList.add(file);
+ return FileVisitResult.CONTINUE;
+ }
+ @Override
+ public FileVisitResult postVisitDirectory(Path dir, IOException exc)
+ throws IOException
+ {
+ if (exc != null)
+ throw exc;
+ return FileVisitResult.CONTINUE;
+ }
+ @Override
+ public FileVisitResult visitFileFailed(Path file, IOException exc)
+ throws IOException
+ {
+ if (followLinks && (exc instanceof FileSystemLoopException)) {
+ if (reportCycles)
+ fileTreeList.add(file);
+ return FileVisitResult.CONTINUE;
+ } else {
+ throw exc;
+ }
+ }
+ });
+
+ return fileTreeList.stream()
+ .map(f -> f.toAbsolutePath().toString())
+ .collect(Collectors.toCollection(ArrayList::new));
+ }
+}
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/nio/file/Files/walkFileTree/PrintFileTree.java
--- a/jdk/test/java/nio/file/Files/walkFileTree/PrintFileTree.java Thu Jun 15 13:44:42 2017 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,92 +0,0 @@
-/*
- * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-import java.nio.file.*;
-import java.nio.file.attribute.*;
-import java.io.IOException;
-import java.util.*;
-
-/**
- * Invokes Files.walkFileTree to traverse a file tree and prints
- * each of the directories and files. The -follow option causes symbolic
- * links to be followed and the -printCycles option will print links
- * where the target of the link is an ancestor directory.
- */
-
-public class PrintFileTree {
-
- public static void main(String[] args) throws Exception {
- boolean followLinks = false;
- boolean printCycles = false;
- int i = 0;
- while (i < (args.length-1)) {
- switch (args[i]) {
- case "-follow" : followLinks = true; break;
- case "-printCycles" : printCycles = true; break;
- default:
- throw new RuntimeException(args[i] + " not recognized");
- }
- i++;
- }
- Path dir = Paths.get(args[i]);
-
- Set options = new HashSet();
- if (followLinks)
- options.add(FileVisitOption.FOLLOW_LINKS);
-
- final boolean follow = followLinks;
- final boolean reportCycles = printCycles;
- Files.walkFileTree(dir, options, Integer.MAX_VALUE, new FileVisitor() {
- @Override
- public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) {
- System.out.println(dir);
- return FileVisitResult.CONTINUE;
- }
- @Override
- public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) {
- System.out.println(file);
- return FileVisitResult.CONTINUE;
- }
- @Override
- public FileVisitResult postVisitDirectory(Path dir, IOException exc)
- throws IOException
- {
- if (exc != null)
- throw exc;
- return FileVisitResult.CONTINUE;
- }
- @Override
- public FileVisitResult visitFileFailed(Path file, IOException exc)
- throws IOException
- {
- if (follow && (exc instanceof FileSystemLoopException)) {
- if (reportCycles)
- System.out.println(file);
- return FileVisitResult.CONTINUE;
- } else {
- throw exc;
- }
- }
- });
- }
-}
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/nio/file/Files/walkFileTree/find.sh
--- a/jdk/test/java/nio/file/Files/walkFileTree/find.sh Thu Jun 15 13:44:42 2017 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,93 +0,0 @@
-#
-# Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#
-
-# @test
-# @bug 4313887 6907737
-# @summary Tests that walkFileTree is consistent with the native find program
-# @build CreateFileTree PrintFileTree
-# @run shell find.sh
-
-# if TESTJAVA isn't set then we assume an interactive run.
-
-if [ -z "$TESTJAVA" ]; then
- TESTSRC=.
- TESTCLASSES=.
- JAVA=java
-else
- JAVA="${TESTJAVA}/bin/java"
-fi
-
-OS=`uname -s`
-case "$OS" in
- Windows_* | CYGWIN* )
- echo "This test does not run on Windows"
- exit 0
- ;;
- AIX )
- CLASSPATH=${TESTCLASSES}:${TESTSRC}
- # On AIX "find -follow" may core dump on recursive links without '-L'
- # see: http://www-01.ibm.com/support/docview.wss?uid=isg1IV28143
- FIND_FOLLOW_OPT="-L"
- ;;
- * )
- FIND_FOLLOW_OPT=
- CLASSPATH=${TESTCLASSES}:${TESTSRC}
- ;;
-esac
-export CLASSPATH
-
-# create the file tree
-ROOT=`$JAVA CreateFileTree`
-if [ $? != 0 ]; then exit 1; fi
-
-failures=0
-
-# print the file tree and compare output with find(1)
-$JAVA ${TESTVMOPTS} PrintFileTree "$ROOT" > out1
-find "$ROOT" > out2
-diff out1 out2
-if [ $? != 0 ]; then failures=`expr $failures + 1`; fi
-
-# repeat test following links. Some versions of find(1) output
-# cycles (sym links to ancestor directories), other versions do
-# not. For that reason we run PrintFileTree with the -printCycles
-# option when the output without this option differs to find(1).
-find $FIND_FOLLOW_OPT "$ROOT" -follow > out1
-$JAVA ${TESTVMOPTS} PrintFileTree -follow "$ROOT" > out2
-diff out1 out2
-if [ $? != 0 ];
- then
- # re-run printing cycles to stdout
- $JAVA ${TESTVMOPTS} PrintFileTree -follow -printCycles "$ROOT" > out2
- diff out1 out2
- if [ $? != 0 ]; then failures=`expr $failures + 1`; fi
- fi
-
-# clean-up
-rm -r "$ROOT"
-
-echo ''
-if [ $failures -gt 0 ];
- then echo "$failures test(s) failed";
- else echo "Test passed"; fi
-exit $failures
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/nio/file/WatchService/LotsOfEvents.java
--- a/jdk/test/java/nio/file/WatchService/LotsOfEvents.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/nio/file/WatchService/LotsOfEvents.java Wed Jul 05 23:40:06 2017 +0200
@@ -26,6 +26,7 @@
* @summary Tests WatchService behavior when lots of events are pending (use -Dseed=X to set PRNG seed)
* @library ..
* @library /test/lib
+ * @build jdk.test.lib.RandomFactory
* @run main/timeout=180 LotsOfEvents
* @key randomness
*/
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/rmi/registry/serialFilter/RegistryFilterTest.java
--- a/jdk/test/java/rmi/registry/serialFilter/RegistryFilterTest.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/rmi/registry/serialFilter/RegistryFilterTest.java Wed Jul 05 23:40:06 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -21,24 +21,18 @@
* questions.
*/
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
import java.io.IOException;
-import java.io.ObjectOutputStream;
import java.io.Serializable;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.nio.file.Paths;
+import java.rmi.AlreadyBoundException;
import java.rmi.MarshalledObject;
import java.rmi.NotBoundException;
import java.rmi.Remote;
import java.rmi.RemoteException;
-import java.rmi.AlreadyBoundException;
import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;
+import java.security.Security;
import java.util.Objects;
-import java.security.Security;
import org.testng.Assert;
import org.testng.TestNG;
@@ -57,7 +51,8 @@
* @summary Test filters for the RMI Registry
* @run testng/othervm RegistryFilterTest
* @run testng/othervm
- * -Dsun.rmi.registry.registryFilter=!java.lang.Long;!RegistryFilterTest$RejectableClass
+ * -Dsun.rmi.registry.registryFilter=!java.lang.Long;!RegistryFilterTest$RejectableClass;maxdepth=19
+ * -Dtest.maxdepth=19
* RegistryFilterTest
* @run testng/othervm/policy=security.policy
* -Djava.security.properties=${test.src}/java.security-extra1
@@ -68,6 +63,8 @@
private static int port;
private static Registry registry;
+ static final int REGISTRY_MAX_DEPTH = 20;
+
static final int REGISTRY_MAX_ARRAY = 10000;
static final String registryFilter =
@@ -125,7 +122,7 @@
/*
- * Test registry rejects an object with the max array size + 1.
+ * Test registry rejects an object with the max array size + 1.
*/
@Test(dataProvider="bindData")
public void simpleBind(String name, Remote obj, boolean blacklisted) throws RemoteException, AlreadyBoundException, NotBoundException {
@@ -139,9 +136,9 @@
}
/*
- * Test registry rejects an object with a well known class
- * if blacklisted in the security properties.
- */
+ * Test registry rejects an object with a well known class
+ * if blacklisted in the security properties.
+ */
@Test
public void simpleRejectableClass() throws RemoteException, AlreadyBoundException, NotBoundException {
RejectableClass r1 = null;
@@ -150,9 +147,46 @@
r1 = new RejectableClass();
registry.bind(name, r1);
registry.unbind(name);
- Assert.assertNull(registryFilter, "Registry filter should not have rejected");
+ Assert.assertNull(registryFilter, "Registry filter should have rejected");
+ } catch (Exception rex) {
+ Assert.assertNotNull(registryFilter, "Registry filter should not have rejected");
+ }
+ }
+
+ /*
+ * Test registry does not reject an object with depth at the built-in limit.
+ */
+ @Test
+ public void simpleDepthBuiltinNonRejectable() throws RemoteException, AlreadyBoundException, NotBoundException {
+ int depthOverride = Integer.getInteger("test.maxdepth", REGISTRY_MAX_DEPTH);
+ depthOverride = Math.min(depthOverride, REGISTRY_MAX_DEPTH);
+ System.out.printf("overrideDepth: %d, filter: %s%n", depthOverride, registryFilter);
+ try {
+ String name = "reject2";
+ DepthRejectableClass r1 = DepthRejectableClass.create(depthOverride);
+ registry.bind(name, r1);
+ registry.unbind(name);
} catch (Exception rex) {
- Assert.assertNotNull(registryFilter, "Registry filter should have rejected");
+ Assert.fail("Registry filter should not have rejected depth: "
+ + depthOverride);
+ }
+ }
+
+ /*
+ * Test registry rejects an object with depth at the limit + 1.
+ */
+ @Test
+ public void simpleDepthRejectable() throws RemoteException, AlreadyBoundException, NotBoundException {
+ int depthOverride = Integer.getInteger("test.maxdepth", REGISTRY_MAX_DEPTH);
+ depthOverride = Math.min(depthOverride, REGISTRY_MAX_DEPTH);
+ System.out.printf("overrideDepth: %d, filter: %s%n", depthOverride, registryFilter);
+ try {
+ String name = "reject3";
+ DepthRejectableClass r1 = DepthRejectableClass.create(depthOverride + 1);
+ registry.bind(name, r1);
+ Assert.fail("Registry filter should have rejected depth: " + depthOverride + 1);
+ } catch (Exception rex) {
+ // Rejection expected
}
}
@@ -173,6 +207,7 @@
return super.toString() + "//" + Objects.toString(obj);
}
}
+
/**
* A simple Serializable Remote object that is passed by value.
* It and its contents are checked by the Registry serial filter.
@@ -183,4 +218,25 @@
RejectableClass() {}
}
+ /**
+ * A simple Serializable Remote object that is passed by value.
+ * It and its contents are checked by the Registry serial filter.
+ */
+ static class DepthRejectableClass implements Serializable, Remote {
+ private static final long serialVersionUID = 362498820763181264L;
+ private final DepthRejectableClass next;
+
+ private DepthRejectableClass(DepthRejectableClass next) {
+ this.next = next;
+ }
+
+ static DepthRejectableClass create(int depth) {
+ DepthRejectableClass next = new DepthRejectableClass(null);
+ for (int i = 1; i < depth; i++) {
+ next = new DepthRejectableClass(next);
+ }
+ return next;
+ }
+ }
+
}
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/security/AccessController/DoPrivAccompliceTest.java
--- a/jdk/test/java/security/AccessController/DoPrivAccompliceTest.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/security/AccessController/DoPrivAccompliceTest.java Wed Jul 05 23:40:06 2017 +0200
@@ -42,7 +42,13 @@
* DoPrivAccmplice.jar.
*
* @library /test/lib
- *
+ * @build jdk.test.lib.util.JarUtils
+ * jdk.test.lib.Utils
+ * jdk.test.lib.Asserts
+ * jdk.test.lib.JDKToolFinder
+ * jdk.test.lib.JDKToolLauncher
+ * jdk.test.lib.Platform
+ * jdk.test.lib.process.*
* @run main/othervm DoPrivAccompliceTest
*/
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/security/KeyStore/PKCS12/EntryProtectionTest.java
--- a/jdk/test/java/security/KeyStore/PKCS12/EntryProtectionTest.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/security/KeyStore/PKCS12/EntryProtectionTest.java Wed Jul 05 23:40:06 2017 +0200
@@ -42,6 +42,8 @@
* specified by different PBE algorithms (use -Dseed=X to set PRNG seed)
* @library /test/lib /lib/testlibrary ../
* @key randomness
+ * @build jdk.test.lib.RandomFactory
+ * @run main EntryProtectionTest
*/
public class EntryProtectionTest {
private static final char[] PASSWORD = "passwd".toCharArray();
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/security/MessageDigest/TestDigestIOStream.java
--- a/jdk/test/java/security/MessageDigest/TestDigestIOStream.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/security/MessageDigest/TestDigestIOStream.java Wed Jul 05 23:40:06 2017 +0200
@@ -41,6 +41,7 @@
* @author Kevin Liu
* @key randomness
* @library /test/lib
+ * @build jdk.test.lib.RandomFactory
* @run main/timeout=180 TestDigestIOStream
*/
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/security/MessageDigest/TestSameLength.java
--- a/jdk/test/java/security/MessageDigest/TestSameLength.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/security/MessageDigest/TestSameLength.java Wed Jul 05 23:40:06 2017 +0200
@@ -36,6 +36,8 @@
* @author Kevin Liu
* @key randomness
* @library /test/lib
+ * @build jdk.test.lib.RandomFactory
+ * @run main TestSameLength
*/
public class TestSameLength {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/security/MessageDigest/TestSameValue.java
--- a/jdk/test/java/security/MessageDigest/TestSameValue.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/security/MessageDigest/TestSameValue.java Wed Jul 05 23:40:06 2017 +0200
@@ -37,6 +37,8 @@
* @author Kevin Liu
* @key randomness
* @library /test/lib
+ * @build jdk.test.lib.RandomFactory
+ * @run main TestSameValue
*/
public class TestSameValue {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/security/Policy/ExtensiblePolicy/ExtensiblePolicyWithJarTest.java
--- a/jdk/test/java/security/Policy/ExtensiblePolicy/ExtensiblePolicyWithJarTest.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/security/Policy/ExtensiblePolicy/ExtensiblePolicyWithJarTest.java Wed Jul 05 23:40:06 2017 +0200
@@ -34,6 +34,7 @@
* @bug 8050402
* @summary Check policy is extensible with user defined permissions
* @library /lib/testlibrary /test/lib
+ * @build jdk.test.lib.util.JarUtils
* @compile TVJar/TVPermission.java
* @run main ExtensiblePolicyWithJarTest
*/
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/security/SecureRandom/DrbgParametersSpec.java
--- a/jdk/test/java/security/SecureRandom/DrbgParametersSpec.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/security/SecureRandom/DrbgParametersSpec.java Wed Jul 05 23:40:06 2017 +0200
@@ -25,6 +25,8 @@
* @bug 8051408 8158534
* @summary Make sure DrbgParameters coded as specified
* @library /test/lib
+ * @build jdk.test.lib.Asserts
+ * @run main DrbgParametersSpec
*/
import jdk.test.lib.Asserts;
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/security/Signature/Offsets.java
--- a/jdk/test/java/security/Signature/Offsets.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/security/Signature/Offsets.java Wed Jul 05 23:40:06 2017 +0200
@@ -42,6 +42,7 @@
* generation, the test tries to verify signature with the above API
* and passing in different signature offset (0, 33, 66, 99).
* @library /test/lib
+ * @build jdk.test.lib.RandomFactory
* @run main Offsets SUN NONEwithDSA
* @run main Offsets SUN SHA1withDSA
* @run main Offsets SUN SHA224withDSA
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/util/Arrays/ParallelPrefix.java
--- a/jdk/test/java/util/Arrays/ParallelPrefix.java Thu Jun 15 13:44:42 2017 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,279 +0,0 @@
-/*
- * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
- * 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 8014076 8025067
- * @summary unit test for Arrays.ParallelPrefix().
- * @author Tristan Yan
- * @run testng ParallelPrefix
- */
-
-import java.util.Arrays;
-import java.util.function.BinaryOperator;
-import java.util.function.DoubleBinaryOperator;
-import java.util.function.Function;
-import java.util.function.IntBinaryOperator;
-import java.util.function.LongBinaryOperator;
-import java.util.stream.IntStream;
-import java.util.stream.LongStream;
-import static org.testng.Assert.*;
-import org.testng.annotations.DataProvider;
-import org.testng.annotations.Test;
-
-public class ParallelPrefix {
- //Array size less than MIN_PARTITION
- private static final int SMALL_ARRAY_SIZE = 1 << 3;
-
- //Array size equals MIN_PARTITION
- private static final int THRESHOLD_ARRAY_SIZE = 1 << 4;
-
- //Array size greater than MIN_PARTITION
- private static final int MEDIUM_ARRAY_SIZE = 1 << 8;
-
- //Array size much greater than MIN_PARTITION
- private static final int LARGE_ARRAY_SIZE = 1 << 14;
-
- private static final int[] ARRAY_SIZE_COLLECTION = new int[]{
- SMALL_ARRAY_SIZE,
- THRESHOLD_ARRAY_SIZE,
- MEDIUM_ARRAY_SIZE,
- LARGE_ARRAY_SIZE
- };
-
- @DataProvider(name = "intSet")
- public static Object[][] intSet(){
- return genericData(size -> IntStream.range(0, size).toArray(),
- new IntBinaryOperator[]{
- Integer::sum,
- Integer::min});
- }
-
- @DataProvider(name = "longSet")
- public static Object[][] longSet(){
- return genericData(size -> LongStream.range(0, size).toArray(),
- new LongBinaryOperator[]{
- Long::sum,
- Long::min});
- }
-
- @DataProvider(name = "doubleSet")
- public static Object[][] doubleSet(){
- return genericData(size -> IntStream.range(0, size).mapToDouble(i -> (double)i).toArray(),
- new DoubleBinaryOperator[]{
- Double::sum,
- Double::min});
- }
-
- @DataProvider(name = "stringSet")
- public static Object[][] stringSet(){
- Function stringsFunc = size ->
- IntStream.range(0, size).mapToObj(Integer::toString).toArray(String[]::new);
- BinaryOperator concat = String::concat;
- return genericData(stringsFunc,
- (BinaryOperator[]) new BinaryOperator[]{
- concat });
- }
-
- private static Object[][] genericData(Function generateFunc, OPS[] ops) {
- //test arrays which size is equals n-1, n, n+1, test random data
- Object[][] data = new Object[ARRAY_SIZE_COLLECTION.length * 3 * ops.length][4];
- for(int n = 0; n < ARRAY_SIZE_COLLECTION.length; n++ ) {
- for(int testValue = -1 ; testValue <= 1; testValue++) {
- int array_size = ARRAY_SIZE_COLLECTION[n] + testValue;
- for(int opsN = 0; opsN < ops.length; opsN++) {
- int index = n * 3 * ops.length + (testValue + 1) * ops.length + opsN;
- data[index][0] = generateFunc.apply(array_size);
- data[index][1] = array_size / 3;
- data[index][2] = 2 * array_size / 3;
- data[index][3] = ops[opsN];
- }
- }
- }
- return data;
- }
-
- @Test(dataProvider="intSet")
- public void testParallelPrefixForInt(int[] data, int fromIndex, int toIndex, IntBinaryOperator op) {
- int[] sequentialResult = data.clone();
- for (int index = fromIndex + 1; index < toIndex; index++) {
- sequentialResult[index ] = op.applyAsInt(sequentialResult[index - 1], sequentialResult[index]);
- }
-
- int[] parallelResult = data.clone();
- Arrays.parallelPrefix(parallelResult, fromIndex, toIndex, op);
- assertArraysEqual(parallelResult, sequentialResult);
-
- int[] parallelRangeResult = Arrays.copyOfRange(data, fromIndex, toIndex);
- Arrays.parallelPrefix(parallelRangeResult, op);
- assertArraysEqual(parallelRangeResult, Arrays.copyOfRange(sequentialResult, fromIndex, toIndex));
- }
-
- @Test(dataProvider="longSet")
- public void testParallelPrefixForLong(long[] data, int fromIndex, int toIndex, LongBinaryOperator op) {
- long[] sequentialResult = data.clone();
- for (int index = fromIndex + 1; index < toIndex; index++) {
- sequentialResult[index ] = op.applyAsLong(sequentialResult[index - 1], sequentialResult[index]);
- }
-
- long[] parallelResult = data.clone();
- Arrays.parallelPrefix(parallelResult, fromIndex, toIndex, op);
- assertArraysEqual(parallelResult, sequentialResult);
-
- long[] parallelRangeResult = Arrays.copyOfRange(data, fromIndex, toIndex);
- Arrays.parallelPrefix(parallelRangeResult, op);
- assertArraysEqual(parallelRangeResult, Arrays.copyOfRange(sequentialResult, fromIndex, toIndex));
- }
-
- @Test(dataProvider="doubleSet")
- public void testParallelPrefixForDouble(double[] data, int fromIndex, int toIndex, DoubleBinaryOperator op) {
- double[] sequentialResult = data.clone();
- for (int index = fromIndex + 1; index < toIndex; index++) {
- sequentialResult[index ] = op.applyAsDouble(sequentialResult[index - 1], sequentialResult[index]);
- }
-
- double[] parallelResult = data.clone();
- Arrays.parallelPrefix(parallelResult, fromIndex, toIndex, op);
- assertArraysEqual(parallelResult, sequentialResult);
-
- double[] parallelRangeResult = Arrays.copyOfRange(data, fromIndex, toIndex);
- Arrays.parallelPrefix(parallelRangeResult, op);
- assertArraysEqual(parallelRangeResult, Arrays.copyOfRange(sequentialResult, fromIndex, toIndex));
- }
-
- @Test(dataProvider="stringSet")
- public void testParallelPrefixForStringr(String[] data , int fromIndex, int toIndex, BinaryOperator op) {
- String[] sequentialResult = data.clone();
- for (int index = fromIndex + 1; index < toIndex; index++) {
- sequentialResult[index ] = op.apply(sequentialResult[index - 1], sequentialResult[index]);
- }
-
- String[] parallelResult = data.clone();
- Arrays.parallelPrefix(parallelResult, fromIndex, toIndex, op);
- assertArraysEqual(parallelResult, sequentialResult);
-
- String[] parallelRangeResult = Arrays.copyOfRange(data, fromIndex, toIndex);
- Arrays.parallelPrefix(parallelRangeResult, op);
- assertArraysEqual(parallelRangeResult, Arrays.copyOfRange(sequentialResult, fromIndex, toIndex));
- }
-
- @Test
- public void testNPEs() {
- // null array
- assertThrowsNPE(() -> Arrays.parallelPrefix((int[]) null, Integer::max));
- assertThrowsNPE(() -> Arrays.parallelPrefix((long []) null, Long::max));
- assertThrowsNPE(() -> Arrays.parallelPrefix((double []) null, Double::max));
- assertThrowsNPE(() -> Arrays.parallelPrefix((String []) null, String::concat));
-
- // null array w/ range
- assertThrowsNPE(() -> Arrays.parallelPrefix((int[]) null, 0, 0, Integer::max));
- assertThrowsNPE(() -> Arrays.parallelPrefix((long []) null, 0, 0, Long::max));
- assertThrowsNPE(() -> Arrays.parallelPrefix((double []) null, 0, 0, Double::max));
- assertThrowsNPE(() -> Arrays.parallelPrefix((String []) null, 0, 0, String::concat));
-
- // null op
- assertThrowsNPE(() -> Arrays.parallelPrefix(new int[] {}, null));
- assertThrowsNPE(() -> Arrays.parallelPrefix(new long[] {}, null));
- assertThrowsNPE(() -> Arrays.parallelPrefix(new double[] {}, null));
- assertThrowsNPE(() -> Arrays.parallelPrefix(new String[] {}, null));
-
- // null op w/ range
- assertThrowsNPE(() -> Arrays.parallelPrefix(new int[] {}, 0, 0, null));
- assertThrowsNPE(() -> Arrays.parallelPrefix(new long[] {}, 0, 0, null));
- assertThrowsNPE(() -> Arrays.parallelPrefix(new double[] {}, 0, 0, null));
- assertThrowsNPE(() -> Arrays.parallelPrefix(new String[] {}, 0, 0, null));
- }
-
- @Test
- public void testIAEs() {
- assertThrowsIAE(() -> Arrays.parallelPrefix(new int[] {}, 1, 0, Integer::max));
- assertThrowsIAE(() -> Arrays.parallelPrefix(new long[] {}, 1, 0, Long::max));
- assertThrowsIAE(() -> Arrays.parallelPrefix(new double[] {}, 1, 0, Double::max));
- assertThrowsIAE(() -> Arrays.parallelPrefix(new String[] {}, 1, 0, String::concat));
- }
-
- @Test
- public void testAIOOBEs() {
- // bad "fromIndex"
- assertThrowsAIOOB(() -> Arrays.parallelPrefix(new int[] {}, -1, 0, Integer::max));
- assertThrowsAIOOB(() -> Arrays.parallelPrefix(new long[] {}, -1, 0, Long::max));
- assertThrowsAIOOB(() -> Arrays.parallelPrefix(new double[] {}, -1, 0, Double::max));
- assertThrowsAIOOB(() -> Arrays.parallelPrefix(new String[] {}, -1, 0, String::concat));
-
- // bad "toIndex"
- assertThrowsAIOOB(() -> Arrays.parallelPrefix(new int[] {}, 0, 1, Integer::max));
- assertThrowsAIOOB(() -> Arrays.parallelPrefix(new long[] {}, 0, 1, Long::max));
- assertThrowsAIOOB(() -> Arrays.parallelPrefix(new double[] {}, 0, 1, Double::max));
- assertThrowsAIOOB(() -> Arrays.parallelPrefix(new String[] {}, 0, 1, String::concat));
- }
-
- // "library" code
-
- private void assertThrowsNPE(ThrowingRunnable r) {
- assertThrows(NullPointerException.class, r);
- }
-
- private void assertThrowsIAE(ThrowingRunnable r) {
- assertThrows(IllegalArgumentException.class, r);
- }
-
- private void assertThrowsAIOOB(ThrowingRunnable r) {
- assertThrows(ArrayIndexOutOfBoundsException.class, r);
- }
-
- static void assertArraysEqual(int[] actual, int[] expected) {
- try {
- assertEquals(actual, expected, "");
- } catch (AssertionError x) {
- throw new AssertionError(String.format("Expected:%s, actual:%s",
- Arrays.toString(expected), Arrays.toString(actual)), x);
- }
- }
-
- static void assertArraysEqual(long[] actual, long[] expected) {
- try {
- assertEquals(actual, expected, "");
- } catch (AssertionError x) {
- throw new AssertionError(String.format("Expected:%s, actual:%s",
- Arrays.toString(expected), Arrays.toString(actual)), x);
- }
- }
-
- static void assertArraysEqual(double[] actual, double[] expected) {
- try {
- assertEquals(actual, expected, "");
- } catch (AssertionError x) {
- throw new AssertionError(String.format("Expected:%s, actual:%s",
- Arrays.toString(expected), Arrays.toString(actual)), x);
- }
- }
-
- static void assertArraysEqual(String[] actual, String[] expected) {
- try {
- assertEquals(actual, expected, "");
- } catch (AssertionError x) {
- throw new AssertionError(String.format("Expected:%s, actual:%s",
- Arrays.toString(expected), Arrays.toString(actual)), x);
- }
- }
-}
-
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/util/Arrays/largeMemory/ParallelPrefix.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/util/Arrays/largeMemory/ParallelPrefix.java Wed Jul 05 23:40:06 2017 +0200
@@ -0,0 +1,308 @@
+/*
+ * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
+ * 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 8014076 8025067
+ * @summary unit test for Arrays.ParallelPrefix().
+ * @author Tristan Yan
+ * @modules java.management jdk.management
+ * @run testng/othervm -Xms256m -Xmx1024m ParallelPrefix
+ */
+
+import java.lang.management.ManagementFactory;
+import java.util.Arrays;
+import java.util.function.BinaryOperator;
+import java.util.function.DoubleBinaryOperator;
+import java.util.function.Function;
+import java.util.function.IntBinaryOperator;
+import java.util.function.LongBinaryOperator;
+import java.util.stream.IntStream;
+import java.util.stream.LongStream;
+import com.sun.management.OperatingSystemMXBean;
+import static org.testng.Assert.*;
+import org.testng.annotations.DataProvider;
+import org.testng.annotations.Test;
+import org.testng.annotations.BeforeSuite;
+
+public class ParallelPrefix {
+ //Array size less than MIN_PARTITION
+ private static final int SMALL_ARRAY_SIZE = 1 << 3;
+
+ //Array size equals MIN_PARTITION
+ private static final int THRESHOLD_ARRAY_SIZE = 1 << 4;
+
+ //Array size greater than MIN_PARTITION
+ private static final int MEDIUM_ARRAY_SIZE = 1 << 8;
+
+ //Array size much greater than MIN_PARTITION
+ private static final int LARGE_ARRAY_SIZE = 1 << 14;
+
+ private static int[] arraySizeCollection;
+
+ @BeforeSuite
+ public static void setup() {
+ java.lang.management.OperatingSystemMXBean bean =
+ ManagementFactory.getOperatingSystemMXBean();
+ if (bean instanceof OperatingSystemMXBean) {
+ OperatingSystemMXBean os = (OperatingSystemMXBean)bean;
+ long physicalMemorySize = os.getTotalPhysicalMemorySize() / (1024 * 1024);
+ System.out.println("System memory size: " + physicalMemorySize + "M");
+ // when we can get system memory size, and it's larger than 2G,
+ // then we enable large array size test below,
+ // else disable large array size test below.
+ if (physicalMemorySize > (2 * 1024)) {
+ arraySizeCollection = new int[]{
+ SMALL_ARRAY_SIZE,
+ THRESHOLD_ARRAY_SIZE,
+ MEDIUM_ARRAY_SIZE,
+ LARGE_ARRAY_SIZE
+ };
+ System.out.println("System memory is large enough, add large array size test");
+ return;
+ }
+ }
+ arraySizeCollection = new int[]{
+ SMALL_ARRAY_SIZE,
+ THRESHOLD_ARRAY_SIZE,
+ MEDIUM_ARRAY_SIZE
+ };
+ System.out.println("System memory is not large enough, remove large array size test");
+ }
+
+ @DataProvider(name = "intSet")
+ public static Object[][] intSet(){
+ return genericData(size -> IntStream.range(0, size).toArray(),
+ new IntBinaryOperator[]{
+ Integer::sum,
+ Integer::min});
+ }
+
+ @DataProvider(name = "longSet")
+ public static Object[][] longSet(){
+ return genericData(size -> LongStream.range(0, size).toArray(),
+ new LongBinaryOperator[]{
+ Long::sum,
+ Long::min});
+ }
+
+ @DataProvider(name = "doubleSet")
+ public static Object[][] doubleSet(){
+ return genericData(size -> IntStream.range(0, size).mapToDouble(i -> (double)i).toArray(),
+ new DoubleBinaryOperator[]{
+ Double::sum,
+ Double::min});
+ }
+
+ @DataProvider(name = "stringSet")
+ public static Object[][] stringSet(){
+ Function stringsFunc = size ->
+ IntStream.range(0, size).mapToObj(Integer::toString).toArray(String[]::new);
+ BinaryOperator concat = String::concat;
+ return genericData(stringsFunc,
+ (BinaryOperator[]) new BinaryOperator[]{
+ concat });
+ }
+
+ private static Object[][] genericData(Function generateFunc, OPS[] ops) {
+ //test arrays which size is equals n-1, n, n+1, test random data
+ Object[][] data = new Object[arraySizeCollection.length * 3 * ops.length][4];
+ for(int n = 0; n < arraySizeCollection.length; n++ ) {
+ for(int testValue = -1 ; testValue <= 1; testValue++) {
+ int array_size = arraySizeCollection[n] + testValue;
+ for(int opsN = 0; opsN < ops.length; opsN++) {
+ int index = n * 3 * ops.length + (testValue + 1) * ops.length + opsN;
+ data[index][0] = generateFunc.apply(array_size);
+ data[index][1] = array_size / 3;
+ data[index][2] = 2 * array_size / 3;
+ data[index][3] = ops[opsN];
+ }
+ }
+ }
+ return data;
+ }
+
+ @Test(dataProvider="intSet")
+ public void testParallelPrefixForInt(int[] data, int fromIndex, int toIndex, IntBinaryOperator op) {
+ int[] sequentialResult = data.clone();
+ for (int index = fromIndex + 1; index < toIndex; index++) {
+ sequentialResult[index ] = op.applyAsInt(sequentialResult[index - 1], sequentialResult[index]);
+ }
+
+ int[] parallelResult = data.clone();
+ Arrays.parallelPrefix(parallelResult, fromIndex, toIndex, op);
+ assertArraysEqual(parallelResult, sequentialResult);
+
+ int[] parallelRangeResult = Arrays.copyOfRange(data, fromIndex, toIndex);
+ Arrays.parallelPrefix(parallelRangeResult, op);
+ assertArraysEqual(parallelRangeResult, Arrays.copyOfRange(sequentialResult, fromIndex, toIndex));
+ }
+
+ @Test(dataProvider="longSet")
+ public void testParallelPrefixForLong(long[] data, int fromIndex, int toIndex, LongBinaryOperator op) {
+ long[] sequentialResult = data.clone();
+ for (int index = fromIndex + 1; index < toIndex; index++) {
+ sequentialResult[index ] = op.applyAsLong(sequentialResult[index - 1], sequentialResult[index]);
+ }
+
+ long[] parallelResult = data.clone();
+ Arrays.parallelPrefix(parallelResult, fromIndex, toIndex, op);
+ assertArraysEqual(parallelResult, sequentialResult);
+
+ long[] parallelRangeResult = Arrays.copyOfRange(data, fromIndex, toIndex);
+ Arrays.parallelPrefix(parallelRangeResult, op);
+ assertArraysEqual(parallelRangeResult, Arrays.copyOfRange(sequentialResult, fromIndex, toIndex));
+ }
+
+ @Test(dataProvider="doubleSet")
+ public void testParallelPrefixForDouble(double[] data, int fromIndex, int toIndex, DoubleBinaryOperator op) {
+ double[] sequentialResult = data.clone();
+ for (int index = fromIndex + 1; index < toIndex; index++) {
+ sequentialResult[index ] = op.applyAsDouble(sequentialResult[index - 1], sequentialResult[index]);
+ }
+
+ double[] parallelResult = data.clone();
+ Arrays.parallelPrefix(parallelResult, fromIndex, toIndex, op);
+ assertArraysEqual(parallelResult, sequentialResult);
+
+ double[] parallelRangeResult = Arrays.copyOfRange(data, fromIndex, toIndex);
+ Arrays.parallelPrefix(parallelRangeResult, op);
+ assertArraysEqual(parallelRangeResult, Arrays.copyOfRange(sequentialResult, fromIndex, toIndex));
+ }
+
+ @Test(dataProvider="stringSet")
+ public void testParallelPrefixForStringr(String[] data , int fromIndex, int toIndex, BinaryOperator op) {
+ String[] sequentialResult = data.clone();
+ for (int index = fromIndex + 1; index < toIndex; index++) {
+ sequentialResult[index ] = op.apply(sequentialResult[index - 1], sequentialResult[index]);
+ }
+
+ String[] parallelResult = data.clone();
+ Arrays.parallelPrefix(parallelResult, fromIndex, toIndex, op);
+ assertArraysEqual(parallelResult, sequentialResult);
+
+ String[] parallelRangeResult = Arrays.copyOfRange(data, fromIndex, toIndex);
+ Arrays.parallelPrefix(parallelRangeResult, op);
+ assertArraysEqual(parallelRangeResult, Arrays.copyOfRange(sequentialResult, fromIndex, toIndex));
+ }
+
+ @Test
+ public void testNPEs() {
+ // null array
+ assertThrowsNPE(() -> Arrays.parallelPrefix((int[]) null, Integer::max));
+ assertThrowsNPE(() -> Arrays.parallelPrefix((long []) null, Long::max));
+ assertThrowsNPE(() -> Arrays.parallelPrefix((double []) null, Double::max));
+ assertThrowsNPE(() -> Arrays.parallelPrefix((String []) null, String::concat));
+
+ // null array w/ range
+ assertThrowsNPE(() -> Arrays.parallelPrefix((int[]) null, 0, 0, Integer::max));
+ assertThrowsNPE(() -> Arrays.parallelPrefix((long []) null, 0, 0, Long::max));
+ assertThrowsNPE(() -> Arrays.parallelPrefix((double []) null, 0, 0, Double::max));
+ assertThrowsNPE(() -> Arrays.parallelPrefix((String []) null, 0, 0, String::concat));
+
+ // null op
+ assertThrowsNPE(() -> Arrays.parallelPrefix(new int[] {}, null));
+ assertThrowsNPE(() -> Arrays.parallelPrefix(new long[] {}, null));
+ assertThrowsNPE(() -> Arrays.parallelPrefix(new double[] {}, null));
+ assertThrowsNPE(() -> Arrays.parallelPrefix(new String[] {}, null));
+
+ // null op w/ range
+ assertThrowsNPE(() -> Arrays.parallelPrefix(new int[] {}, 0, 0, null));
+ assertThrowsNPE(() -> Arrays.parallelPrefix(new long[] {}, 0, 0, null));
+ assertThrowsNPE(() -> Arrays.parallelPrefix(new double[] {}, 0, 0, null));
+ assertThrowsNPE(() -> Arrays.parallelPrefix(new String[] {}, 0, 0, null));
+ }
+
+ @Test
+ public void testIAEs() {
+ assertThrowsIAE(() -> Arrays.parallelPrefix(new int[] {}, 1, 0, Integer::max));
+ assertThrowsIAE(() -> Arrays.parallelPrefix(new long[] {}, 1, 0, Long::max));
+ assertThrowsIAE(() -> Arrays.parallelPrefix(new double[] {}, 1, 0, Double::max));
+ assertThrowsIAE(() -> Arrays.parallelPrefix(new String[] {}, 1, 0, String::concat));
+ }
+
+ @Test
+ public void testAIOOBEs() {
+ // bad "fromIndex"
+ assertThrowsAIOOB(() -> Arrays.parallelPrefix(new int[] {}, -1, 0, Integer::max));
+ assertThrowsAIOOB(() -> Arrays.parallelPrefix(new long[] {}, -1, 0, Long::max));
+ assertThrowsAIOOB(() -> Arrays.parallelPrefix(new double[] {}, -1, 0, Double::max));
+ assertThrowsAIOOB(() -> Arrays.parallelPrefix(new String[] {}, -1, 0, String::concat));
+
+ // bad "toIndex"
+ assertThrowsAIOOB(() -> Arrays.parallelPrefix(new int[] {}, 0, 1, Integer::max));
+ assertThrowsAIOOB(() -> Arrays.parallelPrefix(new long[] {}, 0, 1, Long::max));
+ assertThrowsAIOOB(() -> Arrays.parallelPrefix(new double[] {}, 0, 1, Double::max));
+ assertThrowsAIOOB(() -> Arrays.parallelPrefix(new String[] {}, 0, 1, String::concat));
+ }
+
+ // "library" code
+
+ private void assertThrowsNPE(ThrowingRunnable r) {
+ assertThrows(NullPointerException.class, r);
+ }
+
+ private void assertThrowsIAE(ThrowingRunnable r) {
+ assertThrows(IllegalArgumentException.class, r);
+ }
+
+ private void assertThrowsAIOOB(ThrowingRunnable r) {
+ assertThrows(ArrayIndexOutOfBoundsException.class, r);
+ }
+
+ static void assertArraysEqual(int[] actual, int[] expected) {
+ try {
+ assertEquals(actual, expected, "");
+ } catch (AssertionError x) {
+ throw new AssertionError(String.format("Expected:%s, actual:%s",
+ Arrays.toString(expected), Arrays.toString(actual)), x);
+ }
+ }
+
+ static void assertArraysEqual(long[] actual, long[] expected) {
+ try {
+ assertEquals(actual, expected, "");
+ } catch (AssertionError x) {
+ throw new AssertionError(String.format("Expected:%s, actual:%s",
+ Arrays.toString(expected), Arrays.toString(actual)), x);
+ }
+ }
+
+ static void assertArraysEqual(double[] actual, double[] expected) {
+ try {
+ assertEquals(actual, expected, "");
+ } catch (AssertionError x) {
+ throw new AssertionError(String.format("Expected:%s, actual:%s",
+ Arrays.toString(expected), Arrays.toString(actual)), x);
+ }
+ }
+
+ static void assertArraysEqual(String[] actual, String[] expected) {
+ try {
+ assertEquals(actual, expected, "");
+ } catch (AssertionError x) {
+ throw new AssertionError(String.format("Expected:%s, actual:%s",
+ Arrays.toString(expected), Arrays.toString(actual)), x);
+ }
+ }
+}
+
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/util/Base64/TestBase64.java
--- a/jdk/test/java/util/Base64/TestBase64.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/util/Base64/TestBase64.java Wed Jul 05 23:40:06 2017 +0200
@@ -26,6 +26,7 @@
* 8014217 8025003 8026330 8028397 8129544 8165243
* @summary tests java.util.Base64
* @library /test/lib
+ * @build jdk.test.lib.RandomFactory
* @run main TestBase64
* @key randomness
*/
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/util/List/SubList.java
--- a/jdk/test/java/util/List/SubList.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/util/List/SubList.java Wed Jul 05 23:40:06 2017 +0200
@@ -25,6 +25,7 @@
* @test
* @bug 8079136
* @library /test/lib
+ * @build jdk.test.lib.RandomFactory
* @run testng SubList
* @summary Basic functionality of sublists
* @key randomness
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/util/ResourceBundle/modules/appbasic/src/asiabundles/jdk/test/resources/asia/MyResourcesAsia.java
--- a/jdk/test/java/util/ResourceBundle/modules/appbasic/src/asiabundles/jdk/test/resources/asia/MyResourcesAsia.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/util/ResourceBundle/modules/appbasic/src/asiabundles/jdk/test/resources/asia/MyResourcesAsia.java Wed Jul 05 23:40:06 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -28,7 +28,7 @@
import java.util.Set;
import java.util.spi.AbstractResourceBundleProvider;
-import jdk.test.resources.MyResourcesProvider;
+import jdk.test.resources.spi.MyResourcesProvider;
public class MyResourcesAsia extends AbstractResourceBundleProvider
implements MyResourcesProvider
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/util/ResourceBundle/modules/appbasic/src/asiabundles/module-info.java
--- a/jdk/test/java/util/ResourceBundle/modules/appbasic/src/asiabundles/module-info.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/util/ResourceBundle/modules/appbasic/src/asiabundles/module-info.java Wed Jul 05 23:40:06 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
* 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,6 +24,6 @@
module asiabundles {
requires test;
- provides jdk.test.resources.MyResourcesProvider
+ provides jdk.test.resources.spi.MyResourcesProvider
with jdk.test.resources.asia.MyResourcesAsia;
}
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/util/ResourceBundle/modules/appbasic/src/eubundles/jdk/test/resources/eu/MyResourcesEU.java
--- a/jdk/test/java/util/ResourceBundle/modules/appbasic/src/eubundles/jdk/test/resources/eu/MyResourcesEU.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/util/ResourceBundle/modules/appbasic/src/eubundles/jdk/test/resources/eu/MyResourcesEU.java Wed Jul 05 23:40:06 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -28,7 +28,7 @@
import java.util.Set;
import java.util.spi.AbstractResourceBundleProvider;
-import jdk.test.resources.MyResourcesProvider;
+import jdk.test.resources.spi.MyResourcesProvider;
public class MyResourcesEU extends AbstractResourceBundleProvider
implements MyResourcesProvider
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/util/ResourceBundle/modules/appbasic/src/eubundles/module-info.java
--- a/jdk/test/java/util/ResourceBundle/modules/appbasic/src/eubundles/module-info.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/util/ResourceBundle/modules/appbasic/src/eubundles/module-info.java Wed Jul 05 23:40:06 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
* 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,6 +24,6 @@
module eubundles {
requires test;
- provides jdk.test.resources.MyResourcesProvider
+ provides jdk.test.resources.spi.MyResourcesProvider
with jdk.test.resources.eu.MyResourcesEU;
}
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/util/ResourceBundle/modules/appbasic/src/test/jdk/test/resources/MyResourcesProvider.java
--- a/jdk/test/java/util/ResourceBundle/modules/appbasic/src/test/jdk/test/resources/MyResourcesProvider.java Thu Jun 15 13:44:42 2017 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +0,0 @@
-/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package jdk.test.resources;
-
-import java.util.spi.ResourceBundleProvider;
-
-public interface MyResourcesProvider extends ResourceBundleProvider {
-}
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/util/ResourceBundle/modules/appbasic/src/test/jdk/test/resources/MyResourcesProviderImpl.java
--- a/jdk/test/java/util/ResourceBundle/modules/appbasic/src/test/jdk/test/resources/MyResourcesProviderImpl.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/util/ResourceBundle/modules/appbasic/src/test/jdk/test/resources/MyResourcesProviderImpl.java Wed Jul 05 23:40:06 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,7 @@
import java.util.Locale;
import java.util.ResourceBundle;
import java.util.spi.AbstractResourceBundleProvider;
+import jdk.test.resources.spi.MyResourcesProvider;
public class MyResourcesProviderImpl extends AbstractResourceBundleProvider
implements MyResourcesProvider
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/util/ResourceBundle/modules/appbasic/src/test/jdk/test/resources/spi/MyResourcesProvider.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/util/ResourceBundle/modules/appbasic/src/test/jdk/test/resources/spi/MyResourcesProvider.java Wed Jul 05 23:40:06 2017 +0200
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
+ * 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.
+ */
+
+package jdk.test.resources.spi;
+
+import java.util.spi.ResourceBundleProvider;
+
+public interface MyResourcesProvider extends ResourceBundleProvider {
+}
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/util/ResourceBundle/modules/appbasic/src/test/module-info.java
--- a/jdk/test/java/util/ResourceBundle/modules/appbasic/src/test/module-info.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/util/ResourceBundle/modules/appbasic/src/test/module-info.java Wed Jul 05 23:40:06 2017 +0200
@@ -22,7 +22,7 @@
*/
module test {
- exports jdk.test.resources to eubundles, asiabundles;
- uses jdk.test.resources.MyResourcesProvider;
- provides jdk.test.resources.MyResourcesProvider with jdk.test.resources.MyResourcesProviderImpl;
+ exports jdk.test.resources.spi to eubundles, asiabundles;
+ uses jdk.test.resources.spi.MyResourcesProvider;
+ provides jdk.test.resources.spi.MyResourcesProvider with jdk.test.resources.MyResourcesProviderImpl;
}
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/util/ResourceBundle/modules/appbasic2/src/asiabundles/jdk/test/resources/asia/MyResourcesAsia.java
--- a/jdk/test/java/util/ResourceBundle/modules/appbasic2/src/asiabundles/jdk/test/resources/asia/MyResourcesAsia.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/util/ResourceBundle/modules/appbasic2/src/asiabundles/jdk/test/resources/asia/MyResourcesAsia.java Wed Jul 05 23:40:06 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
* 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,7 +24,7 @@
package jdk.test.resources.asia;
import java.util.Locale;
-import jdk.test.resources.MyResourcesProvider;
+import jdk.test.resources.spi.MyResourcesProvider;
public class MyResourcesAsia extends MyResourcesProvider {
public MyResourcesAsia() {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/util/ResourceBundle/modules/appbasic2/src/asiabundles/module-info.java
--- a/jdk/test/java/util/ResourceBundle/modules/appbasic2/src/asiabundles/module-info.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/util/ResourceBundle/modules/appbasic2/src/asiabundles/module-info.java Wed Jul 05 23:40:06 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
* 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,6 +24,6 @@
module asiabundles {
requires test;
- provides jdk.test.resources.MyResourcesProvider
+ provides jdk.test.resources.spi.MyResourcesProvider
with jdk.test.resources.asia.MyResourcesAsia;
}
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/util/ResourceBundle/modules/appbasic2/src/eubundles/jdk/test/resources/eu/MyResourcesEU.java
--- a/jdk/test/java/util/ResourceBundle/modules/appbasic2/src/eubundles/jdk/test/resources/eu/MyResourcesEU.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/util/ResourceBundle/modules/appbasic2/src/eubundles/jdk/test/resources/eu/MyResourcesEU.java Wed Jul 05 23:40:06 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
* 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,7 +24,7 @@
package jdk.test.resources.eu;
import java.util.Locale;
-import jdk.test.resources.MyResourcesProvider;
+import jdk.test.resources.spi.MyResourcesProvider;
public class MyResourcesEU extends MyResourcesProvider {
public MyResourcesEU() {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/util/ResourceBundle/modules/appbasic2/src/eubundles/module-info.java
--- a/jdk/test/java/util/ResourceBundle/modules/appbasic2/src/eubundles/module-info.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/util/ResourceBundle/modules/appbasic2/src/eubundles/module-info.java Wed Jul 05 23:40:06 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
* 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,6 +24,6 @@
module eubundles {
requires test;
- provides jdk.test.resources.MyResourcesProvider
+ provides jdk.test.resources.spi.MyResourcesProvider
with jdk.test.resources.eu.MyResourcesEU;
}
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/util/ResourceBundle/modules/appbasic2/src/test/jdk/test/resources/MyResourcesProvider.java
--- a/jdk/test/java/util/ResourceBundle/modules/appbasic2/src/test/jdk/test/resources/MyResourcesProvider.java Thu Jun 15 13:44:42 2017 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +0,0 @@
-/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package jdk.test.resources;
-
-
-import java.util.Locale;
-import java.util.ResourceBundle;
-import java.util.spi.AbstractResourceBundleProvider;
-
-public abstract class MyResourcesProvider extends AbstractResourceBundleProvider {
- protected MyResourcesProvider(String... formats) {
- super(formats);
- }
-
- @Override
- public ResourceBundle getBundle(String baseName, Locale locale) {
- if (isSupportedInModule(locale)) {
- return super.getBundle(baseName, locale);
- }
- return null;
- }
-
- protected abstract boolean isSupportedInModule(Locale locale);
-}
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/util/ResourceBundle/modules/appbasic2/src/test/jdk/test/resources/MyResourcesProviderImpl.java
--- a/jdk/test/java/util/ResourceBundle/modules/appbasic2/src/test/jdk/test/resources/MyResourcesProviderImpl.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/util/ResourceBundle/modules/appbasic2/src/test/jdk/test/resources/MyResourcesProviderImpl.java Wed Jul 05 23:40:06 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
* 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,6 +24,7 @@
package jdk.test.resources;
import java.util.Locale;
+import jdk.test.resources.spi.MyResourcesProvider;
public class MyResourcesProviderImpl extends MyResourcesProvider {
public MyResourcesProviderImpl() {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/util/ResourceBundle/modules/appbasic2/src/test/jdk/test/resources/spi/MyResourcesProvider.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/util/ResourceBundle/modules/appbasic2/src/test/jdk/test/resources/spi/MyResourcesProvider.java Wed Jul 05 23:40:06 2017 +0200
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
+ * 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.
+ */
+
+package jdk.test.resources.spi;
+
+
+import java.util.Locale;
+import java.util.ResourceBundle;
+import java.util.spi.AbstractResourceBundleProvider;
+
+public abstract class MyResourcesProvider extends AbstractResourceBundleProvider {
+ protected MyResourcesProvider(String... formats) {
+ super(formats);
+ }
+
+ @Override
+ public ResourceBundle getBundle(String baseName, Locale locale) {
+ if (isSupportedInModule(locale)) {
+ return super.getBundle(baseName, locale);
+ }
+ return null;
+ }
+
+ protected abstract boolean isSupportedInModule(Locale locale);
+}
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/util/ResourceBundle/modules/appbasic2/src/test/module-info.java
--- a/jdk/test/java/util/ResourceBundle/modules/appbasic2/src/test/module-info.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/util/ResourceBundle/modules/appbasic2/src/test/module-info.java Wed Jul 05 23:40:06 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,7 @@
*/
module test {
- exports jdk.test.resources to eubundles, asiabundles;
- uses jdk.test.resources.MyResourcesProvider;
- provides jdk.test.resources.MyResourcesProvider with jdk.test.resources.MyResourcesProviderImpl;
+ exports jdk.test.resources.spi to eubundles, asiabundles;
+ uses jdk.test.resources.spi.MyResourcesProvider;
+ provides jdk.test.resources.spi.MyResourcesProvider with jdk.test.resources.MyResourcesProviderImpl;
}
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/util/ResourceBundle/modules/basic/src/asiabundles/jdk/test/resources/asia/MyResourcesAsia.java
--- a/jdk/test/java/util/ResourceBundle/modules/basic/src/asiabundles/jdk/test/resources/asia/MyResourcesAsia.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/util/ResourceBundle/modules/basic/src/asiabundles/jdk/test/resources/asia/MyResourcesAsia.java Wed Jul 05 23:40:06 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
* 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,7 +24,7 @@
package jdk.test.resources.asia;
import java.util.Locale;
-import jdk.test.resources.MyResourcesProvider;
+import jdk.test.resources.spi.MyResourcesProvider;
/**
*
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/util/ResourceBundle/modules/basic/src/asiabundles/module-info.java
--- a/jdk/test/java/util/ResourceBundle/modules/basic/src/asiabundles/module-info.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/util/ResourceBundle/modules/basic/src/asiabundles/module-info.java Wed Jul 05 23:40:06 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
* 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,6 +24,6 @@
module asiabundles {
requires mainbundles;
- provides jdk.test.resources.MyResourcesProvider
+ provides jdk.test.resources.spi.MyResourcesProvider
with jdk.test.resources.asia.MyResourcesAsia;
}
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/util/ResourceBundle/modules/basic/src/eubundles/jdk/test/resources/eu/MyResourcesEU.java
--- a/jdk/test/java/util/ResourceBundle/modules/basic/src/eubundles/jdk/test/resources/eu/MyResourcesEU.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/util/ResourceBundle/modules/basic/src/eubundles/jdk/test/resources/eu/MyResourcesEU.java Wed Jul 05 23:40:06 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
* 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,7 +24,7 @@
package jdk.test.resources.eu;
import java.util.Locale;
-import jdk.test.resources.MyResourcesProvider;
+import jdk.test.resources.spi.MyResourcesProvider;
/**
*
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/util/ResourceBundle/modules/basic/src/eubundles/module-info.java
--- a/jdk/test/java/util/ResourceBundle/modules/basic/src/eubundles/module-info.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/util/ResourceBundle/modules/basic/src/eubundles/module-info.java Wed Jul 05 23:40:06 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
* 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,6 +24,6 @@
module eubundles {
requires mainbundles;
- provides jdk.test.resources.MyResourcesProvider
+ provides jdk.test.resources.spi.MyResourcesProvider
with jdk.test.resources.eu.MyResourcesEU;
}
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/util/ResourceBundle/modules/basic/src/mainbundles/jdk/test/resources/MyResourcesMain.java
--- a/jdk/test/java/util/ResourceBundle/modules/basic/src/mainbundles/jdk/test/resources/MyResourcesMain.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/util/ResourceBundle/modules/basic/src/mainbundles/jdk/test/resources/MyResourcesMain.java Wed Jul 05 23:40:06 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
* 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,6 +24,7 @@
package jdk.test.resources;
import java.util.Locale;
+import jdk.test.resources.spi.MyResourcesProvider;
public class MyResourcesMain extends MyResourcesProvider {
public MyResourcesMain() {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/util/ResourceBundle/modules/basic/src/mainbundles/jdk/test/resources/MyResourcesProvider.java
--- a/jdk/test/java/util/ResourceBundle/modules/basic/src/mainbundles/jdk/test/resources/MyResourcesProvider.java Thu Jun 15 13:44:42 2017 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,80 +0,0 @@
-/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package jdk.test.resources;
-
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Locale;
-import java.util.ResourceBundle;
-import java.util.ResourceBundle.Control;
-import java.util.Set;
-import java.util.spi.AbstractResourceBundleProvider;
-
-
-public class MyResourcesProvider extends AbstractResourceBundleProvider {
- private final String region;
- private final Set supportedLocales;
- private final List formats;
-
- protected MyResourcesProvider() {
- region = "";
- supportedLocales = null;
- formats = Collections.emptyList();
- }
-
- protected MyResourcesProvider(String format, String region, Locale... locales) {
- super(format);
- this.region = region;
- this.supportedLocales = new HashSet<>(Arrays.asList(locales));
- this.formats = Collections.singletonList(format);
- }
-
- @Override
- public ResourceBundle getBundle(String baseName, Locale locale) {
- if (isSupportedInModule(locale)) {
- return super.getBundle(baseName, locale);
- }
- return null;
- }
-
- @Override
- protected String toBundleName(String baseName, Locale locale) {
- String name = addRegion(baseName);
- return Control.getControl(Control.FORMAT_DEFAULT).toBundleName(name, locale);
- }
-
- private String addRegion(String baseName) {
- if (region.isEmpty()) {
- return baseName;
- }
- int index = baseName.lastIndexOf('.');
- return baseName.substring(0, index + 1) + region + baseName.substring(index);
- }
-
- protected boolean isSupportedInModule(Locale locale) {
- return supportedLocales.contains(locale);
- }
-}
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/util/ResourceBundle/modules/basic/src/mainbundles/jdk/test/resources/spi/MyResourcesProvider.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/util/ResourceBundle/modules/basic/src/mainbundles/jdk/test/resources/spi/MyResourcesProvider.java Wed Jul 05 23:40:06 2017 +0200
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
+ * 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.
+ */
+
+package jdk.test.resources.spi;
+
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Locale;
+import java.util.ResourceBundle;
+import java.util.ResourceBundle.Control;
+import java.util.Set;
+import java.util.spi.AbstractResourceBundleProvider;
+
+
+public class MyResourcesProvider extends AbstractResourceBundleProvider {
+ private final String region;
+ private final Set supportedLocales;
+ private final List formats;
+
+ protected MyResourcesProvider() {
+ region = "";
+ supportedLocales = null;
+ formats = Collections.emptyList();
+ }
+
+ protected MyResourcesProvider(String format, String region, Locale... locales) {
+ super(format);
+ this.region = region;
+ this.supportedLocales = new HashSet<>(Arrays.asList(locales));
+ this.formats = Collections.singletonList(format);
+ }
+
+ @Override
+ public ResourceBundle getBundle(String baseName, Locale locale) {
+ if (isSupportedInModule(locale)) {
+ return super.getBundle(baseName, locale);
+ }
+ return null;
+ }
+
+ @Override
+ protected String toBundleName(String baseName, Locale locale) {
+ String name = addRegion(baseName);
+ return Control.getControl(Control.FORMAT_DEFAULT).toBundleName(name, locale);
+ }
+
+ private String addRegion(String baseName) {
+ if (region.isEmpty()) {
+ return baseName;
+ }
+ int index = baseName.lastIndexOf('.');
+ return baseName.substring(0, index + 1) + region + baseName.substring(index);
+ }
+
+ protected boolean isSupportedInModule(Locale locale) {
+ return supportedLocales.contains(locale);
+ }
+}
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/util/ResourceBundle/modules/basic/src/mainbundles/module-info.java
--- a/jdk/test/java/util/ResourceBundle/modules/basic/src/mainbundles/module-info.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/util/ResourceBundle/modules/basic/src/mainbundles/module-info.java Wed Jul 05 23:40:06 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,7 @@
*/
module mainbundles {
- exports jdk.test.resources to test, eubundles, asiabundles;
- provides jdk.test.resources.MyResourcesProvider
+ exports jdk.test.resources.spi to test, eubundles, asiabundles;
+ provides jdk.test.resources.spi.MyResourcesProvider
with jdk.test.resources.MyResourcesMain;
}
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/util/ResourceBundle/modules/basic/src/test/module-info.java
--- a/jdk/test/java/util/ResourceBundle/modules/basic/src/test/module-info.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/util/ResourceBundle/modules/basic/src/test/module-info.java Wed Jul 05 23:40:06 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
* 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,5 +23,5 @@
module test {
requires mainbundles;
- uses jdk.test.resources.MyResourcesProvider;
+ uses jdk.test.resources.spi.MyResourcesProvider;
}
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/util/ResourceBundle/modules/layer/run.sh
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/util/ResourceBundle/modules/layer/run.sh Wed Jul 05 23:40:06 2017 +0200
@@ -0,0 +1,52 @@
+#
+# Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+# 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 8180375
+# @summary Tests resource bundles are correctly loaded from
+# modules through ".spi.Provider" types.
+
+set -e
+
+if [ -z "$TESTJAVA" ]; then
+ if [ $# -lt 1 ]; then exit 1; fi
+ TESTJAVA="$1"; shift
+ COMPILEJAVA="${TESTJAVA}"
+ TESTSRC="`pwd`"
+ TESTCLASSES="`pwd`"
+fi
+
+JAVAC="$COMPILEJAVA/bin/javac"
+JAVA="$TESTJAVA/bin/java"
+
+rm -rf mods
+$JAVAC --module-source-path $TESTSRC/src -d mods --module m1,m2
+
+mkdir -p mods/m1/p/resources mods/m2/p/resources
+cp $TESTSRC/src/m1/p/resources/*.properties mods/m1/p/resources
+cp $TESTSRC/src/m2/p/resources/*.properties mods/m2/p/resources
+
+mkdir classes
+$JAVAC -d classes $TESTSRC/src/Main.java
+
+$JAVA -cp classes Main
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/util/ResourceBundle/modules/layer/src/Main.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/util/ResourceBundle/modules/layer/src/Main.java Wed Jul 05 23:40:06 2017 +0200
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * 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.module.Configuration;
+import java.lang.module.ModuleFinder;
+import java.lang.reflect.Method;
+import java.nio.file.Paths;
+import java.util.List;
+import java.util.Locale;
+import java.util.ResourceBundle;
+
+public class Main {
+ public static void main(String... args) throws Exception {
+ ModuleFinder afterFinder = ModuleFinder.of(Paths.get("mods"));
+
+ Configuration cf = ModuleLayer.boot().configuration()
+ .resolveAndBind(ModuleFinder.of(), afterFinder,
+ List.of("m1", "m2"));
+
+ System.out.println("Configuration: " + cf);
+
+ ModuleLayer l = ModuleLayer.defineModulesWithManyLoaders(cf,
+ List.of(ModuleLayer.boot()),
+ ClassLoader.getPlatformClassLoader())
+ .layer();
+
+ Module m1 = l.findModule("m1").get();
+ ResourceBundle bundle =
+ ResourceBundle.getBundle("p.resources.MyResource",
+ Locale.US, m1);
+ ResourceBundle jabundle =
+ ResourceBundle.getBundle("p.resources.MyResource",
+ Locale.JAPANESE, m1);
+
+ String enResult = bundle.getString("key");
+ String jaResult = jabundle.getString("key");
+ if (!"hi".equals(enResult) || !"ja".equals(jaResult)) {
+ throw new RuntimeException("Unexpected resources loaded: en: " +
+ enResult + ", ja: " + jaResult);
+ }
+
+ Class> c = Class.forName(m1, "p.Main");
+ Method m = c.getDeclaredMethod("run");
+ m.invoke(null);
+ }
+}
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/util/ResourceBundle/modules/layer/src/m1/module-info.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/util/ResourceBundle/modules/layer/src/m1/module-info.java Wed Jul 05 23:40:06 2017 +0200
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * 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.
+ */
+
+module m1 {
+ exports p;
+ exports p.resources.spi;
+ uses p.resources.spi.MyResourceProvider;
+ provides p.resources.spi.MyResourceProvider with p.internal.BundleProvider;
+}
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/util/ResourceBundle/modules/layer/src/m1/p/Main.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/util/ResourceBundle/modules/layer/src/m1/p/Main.java Wed Jul 05 23:40:06 2017 +0200
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * 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.
+ */
+
+package p;
+
+import java.util.Locale;
+import java.util.ResourceBundle;
+import java.io.InputStream;
+
+public class Main {
+ public static void main(String... args) {
+ run();
+ }
+
+ public static void run() {
+ ClassLoader loader =
+ Main.class.getModule().getLayer().findLoader("m1");
+ ClassLoader loader2 =
+ Main.class.getModule().getLayer().findLoader("m2");
+
+ ResourceBundle bundle =
+ ResourceBundle.getBundle("p.resources.MyResource", Locale.US);
+ ResourceBundle bundle1 =
+ ResourceBundle.getBundle("p.resources.MyResource", Locale.JAPANESE);
+
+ String enResult = bundle.getString("key");
+ String jaResult = bundle1.getString("key");
+ if (!"hi".equals(enResult) || !"ja".equals(jaResult)) {
+ throw new RuntimeException("Unexpected resources loaded: en: " +
+ enResult + ", ja: " + jaResult);
+ }
+ }
+}
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/util/ResourceBundle/modules/layer/src/m1/p/internal/BundleProvider.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/util/ResourceBundle/modules/layer/src/m1/p/internal/BundleProvider.java Wed Jul 05 23:40:06 2017 +0200
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * 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.
+ */
+
+package p.internal;
+
+import p.resources.spi.MyResourceProvider;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.UncheckedIOException;
+import java.util.Locale;
+import java.util.PropertyResourceBundle;
+import java.util.ResourceBundle;
+import java.util.spi.AbstractResourceBundleProvider;
+
+public class BundleProvider extends AbstractResourceBundleProvider
+ implements MyResourceProvider {
+ public BundleProvider() {
+ super();
+ }
+ @Override
+ public ResourceBundle getBundle(String baseName, Locale locale) {
+ if (locale.equals(Locale.ENGLISH) || locale.equals(Locale.ROOT)) {
+ return super.getBundle(baseName, locale);
+ }
+
+ return null;
+ }
+
+}
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/util/ResourceBundle/modules/layer/src/m1/p/resources/MyResource.properties
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/util/ResourceBundle/modules/layer/src/m1/p/resources/MyResource.properties Wed Jul 05 23:40:06 2017 +0200
@@ -0,0 +1,24 @@
+#
+# Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+# 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.
+#
+
+key=hi
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/util/ResourceBundle/modules/layer/src/m1/p/resources/spi/MyResourceProvider.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/util/ResourceBundle/modules/layer/src/m1/p/resources/spi/MyResourceProvider.java Wed Jul 05 23:40:06 2017 +0200
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * 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.
+ */
+
+package p.resources.spi;
+
+import java.util.spi.ResourceBundleProvider;
+
+
+public interface MyResourceProvider extends ResourceBundleProvider {
+}
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/util/ResourceBundle/modules/layer/src/m2/module-info.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/util/ResourceBundle/modules/layer/src/m2/module-info.java Wed Jul 05 23:40:06 2017 +0200
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * 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.
+ */
+
+module m2 {
+ requires m1;
+ provides p.resources.spi.MyResourceProvider with p.internal.BundleProvider;
+}
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/util/ResourceBundle/modules/layer/src/m2/p/internal/BundleProvider.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/util/ResourceBundle/modules/layer/src/m2/p/internal/BundleProvider.java Wed Jul 05 23:40:06 2017 +0200
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * 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.
+ */
+
+package p.internal;
+
+import p.resources.spi.MyResourceProvider;
+
+
+import java.io.IOException;
+import java.io.UncheckedIOException;
+import java.util.Locale;
+import java.util.ResourceBundle;
+import java.util.spi.AbstractResourceBundleProvider;
+
+public class BundleProvider extends AbstractResourceBundleProvider
+ implements MyResourceProvider {
+ public BundleProvider() {
+ super();
+ }
+ @Override
+ public ResourceBundle getBundle(String baseName, Locale locale) {
+ if (locale.equals(Locale.JAPANESE)) {
+ return super.getBundle(baseName, locale);
+ }
+ return null;
+ }
+}
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/util/ResourceBundle/modules/layer/src/m2/p/resources/MyResource_ja.properties
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/util/ResourceBundle/modules/layer/src/m2/p/resources/MyResource_ja.properties Wed Jul 05 23:40:06 2017 +0200
@@ -0,0 +1,24 @@
+#
+# Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+# 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.
+#
+
+key=ja
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/util/ResourceBundle/modules/simple/src/bundles/jdk/test/resources/MyResourcesProvider.java
--- a/jdk/test/java/util/ResourceBundle/modules/simple/src/bundles/jdk/test/resources/MyResourcesProvider.java Thu Jun 15 13:44:42 2017 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
- * 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.
- */
-
-package jdk.test.resources;
-
-import java.util.Locale;
-import java.util.spi.AbstractResourceBundleProvider;
-
-public class MyResourcesProvider extends AbstractResourceBundleProvider {
- public MyResourcesProvider() {
- super("java.class", "java.properties");
- System.err.println("MyResourcesProvider called " + this);
- }
-
- @Override
- protected String toBundleName(String baseName, Locale locale) {
- StringBuilder sb = new StringBuilder(baseName);
- String lang = locale.getLanguage();
- if (!lang.isEmpty()) {
- sb.append('_').append(lang);
- String country = locale.getCountry();
- if (!country.isEmpty()) {
- sb.append('_').append(country);
- }
- }
- return sb.toString();
- }
-}
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/util/ResourceBundle/modules/simple/src/bundles/jdk/test/resources/spi/MyResourcesProvider.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/util/ResourceBundle/modules/simple/src/bundles/jdk/test/resources/spi/MyResourcesProvider.java Wed Jul 05 23:40:06 2017 +0200
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
+ * 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.
+ */
+
+package jdk.test.resources.spi;
+
+import java.util.Locale;
+import java.util.spi.AbstractResourceBundleProvider;
+
+public class MyResourcesProvider extends AbstractResourceBundleProvider {
+ public MyResourcesProvider() {
+ super("java.class", "java.properties");
+ System.err.println("MyResourcesProvider called " + this);
+ }
+
+ @Override
+ protected String toBundleName(String baseName, Locale locale) {
+ StringBuilder sb = new StringBuilder(baseName);
+ String lang = locale.getLanguage();
+ if (!lang.isEmpty()) {
+ sb.append('_').append(lang);
+ String country = locale.getCountry();
+ if (!country.isEmpty()) {
+ sb.append('_').append(country);
+ }
+ }
+ return sb.toString();
+ }
+}
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/util/ResourceBundle/modules/simple/src/bundles/module-info.java
--- a/jdk/test/java/util/ResourceBundle/modules/simple/src/bundles/module-info.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/util/ResourceBundle/modules/simple/src/bundles/module-info.java Wed Jul 05 23:40:06 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,6 @@
*/
module bundles {
- exports jdk.test.resources to test;
- provides jdk.test.resources.MyResourcesProvider with jdk.test.resources.MyResourcesProvider;
+ exports jdk.test.resources.spi to test;
+ provides jdk.test.resources.spi.MyResourcesProvider with jdk.test.resources.spi.MyResourcesProvider;
}
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/util/ResourceBundle/modules/simple/src/test/module-info.java
--- a/jdk/test/java/util/ResourceBundle/modules/simple/src/test/module-info.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/util/ResourceBundle/modules/simple/src/test/module-info.java Wed Jul 05 23:40:06 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
* 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,5 +24,5 @@
module test {
requires bundles;
- uses jdk.test.resources.MyResourcesProvider;
+ uses jdk.test.resources.spi.MyResourcesProvider;
}
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/util/ResourceBundle/modules/visibility/src/exported.named.bundles/jdk/test/resources/exported/classes/MyResourcesProvider.java
--- a/jdk/test/java/util/ResourceBundle/modules/visibility/src/exported.named.bundles/jdk/test/resources/exported/classes/MyResourcesProvider.java Thu Jun 15 13:44:42 2017 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
- * 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.
- */
-
-package jdk.test.resources.exported.classes;
-
-import java.util.Locale;
-import java.util.spi.AbstractResourceBundleProvider;
-
-public class MyResourcesProvider extends AbstractResourceBundleProvider {
- public MyResourcesProvider() {
- super("java.class", "java.properties");
- System.err.println("MyResourcesProvider called " + this);
- }
-
- @Override
- protected String toBundleName(String baseName, Locale locale) {
- StringBuilder sb = new StringBuilder(baseName);
- String lang = locale.getLanguage();
- if (!lang.isEmpty()) {
- sb.append('_').append(lang);
- String country = locale.getCountry();
- if (!country.isEmpty()) {
- sb.append('_').append(country);
- }
- }
- return sb.toString();
- }
-}
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/util/ResourceBundle/modules/visibility/src/exported.named.bundles/jdk/test/resources/exported/classes/spi/MyResourcesProvider.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/util/ResourceBundle/modules/visibility/src/exported.named.bundles/jdk/test/resources/exported/classes/spi/MyResourcesProvider.java Wed Jul 05 23:40:06 2017 +0200
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
+ * 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.
+ */
+
+package jdk.test.resources.exported.classes.spi;
+
+import java.util.Locale;
+import java.util.spi.AbstractResourceBundleProvider;
+
+public class MyResourcesProvider extends AbstractResourceBundleProvider {
+ public MyResourcesProvider() {
+ super("java.class", "java.properties");
+ System.err.println("MyResourcesProvider called " + this);
+ }
+
+ @Override
+ protected String toBundleName(String baseName, Locale locale) {
+ StringBuilder sb = new StringBuilder(baseName);
+ String lang = locale.getLanguage();
+ if (!lang.isEmpty()) {
+ sb.append('_').append(lang);
+ String country = locale.getCountry();
+ if (!country.isEmpty()) {
+ sb.append('_').append(country);
+ }
+ }
+ return sb.toString();
+ }
+}
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/util/ResourceBundle/modules/visibility/src/exported.named.bundles/module-info.java
--- a/jdk/test/java/util/ResourceBundle/modules/visibility/src/exported.named.bundles/module-info.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/util/ResourceBundle/modules/visibility/src/exported.named.bundles/module-info.java Wed Jul 05 23:40:06 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
* 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,6 +25,6 @@
// unqualified exports to verify that resource bundles are not picked
// up by other named modules
exports jdk.test.resources.exported.classes;
- provides jdk.test.resources.exported.classes.MyResourcesProvider
- with jdk.test.resources.exported.classes.MyResourcesProvider;
+ provides jdk.test.resources.exported.classes.spi.MyResourcesProvider
+ with jdk.test.resources.exported.classes.spi.MyResourcesProvider;
}
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/util/ResourceBundle/modules/visibility/src/named.bundles/jdk/test/resources/classes/MyResourcesProvider.java
--- a/jdk/test/java/util/ResourceBundle/modules/visibility/src/named.bundles/jdk/test/resources/classes/MyResourcesProvider.java Thu Jun 15 13:44:42 2017 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +0,0 @@
-/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package jdk.test.resources.classes;
-
-import java.util.Locale;
-import java.util.ResourceBundle;
-import java.util.spi.AbstractResourceBundleProvider;
-
-public class MyResourcesProvider extends AbstractResourceBundleProvider {
- public MyResourcesProvider() {
- super("java.class");
- }
-
- @Override
- protected String toBundleName(String baseName, Locale locale) {
- StringBuilder sb = new StringBuilder(baseName);
- String lang = locale.getLanguage();
- if (!lang.isEmpty()) {
- sb.append('_').append(lang);
- String country = locale.getCountry();
- if (!country.isEmpty()) {
- sb.append('_').append(country);
- }
- }
- return sb.toString();
- }
-
- @Override
- public ResourceBundle getBundle(String baseName, Locale locale) {
- ResourceBundle rb = super.getBundle(baseName, locale);
- String tag = locale.toLanguageTag();
- if (tag.equals("und")) {
- tag = "ROOT"; // to a human friendly name
- }
- System.out.printf(" MyResourcesProvider.getBundle(%s, %s)%n -> %s%n",
- baseName, tag, rb);
- return rb;
- }
-}
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/util/ResourceBundle/modules/visibility/src/named.bundles/jdk/test/resources/classes/spi/MyResourcesProvider.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/util/ResourceBundle/modules/visibility/src/named.bundles/jdk/test/resources/classes/spi/MyResourcesProvider.java Wed Jul 05 23:40:06 2017 +0200
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
+ * 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.
+ */
+
+package jdk.test.resources.classes.spi;
+
+import java.util.Locale;
+import java.util.ResourceBundle;
+import java.util.spi.AbstractResourceBundleProvider;
+
+public class MyResourcesProvider extends AbstractResourceBundleProvider {
+ public MyResourcesProvider() {
+ super("java.class");
+ }
+
+ @Override
+ protected String toBundleName(String baseName, Locale locale) {
+ StringBuilder sb = new StringBuilder(baseName);
+ String lang = locale.getLanguage();
+ if (!lang.isEmpty()) {
+ sb.append('_').append(lang);
+ String country = locale.getCountry();
+ if (!country.isEmpty()) {
+ sb.append('_').append(country);
+ }
+ }
+ return sb.toString();
+ }
+
+ @Override
+ public ResourceBundle getBundle(String baseName, Locale locale) {
+ ResourceBundle rb = super.getBundle(baseName, locale);
+ String tag = locale.toLanguageTag();
+ if (tag.equals("und")) {
+ tag = "ROOT"; // to a human friendly name
+ }
+ System.out.printf(" MyResourcesProvider.getBundle(%s, %s)%n -> %s%n",
+ baseName, tag, rb);
+ return rb;
+ }
+}
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/util/ResourceBundle/modules/visibility/src/named.bundles/jdk/test/resources/props/MyResourcesProvider.java
--- a/jdk/test/java/util/ResourceBundle/modules/visibility/src/named.bundles/jdk/test/resources/props/MyResourcesProvider.java Thu Jun 15 13:44:42 2017 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +0,0 @@
-/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package jdk.test.resources.props;
-
-import java.util.Locale;
-import java.util.ResourceBundle;
-import java.util.spi.AbstractResourceBundleProvider;
-
-public class MyResourcesProvider extends AbstractResourceBundleProvider {
- public MyResourcesProvider() {
- super("java.properties");
- }
-
- @Override
- protected String toBundleName(String baseName, Locale locale) {
- StringBuilder sb = new StringBuilder(baseName);
- String lang = locale.getLanguage();
- if (!lang.isEmpty()) {
- sb.append('_').append(lang);
- String country = locale.getCountry();
- if (!country.isEmpty()) {
- sb.append('_').append(country);
- }
- }
- return sb.toString();
- }
-
- @Override
- public ResourceBundle getBundle(String baseName, Locale locale) {
- ResourceBundle rb = super.getBundle(baseName, locale);
- String tag = locale.toLanguageTag();
- if (tag.equals("und")) {
- tag = "ROOT"; // to a human friendly name
- }
- System.out.printf(" MyResourcesProvider.getBundle(%s, %s)%n -> %s%n",
- baseName, tag, rb);
- return rb;
- }
-}
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/util/ResourceBundle/modules/visibility/src/named.bundles/jdk/test/resources/props/spi/MyResourcesProvider.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/util/ResourceBundle/modules/visibility/src/named.bundles/jdk/test/resources/props/spi/MyResourcesProvider.java Wed Jul 05 23:40:06 2017 +0200
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
+ * 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.
+ */
+
+package jdk.test.resources.props.spi;
+
+import java.util.Locale;
+import java.util.ResourceBundle;
+import java.util.spi.AbstractResourceBundleProvider;
+
+public class MyResourcesProvider extends AbstractResourceBundleProvider {
+ public MyResourcesProvider() {
+ super("java.properties");
+ }
+
+ @Override
+ protected String toBundleName(String baseName, Locale locale) {
+ StringBuilder sb = new StringBuilder(baseName);
+ String lang = locale.getLanguage();
+ if (!lang.isEmpty()) {
+ sb.append('_').append(lang);
+ String country = locale.getCountry();
+ if (!country.isEmpty()) {
+ sb.append('_').append(country);
+ }
+ }
+ return sb.toString();
+ }
+
+ @Override
+ public ResourceBundle getBundle(String baseName, Locale locale) {
+ ResourceBundle rb = super.getBundle(baseName, locale);
+ String tag = locale.toLanguageTag();
+ if (tag.equals("und")) {
+ tag = "ROOT"; // to a human friendly name
+ }
+ System.out.printf(" MyResourcesProvider.getBundle(%s, %s)%n -> %s%n",
+ baseName, tag, rb);
+ return rb;
+ }
+}
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/util/ResourceBundle/modules/visibility/src/named.bundles/module-info.java
--- a/jdk/test/java/util/ResourceBundle/modules/visibility/src/named.bundles/module-info.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/util/ResourceBundle/modules/visibility/src/named.bundles/module-info.java Wed Jul 05 23:40:06 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,10 +22,10 @@
*/
module named.bundles {
- exports jdk.test.resources.classes to test; // exports only to test
- exports jdk.test.resources.props to test; // exports only to test
- provides jdk.test.resources.classes.MyResourcesProvider
- with jdk.test.resources.classes.MyResourcesProvider;
- provides jdk.test.resources.props.MyResourcesProvider
- with jdk.test.resources.props.MyResourcesProvider;
+ exports jdk.test.resources.classes.spi to test; // exports only to test
+ exports jdk.test.resources.props.spi to test; // exports only to test
+ provides jdk.test.resources.classes.spi.MyResourcesProvider
+ with jdk.test.resources.classes.spi.MyResourcesProvider;
+ provides jdk.test.resources.props.spi.MyResourcesProvider
+ with jdk.test.resources.props.spi.MyResourcesProvider;
}
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/util/ResourceBundle/modules/visibility/src/test/module-info.java
--- a/jdk/test/java/util/ResourceBundle/modules/visibility/src/test/module-info.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/util/ResourceBundle/modules/visibility/src/test/module-info.java Wed Jul 05 23:40:06 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,8 @@
*/
module test {
- // jdk.test.resources.classes.MyResourcesProvider is in named.bundles.
+ // jdk.test.resources.classes.spi.MyResourcesProvider is in named.bundles.
requires named.bundles;
- uses jdk.test.resources.classes.MyResourcesProvider;
- uses jdk.test.resources.props.MyResourcesProvider;
+ uses jdk.test.resources.classes.spi.MyResourcesProvider;
+ uses jdk.test.resources.props.spi.MyResourcesProvider;
}
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/util/ResourceBundle/modules/xmlformat/src/bundles/jdk/test/resources/MyResourcesProvider.java
--- a/jdk/test/java/util/ResourceBundle/modules/xmlformat/src/bundles/jdk/test/resources/MyResourcesProvider.java Thu Jun 15 13:44:42 2017 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,81 +0,0 @@
-/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package jdk.test.resources;
-
-import java.io.BufferedInputStream;
-import java.io.InputStream;
-import java.io.IOException;
-import java.util.Enumeration;
-import java.util.Locale;
-import java.util.Properties;
-import java.util.ResourceBundle;
-import java.util.spi.ResourceBundleProvider;
-
-public class MyResourcesProvider implements ResourceBundleProvider {
- @Override
- public ResourceBundle getBundle(String baseName, Locale locale) {
- String xmlName = toXMLName(baseName, locale);
- try (InputStream is = this.getClass().getModule().getResourceAsStream(xmlName)) {
- return new XMLResourceBundle(new BufferedInputStream(is));
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
- }
-
- private String toXMLName(String baseName, Locale locale) {
- StringBuilder sb = new StringBuilder(baseName.replace('.', '/'));
- String lang = locale.getLanguage();
- if (!lang.isEmpty()) {
- sb.append('_').append(lang);
- String country = locale.getCountry();
- if (!country.isEmpty()) {
- sb.append('_').append(country);
- }
- }
- return sb.append(".xml").toString();
- }
-
- private static class XMLResourceBundle extends ResourceBundle {
- private Properties props;
-
- XMLResourceBundle(InputStream stream) throws IOException {
- props = new Properties();
- props.loadFromXML(stream);
- }
-
- @Override
- protected Object handleGetObject(String key) {
- if (key == null) {
- throw new NullPointerException();
- }
- return props.get(key);
- }
-
- @Override
- public Enumeration getKeys() {
- // Not implemented
- return null;
- }
- }
-}
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/util/ResourceBundle/modules/xmlformat/src/bundles/jdk/test/resources/spi/MyResourcesProvider.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/util/ResourceBundle/modules/xmlformat/src/bundles/jdk/test/resources/spi/MyResourcesProvider.java Wed Jul 05 23:40:06 2017 +0200
@@ -0,0 +1,81 @@
+/*
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
+ * 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.
+ */
+
+package jdk.test.resources.spi;
+
+import java.io.BufferedInputStream;
+import java.io.InputStream;
+import java.io.IOException;
+import java.util.Enumeration;
+import java.util.Locale;
+import java.util.Properties;
+import java.util.ResourceBundle;
+import java.util.spi.ResourceBundleProvider;
+
+public class MyResourcesProvider implements ResourceBundleProvider {
+ @Override
+ public ResourceBundle getBundle(String baseName, Locale locale) {
+ String xmlName = toXMLName(baseName, locale);
+ try (InputStream is = this.getClass().getModule().getResourceAsStream(xmlName)) {
+ return new XMLResourceBundle(new BufferedInputStream(is));
+ } catch (IOException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ private String toXMLName(String baseName, Locale locale) {
+ StringBuilder sb = new StringBuilder(baseName.replace('.', '/'));
+ String lang = locale.getLanguage();
+ if (!lang.isEmpty()) {
+ sb.append('_').append(lang);
+ String country = locale.getCountry();
+ if (!country.isEmpty()) {
+ sb.append('_').append(country);
+ }
+ }
+ return sb.append(".xml").toString();
+ }
+
+ private static class XMLResourceBundle extends ResourceBundle {
+ private Properties props;
+
+ XMLResourceBundle(InputStream stream) throws IOException {
+ props = new Properties();
+ props.loadFromXML(stream);
+ }
+
+ @Override
+ protected Object handleGetObject(String key) {
+ if (key == null) {
+ throw new NullPointerException();
+ }
+ return props.get(key);
+ }
+
+ @Override
+ public Enumeration getKeys() {
+ // Not implemented
+ return null;
+ }
+ }
+}
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/util/ResourceBundle/modules/xmlformat/src/bundles/module-info.java
--- a/jdk/test/java/util/ResourceBundle/modules/xmlformat/src/bundles/module-info.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/util/ResourceBundle/modules/xmlformat/src/bundles/module-info.java Wed Jul 05 23:40:06 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,6 @@
*/
module bundles {
- exports jdk.test.resources to test;
- provides jdk.test.resources.MyResourcesProvider with jdk.test.resources.MyResourcesProvider;
+ exports jdk.test.resources.spi to test;
+ provides jdk.test.resources.spi.MyResourcesProvider with jdk.test.resources.spi.MyResourcesProvider;
}
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/util/ResourceBundle/modules/xmlformat/src/test/module-info.java
--- a/jdk/test/java/util/ResourceBundle/modules/xmlformat/src/test/module-info.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/util/ResourceBundle/modules/xmlformat/src/test/module-info.java Wed Jul 05 23:40:06 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
* 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,5 +24,5 @@
module test {
requires bundles;
- uses jdk.test.resources.MyResourcesProvider;
+ uses jdk.test.resources.spi.MyResourcesProvider;
}
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/util/WeakHashMap/GCDuringIteration.java
--- a/jdk/test/java/util/WeakHashMap/GCDuringIteration.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/util/WeakHashMap/GCDuringIteration.java Wed Jul 05 23:40:06 2017 +0200
@@ -25,6 +25,7 @@
* @test
* @bug 6499848
* @library /test/lib
+ * @build jdk.test.lib.RandomFactory
* @run main GCDuringIteration
* @summary Check that iterators work properly in the presence of
* concurrent finalization and removal of elements.
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/util/concurrent/ThreadPoolExecutor/ConfigChanges.java
--- a/jdk/test/java/util/concurrent/ThreadPoolExecutor/ConfigChanges.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/util/concurrent/ThreadPoolExecutor/ConfigChanges.java Wed Jul 05 23:40:06 2017 +0200
@@ -26,6 +26,7 @@
* @bug 6450200
* @summary Test proper handling of pool state changes
* @library /test/lib
+ * @build jdk.test.lib.RandomFactory
* @run main/othervm ConfigChanges
* @key randomness
* @author Martin Buchholz
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/util/jar/JarFile/mrjar/MultiReleaseJarAPI.java
--- a/jdk/test/java/util/jar/JarFile/mrjar/MultiReleaseJarAPI.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/util/jar/JarFile/mrjar/MultiReleaseJarAPI.java Wed Jul 05 23:40:06 2017 +0200
@@ -27,7 +27,8 @@
* @summary Test the extended API and the aliasing additions in JarFile that
* support multi-release jar files
* @library /lib/testlibrary/java/util/jar /test/lib
- * @build Compiler JarBuilder CreateMultiReleaseTestJars
+ * @build jdk.test.lib.RandomFactory
+ * Compiler JarBuilder CreateMultiReleaseTestJars
* @run testng MultiReleaseJarAPI
*/
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/util/logging/FileHandlerMaxLocksTest.java
--- a/jdk/test/java/util/logging/FileHandlerMaxLocksTest.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/util/logging/FileHandlerMaxLocksTest.java Wed Jul 05 23:40:06 2017 +0200
@@ -29,6 +29,8 @@
* "logging.properties" file with default value of 100. This property can be
* overriden by specifying this property in the custom config file.
* @library /test/lib
+ * @build jdk.test.lib.Platform
+ * jdk.test.lib.util.FileUtils
* @author rpatil
* @run main/othervm FileHandlerMaxLocksTest
*/
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/util/regex/RegExTest.java
--- a/jdk/test/java/util/regex/RegExTest.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/util/regex/RegExTest.java Wed Jul 05 23:40:06 2017 +0200
@@ -38,6 +38,7 @@
* 8176029
*
* @library /test/lib
+ * @build jdk.test.lib.RandomFactory
* @run main RegExTest
* @key randomness
*/
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/util/zip/InflaterInputStream/TestAvailable.java
--- a/jdk/test/java/util/zip/InflaterInputStream/TestAvailable.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/util/zip/InflaterInputStream/TestAvailable.java Wed Jul 05 23:40:06 2017 +0200
@@ -23,6 +23,7 @@
/* @test
* @library /test/lib
+ * @build jdk.test.lib.RandomFactory
* @run main TestAvailable
* @bug 7031075 8161426
* @summary Make sure that available() method behaves as expected.
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/util/zip/ZipFile/MultiThreadedReadTest.java
--- a/jdk/test/java/util/zip/ZipFile/MultiThreadedReadTest.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/util/zip/ZipFile/MultiThreadedReadTest.java Wed Jul 05 23:40:06 2017 +0200
@@ -25,6 +25,8 @@
* @bug 8038491
* @summary Crash in ZipFile.read() when ZipFileInputStream is shared between threads
* @library /test/lib
+ * @build jdk.test.lib.Platform
+ * jdk.test.lib.util.FileUtils
* @run main MultiThreadedReadTest
* @key randomness
*/
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/util/zip/ZipFile/ReadLongZipFileName.java
--- a/jdk/test/java/util/zip/ZipFile/ReadLongZipFileName.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/util/zip/ZipFile/ReadLongZipFileName.java Wed Jul 05 23:40:06 2017 +0200
@@ -25,6 +25,9 @@
* @test
* @bug 6374379
* @library /test/lib
+ * @build jdk.test.lib.Platform
+ * jdk.test.lib.util.FileUtils
+ * @run main ReadLongZipFileName
* @summary Verify that we can read zip file names > 255 chars long
*/
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/java/util/zip/ZipFile/ZipEntryFreeTest.java
--- a/jdk/test/java/util/zip/ZipFile/ZipEntryFreeTest.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/java/util/zip/ZipFile/ZipEntryFreeTest.java Wed Jul 05 23:40:06 2017 +0200
@@ -25,6 +25,8 @@
* @bug 6907252
* @summary ZipFileInputStream Not Thread-Safe
* @library /test/lib
+ * @build jdk.test.lib.Platform
+ * jdk.test.lib.util.FileUtils
* @run main ZipEntryFreeTest
*/
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/javax/imageio/plugins/tiff/MultiPageTest/MultiPageTest.java
--- a/jdk/test/javax/imageio/plugins/tiff/MultiPageTest/MultiPageTest.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/javax/imageio/plugins/tiff/MultiPageTest/MultiPageTest.java Wed Jul 05 23:40:06 2017 +0200
@@ -32,6 +32,7 @@
* (number of pages, sizes, colors). Use -Dseed=X to set
* the random generator seed.
*
+ * @build jdk.test.lib.RandomFactory
* @run main MultiPageTest
* @key randomness
*/
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/javax/net/ssl/DTLS/DTLSIncorrectAppDataTest.java
--- a/jdk/test/javax/net/ssl/DTLS/DTLSIncorrectAppDataTest.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/javax/net/ssl/DTLS/DTLSIncorrectAppDataTest.java Wed Jul 05 23:40:06 2017 +0200
@@ -35,6 +35,7 @@
* java.security.jgss/sun.security.krb5.internal.crypto
* java.security.jgss/sun.security.krb5.internal.ktab
* java.base/sun.security.util
+ * @build jdk.test.lib.RandomFactory
* @run main/othervm -Dtest.security.protocol=DTLS
* -Dtest.mode=norm DTLSIncorrectAppDataTest
* @run main/othervm -Dtest.security.protocol=DTLS
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/javax/net/ssl/DTLS/DTLSRehandshakeWithCipherChangeTest.java
--- a/jdk/test/javax/net/ssl/DTLS/DTLSRehandshakeWithCipherChangeTest.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/javax/net/ssl/DTLS/DTLSRehandshakeWithCipherChangeTest.java Wed Jul 05 23:40:06 2017 +0200
@@ -35,6 +35,7 @@
* java.security.jgss/sun.security.krb5.internal.crypto
* java.security.jgss/sun.security.krb5.internal.ktab
* java.base/sun.security.util
+ * @build jdk.test.lib.RandomFactory
* @run main/othervm -Dtest.security.protocol=DTLS
* DTLSRehandshakeWithCipherChangeTest
*/
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/javax/net/ssl/DTLS/DTLSSequenceNumberTest.java
--- a/jdk/test/javax/net/ssl/DTLS/DTLSSequenceNumberTest.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/javax/net/ssl/DTLS/DTLSSequenceNumberTest.java Wed Jul 05 23:40:06 2017 +0200
@@ -36,6 +36,7 @@
* java.security.jgss/sun.security.krb5.internal.crypto
* java.security.jgss/sun.security.krb5.internal.ktab
* java.base/sun.security.util
+ * @build jdk.test.lib.RandomFactory
* @run main/othervm -Dtest.security.protocol=DTLS
* -Dtest.mode=norm DTLSSequenceNumberTest
* @run main/othervm -Dtest.security.protocol=DTLS
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/javax/net/ssl/DTLSv10/DTLSv10RehandshakeWithCipherChangeTest.java
--- a/jdk/test/javax/net/ssl/DTLSv10/DTLSv10RehandshakeWithCipherChangeTest.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/javax/net/ssl/DTLSv10/DTLSv10RehandshakeWithCipherChangeTest.java Wed Jul 05 23:40:06 2017 +0200
@@ -35,6 +35,7 @@
* java.security.jgss/sun.security.krb5.internal.crypto
* java.security.jgss/sun.security.krb5.internal.ktab
* java.base/sun.security.util
+ * @build jdk.test.lib.RandomFactory
* @run main/othervm -Dtest.security.protocol=DTLSv1.0
* DTLSv10RehandshakeWithCipherChangeTest
*/
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/javax/net/ssl/TLS/TLSRehandshakeWithCipherChangeTest.java
--- a/jdk/test/javax/net/ssl/TLS/TLSRehandshakeWithCipherChangeTest.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/javax/net/ssl/TLS/TLSRehandshakeWithCipherChangeTest.java Wed Jul 05 23:40:06 2017 +0200
@@ -35,6 +35,7 @@
* java.security.jgss/sun.security.krb5.internal.crypto
* java.security.jgss/sun.security.krb5.internal.ktab
* java.base/sun.security.util
+ * @build jdk.test.lib.RandomFactory
* @run main/othervm -Dtest.security.protocol=TLS TLSRehandshakeWithCipherChangeTest
*/
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/javax/net/ssl/TLSv1/TLSRehandshakeWithCipherChangeTest.java
--- a/jdk/test/javax/net/ssl/TLSv1/TLSRehandshakeWithCipherChangeTest.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/javax/net/ssl/TLSv1/TLSRehandshakeWithCipherChangeTest.java Wed Jul 05 23:40:06 2017 +0200
@@ -35,6 +35,7 @@
* java.security.jgss/sun.security.krb5.internal.crypto
* java.security.jgss/sun.security.krb5.internal.ktab
* java.base/sun.security.util
+ * @build jdk.test.lib.RandomFactory
* @run main/othervm -Dtest.security.protocol=TLSv1 TLSRehandshakeWithCipherChangeTest
*/
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/javax/net/ssl/TLSv11/TLSRehandshakeWithCipherChangeTest.java
--- a/jdk/test/javax/net/ssl/TLSv11/TLSRehandshakeWithCipherChangeTest.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/javax/net/ssl/TLSv11/TLSRehandshakeWithCipherChangeTest.java Wed Jul 05 23:40:06 2017 +0200
@@ -35,6 +35,7 @@
* java.security.jgss/sun.security.krb5.internal.crypto
* java.security.jgss/sun.security.krb5.internal.ktab
* java.base/sun.security.util
+ * @build jdk.test.lib.RandomFactory
* @run main/othervm -Dtest.security.protocol=TLSv1.1 TLSRehandshakeWithCipherChangeTest
*/
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/jdk/internal/ref/Cleaner/ExitOnThrow.java
--- a/jdk/test/jdk/internal/ref/Cleaner/ExitOnThrow.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/jdk/internal/ref/Cleaner/ExitOnThrow.java Wed Jul 05 23:40:06 2017 +0200
@@ -27,8 +27,12 @@
* @library /test/lib
* @modules java.base/jdk.internal.ref
* java.base/jdk.internal.misc
- * @build jdk.test.lib.*
- * @build jdk.test.lib.process.*
+ * @build jdk.test.lib.Utils
+ * jdk.test.lib.Asserts
+ * jdk.test.lib.JDKToolFinder
+ * jdk.test.lib.JDKToolLauncher
+ * jdk.test.lib.Platform
+ * jdk.test.lib.process.*
* @run main ExitOnThrow
* @summary Ensure that if a cleaner throws an exception then the VM exits
*/
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/jdk/internal/util/jar/TestVersionedStream.java
--- a/jdk/test/jdk/internal/util/jar/TestVersionedStream.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/jdk/internal/util/jar/TestVersionedStream.java Wed Jul 05 23:40:06 2017 +0200
@@ -27,6 +27,8 @@
* @summary basic tests for multi-release jar versioned streams
* @library /test/lib
* @modules jdk.jartool/sun.tools.jar java.base/jdk.internal.util.jar
+ * @build jdk.test.lib.Platform
+ * jdk.test.lib.util.FileUtils
* @run testng TestVersionedStream
*/
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/jdk/modules/incubator/ImageModules.java
--- a/jdk/test/jdk/modules/incubator/ImageModules.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/jdk/modules/incubator/ImageModules.java Wed Jul 05 23:40:06 2017 +0200
@@ -28,7 +28,9 @@
* @library /lib/testlibrary /test/lib
* @key intermittent
* @modules jdk.compiler jdk.jartool jdk.jlink
- * @build jdk.test.lib.compiler.CompilerUtils
+ * @build jdk.test.lib.Platform
+ * jdk.test.lib.util.FileUtils
+ * jdk.test.lib.compiler.CompilerUtils
* @run testng/othervm ImageModules
*/
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/jdk/security/jarsigner/Spec.java
--- a/jdk/test/jdk/security/jarsigner/Spec.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/jdk/security/jarsigner/Spec.java Wed Jul 05 23:40:06 2017 +0200
@@ -30,6 +30,8 @@
* java.base/sun.security.provider.certpath
* jdk.jartool
* jdk.crypto.ec
+ * @build jdk.test.lib.util.JarUtils
+ * @run main Spec
*/
import com.sun.jarsigner.ContentSigner;
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/lib/testlibrary/jdk/testlibrary/TimeLimitedRunner.java
--- a/jdk/test/lib/testlibrary/jdk/testlibrary/TimeLimitedRunner.java Thu Jun 15 13:44:42 2017 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,86 +0,0 @@
-/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package jdk.testlibrary;
-
-import java.util.Objects;
-import java.util.concurrent.Callable;
-
-/**
- * Auxiliary class to run target w/ given timeout.
- */
-public class TimeLimitedRunner implements Callable {
- private final long stoptime;
- private final long timeout;
- private final double factor;
- private final Callable target;
-
- /**
- * @param timeout a timeout. zero means no time limitation
- * @param factor a multiplier used to estimate next iteration time
- * @param target a target to run
- * @throws NullPointerException if target is null
- * @throws IllegalArgumentException if timeout is negative or
- factor isn't positive
- */
- public TimeLimitedRunner(long timeout, double factor,
- Callable target) {
- Objects.requireNonNull(target, "target must not be null");
- if (timeout < 0) {
- throw new IllegalArgumentException("timeout[" + timeout + "] < 0");
- }
- if (factor <= 0d) {
- throw new IllegalArgumentException("factor[" + factor + "] <= 0");
- }
- this.stoptime = System.currentTimeMillis() + timeout;
- this.timeout = timeout;
- this.factor = factor;
- this.target = target;
- }
-
- /**
- * Runs @{linkplan target} while it returns true and timeout isn't exceeded
- */
- @Override
- public Void call() throws Exception {
- long maxDuration = 0L;
- long iterStart = System.currentTimeMillis();
- if (timeout != 0 && iterStart > stoptime) {
- return null;
- }
- while (target.call()) {
- if (timeout != 0) {
- long iterDuration = System.currentTimeMillis() - iterStart;
- maxDuration = Math.max(maxDuration, iterDuration);
- iterStart = System.currentTimeMillis();
- if (iterStart + (maxDuration * factor) > stoptime) {
- System.out.println("Not enough time to continue execution. "
- + "Interrupted.");
- break;
- }
- }
- }
- return null;
- }
-
-}
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/sun/misc/SunMiscSignalTest.java
--- a/jdk/test/sun/misc/SunMiscSignalTest.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/sun/misc/SunMiscSignalTest.java Wed Jul 05 23:40:06 2017 +0200
@@ -46,7 +46,12 @@
* @library /test/lib
* @modules jdk.unsupported
* java.base/jdk.internal.misc
- * @build jdk.test.lib.Platform jdk.test.lib.Utils
+ * @build jdk.test.lib.Utils
+ * jdk.test.lib.Asserts
+ * jdk.test.lib.JDKToolFinder
+ * jdk.test.lib.JDKToolLauncher
+ * jdk.test.lib.Platform
+ * jdk.test.lib.process.*
* @run testng/othervm -Xrs -DXrs=true SunMiscSignalTest
* @run testng/othervm SunMiscSignalTest
* @summary sun.misc.Signal test
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/sun/net/InetAddress/nameservice/dns/CNameTest.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/sun/net/InetAddress/nameservice/dns/CNameTest.java Wed Jul 05 23:40:06 2017 +0200
@@ -0,0 +1,73 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import jdk.test.lib.process.ProcessTools;
+
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.nio.file.StandardOpenOption;
+
+/**
+ * @test
+ * @bug 4763315
+ * @modules java.naming
+ * @library /test/lib
+ * @build CanonicalName Lookup jdk.test.lib.process.*
+ * @run main/othervm/timeout=120 CNameTest
+ * @summary Test DNS provider's handling of CNAME records
+ */
+public class CNameTest {
+ private static final String HOST = "www-proxy.us.oracle.com";
+ private static final String POLICY = "grant {" + System.lineSeparator() +
+ " permission java.net .SocketPermission \"${HOST}\", \"resolve\";" +
+ System.lineSeparator() + "};";
+
+ public static void main(String[] args) throws Exception {
+ // Prerequisite check
+ int rc = ProcessTools.executeTestJava("CanonicalName", HOST)
+ .outputTo(System.out)
+ .errorTo(System.out)
+ .getExitValue();
+ if (rc != 0) {
+ System.out.println("DNS not configured or host doesn't" +
+ " resolve to CNAME record");
+ return;
+ }
+
+ // Tests - with & without security manager
+ Path policy = Paths.get(".", "java.policy");
+ Files.write(policy, POLICY.getBytes(), StandardOpenOption.CREATE_NEW);
+ String[] opts = new String[]{
+ "-Dsun.net.spi.nameservice.provider.1=dns,sun",
+ "-Djava.security.manager -Djava.security.policy=" + policy
+ };
+ for (String opt : opts) {
+ ProcessTools.executeTestJava(opt, "Lookup", HOST)
+ .outputTo(System.out)
+ .errorTo(System.err)
+ .shouldHaveExitValue(0);
+ }
+ }
+}
+
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/sun/net/InetAddress/nameservice/dns/cname.sh
--- a/jdk/test/sun/net/InetAddress/nameservice/dns/cname.sh Thu Jun 15 13:44:42 2017 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,81 +0,0 @@
-#!/bin/sh
-
-#
-# Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
-# 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 4763315
-# @modules java.naming
-# @build CanonicalName Lookup
-# @run shell/timeout=120 cname.sh
-# @summary Test DNS provider's handling of CNAME records
-
-
-# The host that we try to resolve
-
-HOST=www-proxy.us.oracle.com
-
-# fail gracefully if DNS is not configured or there
-# isn't a CNAME record.
-
-CLASSPATH=${TESTCLASSES}
-export CLASSPATH
-JAVA="${TESTJAVA}/bin/java"
-
-sh -xc "$JAVA ${TESTVMOPTS} CanonicalName $HOST" 2>&1
-if [ $? != 0 ]; then
- echo "DNS not configured or host doesn't resolve to CNAME record"
- exit 0
-fi
-
-failures=0
-
-go() {
- echo ''
- sh -xc "$JAVA ${TESTVMOPTS} $1 Lookup $2" 2>&1
- if [ $? != 0 ]; then failures=`expr $failures + 1`; fi
-}
-
-# Tests - with & without security manager
-
-POLICY=java.policy
-echo "grant {" > ${POLICY}
-echo " permission java.net.SocketPermission \"${HOST}\", \"resolve\";" >> ${POLICY}
-echo "};" >> ${POLICY}
-
-np="-Dsun.net.spi.nameservice.provider.1=dns,sun"
-sm="-Djava.security.manager -Djava.security.policy=${POLICY}"
-
-go "" "$HOST"
-go "$sm" "$HOST"
-
-
-#
-# Results
-#
-echo ''
-if [ $failures -gt 0 ];
- then echo "$failures test(s) failed";
- else echo "All test(s) passed"; fi
-exit $failures
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/sun/net/ftp/MarkResetTest.java
--- a/jdk/test/sun/net/ftp/MarkResetTest.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/sun/net/ftp/MarkResetTest.java Wed Jul 05 23:40:06 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,15 +22,30 @@
*/
/*
- *
- * run from MarkResetTest.sh
+ * @test
+ * @bug 4673103
+ * @run main/othervm/timeout=140 MarkResetTest
+ * @summary URLConnection.getContent() hangs over FTP for DOC, PPT, XLS files
*/
-import java.io.*;
-import java.net.*;
-import java.util.regex.*;
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.OutputStream;
+import java.io.PrintWriter;
+import java.net.InetAddress;
+import java.net.ServerSocket;
+import java.net.Socket;
+import java.net.URL;
+import java.net.URLConnection;
+import java.nio.file.Files;
+import java.nio.file.Paths;
public class MarkResetTest {
+ private static final String FILE_NAME = "EncDec.doc";
/**
* A class that simulates, on a separate, an FTP server.
@@ -388,7 +403,9 @@
}
public static void main(String[] args) throws Exception {
- MarkResetTest test = new MarkResetTest();
+ Files.copy(Paths.get(System.getProperty("test.src"), FILE_NAME),
+ Paths.get(".", FILE_NAME));
+ new MarkResetTest();
}
public MarkResetTest() {
@@ -402,9 +419,8 @@
port = server.getPort();
}
- String filename = "EncDec.doc";
- URL url = new URL("ftp://localhost:" + port + "/" +
- filename);
+
+ URL url = new URL("ftp://localhost:" + port + "/" + FILE_NAME);
URLConnection con = url.openConnection();
System.out.println("getContent: " + con.getContent());
@@ -438,7 +454,7 @@
server.interrupt();
// Did we pass ?
- if (len != (new File(filename)).length()) {
+ if (len != (new File(FILE_NAME)).length()) {
throw new Exception("Failed to read the file correctly");
}
System.out.println("PASSED: File read correctly");
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/sun/net/ftp/MarkResetTest.sh
--- a/jdk/test/sun/net/ftp/MarkResetTest.sh Thu Jun 15 13:44:42 2017 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +0,0 @@
-#
-# Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#
-
-# @test
-# @bug 4673103
-# @run shell/timeout=140 MarkResetTest.sh
-# @summary URLConnection.getContent() hangs over FTP for DOC, PPT, XLS files
-
-OS=`uname -s`
-case "$OS" in
- SunOS | Linux | Darwin | AIX )
- PS=":"
- FS="/"
- ;;
- CYGWIN* )
- PS=";"
- FS="/"
- ;;
- Windows* )
- PS=";"
- FS="\\"
- ;;
- * )
- echo "Unrecognized system!"
- exit 1;
- ;;
-esac
-
-${COMPILEJAVA}${FS}bin${FS}javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d . ${TESTSRC}${FS}MarkResetTest.java
-
-# ftp server used by the test requires the file to be present
-# in this directory
-cp ${TESTSRC}${FS}EncDec.doc .
-
-${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} MarkResetTest
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/sun/net/www/protocol/file/DirPermissionDenied.java
--- a/jdk/test/sun/net/www/protocol/file/DirPermissionDenied.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/sun/net/www/protocol/file/DirPermissionDenied.java Wed Jul 05 23:40:06 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -21,14 +21,36 @@
* questions.
*/
+/**
+ * @test
+ * @bug 6977851
+ * @summary NPE from FileURLConnection.connect
+ * @library /test/lib
+ * @build DirPermissionDenied jdk.test.lib.process.*
+ * jdk.test.lib.util.FileUtils
+ * @run testng DirPermissionDenied
+ */
+
+import java.io.IOException;
+import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;
-import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import jdk.test.lib.process.ProcessTools;
+import jdk.test.lib.util.FileUtils;
+import org.testng.annotations.AfterTest;
+import org.testng.annotations.Test;
+import org.testng.annotations.BeforeTest;
public class DirPermissionDenied {
- public static void main(String[] args) throws Exception {
- URL url = new URL("file:" + args[0]);
+ private static final Path TEST_DIR = Paths.get(
+ "DirPermissionDeniedDirectory");
+ @Test
+ public void doTest() throws MalformedURLException {
+ URL url = new URL(TEST_DIR.toUri().toString());
try {
URLConnection uc = url.openConnection();
uc.connect();
@@ -56,4 +78,20 @@
throw new RuntimeException("Failed " + e);
}
}
+
+ @BeforeTest
+ public void setup() throws Throwable {
+ // mkdir and chmod "333"
+ Files.createDirectories(TEST_DIR);
+ ProcessTools.executeCommand("chmod", "333", TEST_DIR.toString())
+ .outputTo(System.out)
+ .errorTo(System.out)
+ .shouldHaveExitValue(0);
+ }
+
+ @AfterTest
+ public void tearDown() throws IOException {
+ FileUtils.deleteFileIfExistsWithRetry(TEST_DIR);
+ }
}
+
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/sun/net/www/protocol/file/DirPermissionDenied.sh
--- a/jdk/test/sun/net/www/protocol/file/DirPermissionDenied.sh Thu Jun 15 13:44:42 2017 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +0,0 @@
-#
-# Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#
-
-#
-# @test
-# @bug 6977851
-# @summary NPE from FileURLConnection.connect
-# @build DirPermissionDenied
-# @run shell DirPermissionDenied.sh
-
-TESTDIR="${TESTCLASSES}/DirPermissionDeniedDirectory"
-echo ${TESTDIR}
-
-rm -rf ${TESTDIR}
-mkdir -p ${TESTDIR}
-chmod 333 ${TESTDIR}
-
-$TESTJAVA/bin/java ${TESTVMOPTS} -classpath $TESTCLASSES DirPermissionDenied ${TESTDIR}
-result=$?
-
-# Add back read access for user, otherwise not removable on some systems
-chmod u+r ${TESTDIR}
-
-rm -rf ${TESTDIR}
-exit $result
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/sun/net/www/protocol/https/HttpsURLConnection/B6216082.java
--- a/jdk/test/sun/net/www/protocol/https/HttpsURLConnection/B6216082.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/sun/net/www/protocol/https/HttpsURLConnection/B6216082.java Wed Jul 05 23:40:06 2017 +0200
@@ -32,7 +32,9 @@
* @summary Redirect problem with HttpsURLConnection using a proxy
* @modules java.base/sun.net.www
* @library .. /test/lib
- * @build HttpCallback TestHttpsServer ClosedChannelList
+ * @build jdk.test.lib.NetworkConfiguration
+ * jdk.test.lib.Platform
+ * HttpCallback TestHttpsServer ClosedChannelList
* HttpTransaction TunnelProxy
* @key intermittent
* @run main/othervm B6216082
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/sun/net/www/protocol/https/HttpsURLConnection/PostThruProxy.java
--- a/jdk/test/sun/net/www/protocol/https/HttpsURLConnection/PostThruProxy.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/sun/net/www/protocol/https/HttpsURLConnection/PostThruProxy.java Wed Jul 05 23:40:06 2017 +0200
@@ -39,6 +39,12 @@
* that serves http POST method requests in secure channel, and a client
* that makes https POST request through a proxy.
* @library /test/lib
+ * @build jdk.test.lib.Utils
+ * jdk.test.lib.Asserts
+ * jdk.test.lib.JDKToolFinder
+ * jdk.test.lib.JDKToolLauncher
+ * jdk.test.lib.Platform
+ * jdk.test.lib.process.*
* @compile OriginServer.java ProxyTunnelServer.java
* @run main/othervm PostThruProxy
*/
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/sun/net/www/protocol/https/HttpsURLConnection/PostThruProxyWithAuth.java
--- a/jdk/test/sun/net/www/protocol/https/HttpsURLConnection/PostThruProxyWithAuth.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/sun/net/www/protocol/https/HttpsURLConnection/PostThruProxyWithAuth.java Wed Jul 05 23:40:06 2017 +0200
@@ -39,6 +39,12 @@
* http POST method requests in secure channel, and a client that
* makes https POST request through a proxy.
* @library /test/lib
+ * @build jdk.test.lib.Utils
+ * jdk.test.lib.Asserts
+ * jdk.test.lib.JDKToolFinder
+ * jdk.test.lib.JDKToolLauncher
+ * jdk.test.lib.Platform
+ * jdk.test.lib.process.*
* @compile OriginServer.java ProxyTunnelServer.java
* @run main/othervm -Djdk.http.auth.tunneling.disabledSchemes= PostThruProxyWithAuth
*/
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/sun/net/www/protocol/jar/GetContentTypeTest.java
--- a/jdk/test/sun/net/www/protocol/jar/GetContentTypeTest.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/sun/net/www/protocol/jar/GetContentTypeTest.java Wed Jul 05 23:40:06 2017 +0200
@@ -25,9 +25,13 @@
* @test
* @bug 4274624
* @library /test/lib
- * @build GetContentType GetContentTypeTest
+ * @build jdk.test.lib.Utils
+ * jdk.test.lib.Asserts
* jdk.test.lib.JDKToolFinder
+ * jdk.test.lib.JDKToolLauncher
+ * jdk.test.lib.Platform
* jdk.test.lib.process.*
+ * GetContentType GetContentTypeTest
* @run main/othervm GetContentTypeTest
* @summary Test JarURLConnection.getContentType would
* would return default "content/unknown"
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/sun/net/www/protocol/jar/jarbug/TestDriver.java
--- a/jdk/test/sun/net/www/protocol/jar/jarbug/TestDriver.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/sun/net/www/protocol/jar/jarbug/TestDriver.java Wed Jul 05 23:40:06 2017 +0200
@@ -27,10 +27,14 @@
* @library /test/lib
* /lib/testlibrary
* @modules jdk.compiler
- * @build src.test.src.TestDriver JarUtils
- * jdk.test.lib.compiler.CompilerUtils
+ * @build jdk.test.lib.compiler.CompilerUtils
+ * jdk.test.lib.Utils
+ * jdk.test.lib.Asserts
* jdk.test.lib.JDKToolFinder
+ * jdk.test.lib.JDKToolLauncher
+ * jdk.test.lib.Platform
* jdk.test.lib.process.*
+ * src.test.src.TestDriver JarUtils
* @summary various resource and classloading bugs related to jar files
* @run main/othervm TestDriver
*/
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/sun/net/www/protocol/jrt/OtherResourcesTest.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/sun/net/www/protocol/jrt/OtherResourcesTest.java Wed Jul 05 23:40:06 2017 +0200
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import jdk.test.lib.JDKToolFinder;
+import static jdk.test.lib.process.ProcessTools.executeCommand;
+
+/**
+ * @test
+ * @bug 8142968
+ * @summary Access a jrt:/ resource in an observable module that is not in
+ * the boot layer and hence not known to the built-in class loaders.
+ * This test is intended to run with --limit-modules.
+ * @library /test/lib
+ * @build OtherResources OtherResourcesTest
+ * jdk.test.lib.JDKToolFinder
+ * jdk.test.lib.process.*
+ * @run main OtherResourcesTest
+ */
+public class OtherResourcesTest {
+ public static void main(String[] args) throws Throwable {
+ String classes = System.getProperty("test.classes");
+ executeCommand(JDKToolFinder.getTestJDKTool("java"),
+ "--limit-modules", "java.base",
+ "-cp", classes, "OtherResources")
+ .outputTo(System.out)
+ .errorTo(System.out)
+ .shouldHaveExitValue(0);
+ }
+}
+
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/sun/net/www/protocol/jrt/other_resources.sh
--- a/jdk/test/sun/net/www/protocol/jrt/other_resources.sh Thu Jun 15 13:44:42 2017 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +0,0 @@
-#
-# Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#
-
-# @test
-# @build OtherResources
-# @run shell other_resources.sh
-# @summary Access a jrt:/ resource in an observable module that is not in
-# the boot layer and hence not known to the built-in class loaders. This
-# test is a shell test because the run tag doesn't support --limit-modules.
-
-set -e
-
-if [ -z "$TESTJAVA" ]; then
- if [ $# -lt 1 ]; then exit 1; fi
- TESTJAVA="$1"; shift
- COMPILEJAVA="${TESTJAVA}"
- TESTSRC="`pwd`"
- TESTCLASSES="`pwd`"
-fi
-
-JAVA="$TESTJAVA/bin/java ${TESTVMOPTS}"
-$JAVA --limit-modules java.base -cp $TESTCLASSES OtherResources
-
-exit 0
-
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/sun/nio/cs/FindDecoderBugs.java
--- a/jdk/test/sun/nio/cs/FindDecoderBugs.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/sun/nio/cs/FindDecoderBugs.java Wed Jul 05 23:40:06 2017 +0200
@@ -26,6 +26,7 @@
* @bug 6380723
* @summary Decode many byte sequences in many ways (use -Dseed=X to set PRNG seed)
* @library /test/lib
+ * @build jdk.test.lib.RandomFactory
* @run main/timeout=1800 FindDecoderBugs
* @author Martin Buchholz
* @key randomness
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/sun/nio/cs/FindEncoderBugs.java
--- a/jdk/test/sun/nio/cs/FindEncoderBugs.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/sun/nio/cs/FindEncoderBugs.java Wed Jul 05 23:40:06 2017 +0200
@@ -26,6 +26,7 @@
* @bug 6233345 6381699 6381702 6381705 6381706
* @summary Encode many char sequences in many ways
* @library /test/lib
+ * @build jdk.test.lib.RandomFactory
* @run main/timeout=1200 FindEncoderBugs
* @author Martin Buchholz
* @key randomness
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/sun/security/ec/SignatureOffsets.java
--- a/jdk/test/sun/security/ec/SignatureOffsets.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/sun/security/ec/SignatureOffsets.java Wed Jul 05 23:40:06 2017 +0200
@@ -35,6 +35,7 @@
* generation, the test tries to verify signature with the above API
* and passing in different signature offset (0, 33, 66, 99).
* @library /test/lib
+ * @build jdk.test.lib.RandomFactory
* @compile ../../../java/security/Signature/Offsets.java
* @run main SignatureOffsets SunEC NONEwithECDSA
* @run main SignatureOffsets SunEC SHA1withECDSA
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/sun/security/krb5/auto/ModuleName.java
--- a/jdk/test/sun/security/krb5/auto/ModuleName.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/sun/security/krb5/auto/ModuleName.java Wed Jul 05 23:40:06 2017 +0200
@@ -27,6 +27,12 @@
* @summary GSSContext type when jdk.security.jgss is not available
* @library /test/lib
* @compile -XDignore.symbol.file ModuleName.java
+ * @build jdk.test.lib.Utils
+ * jdk.test.lib.Asserts
+ * jdk.test.lib.JDKToolFinder
+ * jdk.test.lib.JDKToolLauncher
+ * jdk.test.lib.Platform
+ * jdk.test.lib.process.*
* @run main/othervm ModuleName
*/
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/sun/security/krb5/auto/ReplayCacheTestProc.java
--- a/jdk/test/sun/security/krb5/auto/ReplayCacheTestProc.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/sun/security/krb5/auto/ReplayCacheTestProc.java Wed Jul 05 23:40:06 2017 +0200
@@ -26,6 +26,7 @@
* @bug 7152176 8168518 8172017
* @summary More krb5 tests
* @library ../../../../java/security/testlibrary/ /test/lib
+ * @build jdk.test.lib.Platform
* @run main/othervm/timeout=300 ReplayCacheTestProc
*/
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/sun/security/krb5/auto/rcache_usemd5.sh
--- a/jdk/test/sun/security/krb5/auto/rcache_usemd5.sh Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/sun/security/krb5/auto/rcache_usemd5.sh Wed Jul 05 23:40:06 2017 +0200
@@ -24,6 +24,7 @@
# @test
# @bug 8168518
# @library ../../../../java/security/testlibrary/ /test/lib
+# @build jdk.test.lib.Platform
# @run main/othervm/timeout=300 -Djdk.krb5.rcache.useMD5=true
# -Dtest.service=host ReplayCacheTestProc
# @summary testing jdk.krb5.rcache.useMD5. This action is put in a separate
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/sun/security/mscapi/SignatureOffsets.java
--- a/jdk/test/sun/security/mscapi/SignatureOffsets.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/sun/security/mscapi/SignatureOffsets.java Wed Jul 05 23:40:06 2017 +0200
@@ -35,6 +35,7 @@
* generation, the test tries to verify signature with the above API
* and passing in different signature offset (0, 33, 66, 99).
* @library /test/lib
+ * @build jdk.test.lib.RandomFactory
* @compile ../../../java/security/Signature/Offsets.java
* @requires os.family == "windows"
* @run main SignatureOffsets SunMSCAPI NONEwithRSA
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/sun/security/pkcs11/rsa/TestKeyPairGenerator.java
--- a/jdk/test/sun/security/pkcs11/rsa/TestKeyPairGenerator.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/sun/security/pkcs11/rsa/TestKeyPairGenerator.java Wed Jul 05 23:40:06 2017 +0200
@@ -29,6 +29,7 @@
* @library ..
* @library /test/lib
* @modules jdk.crypto.cryptoki
+ * @build jdk.test.lib.RandomFactory
* @run main/othervm -Djava.security.debug=sunpkcs11 TestKeyPairGenerator
* @run main/othervm -Djava.security.debug=sunpkcs11 TestKeyPairGenerator
* sm TestKeyPairGenerator.policy
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/sun/security/rsa/SignatureOffsets.java
--- a/jdk/test/sun/security/rsa/SignatureOffsets.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/sun/security/rsa/SignatureOffsets.java Wed Jul 05 23:40:06 2017 +0200
@@ -35,6 +35,7 @@
* generation, the test tries to verify signature with the above API
* and passing in different signature offset (0, 33, 66, 99).
* @library /test/lib
+ * @build jdk.test.lib.RandomFactory
* @compile ../../../java/security/Signature/Offsets.java
* @run main SignatureOffsets SunRsaSign MD2withRSA
* @run main SignatureOffsets SunRsaSign MD5withRSA
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/sun/security/ssl/CertPathRestrictions/TLSRestrictions.java
--- a/jdk/test/sun/security/ssl/CertPathRestrictions/TLSRestrictions.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/sun/security/ssl/CertPathRestrictions/TLSRestrictions.java Wed Jul 05 23:40:06 2017 +0200
@@ -48,8 +48,15 @@
/*
* @test
+ * @bug 8165367
* @summary Verify the restrictions for certificate path on JSSE with custom trust store.
* @library /test/lib
+ * @build jdk.test.lib.Utils
+ * jdk.test.lib.Asserts
+ * jdk.test.lib.JDKToolFinder
+ * jdk.test.lib.JDKToolLauncher
+ * jdk.test.lib.Platform
+ * jdk.test.lib.process.*
* @compile JSSEClient.java
* @run main/othervm -Djava.security.debug=certpath TLSRestrictions DEFAULT
* @run main/othervm -Djava.security.debug=certpath TLSRestrictions C1
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/sun/security/ssl/rsa/SignatureOffsets.java
--- a/jdk/test/sun/security/ssl/rsa/SignatureOffsets.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/sun/security/ssl/rsa/SignatureOffsets.java Wed Jul 05 23:40:06 2017 +0200
@@ -35,6 +35,7 @@
* generation, the test tries to verify signature with the above API
* and passing in different signature offset (0, 33, 66, 99).
* @library /test/lib
+ * @build jdk.test.lib.RandomFactory
* @compile ../../../../java/security/Signature/Offsets.java
* @run main SignatureOffsets SunJSSE MD2withRSA
* @run main SignatureOffsets SunJSSE MD5withRSA
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/sun/security/tools/jarsigner/AltProvider.java
--- a/jdk/test/sun/security/tools/jarsigner/AltProvider.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/sun/security/tools/jarsigner/AltProvider.java Wed Jul 05 23:40:06 2017 +0200
@@ -27,6 +27,15 @@
* @summary -providerPath, -providerClass, -addprovider, and -providerArg
* @library /test/lib
* @modules java.base/jdk.internal.misc
+ * @build jdk.test.lib.util.JarUtils
+ * jdk.test.lib.compiler.CompilerUtils
+ * jdk.test.lib.Utils
+ * jdk.test.lib.Asserts
+ * jdk.test.lib.JDKToolFinder
+ * jdk.test.lib.JDKToolLauncher
+ * jdk.test.lib.Platform
+ * jdk.test.lib.process.*
+ * @run main AltProvider
*/
import jdk.test.lib.JDKToolLauncher;
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/sun/security/tools/jarsigner/Options.java
--- a/jdk/test/sun/security/tools/jarsigner/Options.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/sun/security/tools/jarsigner/Options.java Wed Jul 05 23:40:06 2017 +0200
@@ -31,6 +31,8 @@
* jdk.jartool/sun.security.tools.jarsigner
* java.base/sun.security.pkcs
* java.base/sun.security.x509
+ * @build jdk.test.lib.util.JarUtils
+ * @run main Options
*/
import com.sun.jarsigner.ContentSigner;
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/sun/security/tools/jarsigner/TimestampCheck.java
--- a/jdk/test/sun/security/tools/jarsigner/TimestampCheck.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/sun/security/tools/jarsigner/TimestampCheck.java Wed Jul 05 23:40:06 2017 +0200
@@ -68,6 +68,14 @@
* java.base/sun.security.tools.keytool
* @library /lib/testlibrary
* @library /test/lib
+ * @build jdk.test.lib.util.JarUtils
+ * jdk.test.lib.SecurityTools
+ * jdk.test.lib.Utils
+ * jdk.test.lib.Asserts
+ * jdk.test.lib.JDKToolFinder
+ * jdk.test.lib.JDKToolLauncher
+ * jdk.test.lib.Platform
+ * jdk.test.lib.process.*
* @run main/timeout=600 TimestampCheck
*/
public class TimestampCheck {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/sun/security/tools/jarsigner/TsacertOptionTest.java
--- a/jdk/test/sun/security/tools/jarsigner/TsacertOptionTest.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/sun/security/tools/jarsigner/TsacertOptionTest.java Wed Jul 05 23:40:06 2017 +0200
@@ -36,6 +36,7 @@
* java.base/sun.security.util
* java.base/sun.security.x509
* java.management
+ * @build jdk.test.lib.util.JarUtils
* @run main TsacertOptionTest
*/
public class TsacertOptionTest extends Test {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/sun/security/tools/jarsigner/Warning.java
--- a/jdk/test/sun/security/tools/jarsigner/Warning.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/sun/security/tools/jarsigner/Warning.java Wed Jul 05 23:40:06 2017 +0200
@@ -35,6 +35,8 @@
* @bug 8024302 8026037 8130132
* @summary warnings, errors and -strict
* @library /lib/testlibrary /test/lib
+ * @build jdk.test.lib.util.JarUtils
+ * @run main Warning
*/
public class Warning {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/sun/security/tools/jarsigner/multiRelease/MVJarSigningTest.java
--- a/jdk/test/sun/security/tools/jarsigner/multiRelease/MVJarSigningTest.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/sun/security/tools/jarsigner/multiRelease/MVJarSigningTest.java Wed Jul 05 23:40:06 2017 +0200
@@ -26,6 +26,13 @@
* @bug 8047305 8075618
* @summary Tests jarsigner tool and JarSigner API work with multi-release JAR files.
* @library /test/lib
+ * @build jdk.test.lib.compiler.CompilerUtils
+ * jdk.test.lib.Utils
+ * jdk.test.lib.Asserts
+ * jdk.test.lib.JDKToolFinder
+ * jdk.test.lib.JDKToolLauncher
+ * jdk.test.lib.Platform
+ * jdk.test.lib.process.*
* @run main MVJarSigningTest
*/
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/sun/security/tools/jarsigner/warnings/AliasNotInStoreTest.java
--- a/jdk/test/sun/security/tools/jarsigner/warnings/AliasNotInStoreTest.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/sun/security/tools/jarsigner/warnings/AliasNotInStoreTest.java Wed Jul 05 23:40:06 2017 +0200
@@ -29,6 +29,7 @@
* @bug 8024302 8026037
* @summary Test for aliasNotInStore warning
* @library /lib/testlibrary /test/lib ../
+ * @build jdk.test.lib.util.JarUtils
* @run main AliasNotInStoreTest
*/
public class AliasNotInStoreTest extends Test {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/sun/security/tools/jarsigner/warnings/BadExtendedKeyUsageTest.java
--- a/jdk/test/sun/security/tools/jarsigner/warnings/BadExtendedKeyUsageTest.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/sun/security/tools/jarsigner/warnings/BadExtendedKeyUsageTest.java Wed Jul 05 23:40:06 2017 +0200
@@ -29,6 +29,7 @@
* @bug 8024302 8026037
* @summary Test for badExtendedKeyUsage warning
* @library /lib/testlibrary /test/lib ../
+ * @build jdk.test.lib.util.JarUtils
* @run main BadExtendedKeyUsageTest
*/
public class BadExtendedKeyUsageTest extends Test {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/sun/security/tools/jarsigner/warnings/BadKeyUsageTest.java
--- a/jdk/test/sun/security/tools/jarsigner/warnings/BadKeyUsageTest.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/sun/security/tools/jarsigner/warnings/BadKeyUsageTest.java Wed Jul 05 23:40:06 2017 +0200
@@ -30,6 +30,7 @@
* @summary Test for badKeyUsage warning
* @library /lib/testlibrary /test/lib ../
* @ignore until 8026393 is fixed
+ * @build jdk.test.lib.util.JarUtils
* @run main BadKeyUsageTest
*/
public class BadKeyUsageTest extends Test {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/sun/security/tools/jarsigner/warnings/BadNetscapeCertTypeTest.java
--- a/jdk/test/sun/security/tools/jarsigner/warnings/BadNetscapeCertTypeTest.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/sun/security/tools/jarsigner/warnings/BadNetscapeCertTypeTest.java Wed Jul 05 23:40:06 2017 +0200
@@ -33,6 +33,7 @@
* @bug 8024302 8026037
* @summary Test for badNetscapeCertType warning
* @library /lib/testlibrary /test/lib ../
+ * @build jdk.test.lib.util.JarUtils
* @run main BadNetscapeCertTypeTest
*/
public class BadNetscapeCertTypeTest extends Test {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/sun/security/tools/jarsigner/warnings/ChainNotValidatedTest.java
--- a/jdk/test/sun/security/tools/jarsigner/warnings/ChainNotValidatedTest.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/sun/security/tools/jarsigner/warnings/ChainNotValidatedTest.java Wed Jul 05 23:40:06 2017 +0200
@@ -31,6 +31,7 @@
* @bug 8024302 8026037
* @summary Test for chainNotValidated warning
* @library /lib/testlibrary /test/lib ../
+ * @build jdk.test.lib.util.JarUtils
* @run main ChainNotValidatedTest
*/
public class ChainNotValidatedTest extends Test {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/sun/security/tools/jarsigner/warnings/HasExpiredCertTest.java
--- a/jdk/test/sun/security/tools/jarsigner/warnings/HasExpiredCertTest.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/sun/security/tools/jarsigner/warnings/HasExpiredCertTest.java Wed Jul 05 23:40:06 2017 +0200
@@ -29,6 +29,7 @@
* @bug 8024302 8026037
* @summary Test for hasExpiredCert warning
* @library /lib/testlibrary /test/lib ../
+ * @build jdk.test.lib.util.JarUtils
* @run main HasExpiredCertTest
*/
public class HasExpiredCertTest extends Test {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/sun/security/tools/jarsigner/warnings/HasExpiringCertTest.java
--- a/jdk/test/sun/security/tools/jarsigner/warnings/HasExpiringCertTest.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/sun/security/tools/jarsigner/warnings/HasExpiringCertTest.java Wed Jul 05 23:40:06 2017 +0200
@@ -29,6 +29,7 @@
* @bug 8024302 8026037
* @summary Test for hasExpiringCert warning
* @library /lib/testlibrary /test/lib ../
+ * @build jdk.test.lib.util.JarUtils
* @run main HasExpiringCertTest
*/
public class HasExpiringCertTest extends Test {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/sun/security/tools/jarsigner/warnings/HasUnsignedEntryTest.java
--- a/jdk/test/sun/security/tools/jarsigner/warnings/HasUnsignedEntryTest.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/sun/security/tools/jarsigner/warnings/HasUnsignedEntryTest.java Wed Jul 05 23:40:06 2017 +0200
@@ -29,6 +29,7 @@
* @bug 8024302 8026037
* @summary Test for hasUnsignedEntry warning
* @library /lib/testlibrary /test/lib ../
+ * @build jdk.test.lib.util.JarUtils
* @run main HasUnsignedEntryTest
*/
public class HasUnsignedEntryTest extends Test {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/sun/security/tools/jarsigner/warnings/MultipleWarningsTest.java
--- a/jdk/test/sun/security/tools/jarsigner/warnings/MultipleWarningsTest.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/sun/security/tools/jarsigner/warnings/MultipleWarningsTest.java Wed Jul 05 23:40:06 2017 +0200
@@ -29,6 +29,7 @@
* @bug 8024302 8026037
* @summary Checks if jarsigner prints appropriate warnings
* @library /lib/testlibrary /test/lib ../
+ * @build jdk.test.lib.util.JarUtils
* @run main MultipleWarningsTest
*/
public class MultipleWarningsTest extends Test {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/sun/security/tools/jarsigner/warnings/NoTimestampTest.java
--- a/jdk/test/sun/security/tools/jarsigner/warnings/NoTimestampTest.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/sun/security/tools/jarsigner/warnings/NoTimestampTest.java Wed Jul 05 23:40:06 2017 +0200
@@ -30,6 +30,7 @@
* @bug 8024302 8026037
* @summary Checks warnings if -tsa and -tsacert options are not specified
* @library /lib/testlibrary /test/lib ../
+ * @build jdk.test.lib.util.JarUtils
* @run main NoTimestampTest
*/
public class NoTimestampTest extends Test {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/sun/security/tools/jarsigner/warnings/NotSignedByAliasTest.java
--- a/jdk/test/sun/security/tools/jarsigner/warnings/NotSignedByAliasTest.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/sun/security/tools/jarsigner/warnings/NotSignedByAliasTest.java Wed Jul 05 23:40:06 2017 +0200
@@ -29,6 +29,7 @@
* @bug 8024302 8026037
* @summary Test for notSignedByAlias warning
* @library /lib/testlibrary /test/lib ../
+ * @build jdk.test.lib.util.JarUtils
* @run main NotSignedByAliasTest
*/
public class NotSignedByAliasTest extends Test {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/sun/security/tools/jarsigner/warnings/NotYetValidCertTest.java
--- a/jdk/test/sun/security/tools/jarsigner/warnings/NotYetValidCertTest.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/sun/security/tools/jarsigner/warnings/NotYetValidCertTest.java Wed Jul 05 23:40:06 2017 +0200
@@ -29,6 +29,7 @@
* @bug 8024302 8026037
* @summary Test for notYetValidCert warning
* @library /lib/testlibrary /test/lib ../
+ * @build jdk.test.lib.util.JarUtils
* @run main NotYetValidCertTest
*/
public class NotYetValidCertTest extends Test {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/sun/security/tools/keytool/ImportPrompt.java
--- a/jdk/test/sun/security/tools/keytool/ImportPrompt.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/sun/security/tools/keytool/ImportPrompt.java Wed Jul 05 23:40:06 2017 +0200
@@ -33,6 +33,14 @@
* @bug 8172975
* @summary SecurityTools.keytool() needs to accept user input
* @library /test/lib
+ * @build jdk.test.lib.SecurityTools
+ * jdk.test.lib.Utils
+ * jdk.test.lib.Asserts
+ * jdk.test.lib.JDKToolFinder
+ * jdk.test.lib.JDKToolLauncher
+ * jdk.test.lib.Platform
+ * jdk.test.lib.process.*
+ * @run main ImportPrompt
*/
public class ImportPrompt {
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/sun/security/tools/keytool/PrintSSL.java
--- a/jdk/test/sun/security/tools/keytool/PrintSSL.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/sun/security/tools/keytool/PrintSSL.java Wed Jul 05 23:40:06 2017 +0200
@@ -26,6 +26,13 @@
* @bug 6480981 8160624
* @summary keytool should be able to import certificates from remote SSL server
* @library /test/lib
+ * @build jdk.test.lib.SecurityTools
+ * jdk.test.lib.Utils
+ * jdk.test.lib.Asserts
+ * jdk.test.lib.JDKToolFinder
+ * jdk.test.lib.JDKToolLauncher
+ * jdk.test.lib.Platform
+ * jdk.test.lib.process.*
* @run main/othervm PrintSSL
*/
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/sun/security/tools/keytool/ReadJar.java
--- a/jdk/test/sun/security/tools/keytool/ReadJar.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/sun/security/tools/keytool/ReadJar.java Wed Jul 05 23:40:06 2017 +0200
@@ -26,6 +26,15 @@
* @bug 6890872 8168882
* @summary keytool -printcert to recognize signed jar files
* @library /test/lib
+ * @build jdk.test.lib.SecurityTools
+ * jdk.test.lib.util.JarUtils
+ * jdk.test.lib.Utils
+ * jdk.test.lib.Asserts
+ * jdk.test.lib.JDKToolFinder
+ * jdk.test.lib.JDKToolLauncher
+ * jdk.test.lib.Platform
+ * jdk.test.lib.process.*
+ * @run main ReadJar
*/
import java.nio.file.Files;
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/sun/security/tools/keytool/WeakAlg.java
--- a/jdk/test/sun/security/tools/keytool/WeakAlg.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/sun/security/tools/keytool/WeakAlg.java Wed Jul 05 23:40:06 2017 +0200
@@ -30,6 +30,13 @@
* @modules java.base/sun.security.tools.keytool
* java.base/sun.security.tools
* java.base/sun.security.util
+ * @build jdk.test.lib.SecurityTools
+ * jdk.test.lib.Utils
+ * jdk.test.lib.Asserts
+ * jdk.test.lib.JDKToolFinder
+ * jdk.test.lib.JDKToolLauncher
+ * jdk.test.lib.Platform
+ * jdk.test.lib.process.*
* @run main/othervm/timeout=600 -Duser.language=en -Duser.country=US WeakAlg
*/
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/sun/security/util/DerInputBuffer/TimeParsing.java
--- a/jdk/test/sun/security/util/DerInputBuffer/TimeParsing.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/sun/security/util/DerInputBuffer/TimeParsing.java Wed Jul 05 23:40:06 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,7 @@
/*
* @test
- * @bug 4558835 4915146
+ * @bug 4558835 4915146 8181841
* @summary Verify timezone offset and fractional seconds are correctly parsed
* @modules java.base/sun.security.util
*/
@@ -77,6 +77,10 @@
private final static byte[] GEN_FRACT3_ZULU =
{0x18, 0x13, 0x32, 0x30, 0x30, 0x31, 0x30, 0x38, 0x31, 0x30, 0x31, 0x37, 0x34, 0x33, 0x35, 0x31, 0x2e, 0x37, 0x36, 0x35, 0x5a};
+ // 20010810174351.7654Z
+ private final static byte[] GEN_FRACT4_ZULU =
+ {0x18, 0x14, 0x32, 0x30, 0x30, 0x31, 0x30, 0x38, 0x31, 0x30, 0x31, 0x37, 0x34, 0x33, 0x35, 0x31, 0x2e, 0x37, 0x36, 0x35, 0x34, 0x5a};
+
// 20010810184351.7+0100
private final static byte[] GEN_FRACT1_PLUS1 =
{0x18, 0x15, 0x32, 0x30, 0x30, 0x31, 0x30, 0x38, 0x31, 0x30, 0x31, 0x38, 0x34, 0x33, 0x35, 0x31, 0x2e, 0x37, 0x2b, 0x30, 0x31, 0x30, 0x30};
@@ -89,10 +93,17 @@
private final static byte[] GEN_FRACT3_PLUS1 =
{0x18, 0x17, 0x32, 0x30, 0x30, 0x31, 0x30, 0x38, 0x31, 0x30, 0x31, 0x38, 0x34, 0x33, 0x35, 0x31, 0x2e, 0x37, 0x36, 0x35, 0x2b, 0x30, 0x31, 0x30, 0x30};
+ // 20010810184351.7654+0100
+ private final static byte[] GEN_FRACT4_PLUS1 =
+ {0x18, 0x18, 0x32, 0x30, 0x30, 0x31, 0x30, 0x38, 0x31, 0x30, 0x31, 0x38, 0x34, 0x33, 0x35, 0x31, 0x2e, 0x37, 0x36, 0x35, 0x34, 0x2b, 0x30, 0x31, 0x30, 0x30};
+
// 20010810184351,765+0100
private final static byte[] GEN_FRACT3_COMMA_PLUS1 =
{0x18, 0x17, 0x32, 0x30, 0x30, 0x31, 0x30, 0x38, 0x31, 0x30, 0x31, 0x38, 0x34, 0x33, 0x35, 0x31, 0x2c, 0x37, 0x36, 0x35, 0x2b, 0x30, 0x31, 0x30, 0x30};
+ // 20010810184351,7654+0100
+ private final static byte[] GEN_FRACT4_COMMA_PLUS1 =
+ {0x18, 0x18, 0x32, 0x30, 0x30, 0x31, 0x30, 0x38, 0x31, 0x30, 0x31, 0x38, 0x34, 0x33, 0x35, 0x31, 0x2c, 0x37, 0x36, 0x35, 0x34, 0x2b, 0x30, 0x31, 0x30, 0x30};
private static Date decodeUTC(byte[] b) throws IOException {
DerInputStream derin = new DerInputStream(b);
@@ -146,6 +157,8 @@
checkGeneralized(d3, GEN_FRACT3_ZULU, "fractional seconds (Zulu)");
checkGeneralized(d3, GEN_FRACT3_PLUS1, "fractional seconds (+0100)");
checkGeneralized(d3, GEN_FRACT3_COMMA_PLUS1, "fractional seconds (+0100)");
+ checkGeneralized(d3, GEN_FRACT4_ZULU, "fractional seconds (Zulu)");
+ checkGeneralized(d3, GEN_FRACT4_PLUS1, "fractional seconds (+0100)");
+ checkGeneralized(d3, GEN_FRACT4_COMMA_PLUS1, "fractional seconds (+0100)");
}
-
}
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/sun/text/resources/LocaleData.cldr
--- a/jdk/test/sun/text/resources/LocaleData.cldr Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/sun/text/resources/LocaleData.cldr Wed Jul 05 23:40:06 2017 +0200
@@ -8274,3 +8274,29 @@
# bug #8075173
FormatData/de/standalone.MonthAbbreviations/2=M\u00e4r
+
+# bug #8178872
+FormatData/pt_PT/latn.NumberElements/0=,
+FormatData/pt_PT/latn.NumberElements/1=\u00a0
+FormatData/pt_AO/latn.NumberElements/0=,
+FormatData/pt_AO/latn.NumberElements/1=\u00a0
+FormatData/pt_CH/latn.NumberElements/0=,
+FormatData/pt_CH/latn.NumberElements/1=\u00a0
+FormatData/pt_CV/latn.NumberElements/0=,
+FormatData/pt_CV/latn.NumberElements/1=\u00a0
+FormatData/pt_GQ/latn.NumberElements/0=,
+FormatData/pt_GQ/latn.NumberElements/1=\u00a0
+FormatData/pt_MO/latn.NumberElements/0=,
+FormatData/pt_MO/latn.NumberElements/1=\u00a0
+FormatData/pt_LU/latn.NumberElements/0=,
+FormatData/pt_LU/latn.NumberElements/1=\u00a0
+FormatData/pt_MZ/latn.NumberElements/0=,
+FormatData/pt_MZ/latn.NumberElements/1=\u00a0
+FormatData/pt_ST/latn.NumberElements/0=,
+FormatData/pt_ST/latn.NumberElements/1=\u00a0
+FormatData/pt_TL/latn.NumberElements/0=,
+FormatData/pt_TL/latn.NumberElements/1=\u00a0
+FormatData/kea/latn.NumberElements/0=,
+FormatData/kea/latn.NumberElements/1=\u00a0
+FormatData/kea_CV/latn.NumberElements/0=,
+FormatData/kea_CV/latn.NumberElements/1=\u00a0
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/sun/text/resources/LocaleDataTest.java
--- a/jdk/test/sun/text/resources/LocaleDataTest.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/sun/text/resources/LocaleDataTest.java Wed Jul 05 23:40:06 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -37,7 +37,7 @@
* 7003124 7085757 7028073 7171028 7189611 8000983 7195759 8004489 8006509
* 7114053 7074882 7040556 8008577 8013836 8021121 6192407 6931564 8027695
* 8017142 8037343 8055222 8042126 8074791 8075173 8080774 8129361 8134916
- * 8145136 8145952 8164784 8037111 8081643 7037368
+ * 8145136 8145952 8164784 8037111 8081643 7037368 8178872
* @summary Verify locale data
* @modules java.base/sun.util.resources
* @modules jdk.localedata
@@ -99,8 +99,15 @@
* LocaleNames/fr_FR/US=\u00c9tats-Unis
* LocaleNames/fr_FR/FR=France
*
- * You can use language tag with '-' in locale field like this:
- * LocaleNames/sr-Latn/SR=Surinam
+ * Second field which designates locale is in the form of:
+ * 1) Legacy locale notation using '_' as a locale component(language/country/variant) separator.
+ * language is a mandatory component. country and variant are optional, however,
+ * variant cannot exist without country. So for example, while "ja"/"ja_JP"/"ja_JP_JP" are valid,
+ * "_JP"/"ja__JP" are invalid.
+ *
+ * 2) BCP47 language tag notation in which we can specify language tag with '-' as a subtag
+ * separator. Language tag can be specified with '-' in locale field like this:
+ * LocaleNames/sr-Latn/SR=Surinam
* FormatData/sr-Latn-BA/DayNames/2=utorak
*
* The command-line syntax of this test is
@@ -276,16 +283,25 @@
throw new Exception("Malformed input file: \"" + key + "\" is missing locale name");
localeName = key.substring(oldIndex, index);
boolean use_tag = localeName.indexOf("-") != -1;
-
if (use_tag == false && localeName.length() > 0) {
- language = localeName.substring(0, 2);
- if (localeName.length() > 3) {
- country = localeName.substring(3, 5);
- if (localeName.length() > 5)
- variant = localeName.substring(6);
+ String[] locDetails = localeName.split("_");
+ switch (locDetails.length) {
+ case 1:
+ language = locDetails[0];
+ break;
+ case 2:
+ language = locDetails[0];
+ country = locDetails[1];
+ break;
+ case 3:
+ language = locDetails[0];
+ country = locDetails[1];
+ variant = locDetails[2];
+ break;
+ default:
+ throw new Exception("locale not specified properly " + locDetails);
}
}
-
oldIndex = index + 1;
index = key.indexOf("/", oldIndex);
if (index == -1)
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/tools/jar/InputFilesTest.java
--- a/jdk/test/tools/jar/InputFilesTest.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/tools/jar/InputFilesTest.java Wed Jul 05 23:40:06 2017 +0200
@@ -30,6 +30,8 @@
* demonstrating identical behavior to JDK 8 jar tool.
* @library /test/lib
* @modules jdk.jartool
+ * @build jdk.test.lib.Platform
+ * jdk.test.lib.util.FileUtils
* @run testng InputFilesTest
*/
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/tools/jar/ReleaseBeforeFiles.java
--- a/jdk/test/tools/jar/ReleaseBeforeFiles.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/tools/jar/ReleaseBeforeFiles.java Wed Jul 05 23:40:06 2017 +0200
@@ -29,6 +29,8 @@
* not the --release option is preceded by a file name.
* @library /test/lib
* @modules jdk.jartool/sun.tools.jar
+ * @build jdk.test.lib.Platform
+ * jdk.test.lib.util.FileUtils
* @run testng ReleaseBeforeFiles
*/
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/tools/jar/compat/CLICompatibility.java
--- a/jdk/test/tools/jar/compat/CLICompatibility.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/tools/jar/compat/CLICompatibility.java Wed Jul 05 23:40:06 2017 +0200
@@ -50,7 +50,9 @@
* @test
* @bug 8170952
* @library /lib/testlibrary /test/lib
- * @build jdk.testlibrary.JDKToolFinder
+ * @build jdk.test.lib.Platform
+ * jdk.test.lib.util.FileUtils
+ * jdk.testlibrary.JDKToolFinder
* @run testng CLICompatibility
* @summary Basic test for compatibility of CLI options
*/
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/tools/jar/mmrjar/Basic.java
--- a/jdk/test/tools/jar/mmrjar/Basic.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/tools/jar/mmrjar/Basic.java Wed Jul 05 23:40:06 2017 +0200
@@ -30,6 +30,8 @@
* jdk.compiler
* jdk.jartool
* @library /test/lib
+ * @build jdk.test.lib.Platform
+ * jdk.test.lib.util.FileUtils
* @run testng Basic
*/
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/tools/jar/modularJar/Basic.java
--- a/jdk/test/tools/jar/modularJar/Basic.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/tools/jar/modularJar/Basic.java Wed Jul 05 23:40:06 2017 +0200
@@ -50,7 +50,9 @@
* @library /lib/testlibrary /test/lib
* @modules jdk.compiler
* jdk.jartool
- * @build jdk.testlibrary.JDKToolFinder
+ * @build jdk.test.lib.Platform
+ * jdk.test.lib.util.FileUtils
+ * jdk.testlibrary.JDKToolFinder
* @compile Basic.java
* @run testng Basic
* @summary Tests for plain Modular jars & Multi-Release Modular jars
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/tools/jar/multiRelease/ApiValidatorTest.java
--- a/jdk/test/tools/jar/multiRelease/ApiValidatorTest.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/tools/jar/multiRelease/ApiValidatorTest.java Wed Jul 05 23:40:06 2017 +0200
@@ -28,7 +28,14 @@
* @modules java.base/jdk.internal.misc
* jdk.compiler
* jdk.jartool
- * @build MRTestBase
+ * @build jdk.test.lib.util.FileUtils
+ * jdk.test.lib.Utils
+ * jdk.test.lib.Asserts
+ * jdk.test.lib.JDKToolFinder
+ * jdk.test.lib.JDKToolLauncher
+ * jdk.test.lib.Platform
+ * jdk.test.lib.process.*
+ * MRTestBase
* @run testng/timeout=1200 ApiValidatorTest
*/
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/tools/jar/multiRelease/Basic.java
--- a/jdk/test/tools/jar/multiRelease/Basic.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/tools/jar/multiRelease/Basic.java Wed Jul 05 23:40:06 2017 +0200
@@ -27,7 +27,14 @@
* @modules java.base/jdk.internal.misc
* jdk.compiler
* jdk.jartool
- * @build MRTestBase
+ * @build jdk.test.lib.util.FileUtils
+ * jdk.test.lib.Utils
+ * jdk.test.lib.Asserts
+ * jdk.test.lib.JDKToolFinder
+ * jdk.test.lib.JDKToolLauncher
+ * jdk.test.lib.Platform
+ * jdk.test.lib.process.*
+ * MRTestBase
* @run testng Basic
*/
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/tools/jar/multiRelease/Basic1.java
--- a/jdk/test/tools/jar/multiRelease/Basic1.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/tools/jar/multiRelease/Basic1.java Wed Jul 05 23:40:06 2017 +0200
@@ -27,8 +27,13 @@
* @modules java.base/jdk.internal.misc
* jdk.compiler
* jdk.jartool
- * @build jdk.test.lib.JDKToolFinder jdk.test.lib.Utils
- * @build MRTestBase
+ * @build jdk.test.lib.Utils
+ * jdk.test.lib.Asserts
+ * jdk.test.lib.JDKToolFinder
+ * jdk.test.lib.JDKToolLauncher
+ * jdk.test.lib.Platform
+ * jdk.test.lib.process.*
+ * MRTestBase
* @run testng Basic1
*/
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/tools/jar/multiRelease/RuntimeTest.java
--- a/jdk/test/tools/jar/multiRelease/RuntimeTest.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/tools/jar/multiRelease/RuntimeTest.java Wed Jul 05 23:40:06 2017 +0200
@@ -26,6 +26,13 @@
* @summary Test Multi-Release jar usage in runtime
* @library /test/lib
* @modules jdk.compiler
+ * @build jdk.test.lib.compiler.CompilerUtils
+ * jdk.test.lib.Utils
+ * jdk.test.lib.Asserts
+ * jdk.test.lib.JDKToolFinder
+ * jdk.test.lib.JDKToolLauncher
+ * jdk.test.lib.Platform
+ * jdk.test.lib.process.*
* @run testng RuntimeTest
*/
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/tools/jlink/multireleasejar/JLinkMultiReleaseJarTest.java
--- a/jdk/test/tools/jlink/multireleasejar/JLinkMultiReleaseJarTest.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/tools/jlink/multireleasejar/JLinkMultiReleaseJarTest.java Wed Jul 05 23:40:06 2017 +0200
@@ -29,9 +29,14 @@
* @library /test/lib
* @modules java.base/jdk.internal.jimage
* java.base/jdk.internal.module
- * @build jdk.test.lib.process.*
+ * @build jdk.test.lib.Utils
+ * jdk.test.lib.Asserts
+ * jdk.test.lib.JDKToolFinder
+ * jdk.test.lib.JDKToolLauncher
+ * jdk.test.lib.Platform
+ * jdk.test.lib.process.*
* @run testng JLinkMultiReleaseJarTest
-*/
+ */
import java.io.ByteArrayInputStream;
import java.io.IOException;
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/tools/jlink/plugins/SystemModuleDescriptors/CompiledVersionTest.java
--- a/jdk/test/tools/jlink/plugins/SystemModuleDescriptors/CompiledVersionTest.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/tools/jlink/plugins/SystemModuleDescriptors/CompiledVersionTest.java Wed Jul 05 23:40:06 2017 +0200
@@ -42,8 +42,10 @@
* @test
* @library /lib/testlibrary /test/lib
* @modules jdk.compiler jdk.jlink
- * @build CompiledVersionTest jdk.testlibrary.ProcessTools
- * jdk.test.lib.compiler.CompilerUtils
+ * @build jdk.test.lib.compiler.CompilerUtils
+ * jdk.test.lib.util.FileUtils
+ * jdk.test.lib.Platform
+ * CompiledVersionTest jdk.testlibrary.ProcessTools
* @run testng CompiledVersionTest
*/
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/tools/jlink/plugins/SystemModuleDescriptors/UserModuleTest.java
--- a/jdk/test/tools/jlink/plugins/SystemModuleDescriptors/UserModuleTest.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/tools/jlink/plugins/SystemModuleDescriptors/UserModuleTest.java Wed Jul 05 23:40:06 2017 +0200
@@ -48,8 +48,10 @@
* @modules jdk.compiler jdk.jlink
* @modules java.base/jdk.internal.module
* @modules java.base/jdk.internal.org.objectweb.asm
- * @build ModuleTargetHelper UserModuleTest jdk.testlibrary.ProcessTools
- * jdk.test.lib.compiler.CompilerUtils
+ * @build jdk.test.lib.compiler.CompilerUtils
+ * jdk.test.lib.util.FileUtils
+ * jdk.test.lib.Platform
+ * ModuleTargetHelper UserModuleTest jdk.testlibrary.ProcessTools
* @run testng UserModuleTest
*/
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/tools/jmod/JmodNegativeTest.java
--- a/jdk/test/tools/jmod/JmodNegativeTest.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/tools/jmod/JmodNegativeTest.java Wed Jul 05 23:40:06 2017 +0200
@@ -27,6 +27,8 @@
* @modules jdk.compiler
* jdk.jlink
* @build jdk.test.lib.compiler.CompilerUtils
+ * jdk.test.lib.util.FileUtils
+ * jdk.test.lib.Platform
* @run testng JmodNegativeTest
* @summary Negative tests for jmod
*/
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/tools/jmod/JmodTest.java
--- a/jdk/test/tools/jmod/JmodTest.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/tools/jmod/JmodTest.java Wed Jul 05 23:40:06 2017 +0200
@@ -29,6 +29,8 @@
* @modules jdk.compiler
* jdk.jlink
* @build jdk.test.lib.compiler.CompilerUtils
+ * jdk.test.lib.util.FileUtils
+ * jdk.test.lib.Platform
* @run testng/othervm -Djava.io.tmpdir=. JmodTest
*/
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/tools/jmod/hashes/HashesTest.java
--- a/jdk/test/tools/jmod/hashes/HashesTest.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/tools/jmod/hashes/HashesTest.java Wed Jul 05 23:40:06 2017 +0200
@@ -31,6 +31,8 @@
* jdk.compiler
* jdk.jartool
* jdk.jlink
+ * @build jdk.test.lib.compiler.ModuleInfoMaker
+ * jdk.test.lib.compiler.CompilerUtils
* @run testng HashesTest
*/
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/tools/launcher/LauncherMessageTest.java
--- a/jdk/test/tools/launcher/LauncherMessageTest.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/tools/launcher/LauncherMessageTest.java Wed Jul 05 23:40:06 2017 +0200
@@ -25,6 +25,8 @@
* @test
* @bug 8167063
* @library /test/lib
+ * @build jdk.test.lib.Platform
+ * jdk.test.lib.util.FileUtils
* @run main LauncherMessageTest
* @summary LauncherHelper should not throw JNI error for LinkageError
*/
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/tools/launcher/modules/addexports/AddExportsTestWarningError.java
--- a/jdk/test/tools/launcher/modules/addexports/AddExportsTestWarningError.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/tools/launcher/modules/addexports/AddExportsTestWarningError.java Wed Jul 05 23:40:06 2017 +0200
@@ -27,7 +27,9 @@
* @summary Basic argument validation for --add-exports
* @library /lib/testlibrary /test/lib
* @modules jdk.compiler
- * @build jdk.testlibrary.*
+ * @build jdk.test.lib.compiler.ModuleInfoMaker
+ * jdk.test.lib.compiler.CompilerUtils
+ * jdk.testlibrary.*
* @run testng AddExportsTestWarningError
*/
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/tools/launcher/modules/addreads/AddReadsTestWarningError.java
--- a/jdk/test/tools/launcher/modules/addreads/AddReadsTestWarningError.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/tools/launcher/modules/addreads/AddReadsTestWarningError.java Wed Jul 05 23:40:06 2017 +0200
@@ -27,8 +27,10 @@
* @summary Basic argument validation for --add-reads
* @library /lib/testlibrary /test/lib
* @modules jdk.compiler
+ * @build jdk.test.lib.compiler.ModuleInfoMaker
+ * @build jdk.test.lib.compiler.CompilerUtils
+ * @build jdk.testlibrary.*
* @build AddReadsTestWarningError
- * @build jdk.testlibrary.*
* @run testng AddReadsTestWarningError
*/
diff -r ea7475564d07 -r ca0e16b2d5d6 jdk/test/tools/launcher/modules/patch/systemmodules/PatchSystemModules.java
--- a/jdk/test/tools/launcher/modules/patch/systemmodules/PatchSystemModules.java Thu Jun 15 13:44:42 2017 +0200
+++ b/jdk/test/tools/launcher/modules/patch/systemmodules/PatchSystemModules.java Wed Jul 05 23:40:06 2017 +0200
@@ -28,6 +28,8 @@
* @library /lib/testlibrary /test/lib
* @modules jdk.compiler
* @build jdk.test.lib.compiler.CompilerUtils
+ * jdk.test.lib.util.FileUtils
+ * jdk.test.lib.Platform
* @run testng PatchSystemModules
*/
diff -r ea7475564d07 -r ca0e16b2d5d6 make/CompileJavaModules.gmk
--- a/make/CompileJavaModules.gmk Thu Jun 15 13:44:42 2017 +0200
+++ b/make/CompileJavaModules.gmk Wed Jul 05 23:40:06 2017 +0200
@@ -42,8 +42,7 @@
################################################################################
-java.base_ADD_JAVAC_FLAGS := -Xdoclint:all/protected,-reference '-Xdoclint/package:java.*,javax.*' -XDstringConcat=inline \
- --doclint-format html4
+java.base_ADD_JAVAC_FLAGS := -Xdoclint:all/protected,-reference '-Xdoclint/package:java.*,javax.*' -XDstringConcat=inline
java.base_COPY := .icu .dat .spp content-types.properties hijrah-config-islamic-umalqura.properties
java.base_CLEAN := intrinsic.properties
diff -r ea7475564d07 -r ca0e16b2d5d6 nashorn/.hgtags
--- a/nashorn/.hgtags Thu Jun 15 13:44:42 2017 +0200
+++ b/nashorn/.hgtags Wed Jul 05 23:40:06 2017 +0200
@@ -417,3 +417,5 @@
fc416270a776409b74006262dd0a9f5f5ff31555 jdk-9+171
f381e171bec90afee95dc2920793754b58b6f705 jdk-10+10
c8d6b740f0f7ec834b4157bf0d4523e8bbddb3f0 jdk-9+172
+ae0c4f1560e41e94a843e9933558d0223575869d jdk-10+11
+fa8e4de50e821eed876388c84f7129a6739268be jdk-9+173
diff -r ea7475564d07 -r ca0e16b2d5d6 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeDataView.java
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeDataView.java Thu Jun 15 13:44:42 2017 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeDataView.java Wed Jul 05 23:40:06 2017 +0200
@@ -416,7 +416,7 @@
* @return 32-bit unsigned int value at the byteOffset
*/
@Function(attributes = Attribute.NOT_ENUMERABLE, arity = 1)
- public static long getUint32(final Object self, final Object byteOffset, final Object littleEndian) {
+ public static double getUint32(final Object self, final Object byteOffset, final Object littleEndian) {
try {
return 0xFFFFFFFFL & getBuffer(self, littleEndian).getInt(JSType.toInt32(byteOffset));
} catch (final IllegalArgumentException iae) {
@@ -432,7 +432,7 @@
* @return 32-bit unsigned int value at the byteOffset
*/
@SpecializedFunction
- public static long getUint32(final Object self, final int byteOffset) {
+ public static double getUint32(final Object self, final int byteOffset) {
try {
return JSType.toUint32(getBuffer(self, false).getInt(JSType.toInt32(byteOffset)));
} catch (final IllegalArgumentException iae) {
@@ -449,7 +449,7 @@
* @return 32-bit unsigned int value at the byteOffset
*/
@SpecializedFunction
- public static long getUint32(final Object self, final int byteOffset, final boolean littleEndian) {
+ public static double getUint32(final Object self, final int byteOffset, final boolean littleEndian) {
try {
return JSType.toUint32(getBuffer(self, littleEndian).getInt(JSType.toInt32(byteOffset)));
} catch (final IllegalArgumentException iae) {
@@ -837,9 +837,9 @@
* @return undefined
*/
@SpecializedFunction
- public static Object setUint32(final Object self, final int byteOffset, final long value) {
+ public static Object setUint32(final Object self, final int byteOffset, final double value) {
try {
- getBuffer(self, false).putInt(byteOffset, (int)value);
+ getBuffer(self, false).putInt(byteOffset, (int) JSType.toUint32(value));
return UNDEFINED;
} catch (final IllegalArgumentException iae) {
throw rangeError(iae, "dataview.offset");
@@ -856,9 +856,9 @@
* @return undefined
*/
@SpecializedFunction
- public static Object setUint32(final Object self, final int byteOffset, final long value, final boolean littleEndian) {
+ public static Object setUint32(final Object self, final int byteOffset, final double value, final boolean littleEndian) {
try {
- getBuffer(self, littleEndian).putInt(byteOffset, (int)value);
+ getBuffer(self, littleEndian).putInt(byteOffset, (int) JSType.toUint32(value));
return UNDEFINED;
} catch (final IllegalArgumentException iae) {
throw rangeError(iae, "dataview.offset");
diff -r ea7475564d07 -r ca0e16b2d5d6 nashorn/test/script/basic/JDK-8181191.js
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8181191.js Wed Jul 05 23:40:06 2017 +0200
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * 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-8181191: getUint32 returning Long
+ *
+ * @test
+ * @run
+ */
+
+
+function uint32(x) {
+ var buffer = new ArrayBuffer(16);
+ var dataview = new DataView(buffer);
+ dataview.setUint32(0, x);
+ return dataview.getUint32(0);
+}
+
+Assert.assertTrue(typeof uint32(0x7f) === 'number');
+Assert.assertTrue(typeof uint32(0x80) === 'number');
+Assert.assertTrue(typeof uint32(0xffffffff) === 'number');
+Assert.assertTrue(typeof uint32(0x100000000) === 'number');
+
+Assert.assertTrue(uint32(0x7f) === 0x7f);
+Assert.assertTrue(uint32(0x80) === 0x80);
+Assert.assertTrue(uint32(0xffffffff) === 0xffffffff);
+Assert.assertTrue(uint32(0x100000000) === 0x0);
+
+Assert.assertTrue(uint32(0x7f) === uint32(0x7f));
+Assert.assertTrue(uint32(0x80) === uint32(0x80));
+Assert.assertTrue(uint32(0xffffffff) === uint32(0xffffffff));
+Assert.assertTrue(uint32(0x100000000) === uint32(0x100000000));
diff -r ea7475564d07 -r ca0e16b2d5d6 test/lib/jdk/test/lib/Platform.java
--- a/test/lib/jdk/test/lib/Platform.java Thu Jun 15 13:44:42 2017 +0200
+++ b/test/lib/jdk/test/lib/Platform.java Wed Jul 05 23:40:06 2017 +0200
@@ -23,6 +23,10 @@
package jdk.test.lib;
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
import java.util.regex.Pattern;
public class Platform {
@@ -228,7 +232,7 @@
public static boolean canPtraceAttachLinux() throws Exception {
// SELinux deny_ptrace:
- String deny_ptrace = Utils.fileAsString("/sys/fs/selinux/booleans/deny_ptrace");
+ String deny_ptrace = fileAsString("/sys/fs/selinux/booleans/deny_ptrace");
if (deny_ptrace != null && deny_ptrace.contains("1")) {
// ptrace will be denied:
return false;
@@ -239,7 +243,7 @@
// 1 - restricted ptrace: a process must be a children of the inferior or user is root
// 2 - only processes with CAP_SYS_PTRACE may use ptrace or user is root
// 3 - no attach: no processes may use ptrace with PTRACE_ATTACH
- String ptrace_scope = Utils.fileAsString("/proc/sys/kernel/yama/ptrace_scope");
+ String ptrace_scope = fileAsString("/proc/sys/kernel/yama/ptrace_scope");
if (ptrace_scope != null) {
if (ptrace_scope.startsWith("3")) {
return false;
@@ -265,4 +269,10 @@
.matcher(osArch)
.matches();
}
+
+ private static String fileAsString(String filename) throws IOException {
+ Path filePath = Paths.get(filename);
+ if (!Files.exists(filePath)) return null;
+ return new String(Files.readAllBytes(filePath));
+ }
}
|
---|