--- a/jdk/src/java.base/share/classes/com/sun/java/util/jar/pack/Package.java Thu Sep 08 21:11:54 2016 +0000
+++ b/jdk/src/java.base/share/classes/com/sun/java/util/jar/pack/Package.java Thu Sep 08 22:14:00 2016 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -476,7 +476,8 @@
} else if (localICs.isEmpty()) {
// It was a non-empty diff, but the local ICs were absent.
actualICs = null;
- changed = 0; // [] => null, no tuple change
+ // [] => null, no tuple change, but attribute deletion.
+ changed = -1;
} else {
// Non-trivial diff was transmitted.
actualICs = computeICdiff();
--- a/jdk/src/java.base/share/classes/com/sun/java/util/jar/pack/PackageReader.java Thu Sep 08 21:11:54 2016 +0000
+++ b/jdk/src/java.base/share/classes/com/sun/java/util/jar/pack/PackageReader.java Thu Sep 08 22:14:00 2016 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -1193,18 +1193,21 @@
cls.visitRefs(VRM_CLASSIC, cpRefs);
ArrayList<BootstrapMethodEntry> bsms = new ArrayList<>();
- /*
- * BootstrapMethod(BSMs) are added here before InnerClasses(ICs),
- * so as to ensure the order. Noting that the BSMs may be
- * removed if they are not found in the CP, after the ICs expansion.
- */
- cls.addAttribute(Package.attrBootstrapMethodsEmpty.canonicalInstance());
-
// flesh out the local constant pool
ConstantPool.completeReferencesIn(cpRefs, true, bsms);
+ // add the bsm and references as required
+ if (!bsms.isEmpty()) {
+ cls.addAttribute(Package.attrBootstrapMethodsEmpty.canonicalInstance());
+ cpRefs.add(Package.getRefString("BootstrapMethods"));
+ Collections.sort(bsms);
+ cls.setBootstrapMethods(bsms);
+ }
+
// Now that we know all our local class references,
// compute the InnerClasses attribute.
+ // An InnerClasses attribute usually gets added here,
+ // although it might already have been present.
int changed = cls.expandLocalICs();
if (changed != 0) {
@@ -1221,16 +1224,6 @@
ConstantPool.completeReferencesIn(cpRefs, true, bsms);
}
- // remove the attr previously set, otherwise add the bsm and
- // references as required
- if (bsms.isEmpty()) {
- cls.attributes.remove(Package.attrBootstrapMethodsEmpty.canonicalInstance());
- } else {
- cpRefs.add(Package.getRefString("BootstrapMethods"));
- Collections.sort(bsms);
- cls.setBootstrapMethods(bsms);
- }
-
// construct a local constant pool
int numDoubles = 0;
for (Entry e : cpRefs) {
--- a/jdk/src/java.base/share/classes/java/lang/ClassLoader.java Thu Sep 08 21:11:54 2016 +0000
+++ b/jdk/src/java.base/share/classes/java/lang/ClassLoader.java Thu Sep 08 22:14:00 2016 +0000
@@ -1167,17 +1167,7 @@
protected final Class<?> findSystemClass(String name)
throws ClassNotFoundException
{
- ClassLoader system = getSystemClassLoader();
- if (system == null) {
- if (!checkName(name))
- throw new ClassNotFoundException(name);
- Class<?> cls = findBootstrapClass(name);
- if (cls == null) {
- throw new ClassNotFoundException(name);
- }
- return cls;
- }
- return system.loadClass(name);
+ return getSystemClassLoader().loadClass(name);
}
/**
@@ -1437,11 +1427,7 @@
* @since 1.1
*/
public static URL getSystemResource(String name) {
- ClassLoader system = getSystemClassLoader();
- if (system == null) {
- return BootLoader.findResource(name);
- }
- return system.getResource(name);
+ return getSystemClassLoader().getResource(name);
}
/**
@@ -1464,17 +1450,13 @@
*
* @throws IOException
* If I/O errors occur
-
+ *
* @since 1.2
*/
public static Enumeration<URL> getSystemResources(String name)
throws IOException
{
- ClassLoader system = getSystemClassLoader();
- if (system == null) {
- return BootLoader.findResources(name);
- }
- return system.getResources(name);
+ return getSystemClassLoader().getResources(name);
}
/**
@@ -1631,8 +1613,7 @@
* this method during startup should take care not to cache the return
* value until the system is fully initialized.
*
- * @return The system <tt>ClassLoader</tt> for delegation, or
- * <tt>null</tt> if none
+ * @return The system <tt>ClassLoader</tt> for delegation
*
* @throws SecurityException
* If a security manager is present, and the caller's class loader
--- a/jdk/src/java.base/share/classes/java/lang/Runtime.java Thu Sep 08 21:11:54 2016 +0000
+++ b/jdk/src/java.base/share/classes/java/lang/Runtime.java Thu Sep 08 22:14:00 2016 +0000
@@ -733,6 +733,7 @@
* @deprecated
* This method was intended to control instruction tracing.
* It has been superseded by JVM-specific tracing mechanisms.
+ * This method is subject to removal in a future version of Java SE.
*
* @param on ignored
*/
@@ -745,6 +746,7 @@
* @deprecated
* This method was intended to control method call tracing.
* It has been superseded by JVM-specific tracing mechanisms.
+ * This method is subject to removal in a future version of Java SE.
*
* @param on ignored
*/
--- a/jdk/src/java.base/share/classes/java/lang/RuntimePermission.java Thu Sep 08 21:11:54 2016 +0000
+++ b/jdk/src/java.base/share/classes/java/lang/RuntimePermission.java Thu Sep 08 22:14:00 2016 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -323,11 +323,9 @@
* <td>usePolicy</td>
* <td>Granting this permission disables the Java Plug-In's default
* security prompting behavior.</td>
- * <td>For more information, refer to Java Plug-In's guides, <a href=
- * "../../../technotes/guides/plugin/developer_guide/security.html">
- * Applet Security Basics</a> and <a href=
- * "../../../technotes/guides/plugin/developer_guide/rsa_how.html#use">
- * usePolicy Permission</a>.</td>
+ * <td>For more information, refer to the <a href=
+ * "../../../technotes/guides/deploy/index.html">deployment guide</a>.
+ * </td>
* </tr>
* <tr>
* <td>manageProcess</td>
--- a/jdk/src/java.base/share/classes/java/security/DigestInputStream.java Thu Sep 08 21:11:54 2016 +0000
+++ b/jdk/src/java.base/share/classes/java/security/DigestInputStream.java Thu Sep 08 22:14:00 2016 +0000
@@ -52,7 +52,7 @@
* {@link MessageDigest}),
* so that in order to compute intermediate digests, a caller should
* retain a handle onto the digest object, and clone it for each
- * digest to be computed, leaving the orginal digest untouched.
+ * digest to be computed, leaving the original digest untouched.
*
* @see MessageDigest
*
--- a/jdk/src/java.base/share/classes/java/security/KeyPairGenerator.java Thu Sep 08 21:11:54 2016 +0000
+++ b/jdk/src/java.base/share/classes/java/security/KeyPairGenerator.java Thu Sep 08 22:14:00 2016 +0000
@@ -76,7 +76,7 @@
* {@code g} parameters. If the modulus size is not one of the above
* values, the <i>Sun</i> provider creates a new set of parameters. Other
* providers might have precomputed parameter sets for more than just the
- * three modulus sizes mentioned above. Still others might not have a list of
+ * modulus sizes mentioned above. Still others might not have a list of
* precomputed parameters at all and instead always create new parameter sets.
*
* <li><b>Algorithm-Specific Initialization</b>
@@ -393,7 +393,7 @@
* of randomness.
* (If none of the installed providers supply an implementation of
* {@code SecureRandom}, a system-provided source of randomness is
- * used.).
+ * used.)
*
* <p>This concrete method has been added to this previously-defined
* abstract class.
--- a/jdk/src/java.base/share/classes/java/security/SignatureSpi.java Thu Sep 08 21:11:54 2016 +0000
+++ b/jdk/src/java.base/share/classes/java/security/SignatureSpi.java Thu Sep 08 22:14:00 2016 +0000
@@ -38,7 +38,7 @@
* for the {@code Signature} class, which is used to provide the
* functionality of a digital signature algorithm. Digital signatures are used
* for authentication and integrity assurance of digital data.
- *.
+ *
* <p> All the abstract methods in this class must be implemented by each
* cryptographic service provider who wishes to supply the implementation
* of a particular signature algorithm.
--- a/jdk/src/java.base/share/classes/java/util/ImmutableCollections.java Thu Sep 08 21:11:54 2016 +0000
+++ b/jdk/src/java.base/share/classes/java/util/ImmutableCollections.java Thu Sep 08 22:14:00 2016 +0000
@@ -31,6 +31,10 @@
import java.io.ObjectOutputStream;
import java.io.ObjectStreamException;
import java.io.Serializable;
+import java.util.function.BiFunction;
+import java.util.function.Function;
+import java.util.function.Predicate;
+import java.util.function.UnaryOperator;
/**
* Container class for immutable collections. Not part of the public API.
@@ -61,9 +65,25 @@
*/
static final double EXPAND_FACTOR = 2.0;
+ static UnsupportedOperationException uoe() { return new UnsupportedOperationException(); }
+
// ---------- List Implementations ----------
- static final class List0<E> extends AbstractList<E> implements RandomAccess, Serializable {
+ abstract static class AbstractImmutableList<E> extends AbstractList<E>
+ implements RandomAccess, Serializable {
+ @Override public boolean add(E e) { throw uoe(); }
+ @Override public boolean addAll(Collection<? extends E> c) { throw uoe(); }
+ @Override public boolean addAll(int index, Collection<? extends E> c) { throw uoe(); }
+ @Override public void clear() { throw uoe(); }
+ @Override public boolean remove(Object o) { throw uoe(); }
+ @Override public boolean removeAll(Collection<?> c) { throw uoe(); }
+ @Override public boolean removeIf(Predicate<? super E> filter) { throw uoe(); }
+ @Override public void replaceAll(UnaryOperator<E> operator) { throw uoe(); }
+ @Override public boolean retainAll(Collection<?> c) { throw uoe(); }
+ @Override public void sort(Comparator<? super E> c) { throw uoe(); }
+ }
+
+ static final class List0<E> extends AbstractImmutableList<E> {
List0() { }
@Override
@@ -86,7 +106,7 @@
}
}
- static final class List1<E> extends AbstractList<E> implements RandomAccess, Serializable {
+ static final class List1<E> extends AbstractImmutableList<E> {
private final E e0;
List1(E e0) {
@@ -114,7 +134,7 @@
}
}
- static final class List2<E> extends AbstractList<E> implements RandomAccess, Serializable {
+ static final class List2<E> extends AbstractImmutableList<E> {
private final E e0;
private final E e1;
@@ -147,7 +167,7 @@
}
}
- static final class ListN<E> extends AbstractList<E> implements RandomAccess, Serializable {
+ static final class ListN<E> extends AbstractImmutableList<E> {
private final E[] elements;
@SafeVarargs
@@ -183,7 +203,17 @@
// ---------- Set Implementations ----------
- static final class Set0<E> extends AbstractSet<E> implements Serializable {
+ abstract static class AbstractImmutableSet<E> extends AbstractSet<E> implements Serializable {
+ @Override public boolean add(E e) { throw uoe(); }
+ @Override public boolean addAll(Collection<? extends E> c) { throw uoe(); }
+ @Override public void clear() { throw uoe(); }
+ @Override public boolean remove(Object o) { throw uoe(); }
+ @Override public boolean removeAll(Collection<?> c) { throw uoe(); }
+ @Override public boolean removeIf(Predicate<? super E> filter) { throw uoe(); }
+ @Override public boolean retainAll(Collection<?> c) { throw uoe(); }
+ }
+
+ static final class Set0<E> extends AbstractImmutableSet<E> {
Set0() { }
@Override
@@ -210,7 +240,7 @@
}
}
- static final class Set1<E> extends AbstractSet<E> implements Serializable {
+ static final class Set1<E> extends AbstractImmutableSet<E> {
private final E e0;
Set1(E e0) {
@@ -241,7 +271,7 @@
}
}
- static final class Set2<E> extends AbstractSet<E> implements Serializable {
+ static final class Set2<E> extends AbstractImmutableSet<E> {
private final E e0;
private final E e1;
@@ -312,7 +342,7 @@
* least one null is always present.
* @param <E> the element type
*/
- static final class SetN<E> extends AbstractSet<E> implements Serializable {
+ static final class SetN<E> extends AbstractImmutableSet<E> {
private final E[] elements;
private final int size;
@@ -403,7 +433,23 @@
// ---------- Map Implementations ----------
- static final class Map0<K,V> extends AbstractMap<K,V> implements Serializable {
+ abstract static class AbstractImmutableMap<K,V> extends AbstractMap<K,V> implements Serializable {
+ @Override public void clear() { throw uoe(); }
+ @Override public V compute(K key, BiFunction<? super K,? super V,? extends V> rf) { throw uoe(); }
+ @Override public V computeIfAbsent(K key, Function<? super K,? extends V> mf) { throw uoe(); }
+ @Override public V computeIfPresent(K key, BiFunction<? super K,? super V,? extends V> rf) { throw uoe(); }
+ @Override public V merge(K key, V value, BiFunction<? super V,? super V,? extends V> rf) { throw uoe(); }
+ @Override public V put(K key, V value) { throw uoe(); }
+ @Override public void putAll(Map<? extends K,? extends V> m) { throw uoe(); }
+ @Override public V putIfAbsent(K key, V value) { throw uoe(); }
+ @Override public V remove(Object key) { throw uoe(); }
+ @Override public boolean remove(Object key, Object value) { throw uoe(); }
+ @Override public V replace(K key, V value) { throw uoe(); }
+ @Override public boolean replace(K key, V oldValue, V newValue) { throw uoe(); }
+ @Override public void replaceAll(BiFunction<? super K,? super V,? extends V> f) { throw uoe(); }
+ }
+
+ static final class Map0<K,V> extends AbstractImmutableMap<K,V> {
Map0() { }
@Override
@@ -430,7 +476,7 @@
}
}
- static final class Map1<K,V> extends AbstractMap<K,V> implements Serializable {
+ static final class Map1<K,V> extends AbstractImmutableMap<K,V> {
private final K k0;
private final V v0;
@@ -472,7 +518,7 @@
* @param <K> the key type
* @param <V> the value type
*/
- static final class MapN<K,V> extends AbstractMap<K,V> implements Serializable {
+ static final class MapN<K,V> extends AbstractImmutableMap<K,V> {
private final Object[] table; // pairs of key, value
private final int size; // number of pairs
--- a/jdk/src/java.base/share/classes/java/util/List.java Thu Sep 08 21:11:54 2016 +0000
+++ b/jdk/src/java.base/share/classes/java/util/List.java Thu Sep 08 22:14:00 2016 +0000
@@ -94,7 +94,8 @@
*
* <ul>
* <li>They are <em>structurally immutable</em>. Elements cannot be added, removed,
- * or replaced. Attempts to do so result in {@code UnsupportedOperationException}.
+ * or replaced. Calling any mutator method will always cause
+ * {@code UnsupportedOperationException} to be thrown.
* However, if the contained elements are themselves mutable,
* this may cause the List's contents to appear to change.
* <li>They disallow {@code null} elements. Attempts to create them with
--- a/jdk/src/java.base/share/classes/java/util/Map.java Thu Sep 08 21:11:54 2016 +0000
+++ b/jdk/src/java.base/share/classes/java/util/Map.java Thu Sep 08 22:14:00 2016 +0000
@@ -119,7 +119,8 @@
*
* <ul>
* <li>They are <em>structurally immutable</em>. Keys and values cannot be added,
- * removed, or updated. Attempts to do so result in {@code UnsupportedOperationException}.
+ * removed, or updated. Calling any mutator method will always cause
+ * {@code UnsupportedOperationException} to be thrown.
* However, if the contained keys or values are themselves mutable, this may cause the
* Map to behave inconsistently or its contents to appear to change.
* <li>They disallow {@code null} keys and values. Attempts to create them with
--- a/jdk/src/java.base/share/classes/java/util/Set.java Thu Sep 08 21:11:54 2016 +0000
+++ b/jdk/src/java.base/share/classes/java/util/Set.java Thu Sep 08 22:14:00 2016 +0000
@@ -70,7 +70,8 @@
*
* <ul>
* <li>They are <em>structurally immutable</em>. Elements cannot be added or
- * removed. Attempts to do so result in {@code UnsupportedOperationException}.
+ * removed. Calling any mutator method will always cause
+ * {@code UnsupportedOperationException} to be thrown.
* However, if the contained elements are themselves mutable, this may cause the
* Set to behave inconsistently or its contents to appear to change.
* <li>They disallow {@code null} elements. Attempts to create them with
--- a/jdk/src/java.base/share/classes/jdk/internal/org/objectweb/asm/commons/SerialVersionUIDAdder.java Thu Sep 08 21:11:54 2016 +0000
+++ b/jdk/src/java.base/share/classes/jdk/internal/org/objectweb/asm/commons/SerialVersionUIDAdder.java Thu Sep 08 22:14:00 2016 +0000
@@ -80,7 +80,7 @@
* ClassWriter cw = new ClassWriter(...);
* ClassVisitor sv = new SerialVersionUIDAdder(cw);
* ClassVisitor ca = new MyClassAdapter(sv);
- * new ClassReader(orginalClass).accept(ca, false);
+ * new ClassReader(originalClass).accept(ca, false);
* </pre>
*
* The SVUID algorithm can be found <a href=
--- a/jdk/src/java.base/share/classes/sun/security/ssl/ClientHandshaker.java Thu Sep 08 21:11:54 2016 +0000
+++ b/jdk/src/java.base/share/classes/sun/security/ssl/ClientHandshaker.java Thu Sep 08 22:14:00 2016 +0000
@@ -1185,7 +1185,7 @@
/*
* FOURTH, if we sent a Certificate, we need to send a signed
* CertificateVerify (unless the key in the client's certificate
- * was a Diffie-Hellman key).).
+ * was a Diffie-Hellman key).
*
* This uses a hash of the previous handshake messages ... either
* a nonfinal one (if the particular implementation supports it)
--- a/jdk/src/java.desktop/share/classes/com/sun/media/sound/DLSInfo.java Thu Sep 08 21:11:54 2016 +0000
+++ b/jdk/src/java.desktop/share/classes/com/sun/media/sound/DLSInfo.java Thu Sep 08 22:14:00 2016 +0000
@@ -95,7 +95,7 @@
public String subject = null;
/**
* (ISRC) Name of person or orginization who supplied
- * orginal material for the file.
+ * original material for the file.
*/
public String source = null;
/**
--- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/builder/DefaultImageBuilder.java Thu Sep 08 21:11:54 2016 +0000
+++ b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/builder/DefaultImageBuilder.java Thu Sep 08 22:14:00 2016 +0000
@@ -189,12 +189,12 @@
storeFiles(modules, release);
if (Files.getFileStore(root).supportsFileAttributeView(PosixFileAttributeView.class)) {
- // launchers in the bin directory need execute permission
+ // launchers in the bin directory need execute permission.
+ // On Windows, "bin" also subdirectories containing jvm.dll.
if (Files.isDirectory(bin)) {
- Files.list(bin)
- .filter(f -> !f.toString().endsWith(".diz"))
- .filter(f -> Files.isRegularFile(f))
- .forEach(this::setExecutable);
+ Files.find(bin, 2, (path, attrs) -> {
+ return attrs.isRegularFile() && !path.toString().endsWith(".diz");
+ }).forEach(this::setExecutable);
}
// jspawnhelper is in lib or lib/<arch>
--- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/ExcludeVMPlugin.java Thu Sep 08 21:11:54 2016 +0000
+++ b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/ExcludeVMPlugin.java Thu Sep 08 22:14:00 2016 +0000
@@ -103,7 +103,9 @@
List<ResourcePoolEntry> ret = javaBase.entries().filter((t) -> {
String path = t.path();
for (String jvmlib : jvmlibs) {
- return t.path().endsWith("/" + jvmlib);
+ if (t.path().endsWith("/" + jvmlib)) {
+ return true;
+ }
}
return false;
}).collect(Collectors.toList());
--- a/jdk/test/ProblemList.txt Thu Sep 08 21:11:54 2016 +0000
+++ b/jdk/test/ProblemList.txt Thu Sep 08 22:14:00 2016 +0000
@@ -310,8 +310,6 @@
tools/pack200/CommandLineTests.java 7143279,8059906 generic-all
-tools/pack200/Pack200Test.java 8059906,8151901 generic-all
-
tools/launcher/FXLauncherTest.java 8068049 linux-all,macosx-all
tools/pack200/Pack200Props.java 8155857 generic-all
--- a/jdk/test/java/net/SetFactoryPermission/SetFactoryPermission.java Thu Sep 08 21:11:54 2016 +0000
+++ b/jdk/test/java/net/SetFactoryPermission/SetFactoryPermission.java Thu Sep 08 22:14:00 2016 +0000
@@ -27,7 +27,7 @@
* @bug 8048052
* @summary Test a series of methods which requires "setFactory" runtime permission
* @modules java.rmi
- * @run main SetFactoryPermission success
+ * @run main/othervm SetFactoryPermission success
* @run main/othervm/policy=policy.fail SetFactoryPermission fail
* @run main/othervm/policy=policy.success SetFactoryPermission success
*/
--- a/jdk/test/java/time/TEST.properties Thu Sep 08 21:11:54 2016 +0000
+++ b/jdk/test/java/time/TEST.properties Thu Sep 08 22:14:00 2016 +0000
@@ -1,4 +1,6 @@
# Threeten test uses TestNG
TestNG.dirs = .
othervm.dirs = tck/java/time/chrono test/java/time/chrono test/java/time/format
+modules = jdk.localedata
lib.dirs = ../../lib/testlibrary
+lib.build = jdk.testlibrary.RandomFactory
--- a/jdk/test/java/util/Calendar/Bug4302966.java Thu Sep 08 21:11:54 2016 +0000
+++ b/jdk/test/java/util/Calendar/Bug4302966.java Thu Sep 08 22:14:00 2016 +0000
@@ -24,6 +24,7 @@
/*
* @test
* @bug 4302966
+ * @modules jdk.localedata
* @summary In Czech Republic first day of week is Monday not Sunday
*/
--- a/jdk/test/java/util/Collection/MOAT.java Thu Sep 08 21:11:54 2016 +0000
+++ b/jdk/test/java/util/Collection/MOAT.java Thu Sep 08 22:14:00 2016 +0000
@@ -112,7 +112,6 @@
testCollection(Arrays.asList(1,2,3));
testCollection(nCopies(25,1));
testImmutableList(nCopies(25,1));
- testImmutableList(unmodifiableList(Arrays.asList(1,2,3)));
testMap(new HashMap<Integer,Integer>());
testMap(new LinkedHashMap<Integer,Integer>());
@@ -134,6 +133,20 @@
testMap(Collections.synchronizedSortedMap(new TreeMap<Integer,Integer>()));
testMap(Collections.synchronizedNavigableMap(new TreeMap<Integer,Integer>()));
+ // Unmodifiable wrappers
+ testImmutableSet(unmodifiableSet(new HashSet<>(Arrays.asList(1,2,3))));
+ testImmutableList(unmodifiableList(Arrays.asList(1,2,3)));
+ testImmutableMap(unmodifiableMap(Collections.singletonMap(1,2)));
+ testCollMutatorsAlwaysThrow(unmodifiableSet(new HashSet<>(Arrays.asList(1,2,3))));
+ testCollMutatorsAlwaysThrow(unmodifiableSet(Collections.emptySet()));
+ testEmptyCollMutatorsAlwaysThrow(unmodifiableSet(Collections.emptySet()));
+ testListMutatorsAlwaysThrow(unmodifiableList(Arrays.asList(1,2,3)));
+ testListMutatorsAlwaysThrow(unmodifiableList(Collections.emptyList()));
+ testEmptyListMutatorsAlwaysThrow(unmodifiableList(Collections.emptyList()));
+ testMapMutatorsAlwaysThrow(unmodifiableMap(Collections.singletonMap(1,2)));
+ testMapMutatorsAlwaysThrow(unmodifiableMap(Collections.emptyMap()));
+ testEmptyMapMutatorsAlwaysThrow(unmodifiableMap(Collections.emptyMap()));
+
// Empty collections
final List<Integer> emptyArray = Arrays.asList(new Integer[]{});
testCollection(emptyArray);
@@ -196,6 +209,8 @@
// Immutable List
testEmptyList(List.of());
+ testListMutatorsAlwaysThrow(List.of());
+ testEmptyListMutatorsAlwaysThrow(List.of());
for (List<Integer> list : Arrays.asList(
List.<Integer>of(),
List.of(1),
@@ -211,10 +226,13 @@
List.of(integerArray))) {
testCollection(list);
testImmutableList(list);
+ testListMutatorsAlwaysThrow(list);
}
// Immutable Set
testEmptySet(Set.of());
+ testCollMutatorsAlwaysThrow(Set.of());
+ testEmptyCollMutatorsAlwaysThrow(Set.of());
for (Set<Integer> set : Arrays.asList(
Set.<Integer>of(),
Set.of(1),
@@ -230,6 +248,7 @@
Set.of(integerArray))) {
testCollection(set);
testImmutableSet(set);
+ testCollMutatorsAlwaysThrow(set);
}
// Immutable Map
@@ -241,6 +260,8 @@
}
testEmptyMap(Map.of());
+ testMapMutatorsAlwaysThrow(Map.of());
+ testEmptyMapMutatorsAlwaysThrow(Map.of());
for (Map<Integer,Integer> map : Arrays.asList(
Map.<Integer,Integer>of(),
Map.of(1, 101),
@@ -256,6 +277,7 @@
Map.ofEntries(ea))) {
testMap(map);
testImmutableMap(map);
+ testMapMutatorsAlwaysThrow(map);
}
}
@@ -358,6 +380,93 @@
it.remove(); });
}
+ /**
+ * Test that calling a mutator always throws UOE, even if the mutator
+ * wouldn't actually do anything, given its arguments.
+ *
+ * @param c the collection instance to test
+ */
+ private static void testCollMutatorsAlwaysThrow(Collection<Integer> c) {
+ THROWS(UnsupportedOperationException.class,
+ () -> c.addAll(Collections.emptyList()),
+ () -> c.remove(ABSENT_VALUE),
+ () -> c.removeAll(Collections.emptyList()),
+ () -> c.removeIf(x -> false),
+ () -> c.retainAll(c));
+ }
+
+ /**
+ * Test that calling a mutator always throws UOE, even if the mutator
+ * wouldn't actually do anything on an empty collection.
+ *
+ * @param c the collection instance to test, must be empty
+ */
+ private static void testEmptyCollMutatorsAlwaysThrow(Collection<Integer> c) {
+ if (! c.isEmpty()) {
+ fail("collection is not empty");
+ }
+ THROWS(UnsupportedOperationException.class,
+ () -> c.clear());
+ }
+
+ /**
+ * As above, for a list.
+ *
+ * @param c the list instance to test
+ */
+ private static void testListMutatorsAlwaysThrow(List<Integer> c) {
+ testCollMutatorsAlwaysThrow(c);
+ THROWS(UnsupportedOperationException.class,
+ () -> c.addAll(0, Collections.emptyList()));
+ }
+
+ /**
+ * As above, for an empty list.
+ *
+ * @param c the list instance to test, must be empty
+ */
+ private static void testEmptyListMutatorsAlwaysThrow(List<Integer> c) {
+ if (! c.isEmpty()) {
+ fail("list is not empty");
+ }
+ testEmptyCollMutatorsAlwaysThrow(c);
+ THROWS(UnsupportedOperationException.class,
+ () -> c.replaceAll(x -> x),
+ () -> c.sort(null));
+ }
+
+ /**
+ * As above, for a map.
+ *
+ * @param m the map instance to test
+ */
+ private static void testMapMutatorsAlwaysThrow(Map<Integer,Integer> m) {
+ THROWS(UnsupportedOperationException.class,
+ () -> m.compute(ABSENT_VALUE, (k, v) -> null),
+ () -> m.computeIfAbsent(ABSENT_VALUE, k -> null),
+ () -> m.computeIfPresent(ABSENT_VALUE, (k, v) -> null),
+ () -> m.merge(ABSENT_VALUE, 0, (k, v) -> null),
+ () -> m.putAll(Collections.emptyMap()),
+ () -> m.remove(ABSENT_VALUE),
+ () -> m.remove(ABSENT_VALUE, 0),
+ () -> m.replace(ABSENT_VALUE, 0),
+ () -> m.replace(ABSENT_VALUE, 0, 1));
+ }
+
+ /**
+ * As above, for an empty map.
+ *
+ * @param map the map instance to test, must be empty
+ */
+ private static void testEmptyMapMutatorsAlwaysThrow(Map<Integer,Integer> m) {
+ if (! m.isEmpty()) {
+ fail("map is not empty");
+ }
+ THROWS(UnsupportedOperationException.class,
+ () -> m.clear(),
+ () -> m.replaceAll((k, v) -> v));
+ }
+
private static void clear(Collection<Integer> c) {
try { c.clear(); }
catch (Throwable t) { unexpected(t); }
--- a/jdk/test/java/util/Date/Bug8135055.java Thu Sep 08 21:11:54 2016 +0000
+++ b/jdk/test/java/util/Date/Bug8135055.java Thu Sep 08 22:14:00 2016 +0000
@@ -24,6 +24,7 @@
/*
* @test
* @bug 8135055
+ * @modules java.sql
* @summary Test java.sql.TimeStamp instance should come after java.util.Date
* if Nanos component of TimeStamp is not equal to 0 milliseconds.
*/
--- a/jdk/test/java/util/Formatter/FormatLocale.java Thu Sep 08 21:11:54 2016 +0000
+++ b/jdk/test/java/util/Formatter/FormatLocale.java Thu Sep 08 22:14:00 2016 +0000
@@ -24,6 +24,7 @@
/**
* @test
* @bug 8146156 8159548
+ * @modules jdk.localedata
* @summary test whether uppercasing follows Locale.Category.FORMAT locale.
* @run main/othervm FormatLocale
*/
--- a/jdk/test/java/util/ResourceBundle/modules/security/TestPermission.java Thu Sep 08 21:11:54 2016 +0000
+++ b/jdk/test/java/util/ResourceBundle/modules/security/TestPermission.java Thu Sep 08 22:14:00 2016 +0000
@@ -69,6 +69,7 @@
@Test
public void runTest() throws Exception {
int exitValue = executeTestJava("--module-path", MODS_DIR.toString(),
+ "--add-modules", "m1",
"-m", "test/jdk.test.Main")
.outputTo(System.out)
.errorTo(System.out)
--- a/jdk/test/java/util/ServiceLoader/modules/ServicesTest.java Thu Sep 08 21:11:54 2016 +0000
+++ b/jdk/test/java/util/ServiceLoader/modules/ServicesTest.java Thu Sep 08 22:14:00 2016 +0000
@@ -42,7 +42,7 @@
* @test
* @library /lib/testlibrary
* @modules java.scripting
- jdk.compiler
+ * jdk.compiler
* @build ServicesTest CompilerUtils jdk.testlibrary.*
* @run testng ServicesTest
* @summary Tests ServiceLoader to locate service providers on the module path
@@ -112,6 +112,7 @@
public void runWithModulePath() throws Exception {
int exitValue
= executeTestJava("--module-path", MODS_DIR.toString(),
+ "--add-modules", "bananascript",
"-m", "test/test.Main",
"BananaScriptEngine")
.outputTo(System.out)
@@ -131,6 +132,7 @@
int exitValue
= executeTestJava("--module-path", MODS_DIR.toString(),
"-cp", CLASSES_DIR.toString(),
+ "--add-modules", "bananascript",
"-m", "test/test.Main",
"BananaScriptEngine", "PearScriptEngine")
.outputTo(System.out)
--- a/jdk/test/java/util/TimeZone/HongKong.java Thu Sep 08 21:11:54 2016 +0000
+++ b/jdk/test/java/util/TimeZone/HongKong.java Thu Sep 08 22:14:00 2016 +0000
@@ -24,6 +24,7 @@
/*
* @test
* @bug 4487276 8008577
+ * @modules jdk.localedata
* @summary Verify that Hong Kong locale uses traditional Chinese names.
* @run main/othervm -Djava.locale.providers=COMPAT,SPI HongKong
*/
--- a/jdk/test/java/util/logging/modules/GetResourceBundleTest.java Thu Sep 08 21:11:54 2016 +0000
+++ b/jdk/test/java/util/logging/modules/GetResourceBundleTest.java Thu Sep 08 22:14:00 2016 +0000
@@ -37,6 +37,7 @@
* @bug 8129126 8136802 8137316 8137317 8136804 8139350
* @library /lib/testlibrary
* @modules jdk.compiler
+ * java.logging
* @build GetResourceBundleTest CompilerUtils jdk.testlibrary.ProcessTools
* @run testng GetResourceBundleTest
* @summary Tests Logger.getLogger + logger.getResourceBundle in an named/unnamed module,
--- a/jdk/test/sun/util/locale/provider/Bug8038436.java Thu Sep 08 21:11:54 2016 +0000
+++ b/jdk/test/sun/util/locale/provider/Bug8038436.java Thu Sep 08 22:14:00 2016 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2016 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 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
@@ -27,15 +27,25 @@
* @summary Test for changes in 8038436
* @modules java.base/sun.util.locale.provider
* java.base/sun.util.spi
+ * jdk.localedata
* @compile -XDignore.symbol.file Bug8038436.java
* @run main/othervm --limit-modules java.base Bug8038436 security
* @run main/othervm -Djava.locale.providers=COMPAT Bug8038436 availlocs
*/
-import java.security.*;
-import java.util.*;
-import java.util.stream.*;
-import sun.util.locale.provider.*;
+import java.security.CodeSource;
+import java.security.Permission;
+import java.security.PermissionCollection;
+import java.security.Permissions;
+import java.security.Policy;
+import java.security.ProtectionDomain;
+import java.util.Arrays;
+import java.util.Formatter;
+import java.util.GregorianCalendar;
+import java.util.List;
+import java.util.Locale;
+import java.util.stream.Collectors;
+import sun.util.locale.provider.LocaleProviderAdapter;
public class Bug8038436 {
public static void main(String[] args) {
--- a/jdk/test/sun/util/locale/provider/Bug8152817.java Thu Sep 08 21:11:54 2016 +0000
+++ b/jdk/test/sun/util/locale/provider/Bug8152817.java Thu Sep 08 22:14:00 2016 +0000
@@ -28,6 +28,7 @@
* @bug 8152817
* @summary Make sure that resource bundles in the jdk.localedata module are
* loaded under a security manager.
+ * @modules jdk.localedata
* @run main/othervm -Djava.locale.providers=COMPAT
* -Djava.security.debug=access,failure,codebase=jrt:/jdk.localedata Bug8152817
*/
--- a/jdk/test/sun/util/resources/Calendar/Bug4518811.java Thu Sep 08 21:11:54 2016 +0000
+++ b/jdk/test/sun/util/resources/Calendar/Bug4518811.java Thu Sep 08 22:14:00 2016 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 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
@@ -22,9 +22,10 @@
*/
/*
- *@test
- *@bug 4518811
- *@summary Verifies the minimum days of the week for euro locales
+ * @test
+ * @bug 4518811
+ * @modules jdk.localedata
+ * @summary Verifies the minimum days of the week for euro locales
*/
// this code is a bit brute-force, but I've been coding in nothing but Shell for the last year, so I'm rusty.
--- a/jdk/test/sun/util/resources/Calendar/Bug4527203.java Thu Sep 08 21:11:54 2016 +0000
+++ b/jdk/test/sun/util/resources/Calendar/Bug4527203.java Thu Sep 08 22:14:00 2016 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 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
@@ -24,6 +24,7 @@
/*
* @test 1.1 11/02/01
* @bug 4527203
+ * @modules jdk.localedata
* @summary In Hungary and Ukraine first day of week is Monday not Sunday
*/
--- a/jdk/test/sun/util/resources/Locale/Bug4429024.java Thu Sep 08 21:11:54 2016 +0000
+++ b/jdk/test/sun/util/resources/Locale/Bug4429024.java Thu Sep 08 22:14:00 2016 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 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
@@ -20,12 +20,13 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
-/**
- @test
- @summary checking localised language/country names in finnish
- @bug 4429024 4964035 6558856 8008577
- @run main/othervm -Djava.locale.providers=JRE,SPI Bug4429024
-*/
+/*
+ * @test
+ * @summary checking localised language/country names in finnish
+ * @modules jdk.localedata
+ * @bug 4429024 4964035 6558856 8008577
+ * @run main/othervm -Djava.locale.providers=JRE,SPI Bug4429024
+ */
import java.util.Locale;
--- a/jdk/test/sun/util/resources/Locale/Bug4965260.java Thu Sep 08 21:11:54 2016 +0000
+++ b/jdk/test/sun/util/resources/Locale/Bug4965260.java Thu Sep 08 22:14:00 2016 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 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
@@ -20,11 +20,12 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
-/**
- *@test
- *@bug 4965260 8008577
- *@summary Verifies the language name of "nl" for supported locales
- *@run main/othervm -Djava.locale.providers=JRE,SPI Bug4965260
+/*
+ * @test
+ * @bug 4965260 8008577
+ * @modules jdk.localedata
+ * @summary Verifies the language name of "nl" for supported locales
+ * @run main/othervm -Djava.locale.providers=JRE,SPI Bug4965260
*/
import java.util.Locale;
--- a/jdk/test/sun/util/resources/Locale/Bug6275682.java Thu Sep 08 21:11:54 2016 +0000
+++ b/jdk/test/sun/util/resources/Locale/Bug6275682.java Thu Sep 08 22:14:00 2016 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 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
@@ -21,10 +21,11 @@
* questions.
*/
-/**
- @test
- @summary Verifying that the language names starts with lowercase in spanish
- @bug 6275682
+/*
+ * @test
+ * @summary Verifying that the language names starts with lowercase in spanish
+ * @modules jdk.localedata
+ * @bug 6275682
*/
import java.util.Locale;
--- a/jdk/test/sun/util/resources/TimeZone/Bug4938846.java Thu Sep 08 21:11:54 2016 +0000
+++ b/jdk/test/sun/util/resources/TimeZone/Bug4938846.java Thu Sep 08 22:14:00 2016 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 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
@@ -22,10 +22,11 @@
*/
/*
- *@test
- *@bug 4938846 8008577
- *@summary Test case for en_IE TimeZone info
- *@run main/othervm -Djava.locale.providers=JRE,SPI Bug4938846
+ * @test
+ * @bug 4938846 8008577
+ * @modules jdk.localedata
+ * @summary Test case for en_IE TimeZone info
+ * @run main/othervm -Djava.locale.providers=JRE,SPI Bug4938846
*/
import java.util.Locale;
--- a/jdk/test/sun/util/resources/TimeZone/Bug6271396.java Thu Sep 08 21:11:54 2016 +0000
+++ b/jdk/test/sun/util/resources/TimeZone/Bug6271396.java Thu Sep 08 22:14:00 2016 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 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
@@ -22,10 +22,11 @@
*/
/*
- *@test
- *@bug 6271396 8008577
- *@summary Test case for verifying typo of timezone display name Australia/Lord_Howe
- *@run main/othervm -Djava.locale.providers=JRE,SPI Bug6271396
+ * @test
+ * @bug 6271396 8008577
+ * @modules jdk.localedata
+ * @summary Test case for verifying typo of timezone display name Australia/Lord_Howe
+ * @run main/othervm -Djava.locale.providers=JRE,SPI Bug6271396
*/
import java.util.Locale;
--- a/jdk/test/sun/util/resources/TimeZone/Bug6317929.java Thu Sep 08 21:11:54 2016 +0000
+++ b/jdk/test/sun/util/resources/TimeZone/Bug6317929.java Thu Sep 08 22:14:00 2016 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 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
@@ -22,10 +22,11 @@
*/
/*
- *@test
- *@bug 6317929 6409419 8008577
- *@summary Test case for tzdata2005m support for 9 locales
- *@run main/othervm -Djava.locale.providers=JRE,SPI Bug6317929
+ * @test
+ * @bug 6317929 6409419 8008577
+ * @modules jdk.localedata
+ * @summary Test case for tzdata2005m support for 9 locales
+ * @run main/othervm -Djava.locale.providers=JRE,SPI Bug6317929
*/
import java.util.Locale;
--- a/jdk/test/sun/util/resources/TimeZone/Bug6377794.java Thu Sep 08 21:11:54 2016 +0000
+++ b/jdk/test/sun/util/resources/TimeZone/Bug6377794.java Thu Sep 08 22:14:00 2016 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 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
@@ -22,10 +22,11 @@
*/
/*
- *@test
- *@bug 6377794
- *@summary Test case for tzdata2005r support for 9 locales
- *@run main/othervm -Djava.locale.providers=JRE,SPI Bug6377794
+ * @test
+ * @bug 6377794
+ * @modules jdk.localedata
+ * @summary Test case for tzdata2005r support for 9 locales
+ * @run main/othervm -Djava.locale.providers=JRE,SPI Bug6377794
*/
import java.util.Locale;
--- a/jdk/test/sun/util/resources/TimeZone/Bug6442006.java Thu Sep 08 21:11:54 2016 +0000
+++ b/jdk/test/sun/util/resources/TimeZone/Bug6442006.java Thu Sep 08 22:14:00 2016 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 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
@@ -22,10 +22,11 @@
*/
/*
- *@test
- *@bug 6442006 8008577
- *@summary Test case for verifying timezone display name for Asia/Taipei
- *@run main/othervm -Djava.locale.providers=JRE,SPI Bug6442006
+ * @test
+ * @bug 6442006 8008577
+ * @modules jdk.localedata
+ * @summary Test case for verifying timezone display name for Asia/Taipei
+ * @run main/othervm -Djava.locale.providers=JRE,SPI Bug6442006
*/
import java.util.Locale;
--- a/jdk/test/sun/util/resources/cldr/Bug8134250.java Thu Sep 08 21:11:54 2016 +0000
+++ b/jdk/test/sun/util/resources/cldr/Bug8134250.java Thu Sep 08 22:14:00 2016 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 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
@@ -24,6 +24,7 @@
/*
* @test
* @bug 8134250 8134520
+ * @modules jdk.localedata
* @summary Tests CLDR/LDML features are correctly reflected in JDK.
* @run main/othervm -Djava.locale.providers=CLDR Bug8134250
*/
@@ -31,10 +32,15 @@
// Note this test highly depends on a particular version of CLDR. Results
// may vary in the future.
-import java.time.*;
-import java.time.chrono.*;
-import java.time.format.*;
-import java.util.*;
+import java.time.LocalDate;
+import java.time.Month;
+import java.time.ZoneId;
+import java.time.chrono.Chronology;
+import java.time.format.DateTimeFormatter;
+import java.time.format.DateTimeFormatterBuilder;
+import java.time.format.FormatStyle;
+import java.time.format.TextStyle;
+import java.util.Locale;
public class Bug8134250 {
public static void main(String [] args) {
--- a/jdk/test/sun/util/resources/cldr/Bug8145136.java Thu Sep 08 21:11:54 2016 +0000
+++ b/jdk/test/sun/util/resources/cldr/Bug8145136.java Thu Sep 08 22:14:00 2016 +0000
@@ -25,6 +25,7 @@
/*
* @test
* @bug 8145136
+ * @modules jdk.localedata
* @summary Tests CLDR 28/29 newly added feature LikelySubtags is correctly reflected in JDK.
* @run main/othervm -Djava.locale.providers=CLDR Bug8145136
*/
--- a/jdk/test/tools/pack200/Pack200Test.java Thu Sep 08 21:11:54 2016 +0000
+++ b/jdk/test/tools/pack200/Pack200Test.java Thu Sep 08 22:14:00 2016 +0000
@@ -21,6 +21,14 @@
* questions.
*/
+ /*
+ * @test
+ * @bug 6521334 6712743 8007902 8151901
+ * @summary test general packer/unpacker functionality
+ * using native and java unpackers
+ * @compile -XDignore.symbol.file Utils.java Pack200Test.java
+ * @run main/othervm/timeout=1200 -Xmx1280m -Xshare:off Pack200Test
+ */
import java.util.*;
import java.io.*;
@@ -28,17 +36,6 @@
import java.lang.management.MemoryMXBean;
import java.util.jar.*;
- /*
- * @test
- * @bug 6521334 6712743 8007902
- * @key intermittent
- * @summary check for memory leaks, test general packer/unpacker functionality\
- * using native and java unpackers
- * @compile -XDignore.symbol.file Utils.java Pack200Test.java
- * @run main/othervm/timeout=1200 -Xmx1280m -Xshare:off Pack200Test
- * @author ksrini
- */
-
/**
* Tests the packing/unpacking via the APIs.
*/
@@ -48,6 +45,9 @@
static final MemoryMXBean mmxbean = ManagementFactory.getMemoryMXBean();
static final long m0 = getUsedMemory();
static final int LEAK_TOLERANCE = 21000; // OS and GC related variations.
+ // enable leak checks only if required, GC charecteristics vary on
+ // platforms and this may not yield consistent results
+ static final boolean LEAK_CHECK = Boolean.getBoolean("Pack200Test.enableLeakCheck");
/** Creates a new instance of Pack200Test */
private Pack200Test() {}
@@ -60,9 +60,11 @@
}
private static void leakCheck() throws Exception {
+ if (!LEAK_CHECK)
+ return;
long diff = getUsedMemory() - m0;
System.out.println(" Info: memory diff = " + diff + "K");
- if ( diff > LEAK_TOLERANCE) {
+ if (diff > LEAK_TOLERANCE) {
throw new Exception("memory leak detected " + diff);
}
}
@@ -126,7 +128,7 @@
/**
* @param args the command line arguments
*/
- public static void main(String[] args) throws IOException {
+ public static void main(String[] args) throws Exception {
// select the jars carefully, adding more jars will increase the
// testing time, especially for jprt.
jarList.add(Utils.createRtJar());
Binary file jdk/test/tools/pack200/pack200-verifier/data/golden.jar has changed