Merge
diff --git a/.hgtags-top-repo b/.hgtags-top-repo
index ac2de3f..9aadc2e 100644
--- a/.hgtags-top-repo
+++ b/.hgtags-top-repo
@@ -247,3 +247,4 @@
ff1478785e43718146ffbce97e007f39c3bcaa32 jdk8-b123
790bbd46b2015e69ce301dae194c2b4141011f2d jdk8-b124
790bbd46b2015e69ce301dae194c2b4141011f2d jdk8-b125
+9ccce5bf1b0ea0d3f3fb871be069f305f9cea530 jdk8-b126
diff --git a/THIRD_PARTY_README b/THIRD_PARTY_README
index ba48858..a93b35b 100644
--- a/THIRD_PARTY_README
+++ b/THIRD_PARTY_README
@@ -1400,7 +1400,7 @@
-------------------------------------------------------------------------------
%% This notice is provided with respect to Little CMS 2.4, which may be
-included with OpenJDK 8.
+included with JRE 8, JDK 8, and OpenJDK 8.
--- begin of LICENSE ---
diff --git a/corba/.hgtags b/corba/.hgtags
index 0556a09..200d803 100644
--- a/corba/.hgtags
+++ b/corba/.hgtags
@@ -247,3 +247,4 @@
1ecd4619f60c2432120821e805e64bdb45de66cc jdk8-b123
7b45151c7a05764b87ca088ba70448d39de6d41f jdk8-b124
7b45151c7a05764b87ca088ba70448d39de6d41f jdk8-b125
+8ceb68fd9e107767edf949c6b3ac9d425ca93cac jdk8-b126
diff --git a/corba/THIRD_PARTY_README b/corba/THIRD_PARTY_README
index ba48858..a93b35b 100644
--- a/corba/THIRD_PARTY_README
+++ b/corba/THIRD_PARTY_README
@@ -1400,7 +1400,7 @@
-------------------------------------------------------------------------------
%% This notice is provided with respect to Little CMS 2.4, which may be
-included with OpenJDK 8.
+included with JRE 8, JDK 8, and OpenJDK 8.
--- begin of LICENSE ---
diff --git a/hotspot/.hgtags b/hotspot/.hgtags
index 0cc60f4..d66816a 100644
--- a/hotspot/.hgtags
+++ b/hotspot/.hgtags
@@ -412,3 +412,6 @@
df333ee12bba67e2e928f8ce1da37afd9bf95b48 jdk8-b124
3585183c191aa6b4d0375ea659515335e1804417 hs25-b67
df333ee12bba67e2e928f8ce1da37afd9bf95b48 jdk8-b125
+c8218f1072a0370f3ce4714469ced0613ee543ab jdk8-b126
+d45454002494d147c0761e6b37d8a73064f3cf92 hs25-b68
+32f017489ba5dd1bedabb9fa1d26bcc74d0a72b6 hs25-b69
diff --git a/hotspot/THIRD_PARTY_README b/hotspot/THIRD_PARTY_README
index ba48858..a93b35b 100644
--- a/hotspot/THIRD_PARTY_README
+++ b/hotspot/THIRD_PARTY_README
@@ -1400,7 +1400,7 @@
-------------------------------------------------------------------------------
%% This notice is provided with respect to Little CMS 2.4, which may be
-included with OpenJDK 8.
+included with JRE 8, JDK 8, and OpenJDK 8.
--- begin of LICENSE ---
diff --git a/hotspot/make/hotspot_version b/hotspot/make/hotspot_version
index bca36a9..c250e0f 100644
--- a/hotspot/make/hotspot_version
+++ b/hotspot/make/hotspot_version
@@ -35,7 +35,7 @@
HS_MAJOR_VER=25
HS_MINOR_VER=0
-HS_BUILD_NUMBER=67
+HS_BUILD_NUMBER=69
JDK_MAJOR_VER=1
JDK_MINOR_VER=8
diff --git a/hotspot/src/cpu/sparc/vm/sparc.ad b/hotspot/src/cpu/sparc/vm/sparc.ad
index 1928387..1b77525 100644
--- a/hotspot/src/cpu/sparc/vm/sparc.ad
+++ b/hotspot/src/cpu/sparc/vm/sparc.ad
@@ -3355,8 +3355,8 @@
interface(CONST_INTER);
%}
-// Unsigned (positive) Integer Immediate: 13-bit
-operand immU13() %{
+// Unsigned Integer Immediate: 12-bit (non-negative that fits in simm13)
+operand immU12() %{
predicate((0 <= n->get_int()) && Assembler::is_simm13(n->get_int()));
match(ConI);
op_cost(0);
@@ -3392,6 +3392,17 @@
interface(CONST_INTER);
%}
+// Int Immediate non-negative
+operand immU31()
+%{
+ predicate(n->get_int() >= 0);
+ match(ConI);
+
+ op_cost(0);
+ format %{ %}
+ interface(CONST_INTER);
+%}
+
// Integer Immediate: 0-bit
operand immI0() %{
predicate(n->get_int() == 0);
@@ -5720,7 +5731,6 @@
effect(TEMP dst, TEMP tmp);
ins_cost(MEMORY_REF_COST + 2*DEFAULT_COST);
- size((3+1)*4); // set may use two instructions.
format %{ "LDUH $mem,$dst\t! ushort/char & 16-bit mask -> long\n\t"
"SET $mask,$tmp\n\t"
"AND $dst,$tmp,$dst" %}
@@ -5842,13 +5852,13 @@
ins_pipe(iload_mem);
%}
-// Load Integer with a 13-bit mask into a Long Register
-instruct loadI2L_immI13(iRegL dst, memory mem, immI13 mask) %{
+// Load Integer with a 12-bit mask into a Long Register
+instruct loadI2L_immU12(iRegL dst, memory mem, immU12 mask) %{
match(Set dst (ConvI2L (AndI (LoadI mem) mask)));
ins_cost(MEMORY_REF_COST + DEFAULT_COST);
size(2*4);
- format %{ "LDUW $mem,$dst\t! int & 13-bit mask -> long\n\t"
+ format %{ "LDUW $mem,$dst\t! int & 12-bit mask -> long\n\t"
"AND $dst,$mask,$dst" %}
ins_encode %{
Register Rdst = $dst$$Register;
@@ -5858,14 +5868,13 @@
ins_pipe(iload_mem);
%}
-// Load Integer with a 32-bit mask into a Long Register
-instruct loadI2L_immI(iRegL dst, memory mem, immI mask, iRegL tmp) %{
+// Load Integer with a 31-bit mask into a Long Register
+instruct loadI2L_immU31(iRegL dst, memory mem, immU31 mask, iRegL tmp) %{
match(Set dst (ConvI2L (AndI (LoadI mem) mask)));
effect(TEMP dst, TEMP tmp);
ins_cost(MEMORY_REF_COST + 2*DEFAULT_COST);
- size((3+1)*4); // set may use two instructions.
- format %{ "LDUW $mem,$dst\t! int & 32-bit mask -> long\n\t"
+ format %{ "LDUW $mem,$dst\t! int & 31-bit mask -> long\n\t"
"SET $mask,$tmp\n\t"
"AND $dst,$tmp,$dst" %}
ins_encode %{
@@ -8960,7 +8969,7 @@
ins_pipe(ialu_cconly_reg_reg);
%}
-instruct compU_iReg_imm13(flagsRegU icc, iRegI op1, immU13 op2 ) %{
+instruct compU_iReg_imm13(flagsRegU icc, iRegI op1, immU12 op2 ) %{
match(Set icc (CmpU op1 op2));
size(4);
diff --git a/hotspot/src/cpu/x86/vm/x86_32.ad b/hotspot/src/cpu/x86/vm/x86_32.ad
index 2aa9e5f..90c1d89 100644
--- a/hotspot/src/cpu/x86/vm/x86_32.ad
+++ b/hotspot/src/cpu/x86/vm/x86_32.ad
@@ -3889,6 +3889,17 @@
interface(CONST_INTER);
%}
+// Int Immediate non-negative
+operand immU31()
+%{
+ predicate(n->get_int() >= 0);
+ match(ConI);
+
+ op_cost(0);
+ format %{ %}
+ interface(CONST_INTER);
+%}
+
// Constant for long shifts
operand immI_32() %{
predicate( n->get_int() == 32 );
@@ -6119,12 +6130,12 @@
ins_pipe(ialu_reg_mem);
%}
-// Load Integer with 32-bit mask into Long Register
-instruct loadI2L_immI(eRegL dst, memory mem, immI mask, eFlagsReg cr) %{
+// Load Integer with 31-bit mask into Long Register
+instruct loadI2L_immU31(eRegL dst, memory mem, immU31 mask, eFlagsReg cr) %{
match(Set dst (ConvI2L (AndI (LoadI mem) mask)));
effect(KILL cr);
- format %{ "MOV $dst.lo,$mem\t# int & 32-bit mask -> long\n\t"
+ format %{ "MOV $dst.lo,$mem\t# int & 31-bit mask -> long\n\t"
"XOR $dst.hi,$dst.hi\n\t"
"AND $dst.lo,$mask" %}
ins_encode %{
diff --git a/hotspot/src/cpu/x86/vm/x86_64.ad b/hotspot/src/cpu/x86/vm/x86_64.ad
index 182a701..9fe9295 100644
--- a/hotspot/src/cpu/x86/vm/x86_64.ad
+++ b/hotspot/src/cpu/x86/vm/x86_64.ad
@@ -3086,6 +3086,17 @@
interface(CONST_INTER);
%}
+// Int Immediate non-negative
+operand immU31()
+%{
+ predicate(n->get_int() >= 0);
+ match(ConI);
+
+ op_cost(0);
+ format %{ %}
+ interface(CONST_INTER);
+%}
+
// Constant for long shifts
operand immI_32()
%{
@@ -5042,12 +5053,12 @@
ins_pipe(ialu_reg_mem);
%}
-// Load Integer with a 32-bit mask into Long Register
-instruct loadI2L_immI(rRegL dst, memory mem, immI mask, rFlagsReg cr) %{
+// Load Integer with a 31-bit mask into Long Register
+instruct loadI2L_immU31(rRegL dst, memory mem, immU31 mask, rFlagsReg cr) %{
match(Set dst (ConvI2L (AndI (LoadI mem) mask)));
effect(KILL cr);
- format %{ "movl $dst, $mem\t# int & 32-bit mask -> long\n\t"
+ format %{ "movl $dst, $mem\t# int & 31-bit mask -> long\n\t"
"andl $dst, $mask" %}
ins_encode %{
Register Rdst = $dst$$Register;
diff --git a/hotspot/src/share/vm/code/dependencies.cpp b/hotspot/src/share/vm/code/dependencies.cpp
index 4419bdd..29aaf32 100644
--- a/hotspot/src/share/vm/code/dependencies.cpp
+++ b/hotspot/src/share/vm/code/dependencies.cpp
@@ -1161,11 +1161,9 @@
// We could also return false if m does not yet appear to be
// executed, if the VM version supports this distinction also.
+ // Default methods are considered "concrete" as well.
return !m->is_abstract() &&
- !InstanceKlass::cast(m->method_holder())->is_interface();
- // TODO: investigate whether default methods should be
- // considered as "concrete" in this situation. For now they
- // are not.
+ !m->is_overpass(); // error functions aren't concrete
}
diff --git a/hotspot/src/share/vm/opto/c2_globals.hpp b/hotspot/src/share/vm/opto/c2_globals.hpp
index 207daab..b3b2fd2 100644
--- a/hotspot/src/share/vm/opto/c2_globals.hpp
+++ b/hotspot/src/share/vm/opto/c2_globals.hpp
@@ -445,7 +445,7 @@
notproduct(bool, PrintEliminateLocks, false, \
"Print out when locks are eliminated") \
\
- product(bool, EliminateAutoBox, true, \
+ product(bool, EliminateAutoBox, false, \
"Control optimizations for autobox elimination") \
\
experimental(bool, UseImplicitStableValues, false, \
diff --git a/hotspot/test/compiler/codegen/LoadWithMask.java b/hotspot/test/compiler/codegen/LoadWithMask.java
new file mode 100644
index 0000000..13ec4e5
--- /dev/null
+++ b/hotspot/test/compiler/codegen/LoadWithMask.java
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8032207
+ * @summary Invalid node sizing for loadUS2L_immI16 and loadI2L_immI
+ * @run main/othervm -server -Xbatch -XX:-TieredCompilation -XX:CompileCommand=compileonly,LoadWithMask.foo LoadWithMask
+ *
+ */
+public class LoadWithMask {
+ static int x[] = new int[1];
+ static long foo() {
+ return x[0] & 0xfff0ffff;
+ }
+
+ public static void main(String[] args) {
+ x[0] = -1;
+ long l = 0;
+ for (int i = 0; i < 100000; ++i) {
+ l = foo();
+ }
+ }
+}
diff --git a/hotspot/test/compiler/codegen/LoadWithMask2.java b/hotspot/test/compiler/codegen/LoadWithMask2.java
new file mode 100644
index 0000000..c1ae528
--- /dev/null
+++ b/hotspot/test/compiler/codegen/LoadWithMask2.java
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8031743
+ * @summary loadI2L_immI broken for negative memory values
+ * @run main/othervm -server -Xbatch -XX:-TieredCompilation -XX:CompileCommand=compileonly,*.foo* LoadWithMask2
+ *
+ */
+public class LoadWithMask2 {
+ static int x;
+ static long foo1() {
+ return x & 0xfffffffe;
+ }
+ static long foo2() {
+ return x & 0xff000000;
+ }
+ static long foo3() {
+ return x & 0x8abcdef1;
+ }
+
+ public static void main(String[] args) {
+ x = -1;
+ long l = 0;
+ for (int i = 0; i < 100000; ++i) {
+ l = foo1() & foo2() & foo3();
+ }
+ if (l > 0) {
+ System.out.println("FAILED");
+ System.exit(97);
+ }
+ System.out.println("PASSED");
+ }
+}
diff --git a/hotspot/test/compiler/inlining/DefaultAndConcreteMethodsCHA.java b/hotspot/test/compiler/inlining/DefaultAndConcreteMethodsCHA.java
new file mode 100644
index 0000000..821ac79
--- /dev/null
+++ b/hotspot/test/compiler/inlining/DefaultAndConcreteMethodsCHA.java
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * @test
+ * @bug 8031695
+ * @summary CHA ignores default methods during analysis leading to incorrect code generation
+ *
+ * @run main/othervm -Xbatch DefaultAndConcreteMethodsCHA
+ */
+interface I {
+ default int m() { return 0; }
+}
+
+class A implements I {}
+
+class C extends A { }
+class D extends A { public int m() { return 1; } }
+
+public class DefaultAndConcreteMethodsCHA {
+ public static int test(A obj) {
+ return obj.m();
+ }
+ public static void main(String[] args) {
+ for (int i = 0; i < 10000; i++) {
+ int idC = test(new C());
+ if (idC != 0) {
+ throw new Error("C.m didn't invoke I.m: id "+idC);
+ }
+
+ int idD = test(new D());
+ if (idD != 1) {
+ throw new Error("D.m didn't invoke D.m: id "+idD);
+ }
+ }
+
+ }
+}
diff --git a/jaxp/.hgtags b/jaxp/.hgtags
index 962b062..07d19e2 100644
--- a/jaxp/.hgtags
+++ b/jaxp/.hgtags
@@ -247,3 +247,4 @@
4e35b5b6d2e5e27772d59a70a54e5d04fc801a64 jdk8-b123
83bb924238f800db68fb6f60142cc5149d7a9bf6 jdk8-b124
83bb924238f800db68fb6f60142cc5149d7a9bf6 jdk8-b125
+390cc275c04c4d7c8a14a895e9bcdc57621af966 jdk8-b126
diff --git a/jaxp/THIRD_PARTY_README b/jaxp/THIRD_PARTY_README
index ba48858..a93b35b 100644
--- a/jaxp/THIRD_PARTY_README
+++ b/jaxp/THIRD_PARTY_README
@@ -1400,7 +1400,7 @@
-------------------------------------------------------------------------------
%% This notice is provided with respect to Little CMS 2.4, which may be
-included with OpenJDK 8.
+included with JRE 8, JDK 8, and OpenJDK 8.
--- begin of LICENSE ---
diff --git a/jaxws/.hgtags b/jaxws/.hgtags
index c828f05..8e7c4ad 100644
--- a/jaxws/.hgtags
+++ b/jaxws/.hgtags
@@ -247,3 +247,4 @@
91f5c542ccad330efc0d281362dd6f33f2039746 jdk8-b123
ef71ecbcd7bc014b1be39a6d1b3a1fb663772c14 jdk8-b124
ef71ecbcd7bc014b1be39a6d1b3a1fb663772c14 jdk8-b125
+7193a007a159ef9401b672af5c36c5b95e6e2943 jdk8-b126
diff --git a/jaxws/THIRD_PARTY_README b/jaxws/THIRD_PARTY_README
index ba48858..a93b35b 100644
--- a/jaxws/THIRD_PARTY_README
+++ b/jaxws/THIRD_PARTY_README
@@ -1400,7 +1400,7 @@
-------------------------------------------------------------------------------
%% This notice is provided with respect to Little CMS 2.4, which may be
-included with OpenJDK 8.
+included with JRE 8, JDK 8, and OpenJDK 8.
--- begin of LICENSE ---
diff --git a/jdk/.hgtags b/jdk/.hgtags
index 14326a5..eb2deea 100644
--- a/jdk/.hgtags
+++ b/jdk/.hgtags
@@ -247,3 +247,4 @@
484e16c0a040efeccbe449d163e9c185e6c2b4db jdk8-b123
ae303640bc1cca06f1c6ac887e6b523ceeb425a6 jdk8-b124
ae303640bc1cca06f1c6ac887e6b523ceeb425a6 jdk8-b125
+a9088d517f2fa9919886d3d95023c518b59172b8 jdk8-b126
diff --git a/jdk/THIRD_PARTY_README b/jdk/THIRD_PARTY_README
index ba48858..a93b35b 100644
--- a/jdk/THIRD_PARTY_README
+++ b/jdk/THIRD_PARTY_README
@@ -1400,7 +1400,7 @@
-------------------------------------------------------------------------------
%% This notice is provided with respect to Little CMS 2.4, which may be
-included with OpenJDK 8.
+included with JRE 8, JDK 8, and OpenJDK 8.
--- begin of LICENSE ---
diff --git a/jdk/src/share/classes/java/lang/invoke/AbstractValidatingLambdaMetafactory.java b/jdk/src/share/classes/java/lang/invoke/AbstractValidatingLambdaMetafactory.java
index fa6ed4d..10c3ed1 100644
--- a/jdk/src/share/classes/java/lang/invoke/AbstractValidatingLambdaMetafactory.java
+++ b/jdk/src/share/classes/java/lang/invoke/AbstractValidatingLambdaMetafactory.java
@@ -114,6 +114,11 @@
Class<?>[] markerInterfaces,
MethodType[] additionalBridges)
throws LambdaConversionException {
+ if ((caller.lookupModes() & MethodHandles.Lookup.PRIVATE) == 0) {
+ throw new LambdaConversionException(String.format(
+ "Invalid caller: %s",
+ caller.lookupClass().getName()));
+ }
this.targetClass = caller.lookupClass();
this.invokedType = invokedType;
@@ -221,6 +226,13 @@
String.format("Invalid receiver type %s; not a subtype of implementation type %s",
receiverClass, implDefiningClass));
}
+
+ Class<?> implReceiverClass = implMethod.type().parameterType(0);
+ if (implReceiverClass != implDefiningClass && !implReceiverClass.isAssignableFrom(receiverClass)) {
+ throw new LambdaConversionException(
+ String.format("Invalid receiver type %s; not a subtype of implementation receiver type %s",
+ receiverClass, implReceiverClass));
+ }
} else {
// no receiver
capturedStart = 0;
@@ -256,11 +268,17 @@
(implKind == MethodHandleInfo.REF_newInvokeSpecial)
? implDefiningClass
: implMethodType.returnType();
+ Class<?> samReturnType = samMethodType.returnType();
if (!isAdaptableToAsReturn(actualReturnType, expectedType)) {
throw new LambdaConversionException(
String.format("Type mismatch for lambda return: %s is not convertible to %s",
actualReturnType, expectedType));
}
+ if (!isAdaptableToAsReturn(expectedType, samReturnType)) {
+ throw new LambdaConversionException(
+ String.format("Type mismatch for lambda expected return: %s is not convertible to %s",
+ expectedType, samReturnType));
+ }
}
/**
diff --git a/jdk/src/share/classes/java/util/jar/JarFile.java b/jdk/src/share/classes/java/util/jar/JarFile.java
index 9aac6a1..f78c36c 100644
--- a/jdk/src/share/classes/java/util/jar/JarFile.java
+++ b/jdk/src/share/classes/java/util/jar/JarFile.java
@@ -40,6 +40,7 @@
import sun.security.action.GetPropertyAction;
import sun.security.util.ManifestEntryVerifier;
import sun.misc.SharedSecrets;
+import sun.security.util.SignatureFileVerifier;
/**
* The <code>JarFile</code> class is used to read the contents of a jar file
@@ -364,11 +365,13 @@
String[] names = getMetaInfEntryNames();
if (names != null) {
for (int i = 0; i < names.length; i++) {
- JarEntry e = getJarEntry(names[i]);
- if (e == null) {
- throw new JarException("corrupted jar file");
- }
- if (!e.isDirectory()) {
+ String uname = names[i].toUpperCase(Locale.ENGLISH);
+ if (MANIFEST_NAME.equals(uname)
+ || SignatureFileVerifier.isBlockOrSF(uname)) {
+ JarEntry e = getJarEntry(names[i]);
+ if (e == null) {
+ throw new JarException("corrupted jar file");
+ }
if (mev == null) {
mev = new ManifestEntryVerifier
(getManifestFromReference());
diff --git a/jdk/src/share/classes/sun/invoke/util/VerifyAccess.java b/jdk/src/share/classes/sun/invoke/util/VerifyAccess.java
index 02a6e66..d8b338a 100644
--- a/jdk/src/share/classes/sun/invoke/util/VerifyAccess.java
+++ b/jdk/src/share/classes/sun/invoke/util/VerifyAccess.java
@@ -118,7 +118,7 @@
isSamePackage(defc, lookupClass))
return true;
if ((allowedModes & PROTECTED) != 0 &&
- isPublicSuperClass(defc, lookupClass))
+ isSuperClass(defc, lookupClass))
return true;
return false;
case PACKAGE_ONLY: // That is, zero. Unmarked member is package-only access.
@@ -140,8 +140,8 @@
lookupClass.isAssignableFrom(refc));
}
- static boolean isPublicSuperClass(Class<?> defc, Class<?> lookupClass) {
- return isPublic(getClassModifiers(defc)) && defc.isAssignableFrom(lookupClass);
+ static boolean isSuperClass(Class<?> defc, Class<?> lookupClass) {
+ return defc.isAssignableFrom(lookupClass);
}
static int getClassModifiers(Class<?> c) {
diff --git a/jdk/src/solaris/native/common/jni_util_md.c b/jdk/src/solaris/native/common/jni_util_md.c
index e9e0f4e..42ab2de 100644
--- a/jdk/src/solaris/native/common/jni_util_md.c
+++ b/jdk/src/solaris/native/common/jni_util_md.c
@@ -23,6 +23,8 @@
* questions.
*/
+#include <string.h>
+
#include "jni.h"
#include "jni_util.h"
#include "dlfcn.h"
@@ -40,7 +42,11 @@
if (procHandle != NULL) {
return procHandle;
}
+#ifdef __APPLE__
+ procHandle = (void*)dlopen(NULL, RTLD_FIRST);
+#else
procHandle = (void*)dlopen(NULL, RTLD_LAZY);
+#endif
return procHandle;
}
diff --git a/jdk/test/java/lang/invoke/ProtectedMemberDifferentPackage/Test.java b/jdk/test/java/lang/invoke/ProtectedMemberDifferentPackage/Test.java
new file mode 100644
index 0000000..6640a0e
--- /dev/null
+++ b/jdk/test/java/lang/invoke/ProtectedMemberDifferentPackage/Test.java
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+/**
+ * @test
+ * @bug 8032585
+ * @summary JSR292: IllegalAccessError when attempting to invoke protected method from different package
+ *
+ * @compile p1/T2.java p2/T3.java
+ * @run main/othervm p2.T3
+ */
+public class Test {}
diff --git a/jdk/test/java/lang/invoke/ProtectedMemberDifferentPackage/p1/T2.java b/jdk/test/java/lang/invoke/ProtectedMemberDifferentPackage/p1/T2.java
new file mode 100644
index 0000000..d702f99
--- /dev/null
+++ b/jdk/test/java/lang/invoke/ProtectedMemberDifferentPackage/p1/T2.java
@@ -0,0 +1,30 @@
+/*
+ * 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 p1;
+
+class T1 {
+ protected void m() { System.out.println("T1.m");}
+}
+
+public class T2 extends T1 {}
diff --git a/jdk/test/java/lang/invoke/ProtectedMemberDifferentPackage/p2/T3.java b/jdk/test/java/lang/invoke/ProtectedMemberDifferentPackage/p2/T3.java
new file mode 100644
index 0000000..c79ffa9
--- /dev/null
+++ b/jdk/test/java/lang/invoke/ProtectedMemberDifferentPackage/p2/T3.java
@@ -0,0 +1,37 @@
+/*
+ * 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 p2;
+
+import p1.T2;
+
+import java.lang.invoke.MethodHandle;
+import java.lang.invoke.MethodHandles;
+import java.lang.invoke.MethodType;
+
+public class T3 extends T2 {
+ public static void main(String[] args) throws Throwable {
+ MethodHandles.lookup().findVirtual(T3.class, "m", MethodType.methodType(void.class));
+ System.out.println("TEST PASSED");
+ }
+}
diff --git a/jdk/test/java/lang/invoke/lambda/T8032697.java b/jdk/test/java/lang/invoke/lambda/T8032697.java
new file mode 100644
index 0000000..be422a9
--- /dev/null
+++ b/jdk/test/java/lang/invoke/lambda/T8032697.java
@@ -0,0 +1,69 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8032697
+ * @summary Issues with Lambda
+ */
+
+import java.lang.invoke.LambdaMetafactory;
+import java.lang.invoke.LambdaConversionException;
+import java.lang.invoke.MethodHandle;
+import java.lang.invoke.MethodHandles;
+import java.lang.invoke.MethodType;
+
+import T8032697_anotherpkg.T8032697_A;
+
+public class T8032697 extends T8032697_A {
+
+ interface I {
+ int m();
+ }
+
+ interface IA {
+ int m(T8032697_A x);
+ }
+
+ static MethodHandles.Lookup l;
+ static MethodHandle h;
+ private static MethodType mt(Class<?> k) { return MethodType.methodType(k); }
+ private static MethodType mt(Class<?> k, Class<?> k2) { return MethodType.methodType(k, k2); }
+ private static boolean mf(MethodType mti, MethodType mtf) {
+ try {
+ LambdaMetafactory.metafactory(l, "m", mti,mtf,h,mtf);
+ } catch(LambdaConversionException e) {
+ return true;
+ }
+ return false;
+ }
+
+ public static void main(String[] args) throws Throwable {
+ l = MethodHandles.lookup();
+ h = l.findVirtual(T8032697_A.class, "f", mt(int.class));
+ if (mf(mt(I.class, T8032697.class), mt(int.class))) throw new AssertionError("Error: Should work");
+ if (mf(mt(IA.class), mt(int.class, T8032697.class))) throw new AssertionError("Error: Should work");
+ if (!mf(mt(I.class, T8032697_A.class), mt(int.class))) throw new AssertionError("Error: Should fail");
+ if (!mf(mt(IA.class), mt(int.class, T8032697_A.class))) throw new AssertionError("Error: Should fail");
+ }
+}
diff --git a/jdk/test/java/lang/invoke/lambda/T8032697_anotherpkg/T8032697_A.java b/jdk/test/java/lang/invoke/lambda/T8032697_anotherpkg/T8032697_A.java
new file mode 100644
index 0000000..d611e3f
--- /dev/null
+++ b/jdk/test/java/lang/invoke/lambda/T8032697_anotherpkg/T8032697_A.java
@@ -0,0 +1,28 @@
+/*
+ * 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 T8032697_anotherpkg;
+
+public class T8032697_A {
+ protected final int f() { return 2; }
+}
diff --git a/jdk/test/java/lang/invoke/lambda/T8032704.java b/jdk/test/java/lang/invoke/lambda/T8032704.java
new file mode 100644
index 0000000..9dfe3a0
--- /dev/null
+++ b/jdk/test/java/lang/invoke/lambda/T8032704.java
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8032704
+ * @summary Issues with lib perm in Lambda
+ */
+
+import java.io.Closeable;
+import java.lang.invoke.LambdaMetafactory;
+import java.lang.invoke.LambdaConversionException;
+import java.lang.invoke.MethodHandle;
+import java.lang.invoke.MethodHandles;
+import java.lang.invoke.MethodType;
+
+public class T8032704 {
+
+ public static void here() {}
+ static MethodHandle h;
+ private static MethodType mt(Class<?> k) { return MethodType.methodType(k); }
+ private static boolean mf(MethodHandles.Lookup l) {
+ try {
+ LambdaMetafactory.metafactory(l, "close",
+ mt(Closeable.class),mt(void.class),h,mt(void.class));
+ } catch(LambdaConversionException e) {
+ return true;
+ }
+ return false;
+ }
+
+ public static void main(String[] args) throws Throwable {
+ MethodHandles.Lookup ll = MethodHandles.lookup();
+ h = ll.findStatic(T8032704.class, "here", mt(void.class));
+ if (mf(ll)) throw new AssertionError("Error: Should work");
+ if (!mf(MethodHandles.publicLookup())) throw new AssertionError("Error: Should fail - public");
+ if (!mf(ll.in(T8032704other.class))) throw new AssertionError("Error: Should fail - other");
+ if (!mf(ll.in(Thread.class))) throw new AssertionError("Error: Should fail - Thread");
+ }
+}
+
+class T8032704other {}
diff --git a/jdk/test/java/lang/invoke/lambda/T8032711.java b/jdk/test/java/lang/invoke/lambda/T8032711.java
new file mode 100644
index 0000000..b01009f
--- /dev/null
+++ b/jdk/test/java/lang/invoke/lambda/T8032711.java
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8032711
+ * @summary Issue with Lambda in handling
+ */
+
+import java.lang.invoke.LambdaMetafactory;
+import java.lang.invoke.LambdaConversionException;
+import java.lang.invoke.MethodHandle;
+import java.lang.invoke.MethodHandles;
+import java.lang.invoke.MethodType;
+
+public class T8032711 {
+
+ interface I {
+ void m();
+ }
+
+ static void here() {}
+ static MethodHandles.Lookup l;
+ static MethodHandle h;
+ private static MethodType mt(Class<?> k) { return MethodType.methodType(k); }
+ private static boolean mf(Class<?> k) {
+ try {
+ LambdaMetafactory.metafactory(l, "m",
+ mt(I.class),mt(k),h,mt(void.class));
+ } catch(LambdaConversionException e) {
+ return true;
+ }
+ return false;
+ }
+
+ public static void main(String[] args) throws Throwable {
+ l = MethodHandles.lookup();
+ h = l.findStatic(T8032711.class, "here", mt(void.class));
+ if (mf(void.class)) throw new AssertionError("Error: Should work");
+ if (!mf(String.class)) throw new AssertionError("Error: Should fail");
+ }
+}
diff --git a/jdk/test/sun/security/tools/jarsigner/EntriesOrder.java b/jdk/test/sun/security/tools/jarsigner/EntriesOrder.java
new file mode 100644
index 0000000..96c90e9
--- /dev/null
+++ b/jdk/test/sun/security/tools/jarsigner/EntriesOrder.java
@@ -0,0 +1,199 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * @test
+ * @bug 8031572
+ * @summary jarsigner -verify exits with 0 when a jar file is not properly signed
+ */
+
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+import java.security.cert.Certificate;
+import java.util.*;
+import java.util.jar.JarEntry;
+import java.util.jar.JarFile;
+import java.util.jar.JarInputStream;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipOutputStream;
+
+public class EntriesOrder {
+
+ public static void main(String[] args) throws Exception {
+
+ String[] entries = {
+ "META-INF/",
+ "META-INF/MANIFEST.MF",
+ "META-INF/A.RSA",
+ "META-INF/A.SF",
+ "META-INF/inf",
+ "a"};
+
+ Map<String,byte[]> content = new HashMap<>();
+
+ // We will create a jar containing entries above. Try all permutations
+ // and confirm 1) When opened as a JarFile, we can always get 3 signed
+ // ones (MANIFEST, inf, a), and 2) When opened as a JarInputStream,
+ // when the order is correct (MANIFEST at beginning, followed by RSA/SF,
+ // directory ignored), we can get 2 signed ones (inf, a).
+
+ // Prepares raw files
+ Files.write(Paths.get("a"), "a".getBytes());
+ Files.createDirectory(Paths.get("META-INF/"));
+ Files.write(Paths.get("META-INF/inf"), "inf".getBytes());
+
+ // Pack, sign, and extract to get all files
+ sun.tools.jar.Main m =
+ new sun.tools.jar.Main(System.out, System.err, "jar");
+ if (!m.run("cvf a.jar a META-INF/inf".split(" "))) {
+ throw new Exception("jar creation failed");
+ }
+ sun.security.tools.keytool.Main.main(
+ ("-keystore jks -storepass changeit -keypass changeit -dname" +
+ " CN=A -alias a -genkeypair -keyalg rsa").split(" "));
+ sun.security.tools.jarsigner.Main.main(
+ "-keystore jks -storepass changeit a.jar a".split(" "));
+ m = new sun.tools.jar.Main(System.out, System.err, "jar");
+ if (!m.run("xvf a.jar".split(" "))) {
+ throw new Exception("jar extraction failed");
+ }
+
+ // Data
+ for (String s: entries) {
+ if (!s.endsWith("/")) {
+ content.put(s, Files.readAllBytes(Paths.get(s)));
+ }
+ }
+
+ // Test
+ for (List<String> perm: Permute(entries)) {
+
+ // Recreate a jar
+ try (ZipOutputStream zos
+ = new ZipOutputStream(new FileOutputStream("x.jar"))) {
+ for (String e: perm) {
+ zos.putNextEntry(new ZipEntry(e));
+ if (Paths.get(e).toFile().isDirectory()) continue;
+ zos.write(content.get(e));
+ }
+ }
+
+ // Open with JarFile, number of signed entries should be 3.
+ int cc = 0;
+ try (JarFile jf = new JarFile("x.jar")) {
+ Enumeration<JarEntry> jes = jf.entries();
+ while (jes.hasMoreElements()) {
+ JarEntry je = jes.nextElement();
+ sun.misc.IOUtils.readFully(jf.getInputStream(je), -1, true);
+ Certificate[] certs = je.getCertificates();
+ if (certs != null && certs.length > 0) {
+ cc++;
+ }
+ }
+ }
+
+ if (cc != 3) {
+ System.out.println(perm + " - jf - " + cc);
+ throw new Exception();
+ }
+
+ // Open with JarInputStream
+ int signed;
+
+ perm.remove("META-INF/");
+ if (perm.get(0).equals("META-INF/MANIFEST.MF") &&
+ perm.get(1).contains("/A.") &&
+ perm.get(2).contains("/A.")) {
+ signed = 2; // Good order
+ } else {
+ signed = 0; // Bad order. In this case, the number of signed
+ // entries is not documented. Just test impl.
+ }
+
+ cc = 0;
+ try (JarInputStream jis
+ = new JarInputStream(new FileInputStream("x.jar"))) {
+ while (true) {
+ JarEntry je = jis.getNextJarEntry();
+ if (je == null) break;
+ sun.misc.IOUtils.readFully(jis, -1, true);
+ Certificate[] certs = je.getCertificates();
+ if (certs != null && certs.length > 0) {
+ cc++;
+ }
+ }
+ }
+
+ if (cc != signed) {
+ System.out.println(perm + " - jis - " + cc + " " + signed);
+ throw new Exception();
+ }
+ }
+ }
+
+ // Helper method to return all permutations of an array. Each output can
+ // be altered without damaging the iteration process.
+ static Iterable<List<String>> Permute(String[] entries) {
+ return new Iterable<List<String>>() {
+
+ int s = entries.length;
+ long c = factorial(s) - 1; // number of permutations
+
+ private long factorial(int n) {
+ return (n == 1) ? 1: (n * factorial(n-1));
+ }
+
+ @Override
+ public Iterator<List<String>> iterator() {
+ return new Iterator<List<String>>() {
+ @Override
+ public boolean hasNext() {
+ return c >= 0;
+ }
+
+ @Override
+ public List<String> next() {
+ if (c < 0) return null;
+ List<String> result = new ArrayList<>(s);
+ LinkedList<String> source = new LinkedList<>(
+ Arrays.asList(entries));
+ // Treat c as a integer with different radixes at
+ // different digits, i.e. at digit 0, radix is s;
+ // at digit 1, radix is s-1. Thus a s-digit number
+ // is able to represent s! different values.
+ long n = c;
+ for (int i=s; i>=1; i--) {
+ int x = (int)(n % i);
+ result.add(source.remove(x));
+ n = n / i;
+ }
+ c--;
+ return result;
+ }
+ };
+ }
+ };
+ }
+}
diff --git a/langtools/.hgtags b/langtools/.hgtags
index 9238c86..faacf85 100644
--- a/langtools/.hgtags
+++ b/langtools/.hgtags
@@ -247,3 +247,4 @@
a345cf28faca8cc49a28241a0a197fd520d25beb jdk8-b123
436176151e85455e74cd1441a2ba96e791c56785 jdk8-b124
436176151e85455e74cd1441a2ba96e791c56785 jdk8-b125
+ba24b63043626003929927f091e8b84190f39261 jdk8-b126
diff --git a/langtools/THIRD_PARTY_README b/langtools/THIRD_PARTY_README
index ba48858..a93b35b 100644
--- a/langtools/THIRD_PARTY_README
+++ b/langtools/THIRD_PARTY_README
@@ -1400,7 +1400,7 @@
-------------------------------------------------------------------------------
%% This notice is provided with respect to Little CMS 2.4, which may be
-included with OpenJDK 8.
+included with JRE 8, JDK 8, and OpenJDK 8.
--- begin of LICENSE ---
diff --git a/nashorn/.hgtags b/nashorn/.hgtags
index f0a41e8..e6259e0 100644
--- a/nashorn/.hgtags
+++ b/nashorn/.hgtags
@@ -235,3 +235,4 @@
688f4167f92188482b0d80e315c72f726c6d5ff6 jdk8-b123
7346abe2ea03134e1aee3b3d0fccb047235bd221 jdk8-b124
7346abe2ea03134e1aee3b3d0fccb047235bd221 jdk8-b125
+095263db862da23fa04d57c7e93e553831132449 jdk8-b126
diff --git a/nashorn/THIRD_PARTY_README b/nashorn/THIRD_PARTY_README
index ba48858..a93b35b 100644
--- a/nashorn/THIRD_PARTY_README
+++ b/nashorn/THIRD_PARTY_README
@@ -1400,7 +1400,7 @@
-------------------------------------------------------------------------------
%% This notice is provided with respect to Little CMS 2.4, which may be
-included with OpenJDK 8.
+included with JRE 8, JDK 8, and OpenJDK 8.
--- begin of LICENSE ---